Posts

Showing posts from March, 2014

php - symfony2 session persistance -

this has been bugging me week now. i cant seem large php array persist in session on page redirect. for ($i=1;$i<$data['weeks'];$i++) { $instances[] = array( 'start' => $starttime + ((86400 * 7) * $i), 'end' => $starttime + ((86400 * 7) * $i) + $duration, 'venueid' => $data['venueid'] ); } $request->getsession()->set('addclass-1-instances', $instances); return new redirectresponse ($this->generateurl( 'class_add', array( 'clubid' => $this->club->clubid, 'step' => 4, 'classtype' => 1 ) )); this works when array small (1-10 elements) fails when larger (1000 - 2000 elements). if dump out session object after adding it, can see in session attributes collection. var_dump($request->getsession()); protected 'attributes' => & array (size=6) 'addclass-1-instances

c# - Windows Phone - Listbox items on array -

i have listbox on windows phone app, listbox receive values collection. put listbox items on array. so, need value first list item, received value app1.pivotpage1+fields . the collection item want show fnome . how it? my code: private void button_click(object sender, routedeventargs e) { string[] array = new string[list2.items.count]; (int = 0; < list2.items.count; i++) { object s = list2.items[i]; array[i] = s.tostring(); } tjsonobject jobject = new tjsonobject(); tjsonpair jpair = new tjsonpair("test", array[0]); tjsonpair jpair1 = new tjsonpair("test1", "test1"); tjsonarray jarray = new tjsonarray(); jobject.addpairs(jpair); jobject.addpairs(jpair1); jarray.add(jobject); messagebox.show(jarray.tostring()); } my collection: public observablecollection<fields> items { get; set; } public class fi

java - JBoss - Loading a new module at runtime -

is possible load added module @ run-time? i have added optional module ear, started jboss , added optional module @ run-time using cli. load module though had restart jboss not looking for. is there way load without restart using jboss cli? you can try jrebel , hot deploy stuff have trial version. if using jboos 7.0.1 (community project). you can go jboss administrative panel, there in profile settings open core - deployment scanners. turn on auto deploy-exploded (set true), , set scanner time per requirement ( default 5000 ms) . it.

django - Create View - access to success_url from templates -

say have: class mycreate(createview): template_name = 'template.html' success_url = reverse_lazy('blabla') form_class = myform and suppose in template want add back button. lead me same page success_url . solution override get_context_data in mycreate class , add {'back': self.get_success_url()} context . the implications have more createviews , had create contextmixin back button. there other easier solution? accessing success_url directly in template? thanks as can see in django (1.7) implementation of contextmixin , must have access view instance our templates: def get_context_data(self, **kwargs): if 'view' not in kwargs: kwargs['view'] = self return kwargs so can access success_url in templates: {{ view.get_success_url }}

javascript - Datepicker postbacks when lose focus -

when click textbox datetimepicker popups after when click outside of picker close it, page postbacks textchange doesn't fired. either should not postback page or textchange fired fix here. know how solve problem? <script> $(function () { $("#<%=dpstartdatetime.clientid%>").datepicker({ autoclose: true, weekstart: 1, language: "tr" }).next().on(ace.click_event, function () { $(this).prev().focus(); }); }); </script> <asp:textbox id="dpstartdatetime" runat="server" cssclass="form-control date-picker" data-date-format="dd.mm.yyyy" autopostback="true" ontextchanged="dpstartdatetime_textchanged"></asp:textbox><span class="input-group-addon"><i class="fa fa-calendar bigger-110"></i></span> change autopostback="true" `autopostback="false"'

angularjs kendo datasource data length zero -

i'm trying grid (created angular directive) populated data, not populating. here's grid declaration: <div id="daytypesgrid" kendo-grid k-options='daytypesgridoptions'></div> here's code angular controller: $scope.daytypesgridoptions = { schema: { model: { id: "description", fields: { description: { editable: false, nullable: false }, numberofdays: { type: "number", validation: { required: true, min: 0} } } } }, columns: [{ field: "description", title: "day type" }, { field: "numberofdays", title: "number of days" }] }; so far good. grid instantiated, , see 2 columns. , angular controller executes data fetch call, , store result in array $scope.viewmodel.daytypes. using browser dev tools, can see $scope.viewmodel.daytypes indeed contains

spawn - Unable to make executable that properly communicates with node.js -

