Posts

Showing posts from May, 2014

ios - How to create a 3d map for an augmented reality game? -

i want build game one: ar invaders how can create 3d map? camera of iphone should middle of 3d circle map. dont know if 3d circle map correct word explain it. iphone should object middle of 3d circle map , around iphone should objects kill. so how can create augmented reality map, when move foreward or backward iphone objects grow? or when move iphone upward? any suggestions? looks game uses imu data , video capture front camera. if want use not rotations in game, need kind of slam 1 http://13thlab.com/ballinvasion/

Generate an Image with text using c# -

Image
basically want able somehow generate image has list of stats player. need able draw text onto image , maybe players avatar onto if possible. want avoid using libraries unless have unless have easy way using x library. know how make using simple php request since of information retrieved various databases anyway, prefer have way make directly in program can change easily. i've done in java before don't know how make in c# without using opengl. here's picture of might like. i apologize if has been asked before if couldn't find it. you have refer system.drawing namespace. gdi+ easy thing understand , use it. easy example

python 2.7 - Don't understand this Boolean operator logic -

def odd(x): x % 2 return x > 0 why function return true numbers? you need change to: x = x % 2 to update variable in line 2.

python 3.x - clearing entry text with tkinter -

so i'm having trouble deleting text entered user help? of code... menubar = menu(mgui) filemenu = menu(menubar, tearoff = 0) filemenu.add_command(label="new", command = mnew) filemenu.add_command(label="open", command = mopen) filemenu.add_command(label="close", command = mquit) menubar.add_cascade(label = "file", menu=filemenu) #edit bar condtruction editmenu = menu(menubar, tearoff = 0) editmenu.add_command(label="clear text", command = mclear) menubar.add_cascade(label = "edit", menu=editmenu) here things explaining mquit , stuff def mhello(): mtext = ment.get() mlabel2 = label(mgui, text = mtext).pack() return def mnew(): filemenu.add_command(label="new") menubar.add_cascade(label="file", menu=filemenu) return def mclear(): delete(first, last=none) plz me clear text, thanks! assuming ment refers tkinter entry widget, use `ment.delete(0,"end&q

Trying to prevent submit until one radio button is selected using jquery -

must syntax error, because can't first alert my submit button: input type="submit" name="payonline" id="payonline" value="pay online" style="color: red; font- weight: bold; width:100px; height:40px;"/> jquery: <script> $("#payonline").click(function() { alert("submit button clicked on"); if ($("input:radio[name='epackage']:checked").val() <0 ) { alert('nothing checked!'); return false; event.preventdefault(); } else { alert('one of radio buttons checked!'); } }); </script> you want change .val .length. return value of 0 or 1. change if '<= 0'... <form> <input type="radio" name="epackage" value="1">option 1<br> <input type="radio" name="epackage" value="2">option 2 <input type="submit" name="payonli

sql server - MS Sync Framework overwrite/ignore new insert from different users? -

i implemented sql server sync program using sync2.1 framework. supposed used multiple users: 1) master db installed on server myserver.com; 2) each user provisioned using same schema , scope; 3) user sync server, no change. 4) user b sync server, no change. 5) user b makes changes, sync server, shows 1 change upload , 0 change download; 6) now, if use make changes, sync server, shows 1 change upload, xxxxxx changes download, xxxxxx big #. i thought after step #4, no matter sync database, changes uploaded or downloaded. looks after user sync, if there user sync, when 1st user sync again, download entire database changes again. is normal? can cause this? or, maybe sync supposed used 1 user only? or, different users should use different schemas? furthermore, in db, has table 'location', has column locationid (pk), , auto int. there table 'client', has column 'locationid' pointing location table, , has clientid column (pk). now, user work on local db, ins

vb.net - How to read From Text Files line by line - multiple choice Quiz -

hi need this, need make multiple choice question program reads questions , answers 2 different text files (notepad files) when try cant seem working. have tried loops didn't work tried arrays didn't meet requirements of reading form text file so come need reading text file line tine , updating when new question needs given i cannot 1 read line line (questions.txt) , need have match question in answers.txt need update when next question clicked vb.net program need create must following questions , answers should loaded file called questions.txt , answers.txt respectively -questions should appear in random order, every time program executed -update form next question -keep track on how many questions correct any resources or tutorials on of above muchly appreciated total edits: 198305769 lol. cleaned answer, , should complete. cheers. declare global variable (integer); that's you'll assign amount of questions user has answered: public

html - Set DIV display:block on A:hover Trigger (using only CSS) -

