Posts

Showing posts from March, 2012

php - Get results from Instagram API to use in Wordpress -

i have been reading on basic authentication on instagram client(app). gather on reading curl best option threads saying. found instagram php api wrapper on gihub dont think need go route need. what trying this: a function checks current users meta 'instagram_user' (instagram user id) , 'instagram_token' (access token). if usermeta not set, meaning have not authorized client yet, shows link authorization url. click link, authorize app , return our site. need know how retrieve data once return can use add_user_meta save token , id user_meta tables. //get current user $user_id = get_current_user_id(); $instagram_userid = get_user_meta($user_id, 'instagram_user', true); $access_token = get_user_meta($user_id, 'instagram_token', true); if(!$access_token || !$instagram_userid){ echo '<p style="text-align:center;">you need authorize instagram in order see feed here.</p><p><a class="btn btn-success&

c# - Azure Publish Database First Connection String Not Working -

i have gone through steps publish web app using database first on azure portal. however, when publish error message: code generated using t4 templates database first , model first development may not work correctly if used in code first mode. continue using database first or model first ensure entity framework connection string specified in config file of executing application. use these classes, generated database first or model first, code first add additional configuration using attributes or dbmodelbuilder api , remove code throws exception. my connection string in web.config after has been modified publish: <add name="mysiteentities" connectionstring="metadata=res://*/mysite.csdl|res://*/mysite.ssdl|res://*/mysite.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=tcp:**********.database.windows.net,****;initial catalog=mysite;user id=username@**********;password=*******;multipleactiveresultsets=true&

parsing - Spreadsheet.open in Rails gives this error "unknown encoding name - MACINTOSH" -

i using spreadsheet parse xls files. it's working great. today 1 of user has uploaded file , it's getting error "unknown encoding name - macintosh" my code is: book = spreadsheet.open file_path sheet1 = book.worksheet 0 this excel file getting error: https://www.dropbox.com/s/jv37pk5rpiy9259/testlisttextnonames2.xls can guys please me solve issue. running same problem. here best can deduce: "macintosh" not known encoding in ruby 1.9+. try opening console , running "encoding.find('macintosh')". you'll same error. so available? in console: "encoding.list". 1 of options macroman. i'm guessing close second. so if change mapping in lib/spreadsheet/excel/internals.rb 10000 , 32768 map "macroman", should work. tested locally , does. i opened pull request: https://github.com/zdavatz/spreadsheet/pull/51 some reference links: * https://en.wikipedia.org/wiki/mac_os_roman * http://bugs.pyt

javascript - Bootstrap table: is it possible to call the function which sorts rows by column from code (without clicking the header) -

http://jsfiddle.net/e3nk137y/4537/ <table data-toggle="table" > <thead> <tr> <th data-field="fruit" data-sortable="true">item</th> <th data-field="date" data-sortable="true">date</th> <th data-field="type" data-sortable="true">type</th> </tr> </thead> <tbody> <tr><td>pear </td><td data-month="1">january</td> <td>fruit</td></tr> <tr><td>carrot</td><td data-month="3">march</td> <td>vegetable</td></tr> <tr><td>apple </td><td data-month="2">february</td><td>fruit</td></tr> </tbody> </table> in fiddle example of table. when click header, table sorted column belo

python - Wrapping long y labels in matplotlib tight layout using setp -

Image
i've been trying wrap text long labels in code. tried textwrap method suggested earlier here , code defines yticklabels through array imported csv using pyplot.setp() method. i'm using tight_layout() formatting otherwise. so question - there way wrap long y labels newlines easily? here sample code i'd fix for: import numpy np import matplotlib.pyplot plt labels=('really really really long label 1', 'really really really long label 2', 'really really really long label 3') values=(30,50,40) fig = plt.figure() ax=fig.add_subplot(111) plt.ylim((0,40)) in np.arange(3): plt.barh(15*i, values[i]) plt.yticks(15*np.arange(3)) plt.setp(ax.set_yticklabels(labels)) plt.tight_layout() plt.show() this plots i'd labels go newlines after fixed width. ideas? i have tried using textwrap on labels , works me. from textwrap import wrap labels=['really really really long label 1', 'really really really long labe

linux - Nested grep with SSH -

i have following shell command runs successfully: sed -e "1,/^$(date -d -24hour +'%y-%m-%d %h')/d" logfile | grep -a20 -b10 'exception' | mail -s "sample report" xyz@yourdomain however, have ssh particular machine run this. avoid this, modified in following way leads failure: ssh myserver 'sed -e "1,/^$(date -d -24hour +'%y-%m-%d %h')/d" logfile | grep -a20 -b10 'exception' | mail -s "sample report" xyz@yourdomain ' what wrong command? how can fix this? embed code in quoted heredoc avoid needing modify (which error-prone process nature): ssh myserver 'bash -s' <<'eof' sed -e "1,/^$(date -d -24hour +'%y-%m-%d %h')/d" logfile \ | grep -a20 -b10 'exception' \ | mail -s "sample report" xyz@yourdomain eof in specific case here, obvious reason original modifications failed internal single quotes terminating ones surroun

joomla - Can't save filenames into the database with JInput -

i have form input fields of type text , file. have problem of filenames not saving in database else does. vardumped $myform , there files, created array filenames , merged $myform. tried set 'jform' doesn't seem working. have ideas why? thanks! controller.php function save() { $jinput = jfactory::getapplication()->input; $myform = $jinput->get('jform', null, 'array'); //$files = $jinput->files->get('jform'); $file_array = ['image1' => 'test.png', 'image2' => 'test2.png']; $merged_array = array_merge($myform, $file_array); $jinput->set('jform',$merged_array); //or $jinput->post->set('jform',$merged_array); (this doesn't work either) return parent::save(); } do not use $_post unless plan on writing extensive validation code secure user input. instead, us