i'm testing communication between node.js , executables launched child processes. executable launched within node.js via child_process.spawn() , output monitored node.js. i'm testing capability both on linux , windows oss. i've spawned tail -f /var/log/syslog , listened output, own executables can't seem write correctly stdout (in whatever form exists when captured node.js). test code: #include <iostream> #include <stdio.h> #include <unistd.h> int main() { using namespace std; long x = 1; while (true) { fprintf(stdout, "xtime - %ld\n", x++); usleep(1000000); } } (note: include s may useless; i've not checked them) stdout output not automatically flushed (at least on *nix) when stdout not tty (even if there newline in output, otherwise newline flushes when stdout tty). so can either disable stdout buffering entirely via setbuf(stdout, null); or can manually flush output

ruby on rails - Daemon eats too much CPU when being idle -

i using blue-daemons fork of daemons gem (since second 1 looks totally abandoned) along daemons-rails gem, wraps daemons rails. the problem daemon eats cpu when it's idle (10-20 times higher it's performing job). by being idle, mean have special flag - status.active? . if status.active? true , perform job, if it's false , sleep 10 secs , iterate next step in while($running) do block , check status again , again. i don't want hard stop job because there sensitive data , don't want process break it. there way handle high cpu usaget? tried sidekiq, looks it's primary aim run jobs on demand or on schedule, need daemon run on non-stop basis. $running = true signal.trap("term") $running = false end while($running) while status.active? ..... lots of work ..... else sleep 10 end end

mysql - Is it valid to use DISTINCT two times in a single query -

