Posts

sql - Check date value in Netezza -

in netezza , trying check if date value valid or not ; isdate function in sql server. i getting dates 11/31/2013 not valid, how in netezza can check if date valid exclude them process. thanks i don't believe there built-in netezza function check if date valid. may able write lua function this, or try joining "date" lookup table, so: create table 2 columns: date_value date date_string varchar(10) load data table valid dates (generate file in favorite tool, excel, unix, whatever). there can more 1 row per date_value (different "valid" formats) if use this check. if fill in from, say, 1900 2100, long data within range, you'll fine. , it's small table, too, ~200 years ~7300 rows. add more if needed. heck, since nz date datatype goes ad1 ad 9999, fill 3.4 million rows (small nz). then, isolate rows have invalid dates, use join or exists / not exists table, on date_string. since table small, netezza broadcast spus, making performanc...

c# - Clearing image and draw information on it -

hi want draw information on image in c#. wrote code , works: bitmap bmp = new bitmap(@"g:\cert_template.png"); graphics g = graphics.fromimage(bmp); g.drawstring(cert_id, new font("b zar", 3,system.drawing.fontstyle.bold), brushes.black, new point(85, 95)); g.drawstring(date_cert, new font("b zar", 3, system.drawing.fontstyle.bold), brushes.black, new point(85, 135)); g.drawstring(s1 + s3, new font("b zar", 4, system.drawing.fontstyle.bold), brushes.black, new point(90, 290)); g.drawstring(s4, new font("b zar", 3, system.drawing.fontstyle.bold), brushes.black, new point(480, 360)); g.drawstring(date_exam, new font("b zar", 3, system.drawing.fontstyle.bold), brushes.black, new point(170, 515)); g.drawstring(convert.tostring(mark), new font("b zar", 3, system.drawing.fontstyle.bold), brushes.black, new point(520, 600)); g.drawstring(lvl, new font("b zar", 3, system.drawing.fontstyle.bold), brushe...

user interface - Python, PySide sleep without stalling the whole program? -

i have piece of code: self.connect(self.yes_button,signal('clicked()'),self.yes_pressed) self.connect(self.no_button,signal('clicked()'),self.no_pressed) def yes_pressed(self): self.box.append("hello") time.sleep(2) self.box.append("text2") what when yes button pressed waits 2 seconds first appends both hello , text2(box qtextbrowser() object)how make appending one, wait 2 seconds , append other 1 instead? there simple solution this? you can this, using pyqt's qtimer . more singleshot setup : qtimer.singleshot (int msec, qobject receiver, slot()slot() member) qtcore.qtimer.singleshot(1000, lambda: self.box.append("text2")) #1000 milliseconds = 1 second or can event try implementation: self.timerscreen = qtimer() self.timerscreen.setinterval(1000) #1000 milliseconds = 1 second self.timerscreen.setsingleshot(true) self.timerscreen.timeout.connect(self.box.append("text2"))...

perl - Compare size of change rather than number -

i need compare values list represent log magnitudes of change: '1.3118 2.07985', '1.18887 0.990066', '2.63964 2.31757', '0.828566 1.03155', '-0.895715 -0.993696', '1.24353 1.35931', '1.2916 1.03409', '-0.747429 -1.18246', '1.30936 1.20244', '1.40537 1.27763', '-1.07762 -0.978337', '0.755268 0.837232', '0.919512 1.09517', for each row, want make comparison , store value greatest magnitude of change. example have (thanks on question regex value comparison ) comparison: if ($condition1_match > $condition2_match) { push @largest_change, $condition1_match; } would rightly value -0.895715 smaller -0.993696 . want write comparison recognises -0.993696 higher fold change -0.895715 you use absolute values: if (abs $condition1_match > abs $condition2_match) { push...

fixupKeys() function in breeze.debug.js -

function fixupkeys(em, keymappings) { keymappings.foreach(function (km) { var group = em._entitygroupmap[km.entitytypename]; group._fixupkey(km.tempvalue, km.realvalue); }); } for 1 of entities, seeing group return undefined, , throws error group._fixupkey(). it looks me km.entitytypename stores short name of entity, em._entitygroupmap stores concatenated name of entity it's namespace. anyone know if breezejs bug? or doing wrong in model responsible mismatched key? it issue implementation of custom breeze dataservice adapter. looking @ me.

python - Plot array content in grid -

now have 24*20 array below: in [748]: zb_mean out[748]: array([[ nan, 20.68575654, 14.11937546, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, ... ... ... ... ... ... in [749]: zb_mean.shape out[749]: (24, 20) then creat grid according lat/lon below: xi = np.arange(-66,-72,-0.25) yi = np.arange(40.5,45.5,0.25) in [755]: len(xi),len(yi) out[755]: (24, 20) xxb,yyb = np.meshgrid(xi, yi) now grid , array have same dimension,i want plot grid(xxb,yyb) correspond value of array(zb_mean) in center of each small grid, how should do?thank much! if u...

c# - Disabling other tabs when clicked on a button -

i disable tab selection when clicking on button. using following code: foreach (tabpage page in scenarioselectiontab.tabpages) { if (scenarioselectiontab.selectedtab != page) page.enabled = false; } the problem is, when use code above, disables current tab well. how can prevent it? try variant: foreach (tabpage page in scenarioselectiontab.tabpages) { ((control)page).enabled = scenarioselectiontab.selectedtab == page; } tabpage class don't have working enabled property. read msdn. if don't work, try variant selected event: private void tabcontrol1_selecting(object sender, tabcontrolcanceleventargs e) { if (e.tabpage != scenarioselectiontab.selectedtab) e.cancel = true; }