Posts

javascript - Delivering precompiled Handlebars Template on demand via JSON -

i want deliver handlebars templates ember.js application on demand via ajax -request. i'm able compile on server , i'm able deliver following output ( function ) string : ember.templates["authentication"] = ember.handlebars.template(function anonymous(handlebars,depth0,helpers,partials,data) { this.compilerinfo = [2,'>= 1.0.0-rc.3']; helpers = helpers || ember.handlebars.helpers; data = data || {}; var buffer = '', stack1, hashtypes, options, helpermissing=helpers.helpermissing, escapeexpression=this.escapeexpression; data.buffer.push("<h1>hooray! works!</h1>\r\n"); hashtypes = {}; options = {hash:{},contexts:[depth0],types:["id"],hashtypes:hashtypes,data:data}; data.buffer.push(escapeexpression(((stack1 = helpers.outlet),stack1 ? stack1.call(depth0, "main", options) : helpermissing.call(depth0, "outlet", "main", options)))); return buffer; }); this string i'...

jsf - rich:scrollableDataTable with a 2 row header -

i'm developping scrollabledatatable header having 2 row in it. <rich:scrollabledatatable ... <rich:column...> <f:facet name="header"> <s:div> <h:panelgrid columns="1"> <h:outputtext value="hi" /> <h:outputtext value="all" /> </h:panelgrid> </s:div> </f:facet> ... </rich:column> but see 'hi' on video. in html produced see both rows, infact looking better in html code using web-browser-debug (f12) see header of column has height fixed 20px or 21px. to see second header-row must enlarge changing (using web-browser-debug): .rich-sdt-header-cell-body (height : 40px) gridbodytemplate (top: 42px) header:normalbox (height: 42px) gridheadertemplate (height: 42px) how can in xhtml? other scrollabledatatable&columns have header composed 1 row (and goes me). need, in 1 situation, have header more taller. possible, , how? thanks!...

c# - Local NuGet - Notify on newer package? -

i running local nuget on our network folder/share. the official nuget source notifies me if there newer release of package i'm using, it's not work locally. can receive new releases via 'package manager console' , 'manage nuget packages'. is possible receive update notifcations locally or there reason why nuget not notifying me locally? i didn't found way nuget notifies me when using local network folder. easiest way use private gallery , ci server teamcity

java - System.out.println() and BufferedReader mixing up output in console -

i working on program, uses bufferedreader read input, , system.out.println() output. here code: public void choosemethod() throws ioexception{ int in = 0; while(true){ system.out.println("what want do? (0 exit, 1 read bank account, 2 write bank account, 3 read bill, 4 write bill): "); in = integer.parseint(cin.readline()); if(in == 0){ break; }else if((in < 0) || (in > 4)){ system.out.println("invalid choice."); }else if(in == 1){ showbankaccount(); }else if(in == 2){ insertbankaccount(); }else if(in == 3){ showbill(); }else if(in == 4){ insertbill(); } } dbm.close(); } public void insertbankaccount() throws ioexception{ int banknr = 0; int sortcode = 0; int accountnumber = 0; int balance = 0; int interest = 0; string details; string name; while(...

osx - modify PackageMaker installer variables from a script -

i attempting create mac os x installer (tried both packagemaker , packages) 2 things on install: check if application installed (by looking through folder structure in applications directory) , set component selections accordingly. setting destination folder of package according folder found in 1. plugin needs go subdirectory of application folder. the former seems it's relatively simple, can add script requirement choice associated each package , let result drive state of component checkbox. the latter feels tricky. know how figure out location of application first step, have no idea whatsoever of how change destination folder that's set in package. can somehow access installer variables preflight script? the idea have installing temp directory , moving stuff in post flight script, seems error prone , awkward. rule out possibility make installation paths editable (in case user has several instances of software we're plugging installed , picked wrong one). ...

iphone - KVC vs fast enumeration -

which of following faster , why? cgfloat sum = 0; (uiview *v in self.subviews) sum += v.frame.size.height; or cgfloat sum = [[self.subviews valueforkeypath:@"@sum.frame.size.height"] floatvalue]; really, lot of how elegant (or clever) language comes down how avoids loops. for, while; fast enumeration expressions drag. no matter how sugar-coat them, loops block of code simpler describe in natural language. "get me average salary of of employees in array", double totalsalary = 0.0; (employee *employee in employees) { totalsalary += [employee.salary doublevalue]; } double averagesalary = totalsalary / [employees count]; versus... fortunately, key-value coding gives more concise--almost ruby-like--way this: [employees valueforkeypath:@"@avg.salary"]; kvc collection operators allows actions performed on collection using key path notation in valueforkeypath: . any time see @ in key path, denotes particular aggregate funct...

Will this CUDA code execute in-order and asynchronously? -

will code below execute in order? (i cannot put device-to-device copy of cudamemcpy2darraytoarray() in stream ) will code below execute asynchronously? ( cudamemcpy2darraytoarray() not have asynchronous counterpart) i know code sample can implemented more efficiently, it's merely intended example. for( i=0; i<10; i++ ) { cudamemcpy2darraytoarray( dst, src ); // device device copy. cudabindtexturetoarray( texture_reference, dst, ... ) // bind dst texture. kernel<<< dimgrid, dimblock, 0, stream >>>( out ) // compute array. cudamemcpy2dtoarrayasync( src_p, out, stream ) // copy result src. } since kernel calls , cudamemcpy2dtoarrayasync calls use same stream, processed synchronously. 1 streams can't multiple things @ same time. however, if wanted multiple streams work, of form: nstreams = 8; cudastream_t streams [nstreams ]; (unsigned int ii = 0; ii < nstreams; ++ii) handle_e...