i'm getting following error: mysql error 1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'distinct r. roomtype roomtype , i1. meal_plan mealplan , i1.`bed_t' @ line 3 my code is select distinct h.`hotelname` `hotelname` , distinct r.`roomtype` `roomtype` , i1.`meal_plan` `mealplan` , i1.`bed_type` `bedtype` , i1.`roomrate` `roomrate` , i1.`pax` `pax` , i1.`childrate` `childrate` , i1.`childrate1` `childrate1` , i1.`childrate2` `childrate2` , i1.`childrate3` `childrate3` , p.`profitmarkup_type` `profit_type` , p.`applyprofit_val_room` `applyprofit_val_room` , p.`applyprofit_val_bed` `applyprofit_val_bed` `hoteldetails` h inner join `roomdetails` r on h.`hotelname` = r.`hotelname` inner join `inventorypolicy` i1 on i1.`hotel_name` = h.`hotelname` , i1.`room_plan` = r.`roomtype` , i1.`bed_type`=r.`bedtype` , i

c# - Updating UITableView in Xamarin iOS when the dataSource for the table changes dynamically -

i have uitableview , have set datasource table using 'list'.i know size of list , have set number of cells of table same list length.i fetching data table in background meaning list data changes dynamically when table being displayed. when there fast swipe user,the tableview displays empty cells data still being fetched. issue: when reach end of tableview , when tableview still displaying empty cells,and try scroll cell redrawn bottom showing data meaning data 'refreshed' bottom of tableview. what tried: tried reloading tableview,reloading cells data backend,but still issue persists.i tried reloading tableview using invokeonmainthread,but still problem persists. what think happening: data fetching completed in background when tableview displaying empty cells , when scroll again cells 'repainted' display data.i using reusable cells in tableview. is there way reload cells data , update cells.that is,when tableview displaying empty cells , data fetching

floating point - How can I convert uint8_t and uint16_t into floats in c++? -

i read uint8_t , uint16_t types registers "cast" them floats. wich optimal way? there's no need cast; integer types implicitly convertible floating-point types. uint8_t u8 = something; uint16_t u16 = whatever; float f1 = u8; float f2 = u16; 8 , 16-bit integer values should represented exactly. larger types might lose precision.

java - where to use ArrayList and where to use simple array specially for integer -

can please explain in situation supposed use arraylist instead of simple array , diffrence between these 2 , how intialise arraylist.i new java use example if possible whenever don't know size created, can use arraylist.. if want speed access, can use array. (indexing in array faster arraylist).. and , arraylist reduces complexity of coding... arraylist can initialized creating object arraylist class arraylist al = new arraylist(); al.add("string"); || al.add(number); can used add values arraylist..

php - Android Studio - Login/Register stuck at Checking Network -

i started learning android studio , working on app. first part of app require login or registration continue, suppose directed main/home screen. create process followed tutorial everything seems fine until try registering or reset password. first tested in wamp on local host , moved live server, i've changed urls , edited config file. i've added internet , wifi permissions in manifest file well. i can show code im not sure code has seen me out, theres database files, android studio files etc. if take @ tutorial know more or less im going wrong. any appreciated, thanks! <?php /** * database config variables */ define("db_host", "127.0.0.1"); define("db_user", "root"); define("db_password", "iputmypassword"); define("db_database", "myapp_login_api"); ?> i remember when connect device local wlan network able request localhost via 10.0.2.2. in configuration or in activity when

java - joda datetime deserialization -

i trying figure out if joda datetime serializable (when using default java serializable) or need provide own serialization implementation (using externalizable or third party serialization library). currently, tried serializing , deserializing class containing instance variable of type joda datetime serialzation exception datetime. relevant section of class public class testclass implements serializable { private datetime datetime; protected datetime getdatetime() { return datetime; } protected void setdatetime(datetime datetime) { this.datetime = datetime; } joda datetime serializable - error you're sharing project issue. try cleaning , building project again see if issue gets resolved. there other errors in project or after run project?

spring - @Inject , @AutoWired, @Resource & @ManagedProperty : which one should I use ,where and when? -

i'm using hibernate, spring & jsf application. i'm evolving application restfull webservice jersey(jax-rs). need annotated class @component. inside class, need call service grap stuffs database. @component @path("/graphic") public class graphicservice { //@autowired //@inject //participantbo participantbo; or //@managedproperty("#{participantbo}") //private participantbo participantbo; i meet annotations in tutorials don't know/understand meaning. i'd make check-up see if configuration whole application ok or if clean stuffs. most of time, i'm using @ managedproperty annotation include dependency (a servicebo 1 call dao) inside class annotated @managedbean. @managedbean(name="participantcontroller") @viewscoped public class addparticipantbean implements serializable{ private static final long serialversionuid = -6952203235934881190l; @managedproperty(value="#{participan

c# - TimeZoneInfo in Portable Class Library -

i have requirement timezone info of "mountain standard time" portable class library.in wpf application got same below code. timezoneinfo.findsystemtimezonebyid("mountain standard time"); but in pcl, cant see functionality.could 1 please tell me how can achieve same in pcl? thanks in advance. roshil

C++ recursion repeating output -

i have code: #include <iostream> #include <vector> #include <ctime> #include <math.h> #include <string> using namespace std; int main() { srand(time(0)); string command_one; int slot; cout<<"one chip or quit?\n"; getline(cin, command_one); if(command_one=="one chip"){ cout<<"pick slot between 0 , 8 (inclusive)\n"; cin>>slot; if(slot>=0 , slot<=8){ double position=slot; } else{ cout<<"this option invalid!\n"; main(); } } else if(command_one=="quit"){ cout<<"have nice day! :d"; } else{ cout<<"this option invalid!\n"; main(); } } when hits else loop nested in if(command_one=="one chip") returns "this option invalid! 1 chip, multi chip, or quit? option invalid! 1 chip, mul

javascript - angular directive template not loading -

my angular directive template not getting loaded app. js file directive loading fine except html. checked 'net' tab in firebug , not getting called there either. not getting errors. here directive js: angular.module('grid') .directive('grid', function() { return { restrict: 'a', require: 'ngmodel', scope: { ngmodel: '=' }, templateurl: 'scripts/grid/grid.html' } }); here directive html: <div id="game"> <div class="grid-container"> <div class="grid-cell" ng-repeat="cell in ngmodel.grid track $index"></div> </div> <div class="tile-container"> <div tile ng-model="tile" ng-repeat="tile in ngmodel.tiles track $index"></div> </div> finally here index.html meant go <!doctype html> <html> <head> <

Spring Data Rest & JPA -- not rendering results when entities are annotated by methods (works by field annotations) -

i'm attempting spring data rest work entities. implemented repository , can see list of available ones when requesting localhost:8080. however, when attempting execute of repository queries via rest interface (e.g. findall() via localhost:8080/users), response empty. traced issue following: there call org.springframework.data.jpa.mapping.jpapersistententityimpl.getidproperty() (method implemented in base class basicpersistententity) returns null. call made persistententityresourceassembler.getselflinkfor(..). null id property causes null pointer exception further down stack trace, null pointer exception never surfaces app, apart debug log saying "null modelandview". it turns out reason getidproperty() return null because not using field annotations, rather method annotation. @id annotation applied on getter getuserid() , not on filed userid. i don't believe correct behaviour. either jpapersistententityimpl.getidproperty() not configured return correct id

javascript - manually show list of places returned from google places API -

i using google pac give user autocomplete on nearby localities. places api doesn't seem give control on fill type ahead results. adds '.pac-container` in body , positions below text box. control have styling css. also, has rigid behavior empties container , hides on input box blur. whereas want user able select , click button use selected value. i want know if can list of places fetched server , fill them manually in element of choice. may kind of handler allows me achieve this. put "powered google" there well, more control on displaying returned data. there service returns predictions used places-autocomplete: places autocomplete service you may use these predictions create whatever want to, e.g. custom autocomplete behaviour defined on own. you'll find custom implementation(using jqueryui-autocomplete)here: google maps api - autosuggest on hover

