Posts

Showing posts from May, 2012

java - Is there any possibilities to change price programmatically In app purchase android? -

java - Is there any possibilities to change price programmatically In app purchase android? - i want implement in app purchase application.. have tried this link code transaction cost set predefined ...is there possible alter price.if possible means how can alter cost programmatically?. it not possible modify cost of product dynamically in code. product cost determined when upload our product in play store. if want alter product cost need in play store console. java android in-app-purchase in-app-billing

adobe - Structure of the page through parsys vs fixed components - CQ -

adobe - Structure of the page through parsys vs fixed components - CQ - for pages product details, there fixed construction of content product image, description etc. if there parsys component used (widely used in geometrixx demo site), there possibility add together of allowed components in order in parsys. not create content chaos ? or author's responsibility add together needed page construction ? either responsibility of authors/publisher, can controlled through workflows or have create fixed product detail page component each component in fixed in jsp , no parsys available. adobe cq5 aem wcm

java - Cannot find symbol: Thread.sleep (1000); -

java - Cannot find symbol: Thread.sleep (1000); - this question has reply here: java -the method sleep(int) undefined type thread 7 answers i want implement threads using runnable interface. i have next 3 classes: firstthread.java public class firstthread implements runnable { //this method executed when thread executed public void run() { //looping 1 10 display numbers 1 10 ( int i=1; i<=10; i++) { //displaying numbers thread system.out.println( "messag first thread : " +i); /*taking delay of 1 sec before displaying next number * * "thread.sleep(1000);" - when statement executed, * thread sleep 1000 milliseconds (1 second) * before executin...

c++ - QTest::qExec Hide "passed" messages -

c++ - QTest::qExec Hide "passed" messages - i'm new in qt , qtest. utilize qtest::qexec(&somemytestclassobject) run tests. possible hide "pass : myclass::mytest" messages? of course of study want see "fail" messages , statistics sorry poor english i'm not sure if works qtest::qexec , default qtest executable generated qtest_appless_main(mytestclass) can run tests parameter -silent . from help-text: -silent : outputs warnings , failures c++ qt qtestlib

sorting - What's the fastest approach to merging a small number of large, already sorted lists in Hadoop? -

sorting - What's the fastest approach to merging a small number of large, already sorted lists in Hadoop? - i've got little hadoop (cdh5.1.0, mrv2/yarn) cluster (5x nodes 4cpu, 16gb ram, 600gb disk) of contains little number ~30 of ~15gb sequencefiles. sequencefiles contains pairs of byteswritable / byteswritable , , keys not uniformly distributed across possible keyspace - it's rather lumpy. however, these files sorted. i need merge these create single, sorted sequencefile, efficiently possible. i've tried number of approaches already, haven't been successful. initially, tried using mapreduce job randomsampler , totalorderpartitioner, , around 1000 reducers. however, turns out because of non-uniformity of input keys, randomsampler isn't @ distributing info across partitions, , end 999 reducers succeeding, , 1 failing due running out of local disk. it occurs me approach doesn't appear take advantage of fact input info sorted - solve problem ...

javascript - move_uploaded_file - file name of image? -

javascript - move_uploaded_file - file name of image? - the script: <?php if (isset($_post['submit'])) { $j = 0; //variable indexing uploaded image $target_path = "uploads/"; //declaring path uploaded images ($i = 0; $i < count($_files['file']['name']); $i++) {//loop individual element array $validextensions = array("jpeg", "jpg", "png"); //extensions allowed $ext = explode('.', basename($_files['file']['name'][$i]));//explode file name dot(.) $file_extension = end($ext); //store extensions in variable $target_path = $target_path . md5(uniqid()) . "." . $ext[count($ext) - 1];//set target path new name of image $j = $j + 1;//increment number of uploaded images according files in array if (($_files["file"]["size"][$i] < 100000) //approx. 100kb files can uploaded. &...

ios - how to set timer when closed subviews -

ios - how to set timer when closed subviews - i tried open 2 subviews , closed @ time tried this - (void)motionbegan:(uieventsubtype)motion withevent:(uievent *)event { if(event.type == uieventsubtypemotionshake) { [self shakeview]; //[self open]; } } -(void)shakeview { [uiview animatewithduration:2.8 animations:^{ //open firstview.frame = cgrectmake(0, -40, self.view.frame.size.width, self.view.frame.size.height/2); secondview.frame = cgrectmake(0, 260, self.view.frame.size.width, self.view.frame.size.height/2); // final location } completion:^(bool finished) { // closed firstview.frame = cgrectmake(0, 0, self.view.frame.size.width, self.view.frame.size.height/2); secondview.frame = cgrectmake(0,230 , self.vi...

resolution - PPI and DPI confusion -

resolution - PPI and DPI confusion - i trying clear confusion ppi , dpi, afaik ppi refers how much pixels screen can display per inch, , metadata included image aid printing process, , dpi practically same ppi used when referring printers. my question is, if have image 400 ppi, , screen 400 ppi, means if print image, physical size of printed image same size of image when viewed on screen? resolution dpi ppi

ruby on rails - "Exception Occurred" with addSiteAccount1 -

ruby on rails - "Exception Occurred" with addSiteAccount1 - after having gotten site's login form getsiteloginform, i'm attempting add together site, i'm receiving { :erroroccurred=>"true", :exceptiontype=>"exception occurred", :referencecode=>"_fa9ede97-1792-45ca-b147-005ec4002d33" } the url i'm posting (in rails) is: https://consolidatedsdk.yodlee.com/yodsoap/srest/private-fairshare/v1.0/jsonsdk/siteaccountmanagement/addsiteaccount1 and post data: cobsessiontoken=redacted usersessiontoken=redacted siteid=11671 credentialfields.enclosedtype=com.yodlee.common.fieldinfosingle credentialfields[0][displayname]=user name credentialfields[0][fieldtype.typename]=text credentialfields[0][iseditable]=true credentialfields[0][name]=login credentialfields[0][value]=testuser credentialfields[0][valueidentifier]=login credentialfields[0][valuemask]=login_field credentialf...

c# - Creating an object of Form1 causes a stack overflow -

c# - Creating an object of Form1 causes a stack overflow - i have label in form1 i'm trying modify. here's code: namespace asst5 { public partial class form1 : form { robot robot1 = new robot(); public form1() { initializecomponent(); label2.location = new point(100,100); label1.text = label2.location.tostring(); } private void button7_click(object sender, eventargs e) { application.exit(); } private void button1_click(object sender, eventargs e) { label2.text = "↑"; robot1.direction = 1; } private void button2_click(object sender, eventargs e) { label2.text = "↓"; robot1.direction = 2; } private void east_click(object sender, eventargs e) { label2.text = "→"; robot1.direction = 4; } ...

android - Fragment crash after selecting another item after onBackPressed -

android - Fragment crash after selecting another item after onBackPressed - this rather unusual issue me. i'm using custom list display items , fragment display more of selected item's data. however, whenever press , select item, app gives me illegal exception error. did wrong within codes? if don't commit transaction, details fragment not show. this events fragment: public static class eventssectionfragment extends fragment { /** * fragment argument representing section number * fragment. */ public static final string arg_section_number = "section_number"; sharedpreferences settings = null; editor editor; listview list; textview noeventstv; public eventssectionfragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { reclifecycle_with_savedinstancestate(saved...

C# method to get Active Directory properties -

C# method to get Active Directory properties - i want create method accepts 2 arguments; first beingness username, , sec beingness name of active directory property return... method exists in separate class ( sharedmethods.cs ) , works fine if define property name locally in method, can't workout how pass in sec argument. here method: public static string getaduserproperty(string suser, string sproperty) { principalcontext domain = new principalcontext(contexttype.domain); userprincipal user = userprincipal.findbyidentity(domain, suser); var property = enum.parse<userprincipal>(sproperty, true); homecoming user != null ? property : null; } and code calling follows; sdisplayname = sharedmethods.getaduserproperty(susername, "displayname"); currently enum.parse throwing next error: the non-generic method 'system.enum.parse(system.type, string, bool)' cannot used type arguments i can work re...

php - txt file chat system -

php - txt file chat system - i have simple friend-to-friend facebook style chat scheme on site. when user starts conversation friend, new .txt file created , named based on id's of users, illustration 142and153.txt. messages saved. creates huge security risk because see conversation entering www.website.com/142and153.txt. how can hide files public? website finished , lastly thing want contains security risks this, can guys think of other problems kind of chat system, or should develop other kind of system? well, can accomplish considering couple of things: create new blank index.html in directory chat files beingness saved avoid intruders check out files there try utilize md5 function files name, md5(id1andid2) can generate 32 digit hexadecimal number based on real id of users, , 'i believe' hard predict. php facebook generics chat

node.js - NodeJS is faster than D when computing prime numbers. How? -

node.js - NodeJS is faster than D when computing prime numbers. How? - i wrote simple function computing prime numbers in d. thought pretty quick, calculating prime numbers 100,000. wanted compare nodejs. when ran nodejs script first time, astounded @ difference , double checked wasn't skipping sort of calculation how. 2 pretty identical functionally. d: import std.stdio; import std.math; import std.datetime; import std.file; import std.array; enum size_t iterations = 100_000; bool divisible(real n) { real d; for(d = 3; d < floor(n / 2); d += 2) { if(n % d == 0) { homecoming true; } } homecoming false; } void main() { stopwatch sw; size_t t = iterations; size_t c = 0; real n = 2; real r[iterations]; r[c] = n; sw.start(); c++; for(n = 3; n < t; n += 2) { if(!divisible(n)) { r[c] = n; c++; } } sw.stop(); double seconds = cast(doubl...

excel - Permanently Save Variables with VBA? -

excel - Permanently Save Variables with VBA? - one of many userforms in excel uses file paths locate files copy,move,delete depending on situation. bulk of these file locations in same directory , looking permanent way store file paths configuration file or settings files vba allows in same place. i thinking adding string paths hidden personal workbook , reference each cell when assigning variable develop on machine , rollout other pc , won't avoid overwriting them. i've heard text files can used or savesettings() method i've used before. what best way accomplish task , worth doing? if users/different pcs can think of 2 ways. way 1 store values in excel settings. use application.defaultfilepath store path , read later. example sub storepath() application.defaultfilepath = "c:\temp" end sub sub getpath() msgbox application.defaultfilepath end sub way 2 store values in registry. see little tutorial wrote couple of years ag...

Visual Basic Excel Number to English -

Visual Basic Excel Number to English - i've found code on microsoft website , want edit not write 1 hunred or 1 one thousand , found adding if mid(mynumber, 1, 1) = "1" result = "hundred" end if gethundreds function not write 1 before hundred how can create same thousand part? thanks. option explicit 'main function function spellnumber(byval mynumber) dim dollars, cents, temp dim decimalplace, count redim place(9) string place(2) = " one thousand " place(3) = " 1000000 " place(4) = " billion " place(5) = " trillion " ' string representation of amount. mynumber = trim(str(mynumber)) ' position of decimal place 0 if none. decimalplace = instr(mynumber, ".") ' convert cents , set mynumber dollar amount. if decimalplace > 0 cents = gettens(left(mid(mynumber, decimalplace + 1) & _ "00", 2)) mynumber = trim(left(mynumber, decimalplace - 1)) end if cou...

Looking for a simple private gallery [PHP] -

Looking for a simple private gallery [PHP] - i planning create myself photo storing solution - dropbox, in own server , photos. thinking of 1 public page - login form. when come in www.example.com > end login form > after login see albums , can create new ones/upload photos, mass download , etc. scheme has super easy utilize (senior citizen using it), should compatible mobile phones , photos should absolutely private! i have searched online, of systems overcrowded unnecessary tools create scheme complicated , orientated more public galleries. any ideas of similar systems created use? you have few options here, build way getting want. however, not has time or patience have. alternative : owncloud best alternative here in opinion have installed , used before. user friendly , simple install. or suggest investigating these : alternatives php gallery private

android - How to convert a Drawable to a scaled Bitmap -

android - How to convert a Drawable to a scaled Bitmap - in imageview's ondraw struggling convert drawable object bitmap (respecting scaling). i'm loading svg file picturedrawable. i'm trying apply rounded corners image bitmapshader. in order have convert drawable bitmap. works, i'm not getting head around scaling procedure. bitmap bitmap = bitmap.createbitmap( picture.getintrinsicwidth(), picture.getintrinsicheight(), bitmap.config.argb_8888 ) canvas canvas = new canvas( bitmap ) // scaling canvas appears work ... canvas.concat( getimagematrix() ) canvas.drawpicture( picture.getpicture, // ... not fill viewport, getwidth , getheight // values not reflect scaling new rectf( 0, 0, canvas.getwidth(), canvas.getheight() ) ) paint.setshader( new bitmapshader( bitmap, shader.tilemode.clamp, shader.tilemode.clamp ) ) canvas.drawroundrect( new rectf( 0, 0, bitmap.getwidth(), bitmap.getheight() ), radius, radius, paint ) ...

sorting - How to sort Integer Stream using queue? Lab JAVA -

sorting - How to sort Integer Stream using queue? Lab JAVA - okay programme needs separate stream of integers using queue. output it's not in desired order firstly integers divisible 3 1%3 2%3 suggestions? here code: import java.util.random; public class oct22 { public static void main(string[] arg) { int x; random rnd = new random(); queue<integer> queue = new arrayqueue<integer>(); queue<integer> queue2 = new arrayqueue<integer>(); //for(char c='a'; c<= 'z'; c++) // queue.add(c); for(int i=0;i<20;i++) queue2.add(rnd.nextint(100)); for(int i=0;i<queue2.size();i++) { x=queue2.remove(); if(x%3==0) queue.add(x); else queue2.add(x); } for(int i=0;i<queue2.size();i++) { x=queue2.remove(); if(x%3==1) queue.add(x); else queue2.add(x); } for(int i=0;i<queue2.size();i++) { x=queue2.remove(); if(x%3==2) queue.add(x); else queue.add(x); } system.out.pr...

asp.net mvc - authentication gets shared in different applications -

asp.net mvc - authentication gets shared in different applications - i'm having 2 mvc-applications need debug @ same time different userlogins. the 2 apps not share database or else. the problem is: when debug both apps @ same time, , login user in app1 (default aspnet.identity way). after that, login different user in app2. when go app1 , refresh page, user logged in in app2 gets logged in in app1. so, bug or how can prepare can logged in different users in 2 apps? edit: works when have apps in different browsers (one in chrome , 1 in firefox) as solution debugging, open projects in different browsers, if want solve permanently should know mechanism of how membership login works cross different domains. take this: asp.net forms authentication , multiple domains and one: http://www.codeproject.com/tips/438319/sharing-authentication-cookie-between-two-asp-net asp.net-mvc

ios - releasing the scrollview back to the beginning and I can not fill the textfield final -

ios - releasing the scrollview back to the beginning and I can not fill the textfield final - i have scrollview list of info fill, form, when under scroll fill info not working when release selection , can not anything, want no matter release scroll stand there. in viewdidload() [scroll setscrollenabled:yes]; [scroll setcontentsize:cgsizemake(1000, 1000)]; have dealt these lines of code not work video whit problem: http://youtu.be/jfqsnz08npo another video http://youtu.be/i5h5ossognm an image: ios objective-c xcode6

css - Bootstrap 3.0 Collapse Horizontally with text -

css - Bootstrap 3.0 Collapse Horizontally with text - i wanted accordion in bootstrap horizontal collapse , expand i saw reply bootstrap 3.0 collapse horizontally link answers 90% of question, has given image src , when set text instead image coming bottom top instead left right how can create text left right above example? css twitter-bootstrap twitter-bootstrap-3

swift - Parse with Search Bar and Search Display controller iOS -

swift - Parse with Search Bar and Search Display controller iOS - saw ios swift tutorial in ray wenderlich using search bar , search display controller uses local data. (http://www.raywenderlich.com/76519/add-table-view-search-swift). i need load info parse, user object class, column username. any clue how start, alter illustration above ? thnx , cheers 1)you can utilize restkit parse info , create user model objects. 2)instead of chocolate create user (class/model) , properties (what receive in http response api). 3) reference object in uitableviewcontroller , initialize it. 4) have array of user objects info , count create section, rows , cell. look @ tutorial http://www.raywenderlich.com/58682/introduction-restkit-tutorial if follow think should it. ios swift parse.com

javascript - Angularjs access local json files -

javascript - Angularjs access local json files - this question has reply here: local file access javascript 10 answers i new angularjs , i've been searching on web whole day find solution in getting info local json file without having utilize localhost webapp. unfortunately, haven't found any. tried using $http.get cross origin * error. is there no other way info local json file without having locally host webapp? does angularjs have other function info local json files without having utilize $http.get? you need deploy application http server, easiest way using node, here exmaple https://www.npmjs.org/package/http-server, or can alter browser security settings. javascript json angularjs

java - Converting Byte To Int,Short To Long...etc -

java - Converting Byte To Int,Short To Long...etc - i'm learning java , don't know much it. formula of converting bigger info types smaller ones?for example: byte x=10; long y=250; x=(byte)y; system.out.println(x); after compiling gives me -6. , uses have? you getting -6 because made long byte , value in long big byte. seek convert byte long! a byte has range -128 127. long goes -2^63 2^63-1. have gotten overflow becuase of converting in way. java

hibernate - spring-boot is not creating hsqldb database -

hibernate - spring-boot is not creating hsqldb database - in current spring project, start utilize spring-boot spring-jpa create , manage hsqldb database. i have hibernate.properties in thee folder src/main/resources project: # jdbc.x jdbc.driverclassname=org.hsqldb.jdbc.jdbcdriver jdbc.url=jdbc:hsqldb:file:/home/kleber/.webapp/testedb jdbc.user=sa jdbc.pass= # hibernate.x hibernate.dialect=org.hibernate.dialect.hsqldialect hibernate.show_sql=false hibernate.hbm2ddl.auto=create my pom.xml have dependencies: <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-actuator</artifactid> </dependency> <dependency> <groupid>org.apache.tomcat.embed</groupid...

ruby - how can I generate a json return for all the objects in a twilio call -

ruby - how can I generate a json return for all the objects in a twilio call - this similar question asked meaningfully different. using ruby, sinatra , twilio want phone call log records json object can print ona n html page. code is: get '/call_logs' client = twilio::rest::client.new account_sid, auth_token calls = client.account.calls.list calls.each |call| @sid = call.sid puts @sid @from = call.from puts @from @to = call.to puts @to @price = call.price.to_s puts @price @duration = call.duration puts @duration end halt 200, {sid:@sid,from:@from,to:@to,price:@price,duration:@duration}.to_json end this produces 1 homecoming is: { "sid":"cadd102cb19729424b1acdbe7b93a03400", "from":"+441903684027", "to":"+818088931617", "price":"-0.16000", "duration":"16" } there are, in fact, multiple records getting one. if place { sid:@sid, from:@fr...

objective c - Access text values from dynamically created UITextFields. iOS -

objective c - Access text values from dynamically created UITextFields. iOS - i creating uitextfield 's in view based on count of nsarray . i want know how can access text values based on tag of uitextfield in nsarray . so after add together below uitextfield 's view how write code retrieve .text values mytextfield0, mytextfield1 , mytextfield2 respectively? example: nsstring *textfeildtextstring = [nsstring stringwithformat:@"%@",mytextfield1.text]; actual code: self.textfieldarray = [nsarray arraywithobjects:@"one", @"two", @"three",nil]; nsmutabledictionary *mydict = [nsmutabledictionary dictionary]; (int i=0; i<[self.textfieldarray count]; i++) { uiview *spacerview1 = [[uiview alloc] initwithframe:cgrectmake(0, 0, 10, 10)]; uitextfield *mytextfield = [[uitextfield alloc]initwithframe:cgrectmake(20, 60*i+150, 280, 45)]; mytextfield.borderstyle = uitextborderstylenone; mytextfield.font = [uif...

jquery - undefined method `gsub' for 2014-10-31 17:55:55 +0530:Time -

jquery - undefined method `gsub' for 2014-10-31 17:55:55 +0530:Time - while executing next got error message 'undefined method `gsub' 2014-10-31 17:55:55 +0530:time' the code is $(document).ready(function(){ jquery(".countdown_timer_widget").countdowntimer("<%= j (time.now) %>", "<%= j (@end_time) %>"); }); i don't know how right , help me try: $(document).ready(function(){ jquery(".countdown_timer_widget").countdowntimer("<%= j (time.now.to_s) %>", "<%= j (@end_time) %>"); }); the method gsub strings hence have convert date string. jquery ruby-on-rails

Fortran passing statement function to function -

Fortran passing statement function to function - i looking pass statement function evaluated in function, possible? trying have function can numerically integrate general function. there other values in real problem don't want have external function. edit 2014/11/1 02:22 gmt there couple of bugs in code @ianh set in. code works after take care of bugs. program trapezoidz implicit none ! main programme global variables , constants here. phone call main contains subroutine main real :: u, integral1 integer :: integer, parameter :: n = 5000 ! delete declaration of trapezoid_integration , f. integral1 = trapezoid_integration(trigsin, n, 0., 3.14159 / 2.0) write (*,*) "i - trap = ",1 - integral1 end subroutine main function my_f(u) real :: my_f real, intent(in) :: u my_f = (u**4)*exp(u)/((exp(u)-1.0)**2) end function my_f function trigsin(u) result(my_f) real :: my_f real, intent(in) :: u my_f = sin...

activerecord - How to add migration details to its corresponding model in Rails 4 -

activerecord - How to add migration details to its corresponding model in Rails 4 - i remember 1 of colleagues did don't remember how. guess used gem or rake task accomplish this. please share if know how this. maybe gem can add together relevant associations automatically model file. when rails g model. you can utilize gem: https://github.com/ctran/annotate_models then run annotate terminal. notes if field hstore or array type in case of postgresql. intelligent. myself made commit ;) activerecord gem rails-activerecord rails-migrations

javascript - How to get label value from stripes:options-collection in java script or java -

javascript - How to get label value from stripes:options-collection in java script or java - i using below code in jsp page. when submit want value label in java code. how this? getting null empname in java. jsp code: <stripes:form action="empmanager.action?changemanager" method="post" id="empform" name="changemanager"> <stripes:select class="selectmenu" name="empid" id="empid"> <stripes:option value="" selected="-- emp --">-- emp --</stripes:option> <stripes:options-collection collection="${actionbean.emplist}" label="empname" value="empid" /> </stripes:select> <a href="javascript:changeemp();" class="button right">submit</a> </stripes:form> function changestore() {alert(1); document.getelementbyid(...

angularjs e2e - Download and use file with Protractor e2e test -

angularjs e2e - Download and use file with Protractor e2e test - how write test download file, , post in form. it "should back upwards download , upload file", -> upload = element(by.id 'uploadinput'); upload.sendkeys 'c:\\path\\to\\file\\file.txt' currently upload works, how download file before , it's path? solved adding file project , got absolute path this: it "should back upwards download , upload file", -> upload = element(by.id 'uploadinput'); upload.sendkeys path.resolve(__dirname, '../../assets/file.txt') protractor angularjs-e2e

labview - Forwarding a signal from RX to TX using a USRP with FPGA -

labview - Forwarding a signal from RX to TX using a USRP with FPGA - this labview (software) fpga (hardware) question don't know whether should post here or on electronics stack exchange. i have usrp-2953r , want accomplish simple project. want read signal rf0/rx1 , output rf1/tx1 using fpga (not forwarding host). signal centered @ 5.9ghz 10mhz of bandwidth. feasible? should approach be? i have tried different modifications "simple ni-usrp streaming" project comes labview 2013, haven't outputted anything. i'm using labview 2013 sp1 , able compile , execute code on usrp fpga. doesn't want do. any help appreciated. the "simple ni-usrp streaming" project's starting fpga code starts on receive side adcs beingness sampled. these values mixed down, , decimated before piping target-host rx fifo. transmitter code starts reading host-target tx fifo. seek replacing rx , tx fifos 1 target scoped fifo. samples placed in fifo pulled out t...

java - How can i randomly select and delete an element from an already existing linked list? -

java - How can i randomly select and delete an element from an already existing linked list? - i making musical chair game. have made singly circular linked list have randomly select element , delete it. how can ? programatically, should relatively easy. import java.util.linkedlist; import java.util.list; import java.util.random; public class test { public static void main(string... args) { list<integer> list = new linkedlist<integer>(); random r = new random(); // fill list random values seek { (int = 0; < integer.parseint(args[0]); ++i) { list.add(r.nextint()); } } grab (numberformatexception e) { e.printstacktrace(); } system.out.println(list); // delete random values (int = 0; < list.size() / 2; ++i) { list.remove(r.nextint(list.size())); } system.out.println(list); } } java linked-list

javascript - Firebase and Backbone -

javascript - Firebase and Backbone - i trying build basic app using backbone , firebase: http://jsfiddle.net/c9wew/6324/ var counter = 0; var box = backbone.firebase.model.extend({ defaults: { number: 0 }, //firebase: new firebase('https://backbone-firebase.firebaseio.com/box') }); var boxlist = backbone.firebase.collection.extend({ model: box, firebase: new firebase('https://backbone-firebase.firebaseio.com/') }); var boxes = new boxlist; var addbox = backbone.view.extend({ el: $('#addbox'), events: { "click" : 'addbox' }, addbox: function () { console.log("adding box"); boxes.add({ number: counter }); counter = counter+1; } }); var addbox = new addbox(); error stack trace: uncaught typeerror: undefined not function backfire.min.js:1 b.firebase.collection.b.collection.extend.constructor backfire.min.js:1 d backbon...

angularjs - Angular does not encode the semi-colon character in an url -

angularjs - Angular does not encode the semi-colon character in an url - we need encoded semi-colon character in our url parameter angular not encode character. the resource utilize looks this: app.factory('testresource', ['$resource', function ($resource) { homecoming $resource('http://somedomain.com'); }]); app.run(['testresource', function (testresource) { testresource.query({ q: 'sin;sout' }); }]); this result get: http://somedomain.com/?q=sin;sout we want url be: http://somedomain.com/?q=sin%3bsout but if pre-encode parameter before sending % char get's encoded this: http://somedomain.com/?q=sin%253bsout how can desired result? (http://somedomain.com/?q=sin%3bsout) building on zeroflagl's reply 1 consider changing replace alter occurrences of semi-colon (as written replace first semi-colon): url = url.replace(/;/g, '%3b'); angularjs

c - Appending individual characters from string onto a char pointer -

c - Appending individual characters from string onto a char pointer - i'm writing parser in c, , i've got code looks this: char *consume_while(parser *self, int(*test)(char)) { char *result; while (eof(self) && (*test)(next_char(self))) { // append homecoming value function consumed_char(self) // onto "result" string defined above. } homecoming result; } but i'm kinda new whole string manipulation aspect of c, how append character returned function consumed_char(self) result char pointer? i've seen people using strcat function, wont work takes 2 constant char pointers, i'm dealing char* , char. in java this: result += consumed_char(self); what's equivalent in c? :) in c, strings not exist type, char arrays null-terminating character. means, assuming buffers big plenty , filled zeroes, can simple as: result[(strlen(result)] = consumed_char(self); if not, best bet utilize str...

android - Opening the application from the background service -

android - Opening the application from the background service - i have designed app receive text message(sms) , hence have implemented broadcast receiver on background service. works fine except cant open application(any activity class) background service. have written code start activity doesn't work. i went through many similar questions, couldn't find solution problem. this code snippet of service class: public class background extends service { @override public int onstartcommand(intent intent, int flags, int startid) { // todo auto-generated method stub new broadcastreceiver() { string number, body; @override public void onreceive(context context, intent intent) { // todo auto-generated method stub bundle bundle = intent.getextras(); object[] messages = (object[]) bundle.get("pdus"); smsmessage[] sms = new smsmessage[messages...

Which PHP file taking so mysql resources on server? -

Which PHP file taking so mysql resources on server? - one of php file using much mysql memory usage, how can find out php file taking much load or taking much execution time ? command terminal ? need help run in mysql terminal command: show processlist; show processlist syntax php mysql centos

ios - JSMessageViewController = Passing PFObject into (id) -

ios - JSMessageViewController = Passing PFObject into (id<JSMessageData>) - i using parse database store text user enters, , display onto jsmessageviewcontroller . i having difficulty understanding why pfobject not pass, , instead, see empty message cells.. in code here can see, if pass either of // code, crashes, know nil wont work , thats why getting blank... how pass pfobject jsmessagedata ? - (id<jsmessagedata>)messageforrowatindexpath:(nsindexpath *)indexpath { //pfobject *chat = self.chats[(nsuinteger) indexpath.row]; //return chat; //pfobject *chat = self.chats[indexpath.row]; //nsstring *message = chat[kmmkchattextkey]; //return message; homecoming nil; } jsmessagedata has 3 instances : - (nsdate *)date , - (nsstring *)sender , , - (nsstring *)text .... http://cocoadocs.org/docsets/jsmessagesviewcontroller/4.0.0/protocols/jsmessagedata.html has worked ? or can help me figure out how can pass pfoject through - pars...

java - How to run maven tests in particular sequence? -

java - How to run maven tests in particular sequence? - i've created maven project has construction following: src/main/java src/main/resources src/test/java src/test/resources i've kept testng tests in src/test/java folder. suppose in folder, i've 3 classes: yahootest googletest twittertest and each of 1 have few testng test methods. when nail mvn clean test on command prompt, observed tests running in next order: test googletest test twittertest test yahootest test googletest test twittertest test yahootest test googletest test twittertest test yahootest means first classes ordered in alphabetical order i.e. googletest, twittertest, yahootest , 1 test each class executed , 1 time again 1 test each class executed. continues until test methods execution finishes. but want customize test execution. how can accomplish following: arrange test execution of test classes in order want rather in alphabetical order instead of executing 1 test ...

php - FOS\OAuthServerBundle unrecognized field error -

php - FOS\OAuthServerBundle unrecognized field error - in symfony2 i'm trying implement fos\oauthserverbundle, getting weird error. after next guide here , official guide on github, i'm met error says: unrecognized field: randomid 500 internal server error - ormexception this protected variable in client entity/model in fos\oauthserverbundle. must missing simple here, life of me can not figure out what. has else experienced similar error this? this error happens when trying go to: http://symfony.local/app_dev.php/oauth/v2/token?grant_type=client_credentials&client_id=fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk&client_secret=[secret redacted] stack trace doctrine\orm\ormexception: unrecognized field: randomid @ n/a in /home/johnny/development/symfonyproject/vendor/doctrine/orm/lib/doctrine/orm/ormexception.php line 100 @ doctrine\orm\ormexception::unrecognizedfield('randomid') in /home/joh...

c# - Overflow Error on inserting data on Access database -

c# - Overflow Error on inserting data on Access database - private void button1_click(object sender, eventargs e) { seek { connections.con.open(); string str = "insert `employee` (`firstname`, `lastname`, `age`, `contactnumber`, `username`, `password`) values (?, ?, ?, ?, ?, ?)"; oledbcommand cmd = new oledbcommand(str, connections.con); cmd.parameters.addwithvalue("@?", txtfirst.text.tostring()); cmd.parameters.addwithvalue("@?", txtlast.text.tostring()); cmd.parameters.addwithvalue("@?", txtage.text.tostring()); cmd.parameters.addwithvalue("@?", txtcon.text.tostring()); cmd.parameters.addwithvalue("@?", txtuser.text.tostring()); cmd.parameters.addwithvalue("@?", txtpass.text.tostring()); ...

sql - How to set database table name in Rails 4 with dot in name -

sql - How to set database table name in Rails 4 with dot in name - i have table dot in name , cannot create query it. table name is: site.com_news in model, according how explicitly specify model's table-name mapping in rails? set: class news < activerecord::base self.table_name = "site.com_news" end in log: e, [2014-10-06t17:22:34.119037 #15975] error -- : mysql2::error: table 'site.com_news' doesn't exist: select `site`.`com_news`.* `site`.`com_news` i, [2014-10-06t17:22:34.150211 #15975] info -- : rendered news/index.html.erb within layouts/application (36.2ms) i, [2014-10-06t17:22:34.150696 #15975] info -- : completed 500 internal server error in 65ms f, [2014-10-06t17:22:34.155848 #15975] fatal -- : actionview::template::error (mysql2::error: table 'site.com_news' doesn't exist: select `site`.`com_news`.* `site`.`com_news`): how escape dot character in table name? seek " site.com_news " - not work. ac...

python - Selecting files in IPython notebooks -

python - Selecting files in IPython notebooks - is there way me select files on host file-system through ipython notebook? hoping sort of widget based solution. for example, want train machine learning algorithm using files, , want able select csv files utilize training. there no widget (yet) maybe :-) otherwise on *nix ipython can things : files = !ls *.train.csv f in files: ... and expect python ipython-notebook

python - Zoomed Plot with Time Series -

python - Zoomed Plot with Time Series - my task simple: have time series ts (euro swiss franc daily exchange rates between 2010 , 2014) plot. in plot highlight time interval zooming it. however, zoomed window stays empty (see code below). furthermore, have problem selecting x-range of zoomed-in window since not know how transform dates internal integer representation of matplotlib. thanks in advance help! here code: import numpy np import pandas pd matplotlib import pyplot plt mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes mpl_toolkits.axes_grid1.inset_locator import mark_inset # load time series ts = pd.read_csv('./data/eur_chf_exchange_rates/eur_chf_daily.csv',sep=';', parse_dates=['time'], index_col = 'time',decimal=',') ts = ts['eur/chf'] ts = ts.sort_index(ascending=true) # plot fig = plt.figure(figsize=(14,5)) ax = plt.axes() ts.plot() # ts time series # label axis ax.set_xlabel('') ax.set_yl...

How to clear scons cache? CheckLibWithHeader returns "no" first time called, "yes" second time -

How to clear scons cache? CheckLibWithHeader returns "no" first time called, "yes" second time - i have sconstruct file checking google protobuf library, so: main['have_protobuf'] = main['protoc'] , \ conf.checklibwithheader('protobuf', 'google/protobuf/message.h', 'c++', 'google_protobuf_verify_version;') i noticed phone call checklibwithheader returning "no". doing debugging of script, , became apparent me subsequent identical calls checklibwithheader returned "yes". when set identical line in sconstruct file next 1 above, output follows: . . . checking accept(0,0,0) in c++ library none... (cached) yes checking zlibversion() in c++ library z... (cached) yes checking google_protobuf_verify_version in c++ library protobuf... (cached) no checking google_protobuf_verify_version in c++ library protobuf... (cached) yes checking clock_nanosleep(0,0,null,null) in c...