Posts

Showing posts from January, 2014

Mailbag: Christian Right, Part 2

Mailbag: Christian Right, Part 2 1.Mailbag: Christian Right, Part 2 Description:25-09-2011 · From: "Jennifer" Subject: Re: Atheism I am eager to see you, with all of your information and determination to do away with the "religious right," get into ... 2.Mailbag: Christian Right, Part 3 - About.com Agnosticism / Atheism Description:02-10-2011 · Mailbag: Christian Right, Part 3. By Austin Cline ... More selections from the Agnosticism / Atheism Mailbag... Comments (5) See All ... 2006 at 2:59 pm ... 3.Liars in the Christian Right Wing (Part 2) - YouTube Description:Liars in the Christian Right Wing (Part 2) Profmth Mitch ... 9:35 Maniacs' Mailbag 3 by Profmth Mitch 3,259 views; 10:54 Re: Richard Dawkins, Insults, ... 4.CrEvo Rant #19: Mailbag, part 2 - Today's Christian Videos Description:02-10-2010 · ... Mailbag, part 2, Today's Christian Videos ... Mailbag, part 2 on Godtube.com the largest video sharing pl

Mfecane -- What Was the Mfecane

Mfecane -- What Was the Mfecane 1.Mfecane - Wikipedia, the free encyclopedia Description:Mfecane (Zulu: [m&#809;f&#603;&#712;k&#448;a&#720;ne] crushing or scattering), also known by the Sesotho name Difaqane or Lifaqane, was a period of widespread chaos and warfare among ... 2.Mfecane Description:Introduction Mfecane Mfecane, period of upheaval in southern Africa in the early decades of the 19th century, characterized by widespread warfare between chiefdoms ... 3.Mfecane (African history) -- Encyclopedia Britannica Description:MLA style: "Mfecane". Encyclopædia Britannica. Encyclopædia Britannica Online. Encyclopædia Britannica Inc., 2014. Web. 14 Jan. 2014 < http://www.britannica.com ... 4.Mfecane -- What Was the Mfecane - About.com African History Description:A explanation of the term Mfecane and why the subject is controversial. 5.Mfecane - History-Other Description:Full version Mfecane Mfecan
1.#EANF# Description:#EANF# 2.#EANF# Description:#EANF# 3.#EANF# Description:#EANF# 4.#EANF# Description:#EANF# 5.#EANF# Description:#EANF# 6.#EANF# Description:#EANF# 7.#EANF# Description:#EANF# 8.#EANF# Description:#EANF# 9.#EANF# Description:#EANF# 10.#EANF# Description:#EANF#

This Day in African History: November 15

This Day in African History: November 15 1.This Day in African History: November 15 Description:1902, 15 November An assassination attempt on Belgium King Leopold II by Gennaro Rubin is foiled. 1942, 15 November - World War II: North Africa 2.This Day in African History: November Description:A chronicle of events in African history on 15 November. This Day in African History: November 16 A chronicle of events in African history on 16 November. 3.This Day in History: November 15 | Infoplease.com Description:History; Geography; Buildings & Structures; Disasters; ... November 15: Yesterday Tomorrow: 1763. ... or choose another day: 4.This Day | History Description:This Day; Topics. History of South Africa; History of WW2; ... 15 November - Brazil's last Emperor deposed. ... This day in history. prev; 5.This Day | History - History.co.uk | Shows, Videos, Topics and ... Description:This Day; Topics. History of South Africa; H

Ancient Egypt by Barry Kemp

Ancient Egypt by Barry Kemp 1.Barry Kemp (Egyptologist) - Wikipedia, the free encyclopedia Description:Publications . Barry Kemp (2005). Ancient Egypt: Anatomy of a Civilisation (2nd Edition ed.). Routledge. ISBN 0-415-23550-2. Barry Kemp (2005). 2.Book Review: Ancient Egypt by Barry Kemp - African History ... Description:Barry Kemp is a consummate teacher. Reading his text is like being shown through a dark Egyptian tomb, the archaeologist's lamp illuminating the walls as you proceed ... 3.Ancient Egypt: Anatomy of a Civilization: Barry J. Kemp ... Description:Ancient Egypt: Anatomy of a Civilization [Barry J. Kemp] on Amazon.com. *FREE* shipping on qualifying offers. This comprehensive survey of Egyptian society and ... 4.Excavating Amarna - Archaeology Magazine Archive Description:Barry Kemp tells about recent work and discoveries at the royal city of the pharaoh Akhenaten. Beginning in November, Philadelphia will host "Amarna
1.#EANF# Description:#EANF# 2.#EANF# Description:#EANF# 3.#EANF# Description:#EANF# 4.#EANF# Description:#EANF# 5.#EANF# Description:#EANF# 6.#EANF# Description:#EANF# 7.#EANF# Description:#EANF# 8.#EANF# Description:#EANF# 9.#EANF# Description:#EANF# 10.#EANF# Description:#EANF#

Ujamaa -- What was Ujamaa and how did it affect Tanzania?

Ujamaa -- What was Ujamaa and how did it affect Tanzania? 1.Ujamaa -- What was Ujamaa and how did it affect Tanzania? Description:What was Ujamaa and how did Nyerere's social and economic policy affect Tanzania in the 1960s and 70s? 2.Ujamaa | Fundstellen im Internet | cyclopaedia.net Description:Fundstellen zu "Ujamaa" im ... What was Ujamaa and how did it affect Tanzania? ... evaluate African socialism with the reference to Ujamaa policies of Tanzania. 3.Nyerere's Tanzania - Understanding Socialism Description:... was the first president of independent Tanzania ... Ujamaa. Nyerere served as ... What was Ujamaa and how did it affect Tanzania? 4.The Contribution of Ujamaa to Development in Tanzania Description:The Contribution of Ujamaa to Development in Tanzania ... of all decisions which affect his life ... which Nyerere's ujamaa did in this respect ... 5.Ujamaa: A Commentary on President Nyerere's Visio

database - comparing a string value returned from ToArray() method in c# -

following code written me searching specific item name in advertisement table. public actionresult searchresult(string name) { var advertisement = db.advertisements.toarray(); // retrieve data database foreach (var ad in advertisement) { if (ad.title.equals(name)) { return view(ad); } } return view(advertisement); } even though search item in database, in cases if condition not being true.each time whole list of items result in view page. issue here? my model advertisement looks this. using system; using system.drawing; // image type in namespace using system.collections.generic; using system.linq; using system.web; using system.componentmodel.dataannotations; namespace bartering.models { public class advertisement { [key] public int id { get; set; } [required] [stringlength(100)] public string title { get; set; } public guid ownerid { get; set; } [r

c++ - Using non-static objects in jni in java -

i trying learn jni, , wondering how make java object have values associated in jni c++ layer. have java code. public class test { static { runtime.getruntime().loadlibrary("jnitests"); } public native void setvalue(int value); public native int getvalue(); public static void main(string[] args) { test test1 = new test(); test1.setvalue(34); test test2 = new test(); test2.setvalue(23); system.out.println(test1.getvalue()); } } so trying enable each test object store value in jni using setvalue , getvalue, using c++ code. #include <jni.h> #include "test.h" int value; jniexport void jnicall java_test_setvalue(jnienv *, jobject, jint newvalue) { value = newvalue; } jniexport jint jnicall java_test_getvalue(jnienv *, jobject) { return value; } however, problem when use setvalue on test2 , print test1's value has changesd set test2 to. how fix this. tried mapping

Android Java - reading dictionary assets -

this might duplicated thread after trying out several , multiple threads problem still continues :/ i have method reads dictionary , decryption . , have no idea how read dictionary . drag , dropped dictionary assets folder , used code . try { system.out.println("dictionary initialize"); bufferedreader inputreader; fileinputstream fis = new fileinputstream("/assets/dictionary-english.txt"); bufferedreader dictionary = new bufferedreader(new inputstreamreader(fis)); string checktext; while ((checktext = dictionary.readline()) != null) { dictionaryset.add(checktext); } system.out.println("dictionary initialized"); } catch (ioexception ex) { system.out.println("error! reading!"); } after several test , have confirmed not reach while loop try , catch catches error . caught ioexception error . idea how fix ? thanks this error log cat

ruby on rails - Could not find Heroku <> = 0 Windows 7 -

heroku working stops today. when try run heroku logs there error comming out. c:/railsinstaller/ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247: in `to_specs': not find heroku (>= 0) amongst [actionmailer-3.2.13, action pack-3.2.13, activeadmin-0.6.1, activeadmin-mongoid-0.2.0, activemodel-3.2.13, ctiverecord-3.2.13, activeresource-3.2.13, activesupport-3.2.13, arbre-1.0.1, ar el-3.0.2, bcrypt-ruby-3.1.2-x86-mingw32, bourbon-3.1.8, bson-1.9.2, bson_ext-1.9 .2, builder-3.0.4, bundle-0.0.1, bundler-1.3.4, coffee-rails-3.2.2, coffee-scrip t-2.2.0, coffee-script-source-1.6.3, devise-3.0.2, erubis-2.7.0, execjs-2.0.2, f araday-0.8.8, font-awesome-rails-3.2.1.3, font_assets-0.1.10, formtastic-2.2.1, has_scope-0.6.0.rc, hashie-2.0.5, hike-1.2.3, httpauth-0.2.0, i18n-0.6.1, inheri ted_resources-1.4.1, journey-1.0.4, jquery-rails-2.3.0, json-1.8.0, jwt-0.1.8, k aminari-0.14.1, mail-2.5.4, meta-tags-1.5.0, meta_search-1.1.3, mime-types-1.25, mongoid-3.0.23, moped-1.5

java ee - Invoke batch job from EJB -

i trying invoke batch job ejb. batch job based on javax.batch-api-1.0.jar, not spring. in ejb, use following lines invoke batch job: joboperator joboperator = batchruntime.getjoboperator(); properties props = new properties(); long execid=joboperator.start("mybatch-job", props); however, failed. debug shows batchruntime.getjoboperator() returns null. tell me why invocation failed? thanks. ===== problem should failed inject joboperator ejb. don't know how fix it. tried using @inject, @inject joboperator joboperator; ... properties props = new properties(); joboperator.start("mybatch-job", props); and add jobproducer class: @named public class jobproducers { @produces @default public joboperator getjoboperator() { return batchruntime.getjoboperator(); } } however, still doesn't work.

html - How to properly add divs inside another div so the original design doesn't break? -

Image
i have basic html: <div id="views-container"> <div id="html-container"></div> <div id="original-page-container"></div> <div id="result-page-container"></div> </div> this css divs: #views-container > div{ height:90%; width:33%; display:inline-block; } #html-container{ background-color: pink; } #original-page-container{ background-color: yellow; } #result-page-container{ background-color: gray; } this final output: but want add 2 divs inside html-container , this: <div id="views-container"> <div id="html-container"> <div id="html-content-area"> <textarea id="outputhtml"></textarea> </div> <div id="html-info-area"> bla bla bla </div> </div> </div> when this, how

sql - Can connect with PERL but can't query MSSQL 2k8 database -

i able connect mssql server getting permission error when trying query database. see "yay" in script below, error: *[microsoft][odbc sql server driver][sql server]the select permission denied on object 'ticket_types', database 'dbname', schema 'dbo'. (sql-42000)(dbd: st_execute/sqlexecute err=-1)* if add "domain\domain users" dbo access works, when take away doesn't. think it's connecting database logon user, not sql user set in connect string not positive. the sql driver set use "with sql server authentication using login id..." , not "windows nt..." classic asp connects , queries fine. can access/query db using sql account in connect string via asp classic , sql server management studio. it may relevant works against sql2005 not sql2008 trying upgrade to. fine our upgrade except our couple perl scripts don't tables. use lib "cgi-bin"; use dbi; use cgi; use cgi::carp qw(f

gcc - linux linker: '-lpng' inhibits '-lz'? -

on ubuntu-13.04, got error when building executable shared libraries, using gcc-4.7.3 provided linux distribution. i guess problem between libpng , zlib (the former uses latter), don't know why. first, command is: $ gfortran -o test_muesli_config_fml test_muesli_config_fml.o -fopenmp -wl,--rpath,/usr/local/lib/muesli /usr/local/lib/muesli/libfml.so -lstdc++ -wl,--rpath,/usr/lib /usr/lib/liblapack.so -wl,--rpath,/usr/lib /usr/lib/libblas.so -lpng -lz -lpthread -lreadline -lhistory which gives following error: /usr/local/lib/muesli/libfml.so: undefined reference `gzwrite' /usr/local/lib/muesli/libfml.so: undefined reference `gzopen' /usr/local/lib/muesli/libfml.so: undefined reference `gzclose' /usr/local/lib/muesli/libfml.so: undefined reference `gzread' collect2: error: ld returned 1 exit status but note -lz present. after that, added linker option --trace-symbol= in order more information: $ gfortran -o test_muesli_config_fml test_muesli_config

javascript - Has some problems with convering JS code -

i found interesting article here http://vk.com/away.php?utf=1&to=http%3a%2f%2ftympanus.net%2ftutorials%2fanimatedbordermenus%2findex3.html , tried apply on site. i found problem in conficting modernize + classie vs jquery decided convert code that: before: function init() { var menu = document.getelementbyid( 'bt-menu' ), trigger = menu.queryselector( 'a.bt-menu-trigger' ), // triggerplay demo 6 triggerplay = document.queryselector( 'a.bt-menu-trigger-out' ), // event type (if mobile use touch events) eventtype = mobilecheck() ? 'touchstart' : 'click', resetmenu = function() { classie.remove( menu, 'bt-menu-open' ); classie.add( menu, 'bt-menu-close' ); }, closeclickfn = function( ev ) { resetmenu(); overlay.removeeventlistener( eventtype, closeclickfn ); }; var overlay = document.createelem

persistence - Saving a Javascript variable for later usage? -

i wondering if there way save 1 or more javascript variables local machine , call on them later? var = b and when go webpage remembers value b was? what looking how make , use cookies . a cookie variable stored on visitor's computer. each time same computer requests page browser, send cookie too. javascript, can both create , retrieve cookie values.

c - Find the common nodes of two intersecting linked lists -

i asked in interview if have 2 linked list intersect in more 1 node how can find common nodes in linked list meet. find solution minimum complexity. e.g. ![linked list example][1] linked list 1 = 11->12->13->14->15->16->17->54 linked list 2 = 23->24->13->26->14->15->35->16->45 i answered him can store addresses of 1 linked list in hashmap , compare every node's address in second list hashmap. way can achieve o(n) complexity. interviewer not satisfied. please suggest better solution. in advance. it can achieved in better way listen if 2 linked list intersecting @ node can traverse ones both list find length of each list move pointer of 1 list upto distance between 2 &then move both pointer simultaneouly int way whenever u node both pointers equal.. given 2 singly linked list, find if intersecting. in single iteration. a. traverse list1 , find last element b. traverse list2 , find last element

Android: Device Unique Hardware -

is possible develop applications android take advantage of unique hardware? more clear, example galaxy s4. phone has many hardware inputs , outputs not standard android model, such thermometer, ir led, humidity sensor, , "air view" features (not sure hardware called). is possible develop third party apps take advantage of these? if how difficult it? i have searched topic , can't seem find relevant. is possible develop applications android take advantage of unique hardware? that impossible answer in abstract. is possible develop third party apps take advantage of these? a thermometer , humidity sensor part of android sdk. welcome use sensormanager those, assuming samsung exposing sensors through sensormanager . with respect ir emitter, "air view", etc., possible of available through a proprietary samsung sdk .

More than 4 column for content in TYPO3 6.x.x -

is there way add more column typo3? in past used add additional column in exttables.php ( http://www.lacisoft.com/blog/2009/11/06/additional-columns-in-typo3s-web-page-module/ ), since typo3 6.x.x mod.shared.colpos_list no longer support, in backend see 4 standard column , nothing else... any sugestions, manuals? i have found solution - beckend layout - , tutorial on http://blog.sebastiaandejonge.com/articles/2012/july/26/implementing-typo3s-backend-layouts/ site

python - Can I assign a function to a variable for use within another function? -

i want know if can create function within it's arguments can define function use else? eg: def askquestion(functionname): userinput == str(input("are sure want run this? <y/n> ")) if userinput = "y": functionname() elif userinput == "n": print("returning main menu") else: print("that not valid input!") i dont know if explained if me out great. yes, can. pass in function object: def foo(): # foo def bar(): # bar askquestion(foo) # run foo when `y` typed. python functions first-class objects, assigned whatever name defined begin can bind them other names too. you can, example, store them in mapping, functions in mapping based on variable altogether: map = { 'spam': foo, 'eggs': bar, } askquestion(map[anothervar]) within askquestion , functionname bound whatever function object passed in. adding () after name invokes function.

sorting array in mips (assembly) -

im in class learning assembly using mips. working on sorting array of numbers , think have method working correctly, bit of trouble. not know how check when im sorted fully. im using pretty rudimentary method sorting, have learned far. also, not know how output numbers check see if sorted. im used java , such assembly kinda throwing me spin. here code far: .text .globl main main: la $a0, array # sets base address of array $a0 loop: lw $t0, 0($a0) # sets $t0 current element in array lw $t1, 4($a0) # sets $t1 next element in array blt $t1, $t0, swap # if following value greater, swap them addi $a0, $a0, 4 # advance array start @ next location last time j loop # jump loop can compare next 2 elements swap: sw $t0, 4($a0) # store greater numbers contents in higher position in array (swap) sw $t1, 0($a0) # store lesse

android - Send a Bundle over the network -

i'm trying send bundle on network 1 device using objectinputstreams , such. problem bundle not serializable . there simple way make happen? want use bundle because can sending sorts of types (string, int, parcelables, lists, etc) you should not serialize bundle, because not guarantee version compatibility. if can make sure every device uses exact same version should fine. not recommend this. every api states should not done! parcel not general-purpose serialization mechanism. class (and corresponding parcelable api placing arbitrary objects parcel) designed high-performance ipc transport. such, not appropriate place parcel data in persistent storage: changes in underlying implementation of of data in parcel can render older data unreadable. https://developer.android.com/reference/android/os/parcel.html but if want it, here way implement it: bundle in = ...; outputstream os = ... parcel p = parcel.obtain(); //create empty parcel object in.writ

java.util.scanner - Java scanner searches same pattern twice -

i expect following code find tokens of pattern available. parse shell command iwlist wlp3s0 scanning , there more 1 access point (repeating pattern). need parse them somehow. scanner s = new scanner(commandoutput); string pattern = ".*?address: (\\s*) .*?channel:(\\d*) .*?frequency:(\\s*) .*?quality=(\\d*)/(\\d*) .*?signal level=-(\\d*)"; //s.findinline(pattern); while(true){ s.findinline(pattern); matchresult result = s.match(); (int = 1; <= result.groupcount(); i++) { system.out.println(result.group(i)); } } but throws exception: java.lang.illegalstateexception . how check if has more matches while iterating through loop instead of while(true) , exception? the issue match() method: public matchresult match() returns match result of last scanning operation performed scanner. method throws illegalstateexception if no match has been performed, or if last match not successful

objective c - Error "Application windows are expected to have a root view controller" (iOS) -

Image
i've created blank iphone app project , show full-screen advertisement during app launch. i tried install ad following guideline: https://github.com/mopub/mopub-ios-sdk/wiki/interstitial-integration-for-ios that's i've done finally: actually codes copied previous link. however, error shows when app runs: application windows expected have root view controller @ end of application launch i think error may related loadview method, because if remove loadview method, error disappeared. in fact, error seems common can searched on internet, don't know how loadview related it, , how can solved in case. any solutions? lot. you need this: add #import "viewcontroller.h" to top of appdelegate.m and in appdelegate.m, application:didfinishlaunchingwithoptions: method should have code this. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // ... other code /

python - Testing a Tkinter Button object with an if statement -

i working on program needs gui buttons things, case when having questions buttons, have ran difficulties because while can activate functions buttons, cannot test wether being pressed if statement. know how use check buttons , radio buttons, have not found else remotely useful. need able tell how long pressed, , things being pressed stop when released. need way of assigning variable true while still holding click down on button, , false other time, normal button, not 1 toggles each time press. it's not clear me you're having trouble with, took liberty of coding little gui times how long button pressed. import tkinter tk import time class buttontimer: def __init__(self, root): self.master = root self.button = tk.button(self.master, text="press me") # notice haven't assigned button command - we're going bind mouse events instead of using built in command callback. self.button.bind('<buttonpress>', self.p

Get dataset Item on Condition using c# -

i have dataset : itemname |categoryname ------------------ item1 | category1 item2 | category1 item3 | category4 item4 | category5 item5 | category1 i want category name item. you can either set filter property of datatable or use linq query or loop through rows until find 1 containing wanted item.

java - Method similar to Scanner.hasNext for ObjectInputStream -

i reading .dat file unknown amount of objects within it. want loop through file using .readobject() method. there way can determine amount of times read file similar way .hasnext() method works scanner? for example, use while loop hasnext() parameter. while (scfile.hasnext()){ x = scfile.nextint(); } thanks in advance. just read stream until eofexception thrown. method looking not exist.

elasticsearch - Multi Terms search NEST C# -

i want search matching multiple values ( array of values ) : var result1 = _client.search<type1>(s => s .fields(f => f.trip_id) .query(q => q .terms(t => t.arg1, value1)).take(_alldata)) .documents.select(d => d.arg2).toarray(); var result2 = _client.search<type2>(s => s .query(q => q .terms(t => t.arg3, result1)) .take(_alldata) ).documents.select(s => s.ar3).tolist(); how can ? thinking facets don't see how can it. way works foreach iterator not effective... thanks help. you can express multiple queries so: .query(q=>q.terms(t=>t.arg3, result1) && q.terms(t=>t.arg1, value1)) be sure read documentation on writing queries discover stuff nest has offer.

if statement - Weird if elseif logic in PHP -

i have page displays html based on query string loaded in url. here sample of code. <?php // grab querystring section $w = getquerys('section'); if ($w == "main") {?> display html version one <? } else if ($w == 'types') {?> display html version two <?php } ?> for reason, logic works fine on web hosting site, not on workstation using xampp. when run on workstation, both html version 1 , tow displayed @ same time on page. i'm afraid i'm @ bit of loss this. i've confirmed getquerys function works fine echoing out $w variable. thanks in advance can provide. you mixing php shorts tags long tags. expect xampp doesn't have short tags enabled, change following line: <?php } else if ($w == 'types') {?>

Calling C++ function from Excel and VBA using DLL created in C++ -

i created dll containing function named "koduj". calling function using inside excel worksheet cell returns desired result. calling "koduj" vba returns wrong answer. koduj needs 2 arguments: string nr_id , integer x1 . calculates sum of nr_id 's letters in ascii representation , adds x1 . calculated sum returned. i following instructions found here . here's .cpp sourcefile: #include<windows.h> #include<string> using namespace std; //convert bstr wstring convenience wstring bstr_to_wstring (bstr text){ return wstring(text, sysstringlen(text)); } //calculate sum of letters in ascii representation int ascii_sum (wstring ws){ int sum = 0; (unsigned int = 0; < ws.length(); i++) sum += ws[i]; return sum; } //"koduj" function int _stdcall koduj (bstr nr_id, int & x1){ wstring ws_nr_id = bstr_to_wstring(nr_id); return ascii_sum(ws_nr_id) + x1; } here's vba function declaration: dec

c# - Setting nhibernate property-ref on one-to-many to property other than primary key fails -

i receiving exception when set property-ref in xml file. initializing[domain.entities.r#12345]-failed lazily initialize collection of role: domain.entities.r.lp, no session or session closed lp.hbm.xml ---------- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="domain.entities" assembly="domain"> <class name="lp" table="lp"> <id name="id"> <column name="id" sql-type="int" not-null="true"/> </id> <property name="anotherfield"/> <property name="paymentdate"/> <property name="paymentamount"/> </class> </hibernate-mapping> r.hbm.xml --------- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="domain.entities&q

c++ - Exception handling before deleting dynamic memory in a function -

i allocated dynamic memory , clearing memory @ end of function using delete operator. have exception handling before delete. how can avoid memory leak in situation. use std::unique_ptr or similar hold heap-allocated memory. deallocated automatically when smart pointer goes out of scope, whether or not exception thrown.

parsing - Lua string manipulation pattern matching alternative "|" -

is there way can string pattern match "ab|cd" matches either "ab" or "cd" in input string. know use "[ab]" pattern , match either "a" or "b" , works 1 letter stuff. note actual problem lot more complicated, need know if there or thing in lua's string manipulation. want put other patterns on each sides of or thing, , etc. if works "hello|world" , matches "hello, world!" both "hello" , "world" it's great! just expand on peterm's suggestion, lpeg provides re module exposes similar interface lua's standard string library while still preserving power , flexibility offered lpeg. i try out re module first since syntax bit less esoteric compared lpeg. here's example usage can match hello world example: dump = require 'pl.pretty'.dump re = require 're' local subj = "hello, world! padding world1 !hello hello hellonomatch no

Wordpress links pointing to the wrong domain -

in wordpress, how can change links pointing without changing server name or adding redirection? my main site rails app @ www.example.com. i have wordpress blog on separate server @ blog.example.com/blog i have reverse proxy on primary (rails) server takes url ends in /blog/ , serves blog content. (that's behind scenes -- user never sees blog.example.com domain) currently, can access blog via reverse proxy @ www.example.com/blog, problem urls on blog point blog.example.com/blog (wrong) instead of www.example.com/blog (right). i've tried changing urls in wp-config.php, whenever change breaks something. i figured out. here's did. 1) got rid of bitnami wordpress image (on amazon) , reinstalled wordpress fresh, scratch, on ec2. bitnami had bunch of magic behind scenes making hard me figure out going on. 2) via wordpress admin changed site address (url) http://blog.example.com/blog http://www.example.com/blog previously, had been changing in wp-config

How to pass argument in a different way in Android/Java? -

i'm building android app in implement supertype method of activity called oncheckedchanged(compoundbutton buttonview, boolean ischecked) follows: @override public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { if (ischecked){ linearlayout view = (linearlayout) findviewbyid(r.id.some_view); animation anim = expand(view, true); view.startanimation(anim); } else { linearlayout view = (linearlayout) findviewbyid(r.id.some_view); animation anim = expand(view, false); view.startanimation(anim); } } and method set listen switch in oncreate method this: myswitch = (switch) findviewbyid(r.id.my_switch); myswitch.setoncheckedchangelistener(this); the thing want implement method not some_view , couple other views. since don't want copy/paste method couple times , change some_view need way of passing view. since i'm overriding method however, cannot add argument method. since set listen

iOS JSON POST not accepted by php -

unfortunately have been searching fix (or reason) 7 hours , have conceded need help. i have started rewriting application ios (from android) , stuck json in ios. my json post action; nsstring *post = [[nsstring alloc] initwithformat:@"{'firstname':'%@' 'surname':'%@' 'yob':'%@' 'gender':'%@' 'hometown':'%@' 'phone':'%@' 'email':'%@' 'deviceid':'%@' 'regid':'%@' 'phonetype':'%@'}",[_firstname text],[_surname text],[_yob text],[_gender text],[_hometown text], [_phoneno text],[_email text],[_deviceid text],[_regid text],[_phonetype text]]; nslog(@"postdata: %@",post); nsurl *url=[nsurl urlwithstring:@"***"]; nsdata *postdata = [post datausingencoding:nsasciistringencoding]; nsstring *postlength = [nsstring stringwithformat:@"%d", [postdata length]];

loops - Fix ssh line for Xpra bash script -

im writting small script starting 'xpra' session remote machine. i'm pretty new bash scripting, wondering if me clean code bit, concerning best practices. the ssh line 1 i'm having problems with, must ctrl-c on keyboard command killed , let continue echo "done" . how can fix minor issue? ### ### # syntax: xpra.sh hostmachine command # ## ### ## wake on lan host machine. ~/scripts/$1 ## check if online , ssh command. ## attach xpra client. while :; ping -c 1 $1 if [ $? -eq 0 ]; ssh $1 "xpra start :7 && sleep 2 && ("display=:7 $2"&) "; echo "done"; sleep 5; echo "attaching"; (xpra attach ssh:$1:7 &); break; else echo "host offline"; slee

css - A Few Questions About Label Tags -

how can make text displayed label tag bold? i want 2 labels same tag, second directly below first. what's way this? how can choose size of text of label? sorry if of these obvious, documentation wasn't helpful. thanks! you can make class sets font-weight , font-size in , use in f.label's class. for example, in css, have: .mylabel { font-weight: bold; font-size: 20px; } and inside html.erb, you'd have css class made in it, so... <%= f.label :first_name, class: 'mylabel' %>:

php - foreach stdClass object converted to string -

i working response api returns data in json in straight forward structure. pseudo structure best represented as: services -> service -> options -> option -> suboptions -> option as decoded json, of these stdclass objects. have number of foreach statements iterating through various services , options, work without issue. however, when use foreach statement @ suboption level, object serialized string. information suboptions has structure this. [suboptions] => stdclass object ( [option] => stdclass object ( [code] => some_code [name] => name ) ) when using foreach such (where $option option in services -> service -> options -> option ): foreach($option->suboptions->option $suboption) { print_r($suboption); } it outputs some_codesome name not expected stdclass object ( [code] => some_code [name] => name ) i not aware of reasons foreach in terms of depth or

Specific conversion of EBNF into BNF -

<a> ::= <b> x {<b> <d>} y <b> <b> ::= <c> (w|z) <c> <d> <c> := m [n] <d> <e> <d> := q | null <e> := p | null how convert ebnf bnf? different people use different syntax ebnf, , i'm not sure 1 using. grammar in ebnf ( iso/iec 14977: 1996(e) ) this: a = b, "x", {b, d}, "y", b; b = c, ("w" | "z"), c, d; c = "m", ["n"], d, e; d = ["q"]; e = ["p"]; assuming use null empty string. notice further simplified. some productions must added convert bnf: { expr } can replaced inserting production p := empty | expr p empty represents empty string. [ expr ] can replaced inserting p := empty | expr . any expression ( expr ) can replaced adding new production p := expr . so this: a -> b x f y b f -> empty | b d f b -> c g c d g -> w | z c -> m h d e h -> empty | n d -> q | empt

css - Is it legal to position an at-rule inside a style block? -

the following valid css: @media print { .no_print { display: none; } } h1 { font-family: verdana, arial, sans-serif; font-size: 13px; font-weight: bold; margin-bottom: 12px; } in following have placed @media statement inside h1 style block. valid css? googling, find examples of @media statements being placed inside 1 another. lack sufficient familiarity terminology of css refine search terms further in hope of answering question. h1 { font-family: verdana, arial, sans-serif; font-size: 13px; font-weight: bold; margin-bottom: 12px; @media print { font-weight: normal; } } no, not valid. generally, at-rules (rules begins @ ) allowed @ start of style sheet only, general css principles. however, @media , @page rules allowed elsewhere, too, between rules , not inside rule. rule construct consists of list of selectors , set of declarations between braces, e.g. h1 { color: blue; line-height: 1 } . browser

c++ - extra data elements in a union structure -

i'm trying encode relatively complex message union structure can generate array of uint8_t can feed serial communications protocol. however, when looking @ array generated when union filled data, uint8_t element appears after command type element. please see union structure below: union myint16_t{ uint16_t ui16; int16_t i16; uint8_t data[2]; }; union { struct { uint8_t commandtype; myint16_t upperlimits[4]; myint16_t lowerlimits[4]; myint16_t jointzeros[4]; int8_t jointpolarity[4]; myint16_t p[4]; myint16_t i[4]; myint16_t d[4]; }; uint8_t data[53]; }; as can see there second anonymous union references union myint16_t. if fill values of anonymous union , print out underlying data[53] array, second value (data[1]) 0 , not part of first element of upperlimits[4]. please see code fill union , print out elements. char q = 'c'; hmmv4_configmsg msg; msg.co

java - Method deepHashCode of Arrays class on two dimensional array -

i have problems understanding behavior of arrays.deephashcode on int[][] . assume program easy enough read. , b has equal hash expected. d different rest. reason c equal , b. c transpose of arraya (and arrayb), may coincidence , not reason same hash code returned. am not supposed use method on int[][] ? suggestions of way make own hashcode int[][] returns equal integer if , if each element in each subarray equal each other (same position, same length...like deep cloned) import java.util.arrays; public class test{ public static void main(string[] args){ int[][] arraya = new int[][]{ {1,2,3}, {4,5,6}, {7,8,9} }; int[][] arrayb = new int[][]{ {1,2,3}, {4,5,6}, {7,8,9} }; int[][] arrayc = new int[][]{ {1,4,7}, {2,5,8}, {3,6,9} }; int[][] arrayd = n

jQuery Datepicker icon showing below the input box instead of on the right -

i started using jquery datepicker , have problem. got calendar icon showing it's being shown below input box instead of right. since calendar icon called jquery code, option use display inline? here's relevant code. thanks. <script> $(function() { $( "#datepicker" ).datepicker({ showon: "button", buttonimage: "calendar_icon.gif", buttonimageonly: true, buttontext: "open calendar" }); }); </script> date: <input type="text" id="datepicker" /> since don't mention css, i'm guessing that's problem is. need add ui-datepicker-trigger class css file. automatically assigned function don't need change input include class="ui-datepicker-trigger". copy , pasted i'm using in 1 of css files. part need display: inline part figure might use out of whole thing. .ui-datepicker-trigger { display: inline; padding:0px; paddi

html - Get selected text from dropdown in PHP -

i totally new in php, in fact reason doing customize wordpress plugin can fit need. far have default form, doing add country dropdown. here's how add it <div class="control-group"> <label class="control-label" for="country">country :</label> <div class="controls"> <select id="itemtype_id" name="cscf[country]" class="input-xlarge"> <option value="malaysia@email.com">malaysia</option> <option value="indonesia@email.com">indonesia</option> </select> <span class="help-inline"></span> </div> </div> so far able retrieve value of selected item $cscf['country']; how can display text country name in case ? you can use hidden field, , javascript , jquery can set value field, when selected value of dropdown changes.

c# - WPF RichTextBox increase grid row size -

i have following xaml <grid> <grid.rowdefinitions> <rowdefinition height="auto"/> <!--here expander richtextbox within--> <rowdefinition height="auto"/> <!--here splitter--> <rowdefinition height="*"/> <!--here other controls--> </grid.rowdefinitions> ... the problem when expander open , richtextbox fills text rows automatically increase heigth expander , grid row height, way items on bottom row sliding down. i want have bottom grid row height independent richtextbox. can without binding richtextbox height expander or top row height? thank you. you add 1 more row grid, , define minheight row. set datagrid vertical alignment stretch verticalalignment = stretch . set default height size window.

taglib - How to access component properties from a Java Class -

i working on component requires properties (that user sets during run time) work intended. initially, using properties.get('foo') fetch needed property component, i'm trying remove traces of script-let code component jsp file. how fetch property 'foo' (which set during runtime on component) within java code? remember reading somewhere using valuemap best way, tried using this:- public static map<string, object> getresourceproperties(string path, slinghttpservletrequest request) { resourceresolver resourceresolver = request.getresourceresolver(); map<string, object> props= new hashmap<string, object>(); resource resource = resourceresolver.getresource(path); if (null != resource) { props.putall(resource.adaptto(valuemap.class)); } return props; } and in jsp:- <c:set var="refproperties" value="${xyz:getresourceproperties(properties.path,slingre

r - How to combine all sublist elements into one list -

i have list (of length 3) made of sublists (each of differing length - 2, 2, 3). store of 1 big list (e.g., no sublists - 1 list of length 7). understand how manually, there function or command can use? i able lists , sublists of length. here's example of list: [[1]] [[1]][[1]] name n l_1 t t_3 t_4 t_5 cluster 12 563035 19 9.263158 0.2017045 0.06379453 0.075876830 0.095852895 1 14 563037 19 8.026316 0.2076503 0.05634675 0.098684211 -0.104566563 1 [[1]][[2]] name n l_1 t t_3 t_4 t_5 cluster 13 563036 20 7.200000 0.1838450 -0.06428098 0.085681987 -0.011070830 2 17 563042 20 7.725000 0.2168285 0.15161037 0.117570045 -0.067102568 2 [[2]] [[2]][[1]] name n l_1 t t_3 t_4 t_5 cluster 1 561101 11 6.772727 0.19731544 0.029478458 -0.128117914 6.235828e-02 1 44 563080 11 7.545455 0.185