Posts

Showing posts from August, 2014

html - Justify vertical li element text with css -

i'd able justify text.. for life of me cannot work. html: <div id="main-content-left-container"> <ul id="left-bullets"> <li>i want all/li> <li>of text</li> <li>justified left-bullets 70% width size</li> </ul> <img > //not important here </div> css: #main-content-left-container { width: 450px; position: relative; float: left; margin-left: 5px; } #left-bullets { position: relative; width: 70%; margin: 0 15px 0 auto; list-style-type: disc; font-size: 12pt; text-align: justify; } i have tried many variations , combinations of text-align in css. display: block, etc. yet still cannot text justify. i found piece of code it: #element:after { content: ""; display: inline-block; width: 100%; } this not supported versions of ie though. fiddle: http://jsfiddle.net/bortao/ltkek/

string - Haskell types missmatch -

i want make function takes string "path" path of file has 1 line, want take line , check if it's proper expression , if build tree out of string, here code ` loadexpression :: string -> tree char loadexpression path = contents <- readfile path if checkifproper $ filter (/=' ') contents buildtreefromstring contents else emptytree ` but gives me error "couldn't match type io' with tree' " . know io string different normal 1 isn't <- suppost ? converting io string normal one. if call buildtreefromstring string "(1+2)*3" works fine, same checkifproper . the whole error : couldn't match type `io' `tree' expected type: tree string actual type: io string in return type of call of `readfile' in stmt of 'do' block: contents <- readfile path readfile has type filepath -> io string , do block in io monad. entire function therefore returns io (tree char) , no

mysql - join 2 tables using a pivot -

