Posts

Showing posts from March, 2014

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.

wpf - Why is this Binding not working in XAML? -

i'm using xaml simulate watermark text on textbox, binding text property not working: <textbox x:name="txtsearch" borderthickness="0"> <ap:cuebannerservice.cuebanner> <textblock foreground="black" opacity=".7" text="{binding path=watermarktext}"/> </ap:cuebannerservice.cuebanner> </textbox> on other hand, of follow code works: <textblock foreground="black" opacity=".7" text="watermark test"/> <textbox opacity=".7" text="{binding path=watermarktext}"/> why not working? thank you! update this works fine (without textblock): <textbox x:name="txtsearch" borderthickness="0" ap:cuebannerservice.cuebanner="{binding path=watermarktext}"> update 2 this works!: <textbox x:name="txtsearch" borderthickness="0"> <ap:cuebannerservice.cuebanner> <tex...

php - How can I sort an array from 2 fields? -

i have following format of array [hometeam] => brazil [awayteam] => croatia how can sort array based on home , away teams. so brazil come first if home or away team. do need array_multisort? i've given try, not getting right results. any appreciated. cheers use usort : usort($myarray, function($a, $b) { return $a > $b; }); you need modify return condition depending on how want sorted.

xml - XSL transformation from EAD to MARC skips over 2nd subject term -

i have strange problem. have xml documents encoded in ead i'm transforming marc records library catalog. there section of ead document looks this: <controlaccess> <list type="simple"> <item><subject encodinganalog="650" source="lcsh">prisons -- history -- 19th century</subject></item> <item><subject encodinganalog="650" source="lcsh">prisons -- statistics -- history -- 19th century</subject></item> <item><subject encodinganalog="650" source="lcsh">prisons -- statistics -- term 1 -- history -- 19th century</subject></item> <item><subject encodinganalog="650" source="lcsh">prisons -- statistics -- term 1 -- term 2 -- history -- 19th century</subject></item> </list> </controlaccess> what code correct...

scheme - How do you increment with biwascheme? -

has used online ide replit? http://repl.it/languages/scheme how increment it? i'm trying encapsulate function sum things based on sicp video 2a. (define (square ) (* a)) (define (sum term next b) (if (> b) 0 (+ (term a) (sum term (next ) next b)))) (define (sum-int b) (define (identity a) a) (sum identity (+ 1 a) b)) (define (sum-square b) (sum square (+1 ) b)) (sum-square 1 2) alternate sum-square (not working) (define (sum-square b) (sum square (+ 1 a) b)) (sum-square 1 2) // getting 2 not function. working code: (define (sum-int b) (define (identity a) a) (sum identity (lambda(a)(+ 1 a)) b)) you have pass function next parameter, this: (define (identity n) n) (define (sum-int b) (sum identity add1 b)) (define (sum-square b) (sum square add1 b)) in case add1 isn't defined, can write own version: (define (add1 n) (+ 1 n)) alternatively, can directl...

c++ - Indexing file names and its content -

i write program index file names , content in given directory. if match given regular expression, index them. use regex functions. i don't know how start this. i use polymorphic approach: a class base (virtual), basic information (name, parent directory...). a class file, child of base, represent file. a class folder/directoy represent directory. i thinking using map build trees. may tell me opinion please? for filesystem functionality, use boost.filesystem . for regular expressions, use <regex> c++11, boost.regex otherwise. any initial(!) trouble might have when installing , learning boost pay off. for map, use std::map . in case, not reinvent wheel.

sql - Mysql query for selecting friends -

Image
i trying solve "issue", still without success. i'd achieve is, create query select friends of specific actor. let's want list of first name, last name , age of jason statham's friends. below image of tables. ps: tables correctly organized ? (especially foreign keys) in advance does you're looking for? select actors.first_name, actors.last_name actors actors.login in ( select friendslist.loginf friendslist friendslist.logina = 'xstad' )

amazon web services - AWS new generation (m3.x) Intstance configuration not suppported -