i'm trying trigger div display:none; display:block; when link hovered. i've tried achieve reaction through adjacent sibling selector target div doesn't change none block . think it's because i'm not defining correct hierarchy, have no idea else try. <div id="home_bar"> <div id="welcome_left"> i’m <a href="#" id="name">anthony</a>. </div> <div id="welcome_right"> <div id="name_desc">i love lamp.</div> </div> </div> the above html powered following css: #home_bar { display: table-row; width: 888px; border: 1px solid red; margin-top: 80px; } #welcome_left { letter-spacing: -1px; font-size: 36pt; line-height: 36pt; width: 666px; color: #606060; cursor: default; display: table-cell; float: left; } #welcome_right { float: right; width: 200px; display: table-cell; position: relative; } #name:hover { color

Excel 2007 VBA issue with structured references -

if create range structured reference , try run find function, excel throws 50290 error application-defined or object-defined error . google says, error seems related missing reference. missing reference is not obvious looking through tools/references. set colrange = range("table[column]") set r = colrange.find(id, lookin:=xlvalues) line 2 throws error. colrange variable looks fine in watch window. can extract values using .cells property. find (ctrl+f) works fine. hope not overlooking simple. if not able find id in colrange reference object r not defined. , when u use property of object r, throw error. hope answer query, if not paste ur code here, check that.

python - Pb converting a list of pandas.Series into a numpy array of pandas.Series -