can please me this... so have 2 tables. user_info (username,firstname,lastname,address) , user_contact (username,number,primary,alternate) example fields in user_contacts ('abc',xxx-xxx-xxxx,1,0) ('abc',xxx-xxx-xxxx,0,1) ('abc',xxx-xxx-xxxx,0,1) ('abc',xxx-xxx-xxxx,0,1) ('def',xxx-xxx-xxxx,1,0) ('def',xxx-xxx-xxxx,0,1) ('def',xxx-xxx-xxxx,0,1) this means user can have more 1 alternate phone numbers. what want join 2 tables, , result like, (username,primary number, alternate num1, alternate num2, alternate num3 .. ) what have far this, can give me 1 alternate number , not all. select username,firstname,lastname,address, sum(if(c.primary=1,c.number,null) primary, sum(if(c.alternate=1,c.number,null) alternate user_info left join user_contact c on i.username = c.username group username i appreciate lot. read pivote tables, im unable find answers doubts. thanks in adv tha

Inserting in Binary Search Tree (C) using for loop -

i'm having trouble inserting in binary search tree using loop, when call inordertraversal function, there no output blank line, far think rest of code okay problem in insert function. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> typedef struct binarytree{ int data; struct binarytree *left; struct binarytree *right; } node; node* insert(node* head, int value) { _bool flag = true; for(node *temp = head; flag == true; (temp = (value >= temp->data)?(temp->right):(temp->left))) { if(temp == null) { temp = (node*)malloc(sizeof(node*)); temp->data = value; temp->left = null; temp->right = null; flag = false; } } return head; } void inordertraversal(node* head) { if(head == null) { return; } inordertraversal(head->left); printf("%d ",head->data); inordertraversal

apache - Restoring Derby-Database via Java -

i'm trying restore apache derby database via java. while researching found following page http://db.apache.org/derby/docs/10.3/adminguide/tadminhubbkup44.html . far understand got have running connection server , use given url make restore happen. i'm not sure how restart , restore running server in java using url. i have managed restore derby database using backup files created. problem needed shut down database before trying restore it. but ran problem. after shutdown , following restore of database database doesn't boot automatically. have tried register new driver or set shutdown attribute false none of has worked reboot database via java. this code far: public boolean restore() throws datasourceexception { string databasename = "jdbc:derby://localhost:1527/sun-appserv-samples;restorefrom="+ getrestorepath() +"sun-appserv-samples"; string delete = "jdbc:derby://localhost:1527/sun-appserv-samples;shutdown=true";

python - Possible to have ``a < b and not(a - b < 0)`` with floats -

is a < b , not(a - b < 0) possible floating points due floating point round of error? there example? it depends on floating point format, , whether has gradual underflow . ieee 754 binary floating point does. means gap between 2 distinct floats non-zero, if can represented 1 significant bit in extreme case. the smallest possible absolute difference between 2 distinct floats comes equal sign (or 1 of numbers zero), 0 exponent, , significands differ 1. in case, subtracting larger smaller result in smallest magnitude negative number, negative sign, 0 exponent, , significand 1. number compares less zero. there other calculations underflow zero. example, dividing smallest positive number number greater or equal 2 results in 0 in normal rounding mode.

database - Visual Studio Pro 2012: local db connection keeps closing -

i've tried searching this, seem if i'm person having problem. project in visual studio pro 2012, database connection keeps dropping constantly. seems random, clicking open table cause close, or writing new sql query. close right after click open it. i poked around in 'modify connection' , didn't see help, tried upping connection retries 10. doesn't help, , apparently isn't saving either, because @ 1 when checked again. it doesn't make sense - because transitioned virtual machine running locally, using amazon workspaces. none of data or settings migrated over. also, coworker has same exact setup, , never has problems. working on same project, using same database. anyone have ideas? highly irritating. thanks

javascript - Is it possible to create an object with different values determined by the id of the object? -

so have information fra .csv file want present in web page. far have var lines long string of information each column in csv file separated ; . loops elements want: `for (var = lines.length - 1; >= 0; i--) { var row = lines[i]; var header = lines[i].tostring().split(":"); var elements = header[1].tostring().split(";"); (var j =0; j <= elements.length - 1; j++) { console.log(elements[j]); }; };` when print console each column: id: 2 description: loung paa selskapssiden with: spiller where: samfundet - selskapssiden date: 06.02.2014 time: 23.00 which want. now, want add information object or whatever. how do that? possible add object can information doing object call like: information.id.description where for loop on .id ? or there easier way storing , get

python - Pandas error tokenizing data when field in csv file contains quotation mark -

i'm using pandas.read_csv read tab delimited file , running error: error tokenizing data. c error: expected 364 fields in line 73058, saw 398 after searching, seems offending entry is: "– ,쳌 \\ ?Å’  Ã¸ ,d -l ,ú ,‚ zo removing quotation mark seems solve things. i've got lot of large files lot of strange characters in them, no doubt repeat itself. need remove single quotation marks ahead of time or there way around this? there quoting argument read_csv : quoting : int or csv.quote_* instance, default none control field quoting behavior per ``csv.quote_*`` constants. use 1 of quote_minimal (0), quote_all (1), quote_nonnumeric (2) or quote_none (3). default (none) results in quote_minimal behavior. these described in csv docs . try setting quoting=3 (i.e. quote_none ).

How to create array of object from values of another variable in php? -

working code: $node1 = new stdclass(); $node1->field_granule_comments1['und'][0]['value'] = "test"; print_r($node1); result stdclass object ( [field_x] => array ( [und] => array ( [0] => array ( [value] => test ) ) ) ) i need output have value in variable. example: $id="field_x['und'][0]['value']"; $node2 = new stdclass(); $node2->$id ="test"; print_r($node2); output of code : stdclass object ( [field_x['und'][0]['value']] => test ) how can come output similar "working result", taking value variable ? try this: $id="field_x['und'][0]['value']"; $node2 = new stdclass(); $node2->{$id} ="test"; print_r($node2); enclose $id variable variable withi

javascript - How to dump an object in Spooky JS -

in casperjs it's easy dump object using: var utils = require('utils'); utils.dump(myobj); how dump object spooky.js in similar fashion? spooky seems run in node can use console.log() (like in browser).

Facebook FQL Distance paginate not working -

i wonder why fql query isnt working select page_id, name,type, distance(latitude, longitude, "37.7873589", "-122.408227") place type="place" , 5000 < distance(latitude, longitude, "37.7873589", "-122.408227") order distance(latitude, longitude, "37.7873589", "-122.408227") asc limit 10 but 1 works select page_id, name,type, distance(latitude, longitude, "37.7873589", "-122.408227") place type="place" , 5000 > distance(latitude, longitude, "37.7873589", "-122.408227") order distance(latitude, longitude, "37.7873589", "-122.408227") asc limit 10 the difference in second 1 im using greater ">". in first 1 im using less "<" i want paginate using facebook places distance. i figured out solution. reason doing because want paginate distance. if distance of last result can paginate next results using n

ios - UNIRest objective c Currency Converter Api -

i trying use currency converter api mashape located @ https://www.mashape.com/ultimate/currency-convert# ! i new objective-c. trying call api through code - nsdictionary* headers = @{@"x-mashape-authorization": @"key"}; nsdictionary* parameters = @{@"amt": @"2", @"from": @"usd", @"to": @"inr", @"accuracy": @"2"}; unihttpjsonresponse* response = [[unirest post:^(unisimplerequest* request) { [request seturl:@"https://exchange.p.mashape.com/exchange/?amt=120&from=usd&to=gbp&accuracy=3&format=json"]; [request setheaders:headers]; [request setparameters:parameters]; }] asjson]; can tell me how can access information returned , how send parameter 2 number instead of string. thanks help. it seems mashape's apis not standardized point of taking parameters parameter array - need pass them in seturl call of unihttpjsonresponse object.

c# - Only assignment, call, increment, decrement, and new object expressions can be used as a statement and ; Expected -

public string messageitem (string itemname) { { return dsmessagecontents.tables["input"].rows[0].tostring();} } i getting 2 errors: only assignment, call, increment, decrements, , new object expressions can used statement, , expected ; you're combining method , property that... won't work. :) use method: public string messageitem(string itemname) { return dsmessagecontents.tables["input"].rows[0].tostring(); } or property: public string messageitem { { return dsmessagecontents.tables["input"].rows[0].tostring(); } } read on differences here.

MongoDB - manual references example -

i reading manual references part mongodb database references documentation, don't understand part of "second query resolve referenced fields". give me example of query, can better idea of talking about. "manual references refers practice of including 1 document’s _id field in document. application can issue second query resolve referenced fields needed." the documentation pretty clear in manual section referring section on database references . important part in comprehending contained in opening statement on page: "mongodb not support joins. in mongodb data denormalized, or stored related data in documents remove need joins. however, in cases makes sense store related information in separate documents, typically in different collections or databases." the further information covers topic of how might choose deal accessing data store in collection. there dbref specification without going more detail, may implemented in

Java for each loop being flagged as UR anomaly by PMD -

i confirm if bug on pmd? how file ticket if is. public static void main(final string[] args) { (final string string : args) { string.getbytes(); //ur anomaly } (int = 0; < args.length; i++) { args[i].getbytes(); } } lines 1-3 being flagged ur anomaly, while rewriting iterate local variable fine. would eliminate pmd violations, inconvenient have resort old loop construct workaround. while controversial, not wish disable rule since find dd, , du anomaly flagging useful. it appears have hit bug in pmd. dataflowanomalyanalysis rule not seem catch possible kinds of variable definitions (another example found here ). ur stands "undefined reference", incorrect. so, can do? since problem appears affect ur part of rule, can disable , continue using du , dd parts. need recent version of pmd this. in ruleset file, suppress ur findings this: <rule ref="rulesets/java/controversial.xml/da

excel - Using VBA To Convert A Column of Formulas From Relative To Fixed Reference -

first off, apologies if silly question. i'm new vba. searched online answer couldn't find it. i'm trying convert long column of formulas relative references absolute cell references. essentially, vba go through column, select cell, "hit f4" , move next cell. i recorded action in vba , got following: activecell.formular1c1 = "='worksheet'!r11c9" range("g5212").select my question in command equivalent of hitting f4? i'm not @ reading vba , i'm trying understand this. and, of course, if i'm going wrong way please let me know. thank you. dim lastcell range set lastcell = range("g" & rows.count).end(xlup) range("g1", lastcell).formula = application.convertformula _ (formula:=range("g1", lastcell).formula, fromreferencestyle:=xla1, _ toreferencestyle:=xla1, toabsolute:=xlabsolute) change column needed. assumed g based on question.

shell - How can I increment a number in a while-loop while preserving leading zeroes (BASH < V4) -

i trying write bash script downloads transcripts of podcast curl. transcript files have name differs 3 digits: filename[three-digits].txt from filename001.txt to.... filename440.txt . i store 3 digits number in variable , increment variable in while loop. how can increment number without losing leading zeroes? #!/bin/bash clear # [...] code handling storage episode=001 last=440 secnow_transcript_url="https://www.grc.com/sn/sn-" last_token=".txt" while [ $episode -le $last ]; curl -x $secnow_transcript_url$episode$last_token > # storage location episode=$[$episode+001]; sleep 60 # don't stress server much! done i searched lot , discovered nice approaches of others , solve problem, out of curiosity love know if there solution problem keeps while-loop , despite for-loop more appropriate in first place, know range, day come, when need while loop! :-) #!/bin/bash episode in $(seq -w 01 05); curl -x $secnow_transcript_url$epis

iphone - CLViewController, display detail view in fullscreen, iOS sdk -

i working on ios application , have used split view structure facebook application has. i have used code has clviewcontroller , code have found google. all working fine in current application when app loads first screen shows split view in 80% screen shows menu , 20% shows detail page. want change in way facebook app works. in facebook on loading app directly shows news feed . same way want load detail page first. if have idea how can achieve please share. thanks in advance. code : how use swrevealviewcontroller here first initialize view controllers firstviewcontroller * first = [[firstviewcontroller alloc]init]; secondviewcontroller * second = [[secondviewcontroller alloc]init]; create barbutton.... uibarbuttonitem *revealbutton = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"reveal-icon"] style:uibarbuttonitemstyleplain target:_revealvc action:@selector(revealtoggleanimated:)]; put firstviewcontroller , secondviewcontroller na

Java - MDB - How to avoid concurrency issue -

we have mdb implemented take user input , processing parallel. have limit check on user data (like number of phone numbers user can have). the problem i'm facing 2 different threads pickup same user's data , processes. first thread fine , checks limit , adds phone user profile correctly. second thread same. limit check happens before first thread commits transaction, limit check passed. crossed limit. is there way fix? making 1 user's data picked same thread fine. i'm not sure how that. please help. in advance. edit: 1 more thing missed convey. issue happens when running in different nodes. it depends application server, number of nodes , application, follwing scenarios ok me: weblogic or jboss support unit of order feature: message unit-of-order weblogic server value-added feature enables stand alone message producer, or group of producers acting one, group messages single unit respect processing order. single unit called unit-of-or

apache - phpMyAdmin SSL configuration -

i have 2 mysql users, regular 'tommy' , control user 'tommy_ctl' apache httpd 2.4.7 runs on 9090 http , 9080 https phpmyadmin (v4.1.6) config.inc.php file has user/password 'tommy_ctl' logging phpmyadmin home page 'tommy' now a) in config.inc.php $cfg['servers'][$i]['ssl'] = false; $cfg['forcessl'] = false; i can logon http://linuxboxa:9090/phpmyadmin/index.php https://linuxboxa:9080/phpmyadmin/index.php b) when set $cfg['servers'][$i]['ssl'] = true; why https://linuxboxa:9080/phpmyadmin/index.php on logon give error ?: #1043 cannot log in mysql server connection controluser defined in configuration failed is ssl option not communication on apache? c) when set $cfg['servers'][$i]['ssl'] = true; $cfg['forcessl'] = true; the https 9080 url takes many many seconds open https://lnappd201.hphc.org:9080/phpmyadmin/index.php and on

