Posts

SQL Server: Where & Like Statements -

i'm rusty sql game. have code (see below) checks on database instance (instance001, instance002, etc), looks when last_read , last_write fields null, along when last reset. nothing on top. the issue i'm having how execute across multiple instances. you'll see commented out section. if add in appropriate or statement ( or inst_name 'instance002' ), isn't getting results seeking. example: instance001 yields 1 records. instance002 yields 60. if use where inst_name 'instance001' or inst_name 'instance002' 210 records. how manipulate sql provide 61? declare @timestring nvarchar(50) = convert(varchar(24), getdate(), 120) select db_name, inst_name, min([last_srvr_rst]) min_srvr_rst, last_read, last_write, log_date=@timestring cms_db_last_read_write -- targeted db data. inst_name -- targeted instance(s) 'instance001' /* 'instance002' 'instance003' 'instance004' */ ...

c# - How to Reset USB Port Programatically -

we have systems connect through devices connected pcs through usb. in cases there adapter in between rs-232 usb conversion. possible tell device manager remove port , add in? drivers various devices (which in cases more 1 such device through usb serial adapter) reset. seems removing port , adding in ensure drivers reconnect. important third party drivers can "stuck" , due threading not possible use anymore. means require physical removal of connection, or full system reset. so hoping knows if there simple way connect device manager find ports remove them , reconnect them. this: public class devicemanagerwrapper { public void resetallports() { using(var devicemanager = new system....devicemanager() { foreach(var port in devicemanager.getports()) { port.disconnect(); port.reconnect(); } } } } obviously doesn't work. hoping point me in right direction.

javascript - ng-repeat through object with value as an array angular -

i have object key value pairs looks this. see key has array value. $scope.testobj = { "london":[ {"id":1,"city":"london","country":"gb","name":"test1"}, {"id":4,"city":"london","country":"gb","name":"test2"} ], "los angeles":[ {"id":8,"city":"la","country":"us","name":"test3"} ] } i want display name next city in front end using angular. have tried many approaches, , used track $index, cannot figure out how working. <div ng-repeat="(key, val) in jobsbycity track $index"> {{key}}:{{val[$index].name}} </div> i have looked @ approach too, nesting ng-repeat <div ng-repeat="(key, val) in testcity"> {{key}} <div ng-repeat="test in val[$index].name"...

sql - Single-row subquery returns more than one row - Real solution -

i'll fast. problem: subquery returning more 1 row (and ok, because should returns more one, or one), , trigger ora error 1427, closing query results. question: how can show registers of subquery? notes all searches on internet says can limit 1, not want. d table matrix, give field4 specific value, returns field me. , in same query, have value field4, , returns type , business result on field. select (select b.value table_b b b.field1 = a.field1 , b.fiel2 = a.field2 , b.field3 = a.field3 , b.category= 'adress') result_field, (select b.value table_b b b.field1 = a.field1 , b.fiel2 = a.field2 , b.field3 = a.field3 , b.category= 'gender') result_field2 table_a a; tables example: table id name age 1 lapras 6 2 lincon 45 table b id a_id ...

excel - Keep leading zeros in specific column when running batch file that splits csv files into multiple files -

i have csv file on number of rows allowed in excel. i'm running batch file (listed) below split multiple csv files. code works , splits multiple files. however, there 2 fields (2 , 3rd) in file have leading zeros keep. is there way can set 2 specific fields imported text keep leading zeros? @echo off setlocal enabledelayedexpansion set bfn=test.csv set lpf=1048576 set sfn=test_split rem not change beyond line. set sfx=%bfn:~-3% set /a linenum=0 set /a filenum=1 /f "delims=" %%l in (%bfn%) ( set /a linenum+=1 echo %%l >> %sfn%!filenum!.%sfx% if !linenum! equ !lpf! ( set /a linenum=0 set /a filenum+=1 ) ) endlocal pause

javascript - Converting multiple configuration routes in react-router's plain objects -

i'm trying achieve following router structure in plain route objects. const demo = () => ( <router history={hashhistory}> <route path="/" component={app}> <route path="fade" component={fadedemo}> <indexroute component={lorem} /> <route path="demo-1" component={lorem} /> <route path="demo-2" component={lorem} /> <route path="demo-3" component={lorem} /> </route> my app router looks this: export const createroutes = (store) => ({ path: '/', component: corelayout, indexroute: home, childroutes: [ counterroute(store) ] }) so want add fadedemo transition container former jsx route without path on latter example. possible? edit: that's updated route index file, can't match '/counter' location: import corelayout '../layouts/corelayout/corelayout' import home './home' ...

c - 'GtkToggleButton {aka struct _GtkTogglebutton}' has no member 'active' -

i trying compile , run example of gtk+3 , unfortunately, example gtk+2 manual, can't find useful on gtk+3 , can't download gtk+2 . on example there couple of function this: void entry_toggle_editable( gtkwidget *checkbutton, gtkwidget *entry ) { gtk_editable_set_editable(gtk_editable(entry),gtk_toggle_button(checkbutton)->active); } when compiling got error: 'gtktogglebutton {aka struct _gtktogglebutton}' has no member named 'active' i looked in manuals. able find in order around problem, understand release compatibility problem, gtk+3 manuals useless approaching first time gtk. one of biggest changes between gtk+ 2 , gtk+ 3 gtk+ 3 gets rid of public structure fields, replacing them gobject properties. instead of saying gtk_toggle_button(checkbutton)->active you say gboolean active; g_object_get(checkbutton, "active", &active, null); (the null because g_object_get() can multiple properties same object @ sa...