Posts

PowerShell for-each loop output to file -

how output/append contents of foreach loop text file? the following below not working out. $groups = get-adgroup -properties * -filter * | {$_.name -like "www*"} foreach($g in $groups) { write-host " " write-host $g.name write-host "----------" get-adgroupmember -identity $g | select-object -property samaccountname out-file -filepath c:\test.txt -append } $output = foreach($g in $groups) { write-output " " write-output $g.name write-output "----------" get-adgroupmember -identity $g | select-object -property samaccountname } $output | out-file "c:\your\file.txt" all saves output of foreach loop variable $output , , dumps data file upon completion. note: write-host write host stream, , not output stream. changing write-output dump $output variable, , subsequently file upon loop completion. the reason original code isn't working y...

Spring Batch Job Execution does not show in Executions Tab -

i have spring batch job setup using javaconfig (entirely through java code) deploy on module in spring xd. typically, when launch job, should see in spring xd's admin-ui under executions tab. not mine, however, , have no clue why. i've spent hours scouring through documentation , looking answer, can't find anything. am missing something? there need put in job make work? cause spring xd not display job's execution under executions? if need me provide logs or something, let me know, although not seeing error in spring xd console output. edit: how job defined int code: return jobbuilderfactory.get("job") .incrementer(new runidincrementer()) .start(setupstep) .next(verifystep) ... .next(zipfilesstep) .next(teardownstep) .build(); does happen @ admin ui? can see job executions when run xd shell command job execution list ? if sure batch job gets executed n...

javascript - HTML Injection Windows RT WebView -

i'am trying insert values html document on windows universal app, html document located on webserver , i'am trying insert username , password saved on client device winphone or pc store app, know id , every thing elemts, cant figure out how insert string input value, can provied sample invokescript("smth", new string[] {smthelse}); or has better idea insert username , password html content of webview? i'am stuck here , realy need feature. thanks in advance add code below xaml , give go. if know id, can set value doing script injection page. private async void button_click(object sender, routedeventargs e) { string functionstring = string.format("document.getelementbyid('namediv').innertext = 'hello, {0}';", nametextbox.text); await webview1.invokescriptasync("eval", new string[] { functionstring }); } don't naughty. healy in tampa.

R: Posix (Unix) Time Crazy Conversion -

unix time 1435617000. as.date(1435617000,origin="01-01-1970") [1] "3930586-11-23" which wrong. i'm trying (a) correct date, which, per epoch converter gmt: mon, 29 jun 2015 22:30:00 gmt . how r tell me month, day, year, hour, minute & second? thank you. i think reason why happen because as.date converts arguments class date objects. in case not need date class posixct object because input, x vector, contains other informations as.date not able manage. problem right function appear, if when not specify right time zone tz argument (except case time zone same original time). the following code job. x <- 1435617000 as.posixct(x, origin = "1970-01-01", tz ="gmt") [1] "2015-06-29 22:30:00 gmt" use as.date just in case wanted date have complete unix time x , have divide 86400 (which number of seconds in day!) right date. as.date(x/86400l, origin = "1970-01-01") [1] "2015-06-29...

How to create equal-width columns in Python 2.7 with Tkinter -

how can force columns in tkinter application window of equal width? the tkdocs website states follows: the width of each column (or height of each row) depends on width or height of widgets contained within column or row. means when sketching out user interface, , dividing rows , columns, don't need worry each column or row being equal width [or height, presumably]. http://www.tkdocs.com/tutorial/grid.html but want columns equal width, preferably making width of all columns depend upon widest widget in any column. there way of achieving cleanly (i.e. not playing around cell padding until them same trial , error or arbitrarily assigning apparently adequate minimum width every column)? also, can selectively done some, not columns in grid (e.g. columns x and y are sized according widest widget in column x or y, column z sized according widest widget in column z)? to make gridded layout have columns have same width, you've got configure columns have same w...

Sql Server Aggregation or Pivot Table Query -

i'm trying write query tell me number of customers had number of transactions each week. don't know start query, i'd assume involves aggregate or pivot function. i'm working in sqlserver management studio. currently data looks first column customer id , each subsequent column week : |customer| 1 | 2| 3 |4 | ---------------------- |001 |1 | 0| 2 |2 | |002 |0 | 2| 1 |0 | |003 |0 | 4| 1 |1 | |004 |1 | 0| 0 |1 | i'd see return following: |visits |1 | 2| 3 |4 | ---------------------- |0 |2 | 2| 1 |0 | |1 |2 | 0| 2 |2 | |2 |0 | 1| 1 |1 | |4 |0 | 1| 0 |0 | what want count of customer transactions per week. e.g. during 1st week 2 customers (i.e. 002 , 003 ) had 0 transactions, 2 customers (i.e. 001 , 004 ) had 1 transaction, whereas 0 customers had more 1 transaction the query below result want, note has column names hard coded. it's easy add more week columns, if number of columns unknown might want solution ...

java - POI Named Cell - Drop down in all the rows does not have all the values -

i have strange issue when create excel drop downs using apache poi - named cell using below method. public static void createhugedropdown(xssfworkbook wb) { int = 0; string sheetname = "lookup"; string colname = "col1"; string mainsheet = "sheet1"; string[] strarray = new string[]{"10", "20", "30"}; xssfsheet sheet = wb.createsheet(sheetname); (string str : strarray) { sheet.createrow(i++).createcell(0).setcellvalue(str); } xssfname namedcell = wb.createname(); namedcell.setnamename(colname); string reference = sheetname + "!a1:a" + i; system.out.println(reference); namedcell.setreferstoformula(reference); xssfsheet sheet1 = wb.getsheet(mainsheet); int namedcellindex = wb.getnameindex(colname); namedcell = wb.getnameat(namedcellindex); areareference aref = new are...