Posts

Showing posts from June, 2013

Django Foreign Key to_field -

i have 2 models customuser , magazine random/unique slug fields. want create third model (article) foreign keys slug field: class customuser(abstractbaseuser): slug = randomslugfield(length=6, unique=true) ... class magazine(models.model): slug = randomslugfield(length=6, unique=true) name = models.charfield() class article(models.model): magazine = models.foreignkey(magazine, to_field='slug') author = models.foreignkey(settings.auth_user_model, to_field='slug') but when migrate database create article model, following error: django.core.exceptions.fielddoesnotexist: customuser has no field named 'slug' but customuser has field named 'slug'. , magazine model don't error. has idea going wrong? i use package slug field: https://github.com/mkrjhnsn/django-randomslugfield edit: here full customuser model: class customuser(abstractbaseuser, permissionsmixin): slug = randomslugfield(length=6, exclude_upp

python - Why can't I remove quotes using `strip('\"')`? -

i can remove left quotes using str.strip('\"') : with open(filename, 'r') fp : line in fp.readlines() : print(line) line = line.strip('\"') print(line) part of results: "route d'espagne" route d'espagne" using line.replace('\"', '') gets right result: "route d'espagne" route d'espagne can explain it? your lines not end quotes. newline separator part of line , not removed when reading file, unless include \n in set of characters stripped " going stay. when diagnosing issues strings, produce debug output print(repr(line)) or print(ascii(line)) , make non-printable or non-ascii codepoints visible: >>> line = '"route d\'espagne"\n' >>> print(line) "route d'espagne" >>> print(repr(line)) '"route d\'espagne"\n' add \n str.strip() argument:

javascript - How to drag and drop ONLY if there is no child in droppable div? -

ok, haven't been able work out solution this. i found answer helps reject drops if there draggable element in droppable slot, haven't been able make slot restart accepting children once has been emptied. also, doesn't work initial state of draggable pieces (notice can stack more 1 piece in slot if initial state of child). here link project and here specific piece of code: jquery(window).on("load",function() //if document has loaded { //code executed when document loads here $( ".b-piece" ).draggable({ cursor: "move", revert: "invalid"}); $( ".grid-b .grid-slot" ).droppable({ accept: ".b-piece", drop: function(event, ui) { $(this).droppable('option', 'accept', 'none'); /* stop accepting objects */ $(this).append(ui.draggable); /* move drag object new parent */ $(this).children(".game-piece").css({"top":"0", "left":"0&

remove "latest files" from Drupal module FileDepot -

how can prevent drupal module "filedepot" displaying "latest files" when user first enters file depot? is possible have display nothing until user clicks on folder? in sites/all/modules/filedepot/lib-ajaxserver.php added 1=2 and sql may check original one. worked me // default view - latest files if (!empty($filedepot->allowableviewfolderssql)) { if ($filedepot->ogmode_enabled) { if (!empty($filedepot->allowablegroupviewfolderssql)) { $sql .= "where 1=2 , file.cid in ({$filedepot->allowablegroupviewfolderssql}) "; } else { $sql .= "where 1=2 , file.cid in ({$filedepot->allowableviewfolderssql}) "; } } elseif (!user_access('administer filedepot', $user)) { if (empty($filedepot->allowableviewfolderssql)) { $sql .= "where 1=2 , file.cid null "; } else { $sql .= "where 1=2 , file.cid in ({$filedepot->allowableviewfolderssql}) &quo

c# - JSON to Dynamic Object vs. Strongly Typed Object -

i'm not sure if don't big picture or if miss benefits of parsing json-string dynamic object? if have class this class product { public string name { get; set; } public double price { get; set; } public string category { get; set; } } and use httpclient object this product product = await response.content.readasasync<product>(); what benefit code? string content = await response.content.readasstringasync(); dynamic product = jobject.parse(content); if want use them need write product.name with typed apporach @ least have intellisense. if service changes product dynamic approach doesn't me either because still need access mentioned above. so missing? why should use dynamics or when? you always prefer use strong type on dynamic (performance\convenience). here cases use dynamic: when want parse xml , dont want work xelement's, xpath's etc. com interop - makes things easy , nice (try working excel\word , convinced

