Posts

Showing posts from April, 2015

How to search in fulltext index using php in mongodb -

i'm using mongodb 2.4 , added fulltext index "title" field in 1 collection. how should search in field using php? this code use right now: $params = array( '_id' => array( '$gt' => (int)$gt ) ); $r = $this->collection->find( $params )->limit($limit); this seem answer question: <?php $result = $db->command( array( 'text' => 'bar', //this name of collection searching 'search' => 'hotel', //the string search 'limit' => 5, //the number of results, default 1000 'project' => array( //the fields retrieve db 'title' => 1 ) ) ); http://www.php.net/manual/en/mongodb.command.php#111891

python - Scipy.loadmat() ---- SystemError: ../Objects/stringobject.c:3899: bad argument to internal function -

i'm trying load .mat file python quite large ( >75mb) , getting following error. can helped? traceback (most recent call last): file "prop_keys.py", line 34, in <module> prop_d = scipy.io.loadmat(prop) file "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio.py", line 175, in loadmat matfile_dict = mr.get_variables(variable_names) file "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio5.py", line 272, in get_variables hdr, next_position = self.read_var_header() file "/usr/lib/python2.7/dist-packages/scipy/io/matlab/mio5.py", line 224, in read_var_header stream = bytesio(dcor.decompress(data)) systemerror: ../objects/stringobject.c:3899: bad argument internal function as noted here: http://projects.scipy.org/scipy/ticket/1894 the file contains compressed data blows 1.1gb when uncompressed. error message symptom of machine not having enough free memory store data. in addition this, latter p

html5 - Stroke left and right side of rect svg -