python 3.x - is inputted point within the rectangle centered on the (0,0) axis -

trying write simple python program determine if 2 points (x, y) input user fall within rectangle centered on (0,0) axis width of 10 , height of 5. here am. x = eval(input("enter x point : ")) y = eval(input("enter y point : ")) if x <= 10.0 / 2: if y <= 5.0 / 2: print("point (" + str(x) + ", " + str(y) + ") in rectangle") else: print("point (" + str(x) + ", " + str(y) + ") not in rectangle") this wont work on negative side. there math function needing, can't figure out one. i have added distance = math.sqrt (( x * x ) + ( y * y )) , changed ifs distance instead of x , y. confused. width = 10 height = 5 x_center = 0 y_center = 0 x_str = input("enter x point: ") y_str = input("enter y point: ") x = float(x_str) y = float(y_str) is_in = true if not (x_center - width/2 <= x <= x_center + width/2): is_in = false if not (y_center

tsql - Trying to find substring in string on sql server -

i have read in many articles , including here on stackoverflow find substring following should used: if charindex('myword', @words) > 0 begin -- end i trying following it's not working returns wrong: say have string 'basketball & soccer' , trying write script checks ampersand , encodes &amp; becomes 'basketball &amp; soccer' problem there may 1 in database 'basketball &amp; soccer' . so when run script, second 1 becomes: 'basketball &amp;amp; soccer' i trying following clean it: declare @cleanparam varchar(500) if charindex('&amp;',@myparameter) > 0 begin -- if &amp; in string skip , start quotes select @cleanparam = replace(@myparameter,'"','&quot;') end else begin -- if not clean &'s , quotes , continue others select @cleanparam = replace(@myparameter,'&','&amp;') select @cleanparam

