Posts

Azure Stream Analytics query language get value by key from array of key value pairs -

i trying extract specific value array property in stream analytics query language. my data looks follows: "context": { "custom": { "dimensions": [{ "macaddress": "ma" }, { "ipaddress": "ipaddr" }] } } i trying obtain result has "macaddress", "ipaddress" column titles , "ma", "ipaddr" rows. i achieving this query: select getrecordpropertyvalue(getarrayelement(mysource.context.custom.dimensions, 0), 'macaddress') macaddress, getrecordpropertyvalue(getarrayelement(mysource.context.custom.dimensions, 1), 'ipaddress') ipaddress, i trying use cross apply far no luck. below cross apply query: select flat.arrayvalue.macaddress macaddress, flat.arrayvalue.ipaddress ipaddress [ffapi-track-events] mysource cross apply getarrayelements(mysource.context.custom.dimensions) ...

Autohotkey controlsend in hidden cmd -

i have script looks this: detecthiddenwindows, on run,%comspec% /k, , hide, pid2 winwait, ahk_pid %pid2% controlsend, ,winscp.com script="path\to\script.txt", ahk_pid %pid2% sleep,3000 ;-- close hidden dos window -- process, close, %pid2% process, waitclose, %pid2% but problem controlsend works , send right letters , change double columns single 1 , change winscp.com winscp>com , etc dont know these letters come idea how fix issue , make send right letters cuz frustrate me , makes whole script mess up. thanks lot max detecthiddenwindows, on run, winscp.com script="path\to\script.txt", , hide, pid2 sleep 6000 process, close, %pid2% process, waitclose, %pid2% that best way me ensure upload done , ready continue script. note: use runwait /c command (which substitute sleep command) summarize whole script provided above afraid still gives same issue mentioned above prefered directly using run , process close , waitclose commands. m...

graphviz - How to access nodes edges of dot format graph (Generalised ) in haskell -

i want access nodes, edges , properties of 'xdotgraph' (g.dotgraph) , set again. here haskell code prints dot format graph using graphviz: $ cat example.dot digraph { [type1="", type2=""]; b [type1="", type2=""]; -> b [label=""]; } import data.graphviz import data.text.io t import qualified data.text.lazy b import qualified data.text.lazy.io l import qualified data.graphviz.types.generalised g import data.graphviz.printing xdottext <- l.readfile "example.xdot" let xdotgraph = parsedotgraph xdottext :: g.dotgraph string t.putstrln $ renderdot $ todot xdotgraph this works me (mostly identical code there few changes): #!/usr/bin/env stack {- stack runghc --resolver lts-6.0 --package graphviz -} import data.graphviz import data.text.io t import qualified data.text.lazy b import qualified data.text.lazy.io l import qualified data.graphviz.types.generalised g import data.graphviz.pr...

node.js - Async to sync in nodejs -

i using library getmac mac address of server on nodejs running. api mac address async want use sync call. possible without using libraries sync, deasync etc? //async api require('getmac').getmac(function(err,macaddress){ if (err) throw err console.log(macaddress) }) you can use package var done = false; require('getmac').getmac(function(err,macaddress) { if (err) throw err console.log(macaddress) done = true; }); require('deasync').loopwhile(function(){return !done;});

list - Scala: type mismatch found in mapping -

error: type mismatch; found : list[list[(char, int)]] required: list[(char, int)] @ q<- x a2 reduceleft ((x,y)=> for{ q<- x b<- y } yield (q::b::nil) ) where, a2 : list[list[(char, int)]]. if a2 list[list[(char, int)]] , x list[(char, int)] , q (char, int) , , b, how found list[list[(char, int)]] ? the problem yield returns list[(char, int)] loop returns list[list[(char, int)]] . therefore, reduceleft complains since expects return type list[(char, int)] .

excel - Format to percent with 10 or a lot of decimals in vba -

Image
i've got tricky problem , don't understand happening , why. i have userform lot of percentage values. these values come excel sheet, this. user can change these values , put them in excel sheet. user's activity gets saved in log sheet. values saved there well. put values there this: private sub savev_click() dim wslog worksheet dim long dim j long dim lastrow long dim tbnr string j = 3 = 2 set wslog = thisworkbook.worksheets("log") wslog lastrow = findlastrow(wslog) lastcolumn = findlastcolumn(wslog) each tb in me.controls if typename(tb) = "textbox" select case 'case 2 , 3 values fixed , not of interest case 2 .cells(lastrow + 1, 1).value = tb.value case 3 .cells(lastrow + 1, 2).value = tb.value 'the following cases refer...

Why do we use .format, vs '%.2f' % order.get_cost() in django paypal -

just want ask quick question clarify things me, learning django paypal following tut , came accross following when creating payment processing view when creating paypal_dict: 'amount':'%.2f' % order.get_total_cost().quantize( decimal('.01')), 'item_name':'order {}'.format(order.id), my question is, why can't following: 'amount':'{}.2f'.format(order.get_total_cost().quantize( decimal('.01')) or 'item_name':'order %' % str(order.id) thanks! you can use either % or format depending on prefer. in single codebase, recommend picking 1 style , sticking consistency.