i using java sdk create ec2 instances. till using m1.medium, m1.large, m1.xlarge configuration create ec2 instance , creating ec2 instance. when changed instance type new generation (m3.medium, m3.large, m3.xlarge), getting below error. message : instance configuration aws marketplace product not supported. please see http://aws.amazon.com/marketplace/pp?sku=5hoheke3dcdw953i7sq087tpb more information supported instance types, regions, , operating systems. note: getting error in aws west 2 (ie oregon) region. able create m3.x instances in other region successfully so ami ubuntu 12.04 image don't believe supported on new generation instances. we've run similar issue, we've had move ubuntu 14.04 support pv virtualization. based on article not appear 1 ami image can run on instance types: https://groups.google.com/forum/#!topic/ec2ubuntu/xdyrnpnxyao i believe ubuntu 12.04 lts image run on new generation instance types: https://aws.amazon.com/marketplac...

html - CSS checkbox:checked not working -

i trying checkboxes change color of text within tabel, doesn't seem working. :checked attribute doesn't seem working. text in . code follows: <html> <head> <style type="text/css"> .methodoption { } #row1 { color: blue; } #buyer1 + #row1 { color: blue; } #buyer1 input[type=checkbox]:checked ~ #row1 { color: red; } </style> </head> <body> <div align="justify" style="font-size: 23px;"> social compliance has changed lot on past few years. several high-profile industry disasters in key sourcing countries bangladesh, along heightened awareness among consumers clothes come from, has prompted stakeholders across supply chain, production facilities brands , buyers, rethink approach compliance , supply chain security. part of our commitment being responsive , effective social compliance monitoring partner, @ wrap wanted idea of of these changes , how can adapt our...

ios - When close view that started locations service notification error occure -

i have created small app use project it's core: https://github.com/dsdavids/ttlocationhandler , worked fine until have moved stating location services view in app. what app doing: when started can tap on start button , ( in emulator locations must enabled ) on map route of movement displayed move. problem came when moved starting action in second view. in second view want start location service , close it. problem when start locating on second view error (application crash exc_bad ) here: ttlocationhandler ... dispatch_async(dispatch_get_main_queue(), ^{ if (output_logs) nslog(@"sending notification out"); nsnotification *anotification = [nsnotification notificationwithname:locationhandlerdidupdatelocation object:[locationtosave copy]]; [[nsnotificationcenter defaultcenter] postnotification:anotification]; }); ... i think because close second view (view started service) , ttlocationhandler still tries send something. better und...

export - emacs org mode : How to select a page style when exporting to odt? -

i exporting org document odt using org-odt-export-to-odt (org-mode version 8.2.6 , emacs 23) , first page orgfirstpage style , following pages orgpage style. i tried using custom style file created exporting empty org file odt , modifying libreoffice first page has orgfirstpage style , second 1 has orgpage style. referenced in org file #+odt_styles_file: pages in exported document have standard style. i'm sure exported odt file uses custom style file because added header standard page style , see in exported odt file. is there way set page style in org file?

ember.js - Ember local live list -