node.js - Browser page refresh gets a new session cookie/id -

i having issue in application. whenever browser refreshes reassign cookie new content , new session id. right behavior of browser? the application uses express , connect-tedious libraries of nodejs. user gets logged out because cookie content , session id different whenever refresh. suggestion on how go resolving problem? if node server code responsible setting cookies user , session (using set-cookie header or generating javascript file client same), should check existing cookies in request. when page reloaded, request come server again. @ point can read cookies passed server (which include cookie session , user set last time). if these cookies found , valid, server should not generate new cookie same. even if logic not reside on server , part of client side js, overall idea same. not create new cookies, if can read existing ones correctly.

javascript - Ext js package build -

sencha command let create, build , distribute own package. ext js library built using sencha command. i wonder correct way have built-package have in correct order, list of singleton files in root folder , there no dependency among each other. example, sencha core package, there ext.js, componentquery.js, etc., how sencha command knows build ext.js first. this bit puzzling me. have similar situation. have package, let's call mycoolstuff, in root source folder, have coolstuff.js , list of singleton/utility files, example, coolstuffeventhandler.js. absolutely need coolstuff.js built first, far have no luck. how did ext js it? when define classes, no matter singletones or not, specify dependencies using requires , uses directives: ext.define('coolstuffeventhandler', { //// requires: [ 'coolstuff' ], ///// }); that's all! rest taken care of sencha cmd you.

JQuery to Native Javascript (simple click call function) -