d3.js - How to use CSV data in d3 -

what want do my csv looks this ,,name,first names,s,r,nat,born,starting point,starting date,arrival date,days,km,assist,support,style,note,arrival date 2 1,1,kagge,erling,,,nor,1/15/1963,berkner island,11/18/1992,1/7/1993,50,appr. 1300,n,n,solo,first solo unassisted, 2,2,arnesen,liv,f,,nor,6/1/1953,hercules inlet,11/4/1994,12/24/1994,50,1130,n,n,solo,first woman unassisted, 3,3,hauge,odd harald,,,nor,1956,berkner island,11/4/1994,12/27/1994,54,appr. 1300,n,n,,, how should import csv able access data such as .text(function(d) { return d['starting point']; }); what i've tried i have tried nesting data d3.csv("data.csv", function(csv_data) { var data = d3.nest() .key(function(d) { return d.name; }) .entries(csv_data) console.log(data); which in console looks this: 0: object key: " dickinson" values: array[2] 0: object assist: "n" first names: "conrad" name: &qu

Regarding VB6 - Environment variable -

regarding vb6 : want call 1 batch file using environment variable, trying following code think thing missing why not working : code : dim spathuser string spathuser = environ$("windir") msgbox spathuser shell "spathuser\test.bat" ---> here m calling batch file so, can 1 me out please? use shell spathuser & "\test.bat"

mysql - select statement with where condition (select all or some) -

i have following tables: images: imageid userid translated theimage -------------------------------------------- 1 2 1 image1 2 3 0 image2 3 3 0 image3 4 3 0 image4 5 3 1 image5 and translationchains: imageid sourcelang targetlang ------------------------------------ 1 2 3 2 4 1 3 5 1 4 4 2 5 1 4 now have 2 options: want either choose images wasn't translated specific user in language or choose images user wasn't translated in specific language. i have following query first option: "select images.imageid, images.theimage, images.translationrating images images.userid=? , images.translated =0" and second option have: "select images.imageid, images.the

java - Generating Unique sequence number in mule -

i have requirement in project. want generate increasing unique sequence number mapped specific field(interchange id ) output xml file. customer wants generate alert around number. specific number should be 1. unique 2. increasing. so have 2 approach case i generate sequence of oracle sequence. problem again not want unnecessarily hit database. will genearate in java of static variable. feel not full proof. think if application or server restarts static variable start form 0 again. in case number not unique. so question is, if can in mulesoft or idea apreciated tia. use static field, grab value database. given there's no requirement numbers need consecutive, can increment database value f.e. 100 each time, need hit database every 100th number need produce.

excel - How to add 2 different times in VBA? -

i need convert gmt utc time , add 2 different times. here code have : dim curdate, correction, utctime date curdate = format(datetime.now, "yyyy-mm-dd hh:mm:ss") utctime = dateadd("h", 4.5, curdate) however adding integer part of hours i.e., 4 , not 4.5 any idea, how achieve ? try this utctime = dateadd("n", 4.5 * 60, curdate)

group by - Aggregate functions on windows azure storage tables -

i have windows azure storage table in storing more 1000k+ rows(entities). wants perform few aggregate functions on table counting on specific column specific condition, average , total , min , max , group by (as in normal sql). how can in windows azure storage tables? the way pretty pull down entities , run aggregates on them in memory. if have keep information date store these aggregates in place , update them every time new entity added. instance average sum/count can have table item stores current sum , count , when add new entity update sum , count values. make sure use optimistic concurrency can catch race conditions etc. if table entities share same partition key can operation on same transaction.

