Posts

Stata: Capture p-value from ranksum test -

when run return list, all after running ranksum test, count , z-score available, not p-value. there way of picking up? clear input eventtime prefflag winner stakechange 1 1 1 10 1 2 1 5 2 1 0 50 2 2 0 31 2 1 1 51 2 2 1 20 1 1 0 10 2 2 1 10 2 1 0 5 3 2 0 8 4 2 0 8 5 2 0 8 5 2 1 8 3 1 1 8 4 1 1 8 5 1 1 8 5 1 1 8 end bysort eventtime winner: tabstat stakechange, stat(mean median n) columns(statistics) ranksum stakechange if inlist(eventtime, 1, 2) & inlist(winner, 0, .), (eventtime) return list, try computing after ranksum : scalar pval = 2 * normprob(-abs(r(z))) display pval the answer @nickcox: http://www.stata.com/statalist/archive/2004-12/msg00622.html the statalist archive valuable resource.

javascript - use brain.js ( neural network in js ) to learn contrast of background image of element -

i'm interested in using brain.js: https://github.com/harthur/brain there provided demo shows how train neural network recognise colour contrast, how can set can learn, input, colour text ( white or black ) looks better on different background images? here demo: http://harthur.github.io/brain/ i have set of background images want train against. , want save training data , able add site uses background images , way able determine colour text use on top of them. it appears though simple this: net.train([{input: { r: 0.03, g: 0.7, b: 0.5 }, output: { black: 1 }}, {input: { r: 0.16, g: 0.09, b: 0.2 }, output: { white: 1 }}, {input: { r: 0.5, g: 0.5, b: 1.0 }, output: { white: 1 }}]); so, input, change values like: var input = {}; input.r = hextorgb($('#rgbtextfield').r; input.g = hextorgb($('#rgbtextfield').g; input.b = hextorgb($('#rgbtextfield').b; var output = {}; output.black = 1; // finally... net.train([ inpu...

javascript - Keeping shape and animation of ball consistance over period of time -

i new two.js . trying basic experiments rubber ball example reposition ball on every second per random input instead of mouse movement. so, have written below code, removing rubber ball effect after iteration. don't know going wrong. second problem, after iteration, rubber ball changing shape circle oval kind of shape. jsfiddle: http://jsfiddle.net/2v93n/ tried many times, not working live jsfiddle. <body> <script> var 2 = new two({ fullscreen: true, autostart: true }).appendto(document.body); two.resoultion = 32; var delta = new two.vector(); var mouse = new two.vector(); var drag = 0.1; var radius = 25; var shadow = two.makecircle(two.width / 2, two.height / 2, radius); var ball = two.makecircle(two.width / 2, two.height / 2, radius); ball.nostroke().fill = 'green';shadow.nostroke().fill = 'rgba(0, 0, 0, 0.2)'; shadow.scale = 0.85; function moverub...

ruby - Upload file to HDFS in chunks -

i use gem 'webhdfs' upload file in chunks hdfs. see in documentation there create method i'm not sure how use , upload large file in chunks. has tried this? i don't think have chunk yourself. can pass file handle , let library stream it. file_io_handle = file.open('/tmp/foo.bin', 'rb') # straight documentation: client.create('/path/to/file', file_io_handle, :overwrite => false, :permission => 0666)

html - DIV expanding over the DIV below -

i hit sth appears bug or @ least weird feature of css/html. now, problem got 3 divs in row, inside parent div. the first , second 1 supposed text containers in chat-like matter. last 1 supposed excluded , paging navigation. on first page, works fine. on every other page, the last text container div expands on navigation . when using chrome developer tools, shows me second div having real size, while background still expands on navigation. if delete navigation, second text container resizes real size. also, when using position:absolute; it doesn't expand. setting position relative explicitly didn't fix problem , setting background-color sth else didn't change white background. i made quick demonstration under jsfiddle.net . so final question is : why second text div expand? or doesn't looks does? //edit: suggested in comments, here raw css/html outside jsfiddle. still don't think that's idea, if so.. <div class="decoded_chat" pagen...

excel - Write to text file in VBA -

i trying print file after opening file create vba. part stuck @ writing file. here have far. sub test() dim myfile string dim testfile string dim intchoice integer dim fs, f myfile = application.getsaveasfilename & "kml" open myfile output #1 application.filedialog(msofiledialogopen).allowmultiselect = false intchoice = application.filedialog(msofiledialogopen).show if intchoice <> 0 testfile = application.filedialog( _ msofiledialogopen).selecteditems(1) end if set fs = createobject("scripting.filesystemobject") set f = fs.opentextfile(testfile) print #1, f close #1 end sub read textstream line-by-line , print needed. in loop. set fs = createobject("scripting.filesystemobject") set f = fs.opentextfile(testfile) while not f.atendofstream print #1, f.readline loop set f = nothing set fs = nothing or, may able omit loop , print #1, f.readall .

post - Autofilling form field using URL -

i have been trying past 4 hours , cannot succeed. i have been trying autofill account pin # in http://bluffmycall.com/ but not taking it, have tried using http://bluffmycall.com/?pin=1111 http://bluffmycall.com/login/?has_errors=invalid&next=/account/&pin=1111 i tried wget http://bluffmycall.com --post-data="pin=1111" wget http://bluffmycall.com/login/?has_errors=invalid&next=/account/ --post-data="pin=1111" wget http://bluffmycall.com/login/?has_errors=invalid&next=/account/ --post-data="id_pin=1111" it of no use, tried curl. i need way have url can prepopulate field account pin #. appreciated thanks. you have send pin action url of form: wget http://bluffmycall.com/login/bypass/ --post-data="pin=1111" by won't anything. logging in creates session, , need cookie identifies session. subsequent wget calls need send session cookie.