Posts

Showing posts from August, 2015

objective c - Call a function on a touch outside of the active UITextField -

objective c - Call a function on a touch outside of the active UITextField - how phone call custom function when user touches outside of uitextfield has keyboard focus? my goal phone call function textfield validation. i tried this: // dismiss keyboard - (void)touchesended: (nsset *)touches withevent: (uievent *)event { (uiview* view in self.view.subviews) { if ([view iskindofclass:[uitextfield class]]) { [view resignfirstresponder]; [self validationfornoofpassengers]; } } } validationfornoofpassengers method check validation. problem here when tap on other ui controls not phone call above method. above method called when touched outside on screen (but not on uicontrols). guidance? set view controller (or other object) text field's delegate. validation in -textfieldshouldendediting: or -textfielddidendediting: . objective-c ios focus uitextfield

jquery - Json with strange names -

jquery - Json with strange names - first sorry english i have problem json. assume next array in php $msg['keyone'] = "bla1"; $msg['key_two'] = "bla2"; $msg['key-three'] = "bla3"; i convert json json_encode($idioma); then load ajax / jquery successfully $.ajax({ type: "post", url: "somepage.php", contenttype: "application/json; charset=utf-8", datatype: "json", success: function(data) { alert(data.keyone); // ok (bla1) alert(data.key_two); // ok (bla2) alert(data.key-three); // error (obviously)!!!! }, }); exist way/syntax access "key-three". i can't rename keys, have maintain ugly names. thanks!! you can access data['key-three'] . jquery ajax json

python - phenny/jenni IRC bot programming -

python - phenny/jenni IRC bot programming - i'm checking them out, not @ understanding how i'd several things: how, after user joins channel, jenni sends him welcome message how write module in general why .block list nick or of .block commands fail (no output) also, memos carry on if jenbot goes offline? database? i don't have code on computer, seek this: jenni.write(['privmsg','target_nick'],"write message here") python chat irc bots

c# - Decimal to string conversion issues -

c# - Decimal to string conversion issues - possible duplicate: c# how remove 0 end of decimal value best way display decimal without trailing zeros in c# i have decimal variable has value 2.50 2.25 how can convert string can get 2.5 2.25 issue 2.50 must 2.5 in string. string.format("{0:0.##}", 2.50); you can convert string , string.trim('0'); trim trailing zeros off. c# decimal

jQuery: How to remove CSS class from both parent and its direct child? -

jQuery: How to remove CSS class from both parent and its direct child? - $("#menu-main > li").add("#menu-main > li > a").removeclass("hover").find("div").hide(); <ul id="menu-main"> <li class="hover"> <a class="hover" href="" title="">abc</a> <div> <ul> <li><a href="" title="">xyz</a><li> </ul> </div> </li> this works thought write improve please or must repeat "#menu-main > li" add() part? $("#menu-main > li").add("#menu-main > li > a").removeclass("hover") that works, alternatively can use $("#menu-main > li").children('a').andself().removeclass("hover") jquery

javascript - Should heavy variables go outside functions? -

javascript - Should heavy variables go outside functions? - i have function runs around 200 times. the function this: function getb(av,bol){ var bxes=[ ["11","12","13","21","22","23","31","32","33"], ["14","15","16","24","25","26","34","35","36"], ["17","18","19","27","28","29","37","38","39"], ["41","42","43","51","52","53","61","62","63"], ["44","45","46","54","55","56","64","65","66"], ["47","48","49","57","58","59","67","68","69"], ["71...

Blender 2.6.1 export to ogre -

Blender 2.6.1 export to ogre - i'm using blender v.2.6.1: there way export project (.blend) .mesh , .skeleton? i've tried download blenderexport , re-create script , subdirectories either ".blender/scripts", when open .blend, in file->export don't appear nil export in ogre files! blender includes export script lot of formats, need activate scripts in files -> preferences -> add-on menu. blender2ogre can export .scene, .mesh, .material, .skeleton. just follow installation steps , tutorials. blender ogre

compilation - C: undefined reference... to library used successfully elsewhere -

compilation - C: undefined reference... to library used successfully elsewhere - i trying compile c++ project (openframeworks + codeblocks), using external c library. "undefined reference" error, although succesfully compile , utilize library elsewhere. the code consists of sources main.cpp, testapp.cpp , header files, including 1 library "myprocessing". when make , code compiled , dies @ linking error obj/i686release/./src/testapp.o: in function `testapp::update()': testapp.cpp:(.text+0x261): undefined reference `gauss_5(datarect_t)' collect2: ld returned 1 exit status make: *** [bin/facegrabber] error 1 where gauss_5 library function, , called in testapp.cpp (header declarations included there). below paste make commands used compile code, generated codeblocks (i strip clarity) # compiling object for: ./src/testapp.cpp g++ -c -g [some -i...] -dof_using_gtk -dof_using_mpg123 -wall -fexceptions -i. -ilib/ -mmd -mp -mfobj/i686deb...

php - How to get everything between two tags if the closing tag appears in the parent? -

php - How to get everything between two tags if the closing tag appears in the parent? - this problem: script utilize stops looking @ first tag. i'm sceaping website, , part of site want 'extract'. <div class="i-want-this-div"> <div class="annoying-sub-div"> bla bla bla </div> <div class="annoying-sub-div"> etc... </div> <div class="annoying-sub-div"> </div> <div class="annoying-sub-div"> </div> <div class="annoying-sub-div"> </div> </div> i want display 'annoying'(because mess function of script beingness there) divs on site, how do this? this current approach: position of first tag, position of closing tag , subtract part form entire string holds whole website source. $startpos = strpos($siteiamscreaping, '<div class="i-want-this-div"...

java ee - How do I configure this Spring project correctly? -

java ee - How do I configure this Spring project correctly? - me , team trying setup spring project, , implement rest services. when seek deploy tomcat 7, error. here output: jan 22, 2012 9:39:34 pm org.apache.catalina.core.aprlifecyclelistener init info: apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib jan 22, 2012 9:39:34 pm org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.j2ee.server:niths' did not find matching property. jan 22, 2012 9:39:34 pm org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["http-bio-8080"] jan 22, 2012 9:39:34 pm org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["ajp-bio-8009"] jan 22, 2012 9:39:34 pm org.apache.catali...

jquery template building grid -

jquery template building grid - i have json below [ { "username": "john robertson", "operatoruserid": 1177, "partcategoryid": 0, "partcategoryname": null, "unitcount": 22, "categorywisecount": 13, "totalusers": 0, "totalcategories": 0, "mainarraycount": null, "newmainarraycount": null, "listcategorywisecount": [6, 1, 2, 0, 0, 0, 13, 0, 0], "listcategories": ["base unit", "hard drive", "laptop", "laptop ac adapter", "motherboard", "optical drive", "processor (cpu)", "server", "tft"], "listusers": ["john robertson", "user1", "margaret graham", "stuart white", "bob van schie", "caird hay", "bsoni", "tsname"] }, { "us...

Passing Command-line arguments from C# to a external exe -

Passing Command-line arguments from C# to a external exe - i have similar problem solved here. can not figure out, how problem got solved. have programme paramter define input , output file. running commend line, works fine: d:\tools\siftdemov4>siftwin32.exe -display < d:\tmp\srcpgm\image000.pbm > result.pbm but running via system.diagnostics.process, not work. error "invalid command line argument: <" , after system.invalidoperationexception occurs. var process = new process() { startinfo = { arguments = string.format(@"-display < {0} > {1}", configuration.source, configuration.destination), filename = configuration.pathtoexternalsift, redirectstandarderror = true, redirectstandardinput = true, redirectstandardoutput = true, useshellexecute = false, createnowindow = true, errordialog = false, } }; process.enableraisingevents = true; process.exited += onprocessexited; process.ou...

android - How to write entire Logcat in to sdcard? -

android - How to write entire Logcat in to sdcard? - i need write entire logcat in sdcard not filtered logcat. tried doing way string[] cmd ={"/system/bin/logcat " +"-f"+" /sdcard/d.txt"}; log.d("ntk","cmd string"+cmd); runtime run = runtime.getruntime(); process pr; seek { pr = run.exec(cmd); pr.waitfor(); bufferedreader buf = new bufferedreader(new inputstreamreader(pr.getinputstream())); string line = ""; while ((line=buf.readline())!=null) { system.out.println(line); log.i(ntl, "lines"+line); } } grab (ioexception e1) { // todo auto-generated grab block e1.printstacktrace(); } grab (interruptedexception e) { // todo auto-generated grab block e.printstacktrace(); } i have given permissions in manifest file too. not able write logcat in sdcard. you can have this tutorial reading logs...

how to encode html pages that could not decode it again -

how to encode html pages that could not decode it again - i have html page want encode not decode 1 time again want show on browsers correctly. know exists programme called encrypt web pro can know encoded html page can decode 1 time again easily. know safe way this? please help me... with free obfuscating html encoder can encode php output encrypted javascript. viewing source straight result in 1 encoded line of javascript. not benefit search engine optimization, , source can still viewed using source debugger such firebug firefox browsers. html encode

Heroku Shared PostgreSQL and pgcrypto -

Heroku Shared PostgreSQL and pgcrypto - i'm wondering if there way enable pgcrypto on heroku shared postgresql database (5mb)? have working fine on local dev box, complains not beingness able find gen_salt when force heroku. if not, should utilize library deal passwords/salts @ business logic layer , store salt & passhash in database straight character fields? thanks much! i'm not sure can say, pgcrypto coming. there's evidence of pvh on hacker news: http://news.ycombinator.com/item?id=2942210 postgresql heroku

html - Draw some rectangles by table tag -

html - Draw some rectangles by table tag - i'm trying create shape tables: my html code this: <html> <head> <title>exercise!</title> </head> <body> <table border="1" width="100%" height="100%"> <tr> <td colspan="2"></td> <td colspan="3"></td> <td colspan="2"></td> </tr> <tr> <td colspan="1"></td> <td colspan="2"></td> <td colspan="1"></td> <td colspan="2"></td> <td colspan="1" rowspan="2"></td> </tr> <tr> <td colspan="2"></td> ...

c# - AuthorizeAttribute v Application_AuthenticateRequest -

c# - AuthorizeAttribute v Application_AuthenticateRequest - we want authorize users , if authorized want add together roles , permissions user , add together iprinciple we have 2 ways of doing 1 in global.asax application_authenticaterequest other create attribute inherits authorizeattribute is there gleaming selection here? in asp.net mvc should prefer custom authorize attribute. if on other hand want code reusable classic asp.net applications utilize application_authenticaterequest or write custom httpmodule , utilize authenticaterequest event. c# asp.net-mvc asp.net-mvc-3 authorize-attribute

wpf - DataGrid SelectedItem Binding -

wpf - DataGrid SelectedItem Binding - below code behind in view model: private datarow selectederrorrow; public datarow selectederrorrow { { homecoming selectederrorrow; } set { selectederrorrow = value; base.raisepropertychanged("selectederrorrow"); } } then in view: <datagrid selecteditem="{binding selectederrorrow,mode=twoway}" the binding works... "gets" value when datagrid drawn never sets when new value selected/highlighted.... ideas? note item source datagrid datatable. edit: datagrid in popup, when datagrid gets drawn binded value (null). 1 time selected/highlight row not 'set' anything. 'set' binded value null when redrawn (the popup open, selected row, close it,and reopen it). thing never sets value null, , sets during secound time drawn. i needed alter binding to. needs bind datarowview , not datarow . wpf binding mvvm datagrid selecteditem

gzip - Can gnuplot transparently open compressed data files to save storage space? -

gzip - Can gnuplot transparently open compressed data files to save storage space? - i have gigabytes of info nice compress gzip storage. can gnuplot open compressed files? if can't, there way pipe info gnuplot uncompressed file doesn't need written disk? something plot "< gzip -dc compressed.gz" , iirc. gzip pipe gnuplot zlib

iphone - Why is my UIToolbar appearing in an odd position? -

iphone - Why is my UIToolbar appearing in an odd position? - i want add together uitoolbar keyboard uitextfield . here code i'm using: uitoolbar *toolbar = [[uitoolbar alloc] init]; toolbar.tintcolor = [uicolor blackcolor]; uibarbuttonitem *donebutton = [[uibarbuttonitem alloc] initwithtitle:@"done" style:uibarbuttonitemstylebordered target:self action:@selector(somefunction)]; donebutton.tintcolor = [uicolor blackcolor]; uisegmentedcontrol *directioncontrol = [[uisegmentedcontrol alloc] initwithitems:[nsarray arraywithobjects:@"back", @"next", nil]]; directioncontrol.tintcolor = [uicolor blackcolor]; directioncontrol.segmentedcontrolstyle = uisegmentedcontrolstylebar; [directioncontrol addtarget:self action:@sel...

asp.net mvc - Scaffolding support in Sharp Architecture 2.0 -

asp.net mvc - Scaffolding support in Sharp Architecture 2.0 - have dropped back upwards scaffolding in sa 2.0. have downloaded templify-project. installed templify , created solution project construction created did not include tools , tools/crudscaffolding supposed contain code generation templates. question is: have dropped code generation capabilities sa 2.0 , additionally if 1 point me demo sa 2.0 indeed grateful asp.net-mvc asp.net-mvc-3 scaffolding sharp-architecture

How to implement the Pause action for the android VideoView? -

How to implement the Pause action for the android VideoView? - in application going play videoview. i not using media controller variour alternative play, pause , stop. instead of using single button utilize play , pause functionality. i have implement below code: case r.id.playvideobtn: if(myvideoview.isplaying()){ myvideoview.pause(); }else{ //mediacontroller ctlr=new mediacontroller(this); // ctlr.setmediaplayer(myvideoview); //myvideoview.setmediacontroller(ctlr); myvideoview.start(); } break; now wonder how implement pause functionality same button click. please help me it. thanks. from videoview.java found... start() goes pause(), resume() goes suspend() (the latter pair causing screen blank out). and solution @ illustration playing video android android-layout android-ndk videoview android-video-player

java - How to add navigation case for Virtual directory -

java - How to add navigation case for Virtual directory - in app, have virtual directory store files downloading. wanted create <h:button> outcome="<virtual-directory-url>/<file-name>" download file. however, ran error navigation case not resolved . i'd grateful if show me how should tackle problem. best regards, james tran i found solution: combination of <h:outputlink> , <h:button> do. should this: <h:outputlink value="<virtual-directory-url>/<file-name>"> <h:button value="download" /> </h:outputlink> java jsf-2 navigation ejb-3.0

java - JACKSON how to not include the wrapper for a field ? -

java - JACKSON how to not include the wrapper for a field ? - jackson how not include wrapper field ? public class authtype { map<string,string> properties; public map<string, string> getproperties() { homecoming properties; } public void setproperties(map<string, string> properties) { this.properties = properties; } } it returns {"properties":{"authtype":"xyz"}} but want have {"authtype":"xyz"} any annotation ? looks there no back upwards http://jira.codehaus.org/browse/jackson-765 workaround ? starting in jackson 1.9, can utilize @jsonunwrapped annotation public class authtype { map<string,string> properties; @jsonunwrapped public map<string, string> getproperties() { homecoming properties; } public void setproperties(map<string, string> properties) { this.properties = properties; ...

sql server 2008 - SQL: Error when trying to filter out all dates older than the current date -

sql server 2008 - SQL: Error when trying to filter out all dates older than the current date - i'm using sql server 2008. have table stores dates in datetime format (i.e. 2012-01-21 15:00:00.000 ) i'm trying filter out dates older "today". attempting using query below. select date mytable date >= getdate() when run though, next error. conversion failed when converting date and/or time character string. is there i'm doing wrong? help , allow me know if need provide more information! more information: [date] of type datetime in mytable. i have view selects [date] , no manipulation i'm accessing [date] via view you don't locale in will matter. possibility date column isn't datetime. don't locale in, (as example) , uk datetime formats treated differently when in reverse format. uk sees date yyyy-dd-mm hh:mm:ss.fff sees date yyyy-mm-dd hh:mm:ss.fff for example, throws error: set language british go se...

security - Django: preventing external query string requests -

security - Django: preventing external query string requests - i've been doing web development few months , maintain having nagging problem. typical pages request content query string contains meaningful info such id in database. illustration link such as: http://www.example.com/posts?id=5 i've been trying think of strategy prevent users manually entering value id without having accessed link--i'd wish acknowledge requests made links presented on website. also, website may not have authentication scheme , allows anonymous browsing; beingness said, info isn't particularly sensitive still don't thought of not beingness able command access information. 1 option, suppose, utilize http post requests these kind of pages -- don't believe user can simulate post request may wrong. furthermore, user place arbitrary number id , end requesting record doesn't exist in database. of course, validate requested id wasting resources accommodate check....

php - Extending custom library 1 with custom library 2 in codeigniter? -

php - Extending custom library 1 with custom library 2 in codeigniter? - i have custom library phone call library1. i'm trying extended library1 custom library called library2. i require_once , include library1 in library2. other alternative have library2 utilize codeigniters load method , load library1 within library2. any 1 have thoughts on why 1 way improve other? first of all, "oop"? think missing point of mcv, secondly check this here php oop codeigniter

reflection - Traverse and find all given type instances within complex object graph -

reflection - Traverse and find all given type instances within complex object graph - (using vb.net 4.0) have object graph complex - has properties, arrays , other collections, subclasses own properties , collections, etc. want traverse entire object graph , find instances of particular type t, perform particular operation on these instances. there bulletproof way perform total traversal of object graph? reflection, seems hard task prone error. i wondering binary serialization, since seems clone object, no matter how complicated, in robust manner. there way modify technique, such instead of serializing instead returns list of references sub-objects of given type t? pure speculation, i'm open feasible solution. well figured out method, though isn't best. because object's graph pretty nested & complex, decided rely on binary serialization, since in (limited) experience offers thorough & robust graph traversal. downside binary serialization can ...

r - Rolling sum on an unbalanced time series -

r - Rolling sum on an unbalanced time series - i have series of annual incident counts per category, no rows years in category did not see incident. add together column shows, each year, how many incidents occurred in previous 3 years. one way handle add together empty rows years 0 incidents, utilize rollapply() left-aligned 4 year window, expand info set more want to. certainly there's way utilize ddply() , transform this? the next 2 lines of code build dummy info set, execute simple plyr sum category: dat <- data.frame( category=c(rep('a',6), rep('b',6), rep('c',6)), year=rep(c(2000,2001,2004,2005,2009, 2010),3), incidents=rpois(18, 3) ) ddply(dat, .(category) , transform, i_per_c=sum(incidents) ) that works, shows per-category total. i want total that's year-dependent. so seek expand ddply() phone call function() syntax, so: ddply(dat, .(category) , transform, function(x) i_per_c=sum(ife...

javamail - How to read e-mails in a local directory using Java? -

javamail - How to read e-mails in a local directory using Java? - i create java programme body/message of mail, mails in .eml format , mails placed locally in machine. problem when seek ways i'm still lead utilize folder class requires active mail service server. now, question is, there way can extract message part of e-mail using javamail api without need connect server? because doing extraction of message part of e-mail without including headers impossible filestream. thanks help. cheers! you can utilize "local store provider" javamail, perhaps simplest approach utilize mimemessage takes inputstream. give (buffered) fileinputstream , parse message you. javamail

r - Populate NAs in a vector using prior non-NA values? -

r - Populate NAs in a vector using prior non-NA values? - what's compact/efficient way populate nas using prior non-na value? example: test = c( 1 , 2 , na , na , 5 , na , 9 , na , na ) expected = c( 1 , 2 , 2 , 2 , 5 , 5 , 9 , 9 , 9 ) here, of na values 'look back' first non-na value. i'm trying avoid loop library(zoo) na.locf(test) [1] 1 2 2 2 5 5 9 9 9 r

python - How to import a java class i created in jython and call a method -

python - How to import a java class i created in jython and call a method - i have made java class calls other java classes , prints screen. trying build python interface calls java class, runs 1 method within it, , terminates. cannot access method. have used line "import directory.directory2.myclass.java (and .jar , .class) made .jar file both raw code , .class file. none of these seem working. set sys.path.append point directory java files are. need convert java class file python module? , if how do that? jython supports loading java classes if python modules. searches directories in sys.path .class files. first, create sure java class has been compiled javac . then, sys.path.append(d) , d directory containing package. if class says package foo.bar; @ top, , resides @ mydir/foo/bar/myclass.java , must have mydir in sys.path (not 1 of subdirs of mydir ). finally, import class via from foo.bar import myclass . names between must match between python , java...

http - ASP.NET MVC: Make browser cache images from action -

http - ASP.NET MVC: Make browser cache images from action - i have actionmethod returns file , has 1 argument (an id). e.g. public actionresult icon(long id) { homecoming file(server.mappath("~/content/images/image" + id + ".png"), "image/png"); } i want browser automatically cache image first time access next time doesn't have download data. i have tried using things outputcacheattribute , manually setting headers on response. i.e: [outputcache(duration = 360000)] or response.cache.setcacheability(httpcacheability.public); response.cache.setexpires(cache.noabsoluteexpiration); but image still loaded every time nail f5 on browser (i'm trying on chrome , ie). (i know loaded every time because if alter image changes in browser). i see http response has headers apparently should work: cache-control:public, max-age=360000 content-length:39317 content-type:image/png date:tue, 31 jan 2012 23:20:57 gmt expires:sun, ...

SQL-Server - Stop success message when saving results to file -

SQL-Server - Stop success message when saving results to file - when running query on sql server , using results file function, sql server automatically adds success message @ end of file looks this: (2620182 row(s) affected) with little file, pop open text editor , remove manually, when file millions of records, takes bit more work. utilize grep or sed remove it, that's manual process. is there way can surpress message showing in saved result set? add set nocount on; before executing query. sql-server

css3 - Simple css opacity IE fix help needed -

css3 - Simple css opacity IE fix help needed - please compare page in chrome , ie you can see drop downwards fields in right side. in chrome displays correctly. in ie displays rectangular boxes. so applied opacity select fields using next code. select { opacity:0; filter:alpha(opacity=0); /* ie8 , before */ } but hides everything. mean "please select" text too. can see invisible in ie chrome displays correctly. so tried code. not working. select option.selectedx { opacity:1; filter:alpha(opacity=100); /* ie8 , before */ } where selectedx class name of drop downwards selected field. thanks try utilize z-index property css css3 opacity

asp.net - How can I return a value from a function that uses a jQuery ajax call? -

asp.net - How can I return a value from a function that uses a jQuery ajax call? - i have next javascript function makes phone call asp.net webmethod returns true if username exists , false if not. next give me right reply in alert box if alter alert(result.d) homecoming result.d result of function undefined. how can function ajax phone call contained in homecoming value based on response webmethod? function doesentereduserexist() { var valfromusernamebox = $("#txtusername").val(); var jsonobj = '{username: "' + valfromusernamebox + '"}'; $.ajax({ type: 'post', contenttype: 'application/json; charset=utf-8', data: jsonobj, datatype: 'json', async: false, url: 'addnewuser.aspx/isusernamevalid', success: function (result) { alert(result.d); }, error: function (err) { alert(err); ...

command line - Passing parameter from Client CMD through ICA file to launch published Citrix App -

command line - Passing parameter from Client CMD through ICA file to launch published Citrix App - i'm trying send simple string parameter c# web app code using cmd line phone call ica file citrix xenapp server launch specific published application (macro scheduler macro compiled exe), not whole citrix desktop. i have web app cmd line code using "c:\program files (x86)\citrix\ica client\wfica32.exe" c:\someicafile.ica \param:"/username=somebodysname" . i've tried parameter syntax: /username=somebodysname, /param:"/username=somebodysname" and 1000000 other combinations of quotes , slashes. i used citrix quicklaunch write ica file, in thing changed initialprogram=#applicationname \param (i added \param). i've tried /username , \param=somebodysname , can't of work either. i've tried hardcoding name in there , can't go through. the exe expecting parameter " username " , when called locally cmd prompt ...

android - Listview and array adapter and remove -

android - Listview and array adapter and remove - i created adapter public class myarrayadapter extends arrayadapter<watch> overriding public myarrayadapter(context context, list<watch> values){ super(context, android.r.layout.simple_list_item_1, values); this.context = context; } and private view createoneview(){ ... } then do myarrayadapter myadapter = new myarrayadapter(this, getallwatches()); ... //do stuff here myadapter.remove(getallwatches().get(2)); myadapter.notifydatasetchanged(); the watch still not removed. suspect objects removed if ther == , not .equal() , or missing more trivial? myadapter.getposition(getallwatches().get(2)) homecoming -1, problem object not found. arrayadapater uses indeed .equals() method. implementing in appropriate way (comparingfields) works smoothly. android listview

bison - Custom scripting language -

bison - Custom scripting language - i kind new writing custom languages. before diving flex,bison based lexers,parsers,compilers inquire if possible before begin research maybe after week work realize that's impossible. goal create scripting language translated c language not compiled farther until machine code because of code goes embedded platform , needs compiled differently normal languages. point create this: written script -> parser translates code c code based on rules -> compiles embedded machine code. so maybe suggest me way this. reading flex & bison based custom languages compiled machine code think isn't need. you might read literature concerning domain specific languages, e.g. dsl2011 , before proceedings. don't focus much on lexing , parsing. of work , issues in defining language semantics , implementation. making dsl translated c not easy task. see instance dsl2011 paper on melt. read books on language semantics , pragmatics,...

java - Log messages are not written in the log file -

java - Log messages are not written in the log file - i have configured project log4j. have configured log4j using log4.properties file. while test runs creates mylog.log file nil written log file. appender using rollingfileappender , log4j.rootlogger=debug . can 1 suggest might causing problem? here log4j.properties project. log4j.rootlogger= debug, consoleappender, rolling log4j.appender.consoleappender=org.apache.log4j.consoleappender log4j.appender.consoleappender.layout=org.apache.log4j.patternlayout log4j.appender.consoleappender.layout.conversionpattern=%d %-2p %c.%m(): %m%n log4j.appender.rolling=org.apache.log4j.rollingfileappender log4j.appender.rolling.maxfilesize=5mb log4j.appender.rolling.maxbackupindex=2 log4j.appender.rolling.file=d:\logs\myproj.log log4j.appender.rolling.layout = org.apache.log4j.patternlayout log4j.appender.rolling.layout.conversionpattern=%d %-4p %c.%m(): %m%n ## next 2 lines have been removed now. log4j.logger.com=warn lo...

templates - Accessing module tag -

templates - Accessing module tag - i'd extend existing module adding tag in views/tags folder. able phone call tag 1 of application template using module. it's done in secure module check.tag. however when seek phone call module tag 1 of application template, play search through application "tags" folder , doesn't check module tags folder. so, there way tell play import tags located in module? thanks you have create sure provide namespace of tag. example, in secure module, tags under secure/app/views/tags so under tags counts namespace. the path check is secure/check.tag so usage in templates #{secure.check} templates tags playframework

xerces c - What is the difference between DOCUMENT_NODE, DOCUMENT_TYPE_NODE and DOCUMENT_FRAGMENT_NODE? -

xerces c - What is the difference between DOCUMENT_NODE, DOCUMENT_TYPE_NODE and DOCUMENT_FRAGMENT_NODE? - can 1 explain me difference between document_node, document_type_node , document_fragment_node in xerces-c. a document_fragment_node can used top level parent of partial document. illustration implement cut-copy-paste operation. described in detail here: http://www.w3.org/tr/rec-dom-level-1/level-one-core.html#id-b63ed1a3 a document_type_node starting node of dtd declaration starting <!doctype . described in detail here: http://www.w3.org/tr/rec-dom-level-1/level-one-core.html#id-412266927 the document_node root node of node tree generated xml input. please note not root element of xml instance. parse() method returns pointer document_node can access finish xml. detailed description can found here: http://xerces.apache.org/xerces-c/apidocs-3/classdomdocument.html xerces-c

how to change android spinner popupBackground -

how to change android spinner popupBackground - i trying alter android spinner popup window background setting android:popupbackground, didn't have effect. there way can alter it? <spinner android:id="@+id/eventnamespinner" android:layout_width="160dp" android:layout_height="30dp" android:layout_alignparentleft="true" android:layout_centervertical="true" android:layout_marginleft="6dp" android:background="@drawable/btn_name" android:paddingbottom="2dp" android:paddingtop="2dp" android:popupbackground="@drawable/bkg"> i presume trying alter "outer" backgroud of spinner's popup, not background of spinner "pupup items". also, presume popup, mean spinner's dialog mode, floating dialog window appears on top of activity, oppo...

c - Same name input/output issue -

c - Same name input/output issue - okay guys, i'm having 1 more issue program. i'm running issue using same filename (knightsball."extension"). don't know if it's locally, or issue i'll have when move code over. can help me thing i'm overlooking? output , input have both go same filename.(in) or (out) no ways around. if alter output file knights.out works. ideas? relevant segments of code: file *fr; file *fo; typedef struct knightsballlottoplayer { char firstname[20]; char lastname[20]; int numbers[6]; } kblottoplayer; int main() { kblottoplayer *temp; int numplays=0; //what file read fr = fopen("knightsball.in", "r"); //what file read fo = fopen("knightsball.out", "w"); and part output accessed: if(match==3) fprintf(fo,"%s %s matched %d numbers , won $10.\n", temp[r].firstname, temp[r].lastname, match); if(match==4) fprintf(fo,"%s %s matched %d numbers , won $100.\n...

java - Using the jersey client to do a POST operation with request params and a request body -

java - Using the jersey client to do a POST operation with request params and a request body - i'm trying figure how how utilize bailiwick of jersey client send both request params , request body of post operation. currently know how both of way individually, not together. from here: using bailiwick of jersey client post operation i've gotten request parms: multivaluedmap formdata = new multivaluedmapimpl(); formdata.add("name1", "val1"); formdata.add("name2", "val2"); clientresponse response = webresource.type("application/x-www-form-urlencoded").post(clientresponse.class, formdata); and request body can following: string jsonobject ="... valid json object"; webresource.type(mediatype.application_json_type).post(string.class, jsonobject); how post both request param request body? thanks i figured out.. webresource.queryparam("key", "value").type(mediatype.appli...

sql server - Debugging EF App locks DB tables? -

sql server - Debugging EF App locks DB tables? - i have wcf app has 5-6 ef models in it. in production env, 1 instance of app running. but in development there 5 developers working on @ same time. (against same database.) we noticing tables on our sql server 2008 r2 db locked. seems when doing step on debugging , has leave on step few minutes. i curious why ef maintain lock on table. how maintain lock on table using ef? can prevent this? note: same application accesses wcf info services (odata) endpoint of info (from same database). don't see how odata locking db, thought mention in case important. there 1 solution. each developer have locally installed database , run debugging session in own environment! else wrong development environment. utilize sql server express or sql server developer edition. sql-server wcf entity-framework entity-framework-4

javascript - How do I create an JS Object with methods and constructor in ClojureScript -

javascript - How do I create an JS Object with methods and constructor in ClojureScript - imagine task create utility lib in clojurescript can used js. for example, let's want produce equivalent of: var foo = function(a, b, c){ this.a = a; this.b = b; this.c = c; } foo.prototype.bar = function(x){ homecoming this.a + this.b + this.c + x; } var x = new foo(1,2,3); x.bar(3); // >> 9 one way accomplish came is: (deftype foo [a b c]) (set! (.bar (.prototype foo)) (fn [x] (this-as (+ (.a this) (.b this) (.c this) x)))) (def x (foo. 1 2 3)) (.bar x 3) ; >> 9 question: there more elegant/idiomatic way of above in clojurescript? this solved jira cljs-83 adding magic "object" protocol deftype: (deftype foo [a b c] object (bar [this x] (+ b c x))) (def afoo (foo. 1 2 3)) (.bar afoo 3) ; >> 9 javascript...

c# - Sharing variables between actions in asp.net MVC -

c# - Sharing variables between actions in asp.net MVC - i have next scenario may warrant storing info in conroller fellow member variable in order share between actions. i have search form , button - when clicked, table total of info returns according search form parameters. 1 action - , clean. i asked set excel button user can download table in excel format. don't want run db query again, since info there, since using server side excel component, need info available on server in order shove excel. my initial thought have variable in controller info can stored. have never seen beingness done in asp.net mvc. accepted pattern? understanding each action sort of isolated. the mvc pattern encourages statelessness. means if want maintain info between actions needs posted client (the server shouldn't maintain state relating specific session). (so yes each action should isolated, , shouldn't reliant on previous action, ie shouldn't rely on s...

php - Determining source of method call at runtime -

php - Determining source of method call at runtime - i'm wondering if there "better" way this: class foo { final public function bar() { if (is_subclass_of(get_called_class(), __class__)) { throw new exception(); } } } class bar extends foo { public function baz() { parent::bar(); // shouldn't allowed } } essentially, want methods in parent class prohibit kid classes calling them. needs bullet-proof, uncertainty is, if know how circumvented, that's i'm interested in knowing (along how prevent it, if possible). edit: suggesting private methods, not option, need interface remain public externally accessible. sorry, guess assumed obvious. class foo { final public function bar() { if (is_subclass_of(get_called_class(), __class__)) { throw new exception('no cookies you!'); } echo 'failure!'; } } class bar extends foo { publ...

How to get all objects in Darts Storage -

How to get all objects in Darts Storage - as mention in this so, way t objects stored in localstorage: class="lang-dart prettyprint-override"> for (var key in localstorage){ console.log(key) } how same in dart? you can keys , values dart's local storage in same way class="lang-dart prettyprint-override"> element log = document.query('#log'); log.nodes.clear(); for(int i=0; i<window.localstorage.length; i++) { var elm = new element.tag("p"); var key = window.localstorage.key(i); elm.innerhtml = "key ${key} value ${window.localstorage.getitem(key)}"; log.nodes.add(elm); } dart local-storage dart-html

ruby on rails - Does ActionDispatch instance can't be stored in a class variable? -

ruby on rails - Does ActionDispatch instance can't be stored in a class variable? - i have controller has 2 methods: upload , submit i can ensure upload method executed before submit called. in upload, have such code: def upload @file = params[:avatar] ... end in submit, have such code: def submit ... user.avatar = @file ... end but seems @file nil. where wrong?.... i'm using rails 3.2.0 instance variables in controllers not persist between requests. every request creates new instance of controller class @file save in upload goes away when upload finishes. then, when new request comes in routed submit method, rails create new instance of controller class , phone call submit on it. since have 2 instances of class, have 2 sets of instance variables , won't share @file . you have arrange @file stored in database, session, form, etc. between requests , submit has load ever stored , assign user.avatar . ruby-on-...

file - CMake: creating COPY_IF_DIFFERENT macro with different behaviors -

file - CMake: creating COPY_IF_DIFFERENT macro with different behaviors - there 2 possible behaviors differ bit each other. difference of particular involvement , investigate cause , possible pitfalls of help. implementation: macro(copy_if_different src_files src_dir dst_dir dst_file_targets) foreach(src_file ${src_files}) set(dst_file ${src_file}) # names of original , re-create same. # set(dst_file_target ${dst_dir}/${dst_file}) # <--- # set(dst_file_target ${src_file}) # <--- b add_custom_command( output ${dst_file_target} command ${cmake_command} args -e copy_if_different ${src_dir}/${src_file} ${dst_dir}/${dst_file} # main_dependency ${src_dir}/${src_file} # <--- c # depends ${src_dir}/${src_file} # <--- d ) set(dstfiletargets ${dstfiletargets} ${dst_file_target}) endforeach() set(${dst_file_tar...

facebook - Multiple posters on page -

facebook - Multiple posters on page - i have question, might found somewhere couldnt find thread if there one, please post link. i admin page grouping of several other business areas. want post on 1 page different icons , names, can done? different admins administered 1 person/account? possible? what going want utilize "page access_token ". have create application , grant manage_pages permission. you should see in authentication documentation section called "page login". can grant application manage_pages permission going url: https://www.facebook.com/dialog/oauth?client_id=your_app_id&redirect_uri=your_url&scope=manage_pages&response_type=token don't forget substitute your_app_id , your_url right values application , url. (the url can url - facebook send after close dialog). see dialog looks : once have right permission, you'll want create phone call url : https://graph.facebook.com/me/accounts?ac...

facebook - Blank Redirect Page with JQuery Mobile (and ASP.NET MVC3) -

facebook - Blank Redirect Page with JQuery Mobile (and ASP.NET MVC3) - i'm getting unusual issue chrome + firefox. doesn't repro on ios or ie9. here's repro: load home page http://example.com login (via rel="external" hyperlink). in case utilize facebook's oauth server side flow - url facebook.com. facebook accepts user's credentials , redirects http://example.com/user/callback . here various facebook info processed (it provided in query string). the server side code @ http://example.com/user/callback redirects user http://example.com . mechanism used redirect redirecttoaction asp.net mvc3. returns 302. expected result: user see url in browser = http://example.com , content nicely shown. works on ie , safari. action result (on chrome only) user gets url in browser = http://example.com/#base_domain=example.com actual page blank (no visible content) view source reveals content present. action result (on firefox only) user gets url in...