Hung mail notification in Jenkins Pipeline or Workflow -

i have created test workflow below: node("master") { ws("/opt/mount1/jenkins/jobs/googleflow/workspace/${env.build_number}") { try { stage name: 'sync', concurrency: 3 echo "before sync" sh '''touch buildfile echo "this ${build_number}" >> buildfile cat buildfile''' sh "sleep 5" echo "after sync" sh "date" stage name: 'build', concurrency: 1 echo "before build" sh "date" sh '''sleep 10 cat buildfile''' echo "build 1/3" sh "sleep 5" echo "build 2/3" sh '''sleep 5 cat buildfile''' echo "build 3/3" sh "date" stage name: 'test', concurrency: 3 echo "before test" sh "date" sh '''sleep 10 cat buildfile''' sh "date" stage name: 'delete',

symfony - Doctrine MongoDB - is there any way to build a query from JSON? -

i have arbitrary mongodb json find query string, example: { "address.city": "seattle"} or { qty: { $gt: 5, $lt: 50 } is there existing method create doctrine.mongodb.query object json string? or alternately query mongo directly , pass results doctrine hydration? is there existing method create doctrine.mongodb.query object json string? at moment no, add setquery method builder . more tedious, working, instantiating query class on own. or alternately query mongo directly , pass results doctrine hydration? once have plain arrays data (and you're not afraid dive unitofwork ) may utilize $dm->getunitofwork()->getorcreatedocument() or employ hydratorfactory , merge documents documentmanager later.

windows - Counting files using a batch file -

i tried following code in .bat file count number of files in directory: for /f %%a in ('dir /a-d /b /s | find /c /v ""') set filecount=%%a echo %filecount% pause however, doesn't work , doesn't pause. instead flashes ": unexpected @ time". if write dir /a-d /b /s | find /c /v "" pause it works fine , displays number of files want save number variable. doing wrong? you need escape pipe, @echo off /f %%a in ('dir /a-d /b /s ^| find /c /v ""') set filecount=%%a echo %filecount% pause

java - Find number coprime to modulus -

i've been doing research on rsa encryption system, it's pretty simple code 1 using small primes, there aren't many possibilities , performance not real issue. here's how rsa works: first, generate n value, product 2 primes picked randomly: n = p * q then need public key, called e . can number coprime φ(n): mcd(φ(n), e) = 1 according euler function , φ(n) = (p-1)(q-1) you still need private key, known d , inverse of e on modulo **φ(n) . so d * e = 1 (mod φ(n)) n , e public values, when d private key. nobody should know p or q , values possible φ(n) , , use calculate d . to encrypt message, use m = m^e (mod n) , m original message, , m encrypted one. so, can send encrypted message can read, using public values. to decrypt message, use d , it's inverse of e , m^d = (m^e)^d = m (mod n) . message can decrypted, using d . knowing this, encrypt message need 2 random primes, calculate n, e, d, , make our encryption , decryption methods.

homebrew - Trouble with brew install devil -

rgbdslam install asking devil $ rosdep install rgbdslam error: following packages/stacks not have rosdep keys resolved system dependencies: rgbdslam: no definition of [libdevil-dev] os [osx] but when try install devil i'm getting this: $ brew install devil error: devil cannot built available compilers. install formula, may need to: brew install gcc $ brew install gcc warning: gcc-5.3.0 installed how can around this? note: have xcode installed accompanied command line tools . ** edit libdevil installed ** for reason gcc 5 doesn't register when devil looking gcc had downgrade 4.9. $ brew rm gcc // removes 5 $ brew install gcc49 // installs 4.9 $ brew install devil // works $ brew install gcc // 2 gcc installed? might interesting rgbdslam still isn't detecting libdevil though, not sure deal is. here's helpful notes answers.ros.org i set siftgpu_disable_devil = 0 in siftgpu/makefile , set(env{sift_gpu_mode} 0) in cmakelists.txt

python - Trouble installing Theano (64 bit DLL error) -

i'm working on windows 7 64 bit laptop nvidia graphic card. wanted use lasagne uses theano. never have thought complicated :/ after failing miserable on own, tried follow tutorial: http://deeplearning.net/software/theano/install_windows.html - uses python2.7 wanted use newer 3.5 version (and don't think problem). did , @ end able call: >where gcc c:\tdm-gcc-64\bin\gcc.exe >where gendef c:\tdm-gcc-64\x86_64-w64-mingw32\bin\gendef.exe >where cl c:\users\user\appdata\local\programs\common\microsoft\visual c++ python\9.0\vc\bin\amd64\cl.exe >where nvcc c:\program files\nvidia gpu computing toolkit\cuda\v5.5\bin\nvcc.exe >where python c:\winpython-64bit-3.5.1.1\python-3.5.1.amd64\python.exe c:\users\user\appdata\local\programs\python\python35-32\python.exe i think looks promising, checked , python.exe 64 bit version (i did size() check other thread). next downloaded theano , supposed call "python setup.py develop" said "unknown option dev

javascript - Safari 9.0.3 flickering issue on window.scrollTo() due to a early repaint on the way -

i'm experiencing odd behaviuor in safari. on quite content-rich page, upon specific user action (that requires relayouts , substitutions of elements on page) rebuild entire document call window.scrollto() move viewport calculated point. isolating problem found before window.scrollto() repaint occurrs (even if javascript still executing !) scroll performed causing flicker. the document first displayed new layout, -a frame later- displayed (with new layout) on new position. i explored variuos " safari flickers " questions (and answers) none of them covers issue i'm experiencing. the behaviour described bug of safari repaint must not occurr until javascript execution has terminated. the web page have solid color background. after experimenting found out using image background instead of solid color solves issue . the main document-sized <div> has background css property: background: #eee; replacing in-line png (a small square same c

css - "content" div height adapted to content. -

i have tabs , 'content' div height adapted height of content. have tried several things of them doesn't work, others work tabs separated of content. here code: html <div id="contenedor"> <input id="tab-1" type="radio" name="radio-set" class="tab- selector-1" checked="checked" /> <label for="tab-1" class="tab-label-1">pestaña1</label> <input id="tab-2" type="radio" name="radio-set" class="tab-selector-2" /> <label for="tab-2" class="tab-label-2">pestaña2</label> <input id="tab-3" type="radio" name="radio-set" class="tab-selector-3" /> <label for="tab-3" class="tab-label-3">pestaña3</label> <input id="tab-4" type="radio" name="radio-set" c

functional programming - What does the operator ! mean in F# -

what "!" operator means in f#? for example here let x = !a * !b yield x or here c := !c + 1.0 it's used dereference cell. check page.

How to setup the git mergetool with the --dir-diff option? -

difftool has great user friendly option viewing diffs. --dir-diff option - allowing abritrarly browse through 2 directories. the git mergetool has clumsy , unfriendly userinterface. solving merge conflicts has done in strict order given git. is there possibility setup similar option $ git difftool --dir-diff? $ git mergetool --dir-merge calling directory compare of e.g. winmerge? or 1 has alternativ solution provide user friendly interface solving multiple file merge conflicts? there simple python program called meld , visualises merges 3 panes do. to use merge resolution, have installed and, while in unresolved-merge in git, type: $ git mergetool . more on topic can read at: painless merge conflict resolution in git ...i have found tools , interfaces available performing merges not equip programmers sufficiently them effectively. often, programmer run git merge , hope git take care of large majority of hunks. of hunks conflict, usual merge strategy of human @

html - Why Have index.php in URI in CodeIgniter Call -

codeigniter gives example blog.php <?php class blog extends ci_controller { public function index() { echo 'hello world!'; } } and calls by example.com/index.php/blog/ question why have index.php in uri? you want know why there index.php in url? there simple answer, request under codeigniter given index.php resolves controller. 1 usally use mod_rewrite masks index.php. php interpreter not have concept of controller, maps uri file , gives post , parameters. need file which translates uri in controller call.

xml - Xpath incompatible with Internet Explorer -

i trying extract xml xpath. works firefox , chrome, but, doesn't work ie9. there trick or hack should do? can see here . here html: <!doctype html> <html> <body> <script> function loadxmldoc(dname) { if (window.xmlhttprequest) { xhttp=new xmlhttprequest(); } else { xhttp=new activexobject("microsoft.xmlhttp"); } xhttp.open("get",dname,false); xhttp.send(""); return xhttp.responsexml; } //xml=loadxmldoc("productfeed-production-version_sample.xml"); xml=loadxmldoc("data.xml"); //path="/products/product/category" path="root/article[3]/price" // code ie if (window.activexobject) { var nodes=xml.selectnodes(path); (i=0;i<nodes.length;i++) { document.write(nodes[i].childnodes[0].nodevalue); document.write("<br>"); } } // code mozilla, firefox, opera, etc. else if (document.implementat

JavaScript slider not going to next image -

can me out here copy same code 1 page , pasted on , page ive added , button's not display next image redirects me next.html? have changed directory image in. <table width="100%"> <tr> <td> <script type="text/javascript"> window.onload = initlinks; // create array of pictures/strings var mypics = new array("includes/img/slider/1.jpg", "includes/img/colleges/1/2.jpg", "includes/img/colleges/1/3.jpg", "includes/img/colleges/1/4.jpg", "includes/img/colleges/1/5.jpg");   // track displayed image, set 0 var thispic = 0;   // handle behaviors when next , previous links clicked function initlinks() {     // when prevlink clicked, call function fetch previous pic     document.getelementbyid("

iphone - Tabbar Start navigate from First Controller -

i creating tabbar application contains 2 tab bars, each contains navigation controller. when press first tabbar , traverse 3 subsequent navigation. getting calling/ interrupt since app going background (ios4). my question when start app double click home button, starts third navigation page & want start in firstviewcontroller. if goal restart app scratch @ every start up, add/change key uiapplicationexitsonsuspend yes in info.plist file here's relevant link in documentation

DynamoDB - How to do incremental backup? -

i using dynamodb tables keys , throughput optimized application use cases. support other ad hoc administrative , reporting use cases want keep complete backup in s3 (a day old backup ok). again, cannot afford scan entire dynamodb tables backup. keys have not sufficient find out "new". how do incremental backups? have modify dynamodb schema, or add tables this? best practices? update : dynamodb streams solves problem. dynamodb streams captures time-ordered sequence of item-level modifications in dynamodb table, , stores information in log 24 hours. applications can access log , view data items appeared before , after modified, in near real time. i see 2 options: generate current snapshot. you'll have read table this, can @ slow rate stay under capacity limits ( scan operation). then, keep in-memory list of updates performed period of time. put these in table, you'll have read those, too, cost much. time interval minute, 10 minutes,

functional programming - Function application for curried functions in JavaScript and ES6 -

i love ecmascript 6 allows write curried functions this: var add = x => y => z => x + y + z; however, hate need parenthesize every argument of curried function: add(2)(3)(5); i want able apply curried functions multiple arguments @ once: add(2, 3, 5); what should do? don't care performance. currying , application of curried functions controversial issues in javascript. in simple terms, there 2 opposing views, illustrate both briefly. - use of separate curry function when necessary the adaptation of concepts other languages or paradigms in principle thing. adaptation though, should done elementary means of target language. mean currying in javascript? curried functions called sequence of unary functions: add3(1)(2)(3); // 6 own functions manually curried arrows const add3 = x => y => z => x + y + z; third party functions or methods curried separate curry function - use of separate curry implementation default there's p

jcl - How to automate Batch monitoring jobs -

we have set of bmp's called batch monitoring jobs runs whole day ( execution status always) , bought running start job. we need see bmp's under execution status, want automate can monitor these bmp's , notify when down, can make them up. could please me how can proceed most mainframes have scheduling application jobs start either manually or there start conditions (in case condition time 6:00am) if there multiple jobs, there can conditions kick off other jobs.

how to select two table mysql use php -

ex: have 2 table: table 1: ________________________________ | id | name | born | |--------------------------------| | 1 | david | 1987 | | 2 | michale | 1998 | | 3 | mary | 1995 | -------------------------------- table 2 _________________________________ | userid | key | value | --------------------------------- | 2 | d of birth | 20-07 | | 2 | sex | m | | 3 | d of birth | 12-09 | | 3 | sex | fm | | 1 | d of birth | 20-01 | | 1 | sex | m | --------------------------------- how can select , add array as: array [0] [id] = 1 [name] = david [born] = 1987 [d o birth] = 20-01 [sex] = m [1] [id] = 2 [name] = michale [born] = 1998 [d o birth] = 20-07 [sex] = m ... i don't know why not use 1 table simple? 2 table faster query? many thanks! you need crossta

angular - Angular2: how bind to select multiple -

i'm able bind using ngmodel single select bind array multiple selected options. when attempt error cannot find differ supporting object 'xxx' in 'mymodelproperty' my code <select multiple [(ngmodel)]="mymodelproperty"> <option *ngfor="#item of myoptions" [value]="item.value">{{item.name}}</option> </select> here's multi-select list implementation supports two-way databinding. use @viewchild instead of getelementbyid() . @component({ selector: 'my-app', template: `{{title}}<p> <select #select multiple (change)="change($event.target.options)"> <option *ngfor="#item of myoptions" [value]="item.value"> {{item.name}} </option> </select> <br><button (click)="changeoptions()">select 1 , 3</button> <p>{{selectedvalues | json}}` }) export class appcomponent {

Strange C++ matrix multiplication/initialization -

i'm using cygwin, windows vista, norton anti-virus (someone asked me before). asked question strange c++ behavior no 1 answer. here's another. simple matrix multiplication exercise. form below gives strange (and wrong) results: #include <iostream> #include <string> #include<cmath> using namespace std; int main(int argc, char* argv[]) { int a[3][3]={{1,5,0},{7,1,2},{0,0,1}}; int b[3][3]={{-2,0,1},{1,0,0},{4,1,0}}; int d[3][3]; (int i=0;i<3;i++) { for(int j=0;j<3;j++) { (int k=0;k<3;k++) { d[i][j]+=a[i][k]*b[k][j]; } } } (int i=0;i<3;i++) { for(int j=0;j<3;j++) { cout<<d[i][j]<<"\n"; }} return 0; } but small change gives correct results: (all i've done move initialized matrices outside main() ). #include <iostream> #include <string> #include<cmath> using namespace std; int a[3][

erlang - Android smack 4.1 flooded with offline messages ejabberd -

i working on chat app using smack 4.1 , ejabberd-15.11 scenario - if client a,b,c,d send messages e , e offline messages stores in offline storage when user e comes online android client becomes unresponsive if number of offline stored messages in huge amount (3000-5000). please suggest me solution the default setting in ejabberd example config file limit number of offline messages 100. max_user_offline_messages: admin: 5000 all: 100 new messages rejected , sender notified error. if user admin expecting connect admin android, can configured ejabberd limit number of offline messages admin 100 messages.

ios - Setting UIScrollView Background Image -

i have scrollview takes full display size on view. want set background static image. don't want tile it, don't think can use backgroundcolor. also, don't want behind scroll view (setting scrollview transparent) because want bg scroll scroll view. any great. thanks! just add uiimageview same size scroll view's content size

whitespace - Is there any tool for adding white spaces for Typescript? -

i'm migrating codes js typescript. , quite annoyed errors white spaces. spaces after comments, , around equal. i understand , makes sense. think there automated tool or plugins white spaces. please advice me solution. [00:15:40] [gulp-tslint] error app/world/world.component.ts[53, 20]: missing whitespace and quite annoyed errors white spaces. spaces after comments, , around equal. typescript not error on these. perhaps using tslint . fix disable tslint or use grunt cleanup : https://www.npmjs.com/package/grunt-trimtrailingspaces or atom editor default.

javascript - setTimeout runs twice after the first iteration -

(var i=0; i<sequence.length; i++) { allowclick=false; function playtimeout(n) { settimeout(function() { _bubis[n].clicked(); }, i*1000+750); } settimeout(function(){allowclick=true},sequence.length*1000+750); playtimeout(sequence[i]); console.log(sequence); } problem: i'm doing simon's game, , when computer shows sequence, animation twice (_bubies.clicked()). happens when sequence.length @ least 2, , animtes twice regardless how long sequence is.

statistics - Bash: I have 2 country-level datasets in .csv format & would like to filter them for common elements & plot the result -

i took 2 data-sets country wikipedia, pasted them libreoffice calc & saved them .csv files. e.g: first .csv file: "algeria", 76 "angola", 100 ... "united arab emirates", 27 second .csv file: "algeria", .67 "argentina", .45 ... "zimbabwe", .57 i want filter lists countries datapoints in both .csv files (assume no duplicates or alternate spellings), match 2 datapoints (e.g. 76, .67 algeria) , output rudimentary scatterplot, quick visual idea of relationship. i tried lots of different ways parse files & of them worked kept getting tripped not knowing enough awk, grep, bash pipes, gnuplot , like. i'm sure it'd easier/better done in python or perl or somesuch , ended using "lookup" function in libreoffice calc, having started i'd know how done in bash. ideally, data-gathering automated parsing html these data-sets in pdf tables , on. any class of pointer appreciated. thanks.

ruby on rails - PaperClip Error NotIdentifiedByImageMagickError when scaling images -

i have been banging head against several days. recently, image uploader has stopped working properly. have investigated several possibilities, have none of suggested solutions have worked in case. the error message is: #<paperclip::errors::notidentifiedbyimagemagickerror:paperclip::errors::notidentifiedbyimagemagickerror> here details: mac os x 10.8.3 imagemagick 6.8.4-4 2013-03-29 libtool => /usr/bin/libtool rails 3.2.13 ruby 1.9.3p194 development.rb contains appropriate path (and have verified correct using which identify ) paperclip.options[:command_path] = "/usr/local/bin/" gemfile.lock (relevant portion) paperclip (3.4.1) activemodel (>= 3.0.0) activerecord (>= 3.0.0) activesupport (>= 3.0.0) cocaine (~> 0.5.0) model (i updating classroom object, picture resides in location model. (classroom has_one :location, :as => :locatable) model location.rb class location < activerecord::base ## paperclip metho

html - Incorrect flexbox display in Chrome 48 -

i'm having problem functionality of flexboxes in chrome. wanted make block picture , description in it, decided use flexboxex. have flexbox parent, has 2 child divs in it. first child take 30% of width, , latter 70%. problem chrome 48 doesn't keep image ratio , stretches height. how looks like chrome 48: flexbox display in chrome 48 but ok in chrome 39 , mozilla. how can workaround problem, or did make mistakes in code, displays incorrectly in actual chrome version? thanks! here fiddle code example .parent0 { display: flex; width: 100%; } .child1 { width: 30%; justify-content: center; align-items: center; display: flex; flex-direction: column; } .child2 { width: 70%; justify-content: center; align-items: center; display: flex; } .image { width: 50%; display: block; } <div class="parent0"

kill process - how to force stop all checked application from list view in android programmatically -

in below given code want kill (forcestop) checked applications after restarting application it's showing name of these killed applications again. i don't know if they're killed or not. why so? kill.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { //killing selected apps string savedapp; int code = 0; int count = lv.getadapter().getcount(); (int j = 0; j < count; j++) { if (lv.isitemchecked(j)) { intent ints = new intent(intent.action_main, null); ints.addcategory(intent.category_launcher); savedapp = lv.getitematposition(j).tostring(); nm.removeall(nm); // this.l = getlistview(); // l.setchoicemode(listview.choice_mode_multiple); packagemanager pm =

common lisp - Defining classes at runtime -

i trying write function takes list of classes (or class names) , returns class has given classes superclasses. should return same class again when given same list twice, using hash table memoization. can not use defclass purpose doesn't evaluate it's direct-superclasses parameter. didn't find corresponding function in hyperspec. there way can portably? just create defclass form , evaluate eval. you can use clos function ensure-class.

jquery - How to save radiobutton selected value in mvc when radio buttons are binded with database values? -

i have radiobutton in view. binding values radiobutton db. after selection using jquery want send selected value of radiobutton controller. here view code. @{ viewbag.title = "permmapping"; layout = "~/views/shared/_layoutc3card.cshtml"; list<c3card.dal.edmodel.ts_grp_perm_mapping> tmgrp1 = (list<c3card.dal.edmodel.ts_grp_perm_mapping>)viewbag.selectedcheckboxes; } script type="text/javascript"> $.ajax({ type: 'post', url: '/grpcontroller/savenewuser', data: { usr_groupid: $('#ddl_group').val() }, datatype: 'json', success: function (data) { alert('user saved successfully.'); $('#tbluserregistration').empty(); } }); </script> this table <table id="tbluserregistration"> <tr> <td> <div class="form-box form-box-default">

svn - How to delete folder from subversion tags directory? -

i have folder in subversion tags directory. wierd part is, dont see when ls in folder since deleted tags directory in terminal. when @ subversion website still there. doing wrong? refer link http://svnbook.red-bean.com/en/1.8/svn.ref.svn.c.delete.html svn delete <dir> svn ci <dir> -m "comment"

ios - Running Unit Tests which creates UIKit objects causes breakpoint -

when creating uilabel while running unit tests, causes exc_breakpoint (code=exc_i386_bpt, subcode 0x0) what doing wrong? - (void)setlabelcount:(nsuinteger)labelcount { _labelcount = labelcount; nsmutablearray *labels = [[nsmutablearray alloc] init]; (int idx=0; idx<self.labelcount; idx++) { uilabel *lbl = [[uilabel alloc] initwithframe:cgrectzero]; // <--- lbl.backgroundcolor = [uicolor clearcolor]; [labels addobject:lbl]; [self.dataview addsubview:lbl]; } self.labels = labels; [self updatecontents]; } here unit test calls code - (void)setup { cell = [[ldpchartcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"chartcell"]; cell.labelcount = 10; // <--- } - (void)teardown { cell = nil; } - (void)testthatreuseidentifierisset { stassertequalobjects(cell.reuseidentifier, @"chartcell", @""); }

Javascript close pop up div -

i have div hide/show onclick adds or removes css class . want able close/hide div when user clicks outside div area. how do this? thanks! i think you're looking can done javascript. event called 'onblur' triggers event handler when loses focus (e.g. div). you can read more here: http://www.w3schools.com/jsref/event_onblur.asp basically call javascript function when object loses focus: onblur="myfunction();" ...and 'myfunction()' have javascript change css.

java - Storing Double in ArrayList -

i have arraylist of type integer, possible store value in (eg: 1.25) without having cast int therefore losing bit after decimal? no, cannot store doubles in arraylist<integer> without loss of precision. can, however, store them in arraylist<double> .

android - Nested parcelable object not reading -

i'm trying parcel object contains string/int variables , object variable. strings , int's working, not nested object. understand have parcelable, i'm apparently doing wrong=. in nested class, writetoparcel method gets called (i check log.d() call), createfromparcel() doesn't. end getting null object. simplified code: public class myclass implements parcelable { public myclass() { } private integer id; private string name; private myotherclass otherclass = new myotherclass(); public integer getid() { return id; } public void setid(integer id) { this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } public otherclass getotherclass() { return otherclass; } public void setotherclass(otherclass otherclass) { this.otherclass = otherclass; } public static final parcelable.creator&

visual c++ - Placing a piece in a connect four game using c++ -

ok have homework assignment , dont know start function. bool placepiece(char** pboard, int colsize, int rowsize, int columnselection, char player) the function place piece represented char player, on game board char** pboard (a 2darray made colsize , rowsize) function put players piece @ bottom of column selected during players turn. if piece @ bottom of column puts piece on top of 1 , if column full return false. really biggest issue im having dont understand how im supposed using pboard. im not looking me me start out on right path. to solve this, need understand arrays , loops . first argument in signature array containing board data (and next 2 arguments dimensions of it) - there need access first element @ columnselection position , set value of player argument. return value should indicate if operation successful. bool placepiece(char** pboard, int colsize, int rowsize, int columnselection, char player) { if (columnselection >= colsize) { /* inv

internet explorer - AngularJs directive's template not updating in IE9 -

i'm creating angularjs's directive. in internet explorer (ie9) doesn't work expected. replace original html template, doesn't update template's interpolated strings. it works correctly in chrome, firefox , safari here's code angular.module('app', []); angular.module('app').directive('mydirective', function () { return { replace: true, scope: { height: '@', width: '@' }, template: '<div style="width:{{width}}px;height:{{height}}px;' + 'border: 1px solid;background:red"></div>' }; }); and here html calling directive <div id="ng-app" ng-app="app"> <div mydirective width="100" height="100"></div> </div> here's fiddle http://jsfiddle.net/sap7t/ you're going need use ng-style . means having setup javascript object sty

Python: how to open a file and loop through word for word and compare to a list -

i have file strings , want loop through file , check contents against file. both files big place in code have open each file open method , turn each loop iterates on file word word (in each file) , compare every word every word in other file. ideas how this? if files both sorted, or if can produce sorted versions of files, relatively easy. simplest approach (conceptually speaking) take 1 word file a, call a, , read word file b, calling b. either b alphabetically prior a, or after a, or same. if same, add word list you're maintaining. if b prior a, read b file b until b >= a. if equal, collect word. if < b, obviously, read until >= b, , collect if equal. since file size problem, might need write collected words out results file avoid running out of memory. i'll let worry detail. if not sorted , can't sort them, it's harder problem. naive approach take word a, , scan through b looking word. since files large, not attractive option. better reading

machine learning - Determining regression equation from coefficients obtained by Lasso Logistic Regression in python? -

i performed lasso regression first categorical feature selection (parameter space had 900 features, reduced 78 after lasso), , linear model calculate response variable. have coefficients parameters important according lasso. ideas how can convert linear regression equation of type: y = β0x0 + β1x1 + β2x2 + ... thanks!

xcode - Get the URL from webview component -

i using webview component , reload component. sometimes, before reloading url webview still pointing. possible information?? thank in advance. alex uiwebview *mywebview = // ... well, we'll exists. nslog(@"last loaded or loading url: %@", mywebview.request.url); the request nsurlrequest object used request page can pretty might need out of it.

java - Splitting array on new line -

i submitting following input through stdin: 4 2 30 one 30 two 15 three 25 four my code is: public static void main(string[] args) throws ioexception { bufferedreader stdin = new bufferedreader(new inputstreamreader(system.in)); string submittedstring; system.out.flush(); submittedstring = stdin.readline(); zipfpuzzle mysolver = new zipfpuzzle(); mysolver.gettopsongs(submittedstring); } which calls: //bringing public string gettopsongs(string mystring) { setup(mystring); calculatequality(); qualitysort(); return titlesort(); } which calls public void setup(string mystring) { string tempstring = mystring; //creating array each element line string[] lineexplode = tempstring.split("\\n+"); //setting numsongsalbum , songstoselect string[] firstline = lineexplode[0].split(" "); numsongsalbum = integer.parseint(firstline[0]);

html - helvetica font not working in wkhtmltopdf -

i have been trying use helvetica font while creating pdf font not reflected in pdf. i did google , found solutions none workable. tried solution 1 i found similar thing here : font issue tried last solution mentioned on there workaround define @font-face in css , have src link external host accessible wkhtmltopdf but solution not working. tried solution 2 tried use google font api, result still not workable. helvetica font here example example of custom font tried solution 3 tried doing using css property @page. not working. what approach workable solution. the easiest way fix wkhtmltopdf 's font problems base64 encode font ( you can use tool ) , include in css: @font-face { font-family: 'helvetica'; src: url(data:font/truetype;charset=utf-8;base64,aaeaaaataqa... } this works fonts (including google fonts), , guarantees cross-platform compatibility across different machines , operating systems.