ios - iPhone 6 addressable screen size -

the new iphone 6 has been announced, , there multiple posts number of pixels , pixels per inch. that's great, ignores important question developers don't seem finding anywhere. what's addressable screen size? for example, iphone 5 has 4" screen 1136x640 pixels. cool. if i'm programming it, addressable screen size 568x320. if draw line 0,0 568,320 (in landscape mode, full seem, of course) goes across entire display, not half of it. the iphone 6 has 2 new pixel sizes, 1334x750 , 1920x1080 iphone 6 plus. presumably, means addressable screen space programming 667x375 iphone 6 , 960x540 iphone 6 plus. can confirm that? also, simulator has variable size setting, doesn't come preset new iphones. set simulator 1334x750 or 567x375 set layouts iphone 6? the iphone 6 has scale of 2 point size 375 x 667 (not 375 x 567). the iphone 6+ has virtual pixel size of 1242 x 2208 scale of 3. point size 414 x 736.

java - printing 2 times donno why -

i having problem when break out remove part code prints main menu options twice there no error in code , runs why print twice instead of once? public void mainloop() { (int = 0; < 100; i++) { string x; system.out.println("please select option"); system.out.println("............................"); system.out.println("1 add name , number \n2 remove name , number \n3 search name , number \n0 exit"); system.out.println("............................"); x = input.nextline(); if (x.equalsignorecase("0")) { system.out.println("thank you!"); break; } if (x.equalsignorecase("1")) { string name; string number; system.out.println("please enter name below"); name = input.nextline(); system.out.println("please enter number below");

sql - What is the opposite of the in function at mysql? -

with in function can found row specified values: select * table1 value in (1,3,4); but how select values isn't 1,3,4: select * table1 value != (1,3,4); i think looking not in : select * table1 value not in (1,3,4);

java - Spring expression cannot resolve type -

i have service method annotated @postauthorize @postauthorize("haspermission(returnobject, new readuserpermission())") public optional<user> find(string email) { // implementation } as method gets called, spring throws following exceptions: caused by: org.springframework.expression.spel.spelevaluationexception: el1003e:(pos 28): problem occurred whilst attempting construct object of type 'readuserpermission' using arguments '()' @ org.springframework.expression.spel.ast.constructorreference.findexecutorforconstructor(constructorreference.java:190) ~[spring-expression-4.0.0.release.jar:4.0.0.release] @ org.springframework.expression.spel.ast.constructorreference.createnewinstance(constructorreference.java:151) ~[spring-expression-4.0.0.release.jar:4.0.0.release] @ org.springframework.expression.spel.ast.constructorreference.getvalueinternal(constructorreference.java:94) ~[spring-expression-4.0.0.release.jar:4.0.0.release] @ o

arrays - Split() in VBA gives Type Mismatch error -

i'm have error in code below, please can me..the vba sad me instrument invalid qualifier on line lenght, when use function len() don't have error, on function split happens!the vba sad me type mismatch. sub getinstrument() dim instrument string dim splitinstrument() string dim integer dim removespax integer dim tam integer removespax = -1 instrument = range("e3") splitinstrument() = split(instrument) tam = instrument.lenght - 1 = 0 tam if splitinstrument(i) <> "" removespax = removespax + 1 splitinstrument(removespax) = splitinstrument(i) end if next redim preserve splitinstrument(removespax) msgbox splitinstrument() end sub since want tam loop through array, want this tam = ubound(splitinstrument) instead of tam = instrument.lenght - 1

display scrollable text in a Spritekit Scene (Swift) -

what best way display block of scrollable text in spritekit game? within scene. write own algorithm using sklabels seems there should better way. there no component in spritekit out of box, it's quite simple simulate scrolling text handling touches. you have handle limit , paging if want have bouncing, acceleration , others, there plenty of examples around here start from. keep in mind sklabelnode doesn't support multiline out of box, have create own multiline label (basically 1 label per line). if text want render long may struggle create , not smooth, work fine. the other option use uikit makes simple create using uiscrollview , uitextview , present on top of skview contains scene. doesn't work if need within scene works wonders if want display big chunks of texts instructions or legal texts.

universal- and existential quantification in SQL -

given relation x | y ------- | | ii b | ii b | ii how query for the set of x there exists y of length 2 (should yield { a, b } ) the set of x y have length 2 (should yield { b } ) the first 1 easy (note, in examples length_function stands in product-specific length-of-string function in whatever sql database you're using): select distinct x relationname length_function(y) = 2; for second one, there variety of ways approach problem. select x relationname group x having min(length_function(y)) = 2 , max(length_function(y)) = 2 will aggregate x values , filter length of 2 while select distinct x relationname length_function(y) = 2 , x not in (select distinct x relationname length_function(y) <> 2) uses same filter first query, additionally filters out x values exist elsewhere in table non-length-2 y value. finally select distinct x relationname rn1 length_function(y) = 2 , not exists (select * relationname x = rn1.x , len

apache - Redirecting complex URL Aliases in htaccess -

i need redirect sample.com/newdomain/calendar external link have rewrite rule in place redirect sample.com/newdomain/ newdomain.sample.com/ when enter sample.com/newdomain/calendar web browser takes me newdomain.sample.com/calendar. how can override original rewrite have written allow sample.com/newdomain/calendar redirect external url. the rewrite rule redirect url containing /newdomain is: # redirect /newdomain newdomain.sample.com rewriterule ^newdomain(/.*)?$ http://newdomain.sample.com$1 [r=301,qsa,l] any appreciated! you can place new redirect rule above previous rule , make sure clear browser cache before testing: rewriteengine on rewriterule ^newdomain/calendar/?$ http://external.site.com/ [r=301,nc,l] rewriterule ^newdomain(/.*)?$ http://newdomain.sample.com$1 [r=301,nc,ne,l]

JQuery not working on divs created by javascript -

this question has answer here: event binding on dynamically created elements? 18 answers i working on assignment odin project: http://www.theodinproject.com/web-development-101/javascript-and-jquery?ref=lc-pb i cannot jquery .hover work on divs have created. the project specifies divs should created using javascript or jquery. have done can't jquery work on divs created javascript. js code below: function creategrid(resolution) { var wr = document.createelement("div"); wr.setattribute("id", "wrapper"); document.body.appendchild(wr); (x = 0; x<resolution; x++) { (i = 0; i<resolution; i++) { var pix = document.createelement("div"); pix.setattribute("class", "pixel"); wr.appendchild(pix); }; var clr

mysql - How to tell SQLAlchemy once that I want InnoDB for the entire database? -

i managing mysql database (flask-)sqlalchemy , want explicitly use mysql_engine = innodb tables. there way tell database connection once want this, don't have repeat every individual table? in advance. do use declarative extension? if so, can set default __table_args__ simple metaclass (stolen here ): def tableargsmeta(table_args): class _tableargsmeta(declarative.declarativemeta): def __init__(cls, name, bases, dict_): if ( # not extend base class '_decl_class_registry' not in cls.__dict__ , # missing __tablename_ or equal none means single table # inheritance — no table (columns go table of # base class) cls.__dict__.get('__tablename__') , # abstract class — no table (columns go table[s] # of subclass[es] not cls.__dict__.get('__abstract__', false)):

android - Trying to simply set button color and text upon press. Keeps crashing? -

so here code, trying have text , color of button posneg_btn change when pressed. keeps crashing , giving me null pointer exception? ideas? missing? listview recurrencelistview; button add_btn; edittext reccurenceentry_et; edittext reccurenceexplanation_et; button clear_btn; button posneg_btn; boolean positiveiftrue = false; //double[] comparisonarray = new double[8]; int reccurencecounter; string[] reccurencearray = new string[30]; string[] reccurenceexparray = new string[30]; string[] finaldisplayarray = new string[30]; private arrayadapter arrayadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.forecast); recurrencelistview = (listview) findviewbyid( r.id.recurrencelistview ); reccurenceentry_et = (edittext) findviewbyid( r.id.reccurenceentry_et ); reccurenceexplanation_et = (edittext) findviewbyid( r.id.reccurenceexplanation_et ); b

angularjs - Angular Translate Use with Directive -

here's fiddle link .... trying update content of directive $translate , using controller. there other generic way same thing(link in directive?? ) .if want use same directive in 1 controller approach might not work. how can rid of controllers ? html <terms-conditions conditions="conditions" checked="checked"></terms-conditions> <br> <button class="btn-primary" ng-disabled="!checked" >submit</button> <hr> </div> <div name="info" ng-controller="myctrl2"> <terms-conditions conditions="conditions" checked="checked"></terms-conditions> <br> <button class="btn-primary" ng-disabled="!checked">submit</button> <hr> </div> </div> js file var demo = angular.module('demo', ['pascalprecht.translate']); demo.directive("t

openssl - Code signing with osslsigncode - Publisher Unknown -

i encountered bit peculiar behavior when trying automate compilation , signing of particular nsis-based binary. namely, makensis run under wine compile executable, , afterwards osslsigncode used sign binary. executable seems built fine, works on windows systems, there's issue (in lack of better word) signing. code signing certificate in pkcs#12 format, command used suggested here : osslsigncode sign -pkcs12 <pkcs12-file> -pass <pkcs12-password> \ -n "your application" -i http://www.yourwebsite.com/ \ -in yourapp.exe -out yourapp-signed.exe i "succeeded" message osslsigncode, if signing went ok, when binary run on windows (win 7 in case), uac says: publisher: unknown the strange thing when opened extracted cert original .p12 file, view it's info, windows afterwards able recognize publisher , digital signature, if somehow became aware of certification path...? any advice appreciated. edit 1 osslsigncode ve

parsing - How to implement command-line variables in Xtext -

i want domain specific language (dsl) accept command-line arguments variables in bash scripts. example: user might issue command runmydsl mydslfile.dsl -args 10 15 or runmydsl mydslfile.dsl -nvargs arg1=10 arg2=15 . capture these values variables $1, $2 first command or $arg1, $arg2 second command. these variables can treated other read-only variables in dsl: val somevariable = $1 since new xtext/parser field, looking best practices people follow dealing situation. simplicity, let's assume, working on simplified dsl addition (based on expression language described in http://blog.efftinge.de/2010/08/parsing-expressions-with-xtext.html ): expression : variable '+' variable; variable: ('val' id '=' int) | commandlinevariable; commandlinevariable: ??; my first idea following: 1.) parse dsl file , access ast, store refence in locally definded variable of corresponding eclass. 2.) use 'mydslfactory' class create new 'variable

ios - How can I implement the new iPad-like landscape mode on iPhone 6 plus -

apple has introduced new ipad-like split view in landscape mode iphone plus, users take advantage of larger screen. i have designed universal ios app uses uisplitviewcontroller show detail , master view in ipad, , uses uinavigationviewcontroller show tableview in iphone. now have iphone plus, how can implement new ipad-like landscape view while using uinavigationviewcontroller main structure in iphone. you might want take @ "building adaptive apps uikit" video on https://developer.apple.com/videos/wwdc/2014/ de basic idea split view controller used on iphone , ipad. when detects device has "compact" horizontal size class pushes detailview on top of master view, whereas "regular" size class shows detailview next master view.

c# - What is the return of Task? -

for past few weeks, have been looking @ tasks , struggled them. 1 of things have struggled creating awaitable method has no return type. now non awaitable methods work this: //this method return type: private string methodwithreturn() { return "this string return type"; } //this method without return type private void methodwithoutreturn() { //some random code has no return } now when comes tasks, it's complicated. there 3 types: void , task , task<t> void not recommended @ all, left 2 tasks. here problem. want have task without return type , code: private task tasktypemethod() { //some random code } the issue here still issues warning "not code paths return value". understanding tasks incorrectly or doing wrong here? i told add async before it, requires me use await keyword inside code block, won't using. without returning task , how caller find out when async computation presumably running completed? if nobo

install - Installed correctly? on a vb.net setup -

i have little setup in vb.net.it copy my.resource 2 files , makes shortcut on desktop,but after installation (2 seconds),windows ask me if program installed correctly.it's not big problem, reason can't use windows app certification kit, setup it's seen dangerous program in webbrowsers . need add form? or...

Permission Denied for linux-x86/bin/acp while compiling android source -

i compiling android source code. commands were aosp_hammerhead-userdebug export out_dir_common_base=/media/entertainment/out make -j4 otapackage during build process, after time error occurs: target symbolic: libz (/media/entertainment/out/androidworkingdir/target/product/hammerhead/symbols/system/lib/libz.so) /bin/bash: /media/entertainment/out/androidworkingdir/host/linux-x86/bin/acp: permission denied make: *** [/media/entertainment/out/androidworkingdir/target/product/hammerhead/symbols/system/lib/libz.so] error 126 make: *** waiting unfinished jobs.... target staticlib: libc (/media/entertainment/out/androidworkingdir/target/product/hammerhead/obj/static_libraries/libc_intermediates/libc.a) for information: i have normal user access(read/write) in /media/entertainment/ i using ubuntu 12.04 64 bit can please me out of this? so, problem ntfs partition i.e. out directory build process should not in ntfs partition. i creat

Ruby on Rails Paypal REST API guest checkout -

i'm trying debug rails app developer. keep in mind have little experience both ruby , rails. goal allow users pay credit card when go paypal payment page without need registration. the actual code in model/shopping-card.rb is: include paypal::sdk::rest class shoppingcart def initialize(session) @session = session @session["delivery"] ||= "shipping" @session[:coupon] ||= {"token" => nil, "discount" => nil} @session[:shopping_cart] ||= [] end def delivery=(v) @session["delivery"] = v end def delivery @session["delivery"] end def should_add_shipping_costs? @session["delivery"] == "shipping" end def cart @session[:shopping_cart] end def discount val = @session["coupon"]["discount"] if val.nil? nil else val.to_f end end def token @session["coupon"]["token"]

Does GridGain support SSL connection between each cluster member? -

does gridgain support ssl connection between each cluster member? if yes, can show me how that? thanks, bill gridgain supports ssl client connections (gridgain provides .net , c++ thin clients), not communication between nodes. to enable ssl client connections, configure server nodes this: <bean id="grid.cfg" class="org.gridgain.grid.gridconfiguration"> <!-- enable rest. --> <property name="restenabled" value="true"/> <!-- client connection configuration. --> <property name="clientconnectionconfiguration"> <bean class="org.gridgain.grid.gridclientconnectionconfiguration"> <!-- enable ssl. --> <property name="resttcpsslenabled" value="true"/> <!-- provide ssl context factory (required). --> <property name="resttcpsslcontextfactory">

c - Difference between array and malloc -

here code : #include<stdio.h> #include <stdlib.h> #define len 2 int main(void) { char num1[len],num2[len]; //works fine //char *num1= malloc(len), *num2= malloc(len); int number1,number2; int sum; printf("first integer add = "); scanf("%s",num1); printf("second integer add = "); scanf("%s",num2); //adds integers number1= atoi(num1); number2= atoi(num2); sum = number1 + number2; //prints sum printf("sum of %d , %d = %d \n",number1, number2, sum); return 0; } here output : first integer add = 15 second integer add = 12 sum of 0 , 12 = 12 why taking 0 instead of first variable 15 ? could not understand why happening. it working fine if using char *num1= malloc(len), *num2= malloc(len); instead of char num1[len],num2[len]; but should work fine this. edited : yes, worked len 3 why showed undefined behav

memory management - What is the best document storage strategy in NoSQL databases? -

nosql databases couchbase hold lot of documents in memory, hence enormous speed it's putting greater demand on memory size of server(s) it's running on. i'm looking best strategy between several contrary strategies of storing documents in nosql database. these are: optimise speed putting whole information 1 (big) document has advantage single information can retrieved memory or disk (if purged memory before). schema-less nosql databases wished. document become big , eat lot of memory, less documents able kept in memory in total optimise memory splitting documents several documents (eg using compound keys described in question: designing record keys document-oriented database - best practice when documents hold information necessary in specific read/update operation allow more (transient) documents held in memory. the use case i'm looking @ call detail records (cdr's) telecommunication providers. these cdr's go hundreds of millions typically

Bisection Search in Python - Find lowest payment over one year -

i've been going nuts problem hours, , i've been redoing on , over! @ point think i'm seeing numbers flying around me. anyway, i'm supposed write program finds correct amount of money pay each month on 1 year, pay off debt on credit card. program, there's few conditions must met. it must done using bisection search ((low + high) / 2) there's set balance there's annual interest rate. here's code @ moment, , i'm getting infinite loops. doing wrong here? balance = 320000 annualinterestrate = 0.2 monthly_interest = float(annualinterestrate) / 12.0 lower_bound = float(balance / 12) upper_bound = (balance * (1 + monthly_interest)**12) / 12.0 epsilon = 0.01 ans = float(lower_bound + upper_bound) / 2 while abs((balance * (1 + monthly_interest)**12) / 12.0) >= epsilon: ans = float(lower_bound + upper_bound) / 2 total = float(ans * 12) new_balance = 0 interest = 0 month in range(0, 12): interest += ans + (1 + m

javascript - Changing the style of each feature in a Leaflet GeoJSON layer -

i have been studying leaflet chloropleth example . in leaflet application, have jquery dropdown that, when selected, fires function takes name of state argument. want use state name update chloropleth map. what pattern changing style of leaflet geojson layer? should recreate layer created l.geojson() second time? seems though layers drawing on top of each other approach. i can provide fiddle if needed. here's an example of changing choropleth classify on different properties - trick call setstyle again different values.

javascript - jQuery ajax not firing in child function -

i'm making script pretty large i'm taking object oriented javascript approach. when trying use jquery's ajax (or before shorthand document ready) doesn't fired , have no clue why. (copy-pasting whole document ready code chrome console shows ajax call work, doensn't run inside child function) my code: // main class function arina(loginstate) { var loginstate = loginstate; } /** * attempts log user in * @ * @param {string} username [user's username] * @param {string} password [user's password] * @return {array} [status, message] */ arina.prototype.login = function(username, password) { /** * validate if user has filled in required fields */ if (username == '' || username == null) return [false, 'no username given.']; if (password == '' || password == null) return [false, 'no password given.']; /** * set ajax payload */ var payload = { use

sql - Similar queries to create third column in MySQL using JOIN -

using question , i've been trying experiment using different types of joins try combine these 2 select queries. similar , work fine when try create third column empfirstname3 query blows up. how combine these 2 tables? htg_techprops table empnumber | empfirstname 111 | bob 222 | john 333 | randy htg_techstaffsets table empnumber | staffsetid ccn31 | 111 ccn11 | 222 poww | null /* techs */ select p.empnumber, p.empfirstname empfirstname1, t.empfirstname empfirstname2 htg_techprops p left join htg_techstaffsets s on p.empnumber=s.empnumber left join htg_techprops t on t.empnumber=s.staffsetid order p.empnumber /* staff sets */ select p.empnumber, p.empfirstname empfirstname1, t.empfirstname empfirstname2 htg_techprops p left join htg_techstaffsets s on p.empnumber=s.staffsetid left join htg_te

sharepoint - Script file file not being loaded through ScriptLink custom action -

i having trouble script link custom actions. building sharepoint app, , added site-scope custom action pointing script file in style library, want particular script injected pages of sharepoint site. while works in situations, script link injection breaks without apparent reason under conditions. example, when arrive on root web, script injected. but, if go link within web (for example home or site contents), file supposed injected not fetched style library , therefore never injected, resulting in uncaught referenceerror when try call 1 of script's function. weirdest part page refresh through ctrl+f5 fetch script file without problem, regardless of page's ability fetch script file when first accessed. keep script until accessed through link again. i've read on sharepoint caching , thinking may cause of problem, trouble these articles talk cache-induced errors when updating file, while trying access it. one thing note that, due limitations, adding script link cu

Python's datetime strptime() inconsistent between machines -

i'm stumped. date-cleaning functions wrote work in python 2.7.5 on mac not in 2.7.6 on ubuntu server. python 2.7.5 (default, mar 9 2014, 22:15:05) [gcc 4.2.1 compatible apple llvm 5.0 (clang-500.0.68)] on darwin type "help", "copyright", "credits" or "license" more information. >>> datetime import datetime >>> date = datetime.strptime('2013-08-15 10:23:05 pdt', '%y-%m-%d %h:%m:%s %z') >>> print(date) 2013-08-15 10:23:05 why not work in 2.7.6 on ubuntu? python 2.7.6 (default, mar 22 2014, 22:59:56) [gcc 4.8.2] on linux2 type "help", "copyright", "credits" or "license" more information. >>> datetime import datetime >>> date = datetime.strptime('2013-08-15 10:23:05 pdt', '%y-%m-%d %h:%m:%s %z') traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/lib/python2.

eclipse - PyDev package explorer empty -

up until today eclipse , pydev. have not modified eclipse or installed since working yesterday. now, pydev package explorer shows no entries. can see them if switch normal project/navigator view. if watch pydev package explorer , switch in , out can see briefly appearing disappearing. i've deleted every project, created new workspace , tried uninstalling , installing pydev, still pydev package explorer shows nothing. all settings correct , can run python code, i'd package explorer back. any ideas? i'm on pydev version 3.7.1.x thanks. maybe added filter or made top level elements working sets , have no working set defined? i.e.: ctrl+f10 > top level elements > projects/working sets or ctrl+f10 > customize view.