i try simple application using ember. index controller: app.indexcontroller = ember.objectcontroller.extend({ schools: [{name:"old school"}], actions:{ add: function(){ var schools = this.get("schools"); schools.push({name: 'new school'}); this.set("schools",schools); } } }); index template: <script type="text/x-handlebars" data-template-name="index"> <button type="button" {{action "add"}}>add school</button> <ul> {{#each school in schools}} <li>{{school.name}}</li> {{/each}} </ul> </script> when lunch application on start see: old school and when hit add button nothing happens, why? you need use pushobject in order ember know value has been added list. , there no need set afterward. add: function(){ var schools = this.get("schools"); schools....

osx - System command from Matlab shell (Mac OS) -

i need invoke gmt command form matlab script. in standard mac os shell have paths configured , gmt works fine. when start matlab result follows: >> !gmt /bin/bash: gmt: command not found when add paths: >> setenv('path', [getenv('path') ':' '/applications/gmt-5.1.1.app/contents/resources/lib/']); problem changes to: >> !gmt dyld: library not loaded: @executable_path/../lib/libnetcdf.7.dylib referenced from: /applications/gmt-5.1.1.app/contents/resources/bin/gmt reason: incompatible library version: gmt requires version 10.0.0 or later, libnetcdf.7.dylib provides version 9.0.0 gmt: trace/breakpoint trap i have no idea go here. on windows works great, prefer working on mac. ok, solved: setenv('dyld_library_path', '/usr/local/bin/');

php - URL generated in Wamp is missing the local host prefix -

when pressing site link wamp localhost dashboard, site not include localhost prefix, therefore not working. per example. pressing:my site results in address: mysite , have manualy put localhost prefix in order site load: localhost/mysite how can fix this? appreciate help. jonathan you don't have create virtual host if u don't need. following open www/wamp/index.php then change line $suppress_localhost = true; to $suppress_localhost = false; this works me

ios - Math behind common geometry shape drawing -

while reading core graphics guide on apple dev library web site. encountered code snippet looks following cgcontextref context = uigraphicsgetcurrentcontext(); cgfloat size = 20; double r = 0.8 * size / 2; double theta = 2 * m_pi * (2.0 / 5.0); cgcontexttranslatectm(context, size / 2, size / 2); cgcontextmovetopoint(context, 0, r); for(int = 0; < 5; i++){ cgcontextaddlinetopoint(context, r * sin(i * theta), r * cos(i * theta)); } cgcontextclosepath(context); the above code draw perfect star. question is, know average geometry , trigonometry, know such geometry drawing way? experience , reading lot, or there specific topic 1 should study? as rex says, trivial application of trig/polar coordinates. if don't understand it, need go , study trig more. i should have @ minimum strong understanding of high school level geometry, algebra 2, , trigonometry (these days in seem cover trig in "precalculus"). if want 3d graphics should study matrix math. th...

scala - Extending new instance of a class -

hi trying understand code below scala. have class b, , has dependency class b. class c extends a. when extending class code below newing b. significant of doing this? in java can't this. class b {} class a( b:b ) {} class c extends a( new b) {} what b ? class b {} this empty class. in java, write same. what a ? class a(b: b) {} this class 1 field. constructor of class takes 1 argument. constructor sets field argument. in java, write follows: class { b b a(b b) { this.b = b } } what c ? class c extends a(new b) {} this subclass of sets field b new b . in java, write follows: class c extends { c() { super(new b()) } }

c++ - Containers in C++11 STL -

struct solution { double power_peak; valarray<int> assignment; }; list<solution> list; list.pop_back(); list<solutions *> list2; list2.pop_back(); function(list2); hello still don't understand how these containers work respect content. assume filled before. when call pop_back on first list. assume gets destroyed (including int's in valarray) when call pop_back on second list. content still live. when function call. list behave pointer array? pointer copied still point same content. is correct? would vector or valarray behave other in terms of copying? when pop_back() element list , or of sequence containers support pop_back() , always result in destruction of last element. difference in second case list contains pointers, , destructor of pointer nop. that's why content pointed pointer still lives on. this reason sticking raw pointers containers frowned upon. means you'll have manage memory manually, can error prone. usin...

vba - Excel: Conditional Formatting by Row Header and not Row Number -

i need highlight values between 1 , 30 across 150 tabs in specific row. row fluctuates between row 6, row 7, row 8 , row 9 between each tab, trying row header named total. possible? the op has posted in comments wants apply conditional formatting row 6 in of worksheets, , not various rows might contain word total. this, in excel 2007 apply desired conditional formatting row 6 on single sheet. select entire row select format painter navigate next sheet select of sheets wish cf row 6 select row 6 (click on 6 format painter) while cannot cf multiple sheets @ same time in excel 2007, can cf single sheet, , copy format multiple sheets simultaneously . edit: see have recorded macro produce conditional formatting , pasted 1 of comments. the next step modify find word total in 1 of rows 6:8, , apply formatting row. here modification of posted, should every sheet. cleaned code macro recorder produced. note macro assumes row header in first column (column a). cycles...

iOS In App Purchase Non Renewing Subscription Receipt Validation -

i trying understand if possible (or not), within app targeted @ ios7, check if non renewing subscription receipt has been cancelled apple? i thought there way check cancellation date in receipt, however, can't see how can re-request non renewing subscription receipt? any advice appreciated. for information, have found if receipt verified against appstore servers there field cancellation_date within formatted data receipt returned. so, if post receipt main bundle apple verify, returned data show cancellation date. if date present apple state treat transaction never having occurred. see here more details https://developer.apple.com/library/ios/releasenotes/general/validateappstorereceipt/chapters/receiptfields.html#//apple_ref/doc/uid/tp40010573-ch106-sw1

android - SetContentView without displaying the screen (yet)? -

is there way in android activity setcontentview() , can have android compute layout, , can views in via findviewbyid() , but not yet display it ? this in app main activity , subordinate activities , 1 want start not display 1 of subordinate activities. (in other words main view filling screen, sufficient keep new 1 hidden @ bottom of view hierarchy). activity started "standard" launch mode. if there's way keeping @ bottom of view hierarchy, how force top when want display it? note: app exists - it's large, complex industrial app 14 activities, written android 2.35 , 2.36, re-architecting use fragments instead of activities impractical. want modify 1 activity not display, or display @ bottom of view hierarchy it's not visible. this in app main activity , subordinate activities , 1 want start not display 1 of subordinate activities that not possible. or, more accurately, welcome start activity , not populate ui, still take on scree...

jquery - How to select a specific HTML page thruogh javascript -

does know how write function select specific page in javascript? reason why asking because have multiple projects use same base master pages , placeholders. need able change of projects individual pages (css & html) out changes of pages in particular project. my javascript code: function initpage() { $('div#rightcontent img').replacewith('<img src="newpicfile.jpg">'); } the problem code changes of divs id of rightcontent . need target 1 page in particular. can me? place in code - function initpage() { if("http://mydomain.com/page.html" == location.href) { $('div#rightcontent img').replacewith('<img src="newpicfile.jpg">'); } }

getting and setting dates with Java -

this question has answer here: how subtract x days date using java calendar? 8 answers how add 7 days current date while not going on available days of month? 7 answers first off thank taking time scroll through this. i greenhorn when comes java working on program asks user basic info sets start date , schedules service dates @ bi weekly intervals between march , october start date. for start date variable, set as: startdate = getdate(); to give current date when user signs up. i have been sifting through searches days cannot figure out how increment service dates 14 days save life. i tried using servicedate = startdate + (0, 14, 0); cant make sense of whats happening here. ideas? use common-lang library. has dateutils class can used this. use this: s...

linux - Perl script, how to source an environment variables from .bash_profile -

i need quick advice on perl script. created script calls other perl scripts , many other shell scripts within those. problem i'm facing, trying make run on universal level setting 1 environment variable. this on linux rhel/centos way... so add variables .bash_profile , works without issue if manually source file first, run perl script! is, ok, script automate part instead of needing extra, manual sourcing step. so script looks this... in short #!/usr/bin/perl use warnings; use strict; `/bin/bash ~/.bash_profile`; blah blah blah more code etc; when launching main script (where part of code is) works no problem. it's subsequent calls made other scripts failing...as if not passing variable on rest of scripts. any ideas?? thanks, the easiest way set environment variables within perl $env{"name"}=... . these variables propagated automatically programs started within perl script, no matter if perl or shell scripts alternatively open .bash_pro...

xpages - How to overcome the error "The unknown namespace tag xe:applicationLayout cannot be used as a control." -

i created sort of template db xpages applications. not true template, design can grab code start new xpages db. i copied on cc , got error: "the unknown namespace tag xe:applicationlayout cannot used control, namespace http://www.ibm.com/xsp/coreex not known." i tried creating new cc in target db , pasting source in, still got error. error mean , how can overcome it? i mean, come on, can't copy , past design elements 1 db another??? it means haven't enabled extlib in application's properties. if xsp properties (in 9.0+) or application properties (in ancient releases), can enable com.ibm.xsp.extlib.library library, assuming have installed.

python - Code to find number of route-combinations in a N by N grid -

Image
i have write code has count number of different combinations start upper left of n n grid, , end in lower right corner. can go down , right! so (if give each of vertices number 1 - (n+1)^2), how many different combinations there 1 - (n+1)^2. can add 1 or add n+1. an example: 2x2 grid: 1 -- 2 -- 3 | | | 4 -- 5 -- 6 | | | 7 -- 8 -- 9 and combinations be: [1-2-3-6-9] [1-2-5-6-9] [1-2-5-8-9] [1-4-5-6-9] [1-4-5-8-9] [1-4-7-8-9] now, how should write code? appreciated! in advance ah. see trying on 1 of eulerproject problems? point manage figure out , learn new things along way! tricking cheating. oh well anyways, consider grid of m rows , n columns (we not need assume grid square). counting upper-left , starting @ zero, denote intersection/node in i-th row , j-th column n_(i,j). thus, upper-left node n_(0,0), bottom-left n_(m,0) , bottom-right n_(m,n). clearly, number of paths n_(0,0) node along far right or far top of grid 1 (since may proceed down ...

highcharts - Large Y-axis tickInterval in high charts does not work -

i have chart @ jsfiddle demonstrate problem our charts not respecting y-axis tick interval large values: http://jsfiddle.net/z2cdu/1/ var plots = {"usbyteplots":[[1362009600000,143663192997],[1362096000000,110184848742],[1362182400000,97694974247],[1362268800000,90764690805],[1362355200000,112436517747],[1362441600000,113563368701],[1362528000000,139579327454],[1362614400000,118406594506],[1362700800000,125366899935],[1362787200000,134189435596],[1362873600000,132873135854],[1362960000000,121002328604],[1363046400000,123138222001],[1363132800000,115667785553],[1363219200000,103746172138],[1363305600000,108602633473],[1363392000000,89133998142],[1363478400000,92170701458],[1363564800000,86696922873],[1363651200000,80980159054],[1363737600000,97604615694],[1363824000000,108011666339],[1363910400000,124419138381],[1363996800000,121704988344],[1364083200000,124337959109],[1364169600000,137495512348],[1364256000000,136017103319],[1364342400000,60867510427]],"dsbyteplo...

JavaScript Rails code not working in application.js -

$(document).ready(function() { $('#client-select2').select2(); }); if place code above application.js, not respond if place in _form.html.erb file, does. know why is? views/orders/_form.html.erb <script type="text/javascript"> $(document).ready(function() { $('#client-select2').select2(); }); </script> <%= simple_form_for(@order) |f| %> <%= f.error_notification %> <%= f.input :code %> <%= f.association :client, collection: client.all, label_method: :name, value_method: :id, prompt: "choose client", required: true, input_html: { id: 'client-select2' } %> <%= f.submit %> <% end %> application.html.erb has <%= javascript_include_tag 'application' %> the reason select2 and/or jquery included after application.js, if instance, if order is: //=require_self //=require select2 //=require jquery the jquery/select2 functions no...

javascript - When are dynamic scripts executed? -

i doing google xss games ( https://xss-game.appspot.com/level2 ), couldn't quite figure out why level 2 wasn't working way expecting. though hint says script tags won't work, didn't know why. question when dynamic script tags executed , vary browser? i tried simple as: <script>alert();</script> and while adds element page, doesn't had hoped. i found post has same problem, solution answer, not explanation: dynamically added script not execute if site sanitizes script tags allows other html - opens xss. hint in level 2 text in message window having html formatting (italic, color etc.) assumption here - html tags allowed. so can enter like <i>hello xss</i> into message window display text in italic. dom element can have event handler attached - can include executable javascript event handler without script tags. try entering message window: <i onmouseover="alert(1)">hello xss</i> and after s...

cmake - Tried Normal Distributions Transform with my own files (in correct PCD format) and it throws errors, why? -

http://pointclouds.org/documentation/tutorials/normal_distributions_transform.php#normal-distributions-transform i've used program sample pcd's given , came out correctly. confirmed experienced users on here. i'm trying use own pcd's. didn't want bother changing program changed names room_scan1 , room_scan2. when attempt use them, error: loaded 307200 data points room_scan1.pcd loaded 307200 data points room_scan2.pcd filtered cloud contains 1186 data points room_scan2.pcd normal_distributions_transform: /build/buildd/pcl-1.7-1.7.1/kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp:172: int pcl::kdtreeflann::radiussearch(const pointt&, double, std::vector&, std::vector&, unsigned int) const [with pointt = pcl::pointxyz, dist = flann::l2_simple]: assertion `point_representation_->isvalid (point) && "invalid (nan, inf) point coordinates given radiussearch!"' failed. aborted (core dumped) this progra...

python - recursively traverse multidimensional dictionary and export to csv -

i've have complex multidimensional dictionary want export of the key value pairs csv file running log file. i've tried various exporting cvs functions , hacked away @ of code example in stackoverflow on traversing multidimensional dictionaries have failed arrive @ solution. problem unique in has key values want export. here dictionary: cpu_stats = {'time_stamp': {'hour': 22, 'month': 5, 'second': 43, 'year': 2014, 'day': 29, 'minute': 31}, 'cpus': [[{'metric_type': 'cpu_index', 'value': 1}, {'metric_type': 'cpu_temperature', 'value': 39}, {'metric_type': 'cpu_fan_speed', 'value': 12000}]]} i need format values in time_stamp yyyy-mm-dd hh:mm:ss , store first cell of row. need values in 'cpus' cpu_index, cpu_temperature, , cpu_fan_speed in same row time stamp. the csv file should this: time_stamp, cpu_index, cpu_temperature,...

javascript - Adding spaces in picture macro's -

this old stuff used work correctly, since have changed flashchat style server coding normal spaces not work. spaces collapse none. ideas great help. have tried think of , searched... on *:text:`bat:#:{ /msg $chan $chr(2) $+ $chr(3) $+ 2 /\ /\ /msg $chan $chr(2) $+ $chr(3) $+ 2 / \'._ (\_/) _.'/ \ /msg $chan $chr(2) $+ $chr(3) $+ 2 /_.''._'--('.')--'_.''._\ /msg $chan $chr(2) $+ $chr(3) $+ 2 \ \_/` ;= / " \ =; `\_/ / /msg $chan $chr(2) $+ $chr(3) $+ 2 \/`\__|` \___/ `|__/`\/ /msg $chan $chr(2) $+ $chr(3) $+ 2 \(/|\)/ /msg $chan $chr(2) $+ $chr(3) $+ 2 "`" } i have hundreds of these change spaces stay appreciate get..

c++ - How to dynamically resize a QImage used in a QLabel/QVBoxLayout/QWidget -

i have derived class (from qwidget) uses qvboxlayout 2 items, both of qlabel. top qlabel used display video stream , bottom qlabel use status line. 1 of examples in qt documentation. capturewin::capturewin() { qvboxlayout *vbox = new qvboxlayout(this); vbox->setcontentsmargins(qmargins(8, 8, 8, 5)); m_plabel = new qlabel(); m_pmessage = new qlabel("no frame"); vbox->addwidget(m_plabel); vbox->addwidget(m_pmessage); } void capturewin::setimage(const qimage &image, const qstring &status) { m_plabel->setpixmap(qpixmap::fromimage(image)); m_pmessage->settext(status); } this working fine, program captures video shared memory segment (generated different process) , video displayed in window. however, video image size can change, trying extend change different size videos dynamically. shared memory header gives information image sizes. can emit signals when ...

nginx - hhvm segmentation fault in PHP project -

please help. working on project >8000 lines of code in front controller architecture. try load page, hhvm crashes segmentation fault. i've listed sanitized stacktrace below sensitive items replaced ####. host: #### processid: 29669 threadid: 7fda7cbff700 threadpid: 29676 name: unknown program type: segmentation fault runtime: hhvm version: tags/hhvm-3.0.1-0-g97c0ac06000e060376fdac4a7970e954e77900d6 debuggercount: 0 server_server_name: #### server: #### threadtype: web request url: /#### # 0 hphp::bt_handler(int) @ crash-reporter.cpp:0 # 1 killpg @ /lib/x86_64-linux-gnu/libc.so.6:0 # 2 memcpy @ /usr/bin/hhvm:0 # 3 get_tty_password @ /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18:0 # 4 mysql_stmt_fetch @ /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18:0 # 5 hphp::mysqlstmt::fetch() @ /usr/bin/hhvm:0 # 6 hphp::c_mysqli_stmt_ni_fetch(hphp::object const&) @ ext_mysqli.cpp:0 # 7 hphp::native::callfunc(hphp::func const*, hphp::typedvalue*, hphp::typedvalue*, int, hph...

select - Polling objects for data in Java -

i have many packetconnection objects connected remote computers. each packetconnection has thread-safe ( synchronized ) read , write methods accept packets . other classes should not have access enclosed streams. i connections' owner notified when packetconnection has data read (it can block until event; spinning cpu in while-loop unwanted). owner ask appropriate object read , return packet . what idomatic way accomplish this? use java nio access "selector" functionality tell sockets have data can read. socketchannel represents selectable socket. call select() on selector determine if of sockets readable; can provide selection time-out if necessary.

css - Hide content from small and extra small screen size devises -

i need hide html contents screen when devices changing. mean trying create responsive design. in small screen sizes (below 768px) want hide contents. my contents - <div class="content-to-hide"> <div class="container"> <a class="banner-brand visible-sm visible-md visible-lg" href="index.html"> <img src="" alt="" width="280"> </a> <div class="utility-nav"> <ul> <li><a href="#" id="example" data-toggle="tooltip" data-placement="left" title=""><i class="icon fa fa-users fa-lg"></i><br /><span>xxxxxxxxxxxxxx</span></a></li> <li><a href="#" title="view cart"><i class="icon fa fa-unlock-alt fa-lg"></i><br />...

web - Setting locations.ini in WebPageTest private instance -

i trying setup private instance of webpagetest using r2.14. have stumbled on putting correct information in locations.ini. here have tried till now used locations.sample.ini sample data see how goes , shows me 'dallas' location ie instance. modified sample value per documentation written in file. unless add remote configuration particular location, not show in drop down list in browser. tried example provided @ https://sites.google.com/a/webpagetest.org/docs/private-instances/locations , http://andydavies.me/blog/2012/09/18/how-to-create-an-all-in-one-webpagetest-private-instance/ no locations show on drop down list in browser. can prior experience please point me doing wrong else please resource , work. i able make work. links provided in example correct , set locations.ini file correctly. however happens unless test agents configured , start polling server tests, list not populate them. not setting test agents instead stuck trying make server work. ...

opencv - Python Tesseract Error on Windows 8 machine -

i have installed python2.7, in c:\python27. added path in environment variables too. i have numpy & opencv working. basic image processing using it. working till date. i have work on ocr, , tried follow instructions on installing python-tesseract here , have installed 32-bit version. i opened python, , when import tesseract it imports without error or problem. but when run sample code, errors : code import cv2.cv cv import tesseract image=cv.loadimage("eurotext.jpg", cv.cv_load_image_grayscale) api = tesseract.tessbaseapi() api.init(".","eng",tesseract.oem_default) #api.setpagesegmode(tesseract.psm_single_word) api.setpagesegmode(tesseract.psm_auto) tesseract.setcvimage(image,api) text=api.getutf8text() conf=api.meantextconf() image=none print text print conf errors traceback (most recent call last): file "f:\python\test\test.py", line 2, in <module> imp...

ios - Sometimes cannot launch an application programmatically on jailbroken device -

nsinteger error = sbslaunchapplicationwithidentifier((cfstringref)bundleid, no); nslog(@"launching [%@] error: [%d]", bundlename, error); if (error) { cfstringref errorstr = sbsapplicationlaunchingerrorstring(error); dlog(@"launching %@ error string [%@]", bundlename, (nsstring *)errorstr); cfrelease(errorstr); } i use above code launch second application first application, can launch successfully. however, sometimes fails launch. see error on syslog launching [myfirstapp] error: [7] launching myfirstapp error string [application not found] how can launch application? note first application running daemon

sql server - Translate sql with COUNT into LINQ -

i can't seem find way translate sql linq. give me unique rows, , count value of numberof field in each row. select id, supid, text, externalid, numberof, count(s.numberof) stock s group s.id, s.supid, s.text, s.externalid, s.numberof can me this? you have this: var consolidatedchildren = s in stock group s new { s.id, s.supid, s.text, s.externalid, s.numberof } gs select new { id = gs.key.school, supid =gs.key.supid, text = gs.key.text, externalid =gs.key.externalid, numberof =gs.key.numberof, count = gs.count() //--------------> count of rows };

database - Website showing special characters like diamond with question mark -

i have website running on asp.net 2.0. using sql server 2005 earlier. running earlier. converted website .net 4.0 using visual studio 2010. working fine @ local environment. when hosted hosting provider showing many characters including diamonds question mark. understand charset problem , have tried following things removed database call webpage shows correctly changed tag in head <meta http-equiv="content-type" content="text/html; charset=utf-8"> iso-8859-1 of no benefit made varchar columns in database nvarchar of no use insted of "changed tag in head iso-8859-1 of no benefit" try this:"utf-8"

Pop up Javascript alert when PHP code starts to run and alert when finished execution -

i have php controller invokes according javascript click function. want pop javascript alert box when code starts run , alert again after finish execution. how achieve inside php controller example: <?php class admin_rentals extends base_admin { function update_user_verification_status() { // should pop alert box // executes code // alert when execution finished } } ?> you cannot controller. can java script if function executed ajax.something this alert('execution started'); $.ajax({ url : 'path/to/your/function', type: 'post', success: function(res){ alert('execution completed'); } }); php class admin_rentals extends base_admin { function update_user_verification_status() { $arrret = array('message'=>'this json'); echo json_encode($arrret); } }

Erlang node suffers high cpu -

i use perf detect node's process perf command: perf record -g -p 13586 sleep 10 result: # events: 7k cpu-clock # # overhead command shared object symbol # ........ ....... .................. .................................... # 17.02% beam beam [.] copy_struct | --- copy_struct 12.38% beam beam [.] size_object | --- size_object 11.85% beam beam [.] db_prog_match | --- db_prog_match 7.78% beam beam [.] db_select_hash | --- db_select_hash 6.90% beam beam [.] process_main | --- process_main 4.70% beam beam [.] do_minor | --- do_minor 4.23% beam beam [.] element_2 | ...

How to send parameter to this java class? -

i new on java, , trying implement print test using zebra sdk. zebra sdk (at end of class there "getconfiglabel"), prints constant "test", want send variable insted of constant. this, understand have send parameter class, not clear me how done. thanks. here class: /*********************************************** * confidential , proprietary * * source code , other information contained herein confidential , exclusive property of * zih corp. , subject terms , conditions in end user license agreement. * source code, , other information contained herein, shall not copied, reproduced, published, * displayed or distributed, in whole or in part, in medium, means, purpose except * expressly permitted under such license agreement. * * copyright zih corp. 2012 * * rights reserved ***********************************************/ package com.zebra.android.devdemo.connectivity; import android.app.activity; import android.graphics.color; import android....