Posts

Showing posts from September, 2015

javafx 8 - JavaFX8 TreeTableView multiple root items -

treeitem<filemodel> root = new treeitem<filemodel>(playlist); treetblviewfiles.setroot(root); treetblviewfiles.setshowroot(true); the code above sets 1 root item, need have several called root items expandable list of child items. how do that? in advance. you make parent root, don't show. that parent's children may roots, show.

c# - Twilio SMS messaging not working in Console Application -

i funded twilio account , working in console application. when go documentation (here: https://www.twilio.com/user/account/developer-tools/api-explorer/message-create ) , enter phone number request works. however, when copy code local console application nothing happens. literally copy code line line , make sure sid, token, , numbers correct , nothing happens @ all, console app runs end of execution. string accountsid = "mysid"; string authtoken = "myauthtoken"; var twilio = new twiliorestclient(accountsid, authtoken); var message = twilio.sendsmsmessage("+12222222222", "+13333333333","hello world"); console.writeline(message.sid); i run fiddler , raw packet. fiddler says result 401 status code. post https://api.twilio.com/2010-04-01/accounts/mysid/sms/messages.json http/1.1 authorization: basic {tonsofrandomcharactersthatlooklikeishouldhide} accept: application/json, application/xml, text/json, text/x-json, text/javascript,

java - Android-Controlled Car [General Info] -

this beginner's question. i'm trying control car on bluetooth on android device. although i'm no expert once know little, can start working on it. the functionality of car want control via android device is: fire engine (ignition) steer car's wheel accelerate gas pedal brake shift gears i know need mechanical micro-controllers don't have experience in field. question start , need do? , software might me it. for have start micro-controller implementation. make circuit can data bluetooth device , according it, micro-controller trigger relays above work. while in android app can make app send particular data (like 1,2,3,4 each work).

memory management - data type storage in C -

i want understand how declaring variable char saves memory declaring int or short. know fact declaring char reserves 1 byte in memory while 2 or 4 bytes reserved int. now, suppose in 16 bit processor, variable char stored @ location 0xabcd. since 16 bit processor, 1 byte or 8 bits of 16 bits @ address 0xabcd reserved char. int variable stored @ location 0xbcde, accordingly reserve 16 bits of 16 bits available @ location 0xbcde. want know happens 8 bits @ location 0xabcd left on after reserving memory char variable considering fact @ 1 memory location 1 variable can stored. memory addresses not work "variables". can not store 8 or 16 bits, can only , exclusively store exactly 8 bits (one single byte). (a) when int gets stored "at" address, takes more space -- not "in" same address, flowing on in next memory addresses, following "the" memory address. thus, if store char @ 0xabcd, compiler knows it's safe assume next value

Search and delete files owned by selected user through batch -

my objective is: - find files owned selected user - delete them my current code: @echo off /f %%f in ('dir /b /s') call :delete_file %%f goto :eof :delete_file ( set var=%1 dir /q %var%| find "\user" ) i'm looping files in current directory, i'm calling :delete_file parameter %%f (file path), in :delete_file i'm setting var first received parameter (%1 - file path). , now, i'm parsing again file (with /q paramter - output owner) in search of owner. question is, how set output of: dir /q %var%| find "\user" to variable? if output null, file not owned selected user, otherwise can delete file. how check this? this should echo del command files matching text if happy remove echo keyword , run real. i made text compare case insensitive. @echo off /f %%f in ('dir /b /s /a-d') ( dir /q "%%f"| find /v ":\" |find /i "%computername%\user">nul && echo del "%%f

how to share virtual sharepoint server and get it in host windows and visual studio? -

i installed windows 8.1 , installed visual studio 2013 on win 8.1 because need sharepoint server installed windows server 2012 r2 on windows 8.1 hyper-v , installed sql server 2012 , sharepoint server 2013 , create first farm server want create sharepoint app in visual studio installed on windows 8.1 when tap vs 2013 sharepoint solution give me same error if sharepoint not running on local machine . when browse sp server admin center in windows 8.1 browser it's able load sp server central admin installed sharepoint designer on windows 8.1 , it's able create site virtual sp server visual studio not able find virtual server ? please me how can add virtual sp server visual studio ( visual studio installed on win 8.1 ) ?? (forgive me bad english) best regards: raha install vs 2013 on hyper-v sharepoint server installed on. run vs 2013 inside hyper-v , should local sharepoint server. good luck

how to remove the base line on the yaxis of highcharts? -

Image
i need remove following encircled parts highcharts chart, 1 base line on y axis , other values label on x axis. i've tried several things mentioned in api haven't been able achieve yet. fiddle http://jsfiddle.net/ftaran/jbhdm/ $(function () { $('#container').highcharts({ chart: { type: 'bar' }, title: { text: null }, xaxis: { labels: { enabled: false } }, yaxis: { labels: { enabled: false }, tickwidth: 0, gridlinewidth: 0, labels: { enabled: false }, "startontick": true }, tooltip: { formatter: function () { return '<b>' + this.series.name + ':</b> ' + this.y + '<br/>' + this.percentage.tofixed(2) + '%';

python - ImportError: matplotlib requires dateutil; import matplotlib.pyplot as plt -

am new progamming , python, keep getting error below when run program. advised should use pip solve it. cant pip installed using cmd. though suceeded using powershell still cant make work. how solve this, tips go along way. thanks traceback (most recent call last): file "<pyshell#0>", line 1, in <module> satmc import satmc file "c:\python27\starb_models_grid1\satmc.py", line 3, in <module> import matplotlib.pyplot plt file "c:\python27\lib\site-packages\matplotlib\__init__.py", line 110, in <module> raise importerror("matplotlib requires dateutil") importerror: matplotlib requires dateutil am using version 2.7.3 you need install various packages numpy working correctly. libsvm-3.17.win32-py2.7 pyparsing-2.0.1.win32-py2.7 python-dateutil-2.2.win32-py2.7 pytz-2013.9.win32-py2.7 six-1.5.2.win32-py2.7 scipy-0.13.3.win32-py2.7 numpy-mkl-1.8.0.win32-py2.7 matplotlib download binar

r - Function with extra parameters from another function's input -

this relatively problem i'm stumped. programming in r, don't think problem restricted r. below i've tried write simple code demonstrating problem: f1 = function(x) { return(a + x) } f2 = function(ftn) { return(ftn(1)) } f3 = function(a) { return(f2(f1)) } the problem: if call f3(2) [for example], f2(f1) returned, , f2(f1) returns f1(a+1). f1 not recognize value of 'a' put in f3, code doesn't work! there way can make f1 recognizes input f3? r uses lexical scope, not dynamic scope. functions free variables (variables used not defined within them) in environment in function defined. f1 defined in global environment a looked in global environment , there no a there. can force f1 free variables in running instance of f3 this: f3 = function(a) { environment(f1) <- environment() return(f2(f1)) } this temporarily creates new f1 within f3 desired environment. another possibility if f1 needed within f3 define f1 there (ra

javascript - HTML Multiple columns in multiple pages -

i want display webpage in book-like fashion, 2 columns, spread through several pages. i using column-count , works fine 1 page, need split text after number of lines display rest in new page. so instead of displaying text as: a b c d e... (each letter represents column of text) i want: a b c d e.. ho this, specifying number of lines per page displayed (and number of columns, although in case 2) , automatically arrange javascript? thanks help. you forgot, each space rendered column! however, cannot use css break line @ each character, either use max-width: 5px; /* approximately 1 char */ or you'll use jquery break string @ each character , write appending <br /> line. var chars = "a b c d e f"; chararray = chars.split(" "); /* @ white space */ (int = 0; < chararray.length; i++) { /* write , add <br /> @ end */ } this way can handle it.

jQuery: create array with all unique values of a table -

is there way can create array using jquery / js contains unique values table, i.e. without duplicates ? also, values interested in in tds class ( myclass ) + exclude "" , " " non-valid values. in below example output should [item1,item2,item3] unique , valid values. example table: <table id="mytable"> <thead> <tr> <th class="myheader">cat 1</th> <th>vol 1</th> <th class="myheader">cat 2</th> <th>vol 2</th> <th class="myheader">cat 3</th> <th>vol 3</th> //... </tr> </thead> <tbody> <tr> <td class="myclass">item1</td><td>8</td><td class="myclass">item2</td><td>7</td><td class="myclass">item1&l

Interrogations about "servless CI with git" bash script -

i in reference excellent article david gageot : serverless ci git . let me include david's script here: #!/bin/bash if [ 0 -eq `git remote -v | grep -c push` ]; remote_repo=`git remote -v | sed 's/origin//'` else remote_repo=`git remote -v | grep "(push)" | sed 's/origin//' | sed 's/(push)//'` fi if [ ! -z "$1" ]; git add . git commit -a -m "$1" fi git pull if [ ! -d ".privatebuild" ]; git clone . .privatebuild fi cd .privatebuild git clean -df git pull if [ -e "pom.xml" ]; mvn clean install if [ $? -eq 0 ]; echo "publishing to: $remote_repo" git push $remote_repo master else echo "unable build" exit $? fi fi if understand correctly script, clone initial git repository second hidden git repository unit tests run. if unit tests pass, second hidden repository pushed initial working repository. my questions follows: how 1 supposed use s

android - activity A B C and startActivityForResult method -

i have 3 activities a, b , c. a main activity. call b , c when button pressed i have in @suppresswarnings("unchecked") @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); // fragment fragment = getsupportfragmentmanager().findfragmentbyid(r.id.pager); if(data!=null) { if(null!=data.getserializableextra("result")) { m_calpage.updatelistview((arraylist<listtype>) data.getserializableextra("result")); } } } b , c related onactivityresult (call rel ) @suppresswarnings("unchecked") @override public void onactivityresult(int requestcode, int resultcode, intent data) { if (requestcode == 1) { if(resultcode == -1) { updatelistview((arraylist<listtype>) data.getseria

sql server - SQL query needed for best product mix data -

i work small company dealing herbal ingredients. count regularly effectiveness of ingredients, based on "product mix" (how of ingredient a, b , c). have table thousands of rows, following: product ingredient ingredient b ingredient c effectiveness 1                          28                               94                            550                      4,1 2 b                         50                               105                           400                      4,3 3 c                         30                               104                           312                       3,5 .. etc etc etc etc etc what   want result, table below. using excel during last years difficult handle millions of data , therefore have similar in sql. did several attempts pivot , subqueries did not manage result needed. in particular, in first 3 columns, include various ranges / criteria. in column ‘average effectiveness’ c

deducing the name of the variable from positional parameters in a posix shell -

#!/bin/sh foo() { printf "$1" } random_var="hello\n" foo $random_var when pass 1 or more variables function, in case foo , accessible through $1 $2 , on; how go step inside foo , print name of original variable in case means random_var ? succinctly, don't or can't tell inside function variables used create argument function. there's no guarantee argument variable, or single variable — example: foo 123 foo ${home}:${path} further, if function cares, mis-written. should self-contained possible, , therefore independent of such issues. if isn't, suggests maybe function not functionally cohesive.

Python (maybe sys or os module) to get a unique identifier of client's machine -

i want use (maybe os or sys module or other module) python unique identifier of client. such cpu number or else fixed , never changes. how possible? i'd take https://pypi.python.org/pypi/pycpuid or question: get unique computer id in python on windows , linux

SQL query to get value of next 5th row without using while loop or cursor in SQL Server 2008 -

i working on query need next nth no of row. table structure id stockname stockdate dayopen dayhigh daylow dayclose -------------------------------------------------------------------- 60 idbi 2014-01-01 66.50 67.80 66.50 67.60 197 idbi 2014-01-02 67.55 69.20 65.25 65.60 334 idbi 2014-01-03 65.00 66.40 64.35 66.15 471 idbi 2014-01-06 66.15 66.35 65.10 65.55 608 idbi 2014-01-07 66.10 66.15 63.85 64.25 745 idbi 2014-01-08 64.00 67.10 63.10 66.80 882 idbi 2014-01-09 66.60 67.80 64.50 64.75 1019 idbi 2014-01-10 65.00 65.90 63.75 64.10 1156 idbi 2014-01-13 63.85 65.00 63.25 64.20 1293 idbi 2014-01-14 64.00 64.95 63.80 64.05 what want output column name give me next 5th row date e.g. 1st row new column should return value of next 5th row date ie 2014-01-08 same 2nd row should return 2014-01-09 date. and can't use datediff -5 day cou

java - boolean &= assignment operator meaning -

if have 2 variables boolean k = true; boolean m = false; what following do; k &= m; that's compound assignment operator, equivalent to: k = (boolean)(k & m);

php - Autocomplete,display search term results? -

a quick question, know how make php script search database record pertaining autocomplete search term (if makes sense @ all). i guess trying that, when search on google , auto-suggestions once click on suggestion results suggestion shows straight away...is there way of doing this? basically create form ajaxes file gives suggestions based on term via database (like query possibly). you can use jqueryui's autocomplete client side. http://jqueryui.com/autocomplete/

html - Place an image next to my title -

i have picture , picture title. i'm trying display text alongside image. current code <p class="title"> <img src="images/football.png" /> sports section </p> .title { float:left; } try removing float p tag, , place on image. <p class="title"> <img class="my_image" src="images/football.png" /> sports section </p> .my_image { float:left; }

php - How to echo a converted time format from mysql datetime column -

i'm trying convert datetimte shorter, error below. warning: date_format() expects parameter 1 datetime, string given in ... code $datetime = '2012-03-24 17:45:12'; $time = date_format($datetime, 'g:i a'); echo $time; what i'm doing wring? thanks. try datetime $date = new datetime("2012-03-24 17:45:12"); echo $date->format("g:i a");

MySQL: Order By Specific Fields -

first question ever harsh :) i needing sort specific department type or department(s) followed rank. default setting orders rank, dept_type , department. front end php i'm looking more sql fix if possible. have source table of departments if sub query work. orgin table: +-----------+------------+------+ | dept_type | department | rank | +-----------+------------+------+ | inbound | dept r | 1 | | outbound | dept p | 2 | | inbound | dept e | 3 | | outbound | dept d | 4 | | outbound | dept d | 5 | | outbound | dept d | 6 | +-----------+------------+------+ i need specify order "dept d", "dept e", else so: select * table order field(department, "dept d", "dept e"), rank, dept_type, department what want return (ddderp): +-----------+------------+------+ | dept_type | department | rank | +-----------+------------+------+ | outbound | dept d | 4 | | outbound | dept d

android - How to accept multiple socket connection at Java server -

i'm trying implement client-server pair in android using standard java sockets. far, i've implemented 1 one client-server connection. now, i'm modifying server side code accept multiple client connection. i've taken here . i'm creating serversocket , wait client connection in infinite while loop. once client side socked accepted, run new thread handle client , again wait new connection. unfortunately, program keeps crashing unknown reason! logcat says- "error opening trace file: no such file or directory". file path correct (it working fine in older implementation). can suggest doing wrong? related missing manifest permission? here i've done far: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); intent launchfilemanager = new intent(getbasecontext(), filechooseractivity.class); startactivityforresult(launchfilemanager, request_cod

apache - My css and png wont work on my 404 directory -

my css , png. work on regular errors not when localhost/example/example . css , png doesn't connect error page. works when localhost/example . .htaccess looks way errordocument 400 /404 errordocument 401 /404 errordocument 403 /404 errordocument 404 /404 errordocument 500 /404

Rebase template function in bottle python doesn't render the template as it should -

i'm trying reproduce basic example of rebase function bottle documentation, when template rendered html code encoded , tags replaced corresponding html code. my template: % rebase('base.tpl', title='page title') <p>page content ...</p> my base template: <html> <head> <title>{{title or 'no title'}}</title> </head> <body> {{base}} </body> </html> the final html rendered: <html> <head> <title>page title</title> </head> <body> &lt;p&gt;page content ...&lt;/p&gt; </body> </html> as can see, template included @ right place, it's if template engine had escaped security reasons , don't know whys. i'm surprised being 1 having issue. i'm using bottle v0.12.5 , reproduced issue on different environnements (macosx & ubuntu) any thoughts or ideas? thanks html special characters automa

android - YouTubePlayerSupportFragment cannot be resolved to a type -

i using adt eclipse develop android app. imported , using android-support-v7-appcompat support library , while using "youtubeplayersupportfragment" class erroring out saying unresolved. min sdk app 7. can please support library should use use youtube player api lower versions of android. ? i have gone through support libraries , features added in library, didn't find clue. can please help? piece of code using youtubeplayersupportfragment fragment = new youtubeplayersupportfragment(); fragmenttransaction.add(r.id.sample_video, fragment); fragmenttransaction.commit(); fragment.initialize(developerkey.developer_key, new oninitializedlistener() { .... }

jquery with variable php -

i have code php ............................ .............................. ................. <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" stock=" <?php if ($option_value['subtract']) { ?> <?php if ($option_value['quantity'] >= 3) { ?> <?php echo $text_in_stock; ?> <?php } ?> <?php if ($option_value['quantity'] < 3 && $option_value['quantity'] > 0) { ?> <?php echo $option_value['quantity']; ?>&nbsp;<?php echo $text_pcs_only; ?> <?php } ?> <?php if ($option_value['quantity'] <= 0) { ?> <?php echo $text_out_of_stock; ?> <?php } ?> <?php } ?> " value="<?php echo $option_value['product_option_value_id

python - TypeError: 'NoneType' object has no attribute '__getitem__15' -

hello every one, want ro run camshift algorithm error created during running time. error is: traceback (most recent call last): file "c:\python27\code\extra algorithms\camshift in opencv.py", line 11, in <module> roi = frame[r:r+h, c:c+w] typeerror: 'nonetype' object has no attribute '__getitem__10' ` probably frame none. can't index you're doing in frame[r:r+h, c:c+w] . should initialize variable or handle case when it's none.

c++ copy constructor, after copy random value -

i have errors copy constructor cant figure out, main question @ moment brought out in test programs comments. why second print out big number, , not three? thank in advance help. template<class t> class array { private: t *cont; unsigned int size; public: array()=default; t& elementat(unsigned int i) { return cont[i]; } array( const array &a ) { cont = new int[ size ]; ( int = 0; < size; i++ ) cont[ ] = a.cont[ ]; } array& operator = (const array& a) { int i,min_size; if(size < a.size) min_size = size; else min_size = a.size; for(i=0; i<min_size; i++) cont[i] = a.cont[i]; return (*this); } void addelement(t element) { t *new_cont = new t[size + 1], *old_cont = cont; (int = 0; < size; i++) { new_cont[i] = old_cont[i]; } new_cont[size] = element; size++

java - jScrollPane Scroll dissapears after jPanel resize -

i'm writing java gui application using netbeanside 7.4 , have encountered following problem: i have jpannel enclosed in jscrollpane of initial dimension 300,160 every time click on jbutton @ runtime, resize jpannel follows: jpanel3.setpreferredsize(new dimension(300, (count + 3) * 30)); jpanel3.repaint(); if count variable larger 3, vertical scrollbar adapts jpannel every time resize it. but if count less 3, vertical scrollbar dissapears, , when resize jpannel again ( lets say, count = 10), scrollbar doesn't show anymore. is normal? how can fix it? is normal? how can fix it? don't know if normal or not, not proper way resize panel. swing component responsible determining size, not application code. done creating setter method when want change property of component. if want dynamically change size of panel should override getpreferredsize() method of custom panel. like: @override public dimentsion getpreferredsize() { return new dimensio

c++ - "Not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation" -

i'm beginning program using heaps in must insertsort, mergesort, , quicksort heap. instructed use code textbook basis , cannot example code compile. keep receiving error: not declared in scope, , no declarations found argument-dependent lookup @ point of instantiation now think has order in template<> classes declared in sort.h file. however, can't imagine textbook publish code doesn't compile. guys mind taking look? full errors: in file included driver.cpp:4:0: sort.h: in instantiation of 'void heapsort(std::vector<comparable>&) [with comparable = int]': driver.cpp:47:21: required here sort.h:79:9: error: 'percdown' not declared in scope, , no declarations found argument-dependent lookup @ point of instantiation [-fpermissive] sort.h:104:6: note: 'template<class comparable> void percdown(std::vector<comparable>&, int, int)' declared here, later in translation unit sort.h:83:9: error: 'percdown' n

php - Symfony2, Edit Form, Upload Picture -

im new forum , symfony. after hours of searching don't found solution problem. problem: i have problem in edit form. create form works fine! have edit form projects. when change fields, title , submit. picture disappears, because haven't pick one.... i have select current picture every time, because not pre selected. what need: 1. need preview of current picture above file upload button. 2. when change data of edit form, preview picture shouldn't change! is there way can achieve this? need help, thx :) my form looks this. public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('title', 'text', array('attr' => array( 'label' => 'titel', 'class' => 'input-xxlarge' ))) ->add('short', 'text', array('attr' => array( 'label' =

avl tree - AVL vs Hashtable with Chaining -

i know best case , worst case avl tree logn find, insert, , delete. best case , worst case hashtable chaining? how differentiate 2 if given 2 mystery data structures? what best case , worst case hashtable chaining? find, insert, delete operation best time o(1) or constant time. worst time, insert: o(1), assuming chaining done adding end of chain delete: o(k), k = number of elements on longest chain. k == n when hashing function poor , n values map same entry , gets chained. so, absolute worst case o(n). find: o(n), using same reasoning delete how differentiate 2 if given 2 mystery data structures? just idea: insert data in both structures , plot insertion time insertion operation vs n. choose data make mimic worst case avl tree (i.e. if integers, insert in order 1000000, 99999, 999998...) not hashtable. notice plot being generate. avl tree 1 have insertion time log(n) beginning while should constant hashtable. around 1000th insertion alv tree take 1

objective c - Change UIToolbar color above UIKeyboard iOS 7 color -

Image
i'm trying change color of uitoolbar above keyboard, can not recreate color black semi transparent keyboard, have tried this: alerttoolbar.bartintcolor = [uicolor colorwithred:0.0f green:0.0f blue:0.0f alpha:0.5f]; but result: alerttoolbar.barstyle = uibarstyleblack; that should give ios 7 blur looking for. don't tint toolbar, set tool bar style.

android - Adding libs with resources via command line -

i'm trying accomplish http://developer.android.com/tools/support-library/setup.html#libs-with-res without using eclipse or gradle; however, official documentation doesn't support that. last couple hours, i've been googling can think of, i'm not finding helpful information. specifically, i'm trying add support.v7.appcompat library. i'm able add jar project, can't find way add relevant resources. keep getting java.lang.illegalstateexception: need use theme.appcompat theme (or descendant) activity. though i've added android:theme="@style/theme.appcompat" <manifest> element of androidmanifest.xml per 1 of earlier, seemingly-relevant search results. i've added android.library.reference.1=<sdk>/extras/android/support/v7/appcompat local.properties , no avail. can please instruct me on how add library command line? however, official documentation doesn't support that the general android library project

How to find all capital and lower case occurrences of unicode character using regex and re.sub in Python? -

this code in django view (intentionally simplified)(python 2.7): # -*- coding: utf-8 -*- django.shortcuts import render import re def index(request): found_verses = [] pattern = re.compile('ю') open('d.txt', 'r') doc: line in doc: found = pattern.search(line) if found: modified_line = pattern.sub('!'+'\g<0>'+'!',line) found_verses.append(modified_line) context = {'found_verses': found_verses} return render(request, 'myapp/index.html', context) d.txt (also utf-8) contains 1 line (intentionally simplified): 1. Я сказал Юлию одному. the above, when rendered, gives me expected result: 1. Я сказал Юли!ю! одному. when change capital letter pattern = re.compile('Ю') , gives me expected result: 1. Я сказал !Ю!лию одному. but when change group pattern = re.compile('[юЮ]') or pattern = re.compile('[Юю]

how to recreate .meteor directory at another developer place? -

i starting out on project want work friend in github, created meteor project locally , added github. added except .meteor directory. when colleague cloned , got project down since missing .meteor directory, unable start working on it. how go recreating .meteor file @ location or suppose include .meteor file github well? * edit: since brand new project, asked him recreate project locally , copy .meteor directory newly created 1 , copy git file location , worked. sure right way though. you should check in .meteor directory because contains critical information meteor version use , required packages project. i suspect may have avoided doing because of huge database stored within directory. fear not - each meteor project comes .meteor/.gitignore avoid checking in db.

d3.js - How can I listen mouse events from d3 when jquery drag & drop is in action? -

i'm planning use jquery drag dom nodes on svg , drop them d3 can handle drop. this question gave me starting point. when listen mousemove event d3, d3 not seem track mouse move during jquery's drag operation. i'd make d3 respond drag before drop, , need track drag has been started jquery outside of svg. i've modified fiddle question above demonstrate approach not working. can see here here code fiddle: var treecreator = function(){}; treecreator.prototype.callbacktest = function(svgcontainer){ alert('the element has been dropped'); }; treecreator.prototype.createtreenode = function(thesvg){ $('#tobedropped').remove(); thesvg.append("circle") .style("stroke","green") .style("fill","white") .attr("r",40) .attr("cx", 100) .attr("cy", 100) .on("mouseover", function () { d3.

linux - Simple way to Get filesize in x86 Assembly Language -

assuming have opened file in assembly , have file handle file in register eax. how go getting size of file can allocate enough buffer space it? i researched discussion here suggested using sys_fstat(28) system call file stats couldn't implement it... #my attempt @ getting file size _test: movl filehandle, %ebx #move filehandle (file descriptor) ebx movl $28, %eax #fstat syscall int $0x80 # end -14 in here not sure why here how implemented in freshlib. wrapper in order provide portability. can simplify of course (see below). struct stat .st_dev dw ? ; id of device containing file .pad1 dw ? .st_ino dd ? ; inode number .st_mode dw ? ; protection .st_nlink dw ? ; number of hard links .st_uid dw ? ; user id of owner .st_gid dw ? ; group id of owner .st_rdev dw ? ; device id (if special file) .pad2 dw ? .st_si

c++ if statement issues -

below function i'm trying use decide if player has moved checkers piece left or right. moveto holds decimal 5.2 , movefrom hold square number 6.3 difference -1.1 , assigned movevalue (i'm checking trace statement , assigning correctly). however when hits ifs it's not coming out equal , runs last if statement, if hard code -1.1 movevalue evaluate correctly. ideas why it's not evaluating correctly big help. have posted output running program under code : int legalplayermove(float moveto, float movefrom) { float movevalue=(moveto-movefrom); cout<<"trace move value"<<movevalue<<endl; if(movevalue==(-1.1)) cout<<"moved left"<<endl; if(movevalue==(-0.9)) cout<<"moved right"<<endl; if(movevalue!=-1.1||movevalue!=-.9) cout<<"that not legal move, please renter square number wish move to."<<endl; return 0; } please en

c++ - openCV Animal (mice) Recognition -

i researching animals recognition algorithms opencv, more precisely of laboratory mice (white) , have not found references. of have seen related algorithms such support vector machine (svm) , hidden markov not sure if correct path. i books references, scientific articles or codes in c++ focus on issue. anyone have ideas? given mice white if track them on counter of different colour, solid colour, relatively easy approach use opencv's cvtcolor(src,dst,color_bgr2hsv); , find min , max hsv values of mice on given background. threshold output binary image using inrange , white being mice , black being background, , use findcountours , moments method locate mice , track them. source , full tutorial: link disclaimer:this not video, credit author of channel.

Can I reset MPI instance in c++? -

i wrote sort algorithm mpi. recursive mergesort, left child sorts half array within same process parent whereas right child gets new process , receives half array parent sends sorted array parent. need sort bunch of integer files. here current design: int main() { mpi_init(); if(my_rank == 0) { foreach data file { sort_mpi(array); } } else { mpi_recv(right_array...); sort_mpi(right_array); mpi_finalize(); } mpi_finalize(); } with code, first file gets sorted , moves on next file. in second interation of loop, stays in rank 0 , never goes rank 1. should ideal if can reset mpi instance before going next file. there way that? you not need reset mpi - need have point instances "freezing" in, , continuing after instances got point... since it's homework - won't tell method name, hope helps. think design of sort, , state need nodes in, when, , how enforce it. this example might helpful (hoping not solve hom

Calling fortran from R via C does not link -

i have routine in fortran, wish use in r via c implementation. suppose fortran file bivnt.f. now, r cmd shlib c_binary.c , r cmd shlib bivnt.f not give problem when comes linking obtain > dyn.load("bivnt.so") > dyn.load("c_binary.so") errore in dyn.load("c_binary.so") : unable load shared object '/users/erlisruli/dropbox/wpapers/abc-cs/rcode/corbindata/c_binary.so': dlopen(/users/erlisruli/dropbox/wpapers/abc-cs/rcode/corbindata/c_binary.so, 6): symbol not found: _smvbvt_ referenced from: /users/erlisruli/dropbox/wpapers/abc-cs/rcode/corbindata/c_binary.so expected in: flat namespace in /users/erlisruli/dropbox/wpapers/abc-cs/rcode/corbindata/c_binary.so this seems pretty strange me, since nm obtain $ nm bivnt.so 0000000000003940 s _a.1868 u _asin u _atan u _atan2 u _exp 0000000000003540 t _mvbvn_ 00000000000027a0 t _mvbvt_ 0000000000002610 t _mvbvtc_ 00