i have drawn rect in svg using d3 , stroke left , right side. <rect class="extent" x="578" width="356" height="250" style="cursor: move; opacity: 0.2; fill: #ff9000;" ></rect> it's hack, can add filter shape , clip top , bottom strokewidth - here i'm assuming 1 unit. <defs> <filter id="clippy" x="0" y="1" height="248" width="356"> <fecolormatrix type="identity"/> </filter> </defs> <rect filter="url(#clippy)" class="extent" width="356" height="250" style="cursor: move;opacity: 0.2; fill: #ff9000;" x="578"></rect> update: here d3.js version of answer created christopher chiche (see original lower down): svg.append("defs").append("filter") .attr("id", "clippy") .attr(&

c# - A call to SSPI failed while sending email using amazon ses from windows application -

Image
i using amazon ses send emails, , use same config inside website , windows application. website sending emails windows application gives me error , not emails sent: note when change smtp config in windows app gmail works fine, problem happen amazon ses , started happen today, before ses working fine on windows app. note both website , windows app working local. stack trace: @ system.net.security.sslstate.startsendauthresetsignal(protocoltoken message, asyncprotocolrequest asyncrequest, exception exception) @ system.net.security.sslstate.checkcompletionbeforenextreceive(protocoltoken message, asyncprotocolrequest asyncrequest) @ system.net.security.sslstate.startsendblob(byte[] incoming, int32 count, asyncprotocolrequest asyncrequest) @ system.net.security.sslstate.processreceivedblob(byte[] buffer, int32 count, asyncprotocolrequest asyncrequest) @ system.net.security.sslstate.startreadframe(byte[] buffer, int32 readbytes, asyncprotocolrequest asyncrequest)

HTML5 & CSS: Formatting anchors, <header>-wide -

i encountered peculiar css formatting problem when changed <div id="header"> block html5's <header> block. basically, want links within <header> block of colour , not decoration. the relevant html , css codes follows: <!-- html5 code --> <header> <h1> <a href="#">link text</a> </h1> </header> /* css code */ header { color: black; text-decoration: none; } the output see (using firefox 20.0 ubuntu 12.04) if css code fragment above not exist. adding class="hdr" anchor block , changing css rule a.hdr works. changing <div id="header"> , #header a works. still, don't see why using <header> , corresponding rule fails, , strikes me "correct" approach. an initial search solution led me, among other links, link (i had <h1> block nested within <a> block, initially), using <div> wrapper didn't wor

Python List Values being assigned to each other -

i'm having problem writing following code: d = [ [0,3,8,999,-4], [999,0,999,1,7], [999,4,0,999,999], [2,999,-5,0,999], [999,999,999,6,0] ] def floydwarshall (w): matrices = [w[:]] pred = [w[:]] print (matrices pred) print (pred matrices) print (pred w) print (matrices w) in range(0,len(pred[0])): j in range(len(pred[0][i])): if pred[0][i][j] != 999 , pred[0][i][j] != 0: pred[0][i][j] = +1 else: pred[0][i][j] = false return (matrices,pred) floydwarshall(d) the values being returned exact same matrices, why this? print statement not pointers same spot in memory, correct? you making shallow copy of nested lists, mutating them still affect both matrices. might want use copy.deepcopy

C++ reading string from memory -

i wrote dll application hooked process. works shows first letter. wanted whole string. string vary 2 letters 32 letters. //reading memory handle exebaseaddress = getmodulehandlea(0); char unameaddr = *(char*)((char*)exebaseaddress + 0x34f01c); printf("%c \n", unameaddr); i wanted understand parts: *(char*)((char*) //<-- for. and if possible use if using multilevel pointers: char multipoint = *(char*)((char*)exebaseaddress + 0x34f01c + 0x123 + 0x321 + 0x20); update i guess wrong here: if(unameaddr == "omnicient") cout << "you omni" << endl; i used username name omnicient did not cout you omni . guess compare wrong? %c displays char s (single characters), %s displays null-terminated char* s (strings): handle exebaseaddress = getmodulehandlea(0); char *unameaddr = (char*) exebaseaddress + 0x34f01c; printf("%s \n", unameaddr); notice tidied pointer casting, important thing got rid of fina

shell - How to assign an output to a shellscript variable? -

how assign result shell variable? input: echo '1+1' | bc -l output: 2 attempts : (didn't work) #!bin/sh a=echo '1+1' | bc -l echo $a you're looking shell feature called command-substitution. there 2 forms of cmd substitution original, stone-age, portable , available in unix-like shells (well all). you enclose value generating commands inside of back-ticks characters, i.e. $ a=`echo 1+1 | bc -l` $ echo $a 2 $ modern, less clunky looking, nestable cmd-substitution supplied $( cmd ) , i.e. $ a=$(echo 1+1 | bc -l) $ echo $a 2 $ your 'she-bang' line says, #!/bin/sh , if you're running on real unix platform, it's /bin/sh original bourne shell, , require use option 1 above. if try option 2 while still using #!/bin/sh , works, have modern shell. try typing echo ${.sh.version} or /bin/sh -c --version , see if useful information. if version number, you'll want learn features newer shells contain. speak

iphone - objective-c 'double free' error in ARC mode -

i'm trying practice block , gcd/nsoperation, wrote project async-objc , when i'm trying test unit test, encountered 'double free' error, thought there shouldn't such error in arc mode. here code - (void)each:(nsarray *)items iterator:(callbackeach)iterator complete:(callbackwitherror)complete { nsblockoperation *blockop = [nsblockoperation blockoperationwithblock:^{ if (!items || items.count == 0) { complete(nil); return; } callbackwitherror __block completeonce = complete; nsoperationqueue *queue = [[nsoperationqueue alloc] init]; nslog(@"start operations %@", queue); [queue setmaxconcurrentoperationcount:kmaxconcurrentoperationcount]; nsinteger __block count = 0; (id item in items) { nsoperation *op = [nsblockoperation blockoperationwithblock:^{ iterator(item, ^(nserror *error) { if (error) {

compiler construction - Qt distribute application for windows on qt 5.0.2 -

i have tried distribute application wrote in qt creator without success. i compiled , dependency walker found dll files required, created folder , copied exe , dll in , works on local computer. i copied files different computer , each time try execute error message program terminated unexpectantly i tried compile different programs (examples) , done same copy/paste , ending same error. i rather not use static linking because of possible licensing issues i have looked other stack overflow responses , same.. copy dlls folder , should work... can't figure out why error. even tried on same windows different version (i compiling on windows7 64, tried on win7 32, win xp, , win 8) edit this list of dlls adding 04/11/2013 12:20 pm 2,106,216 d3dcompiler_43.dll 04/11/2013 12:20 pm 18,025,758 icudt49.dll 04/11/2013 12:20 pm 3,090,303 icuin49.dll 04/11/2013 12:20 pm 1,808,899 icuuc49.dll 04/11/2013 12:22 pm 99,328 libegl.dll

How to start two servers (mysqld and thin) in one batch file? -

i want create batch file start mysql server ( mysqld ) , rails thin server ( rails s thin ). mysql starts, rails s thin doesn't: @echo off cd c:\path\to\app cmd /c "mysqld --console" rem exit <-- or without rem cd c:\path\to\app <-- or without cmd /c "rails s thin" i tried create 3 files this. main 1 runs other two. doesn't either, mysql runs. , need start mysql before rails. rails needs running mysql. how write such batch? upd: how start 2 programs simultaniously in windows command prompt use start e.g. start notepad.exe start calc.exe if want run 1 after tests, may need write own program.

Going from pseudocode to scheme -

key <-5381 each character c in w key <-33.key + ctv(c) end for this pseudocode key function implemented in scheme life of me cant figure out how translate actual code. appreciated. , ctv function converts each character integer value ie 1 , z 26 i'll give general structure of solution, because looks homework , should try solve yourself: (define (key str) (let loop ((chars <???>) ; transform string list of chars (acc 5381)) ; initial value of accumulator (if <???> ; if list of chars empty acc ; return accumulator (loop <???> ; otherwise advance recursion on list <???>)))) ; update accumulator, use `ctv` , apply formula notice we're using recursion implement looping, traverse on parameter chars (the list of characters) , use parameter acc accumulating result returned @ end. instance, here's how value of acc variable gets updated on succe

ios - CAGradientLayer Redraw Method -

i've got draw method draws gradient layer: cagradientlayer *bglayer = [backgroundlayer morninggradient]; bglayer.frame = self.view.bounds; [self.view.layer insertsublayer:bglayer atindex:[self.view.layer.sublayers count]]; but know it's inserting sublayer every time it's called lead memory problems down line , since fit screen there's no reason not deleting them before add in new one. how can this, i've tried using: [self.view.layer removefromsuperlayer]; but lldb error (probably because first time it's called there no sublayer remove) [self.view.layer removefromsuperlayer]; wrong layer! layer added not self.view.layer . self.view.layer.sublayers[i] i integer (zero or larger). i not understand why inserting multiple sublayers that, have reason, won't try grapple issue. anyway, answers crash problem. have figure out of many sublayers want remove, , remove it.

java - Passing Parameters to a function JSF -

hi guys need pass parameters actionlistener code <p:dialog id="dialog" header="acceso restringido" widgetvar="dlgregister" modal="true"> <h:form> <h:panelgrid columns="2" cellpadding="5"> <h:outputlabel for="username" value="nombre de usuario:" /> <p:inputtext value="#{loginbean.usuario.username}" id="username" required="true" label="username" /> <h:outputlabel for="password" value="contraseña:" /> <h:inputsecret value="#{loginbean.usuario.password}" id="password" required="true" label="password" /> <h:outputlabel for="correo" value="correo:" /> <h:inputsecret value="#{loginbean.usuario.correo}" id=&

input - how do you make Scite interactive? -

once compile scite, command prompt won't show up. how set can accept inputs , outputs command prompt program using scite? in scite properties file edit below: change command.go.*.c=$(filename) to command.go.*.c=start $(filename) pressing go opens tatget file in new cmd window , interactable can give inputs if using different language replace *.c corrosponding 1 , put start before command.

curves - gnuplot: plotting a file with 4 columns all on y-axis -

Image
i have file contains 4 numbers (min, max, mean, standard derivation) , plot gnuplot. sample: 24 31 29.0909 2.57451 12 31 27.2727 5.24129 14 31 26.1818 5.04197 22 31 27.7273 3.13603 22 31 28.1818 2.88627 if have 4 files 1 column, can do: gnuplot "file1.txt" lines, "file2.txt" lines, "file3.txt" lines, "file4.txt" lines and plot 4 curves. not care x-axis, should constant increment. how please plot? can't seem find way have 4 curves 1 file 4 columns, having incrementing x value. thank you. you can plot different columns of same file this: plot 'file' using 0:1 lines, '' using 0:2 lines ... ( ... means continuation). couple of notes on notation: using specifies column plot i.e. column 0 , 1 in first using statement, 0th column pseudo column translates current line number in data file. note if 1 argument used using (e.g. using n ) corresponds saying using 0:n (thanks pointing out mgilson ). if

javascript - Leaflet map not showing up in Backbone -

here's view: define([ 'jquery', 'underscore', 'backbone', 'bootstrap', 'leaflet', 'text!templates/map/maptemplate.html' ], function($, _, backbone, bootstrap, l, maptemplate){ var mapview = backbone.view.extend({ el: '.body', template: _.template(maptemplate), render: function() { // load map template this.$el.html(this.template()); // create map var map = l.map('map', { dragging: false }); l.tilelayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addto(map); map.locate({setview: true, maxzoom: 15}); function onlocationfound(e) { var radius = e.accuracy / 2; l.marker(e.latlng).addto(map); l.circle(e.latlng, radius).addto(map); } map.on('locationfound', onlocat

windows - assembly masm can not figure out how to do a if not less then statement -

how in assembly masm do if not less statement i have code in vb.net if not variable1 < variable2 count += 1 end if if not variable1 < variable3 count += 1 end if msgbox.show(count) for code count = 1 i tried below code , not work. either gives me count = 2 @ end or count = 0 @ end. should give me count = 1 here code assembly masm .data variable1 dd ? variable2 dd ? variable3 dd ? this suppose happen. read text file 3 values 500,109,500 stored 3 variables so variable1 = 500 variable2 = 109 variable3 = 506 then need list these in order least greatest tried compare these. i tried of these variations , none of them worked mov esi, offset variable1 mov ecx, offset variable2 .if esi > ecx inc count .endif mov ecx, offset variable3 .if esi > ecx inc count .endif .if variable1 > offset variable2 inc count .endif .if var

mongodb - MongoCollection::aggregate() is undefined in Heroku PHP using MongoHQ -

Image
i'm getting following error when using mongodb's aggregate() function in php code. code works on local setup running mongodb 2.2.3 php fatal error: call undefined method mongocollection::aggregate() in /app/www/page.php on line 52, referer: http://referrer.url code foreach($cats $key=>$val){ $cats2[$val['lable']] = $mycollection->aggregate( array( array('$match' => array('user_id' => $user_id )), array('$unwind' =>"\$data"), array('$match' => array('data.category'=> $val['category'])), array('$project' => array('name'=> "\$data.name", 'id'=>"\$data.id")), array('$group' => array('_id'=>'$id', 'name'=> array('$first' =>

c# - There was an error parsing the query. [ Token line number = 1 ...] -

i tried using stringbuilder make process simpler showing error , don't understand whether problem stringbuilder or code syntax. code: if (datagridview4.rowcount == 0) { messagebox.show("attendance form empty"); } else { //string att; int = datagridview4.rowcount; string[] s = new string[a]; (int = 0; < a; i++) { if (datagridview4.rows[i].cells[1].selected) { s[i] = "present"; } else { s[i] = "absent"; } } string[] s1 = new string[a]; (int = 0; < a; i++) { s1[i] = datagridview4.rows[i].cells[0].value.tostring(); } string date = datetimepicker1.value.tostring("dd-mm-yyyy"); stringbuilder c

javascript - php get access to posted id in ajax request -

how access data that's been posted via ajax request in php. ajax request working return string of data can't seem access variable thats being passed json object. access json object contains 1 parameter. jquery: $.ajax({ type:'post', url:"../../webservices/get_rating.php", data:json.stringify({product_id:id}), datatype:"html", success: function(data) { $('.ratings-content').append(data); }, error:function(data, status, xhr) { alert(data + "\r\n" + status + "\r\n" + xhr); } }); and in php code product_id doesn't work php: $product_id = (int)$_post["product_id"]; echo $product_id; returns 0 by default, $.ajax sends data in get , need set type parameter post . did not set url, data posted. please check link more detail.

objective c - How to redirect to new view after successful login in XCode? -

i trying build app redirects homepage after successful login. have 2 view controllers: loginviewcontroller , dashboardviewcontroller . have coded login part , have created view dashboard, not sure how redirect dashboardviewcontroller after successful login. appreciate help. here code have loginviewcontroller.m file: #import "loginviewcontroller.h" @implementation loginviewcontroller @synthesize username,password,loginbutton,indicator; - (void)didreceivememorywarning { // releases view if doesn't have superview. [super didreceivememorywarning]; // release cached data, images, etc aren't in use. } - (void)viewdidunload { // release retained subviews of main view. // e.g. self.myoutlet = nil; } - (void)dealloc { [super dealloc]; } - (ibaction) loginbutton: (id) sender { // todo: spawn login thread indicator.hidden = false; [indicator startanimating]; nsstring *post =[nsstring stringwithformat:@"username=%@

c - How do I Extract a part of a line from a file? -

i'm new c, sorry if dumb question let's have file containing following: 1 abc 2 def 3 ghi if pass in integer 3 (or character?) function return string of "ghi". don't know how make happen. void testfunc(int num) { file *fp; fp = fopen("testfile.txt", "r"); if(strstr?????? } yea.. have no idea i'm doing. can offer guidance? you can follow link, can bit google also. simple should try own once. reading c file line line using fgetc()

uml - Visual Studio Class Diagram creator cannot show association c++ -

when try show member variable association in visual studio 2012 ultimate, error: cannot show association because 'servernetwork*' cannot found: try 1 of following: -ensure 'servernetwork*' existing type. -if 'servernetwork*' defined outside project ensure have placed correct references in solution explorer. my code compiles , runs i'm sure servernetwork* type , referenced in solution explorer. i think has servernetwork.hpp , servernetwork.cpp not being correctly included in project because have clientnetwork.hpp , clientnetwork.cpp both show fine on class diagram.

c++ - Difference between creating object with "new" or not. -

this question has answer here: what difference between instantiating object using new vs. without 9 answers what difference between these 2 statements? stringstream *mystream = new stringstream(s); and stringstream mystream(s); i heard first return pointer , "dynamically" allocates memory. don't understand difference. thank in advance if inside function, in case: stringstream mystream(s); mystream allocated on stack. destroyed automatically @ end of scope. efficient. in case: stringstream *mystream = new stringstream(s); mystream pointer object allocated on heap. destroyed when call delete mystream . most of time want use stack. efficient , memory gets freed automatically you. happens less type. sometimes need more control. want function create object , have exist until explicitly delete it. these cases should

jsp - Dojo and Spring -

i have created jsp through calling dojo dialogue (on click of button). but code of dialogue ie., <div> ................... </div> is present on same page. therefore unable insert controller (servlet) in between jsp , dojo dialogue. please suggest convenient way insert controller between dojo dialogue , jsp. thank vishal saxena then suppose want use href attribute (then load content in dialog external page -> jsp). the example code: <div data-dojo-type="dijit/dialog" title="my external dialog" href="yourjsp.html"> .... </div> is meant? edit : , in controller map like: @controller public class maincontroller { @requestmapping(value = "/yourjsp.html") public string getdialog(modelmap model) { ... // stuff } }

jquery fancybox popup call from parent javascript file -

can 1 me how call fancybox popup parent js file. when clik on button 1 function if condition true in function need open fancybox popup. advance thanks.. $(document).ready(function() { $("#external").fancybox({ 'width' : '80%', 'height' : '100%', 'autoscale' : false, 'transitionin' : 'none', 'transitionout' : 'none', 'href' : 'openpopup.html', 'type' : 'iframe' }); }); function clickfancy(){ if(true){ // here need open fancypopup }else(){ } <body> <form name="frm1"> <input type="submit" name="fancy" onclick="clickfancy()"> <button>click me</button> </form> </body> <html> if initialized fancybox selector $("#e

vector - C++ index-to-index map -

i have list of ids (integers). sorted in efficient way application can handle them, example 9382 297832 92 83723 173934 (this sort important in application). now facing problem of having access values of id in vector. for example values id 9382 located on somevectorb[30]. i have been using const int units_max_size = 400000; class clsunitsunitidtoarrayindex : public cbasestructure { private: int m_content[units_max_size]; long m_size; protected: void processtxtline(string line); public: clsunitsunitidtoarrayindex(); int *content(); long size(); }; but raised units_max_size 400.000, page stack errors, , tells me doing wrong. think entire approach not good. what should use if want locate id in different vector if "position" different? ps: looking simple can read-in file , can serialized file. why have been using brute-force approach before. if want mapping int's int's , index numbers non-consecutive should consider

XML namespace handling in xslt -

i need convert 1 xml format xml using xslt.initially tried without namespace , got it. when tried name space xmlns="http://ws.wso2.org/dataservice" not working without prefixes xmlns:d="http://ws.wso2.org/dataservice" in given xml file <test xmlns="http://ws.wso2.org/dataservice"> <datarows> <name>name</name> </datarows> <datarows> <name>karthik</name> </datarows> </testcsv> i need xml file after xsl transformation <head> <names>name</names> <names>karthik</names> </head> help me xslt i tried xslt <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:d="http://ws.wso2.org/dataservice" exclude-result-prefixes="d" > <xsl:output method="xml" indent="yes" omit-xml-declara

Access a image dynamically from res folder android -

Image
i have image in res folder this i want access 1 dynamically this holder.viewcover.setimagedrawable(drawable.createfrompath("r.id." + coverimgurl.get(position))); coverimgurl list have 2 image name 1 book_cover & , blank_image array generated dynamically how can set image list in 1 word how access image dynamically in drawable folder , need image name array list ? resources res = getresources(); string mdrawablename = "image_name"; int resourceid = res.getidentifier(mdrawablename , "drawable", getpackagename()); drawable drawable = res.getdrawable(resourceid); icon.setimagedrawable(drawable );

Android :: Servlets, I'm trying to flush a stream to a servlet -

i want send input stream android servlet, dont think can see right way communicate stream in android , stream in servlet, here sample both: android method: private inputstream gethttpconnection(string urlstring) throws ioexception { inputstream stream = null; url url = new url(urlstring); urlconnection connection = url.openconnection(); try { httpurlconnection httpconnection = (httpurlconnection) connection; httpconnection.setrequestmethod("get"); httpconnection.setrequestproperty("name", "thekeyword"); httpconnection.connect(); if (httpconnection.getresponsecode() == httpurlconnection.http_ok) { stream = httpconnection.getinputstream(); } } catch (exception ex) { ex.printstacktrace(); } return stream; } and here servlet code: inputstream = new datainputstream(request.getinputstream()); content = request.getparameter("name");

iphone - How to get session login information to my UIWebView by FacebookSDK -

after logging in facebook facebooksdk, , want display page using uiwebview. displayed correctly when login first time. close , restart app, though facebook session still open, can't login session uiwebview. do have suggestions that, when re-run app, facebook session information? this code example. @interface fblogin2viewcontroller () @end @implementation fblogin2viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. if (fbsession.activesession.state == fbsessionstatecreatedtokenloaded) { // to-do, show logged in view nsstring *appid = [fbsession defaultappid]; nslog(@"session token exists %@", appid); } } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } - (ibaction)onlogin:(id)sender { nsarray *permissions = nil; if (![fbsession activesession]) { fbsession *session = [[fbsession

web applications - Autocomplete vertical scroll bar not working in Android 2.2 -

i have auto complete textbox. <input id="autocompletereportlist" class="mobileautocompletereportlist" /> i have scroll it. below css applied control .mobileautocompletereportlist { width:200px; height:20px; overflow: auto; overflow-y: auto; overflow-x: hidden; } overflow-y not working in mobile browser,is there anyway resolve issue

wolfram mathematica - Plot using one column from a table as the x-value, other columns as y-values -

Image
i have matrix, first column being time, , second column being position of a, third column position of b, etc. plot positions of a, b, ..., functions of time, in same figure. there more efficient way in mathematica making plots column column , combining them "show"? also, plots have colors automatically chosen differ each other; let automation useful, legend automatically generated @ same time. how in mathematica? thanks! [update]: chris' method works extremely well. default legend uses small dot colors bit difficult tell; also, there seems 4 colors; in case there ~20 y-values, making legend useless. there other symbols bigger, , more colors (e.g., grayscales or continuously varying colors)? a = {{{2001, 1, 1}, 2, 3, 4}, {{2002, 1, 1}, 3, 4, 5}, {{2003, 1, 1}, 4, 5, 6}, {{2004, 1, 1}, 5, 6, 7}, {{2005, 1, 1}, 6, 7, 8}}; datelistplot[mapthread[transpose[{#1, #2}] &, {table[first /@ a, {length@rest@last@a}], transpose[rest /@ a]}

javascript - How to animate div using jQuery to the height of another div -

i have div called .a coded height:auto has height rendered based on text contained within. have div on page called .b need animate down using jquery based on height of first div, .a . i have attempted using following jquery function, without luck. idea have jquery ascertain height of .b apply padding .b , not grabbing correct height. have tried using 'margintop' jquery('div.a').animate({'paddingtop': jquery('div.b').height()},500); desparate help! pay up-votes , generous compliments. i think need .outerheight(true) : jquery('div.a').animate({ paddingtop : jquery('div.b').outerheight(true)},500); description .outerheight() docs get current computed height first element in set of matched elements, including padding, border, , optionally margin. returns integer (without "px") representation of value or null if called on empty set of elements. note: the top , bottom padding , border included in

c++ - Compiling Graphin for windows -

i trying compile graphin windows present here svn checkout http://graphin.googlecode.com/svn/trunk/ graphin-read-only but vs 2005 fails 1>------ build started: project: graphin, configuration: release win32 ------ 1>linking... 1> creating library .\../../bin/graphin.lib , object .\../../bin/graphin.exp 1>agg2d.lib(agg2d.obj) : error lnk2019: unresolved external symbol "public: void __thiscall agg::vcgen_dash::remove_all_dashes(void)" (?remove_all_dashes@vcgen_dash@agg@@qaexxz) referenced in function "public: void __thiscall agg::conv_dash<class agg::conv_curve<class agg::path_base<class agg::vertex_block_storage<double,8,256> >,class agg::curve3,class agg::curve4>,struct agg::null_markers>::remove_all_dashes(void)" (?remove_all_dashes@?$conv_dash@v?$conv_curve@v?$path_base@v?$vertex_block_storage@n$07$0baa@@agg@@@agg@@vcurve3@2@vcurve4@2@@agg@@unull_markers@2@@agg@@qaexxz) 1>agg2d.lib(agg2d.obj) : error lnk2019: unr

c# - Client-Side validation with Telerik ASP.NET Ajax doesn't work -

i'm working telerik radcontrols asp.net ajax, , want create client side validation page. created usercontrol , followed this tutorial found on telerik site. unfortunatly doesn't work , have no idea i've done wrong. take @ code me , point me in right direction? <%@ control language="c#" autoeventwireup="false" codebehind="manageaccountcontrol.ascx.cs" inherits="docl.webdoc.controls.account.manageaccountcontrol" %> <style type="text/css"> .btn { margin-top: 15px; } </style> <div id="createuser" style="margin: 10px 10px 10px 10px"> <telerik:radscriptmanager id="radscriptmanager1" runat="server"></telerik:radscriptmanager> <telerik:radskinmanager id="qsfskinmanager" runat="server" showchooser="true" /> <telerik:radformdecorator id="qsffromdecorator" runat="serv

mediacontroller - Android media controller positioning -

i using media player , mediacontroller in activity play audio. in activity have image related audio , beneath description of audio. want mediacontroller displayed bottom of image , above description. @ present mediacontroller appears @ bottom of device if give image anchor view. there way can move mediacontroller above description here go: xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <videoview android:id="@+id/videoview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/blue" /> </linearlayout> activity code: package com.appsopmaat.bethgazo; import java.io.file; import j

symfony - Symfony2 Translatable bundle and safest multilingual approach -

i have developed website personal project in specific language on symfony2. takes long time program because follow safe approaches in developing code, if it's silliest things. plan now, implement directory business website - let's musical instrument companies - on world create account , register business. what have done, have implemented scratch: security bundle, basic entities business {name, location, phone, email, information, etc.}, businesscategory {name, information etc.} , custom simple relationships between them. user can register account , register business. have implemented translations every word or phrase being shown on website using locale in config.yml , custom translations english , let's chinese or spanish. user can click on link "english" or "spanish" , gets translated selected language , website alias changes website.com/en website.com/es. my next steps are: i want user able register in english or spanish. right now, there 1

jquery - How to do lazy loading with BXSlider -

i using image gallery using bxslider . having more 15 images in slide taking lot of time load. need load images in each slider 1 one when particular slide appears. got example here lazyload , bxslider uses lazyload load images. not working me. can 1 me this? im using code $(document).ready(function(){ $("#morelessons").bxslider( { startingslide:1, pager: false }); // trigger lazy load new in-slided images $("a.bx-prev, a.bx-next").bind("click", function() { // call lazy loading settimeout(function() { $(window).trigger("scroll"); }, 100); }); }); you can 'trick' browser move 1 px adding: $(window).scrolltop($(window).scrolltop()+1); fire on a.bx-prev , a.bx-next can set: $(window).scrolltop($(window).scrolltop()-1); fire after events called. if slideshow 50 images not have scrolled down page 50px end. this method work bxslider in drupal 7 addition of lazyload

ios - How to write a Core Data predicate for objects which are related to an object in a to-many relationship -

entitya has to-many relationship entityb (and entityb has to-one relationship entitya ). have array of entityb s (or more accurately, have nsarray contains instances of nsmanagedobject represent entityb ). want create nsfetchrequest fetch entitya s have relationship @ least 1 of entityb s in array. how write predicate fetch request? the following works, think sub-optimal; it's hard grok , i'm sure there must better way of expressing this: nsarray *entitybs = ...; nsmutablearray *containsentitybsubpredicates = [nsmutablearray new]; (nsmanagedobject *entityb in entitybs) { [containsentitybsubpredicates addobject:[nspredicate predicatewithformat:@"%@ in entitybs", entityb]]; } nspredicate *containsentitybspredicate = [nscompoundpredicate orpredicatewithsubpredicates:containsentitybsubpredicates]; i've tried this, doesn't work: nsarray *entitybs = ...; nspredicate *containsentitybspredicate = [nspredicate predicatewithformat:@"any %@ in

How to detect in Android that WIFI is ON, but unreachable? -

does know how programatically detect in android wifi unreachable? i've got app running able detect type of network connection , whether on or not (networkinfo class), can't detect wifi on, out of reach on other side of building, there no internet. network info keeps on saying type of network wifi, isconnected = true, getdetailedstate = connected, these don't me. detect wifi connected or on. if wifi not connected internet connection display message " wifi unreachable or no internet connection. " for checking wifi connected use following code. connectivitymanager connmanager = (connectivitymanager) getsystemservice(connectivity_service); networkinfo mwifi = connmanager.getnetworkinfo(connectivitymanager.type_wifi); if (mwifi.isconnected()) { // whatever }

python - How to check if data has already been previously used -

i have python script retrieves newest 5 records mysql database , sends email notification user containing information. user receive new records , not old ones. can retrieve data mysql without problems... i've tried store in text files , compare files but, of course, text files containing freshly retrieved data have 5 records more old one. so have logic problem here that, being newbie, can't tackle easily. using lists idea stuck in same kind of problem. the infamous 5 records can stay same 1 week , can have new record or maybe 3 new records day. it's quite unpredictable more or less should behaviour. thank time , patience. are assigning unique incrementing id each record? if are, can create separate table holds id of last record fetched, way can retrieve records ids greater id. each time fetch, update table new latest id. let me know if misunderstood issue, saving last fetched id in database solution.

flops - Is there any difference in execution times between two different processors with same amount of gigaflops? -

i have hardware related question debated friend. consider 2 processors 2 different manufacturers same amount of gigaflops put same computers (i.e. ram , such same both computers). now given simple program there difference in execution times between 2 computers same processors. i.e. 2 computers handle code differently (for-loops, while-loops, if-statements , such)? and if, difference noticably or can 1 computers approximately perform same? short answer: yes, different, possibly so. flops floating point operations, very crude measure of cpu performance. in general decent proxy performance scientific computations of kinds, not general performance. there cpus strong in flops - alpha historical example - have more moderate performance in integer computations. means alpha , x86 cpu similar flops have different mips-performance. the truth is hard make generic benchmark, though many have tried.

javascript - Fade in jquery div show -

i trying below script fade in , fade out delay in between. shows div correctly , fades out should, doesn't fade in? <?php if(isset($_get['updated'])) { ?> <div id='updated'><p>the product added shopping cart</p></div> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $('#updated').fadein(800).delay(3000).fadeout(800) </script> <?php } ?> many thanks! its because showing <div id='updated' style="display:none"> fixes it

django - Angular: Add to each request a random number in order to disable caching for IE -

ie heavily caching xhr requests . overcome problem users suggested add random number url. example here whereas work, i'm looking way add random number globally / disable ie caching globally, , caching has disabled resource xhr calls. i'm guessing achieve goal using 1 of following approaches. i'm not sure have do.. a) using $httpprovider.defaults.transformrequest b) using request/response promise chaining have been added in v 1.1.4 this old issue ie. not sure how muck angular's $httpprovider (or want to), here function adds random value url, whether or not uses query string: function nocacheurl(url) { var urlparser = document.createelement('a'); urlparser.href = url; var q = "nc" + math.random() + "=1"; q = urlparser.search ? urlparser.search + "&" + q : "?" + q; return urlparser.protocol + "//" + urlparser.host + urlparser.pathname + urlparser.hash + q; } note name

Making a http request using CEFSharp and all its stored cookies -

i'd make webrequest facebook or authenticated site using cookies contained in cefsharp after user has logged on. how can that? i'm using httpwebrequest. can somehow retrieve cookies cef , pass httpwebrequest? tried looking @ cefrequest it's not accessible nor know how use it i need in order prefetch resources needed 2000 sites need precached. if can suggest way please recommend well the method cef.visitallcookies() issue callback each cookie. can selectively include or of these cookies in web requests make using httpwebrequest . https://github.com/ataranto/cefsharp/blob/master/cefsharp/cefsharp.h#l122

Embed Image into video - FFMPEG or JW player? -

so thought embed image part of video content while converting m4a mp4. output file has image video content , plays expected in vlc when same streamed cdn using jw player, not see image video content, still black , audio heard. not sure issue embeding. used ffmpeg embed image video content. on other hand there posibility jw player overlay image video content while audio can heard in end? you need to loop image ffmpeg -loop 1 -r 1 -i img.png -i audio.m4a -shortest -filter:v \ 'crop=trunc(iw/2)*2:trunc(ih/2)*2' out.mp4 repeat image on , over once per second stop video when audio stops cut image dimensions if necessary