c++ - Is this approach of moving data from standard containers to shared pointers correct? -

here problem: have std::string defined in function. need extend scope of string because of asynchronous operation. naturally can copy shared pointer this: { std::string hi{"hi"}; auto shared_hi = std::make_shared<std::string>(hi); //insert shared_hi in async queue } the problem strings very big, , vectors, , std::arrays. not avoid copy, have function can "steal" data out of containers without having copy them. i've come clever solution posted below, i'm wondering if there isn't better solution this. if there isn't, i'd know if doing i'm doing below defined behavior: template<class t> class wrappeddeleter { public: wrappeddeleter(t &&other): o_(std::move(other)) { } private: t o_; }; //this function creates deleter scope template<class p, class t> std::function<void(p *)> make_delete(t &&encapsulate) { wrappeddeleter<t> *d = new wrappeddeleter<t>(std::move(encapsulate));

dynamic - How to Dynamically Change the Rowsource of an Access Chart -

i know if there way can set rowsource property of chart in report @ run time. i intend have chart in report's group header section. rowsource of chart should updated according group header's value. i got error 2455 - invalid reference property rowsource when tried in vba. i using access 2003. thank you. i got inspiration after searching on internet time. here solution implement. firstly, true rowsource property of chart cannot changed programmatically @ run time. however, can set rowsource property query object , later update query object in vba. here part of code. currentdb.querydefs("myquery").sql = "a new query" me.mychart.requery i have set chart's row source query object named "myquery". placed above code in format event of group header, every time when group header loaded can use value of group header update query object.

Is there a TCl equivalent of PHP's header tag -

can tell use in tcl redirecting page in case of header tag in php i used ::ncgi::redirect not redirecting automatically try using ::ncgi::redirect @ top of code. basically, should come before writing response because returns header browser. there should not puts statements before ::ncgi::redirect try returning header this: ::ncgi::header text/html location $url . again, should done before printing response.

android - can i set all textviews to marquee? -

i have 6 textviews , want them marquee @ same time <textview android:ellipsize="marquee" android:focusable="true" android:focusableintouchmode="true"/> <textview android:ellipsize="marquee" android:focusable="true" android:focusableintouchmode="true"> is possible? code textview txt2 = (textview)findviewbyid(r.id.textview2) txt2.setselected(true); but crashes app try :- hope out..... :) <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="marquee" a