i convert list of pandas.series numpy array of pandas.series. when call array constructor, converting series. >>> l = [series([1,2,3]),series([4,5,6])] >>> np.array(l) array([[1, 2, 3], [4, 5, 6]], dtype=int64) my list small (~10 elements), performances issues ( https://stackoverflow.com/questions/22212777/python-pandas-small-series-performances?noredirect=1#comment33725521_22212777 ) avoid create pandas.dataframe. there easy workaround? thanks in advance you should set dtype of array when assign it: l = [pd.series([1,2,3]),pd.series([4,5,6])] np.array(l, dtype=pd.series) though raises question: why want ndarray of series, , not ndarray of contents of series?

Process creation from database in Websphere process server -

suppose have long running process , waiting in wait activity expires in 50 days , long running process getting executed in ibm websphere process server(wps). now if shutdown wps, means process executing in cpu killed. start server again, question how process created again , how resume particular activity wait. i know these information regarding activity retrieved database not sure how creation of process happen , how resume activity @ shutdown server? please let me know in case don't understand question. thank much. all long running process instances , details stored in wps's internal db. when process waits, not waiting, process execution in state called "wait". no process or thread waiting. when stop server, has these details persisted , when start again, picks details db. process instance not process or thread (like process/thread in os/java), instead entity stored in internal database.

angularjs - When I update the action on my form, it doesn't post -

this works fine <head> <script> function usersctrl($scope) { $scope.info = "the buttons haven't been clicked yet"; $scope.signupfolks = function () { $scope.info = "you've cliked first radio option!" $scope.actionyo = "/users/session"; }; $scope.loginfolks = function () { $scope.info = "you've cliked second option!"; $scope.actionyo = "/users/session2"; }; } </script> </head> <body> <div ng-controller="usersctrl"> <form action="/users/session" method="post"> <input type="radio" ng-model="currentfolks" ng-change="signupfolks()" name="newfolks" id="optionsradios1" value="newfolks3"> <input type="radio" ng-model="currentfolks" ng-change="loginfolks()&q

Simplify expressions in LLVM SSA -

there pass breaks constant gep expression out of instruction's operand own instruction, such nested gep expressions become explicit , easier work in subsequent passes. now have similar problem. ssa phi instruction ( link ): while.cond: ; preds = %while.body, %entry %n.0 = phi %struct.node* [ bitcast ({ %struct.node*, i32, [4 x i8] }* @n1 %struct.node*), %entry ], [ %13, %while.body ] ... contains bitcast instruction ( link ) "inlined" operand. exists there pass allows me break ssa of given module basic instructions, "un-inlining" such nested expressions make them explicit ssa instructions? i don't know of such pass. however, looks me modifying safecode's breakconstantgeps pass should easy: change condition inserted worklist isa<phinode> instead of operand loop checking hasconstantgep .

php - MYSQL Ordering Substring Count -

i want order query counts of substring. table : id shop_update 1 a,b,c 2 a,b 3 c 4 a,'',c i order count id shop_update count 1 a,b,c 3 2 a,b 2 3 c 1 4 a,'',c 2 my query $this->db->select("*,length(shop_update) - length(replace(shop_update,',','')) counts"); $this->db->order_by("counts","desc"); $this->db->from('at_shop'); but returns 0 in count id shop_update count 1 a,b,c 0 2 a,b 0 3 c 0 4 a,'',c 0 my issue length(replace(replace(shop_update,',',''),'''','')) running space length(replace(replace(shop_update,', ',''),'''','')) (spaces added between (', ')in query actual code spaces not there) please see difference help? just using function in query give correct

hosting - How to enable http extension in php using php.ini? -

how enable http extension php shared godaddy hosting in quickest way; preferably uploading php.ini file website directory root - how write it? i'm having issues out of box shared godaddy hosting trying parse data using php 3rd party api that pecl extension, install need permission godaddy so. it's better raise support ticket , ask them you.

matlab - finding a position in loop can find the highest number but need its position -

i have code made prints out "number" , "value" value order came in obtained loop. i able highest number "numbers can't find way print out "value" or position in example: number = 3 5 5 4 value 1 has 3 number value 2 has 6 number value 3 has 5 number value 4 has 4 number highest = 6 i want out put say value 2 has 6 number it can find 6 using max(number) how can position in loop? , case if have 2 numbers equal in both positions this code number len= length(number); %for aligning , display loop x=1; while x<=len fprintf('value %x has %d number \n',x,number(x)) x=x+1; end highest = max(number) try using, [high, pos] = max(number); instead of highest = max(number) ; where high largest number , pos value required.

How to transfer data from one system to another system's HDFS (connected through LAN) using Flume? -

i have computer in lan connection . need transfer data system system's hdfs location using flume. i have tried using ip address of sink system, didn't work. please help.. regards, athiram this can achieved using avro mechanism. the flume has installed in both machines. config file following codes has made run in source system , logs generated. a1.sources = tail-file a1.channels = c1 a1.sinks=avro-sink a1.sources.tail-file.channels = c1 a1.sinks.avro-sink.channel = c1 a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.sources.tail-file.type = spooldir a1.sources.tail-file.spooldir =<location of spool directory> a1.sources.tail-file.channels = c1 a1.sinks.avro-sink.type = avro a1.sinks.avro-sink.hostname = <ip address of destination system data has written> a1.sinks.avro-sink.port = 11111 a config file following codes has made run in destination system , logs generated. a2.sources = avro-collection-source a2.sinks = hdfs-

Turn C# object to json string, how to handle double quotation -

i'm using newtonsoft.json parse object json string. returns somethink this: {\"code\":-1,\"idname\":\"empty\",\"idvalue\":0,\"message\":\"failed,can not read object body\"} it not valid json string think, can work me out? what want this: {"code":-1,"idname":"empty\",\"idvalue\":0,\"message\":\"failed,can not read object body\"} public static class commonutility { // format response string public static string formatresponsestring(int code, string idname, long idvalue, string message) { responsestring rs = new responsestring(); rs.code = code; rs.idname = idname; rs.idvalue = idvalue; rs.message = message; string json = jsonconvert.serializeobject(rs); return json; } } public class responsestring { public int code; public string idname; public long idvalue; p

c# - Markup extension naming -

i'm pretty sure answer no , there way name markup extension differently class implements it? i make markup extension has relatively short name: <textblock text="{my:ext}"/> but give different (longer) name on c# side: public class myspecificmarkupextension : markupextension the information found naming on this page , *extension pattern, not want achieve. hoping attribute exists allow me this: [someattribute("ext")] public class myspecificmarkupextension : markupextension but i've checked of attributes in system.windows.markup namespace , there no such attribute unfortunately. is there solution problem? the answer may have assumed nope. there no such class attribute. none know. since mentioned have large amount of exceptions , keep xaml simple possible how have 1 extension calls others based on key. its hiding extension behind key. take @ this: public class myextextension : markupextension { public string outp

python - Not able to get latest rows when re-rerunning same query at regular interval -

i using python mysqldb module. querying table every 1 seconds. new rows being added table time. code follows; def main(): connectmysqldb_tagem() while true: querytable() time.sleep(1) closedbconnection() the problem code query not return latest rows. return same rows. solve problem, have close mysql connection , make new mysql connection everytime. workable code looks this; def main(): while true: connectmysqldb_tagem() querytable() closedbconnection() time.sleep(1) how can avoid making new connection everytime in order latest rows? pass sql_no_cache in select query, or turn off on session level: cursor.execute("set session query_cache_type = off") see also: how turn off mysql query cache while using sqlalchemy? mysql - force not use cache testing speed of query hope helps.

casting - why does gcc(default version on openSUSE 11.3) give an error on the statement int *p=malloc(sizeof(int));? -

malloc returns void pointer.so why not working me without typecasting return value? error pretty clear said gcc not allowing conversion void* int*. in c, don't have cast. in fact it's bad idea cast there since can cause subtle errors. however, casting is required in c++ first guess, you're somehow invoking c++ compiler. perhaps source files *.cpp or *.c both of may auto-magigically treated c++ rather c. see here more detail: c++ source files conventionally use 1 of suffixes ‘.c’, ‘.cc’, ‘.cpp’, ‘.cpp’, ‘.c++’, ‘.cp’, or ‘.cxx’; c++ header files use ‘.hh’, ‘.hpp’, ‘.h’, or (for shared template code) ‘.tcc’; , preprocessed c++ files use suffix ‘.ii’. gcc recognizes files these names , compiles them c++ programs if call compiler same way compiling c programs (usually name gcc). the fact knows you're trying convert void* int* means have valid malloc prototype in place can't see being other imposition of c++ rules.

c# - Getting Top 3 from Mysql table based on Condition/Value -

i need top 3 forwards,top 3 midfielders,top 4 defenders based on soccer players position i have separate table position structure of position table positionid , positionname 1 tor(which means goal keeper) 2 abwehr(which means defenders) 3 mittelfeld(which means midfielders) 4 angriff(which means forwards) and have soccerplayers table there name(player name),positionid,tscore(player score) i need top 3 players each position based on tscore any query suggestion ?? well can try query set: (select name, positionid, tscore soccerplayers positionid = 1 order tscore limit 3) union (select name, positionid, tscore soccerplayers positionid = 2 order tscore limit 4) union (select name, positionid, tscore soccerplayers positionid = 3 order tscore limit 3)

c# - Downloading files not affecting UI -

we downloading files using httpclient because our backend requires certificate. i have control - filerow which ui element code-behind methods file downloading, one: if (fileisdownloaded == false) { await coreapplication.mainview.corewindow.dispatcher.runasync(windows.ui.core.coredispatcherpriority.low, () => { datamanager.instance.downloadfile(this); }); } if (thumbnailisdownloaded == false) { await coreapplication.mainview.corewindow.dispatcher.runasync(windows.ui.core.coredispatcherpriority.low, () => { datamanager.instance.downloadthumbnail(this); }); } downloading single item fine when click download ( 50 items ) whole ui starts freeze. as can see, have tried give requests low priority - still same result. answers common questions: 1) yes files should downloadable @ 1 time, not 1 after another. 2) datamanager.instance.downloadthumbnail(this) - give refference cu

what is a "Valid System process" for mac and windows. (java ProcessBuilder) -

i trying work out semantics of using java processbuilder call operating system processes , read line out of javadocs start command : "this method checks command valid operating system command. commands valid system-dependent, @ least command must non-empty list of non-null strings." tell me, considered valid process mac , windows? can found on path variable? is can found on path variable? yes is; although can specify full path of command if (such "/bin/ls" ). test if of course check if file in question regular file , has execution permissions. note: launch "real" process, will not launch via command interpreter; such don't attempt use pipes, file globs, shell builtins etc: interpreted sh / cmd .

android - How to pause thread on button click? -

this code use pause thread removecallbacks here permanent kill thread process. want use in place of customhandler.removecallbacks(updatetimerthread) pause thread. may can use 'wait() and notify()`. how puase thread? button2.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { // todo auto-generated method stub customhandler.removecallbacks(updatetimerthread); button.setvisibility(view.visible); } }); this thread private runnable updatetimerthread = new runnable() { int secs; @override public void run() { // todo auto-generated method stub timeinmillisecond = systemclock.uptimemillis()- starttime; updatedtime = timeswapbuff+timeinmillisecond; secs = (int)(updatedtime/1000); int mins = secs/60; secs = secs % 60; int milliseconds = (int)(updatedtime % 10000); textview.settext( string.format(&quo

ios - [PhoneGap]preventing bounce ONLY in the main Window -

Image
i using latest version of phonegap (3.4) , ios7.1 beta3, , find body (maybe call ui view element) have bad property of bounce pic below, , want disable it. tried search on website, , find only <preference name="disallowoverscroll" value="false" /> works me, find preference make bounce disabled in elements in app, , want disable body`s bounce pic below, , keep bounce in div elements. is there way solve issue out? there way used achieve this. it's not conventional because it's dealing native coding. in mainviewcontroller there method named webviewdidfinishload. include this thewebview.scrollview.bounces= no; inside method. - (void)webviewdidfinishload:(uiwebview*)thewebview { // black base color background matches native apps thewebview.backgroundcolor = [uicolor blackcolor]; thewebview.scrollview.bounces= no; return [super webviewdidfinishload:thewebview]; } as ios native code, this'll work in phonegap/cordo

Up Navigation from Actionbar in Android -

in android app using up navigation icon on actionbar. in child activity have set actionbar actionbar = getactionbar(); actionbar.setdisplayhomeasupenabled(true); in manifest have set <activity android:name="app.sclms.useraccount" android:label="@string/app_name" android:parentactivityname="app.sclms.mainmenu"> <meta-data android:name="android.support.parent_activity" android:value="app.sclms.mainmenu" /> </activity> but whenever click on icon application exited. what missing here, don't understand. please read section: http://developer.android.com/training/implementing-navigation/ancestral.html#navigateup specifically, add code: @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { // respond action bar's up/home button case android.r.id.home: navutils.navigateupfromsame

objective c - ios Core data bug with predicate -

i have strange behaviour core data. i have entity card , have nsnumber property idobject when want change info in card, try find similar card in coredata, work, , not. mean next: nsfetchrequest *request = [nsfetchrequest fetchrequestwithentityname:@"card"]; nspredicate *predicate = [nspredicate predicatewithformat:@"idobject == %@", objectid]; request.predicate = predicate; nserror *error; nsarray *objects = [self.backgroundmanagedobjectcontext executefetchrequest:request error:&error]; sometimes code return objects array, return nil. add next code after previous part of code: request.predicate = nil; nsarray *cards = [self.backgroundmanagedobjectcontext executefetchrequest:request error:nil]; error nil, must fine. , cards array has card idobject , try find. if try execute next code several times: nslog(@"idobject -%@-", objectid); nsfetchrequest *request = [nsfetchrequest fetchrequestwithentityname:@"card"]; nspredicate

javascript - Angular JS, 'nomod',Module '{0}' is not available! You either misspelled -

this code in index.html <html ng-app=""> <head> <link rel="stylesheet" href="css/app.css"> <link rel="stylesheet" href="css/bootstrap.css"> <script src="lib/angular/angular.js"></script> <script src="js/phonecontrollers.js"></script> <title ng-bind-template="google phone gallery:{{query}}">google phone gallery</title> </head> <body ng-controller="phonelistctrl"> <div class="container-fluid"> <div class="row-fluid"> <div class="span2"> search: <input ng-model="query"> sory by: <select ng-model="orderprop"> <option value="name">alphabetical</option> <option value="age">newest</option>

angularjs - Directive's isolated scope variables are undefined if it is wrapped in a directive which has in its template ng-if and tranclusion enabled -

i facing issue demonstrated in following example: http://jsfiddle.net/nanmark/xm92p/ <div ng-controller="democtrl"> hello, {{name}}! <div my-wrapper-directive> <div my-nested-directive nested-data="namefornesteddirective"></div> </div> </div> var myapp = angular.module('myapp', []); myapp.controller('democtrl',['$scope', function($scope){ $scope.name = 'nadia'; $scope.namefornesteddirective = 'eirini'; }]) .directive('mywrapperdirective', function(){ return { restrict: 'a', scope: {}, transclude: true, template: "<div ng-if='isenabled'>hello, <div ng-transclude></div></div>", link: function(scope, element){ scope.isenabled = true; } } }) .directive('mynesteddirective', function(){ return { restrict: 'a',

parsing - Simple php dom parser doesn't work with local url -

does not work url. problem? error - php notice: trying property of non-object <?php include ('config.php'); include('simple_html_2012.php'); echo file_get_html('http://www.localhost/test/test.html')->plaintext; ?> if trying parse google.com, works. echo file_get_html('http://localhost/test/test.html')->plaintext; or echo file_get_html('http://127.0.0.1/test/test.html')->plaintext;

jquery - selecting children selector for older browser? -

this ( > selector) supported ie9 : .cc > *{ /* css style */ } what can use older browser (ie6, ie7, ie8)? i tried $('.cc').children() seems not supported? pretty sure > has been around since ie6, actually. edit: correction: ie7. ie6 didn't have particular selector. if spend hours caring ie6, we'll never done.

php - Get a file's character encoding without reading entire file into memory -

i know if need character encoding of file in php can var_dump (mb_detect_encoding (file_get_contents ("somefile.txt"))); however, doing big file not practical eats big chunk of memory. is there way of determining character encoding reliably without having read entire file memory? no, there no way of determining character encoding reliably without having read whole file. reason: character codes differing ascii (which still base part of many encodings) randomly distributed in file. might chance in part did not read. of course, encodings easy identify beginning, not question here. (giving chance accept answer solution, although answer might have been given in comment, should not (so policy).)

java - jcifs.smb.NtStatus - NT_STATUS_INVALID_HANDLE -

i have question following error / error code means: nt_status_invalid_handle in class jcifs.smb.ntstatus. this " the java cifs client library " i trying figure out when error occurs. happen when file not found in shared path? or occur when shared folder connection gets lost? if aware of this, help! i went through source code available here regards, girish when fid not exists smb error code -> errbadfid(0x0006) nt status code -> status_invalid_handle(0xc0000008) posix equivalent -> enoent description -> fid supplied invalid. fid : 16-bit value server message block (smb) server uses represent opened file, named pipe, printer, or device. fid returned smb server in response client request open or create file, named pipe, printer, or device. smb server guarantees fid value returned unique given smb connection until smb connection closed, @ time fid value may reused. fid used smbclient in subsequent smb commands identify

html - Position body background starting at container end -

i have container 980 pixels wide. want background of main page (the body) start right of container , continue far right browser window goes, or until image ends (whichever sooner). it position background image this: body { margin: 0; font-size: 10pt; line-height: 1.4em; text-align: center; background: url(images/image.jpg) no-repeat 980px top; } then background image start 980 pixels left hand edge of browser window means work on 1 particular screen resolution. i tired positioning element background went off edge of screen , when tried hide overflow, meant couldn't scroll main page see content on low resolution or high zoom. is there way take centre , add 490 pixels start end of container? i'd prefer able (x)html , css wihout having resort of javascript. one of many ways solve create div task hold background. can place div want using position: absolute; fiddle

How can I copy files which is not exists? -

i want write .bat file, have 2 folders names , b. have pictures on , , want transfer them b , want transfer pictures not exists. pictures names 1.jpg 2.jpg ,,,,90.jpg how can that? possible? in folder there 1.jpg 2.jpg ... 40.jpg in folder b there 1.jpg 2.jpg ... 90.jpg i want transfer 41.jpg,,,,,90.jpg code should dynamic because file names changed next time. thanks you can enumerate pictures in a for %%f in (a\*) then check whether exist in b if not exist "b\%%~nxf" and copy them if don't copy /y "%%f" b in summary: for %%f in (a\*) if not exist "b\%%~nxf" copy /y "%%f" b that is, if understood correctly want copy images not present in b. question little confusing in regard because seem want copy images b don't exist in a, doesn't make sense.

iphone - how to put the JSON data into UICollectionView in ios -

i try images json url , place on uicollectionview but don't how images json #import "viewcontroller.h" #import "customcell.h" @interface viewcontroller () { nsarray *arrayofimages; nsarray *arrayofdescriptions; nsmutablearray *json; nsstring *img; nsmutabledata *webdata; nsurlconnection *connection; } @end @implementation viewcontroller - (void)viewdidload { /**/ [[self mycollectionview]setdatasource:self]; [[self mycollectionview]setdelegate:self]; nsstring *urlstring=[nsstring stringwithformat:@"http://ielmo.xtreemhost.com/array.php"]; nsurl * url=[nsurl urlwithstring:urlstring]; nsurlrequest *req=[nsurlrequest requestwithurl:url]; connection=[nsurlconnection connectionwithrequest:req delegate:self]; if(connection) { nslog(@"connected"); webdata=

sql - MySQL group_concat with where clause -

i got problem group_concat , filter. in table got module names linked client. want search clients module name, in group concat still want see modules owned client. display clients modules, display specific module. can't figure out how make them both work together. any suggestions on how expected result?? these basic tables , query tried along results , result wanted client +--------------------+ | id | name | +--------------------+ | 1 | client1 | | 2 | client2 | | 3 | client3 | | 4 | client4 | +--------------------+ module +--------------------+ | id | name | +--------------------+ | 1 | module1 | | 2 | module2 | | 3 | module3 | | 4 | module4 | +--------------------+ client_module +-------------------------+ | client_id | module_id | +-------------------------+ | 1 | 2 | | 1 | 3 | | 2 | 1 | | 2 | 2 | | 2 | 4

How to render data in a drop down using JQuery and Ajax in Backbone.Marionette -

i'm using backbone , marionette web app, i'm trying populate drop down menu json after option has been selection. so user selects account type, ajax request fired , data returned. however i'm stuck @ populating relevant drop downs returned data. this ajax request triggered after user selects account: accountselect: function () { var accountcode = $("select#accountcombo").val().tostring(); var jsonurl = "webapp/json?accountcode=" + accountcode; $.ajax({ url: jsonurl, type: "post", data: { accountcode: $("select#accountcombo").val() }, datatype: "text", success:function(data) { return { states: _.pluck(data.states, '

shell - Bash executing multiple commands in background in same line -

when try execute -bash-3.2$ cd /scratch/;nohup sh xyz.sh>>del.txt &;exit i getting following error.. -bash: syntax error near unexpected token `;' i trying run detached process using nohup .. & . ';' works fine other commands except nohup sh xyz.sh>>del.txt &; can tell problem here . thanks you can try putting command between quotes if in bash shell cd /scratch/ ; `nohup sh xyz.sh>>del.txt &` ; exit you can take @ question

Spring Batch retry-policy, and skip-policy issue -

i have following step in batch job. <batch:step id="parse-step"> <batch:tasklet> <batch:chunk reader="xmlcommonreader" processor="xmlcommonprocessor" writer="xmlcommonwriter" commit-interval="1"> <batch:skip-policy> <bean class="org.springframework.batch.core.step.skip.alwaysskipitemskippolicy" scope="step"/> </batch:skip-policy> <batch:retry-policy> <bean class="org.springframework.retry.policy.neverretrypolicy" scope="step"/> </batch:retry-policy> </batch:chunk> </batch:tasklet> <batch:next on="failed" to="file-failed-step"/> <batch:next on="completed"

Behaviour I don't understand in Python mixings comprehension lists and lambda-functions -

this question has answer here: weird behavior: lambda inside list comprehension 5 answers i don't understand behaviour of piece of code, involving comprehension list on lambda functions call method in different objects. happened in large program, question made nonsensical toy-case show point: class evaluator(object): def __init__(self, lft, rgt): self.lft = lft self.rgt = rgt def eval(self, x): return self.lft + x * (self.rgt - self.lft) if __name__ == "__main__": ev1 = evaluator(2, 3) ev2 = evaluator(4, 5) ev3 = evaluator(6, 7) funcs = [lambda x:ev.eval(x+0.1) ev in (ev1, ev2, ev3)] print([f(0.5) f in funcs]) the output [6.6, 6.6, 6.6] , means method in ev3 1 being evaluated time. instead of [2.6, 4.6, 6.6] , have expected. surprises me if rid of lambda-function, behaviour fine: class evalua

javascript - find class name by regex -

i want class match key regex, when search btn, : <div class="btn"> // match <div class="span4"> // not match <div class='btnbtn-success'> // not match </div> <div class=' bbtn '> // not match </div> <div class=' bbtn '> // not match </div> <div class=' b btn '> / match </div> <div class='cbbtn '> // not match </div> <div class='btn '> // match </div> <div class=' bbtn '> // not match </div> <div class=' btn'> // match </div> <div class=" btn "> // match </div> <div class='hello btn '> // match </div> <div class=" btn "> // match

Python 3 - Saving a google spreadsheet as a csv -

i trying save private google spreadsheet csv. have found thread has addressed ( download spreadsheet google docs using python ), answers date 2012. there solution have tried used, running errors. code using import csv import gspread username = "username" //used actual username, password , doc-id in python scriptpassword = "password" docid = "doc-id" client = gspread.login(username, password) spreadsheet = client.open_by_key(docid) i, worksheet in enumerate(spreadsheet.worksheets()): filename = docid + '-worksheet' + str(i) + '.csv' open(filename, 'wb') f: writer = csv.writer(f) writer.writerows(worksheet.get_all_values()) this error idle throwing up writer.writerows(worksheet.get_all_values()) typeerror: 'str' not support buffer interface as must have realized, pretty new python , trying solve problem. can point out issue code using? in python 3, open file in text mode, , set newline 

pinvoke - How to set c# struct attribute (StructLayoutAttribute) globally? -

i'm working on c# p/invoke project , defining lot of structures. each structure, i'm using: [system.runtime.interopservices.structlayoutattribute(system.runtime.interopservices.layoutkind.sequential, pack = 1)] but i'd set attribute( pack = 1 ) once structures share same setting, how can that? thanks, fei you cannot that. there no global switch. have set pack explicitly on every struct. you can @ least make code more concise adding using statement, , writing structlayout rather structlayoutattribute : using system.runtime.interopservices; .... [structlayout(layoutkind.sequential, pack = 1)]

android - Interrupted AsyncTask -

i have asynctask make call webservice using defaulthttpclient(). if execution stops reason (i.e. when i'm debugging , press "terminate"), next call result in "refused connection" or timeout. code called function within of doinbackground() : string response = null; httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url); soapenvelope env = new soapenvelope(); env.setservicenamespace(namespace); env.setmethodname(methodname); env.setparams(params); stringentity se = new stringentity(env.serialize(), http.utf_8); se.setcontenttype("text/xml"); httppost.setentity(se); httpresponse httpresponse = httpclient.execute(httppost); httpentity resentity = httpresponse.getentity(); it stuck on httpresponse httpresponse = httpclient.execute(httppost); restarting app doesn't work. if restart device works again. why behave this?

webstorm - JetBrains Web Strom IDE, not able to copy -

Image
i not able cut copy or thing shortcut keys, commands "meta + ", ex: copy , usual or general command "ctrl + c", here, showing "meta + c". wise, every command meta. (note: using free version of webstorm ide) you need changes keymap webstorm . goto files->settings , open 1 dialog box in keymap option need changes . enter image description here

Git Clone Error fatal: index-pack failed fatal: error in sideband demultiplexer -

i'm trying clone git repository residing @ remote windows server 2008 machine , i'm running following daemon command share repository git daemon --base-path='/d/test/' --export-all --reuseaddr --informative-errors --verbose but i'm able clone repository windows 7 machine once , thereafter if try clone repository throwing me errors fatal: index-pack failed fatal: error in sideband demultiplexer using below command clone repository: git clone git://remoteipaddress/repository i'm able clone repository within windows server machine above command. updating newer git daemon should resolve issue. did me.

mysqli - How to free memory in php class method -

i present part of mine class works correctly. want advice in: how release resources $result->free() method in function , place them in code. is useful write @ end of function, when return value before? when have placed before return operator, function doesn't work. thanks in advance! require_once 'ggc_config.php'; class ggc { public static function executequery($querystring, &$id){ $mysqli = new mysqli(_ggc_host_ , _ggc_user_ , _ggc_password_ , _ggc_db_); if (mysqli_connect_errno()) { echo("connect failed: ". mysqli_connect_error()); return 0; }//if $mysqli->set_charset("utf8"); $result=$mysqli->query($querystring); if ($result===true){ $id=$mysqli->insert_id; return 1; }//if else{ return 0; }//else $result->free(); $mysqli->close();

windows - How to sign assembly and exe files in the installer package? -

i've made application test certificate , installer(with installshield limited edition). in signing option of project i've chosen options * sign clickonce manifests, * sign assembly. in installer project in signing tab i've chosen same digital certificate file, entered password, , option sign output files : setup.exe , windows installer package. option sign files in package not available. after installing program, setup.exe , msi file signed. how make exe files , assemblies digital signature? if referring assemblies installing, need sign them before building installer. visual studio can sign, or can set post build step sign them manually signcode. i recommend visual studio. http://msdn.microsoft.com/en-us/library/9sh96ycy(v=vs.80).aspx http://msdn.microsoft.com/en-us/library/ms247123(v=vs.90).aspx

java - Input missmatch exception -

so far have text file looks this: // comment, lines start // // (and blank lines) should ignored [electrictool data] // data rechargeable, power, timesborrowed, onloan, toolname, itemcode, cost, weight true,18v,12,false,makita bhp452rfwx,rd2001,14995,1800 etc... and following code go through text file: public void readdata() { try{ filedialog filedialogbox = new filedialog(myframe, "open", filedialog.load); filedialogbox.setvisible(true); string filename = filedialogbox.getfile(); file datafile = new file(filename); scanner scanner = new scanner(datafile); string lineoftext; string typeofdata=""; while(scanner.hasnext()) { lineoftext = scanner.nextline().trim(); electrictool electrictool = new electrictool(); if (lineoftext.startswith("[electrictool data]")){ typeofdata="electrictool"; } else if (!lineoftext.isempt

python - How to bulk/batch insert in cassandra using cqlengine? -

i want use bulk insert in cassandra performance purposes. have 10 grabber servers producing data , insert them in master server. want that, instead of direct insert database, every grabber server collect data , insert main server once. don't know if it's batch insert or bulk insert or both. how this? i'm using python , cql engine , cassandra in windows 8 i've found batch insert don't know it's should or not: http://www.datastax.com/docs/1.0/references/cql/batch here cqlengine batch query docs: https://cqlengine.readthedocs.org/en/latest/topics/queryset.html#batch-queries

javascript - Preprocessor directives must appear as the first non-whitespace character on a line (KendoUI) -

i have problem in script part of mvc. <script> @html.actionlink("edit", "edit", new { id= #= userid # }) <script> when write @ , # gives error. kendoui grid (opensource), can table id using #= userid # . need id. how? may problem in merging client side logic , backend. @html.actionlink() this asp.net backend code, generates before client side logic run, but #= userid # is client side code, , run in browser kendo grid system. in case try run backend generator through client side kendo grid, impossible. to fix problem , had functionality want, need or pass userid across backend variable @userid , or paste simple html code <a href="http://url" id="#= userid #">text</a>

javascript - JQGrid grouping while using loadonce issue -

first timer here... in advance. i have jqgrid page. jqgrid (latest version... downloaded yesterday) setup: $(function() { $("#list").jqgrid({ caption: "my first grid", url: "demo_data.php", loadonce: true, datatype: "xml", mtype: "get", pager: "#pager", height: "100%", autowidth: true, altrows: false, rowtotal: 2000, rownum: 10000, rowlist: [10, 25, 50], viewrecords: true, autoencode: true, colnames: ["publisher", "first name", "last name", "email"], colmodel: [ {name: "pid"}, {name: "fname"}, {name: "lname"}, {name: "email", summarytype:'count',summarytpl:'<b>{0} item(s)</b>'} ], sortname: "pid",