Posts

html - Stuck with onblur event in IE8 -

Image
when text entered in text field, ( shown in image )and if incorrect open 1 alert box on onblur event. working fine in browser except one, ie 8. in ie 8 when typing wrong letters , directly clicking on datepicker icon it's not appear alert. means not executes onblur event in ie8. note : here text field has type text, user can write anything. means facing problem in onblur event in ie8 appreciated. seems work in ie7 , up. thought. <input type='text' id="id" name="name" maxlength="10" /> <input type='text' id="id2" name="name2" onblur="count(this);" maxlength="10" /> <script type="text/javascript"> function count(arg) { arg.value = 'blue'; return arg.value; } // option var t = document.getelementbyid("id"); t.onblur = function() { alert("blurring"); }; </script>

node.js - Nesting functions in nodejs / javascript -

from i've read, nesting functions in javascript causes declarations / destructions can avoided using "static functions" or singleton implementation. "new" same thing 2 instances of function or objects independent copies. is true? if so, can have same functionality nested functions , "new". game server in nodejs / javascript. i've reached 8 levels of nested functions , starting worry. example: db.cityupdateupkeep = function( cuid ) { /** @type {array} */ var buildings = null; db.cityget( cuid, function( error, city ) { if( error ) { console.log( "couldn't city" ); } else { db.ibuildings.find( {cuid:cuid}, function( error, cursor ) { if( error ) { console.log( "-error:" ); console.log( error ); } else { cursor.toarray( function( error, response ) { ...

php - Video-IDs to array, array has zero entries -

i have code edit: works now $eigenesvideoid = array(); $eigenesvideotitel = array(); $eigenesvideotags = array(); $counter = 0; function printentirefeed($videofeed, $counter) { global $eigenesvideoid; global $eigenesvideotitel; global $eigenesvideotags; global $counter; foreach($videofeed $videoentry) { if ($videoentry->isvideoprivate() != "1") { $eigenesvideoid[$counter] = $videoentry->getvideoid(); $eigenesvideotitel[$counter] = $videoentry->getvideotitle(); $eigenesvideotags[$counter] = implode(",", $videoentry->getvideotags()); $counter++; } } try { $videofeed = $videofeed->getnextfeed(); } catch (zend_gdata_app_exception $e) { return; } if ($videofeed) { printentirefeed($videofeed, $counter); } } printentirefeed($videofeed, 1); echo count($eigenesvideoid); should put each video not private array. array empty, count zero. how change recursive function (or outer array variables) hav...

differential equations - Calculate ODE's with MATLAB -

Image
the differential equations: α'(t)=s(β-βα+α-qα^2) β'(t)=(s^-1)(-β-αβ+γ) γ'(t)=w(α-γ) intitial values α (0) = 30.00 β (0) = 1.000 γ (0) = 30.00 calculation i want solve problem t_0=0 t=10 while using values s = 1, q = 1 , w = 0.1610 i've no idea how write function ode's , appreciate help! i'm not in habit of solving other people's homework, today's lucky day guess. so, have system of coupled ordinary differential equations: α'(t) = s(β-α(β+1)-qα²) β'(t) = (-β-αβ+γ)/s γ'(t) = w(α-γ) and want solve for y = [α(t) β(t) γ(t)] with 0 < t < 10, s = 1, q = 1, w = 0.1610. way in matlab define function computes derivative ([α'(t) β'(t) γ'(t)]), , throw in 1 of ode solvers ( ode45 first bet): s = 1; q = 1; w = 0.1610; % define y(t) = [α(t) β(t) γ(t)] = [y(1) y(2) y(3)]: deriv = @(t,y) [... s * (y(2) - y(1)*(y(2)+1) - q*y(1)^2) % α'(t) (-y(2) - y(1)*y(2) + y(3))/s ...

iphone - Get ObjectManagedContext from Delegate -

i'm need de objectmanagedcontext appdelegate, when tried don't work... dont know why... followed mount of tutorials not work.... code: appdelegate.h #import <uikit/uikit.h> @class stopwalletviewcontroller; @interface stopwalletappdelegate : uiresponder <uiapplicationdelegate> @property (strong, nonatomic) uiwindow *window; @property (readonly, strong, nonatomic) nsmanagedobjectcontext *managedobjectcontext; @property (readonly, strong, nonatomic) nsmanagedobjectmodel *managedobjectmodel; @property (readonly, strong, nonatomic) nspersistentstorecoordinator *persistentstorecoordinator; @property (strong, nonatomic) stopwalletviewcontroller *viewcontroller; @property (strong,nonatomic) uinavigationcontroller *navigationcontroller; - (void)savecontext; - (nsurl *)applicationdocumentsdirectory; @end appdelegate.m #import "stopwalletappdelegate.h" #import "stopwalletviewcontroller.h" @implementation stopwalletappdelegate @synthesize...

assign - Efficiency in assigning programmatically in R -

in summary, have script importing lots of data stored in several txt files. in sigle file not rows put in same table (df switching dt), each file select rows belonging same df, get df , assign rows. the first time create df named ,say, table1 do: name <- "table1" # in code value of name depend on different factors # , **not** known in advance assign(name, somerows) then, during execution code may find (in other files) other lines put in table1 data frame, so: name <- "table" assign(name, rbindfill(get(name), somerows)) my question is: assign(get(string), anyobject) best way doing assignment programmatically? thanks edit: here simplified version of code: (each item in datasource result of read.table() 1 single text file) set.seed(1) # datasource <- list(data.frame(filetype = rep(letters[1:2], each=4), id = rep(letters[1:4], each=2), var1 = as.inte...

java - FileOutputStream appending issue, where I am going wrong? -

i trying 3 5 pdf file(from internet source) & merging them 1 after another. fyi, dont want use itext or other pdf lib, because, please @ code once public static void savefile(string[] urls, string filename) throws ioexception { clienturlconnection clienturlconnection = null; inputstream inputstream = null; try { int t = 1; fileoutputstream outputstream = new fileoutputstream(filename,true); (string url : urls) { clienturlconnection = new clienturlconnection(url); clienturlconnection.sethttpmethod(clienturlconnection.get_method); inputstream = clienturlconnection.getinputstream(); outputstream.write(ioutils.tobytearray(inputstream)); inputstream.close(); outputstream.flush(); system.out.println((t++) + " - file inserted in " + filename + "\n"); thread.sleep(3000); } outputstream.close(); ...