Posts

sql - Recurring date table -

i got table lot of scheduled events. want create datawarehouse table coming events setup table. how next week? events starts every 5 min, hourly, 3-hourly, daily , so. example table event_name, last_run, next_time, intervallroundup5min job1, 2015-06-10 14:48:03.147, 2015-06-10 14:49:00.000 , 5 job2, 2015-06-10 12:27:09.637, 2015-06-10 15:25:00.000, 180 if rdbms supports recursive ctes, this: with futurecte ( select event_name, dateadd(mi,intervallroundup5min,next_time) nexttime ,intervallroundup5min table1 union select event_name, dateadd(mi,intervallroundup5min,nexttime) ,intervallroundup5min futurecte dateadd(mi,intervallroundup5min,nexttime) <= '2015-06-11' --end date ) select event_name, nexttime futurecte modify end date whatever value want. sql fiddle

php - MySQL difficulties with AS combined with HAVING -

i have as-related mysql question, when combined having: this does work (mind "(250) as", second line): select a.uid, a.name, a.height, a.width, (250) squaresize tx_fach_domain_model_professional a, tx_fach_domain_model_category b, tx_fach_professional_category_mm mm mm.uid_local = a.uid , mm.uid_foreign = 2 having squaresize > 20 order squaresize limit 0 , 4; this not work: select a.uid, a.name, a.height, a.width, (a.height * a.width) squaresize tx_fach_domain_model_professional a, tx_fach_domain_model_category b, tx_fach_professional_category_mm mm mm.uid_local = a.uid , mm.uid_foreign = 2 having squaresize > 20 order squaresize limit 0 , 4; the strange thing doesn't give me errors returns 4 of same rows/records, instead of 4 different ones. pretty clueless here.. above simplified version of real problem.. have (200) in example above, i'm trying measure distance value between longitude , latitude values: select a.uid, a.name, a.latitute, ...

javascript - JS Code didn't work, trying do a demo in css lessons -

but there's demo uses js , css. have been trying fix 3-4 hours. (fyi after 2 hours struggling have found half of solution. i'm using safari , should -webkit-transform ) have tried css added directly element , worked, doesn't worked using js. i have download jquery-1.11.3.js , import it. the lesson i'm watching (on 3:45:55) and when click nothing happened. why!? login.html <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> </title> <link rel='stylesheet' type="text/css" href='logincss.css' /> </head> <body> <div id="banner">please login!</div> <form> <div> <label for="name">name:</label> <input type="text" name="name" /> </div> <div> <label for="email">email:</label> ...

android - Achieve different text sizes of RadioButton programmatically -

i'm using different sizes of text different screen resolutions. this, created resource values/dimens.xml , values-sw720dp/dimens.xml . not understand how use values dimens.xml when creating radiobutton programmatically? radiobutton newradiobutton = new radiobutton(this); newradiobutton.settextsize(30); //how use values dimens.xml? newradiobutton.settextcolor(color.parsecolor("#002060")); radiogroup.addview(newradiobutton, layoutparams); getresources().getdimension(r.dimen.test)

rust - Rustc/LLVM generates faulty code for aarch64 with opt-level=0 -

i have 2 files assembled/compiled/linked minimalistic kernel. start.s: .set cpacr_el1_fpen, 0b11 << 20 .set boot_stack_size, 8 * 1024 .global __boot_stack .global __start .global __halt .bss .align 16 __boot_stack: .fill boot_stack_size .text __start: /* disable fp , simd traps */ mov x0, #cpacr_el1_fpen msr cpacr_el1, x0 /* set stack */ adr x0, __boot_stack add sp, x0, #boot_stack_size /* call rust entry point */ bl __boot __halt: /* halt cpu */ wfi b __halt boot.rs: #[no_mangle] pub extern fn __boot() { unsafe { let ptr = 0x9000000 *mut u8; *ptr = '!' u8; } } for opt-level=3 resulting code outputs single '!' serial port (as intended). opt-level=0 have strange infinite loop (e.g. '!!!!!!!!!....'). here disassembled dump of problematic code: 0000000000000000 <__kernel_begin>: 0: d2a00600 mov x0, #0x300000 ...

Rails select and concatenate subset of columns -

i have following activerecord row: #<location id: 1, name: "test center", description: nil, address: "some road along way", city: "porto", country: "pt", latitude: nil, longitude: nil, created_at: "2015-06-05 19:03:04", updated_at: "2015-06-05 19:03:04"> what need end this: some road along way,porto,pt which coma seperated list of address , city , country . i tried call select , turn hash first, no avail, ideas? there several solutions many variations this. here two: 1. put them in array , join it: [location.address, location.city, location.country].join(',') 2. use string interpolation: "#{location.address},#{location.city},#{location.country}" you can wrap them in method in model or create rails helper. in model: class location < activerecord::base # other code here def description [address, city, country].join(',') end end helper metho...

java - Getting nullpointer exception in the last node of singlylinked list -

Image
public class node { public string name; public node next; public node(string name, node next ){ this.name = name; this.next = next; } public string getname(){ return name; } public void setname(string n){ name = n; } public node getnext(){ return next; } public void setnext(node n){ next = n; } public string tostring() { return "name " + name; } } public class linkedlist { node head = null; int nodecount= 0; int counter = 0; linkedlist(){ head = null; } public boolean isempty(){ return (head != null); } public void insertnode( string name ){ if( head == null){ head = new node(name, null); nodecount++; }else{ node temp = new node(name, null); temp.next = head; head = temp; nodecount++; } } public nod...