Posts

sql - Aggregate function over a given time interval -

my sql bit rusty , i'm having quite bit of difficulty problem. suppose have table timestamp column , number column. goal return result set containing average value arbitrarily chosen regular interval. so, example, if had following initial data, resulting output 5 minute interval follows: time value ------------------------------- ----- 06-jun-12 12.40.00.000000000 pm 2 06-jun-12 12.41.35.000000000 pm 3 06-jun-12 12.43.22.000000000 pm 4 06-jun-12 12.47.55.000000000 pm 5 06-jun-12 12.52.00.000000000 pm 2 06-jun-12 12.54.59.000000000 pm 3 06-jun-12 12.56.01.000000000 pm 4 output: start_time avg_value ------------------------------- --------- 06-jun-12 12.40.00.000000000 pm 3 06-jun-12 12.45.00.000000000 pm 5 06-jun-12 12.50.00.000000000 pm 2.5 06-jun-12 12.55.00.000000000 pm 4 note oracle database, oracle-specific solutions work fine. could, of course, done st...

vb.net - Setting a databound TextBox control's BorderStyle overrides the new Text value -

Image
i've found , able reproduce peculiar behaviour in windows forms, in updating text in databound textbox , changing borderstyle override new text value. to reproduce: create new form, add 3 textbox controls, , use following code: public class form1 private class sampleobject public property mytext string = string.empty end class private _sampleobject1 new sampleobject {.mytext = "old text 1"} private _sampleobject2 new sampleobject {.mytext = "old text 2"} private _sampleobject3 new sampleobject {.mytext = "old text 3"} private sub form1_load(sender object, e eventargs) handles me.load textbox1.databindings.add(new binding("text", _sampleobject1, "mytext", true, datasourceupdatemode.onvalidation, string.empty)) textbox2.databindings.add(new binding("text", _sampleobject2, "mytext", true, datasourceupdatemode.onvalidation, string.empty)) textbox3.da...

php - User authentication with SecurityServiceProvider via POST -

what i'm looking authenticate users on bar .com , post credentials foo.com/login , re-authenticate them without needing log in again. currently, secure pages on foo.com i'm using form-based access via securityserviceprovider , db-backed userprovider authenticate. works great: attempt load secured route intercepted firewall , redirected after successful authentication. what can't figure out how pass post variables (username , password) on provider instance , forward user supplied route. stub post route: $app->post('/login', function(request $req) use ($app) { $route = $req->request->filter('route'); $username = $req->get('username'); $password = $req->get('password'); /* magic happens...? */ }); here example of using user provider load user check password matches setting token in security service. if put code route can access request username , password. $userprovider = $app[...

f# - Passing large sequences as function parameters -

this simple question (but couldn't seem find answer in msdn documents). if pass large sequences , objects function parameters in f#, copied value unless supply byref keyword? thing is, have no intention of modifying arguments, @ same time, don't want large objects copied each time call function. by default sequences/lists/arrays passed reference for example let mutate (arr:int[]) = arr.[0] <- 1 let t = array.zerocreate 1 mutate t printfn "%i" (t.[0]) //prints 1

java - Dynamically creating rows in Excel sheet with Apache POI -

i'm writing program read large xml file , create excel file it. attributes of each node column headers in excel file. created dom object , got nodelist. need iterate through , each node, need add row in excel sheet node's attributes values column values. so, when iterating, need create rows dynamically. how can it? dont see functionality add created rows in apache poi, far have seen define new rows everytime. i'm unable since has more 5000 entries. want is: node node = null; hssfrow datarow = null; (int = 0; < nodelist.getlength(); i++) { node = nodelist.item(i); datarow = spreadsheet.createrow(i); //set values data row here, , add it. //so in loop, next time same variable assigned spreadsheet.createrow(1) etc. } i understand createrow invoked spreadsheet, add row it. in loop, same variable assigned other rows too, think 1 row. please advice me on this. try following node node = null; hssfrow data...

callback - GWT Query selector not working -

gwt query selector i.e. $("#id") not working inside callback function. xyz.find("#id") works, xyz -> gquery variable. callback function doesn't support $ selector or there other problem. are sure element id "id" attached dom when callback function called ? when execute $("#id"), gquery try find elements matching selectors within set of elements of dom tree . when execute xyz.find("#id"), gquery try find elements matching selectors inside array of elements selected xyz no matter elements still or not in dom tree.

Batch script compiler -

is there batch script compiler available? have big batch file , want check syntax going wrong. using @pause , echo can check what's going wrong compiler better option. i suppose best find syntax checker, not real compiler, in batch many constructs compile @ runtime. each %var% expansion needs compile in moment of expansion, content change everything. possibility of self modifying code makes problem bit tricky. perhaps someone, write batch debugger, should possible.