Posts

Showing posts from June, 2012

Matlab: Collect/save data and shrink code -

Matlab: Collect/save data and shrink code - given next code: clc clear p = 45; mat =[ 64.7331 62.4019 60.2700 58.7798 58.4334 62.6596 59.4961 56.2320 53.6037 52.9330 60.9245 56.7753 51.7143 46.3398 44.5793 59.9245 55.0268 48.0563 36.3834 27.3842 59.9858 55.1389 48.3194 37.4449 30.2616 57.9874 54.0479 50.6911 50.0354 52.6935 55.4367 49.3499 41.7788 39.6147 46.7394 54.3272 46.7781 32.1549 20.1516 42.9207 55.3253 49.1113 41.1552 38.7894 46.4079 57.8245 53.7807 50.2828 49.5916 52.3766 63.0248 62.0303 61.8372 62.5024 63.8418 59.4631 57.8597 57.5336 58.6360 60.6997 55.2480 52.3275 51.6672 53.8008 57.2342 50.6163 44.3727 42.4670 47.8379 53.8624 47.3455 34.0518 22.7165 42.7145 51.8266 60.1421 55.2778 48.3022 35.9256 16.6506 60.8750 56.5697 51.0854 44.5373 41.5090 62.4192 59.0475 55.4089 52.2317 51.1936 64.3903 61...

java ee - how to create mysql database using servlet please give some basic ideas -

java ee - how to create mysql database using servlet please give some basic ideas - i working on lastly year project. want connect mysql database using jdbc , please 1 give me basic thought regarding how create mysql database using servlet create static variables likebelow in class // jdbc driver name , database url static final string jdbc_driver = "com.mysql.jdbc.driver"; static final string db_url = "jdbc:mysql://localhost/"; // database credentials static final string user = "username"; static final string pass = "password"; and phone call createdb method based on doget or dopost public static void createdb() { connection conn = null; statement stmt = null; try{ //step 2: register jdbc driver class.forname("com.mysql.jdbc.driver"); //step 3: open connection system.out.println("connecting database..."); conn = drivermanager....

amazon web services - Cannot Bootstrap chef (10.8) on new EC2 Instance - net-ssh conflict -

amazon web services - Cannot Bootstrap chef (10.8) on new EC2 Instance - net-ssh conflict - i have found can't install chef, gem version conflict net-ssh net-ssh-multi net-ssh-gateway in research, unfortunately none of workarounds work me in particular case. i'm trying bootstrap chef on ec2 instance. i cannot upgrade 11.x. this 1 not work: (added command run install chef includes --verbose , --version) gem install net-ssh -v 2.2.2 --no-ri --no-rdoc gem install net-ssh-gateway -v 1.1.0 --no-ri --no-rdoc --ignore-dependencies gem install net-ssh-multi -v 1.1.0 --no-ri --no-rdoc --ignore-dependencies gem install chef --no-ri --no-rdoc --verbose --version 0.10.8 is there way work around problem without upgrading chef? i've tried above with gem install chef --pre --no-ri --no-rdoc and fails too. these both workarounds outlined in linked post above. does this blog post joshua timberman help? amazon-web-services amazon-ec2 chef

python - Separate SQLAlchemy models by file in Flask -

python - Separate SQLAlchemy models by file in Flask - this question has reply here: flask-sqlalchemy import/context issue 2 answers many examples flask apps have seen have models stored straight in main app file (http://pythonhosted.org/flask-sqlalchemy/quickstart.html, http://maximebf.com/blog/2012/10/building-websites-in-python-with-flask/). other ones (http://flask.pocoo.org/docs/patterns/sqlalchemy/) have "models.py" file in models placed. how can have flask app import models separate files, e.x. "user.py"? when seek creating user.py file these contents: from app import db class user(db.model): [...] i next error: file "/users/stackoverflow/myapp/models/user.py", line 1, in <module> app import db importerror: no module named app when insert from models import user in module file. this reply extremel...

extjs - How to disable cache for a Storage in Sencha Touch? -

extjs - How to disable cache for a Storage in Sencha Touch? - how disable cache specific storage in sencha touch? do know way disable cache storages in app? which cache referring to? if it's browser cache (for example, when using ajax proxy) should on default (it uses separate query param in each request, _dc default). if mean model records beingness stored in memory, may want @ usecache config option of model . extjs sencha-touch sencha-touch-2

Why don't I have to commit after git merge -

Why don't I have to commit after git merge - i have repo master , file1.txt , file2.txt git checkout -b fix1 i alter file1.txt and git commit -a then a git checkout master then git checkout -b fix2 i alter file2.txt and git commit -a then git checkout master git merge fix1 git marge fix2 but if a commit -a i get # on branch master nil commit (working directory clean) git merge commits automatically. if don't want commit add together --no-commit argument: --commit, --no-commit perform merge , commit result. alternative can used override --no-commit. --no-commit perform merge pretend merge failed , not autocommit, give user chance inspect , farther tweak merge result before committing. git git-merge

sql - MySQL simple join using temporary table -

sql - MySQL simple join using temporary table - i've got (what thought) simple query on mysql database, using explain shows query using temporary table. i've tried changing order of select , bring together no avail. i've reduced tables simplest (to see if issue complexity of tables, still have problem). i've tried 2 basic tables, 1 "name" field, , other foreign key reference table: a: +-------+--------------+------+-----+---------+----------------+ | field | type | null | key | default | | +-------+--------------+------+-----+---------+----------------+ | id | int(11) | no | pri | null | auto_increment | | name | varchar(128) | no | mul | null | | +-------+--------------+------+-----+---------+----------------+ b: +-------+---------+------+-----+---------+----------------+ | field | type | null | key | default | | +-------+---------+------+-----+---------+----------------+ | id | int(...

Pass variable from python script to C program(command line argument) -

Pass variable from python script to C program(command line argument) - i here issue : have gui (wxpython), has spinctrl, output of spinctrl must sent c file, take command line argument, whenever execute c file using subprocess accepts value gui spinctrl value must sent instead of manual typing. my code is: ps = "password" var1 = self.sc1.getvalue() var2 = self.sc2.getvalue() subprocess.call(['echo xsxsxs | sudo "./license.exe"', str(ps), str(var1), str(var2)],shell = true) whenever run script doesnot show output/error :( if remove echo xsxsxs| sudo line 4 , execute show error: "you must root user","invalid password", "segmentation fault". whenever utilize shell=true subprocess.popen (or 1 of convenience wrappers), should pass string way type in shell, not list . from docs: if shell true, recommended pass args string rather sequence. python c wxpython su...

c++ - Linked List Segmentation Fault -

c++ - Linked List Segmentation Fault - why cause segfault error? i've tried run backtrace gdb, has given me no help. help appreciated, i've been pulling hair out on hours. my node.h #ifndef node_h #define node_h #include <string> using namespace std; class node { public: node(const string, const int) ; ~node() { } void setnext(node *);//setter next variable node * getnext();// getter next variable string getkey();// getter key variable int getdistance(); // getter dist variable private: node *next; int dist; string key; }; #endif my node.cpp #include "node.h" #include <string> node::node(string k, int d){ key = k; dist = d; } void node::setnext(node * n){ next = n; } node * node::getnext(){ homecoming next; } string node::getkey(){ homecoming key; } int node::getdistance(){ homecoming dist; } my list.h #ifndef list_h #define list_h #include "node.h" ...

java - get more fields ifrom jsp page and save in DB -

java - get more fields ifrom jsp page and save in DB - i have jsp page servlet wanna more 400 fields single user , save in db, , user can modify field values , other tools help me gwt? you can update fields "on change" through ajax phone call or seek utilize getattributenames() in servlet. java hibernate jsp java-ee servlets

python - "[Errno 101] Network is unreachable" when trying to send email using Django -

python - "[Errno 101] Network is unreachable" when trying to send email using Django - for reason getting error when trying send email (with gmail) using django. [errno 101] network unreachable the weird part seems happen when web app running on server (bluehost). works fine when locally. here email settings email_use_tls = true email_host = 'smtp.gmail.com' email_host_user = 'email@gmail.com' email_host_password = 'fakepassword' email_port = 587 any thought how can prepare this? this have port trying send email on bluish host machine. they block ports security reasons. more info: https://my.bluehost.com/cgi/help/500 python django email gmail

php - select every other row in MySQL without depending on any ID? -

php - select every other row in MySQL without depending on any ID? - considering next table doesn't have primary key, can select every other row? col1 col2 2 1 b 3 c 12 g first select must find: 2, 3 second select must find: 1, 12 is possible? in unique mysql fashion: select * ( select * , @rn := @rn + 1 rn table1 bring together (select @rn := 0) ) s rn mod 2 = 0 -- utilize = 1 other set example @ sql fiddle. php mysql sql mysqli-multi-query

haskell - linking extra libraries/objects failed -

haskell - linking extra libraries/objects failed - i made ffi bindings c++ unordered_map(a.k.a. hash_map) container , wrapper library called libstl.a . @ first time, used work well. after point, has failed link library next error messages , can't figure out why. $ ghci -l. -lstl -lstdc++ ghci, version 7.6.2: http://www.haskell.org/ghc/ :? help loading bundle ghc-prim ... linking ... done. loading bundle integer-gmp ... linking ... done. loading bundle base of operations ... linking ... done. loading object (static archive) ./libstl.a ... done loading object (dynamic) /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so ... done final link ... ghc: ./libstl.a: unknown symbol `_zznkst8__detail20_prime_rehash_policy11_m_next_bkteme10__fast_bkt' linking libraries/objects failed source codes library located in https://github.com/comatose/stl-container. help appreciated. i've had similar problems loading .o files ghci. understand, problem g++ leaves 'weak...

ios - How to make a array of strings -

ios - How to make a array of strings - two questions: first question: i want create arrays of strings this: country[1]=norway; capital[1]=oslo; country[2]=germany; capital[2]=berlin; how write code? should simple, don't understand of explanations i've seen. guess want utilize nsarray, because don't want alter them! guess main question how declare array! second question: can utilize illustration capital[2] in button text? quiz , want 1 of options if country[2] given country. /a noob easiest way declare nsarray in obj-c this: nsarray *countries = @[@"norway", @"germany"]; nsarray *capitals = @[@"oslo", @"berlin"]; you can access indexes later using [] notation: [mybutton settitle:capitals[1] forstate:uicontrolstatenormal]; remember arrays in programming languages 0-indexed! means first element index 0, sec index 1 , forth ios arrays string

running IStateful jobs per machine in a cluster with Quartz.net -

running IStateful jobs per machine in a cluster with Quartz.net - i running cluster of quartz.net services reading of standard adojobstore. behaviour i'm looking explained in title, i'm wanting run stateful jobs per machine in cluster. believe stateful job run one-at-a-time whole cluster. uncertainty quartz.net supports stateful job per machine in cluster function ality i've looked long , hard there other way replicate behaviour in quartz.net? another way set threadcount per job type opposed current situation threadcount specified per machine, give me behaviour i'm looking , able run specific job type one-at-a-time per machine. any suggestions? if job start times of jobs not crucial, can seek these you can utilize proper grouping name triggers & jobs based on machine name in cluster (for identification) , see if grouping name of triggers correspond machine name firing on (attach trigger listener , create corresponding checks in vetojobexecuti...

asp.net - argumentnullexception was unhandled by user code -

asp.net - argumentnullexception was unhandled by user code - in asp.net application while uploading info excel sheet website im getting error system.argumentnullexception: value cannot null. source error: line 161: lhsupdate.name = associatename; line 162: line 163: var designation = dsdata.tables["lhs"].asenumerable().where(r => convert.tostring(r["associate id"]).trim() == lhsupdate.assciateid.trim()); line 164: line 165: if (designation != null) source file: d:\genius\lhs\lhs\updatelhs.aspx.cs line: 163 stack trace: [argumentnullexception: value cannot null. parameter name: source] system.data.datatableextensions.asenumerable(datatable source) +34903 lhs.login.btnfileuplode_click(object sender, eventargs e) in d:\genius\lhs\lhs\updatelhs.aspx.cs:163 system.web.ui.webcontrols.button.onclick(eventargs e) +118 system.web.ui.webcontrols.button.raisepostbackevent(string eventargu...

scala - Slick match on encrypted variable -

scala - Slick match on encrypted variable - how select on encrypted variable slick. i have bcrypt encoded password in database. to illustrate intentions: def login(name: string, password: string) = action { ... { u <- users if u.name === name && bcrypt.checkpw(password, u.password) } yield u of course of study slick complains u.password beingness lifted column , not string. how go solve problem? actually managed solve problem. def login(name: string, password: string) = action { database withsession { (for { u <- users if u.name === name } yield u).list } match { case nil => ok("no user found") case head :: tail => if(bcrypt.checkpw(password, head.password)) ok("accepted").withsession("userid" -> head.id.get.tostring) else ok("incorrect password") } } scala encryption playframework-2.0 playframew...

Java Collections: Interfaces and Abstract classes -

Java Collections: Interfaces and Abstract classes - all collections implements interface collection, these collection have specific abstract hierarchy e.g. abstractcollection -> abstractlist -> arraylist abstractcollection -> abstractset -> hashset but there corresponding interfaces collection, list, set. these interface seem me kind of redundant. why here ? is convention or there reason implement interface , not extend abstract class. the interfaces there because it's able assign type variable or parameter without imposing implementation. for instance if create persistent entity utilize in hibernate, , has collection of things, want assign type of list or set that. hibernate swap out whatever list initialize own, hibernate-specific implementation lazy-loading or whatever else needs to. hibernate developers may not want constrained having extend abstract class. the abstract class exists convenience implementers. interface contract used clients. ...

java - How to select jpeg images rom android gallery? -

java - How to select jpeg images rom android gallery? - i need create app open android gallery android app , should able view .jpeg images in gallery, other images .png or other format should removed . can please suggest how ? look illustration txt can same jpg files, list files , select want use. android: file list in listview. note: folder gallery enviroment.directory_dcim java android image jpeg

linux - Directing awk output to variable -

linux - Directing awk output to variable - new guy here problem have easy solution, can't seem manage. so, have big list of files need process using same command line program, , i'm trying write little shell script automate this. wrote read input file name text file, , repeat command each of files. far good. problem though naming output. each file named in general format "lane_number_bla_bla_bla", , processed in pairs. so, there "lane_1_bla_bla_bla_001" , "lane_1_bla_bla_bla_002" need combine single output file. this, i'm trying utilize awk read sample number .txt list of input files , parse output file number. here's code came (note echo statement before command there testing; it's removed when comes run actual program; not actual command rather more complicated, principle still applies): echo "which input1 should use?" read text input1=$text echo "which input2 should use?" read text input2=$text echo ...

c# - best practices for application logging azure web applications? -

c# - best practices for application logging azure web applications? - i developing application using asp.net mvc 3, windows azure. looking suggestions error logging , application logging. i suggest utilize enterprise library , configure diagnosticmonitortracelistener writes table storage. you can find info on trace listener here: http://www.windowsazure.com/en-us/develop/net/common-tasks/diagnostics/ c# sql asp.net-mvc-3 azure azure-storage-tables

c++ - While trying to read a file opened for output only, the eofbit flag is set for the stream. Why is that? -

c++ - While trying to read a file opened for output only, the eofbit flag is set for the stream. Why is that? - #include <iostream> #include <fstream> using namespace std; int main() { fstream file("out.txt", ios_base::app); file.seekg(0, ios_base::beg); char buffer[100]; if( !file.getline(buffer, 99) ) cout << "file.failbit " << boolalpha << file.fail() << " file.eofbit " << file.eof() << '\n' << "file.badbit " << file.bad() << " file.goodbit " << file.good() << '\n'; } output the standard prohibits reading file opened output. paragraph 27.9.1.1.3 on basic_filebuf (part of underlying implementation of fstream ): if file not open reading input sequence cannot read. one hence expect see failbit when trying read file open writing. standard says eof...

iphone - ios echo cancellation on audio bitstream for voip -

iphone - ios echo cancellation on audio bitstream for voip - i'm developing ios voip application. quality of phone call quite sub-standard due ambient noise when create call. noise comes through app. i need help understanding ios frameworks / libs utilize help me ambient / echo cancellation streaming audio -- raw bitstream. read parts of multimedia framework stuff on ios there's little info on sound streams, of docs focus on sound files. can create utilize of standard ios sound libraries cancel ambient noise during voip call? how standard ios libs different speeq library? there setting called kauvoiceioproperty_voiceprocessingquality can set adjust level of suppression apply sound units.    here link apple's article. technical q&a qa1683 iphone ios sip voip audio-streaming

Accessing MATLAB's unicode strings from C -

Accessing MATLAB's unicode strings from C - how can access underlying unicode info of matlab strings through matlab engine or mex c interfaces? here's example. let's set unicode characters in utf-8 encoded file test.txt, read as fid=fopen('test.txt','r','l','utf-8'); s=fscanf(fid, '%s') in matlab. now if first feature('defaultcharacterset', 'utf-8') , c engevalstring(ep, "s") , output text file utf-8. proves matlab stores unicode internally. if mxarraytostring(enggetvariable(ep, "s")) , unicode2native(s, 'latin-1') give me in matlab: non-latin-1 characters replaced character code 26. need getting access underlying unicode info c string in unicode format (utf-8, utf-16, etc.), , preserving non-latin-1 characters. is possible? my platform os x, matlab r2012b. addendum: documentation explicitly states "[mxarraytostring()] supports multibyte encoded characters...

java - Gilead replacement to glue GWT and Hibernate together -

java - Gilead replacement to glue GWT and Hibernate together - till gilead looked best solution glue gwt , hibernate together. unfortunately, gilead project seems abandoned , not upgraded new gwt 2.5, makes replacement. do know of new project same thing gilead doing older versions of gwt? it's different programming model (using proxy objects instead of real actual info model objects), recommend using official gwt requestfactory replacement: https://developers.google.com/web-toolkit/doc/latest/devguiderequestfactory we've found much improve programming model doesn't forcefulness maintain model classes clear of server side code. believe has number of performance benefits automatically manages changes delta's rather reserialising entire object. java hibernate gwt gilead

html - CSS Footer Separation -

html - CSS Footer Separation - i have fixed footer on page, consists of text , has no background image. have fixed background image positioned bottom right. wandering prevent content overlapping both footer , background image scroll downwards page. there anyway set padding between them while scroll? you can set padding-bottom height of footer main container. this: .footer { height: 150px; } .container { padding-bottom: 150px; } this prevent content under fixed footer. edit: here fiddle - http://jsfiddle.net/2kzyv/ when reach bottom of page, footer isn't on top of content bottom padding on container. html css position margin footer

Eclipse EGit: fetch/push never ends -

Eclipse EGit: fetch/push never ends - i utilize egit 2.2 eclipse juno. far has been more or less right. but 1 time team-mate has uploaded number of big files (over 2 gig) fetch , force operations never end me. (my network connection fast.) how can troubleshoot/resolve this? well, i'm not experienced git user. resolved problem straightforward way: created new eclipse workspace , cloned remote repository new workspace. fetch , force operations work okay now. eclipse push fetch egit

any way to launch extensions ? chrome.management.launchApp does not allow -

any way to launch extensions ? chrome.management.launchApp does not allow - i want run extension extension; chrome has nice management api , method chrome.management.launchapp not allow it, throws "is not app" error. yes it's not app, it's extension. you can enable/disable/uninstall! extension cannot launch it. there other way of doing it? google-chrome-extension

tcl - how to calculate buffsize of a output in bytes? -

tcl - how to calculate buffsize of a output in bytes? - router show command output execeeds 1000 lines...i trying capture in buffer.,i not sure of buffersize (which passed argument) how calculate i captured ouput in variable , checked string bytelength expect1.11> puts [string bytelength $ram] 836942 but passing buffersize 1200000 not capturing 3/4th output.., tired of increasing on , over.,, way other way calculate buffersize tcl

svn - Incremental Backup in tortoisesvn -

svn - Incremental Backup in tortoisesvn - i have execute incremental backup svn repositry on daily basis. don't want automate it, manual command/script execution work me. tell me command/script used incremental backup? backing should not done via tortoisesvn; should instead done direct access repository. see http://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.backup svn tortoisesvn

php - Facebook API - Get friends hometown -

php - Facebook API - Get friends hometown - im looking retrieve of friends hometowns, using similar php used retrieve names. think code im using should work think because users havent set hometown wont work , says each argument invalid (although wrong). when typing in url web browser next structure: { "id": "z", "friends": { "data": [ { "name": "x", "hometown": { "id": "x", "name": "x" }, "id": "x" }, which repeated every user in friend list, although friends without hometown next omitted: "hometown": { "id": "x", "name": "x" }, to retrieve name , birthday have used next php: $response2 = curl_exec($ch2); $user2 = json_decode($response2...

javascript - Cancel click handler from mousedown handler -

javascript - Cancel click handler from mousedown handler - i’m trying prevent click handler firing based on status within mousdown handler same element. consider this: var bool = true; $('button').click(function() { console.log('clicked'); }).mousedown(function(e) { bool = !bool; if ( bool ) { // temporary prevent click handler, how? } }); is there neat way cross-communicate between handlers? here bin: http://jsbin.com/ipovon/1/edit this works, although, i'm not sure it's quite reply looking for. it's double click function, if set bool=false; initially. var bool = true; $('button').mousedown(function(e) { bool = !bool; if ( bool ) { $(this).unbind('click'); } else { $(this).click(function(){ console.log('clicked'); }); } }); update also, pull click function out of mousedown this, if like: var bool = true; function buttonclick(){ console.log('clicked...

xaml - Delegate.Target is null on WinRT -

xaml - Delegate.Target is null on WinRT - as know, delegate has 2 properties, 1 method infor , other target object. unusual on winrt. if view model implement inotifypropertychanged below: public class propertychangedviewmodel : inotifypropertychanged { public event propertychangedeventhandler propertychanged { add together { /*some code add together handler of value*/ } remove { /*some code removehandler of value*/ } } } in method "add" , "remove" find value.target null when event used internal code of xaml binding. say, if bind property of view model on xaml file, winrt automaticlly register event propertychanged of view model, , add together method call, placed break point in add together method , find target of value null. i'm implementing cross platfrom mvvm library (for wpf, winrt, silverlight , wp 7+) can't utilize propertychangedeventmanager, have manually maintain weak reference target , invoke method tar...

Developing apps for Windows 8 pro -

Developing apps for Windows 8 pro - i developing application windows rt using c# tablets. due insufficient apis device management(device screen lock, n/w config, restrict camera, etc.,.) our client has decided shift windows 8 pro. have template developing tablet apps windows 8 pro(i using c# xaml in "windows store apps" templates win rt), or how create tablet apps windows 8 pro. a windows store app stays windows store app - either way, develop rt/pro or desktop. can utilize windows 8 desktop app , run on pro machine. can sell desktop app through store! windows-store-apps

Codeigniter load model in library -

Codeigniter load model in library - i using codeigniter 2.1.3 i trying load model library. code in build in library looks this $this->ci=& get_instance(); $this->ci->load->database('default') then in 1 of library methods when tried line below doesnt work $this->load->model('model_name') but when tried this $this->ci->load->model('model_name','',true) it works, can explain instance of ci refers , 2 parameters when loading model? in advance. a library not part of way codeigniter works. it homemade library, solve task want done in ci application. this means if want utilize of ci's helpers, models or other libraries, need through ci instance. achieved doing this: public function __construct() { $this->ci =& get_instance(); } by assigning instance librarys fellow member named ci, ci related helpers, models , libraries can loaded through $this->ci . trying $this re...

Virtualbox: Using firewall in ubuntu guest -

Virtualbox: Using firewall in ubuntu guest - i have windows 7 pro host ubuntu server 12.10 guest. host has static ip. networking mode nat port forwarding host port 22 invitee port 22. don't want utilize use bridged networking because of company policies. i need ssh (port: 22) invitee net , want limit inbound connections invitee port 22 ip addresses. enabled ufw in invitee , added rules it. when seek ssh invitee 1 of allowed ip addresses, it's not connecting. if disable ufw, works. what wrong? don't know much nat , invitee firewalls. thanks in advance response. this normal, because invitee vm (ubuntu) receive connection nat gateway ip (ie host (win7) address) , not client connecting ssh. to solve issue , need remove ufw rules , set same rules in host windows firewall. virtualbox firewall nat

c - debugging linker errors (undefined symbols) -

c - debugging linker errors (undefined symbols) - i'm trying link executable external library called libr. i'm not looking help library specifically, linker error, pasted below: undefined reference `r_asm_new()' ok, double check link command: -lr_core -lr_config -lr_cons -lr_cmd -lr_util -lr_flags -lr_asm -lr_lib -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_sign -lr_diff -lr_socket -lr_fs -lr_magic -lr_db and seems contain libraries libr bundle has. double the libr_asm.so file objdump: $ objdump -t libr_asm.so.0.9.3git | grep r_asm_new 00000000000ca66a g df .text 0000000000000149 base of operations r_asm_new so far can tell -l_asm flag should have done it. i'm linking c library c++ executable, can't think of how alter situation. thanks. edit: total link line: /usr/bin/c++ cmakefiles/main.dir/main.cc.o cmakefiles/main.dir/elffile.cc.o cmakefiles/...

winapi - How to read WPD MTP data stream asynchronously? -

winapi - How to read WPD MTP data stream asynchronously? - my sample application gets com istream instance iportabledeviceresources::getstream() function. want read device object contents asynchronously using istream object. how can using asynchronous moniker? istream synchronous design. first inquire scenario needing asynchronous. for example, if reason wanting asynchronous info stream won't block ui thread, can perform istream operations in worker thread. if reason can issue multiple parallel reads, mtp 1.0 devices don't back upwards because @ driver level, requests still processed sequentially in single, global, mtp session. mtp 2.0 supports multi-session allows multiple parallel connections same device, far not many devices have adopted this. most, if not all, mtp devices in market mtp 1.0. winapi com wpd moniker

algorithm - How to draw only the visible pixels which are >0% alpha with a custom color in canvas? -

algorithm - How to draw only the visible pixels which are >0% alpha with a custom color in canvas? - i create performance nail test png images , other shapes. don't care shapes because technique there no performance issues @ checking (not setup). i intent collect images on screen in secondary canvas nail test. each image drawn create new color attached particular image. draw of them in canvas, each image have different fill color. when click on pixel (x, y) color (r, g, b). every color mapped image, image clicked no error (i don't waste finding nail click). i know limited 256*256*256=16 777 216 items because colors don't think problem now... so need know how set fill colors on secondary canvas based on visible pixels each image. update can see right it's nail test map. if click on black shade (c) instantly know i've clicked on bluish box without other calculation. one improvement cache alpha data. reuse same alpha info each imag...

backbone.js - d3.js force layout namespace in a backbone view -

backbone.js - d3.js force layout namespace in a backbone view - i'm working on medium-complex app using backbone.js handle wordpress data, , can't figure out how forcefulness working in backbone layout. basically, i'm trying instantiate forcefulness layout within backbone boilerplate layout, this: mylayout = backbone.layout.extend({ initialize: function() { var f = this; // i.e. layout instance f.force = d3.layout.force() .nodes(mymodels) .on("tick", f.tick) .gravity(0) .friction(0.9) .start(); console.log(f.force); }, tick: function() { // stuff when forcefulness ticks } }); the problem forcefulness beingness defined blank functions, gravity: function(x) { //lots of null things here } . i'm pretty sure it's namespacing issue, nil seek works - i've tried doing $(window).force , var force , $this.force ... in illustration t...

How do I tell a GWT cell widget data has changed via the Event Bus? -

How do I tell a GWT cell widget data has changed via the Event Bus? - i have gwt cell tree utilize display file construction cms. using asyncdataprovider loads info custom rpc class created. have web socket scheme broadcast events (file create, renamed, moved, deleted etc) other clients working in system. what trying wrap head around when recieve 1 of these events, how correctly update cell tree? i suppose problem analogus having 2 instances of cell tree on page, presenting same server-side info , wanting ensure when user updated one, other updated well, via using eventbus . i sense should pretty simple have spent 6 hours on no headway. code included below: note: not using requestfactory though may custom rpc framework. also, fileentity simple representation of file has name accessible getname() . class="lang-java prettyprint-override"> private void drawtree() { // fileservice injected before on , own custom rpc service treeviewm...

Manage Future Event Notification Using Node.js, Redis, and CouchDB -

Manage Future Event Notification Using Node.js, Redis, and CouchDB - i'm trying manage date/time event notifications using node.js on server. there programming pattern can utilize , apply javascript? currently, i'm using named settimeouts , redis store boolean value each timeout. when timeout fires checks redis boolean value. if returns true, notification executes. if value returns false, means user has removed event , there no notification. this solution works, don't believe scale-able several reasons: 1) events days away. don't trust redis store these event long.2) there potentially thousands of events , don't want settimeouts running on place. after event removed. i know problem has been solved, i'm hoping can point me resource or offer mutual pattern. are looking node-cron? node.js events calendar redis couchdb

php - Checking one variable against multiple values? -

php - Checking one variable against multiple values? - currently, i'm doing this: class="lang-php prettyprint-override"> if ( in_array ( $variable, ["a","b","c"] ) ) { ... } which reads little easier than if ( $variable == "a" || $variable == "b" || $variable == "c" ) { ... } but wondering, there more efficient ways, instead of checking value in array? try this $my_array = array_flip(array('a', 'b', 'c', 'd', ...)); if (isset($my_array[$variable])) ... this has one-time o(n) cost create $my_array, checking match o(1). php arrays if-statement

heroku - Web service for location data -

heroku - Web service for location data - i'm trying design web service on heroku collects gps locations many people in regular time intervals. apart of keeping track of each person's location @ particular moment, i'd able query who's within range/radius. i have thought of how using quad trees, want create sure there isn't add-on service such won't reinventing wheel. any help appreciated! thanks! postgresql postgis supported on heroku , need. looks spatialdb in private alpha, might want seek , invite that. mongodb supports spatial indexes, if prefer should check out mongodb add-ons on heroku. heroku geolocation foursquare distance quadtree

couchDB: view that returns NOT NULL values, doesn't return NULL values -

couchDB: view that returns NOT NULL values, doesn't return NULL values - i have couchdb database 2 types of documents. document has x items, document b has -y items. every product has id, single document a, , many document b's associated it. (think of inventory. document has how many items @ start. document b represents sale/breakage etc). i need produce view returns id's of products positive sum of items. i have written map cut down so: map: function(doc) { if (doc.type === "delivery") { emit(doc.productid, doc.items ); } if (doc.type === "sale") { emit(doc.productid, -(doc.items)); } } reduce: function(keys, values) { var total = sum(values); if (total > 0) { homecoming total } } when queried, returns whole lot of null values products don't have in stock. returns positive numbers have. if query view, huge list of {productid: null} pairs. i've used list, doesn't...

Is my CSS padding displaying incorrectly? Or have I got my syntax wrong? -

Is my CSS padding displaying incorrectly? Or have I got my syntax wrong? - i'm setting padding values h1 , p in css follows: h1 { padding-left: 30px; padding-right: 30px; } p { padding-left: 33px; padding-right: 135px; padding-bottom: 30px; } but there seems form of preformatted padding in table used in because top shows indent padded 30px, when there none in table's css. doing wrong? here's image explain mean: the padding above "title" in code. thanks, oliver might need reset default margins on h1 element h1 { margin:0; padding: 0 30px; } css padding

dojo - memory leak in a chart create/render/destroy cycle -

dojo - memory leak in a chart create/render/destroy cycle - i have basic chart2d question. isn't chart.destroy() supposed remove , clean-up memory? if yes, why next code becomes memory hog? please note won't see chart because it's destroyed instantly. using google chrome's task manager @ memory usage, , after 20 minutes goes beyond 200mb. i know updateseries(), that's not want, graph properties may alter in each iteration (title, axes, plots, data, colors, etc.), figured easiest way destroy chart , recreate again. , if there improve way solve problem i wondering what's best way rid of chart , memory bindings? one side note: if remove addplot, addaxis, , addseries lines (so new, render, , destroy left), you'd still same, high memory usage. also, using 1.8.0. thanks, <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript" src="dojo/dojo.js" djconfig=...

Is there anyway to get info on a BLOB field in Oracle? -

Is there anyway to get info on a BLOB field in Oracle? - i importing info oracle db neither made nor administered myself. there might blob fields in data. assuming field title not description field's contents , there no blob_type field, there anyway know or guess kind of binary info beingness stored? basically, how tell difference between image stored in blob field versus perhaps big amount of text. i suppose less of oracle blob thing , more of 'how parse , interpret binary info no prior info' thing. i apologize, either unusual question or rather silly 1 , reply 'no', figured i'd inquire anyway. if helps, plan utilize cx_oracle python import, though uncertainty that's relevant. thanks time, have day. oracle database doesn't have mechanisms rendering blob other raw string has no involvement in beingness able figure out whether word document or angry birds ios6. having said which, investigate oracle's multime...

php - how to count the number of wget requests? -

php - how to count the number of wget requests? - is there way count how many times linux administrator performs wget number of files? or have produce special .sh script connect db , manually update database record? php wget

ruby on rails - record not found but not sure how - how to get back specific sql call raising this? -

ruby on rails - record not found but not sure how - how to get back specific sql call raising this? - i think subject says all. work? class applicationcontroller < actioncontroller::base rescue_from exception, :with => :bad_call def bad_call # how log specific sql activerecord::recordnotfound end end sorry vague question should clear question , tremendous help. how log info esp in development? ths in advance if did understand right should it. rescue_from activerecord::recordnotfound |exception| rails.logger.info exception end i'd suggest reading topic why bad rescue exception. upd: oh, guess i'm wrong. won't give sql query if need. ruby-on-rails rails-activerecord

c# - Getting Cross-thread operation Exception in Outlook add-in -

c# - Getting Cross-thread operation Exception in Outlook add-in - im developing outlook-2010 addin. the main addin class launching asynchronous task , declaring static event suscribe other form: int procesadosarchivado = 0; public delegate void onfilearchiveddelegate (int numfilesarchived, string namearchived); public static event onfilearchiveddelegate onfilearchivedevent = delegate { }; private void thisaddin_startup(object sender, system.eventargs e) { thread hiloarchivado = new thread(doarchivebackground); hiloarchivado.start(); } private void doarchivebackground() { seek { outlook.application app = null; outlook._namespace ns = null; outlook.mailitem item = null; //outlook.mapifolder inboxfolder = null; datetime mydatetime = datetime.now.addmonths(-3); ...

type conversion can not have aggregate operand (error in modelsim) -

type conversion can not have aggregate operand (error in modelsim) - i'm novice vhdl. i'm getting next errors while compiling in modelsim6.5b type conversion(to g) cannot have aggregate operand, no feasible entries infix operator "and", target type ieee.std_logic_1164.std_ulogic in variable assignment different - look type std.stadard.integer any help on these , reason behind helpful. this bundle i've written library ieee; utilize ieee.std_logic_1164.all; utilize ieee.std_logic_unsigned.all; bundle enc_pkg constant n : integer := 1; constant k : integer := 2; constant m : integer := 3; constant l_total : integer := 10; constant l_info : integer := 10; type t_g array (1 downto 1, 3 downto 1)of std_logic; signal g:t_g; type array3_10 array (3 downto 1, 10 downto 0) of std_logic; type array2_10 array (2 downto 1, 10 downto 0) of std_logic; procedure rsc_encod...

django - Captured URL parameters in form -

django - Captured URL parameters in form - i using userena , trying capture url parameters , them form i'm lost how this. what in template is: <a href="/accounts/signup/freeplan">free plan</a><br/> <a href="/accounts/signup/proplan">pro plan</a><br/> <a href="/accounts/signup/enterpriseplan">enterprise plan</a><br/> and in urls.py url(r'^accounts/signup/(?p<planslug>.*)/$','userena.views.signup',{'signup_form':signupformextra}), then, ideally, i'd utilize planslug in forms.py set user plan in profile. i'm lost how captured url parameter custom form. can utilize extra_context, have override userena signup view? if utilize class based views, can overwrite def get_form_kwargs() method of formmixin class. here can pass parameters need form class. in urls.py: url(r'^create/something/(?p<foo>.*)/$', mycreateview.as_vie...

svm - How can i retrieve most similar images inside a Support Vector Machine's class? -

svm - How can i retrieve most similar images inside a Support Vector Machine's class? - when predict class belongs image in svm in scikit learn ... print "predicting on 1 sample" print "input features:" fv = [0.16666666666628771, 5.169878828456423e-26, 2.584939414228212e-22, 1.0, 1.0000000000027285] print fv print "predicted class index:" print clf.predict([fv]) output: predicted class index: [5] how can 5 similar images within class? i don't thing can similarity measure between samples svm, distance sample hyperplane used classification. you calculate euclidean distances between feature vectors of images using scipy.spatial.distance.pdist method. 5 images shortest distance target image can considered similar. hope helps. svm scikit-learn

javascript - Coffeescript ternary if-statement wrong logic -

javascript - Coffeescript ternary if-statement wrong logic - i have pretty much simple logic in homecoming function, doesn't work expected. of course of study can create code longer , solve issue, want little possible. here code: #return title if exists or false otherwise getpagetitlefrommaincontent = (maincontent) -> maincontent.find('#pagetitle') ?.length ?= false if y = (getpagetitlefrommaincontent $("#maincontent")) y.css color:red as see, if finds #pagetitle in #maincontent, should create red. function doesn't homecoming #pagetitle if found, returns .length. from js2coffee.org see code compiled into: var getpagetitlefrommaincontent, y; getpagetitlefrommaincontent = function(maincontent) { var _ref, _ref1; homecoming (_ref = maincontent.find('#pagetitle')) != null ? (_ref1 = _ref.length) != null ? **_ref1 : _ref.length = false : void 0;** }; if (y = getpagetitlefrommaincontent($("#maincontent"))) { ...

xcode - iphone- Google Calendar -

xcode - iphone- Google Calendar - in app, want utilize google calendar. requirement mail service id , events user. , want display events (events means user given in app) particular given mail service id (username mail service calendar). without using iphone ical. want straight add together particular mail service calendar. (for instance: mail id: xx@gmail.com, event: "title:"meeting" on date: "6-2-2013"" - info app). want go xxx@gmail.com , want show events (meeting on 6-2-2013) in mail service calendar. how can without using ical? iphone xcode cocoa-touch google-calendar

Could not able start rails server when upgrading from 3.0.7 to 3.2.11 -

Could not able start rails server when upgrading from 3.0.7 to 3.2.11 - i using ruby 1.8.7 , tried upgrade rails version 3.0.7 3.2.11 existing application. have installed relative gems , bundle install finish when start rails server using rails s, showing me errors. rails s => booting webrick => rails 3.2.11 application starting in development on ..... => phone call -d detach => ctrl-c shutdown server exiting /var/lib/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': no such file load -- journey (loaderror) /var/lib/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' /var/lib/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' /var/lib/gems/1.8/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' /var/lib/gems/1.8/gems/actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:1 /var/lib/ge...

Linux Alias, what's wrong with it? -

Linux Alias, what's wrong with it? - i've got alias: alias gi='grep -r -i $1 ./*' when gi somestring it grep, on other string provide, "p/ or other such thing in it. i'm using similar grepping history: alias gh='history | grep $1' which works perfectly. edit: on /bin/bash shell, per echo $shell. thanks! the alias mechanism simply substitutes word. other words on same line left in place, typically 1 replaces command , leaves arguments. doesn't work grep illustration because want rearrange line. now, $1 refer shell process (or shell function) parameters, in either case, not words typed on same line. you improve served in case shell function, should work on posix shell including bash. gi () { grep -r -i "$1" ./* } linux alias

google maps - How to listen for maprender inside update record -

google maps - How to listen for maprender inside update record - im loading google map , want display route. when set listeners bellow map works fine. { xtype: 'map', flex: 1, mapoptions: { zoom: 13, maptypeid: google.maps.maptypeid.roadmap, }, listeners: { maprender : function(comp, map){; var directionsdisplay = new google.maps.directionsrenderer(); var directionsservice = new google.maps.directionsservice(); directionsdisplay.setmap(map); var start = 'new york'; var end = 'chicago'; var request = { origin:start, destination:end, travelmode: google.maps.directionstravelmode.driving ...

java - Moving an object towards a point android -

java - Moving an object towards a point android - i have in initialization of bullet object: x = startx; y = starty; double distance = math.sqrt(((endx - x) ^ 2) + ((endy - y) ^ 2)); speedx = (6 * (endx - x)) / distance; speedy = (6 * (endy - y)) / distance; it goes touch on screen, farther away touch, faster goes. works fine on paper, i've tried different lengths , should work, bullets need move 6 pixels on line player point touched every step. , update method moves of course. why bullets move @ different speeds? if remember java operators... replace double distance = math.sqrt(((endx - x) ^ 2) + ((endy - y) ^ 2)); with double distance = math.sqrt(math.pow(endx - x, 2) + math.pow(endy - y, 2)); java android

grep - awk - assign variables from multiple sources -

grep - awk - assign variables from multiple sources - i want print output combination of multiple file content. example: grep -v 'word' file_a | awk -v var1="string1" -v var2="string2" -v var3="string3" '{ print $1 var1 var2 var3}' i can command above: assign specific strings variables , print grep 'ed content. if string1/2/3 's long it's quite complicated assign such long words. question: if write string1/2/3 single lines file_b how can assign such file_b lines variables? example: cat file_b string1 string2 string3 why not set in awk script instead of variables: class="lang-bsh prettyprint-override"> $ cat script.awk !/word/ { var1="string1" var2="string2" var3="string3longlonglonglonglonglong" print $1,var1,var2,var3 } $ cat file word no match match1 word no match match2 match 123 $ awk -f script.awk file match1 str...

game engine - Integrate Ren'Py into GameMaker(by YoYogames) -

game engine - Integrate Ren'Py into GameMaker(by YoYogames) - as title mentioned want know how integrate ren'py engine gamemaker yoyogames. i'm in competition have create own game in gamemaker programme want utilize digital storytelling ren'py. thought how that? thanks in advance! wouter wrap ren'py within dll (with c-function gamemaker call). though remember gm limited in extensions can (basically either take on finish drawing of game or leave drawing gm , utilize dll pass strings/numbers only). though 1 time start doing question becomes "why utilize gm" - , " can phone call game made gamemaker". game-engine game-maker