Is there a way to remember the position in a python iterator? -

i iterate on iterable object (let's say, list) , leave @ point remembering position left off continue next time iterator object called. something like: for val in list: do_stuff(val) if some_condition: break do_stuff() val in list: continue_doing_stuff(val) speed matters , list considered quite large. saving object , iterating again through whole list until saved element found not option. possible without writing explicit iterator class list? as peter suggested in comments, can wrap iterable in iter() make generator: a_list = ['a', 'b', 'c', 'd'] iter_list = iter(a_list) val in iter_list: print(val) # do_stuff(val) if val == 'b': break print('taking break') # do_stuff() val in iter_list: print(val) #continue_doing_stuff(val) shows: a b taking break c d and think elegant approach.

objective c - UINavigationController flow for login ios -

Image
solved: once user has logged in / signed up, use following code transition main storyboard... uiwindow* window = [[uiapplication sharedapplication] keywindow]; window.rootviewcontroller = [[uistoryboard storyboardwithname:@"main" bundle:[nsbundle mainbundle]] instantiateinitialviewcontroller]; i have following uinavigationcontroller flow handle logging in...the top segue after tabbarcontroller goes uinavigationcontroller root viewcontroller. when user logged in "this segue works" executed user doesn't have log in @ login screen. works perfectly. issue run when user has login...the segue login/signup screen login screen works perfectly, when go login screen tabbar following happens: this shouldn't happen because have following code in viewcontroller.m (gotten here called) - (void)viewdidload { ... self.navigationitem.title = @"messages"; self.navigationitem.hidesbackbutton = yes; nslog(@"gotten here"

sql - Handling performance and using data types -

i have web forms contain approx 100 150 text fields. so, in of fields user can enter great amount of string data. had entered varchar(150) , not large enough. so, question is, better use: varchar(max) or text ? using sql server 2008 r2. there many related questions available on stack overflow, still confused. assuming web forms more 50 fields text datatype, cause performance-related issues, or make our db large? thought varchar(max) store 8000 characters maximum, have fields can have more 8000 characters. please guide... if you're using sql server 2005 or newer use varchar(max). text datatype deprecated , should not used new development work. see also: http://msdn.microsoft.com/en-us/library/ms187993%28v=sql.90%29.aspx to answer questions in comments: 8000 maximum can enter in default varchar(x) type. because can maximum 8000 characters in 'data-page'. varchar(max) can store 2^31-1 bytes @doug_ivison allready mentioned. consequently amount of cha

php - Twilio StatusCallback not working when modifying a live call -

i trying forward call in twilio modifying live call. have number set zip code caller , determine customer number forward call searching in database. first part of call (to zip code) i'm using gather verb. once have zip code , customer's assigned twilio number can forward call using rest api modify live call. i need add parameters callback url request. according twilio's website should able post statuscallbackurl , method modified call. https://www.twilio.com/docs/api/rest/change-call-state however, not working. here code: $url = 'http://xxxx.com/phone/customer?to='.$number; $call = $this->twilio->account->calls->get($this->request->query->get('callsid')); $call->update(array( 'url' => $url, 'method' => 'get', 'statuscallbackmethod' => 'get', 'statuscallback' => 'http://xxxx.com/phone/log/callback' )); the "url" , "method" o

entitydatasource - Ordering Entity datasource wilth Nulls first -

i have gridview in column has both alphabets , nulls values coming database(oracle). when perform sort operation on column sorting data in ascending null values coming @ last. after analysis came know oracle default sorts data nulls @ end. is there way can override default behaviour? i tried setting orderby property of entity data source below. <asp:entitydatasource id="griddatasource" runat="server" enabledelete="true" enableupdate="true" connectionstring="name=hqadataentities" defaultcontainername="hqadataentities" orderby="case when it.[gnrc_lkup_category] null 0 else 1 end,it.[gnrc_lkup_category]" enableflattening="false" enableinsert="true" entitysetname="gen_lookup"> but woking on initial page load, when perform sort clicking grid header not performing sort correctly.

c# - split array and get last value of each index -

i have string looks string sortorder= "download-15104,download-15103,download-15105,download-15106,download-15107,download-16104,download-16105"; and want ids . , did var ids= new list<int>(); var sortorderarray = sortorder.split(','); foreach (var item in sortorderarray) { var obj = item.split('-'); ids.add(int.parse(obj[1])); } is there other way , quick ? you use linq: var ids = input.split(',').select(x => int.parse(x.split('0')[1])).tolist(); but, it not faster . uses loops internally anyway. may more readable.

c# - Background worker does not work properly in do work event in wpf -

i have read post did not me : background worker not work in wpf i using background worker in wpf(c#) , want when reading text file , shows "loading ...." not show. code : private delegate void upmdlg(); private delegate void upmdlg2(); private void callmetoread() { streamreader str = new streamreader("c:\\test.txt"); while (!str.endofstream) { richtextbox1.appendtext(str.readtoend()); } } private void callmetochangelabel() { label1.foreground = brushes.red; label1.content = "loading ...."; } private void window_loaded(object sender, routedeventargs e) { label1.foreground = brushes.yellow; label1.content = "idle"; backgroundworker bg = new backgroundworker(); bg.dowork += delegate(object s, doworkeventargs args) { upmdlg mo = new upmdlg(callmetochangelabel); label1.dispat

assembly - What does push dword ptr [eax+22] mean? -

i know e.g. push eax save eax stack , decrement esp 4. , push dword ptr means needs push 4 bytes, i'm confused. if [esi+22] same thing? the push instruction, many other x86 instructions, can take variety of operands: immediate values, registers, , memory addresses: push 10 ; pushes value 10 (32 bits in 32-bit mode) push eax ; pushes contents of 32-bit register eax push dword [ebx + 42] ; pushes 32 bits memory location ebx + 42 the register form infers size size of register. memory form needs have size specified (e.g. here shown in intel syntax). immediate values, operand size either 16 or 32 bits; current mode default, , other size can explicitly selected (e.g. push word 10 in 32-bit mode).

jquery - Capture user Idling using javascript -

our site has ifame links different content sites used online exams exams in content pages running 3+ hours exam guard there prevent users doing other stuff while doing exams the problem once user completed exams on 3+hrs , come parent site (our site) has session time out issue in parent page, (parent site session time out set 180min ) as solution have implemented following jquery var to; $(document).ready(function () { = settimeout("timeout()", 10000); }); function timeout() { $.ajax({ type: "post", url: "keepalivedummy.aspx", success: function () { = settimeout("timeout()", 10000); } }); }; now problem if 1 user open parent site , go away keep session unwantedly, any suggestion capture idle time? we can use "mousemove" event , see whether user active or not. i have used below code test whether user idle time reached maximum

xml - Using XSLT insert a new node with hyperlink -

im new xsl. here xml have, applying xsl want insert new node inside elements/element node. see below output im getting , expected output. m pasting xsl used nodes output. please provide change xsl can insert new node , display same in hierarchy. please provide valuable inputs. <?xml version="1.0" encoding="utf-8"?> <plans xmlns="http://test.org/schema/product/v1"> <plan effdate="2013-07-01" enddate="9999-12-31" id="md0000002524" source="pdm" state="released" version="i.8" vertical="medical"> <!--generated by: generatepdmcanonical ver. 16.4--> <!--codeset version 1.6--> <!--generated by: filterpdm ver. 8--> <ids windchill="md0000002524"> <id type="windchill">1</id> <id type="boc">1</id> </ids> <planinfo> <productinfo source=

sql - How to add a string value to the results in a row -

i'm beginner in sql, , have assingment working on ask's show date , century. although simple thing do, thought adding in string separates result of century, if date shown, , enter string saying "current century -" century result following, , of being in same row. here's code using create table , it's results: select to_char(current_date, 'month, dd, yyyy cc') "today's date , century" dual; it produces this: today's date , century february , 05, 2014 21 i can't seem find let me add string results right before, or after century part, can this: february , 05, 2014 current century - 21st anybody got ideas on how go doing this, or links can go read how this? you can that: select to_char(current_date, 'month, dd, yyyy "current century -" cc"st"') "today's date , century" dual; you can insert any text in quotations within format string

error in a r code for implementing non-linear regression -

Image
i attempted fit following model: > x<-c(8100,12900,13800,14250,14700,20700,23100,25200,27300,28560,29760,30060,39060,39660,42060, 42660,57720,57840,58200,59400,59700,60900,62100,65400,85200,88200,88800,98400,106800,114900) > y<-c(1:30) > df<-data.frame(x,y) > fit <- nls(y ~ a*(1-exp(-x/b))^c, data=df, start=c(a=1,b=1,c=1),algorithm="plinear") error in qr.solve(qr.b, cc) : singular matrix 'a' in solve > fit <- nls(y ~ a*(1-exp(-x/b))^c, data=df, start=c(a=1,b=1,c=1),algorithm="port") error in nlsmodel(formula, mf, start, wts, upper) : singular gradient matrix @ initial parameter estimates but can see got error regarding singular gradient matrix. can avoid error? the problem estimate of b way off. x ~o(10000) , use b=1e4 starting point. x<-c(8100,12900,13800,14250,14700,20700,23100,25200,27300,28560,29760,30060,39060,39660,4206042660,57720,57840,58200,59400,59700,60900,62100,65400,85200,88200,88800,984

php - Laravel 4 : Error in fetching photos from Flickr -

Image
i using anahkiasen/flickering data flickr in laravel . i new laravel. see had did fetching data flickr. in homecontroller made 1 method public function flicker() { $apikey = "my api key"; $apisecret = "my api secret"; $method = flickering::handshake($apikey,$apisecret); $result = flickering::getresultsof('photosets.getlist', array('user_id' => '116552873@n04', 'per_page' => 20)); echo "<pre>";print_r($result);echo "</pre>";die; } this code throws error : looking @ documentation: to start working flickering, create new instance of example underneath. if set api credentials in config file, don't need pass arguments constructor automatically fetch key , secret key config files. you need create new instance: $flickering = new flickering\flickering($apikey, $apisecret); so: $method

How to successfully use ffmpeg to convert images into videos -

currently i'm trying make 5 second videos each image , combining them using concat, i'm having lot of issues doing this. here code: ffmpeg -loop 1 -i 000.jpg -t 5 000.mp4 ffmpeg -loop 1 -i 001.jpg -t 5 001.mp4 ffmpeg -f concat -i inputs.txt -codec copy output.mp4 inputs.txt lists following file '000.mp4' file '001.mp4' now when try of this, run output mp4 file , first part of works fine, once starts displaying 001 part of video, switches gray screen. doesn't in stand-alone file 001.mp4. any suggestions on what's going on or fix this? i've tried many other things too. switching files on png instead, gave same issue. tried using different output file types wmv, avi, etc. i'm still new though don't know else try. this shows in command prompt after running command. c:\xampp\htdocs\images>ffmpeg -f concat -i inputs.txt -codec copy output.mp4 ffmpeg version n-50911-g9efcfbe copyright (c) 2000-2013 ffmpeg developers built on

indexing - How do I check the end of a string in C++? -

i have rudimentary program i'm trying implement asks url of .pdf file , downloads , shows through xming. first, want check make sure user put in url 'http://' @ front , 'pdf' or 'pdf' @ end. suppose might typical problem coming python, how check end of string user inputs. using method below (which used python-oriented-brain) range error: -3 so how actual c++ programmers accomplish task? please , thank you. if (file[0]=='h' && file[1]=='t' && file[2]=='t' && file[3]=='p' && file[4]==':' && file[5]=='/' && file[6]=='/' && (file[-3]=='p' || file[-3]=='p') && (file[-2]=='d' || file[-2]=='d') && (file[-1]=='f' || file[-1]=='f')) in c++ cant access negative indizies. have manually calculate position of laste element: int s = file.size(); (file[s-3]=='p' || file[s

checkbox - Checkboxes from "0" to "1" in a string -

i have program when checkboxes checked, code behind changes 0 1. code: dim string = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" if checkbox1.checked = true a(0) = "1" = left(a, 1) + right(a, 89) msgbox(a) else msgbox("wrong!") end if apparently a(0)="1" wrong. this code 1 checkbox, if have 90 checkboxes, how code it?

java - How can I fix this "plus" method in Polynomial class using BigInteger -

i appreciate help. able finish modifying in class biginteger format except compose method. can me last part why not working correctly? appreciate it, thanks. import java.math.biginteger; public class polynomial { private biginteger[] coef; // coefficients private int deg; // degree of polynomial (0 0 polynomial) /** creates constant polynomial p(x) = 1. */ public polynomial(){ coef = new biginteger[1]; coef[0] = new biginteger("1"); deg = 0; } /** creates linear polynomial of form p(x) = x + a. */ public polynomial(int a){ coef = new biginteger[2]; coef[1] = new biginteger("1"); coef[0] = new biginteger(integer.tostring(a)); deg = 1; } /** creates polynomial p(x) = * x^b. */ public polynomial(int a, int b) { coef = new biginteger[b+1]; for(int = 0; < b; i++){ if(coef[i] == null) coef[i] = new biginteger("0"); } coef[b] = new biginteger(integer.tostring(a)); de

java - How to do delayed zone reload in Tapestry? -

is there way delayed zone reload in tapestry. i have not-so-quick operation perform when submit form. results visible after few seconds (usually 2 or 3). is there way delayed zone reload, show indicator zone reload in x seconds , perform actual reload? normally zone update requests blocked @ java side. application not work in single threaded way can use periodiczoneupdater. client polling updates

c++ - Are all functions "noexcept" if exceptions are disabled? -

if turn off exceptions compiling -fno-exceptions functions considered noexcept example std::move_if_noexcept or still have declare functions noexcept reason? the -fno-exceptions prevent throwing exceptions, can not prevent exceptions being thrown libraries. for example, next example terminate because of not caught exception : #include <vector> int main() { std::vector<int> v{1,2,3,4,5,6}; return v.at(55); } but next example not compile, because of -fno-exceptions option : int main() { throw 22; } it fails : g++ -std=c++11 -g -wall -wextra -fno-exceptions ./garbage.cpp ./garbage.cpp: in function ‘int main()’: ./garbage.cpp:4:8: error: exception handling disabled, use -fexceptions enable throw 22; from this article, doing without chapter : user code uses c++ keywords throw, try, , catch produce errors if user code has included libstdc++ headers , using constructs basic_iostream. on other hand, noexcept marks m

c++ - reading a line from a file and put it in a string (with fstream) -

i want read file , put each line in string (each line contains single word) i've used getline doesn't work neither >> command. here's code: (i'm using visual studio) string device_kind; ifstream bank_info; bank_info.open ("acquirer.info"); bank_info >> device_kind; //fails compile getline (bank_info, device_kind); //also fails bank_info.close(); use bank_info.geline(device_kind,size) getline member function of ifstream use . operator.

listview - JavaFX - Scroll on parent node -

Image
i creating contact list in javafx. contact groups titledpane of accordion , content of each titledpane listview. accordion wrapped in scollpane. each time titledpane expanded, resize height of accordion listview displayed without scollbar (as shown in code below). scroll bar can appear on accordion. groupaccordion.expandedpaneproperty().addlistener(new changelistener<titledpane>() { @override public void changed(observablevalue<? extends titledpane> property, final titledpane oldpane, final titledpane newpane) { if (newpane != null) { groupaccordion.setminheight(listviewfullsize); groupaccordion.setmaxheight(listviewfullsize); } } }); here fxml: <scrollpane fx:id="scrollpane" prefheight="-1.0" prefwidth="-1.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="groupscontroller"> <content> <accordi

html - jQuery to Retrieve Data From an XML File -

i need retrieve attribute value in below xml : <datasource id="social_messages2" serial="20140205152417255" type="feed" subtype="" mtime="2014-02-05t14:24:17.2554296z" mtime_unix="1391610257" tz="+0100" ttl="5"> <entry id="13036083562208554600000000" ctime="2014-02-05t14:19:17.5991796z" mtime="2014-02-05t14:19:17.5991796z" ctime_unix="1391609958" mtime_unix="1391609958"> <field name="design">user</field> <field name="message">rt @thatssarcasm: summer 2014 yet</field> <field name="nickname">@devine_318</field> <field name="mid">543606</field> <field name="iconname"/> <field name="timestamp">2014-01-30 15:17:46</field> <field name="viz_image"/> <field name="via">twitter</field> <

memory - Why Initializing object to null is not dereferenced the object in java? -

i working application have implemented observer pattern set slider value on change in model. have button called clear clear window , set observer null before removing listener .so after did memory mapping profiler .but scared find object still there. in 2nd exp before making observer null first remove listener make null , found profiler object collected garbage collector. below provide snipnet of code .any light on appreciated . controls = new createcontrols(); scene scene = new scene(new group()); stage.settitle("table view sample"); stage.setwidth(300); stage.setheight(500); final vbox vbox = new vbox(); vbox.setspacing(5); vbox.setpadding(new insets(10, 0, 0, 10)); controlbox = controls.creatcontrols(); vbox.getchildren().add(controlbox); final button clear = new button("clear"); vbox.getchildren().add(clear); eventhandler deletehnadler= new eventha