i'm trying convert following jquery native javascript, can't seem work. any appreciated. jquery : $(document).ready(function() { $("button").click(function() { var char = "0123456789abcdefghijklmnopqrstuvwxyz"; var fullchar = "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; var genhash = ""; var i; (i = 0; < 8; i++) { var rnum = math.floor(math.random() * char.length); genhash += char.substring(rnum, rnum + 1); } $("input").val(genhash); }).click(); }); native javascript : function passwordgenerator() { var char = "0123456789abcdefghijklmnopqrstuvwxyz"; var fullchar = "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; var genhash = ""; var i; (i = 0; < 8; i++) { var rnum = math.floor(math.random() * char.length); genhash += char.substring(rnum, rnum + 1); } document.getelements

Scala Lifting to a thunk -

i have function wraps result of function in promise. wanted promote lift function sort of re-use elsewhere. here original definitions: val abc = promise[mytype]() try { val suck = abc.success(someotherfunction(intparam1, intparam2)) } catch { case ex: exception => p.failure(ex) } so did following: def myliftfunc[x](x: x) (op: => x): promise[x] = { val p = promise[x]() try { p.success(op) } catch { case nonfatal(ex) => p.failure(ex) } p } how can re-use this? mean, second argument pass in should thunk pass in function body irrespective of parameters function body require! when call lifted function as: myliftfunc(someotherfunction(intparam1, intparam2)) this of type int => promise[int] , someotherfunction returns int . want promise[int] when call myliftfunc ! you might interested in promise.fromtry method. method uses try idiom scala.util , useful structure allows treat try...catch statement more traditional construc

android - Backstack Fragment not appearing in front on Back button prerssed -

i have gone through many stackoverflow question before writing this. confused guy backstack in fragment. i have added 3 fragment on same container inside activity fragment 1 : private void addlandingfragment() { landingpagefragment = landingpagefragment.newinstance(); fragmenttransaction transaction = manager.begintransaction(); transaction.add( r.id.container, landingpagefragment, landing_page_fragment_tag ); transaction.commit(); } fragment 2 : public void addintrofragment() { fragment2 = introfragment.newinstance(); fragmenttransaction transaction = manager.begintransaction(); transaction.replace( r.id.container, fragment2, intro_page_fragment_tag); transaction.addtobackstack(fragment2.getclass().getname() ); transaction.commit(); } fragment 3 : public void ongetstartedclicked() { fragment3= connectfragment.newinstance(); fragmenttransaction transaction = manager.begintransaction(); tr

r - Keep hitting the error ""loop_apply" not resolved from current namespace (plyr)" in ggplot2 with example codes -

Image
i keep hitting error today , download plyr github still doesn't work. restarted r-studio pc after installing plyr.. it appears problem may due change made way r resolves references external dlls, mentioned halfway through thread here . adding parameter package="plyr" .call function call on line 12 of r/loop_apply.r in source (clone github), , installing package source ( install.packages(" <path plyr source> ", type="source", repos=null) ) seems fix it.

javascript - CSS fade with JS callback to set css display on completion interrupts animation -

edit: jsfiddle per request: https://jsfiddle.net/5anz0kgt/1/ edit 2: seems animation interruption in fact related order of elements... if new banenr layer on top of old one, animation smooth. if new banner beneath, animation appears choppy. new question therefore becomes why, , how can fix this? i finishing small banner, , having trouble animations. originally, had following functions controlling banner visibility , animations (which worked): function fadeout(el){ el.style.transition = "opacity 0.5s linear 0s"; el.style.opacity = 0; } function fadein(el){ el.style.transition = "opacity 0.5s linear 0s"; el.style.opacity = 1; } but noticed (of course) made buttons unclickable on banners due element stacking. i therefore decided set display: none on non visible banner layers. fading in, added el.style.display = ""; but fading out needed insure css animation had completed before hide layer. added (courtesy of http://davidw

mysql - How to filter data from SQLDataSource -

i'm trying filter data sqldatasource postcode_data textbox name postcode1 . i using .rowfilter property, it's not working. result, postcode_data still not filtered. what have desired result? protected sub button1_click(sender object, e eventargs) handles button1.click dim dv dataview dim recpostdes string dim recmiles integer dv = ctype(postcode_data.select(datasourceselectarguments.empty), dataview) dv.rowfilter = "postcode = '" & postcode1.text & "%'" recpostdes = ctype(dv.table.rows(0)(3), string) recmiles = ctype(dv.table.rows(0)(5), integer) if recmiles > 0 des1.text = recpostdes mile1.text = recmiles end if end sub first, looks you're trying create like expression. if so, change = like dv.rowfilter = "postcode '" & postcode1.text & "%'" dataview "represents databindable, customized view of datatable sorting,

javascript - Add new input to dynamic nested list in AngularJS -

on page have dynamic list of musicians (players) whereas player can removed , added list. each player shall have multiple instruments dynamic list, whereas instrument can added or removed player's instrument list. talking 2 nested dynamic lists. here code , problem description under it. jamorg.html: <!doctype html> <html ng-app='jamorgapp'> <head> <link rel="stylesheet" type="text/css" href="c:\users\jazzblue\documents\bootstrap\bootstrap-3.3.2-dist\css\bootstrap.min.css" /> <title>jam organizer</title> </head> <body> <div ng-controller='jamorgcontroller jamorg'> <h1>jam</h1> <div ng-repeat='player in players'> <div> <h3 style="display: inline-block;">player {{$index}}</h3> <button ng-click="removeplayer($index)">remove</button> </div> <br/>

Loops and Strings in python -

given strings s1 , s2 , not of same length. create new string consisting of alternating characters of s1 , s2 (that is, first character of s1 followed first character of s2 , followed second character of s1 , followed second character of s2 , , on. once end of either string reached, remainder of longer string added end of new string. example, if s1 contained "abc" , s2 contained "uvwxyz", new string should contain "aubvcwxyz". associate new string variable s3 . my attempt is: s3 = '' = 0 while < len(s1) , < len(s2): s3 += s1[i] + s2[i] += 1 if len(s1) > len(s2): s3 += s1[i:] elif len(s2) > len(s1): s3 += s2[i:] s1 = "abcdefg" s2 = "hijk" s3 = "" minlen = min(len(s1), len(s2)) x in range(minlen): out += s1[x] out += s2[x] out += s1[minlen:] print out a couple of things keep in mind. first, can treat python string array, , can acc

c# - Loading a follow up page into a variable using WebBrowser -

i have below code , want know how make code wait webbrowser load next page after activating submit button: webbrowser wb = new webbrowser(); wb.scrollbarsenabled = false; wb.scripterrorssuppressed = false; wb.navigate(baseurl+uri); while (wb.readystate != webbrowserreadystate.complete) { application.doevents(); } var doctitle1 = wb.documenttitle; foreach (htmlelement form in wb.document.forms) form.invokemember("submit"); stream datastream = wb.documentstream; streamreader reader = new streamreader(datastream); string responsefromserver = reader.readtoend(); console.writeline(responsefromserver); i can hear click sound when activates submit hear when @ end of code. if put break in place, can see wb object has data previous page. thanks!

ios - Recognize self written text -

is there lib used recognize self written text (like taking photo of piece of paper)? have searched on google have found nothing. hope can tell me something. i did quick google search don't know if satisfy needs full ocr library made ios 7+. if library in specific doesn't work you'll want research other ocr (optical character recognition) libraries. https://github.com/gali8/tesseract-ocr-ios edit: should clarify mean perform character recognition asking without more specifics on project can't guarantee work use case!

javascript - ember route event didTransition timing -

i want open modal in route after transitioning it. guess use "didtransition" event. in called method (a util) refer ember.view object. my route actions: actions: { openmodal: modal.open, closemodal: modal.close, togglemodal: modal.toggle, didtransition: function() { this.send('openmodal', 'choose'); } } the problem using: didtransition: function() { this.send('openmodal', 'choose'); } doesn't work (because view object undefined, see further down in utils), using: didtransition: function() { settimeout(function() { self.send('openmodal', 'choose'); }, 0); } does work. why not work standard call? guess it's problem synchronicity. the utils looks following: import ember 'ember'; export default { open: function(id) { console.log('utils open'); var modal = ember.view.views[id]; // test output debugging console.log(modal); modal

string - Replace first and last digit with * in php -

i want replace 1st , last digit of number series *. such have $number = 123435987345735372; i want such *535738753957353* like this? $number = 123435987345735372; $new_number = substr($number, 1, -1); $new_number = "*".$new_number."*"; echo"original number: $number<br>new number: $new_number"; like norbert van nobelen said, check out manual @ php.net

How to animate background color in jQuery? -

what doing wrong following doesn't animate background color? <div style="height:100px;width:100px;background:red">animate this</div><br> <input type="button" id="mybutton" value="start"/><br> $("#mybutton").click(function(){ $("div").animate({backgroundcolor: 'blue'}); }); http://jsfiddle.net/bjf2l0ha/ you need import additional plugin such jquery ui in order support color in animate() function jquery alone doesn't. $("#colorbtn").click(function() { $('#demodiv').animate({backgroundcolor: 'blue'}) }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <input type="button" id="colorbtn" value="change color"/><br> <div

php - How to serialize a view response? -

i'm working on (unfortunately no 1 responded): https://stackoverflow.com/questions/31057493/laravel-caching-while-using-ajax i've changed code cachefilter.php this: public function fetch(route $route, request $request) { $key = $this->makecachekey($request); if( cache::has($key) ) return cache::get($key); } public function put(route $route, request $request, response $response) { $key = $this->makecachekey($request); if( !cache::has($key) ) cache::put($key, $response->getoriginalcontent(), 60); } protected function makecachekey(request $request) { $ajaxrequest = json_encode($request->ajax()); if($ajaxrequest == 'true') { return 'ajax_route_' . str::slug($request->url()); } else { return 'route_' . str::slug($request->url()); } } i'm getting error: serialization of 'closure' not allowed from following line of code: if( !cache::has($key) ) cache::put($k

go - Why must I convert an integer to a float64 to type match? -

i have been playing around go , ran (non?)feature of go while running following code: a := 1 //int b := 1.0 //float64 c := a/b //should float64 when ran following run-time error: invalid operation: / b (mismatched types int , float64) i thought golang supposed pretty type inference. why should necessary me write: c := float64(a)/b //float64 in general, given 2 number types, c should inferred smallest type contains both. can't see being oversight, trying figure out why behavior decided upon. readability reasons only? or suggested behavior cause kind of logical inconsistency in language or something? this mentioned in faq: why go not provide implicit numeric conversions? the convenience of automatic conversion between numeric types in c outweighed confusion causes. when expression unsigned? how big value? overflow? result portable, independent of machine on executes? complicates compiler. that why need: either explicit type conv

amazon web services - Can I use loopback of version higher than 2.0 on AWS? -

i trying develop server-side using loopback database connector. however, quite confused installing loopback on aws. reference installing loopback on aws this website mentioned loopback of version 2.0 installed. yet, when browse through loopback website, https://strongloop.com/strongblog/how-to-setup-push-notifications-private-mbaas-amazon-aws-part-1/ , website shows seems possible install loopback of version higher 2.0 on aws. since there features available after version 2.1x, nice if aws allows installation of loopback of version higher 2.0. me solve problem? btw, using free tier of aws , not intend pay @ moment. even if install image comes preconfigured loopback 2, should able upgrade newer versions using npm ( sudo npm install -g strongloop , like). imagine if there's security issue you'd need wasn't backported whatever reason...loopback files , image linux. have free reign update/upgrade whatever need. my recommendation start out minimal ubuntu image

php - Recursively update every element of multidimensional array -

i have large multidimensional array this: $array = [ 'a' => 1, 'b' => 5, 'c' => [ 'c1' => 12, 'c2' => [ 'd1' = 4, 'd2' => 25 ], 'c3' => [/*...*/] ] ]; the array of unknown size , dimension , trying modify each element, example add 1 every elements value. i've been googling around , found recursive functions visit each element , print contents out, nothing modifying each element go. the following code (that found online) function x($a) { if (!is_array($a)) { echo ($a+1); return; } foreach($a $v) { x($v); } } allows me print out contents of array, how modify update array elements calculation instead of echoing out? array_walk_recursive ($array, function (&$val) { $val += 1; }); print_r($array);

C++ increment ++ operator overloading -

i know how overload operator += if using class e.g. class temp { public: int i; temp(){ = 10; } int operator+=(int k) { return i+=k; } }; int main() { temp var; var += 67; cout << var.i; return 0; } but why cant create overloaded += function basic datatype int operator+=(int v, int h) { return v += (2*h); } int main() { int var = 10; var += 67; cout << i; return 0; } i getting error when compiling above overloaded function. operator overloading not supported primitive types. these operations performed direct cpu instructions. reason though, code overloads basic arithmetic functions impossible maintain.

Apache Phoenix on Spark - Unable to insert to Phoenix HBase Tables/Need suggestion for Best practice -

i have table structure below. trans_count start_time, end_time, count 00:00:01 00:00:10 1000 00:00:11 00:00:20 800 spark listens events kafka , grouping 10 seconds , have insert phoenix hbase table. after 10 seconds, have first check if start_time,end_time combination in table. if there, have take existing count , add new count , upsert again. upsert trans_count(start_time, end_time, count) select start_time, end_time, count? trans_count start_time = ? , end_time = ? if no rows upserted in above statement, upsert data. in apache storm, able create phoenix connection object in configure method , able use same connection once every 10 seconds upsert. in spark, not create connection object , use same object every object in rdd. output spark javadstream> start_time, end_time, count keys in map. i end creating connection object every iteration of rdd, feel not right way. have read p

[PHP][Youtube api v3] retrieving the informations for a single video -

i'm getting trouble youtube api. retrieve informations single video. what got : i can videos specified playlist informations (like title, description etc) i id playlist url : $playlist = $_get['pl']; then videos informations playlist : $response = $youtube->playlistitems->listplaylistitems('id,snippet,contentdetails', ['playlistid' => $playlist, 'maxresults' => '10']); then can , show informations videos foreach : foreach($response['items'] $video){ echo $video['contentdetails']['videoid']; echo $video['snippet']['title']; echo substr($video['snippet']['description'], 0, 430);} what want : now put videoid link : href="index.php?requ=video&v=<?= $video['contentdetails']['videoid']; ?>&pl=<?= $playlist ?>" this way can videoid other page in embed video : $vid = $_get['v']; <iframe height =&q

asp.net - Changing Text In Document Created By Webform -

so have weird problem caused lack of knowledge of how 2013 vs works, because of lack of thorough documentation on subject. i trying take document generated employment application form made, , format text on document doesn't make hr want tear out eye balls, run road block every time. my favorite road block paragraphs. dim rng word.range = me.paragraphs(1).range every time try use error saying paragraphs not member of of webform. pretty sure because not importing right references in document. here ones using: imports system.web.providers.entities imports microsoft.office.interop imports system.windows.documents imports system.io imports system.drawing then tried changing font directly using: richtextbox1.font = new font(fontname.text, 10, fontstyle.regular) but error saying richtextbox1 not declared. when try change font of: lastnamebox.font = new font(fontname.text, 10, fontstyle.regular) it of course tells me font read only. have been searching on google , t

nginx - Meteor.js: Is it possible to change the base path in the URL? -

i access entire app using url http://localhost:3000/theapp instead of http://localhost:3000/ . in html source of app built using meteor build : <html> <head> <link rel="stylesheet" type="text/css" class="__meteor-css__" href="/8b140b84a4d3a2c1d8f5ea63435df8afc22985aa.css?meteor_css_resource=true"> <script src="/215e9bb1458d81c946c277ecc778bae4fc8eb569.js"> ... i'd change base path / /theapp , above <link> , <script> tags become: <link rel="stylesheet" type="text/css" class="__meteor-css__" href="/theapp/8b140b84a4d3a2c1d8f5ea63435df8afc22985aa.css?meteor_css_resource=true"> <script src="/theapp/215e9bb1458d81c946c277ecc778bae4fc8eb569.js"> the reason requirement i'm trying use nginx forward requests different meteor apps based on path in url: http://localhost/app1 ==> http://meteor-app1 http://localho

html - How do align texts in the child div -

i trying text-align center on div texts. texts inside div needs aligned left. in jsfiddle html <div class="parent"> <div class="texts">my text text text<br>my textmy text</div> </div> css .parent { text-align:center; } .texts{ //not sure } i need have texts div center inside parent div no indentations on 2 lines of texts. can't set widths because needs responsive. how solve this? thank you! https://jsfiddle.net/bh4pu001/ use .parent { text-align:center; } .texts{ display: inline-block; text-align: left; } <div class="parent"> <div class="texts">my text text text<br>my textmy text</div> </div>

groovy - In JIRA: Edit Parent Field on Sub-task Transition -

i'd edit couple of parent issue's fields @ same time transition status of sub-task. fields can edit in transition screen apply subtask transitioning how edit parent field on sub-task's transition screen? i need add to, or edit existing body of text on in parent field, opposed overwriting what's there. using post functions copy field subtask parent wont work (as far can see). problem post-functions don't occur until after transition screen finished, means can't copy on latest version of parent field editing on sub-task's transition screen. are there add-ons i'm missing allow me this? thanks! one way: using rest , javascript can this, on transition popup parent field values using rest api , populate values on subtask fields, can edit/modify values using post function can copy values fields in parent issue. others might have different solution..

less - Loop through files in a directory or a list -

i trying generate multiple css classes single .css file used body element of page change page's entire color scheme. i have folder of .less files containing variables @base00 @base0f specific color scheme ( https://github.com/andrewbelt/hack.chat/tree/master/client/base16 ) , import each of these files each css class name. here's psuedocode achieve need. // syntax not exist in less each @scheme in ./base16/ { @import "@scheme" body.@{scheme} { background: @base00; color: @base07; } ... } i might have think outside of box one, creating makefile build replacing variable command line , concatenate each .css file generated less single master .css file. perhaps there more elegant way using pure less. no, there's no built-in file system functions/features less. (it's designed work in several environments , of not permit "directory sniffing"). if necessary 1 can write plugin provide such functionalit

javascript - Filtering a property with multiple values for one field - List.js and Filter.js -

i using list.js plugin along it's filter extension produce search results page allows user filter down end results make easier them find looking for. i have been using api try , come solution in honesty little dated , not sure when last updated. http://www.listjs.com/docs/list-api my code follows: html <div id="search-results"> <div class="col-md-3"> <div class="panel panel-warning"> <div class="panel-heading">filters</div> <div class="panel-body"> <div class="search-filter"> <ul class="list-group"> <li class="list-group-item"> <div class="list-group-item-heading"> <h4>filter options</h4> </div> </li> <li class="list-group-item"> <div class="name

Change starting point, scale in ggvis for R -

i trying create line graph want change y-axis scale goes 0 - 0.5 , 1 goes 0 - 1 . whenever use "values" argument not getting me graph wanted. current code: lnhfbycircleper %>% ggvis(~timepoint, ~circlepercentage, stroke = ~lnhf_split) %>% layer_lines() %>% layer_paths(data = lnhfbystarper,x = ~timepoint, y = ~starpercentage, stroke = ~lnhf_split, strokedash := 6) %>% add_axis("y", title = "percentage of deck chosen") %>% add_axis("x", title = "time point", orient = "bottom") no worries. learned done "scale_numeric("y", domain = c(range))" function.

php - 'mysqldump' is not recognized as an internal or external command -

currently im trying make backup , restore mysql database in laravel project. using laravel package https://github.com/backup-manager/laravel backup package. follow intructions, when trying backup local database through command line (php artisan db:backup) in last question, got message. dumping database , uploading... [backupmanager\shellprocessing\shellprocessfailed] 'mysqldump' not recognized internal or external command, operable program or batch file. i googling it, , put c:\xampp\mysql\bin windows env variables paths, still having issue. if know how fix this, please tell me, appreciate it. laravel 5.1.x it because mysqldump.exe not found in location, right path given bellow open command prompt , type cd c:\program files (x86)\mysql\mysql server 5.5\bin press enter then type mysqldump.exe or, directly open directory "c:\program files (x86)\mysql\mysql server 5.5\bin" , press left shift key keyboard , right click on d

c# - Why the explorer handle window trying bring it to the screen front doesn't do anything? -

it's working other handles windows. process[] processes = process.getprocessesbyname(processname); setprocesswindow.bringtofront(processes[0].id); setprocesswindow.centerprocesswindow(processes[0].id); if processname example taskmgr bring front of screen , center task manager. but if example processname explorer (not internet explorer explorer in case directory on hard disk) won't bring front not anything. this setprocesswindow class: using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using system.runtime.interopservices; using system.diagnostics; using system.windows.forms; using system.drawing; namespace automation { class setprocesswindow { [dllimport("user32.dll", charset = charset.auto, exactspelling = true)] private static extern intptr getforegroundwindow(); [dllimport("user32.dll", charset = charset.auto, setlasterror = true)]

android - How to start animation one by one using onAnimationend()? -

Image
i making animation consist of 7 circles. i used interpolator , draw circles on canvas, animation quite okay. want each of circles starts 1 one (one after another)/ i developed library project , following java file. import android.animation.animator; import android.animation.animatorlisteneradapter; import android.animation.objectanimator; import android.animation.valueanimator; import android.content.context; import android.content.res.typedarray; import android.graphics.canvas; import android.graphics.paint; import android.graphics.drawable.shapedrawable; import android.graphics.drawable.shapes.ovalshape; import android.util.attributeset; import android.view.view; import android.view.animation.acceleratedecelerateinterpolator; import android.view.animation.anticipateovershootinterpolator; import android.util.log; import android.view.animation.linearinterpolator; import teamdapsr.loaders.lib.utils.measureutils; /** * created devesh on 08-jul-15. */ public class cubicbez

android - Parse.com relations with ParseObject -

i'm trying fix relation between 2 parseobjects: place & visit. tried method of extending objects parseobjects clean approach. problem related place object not saved. place: @parseclassname("place") public class place extends parseobject { public place() { } private string title; private parsegeopoint geopoint; public string gettitle() { return title; } public void settitle(string title) { this.title = title; } public parsegeopoint getgeopoint() { return geopoint; } public void setgeopoint(parsegeopoint geopoint) { this.geopoint = geopoint; } //get distance current location public double getdistance(parsegeopoint currentlocation) { return this.geopoint.distanceinkilometersto(currentlocation); } } visit @parseclassname("visit") public class visit extends parseobject { public visit() { } private long timestamp; private long du

php - Redis SCARD returning the wrong results? -

i'm adding large number of data points redis set: $t = 0; $redis = redis::connection(); foreach($adv $a) { $t = $t + 1; print($t); //prints log $test = $redis -> sadd('database/ab/al', $a -> id); print($test); //prints log } when call redis->scard('database/ab/al') result 9832 , answer should getting 9866 $t counter put in check how many iterations loop doing, , $t 9866 after running loop, weird considering scard returning 9832 then thought maybe there duplicates being added, logged response sadd 1 [2015-06-29 16:24:55] local.info: 1 [] [] 2 [2015-06-29 16:24:55] local.info: 1 [] [] 3 [2015-06-29 16:24:55] local.info: 1 [] [] 4 [2015-06-29 16:24:55] local.info: 1 [] [] 5 [2015-06-29 16:24:55] local.info: 1 [] [] 6 [2015-06-29 16:24:55] local.info: 1 [] [] ... 9861 [2015-06-29 16:24:59] local.info: 1 [] [] 9862 [2015-06-29 16:24:59] local.info: 1 [] [] 9863 [2015-06-29 16:24:59] local.info: 1 [] [] 9864 [2015-06-29 16:24:5

Efficient saving of Android AdMob interstitials -

scenario: activity initializes , loads admob interstitial. activity b starts on top of a, can cause destroyed reclaim resources. when user comes activity a, needs recreated , interstitial downloaded again. what best way preserve downloaded interstitial? the method onsaveinstancestate seems unsuitable this. the best solution have single activity , use 2 fragments within activity. way interstitial never destroyed.

Are there any tools with a GUI to manage Selenium Webdriver test runs and results? -

are there tools gui allow managing selenium webdriver test execution , displaying pass/fail results on screen? if not, there full test management tools qc can integrated selenium start tests , store results? use jenkins , open source tool. that allow to: run different tests different jobs run tests headless browsers integrate testng/custom reports track results in html format.

Manipulate RFC 2822 email in javascript -

i creating chrome extension works gmail api. email format followed based on rfc 2822. want modify email. there standard library in javascript manipulate rfc 2822 compliant email? i mailparser andris9. made node, can browserify or inspiration source. when have parsed it, can manipulate other library, mailcomposer .

version control - Query about mercurial heads diagram and heads counting -

i need understand in of following lines number of heads change. im finding hard understand going on in line 15.. know when repository doesn't have same change-sets when pulling or pushing repository there +1 head. my diagram looks when tried solve it: line 12: push clone2 main repository line 15: push clone2 clone1 (because r3 doesn't similar r1) line 17: pull r2 & r1 main repository, since r1 , r3 there, i've added r2 . total heads created: +3 main repository: o--------r2 \----r1 clone 1: o--------r1 \---r3 \---r2 clone 2: o------r2---------r3 \--r1--/ the mercurial commands below: 1: /home/user> hg clone http://remoteserver/mainrepository clone1 2: /home/user> hg clone http://remoteserver/mainrepository clone2 3: /home/user> cd clone1 4: /home/user/clone1> echo 1 > a.txt 5: /home/user/clone1> hg add a.txt 6: /home/user/clone1> hg commit -m "

azure - Certificate Issue with Custom Domain of Web App and Traffic Manager -

i have created 1 web app on azure , deployed in 2 regions. now, using traffic manager have used failover configuration. having custom domain, have used individual domains per web app. so, each of web app has 3 domains (i) ... azurewebsites.net (ii) ... trafficmanager.net (iii) .... mycustomdomain-region1.com same second web app 3 domains. as have correctly configured, customdomain-region1.com working without ssl certificate error. but when use trafficmanager.net based url giving me azurewebsites.net certificate error. why check azurewebsites.net though having custom domain , certificate configured in both web app. i have clicked "continue website (not recommended). " , got error 404 - web app not found page image attached here... 1) https://social.msdn.microsoft.com/forums/getfile/685720 2) https://social.msdn.microsoft.com/forums/getfile/685723 the ssl *.azurewebsites.net shared ssl. if want use ssl custom domain need purchase , configure separately. i