Posts

Showing posts from July, 2014

mysql - Table insert unexisting values -

current situation tblgamepoints id gamenumber playerid game points ----------------------------------------------- 1 1 fps 150 2 1 b fps 150 3 2 fps 100 4 2 b fps 75 when starting gamenumber 3 add empty rows of game in case not allready have points (penalty points). example 1: id gamenumber playerid game points ----------------------------------------------- 1 1 fps 150 2 1 b fps 150 3 2 fps 100 4 2 b fps 75 in example above, there aren't existing rows gamenumber 3 insert statement should insert games points 0 playerids example 2: id gamenumber playerid game points ----------------------------------------------- 1 1 fps 150 2 1 b fps ...

d3.js - Extending c3js with d3js code -

i new c3js, apologies if question sounds basic. c3js library seems powerful yet there features in d3js not available in c3js plan use inside c3js code. has experience in using d3js code c3js or using d3js inside or c3js code. reference, plan use click functions present in d3js on visualizations built in c3js. thanks while can access c3 chart elements using classes c3 uses (you can find full list of classes in source @ https://github.com/masayuki0812/c3/blob/master/c3.js#l5754 ), wouldn't right way attach click handlers - reason being c3 charts rendered in layers , click event may not triggered because it's used layer comes above. for instance, while var chart = c3.generate({ data: { columns: [ ['data1', 30, 200, 100, 400, 150, 250], ['data2', 130, 100, 140, 200, 150, 50] ], type: 'bar' } }); d3.selectall('.' + c3.chart.internal.fn.class.bar + ':nth-child(2)').attr...

Cant Increase Android Studio's Memory Heap -

Image
i using latest version of android studio 1.3 preview beta release. working slow on system (ram 4gb). when try edit java or xml file in editor takes 3-4 second write word. have followed this blog increase android studio's memory heap size. have updated studio64.exe.vmoptions file @ path c:\program files\android\android studio\bin\studio64.exe here inside vmoptions file: -xms128m -xmx4096m -xx:maxpermsize=1024m -xx:reservedcodecachesize=200m -xx:+useconcmarksweepgc -xx:softreflrupolicymspermb=50 -ea -djna.nosys=true -djna.boot.library.path= -djna.debug_load=true -djna.debug_load.jna=true -dsun.io.usecanoncaches=false -djava.net.preferipv4stack=true -xx:+heapdumponoutofmemoryerror -didea.paths.selector=androidstudiopreview1.3 -didea.platform.prefix=androidstudio but android studio memory heap remains same after changes in file. here screen shot still 512m: please suggest other solution? this file ignored android studio. on windows path update is %userprofil...

Using process in c# to run multiple matlab scripts -

so have matlab script initializes values , want run matlab script. there way tell process run script after first one. here's code, works fine runs 1 script. processstartinfo info = new processstartinfo(@"matlab.exe", @"-r script1"); process process = new process(); process.startinfo = info; process.enableraisingevents = true; process.start(); process.waitforexit(); process.exited += new eventhandler(myprocess_exited); evhandledgetlatest = process.hasexited; how can after script1 run script2? want run script1 , script2 in same process, script2 needs have values (in matlab workspace) created script1. if i'd consider calling matlab script directly c#. approach allow results script1 , pass them script2. you'll need add reference matlab com object. for full details see: http://www.mathworks.com/help/matlab/matlab_external/call-matlab-function-from-c-client.html

python - pandas handle NaN/None inserts into sybase -

is there working solution insert nan/none values pandas dataframe sybase-ase tables? i tried suggested solution after researching online (for pandas side): df.where(pd.notnull(df), none) however, when try insert sybase-ase using bulk_copy/bcp, none gets inserted 'nan.0' reason. any ideas why happen or knows of workaround accomplish these insertions of nan/none null sybase? [sybase supports null] full stacktrace databaseerror: df.to_sql('test_table', engine, if_exists='append', index=false, chunksize=1) traceback (most recent call last): file "<stdin>", line 1, in <module> file "/7ff6xgw24wvny74gfgzcvf6p88vc6k1a-pandas-0.15.2-16/lib/pandas/core/generic.py", line 966, in to_sql dtype=dtype) file "/7ff6xgw24wvny74gfgzcvf6p88vc6k1a-pandas-0.15.2-16/lib/pandas/io/sql.py", line 538, in to_sql chunksize=chunksize, dtype=dtype) file "/7ff6xgw24wvny74gfgzcvf6p88vc6k1a-pandas-0.15.2-16/lib/pan...

svn - Android Studio with Subversion on Windows works fine, but keeps throwing errors -

my environment android studio, win 7, subversion. everything works fine, however, related subversion, commits, updates keeps throwing errors if didn't work. but worked! when commit change, colleagues can update files , changes there. it's these annoying random messages. this message when update repository: error:svn: e155000: failed add directory 'app/build/intermediates/res/debug': unversioned directory of same name exists work, because can see changes colleagues. this when try check in error:warning: post-commit fs processing had error 'attempt write readonly database'. weird... still working fine! what's happening , how can rid of these error messages? thanks help. i fixed problem going on subversion server , adding permissions write group on file: /home/svn/repos/db/rep-cache.db hope helps else.

css - Why does my <ul> have a background of an element which isn't its parent? -

i trying build page header, includes navigation bar @ bottom. however, navigation bar has background colour of main content, not of header. i searched site similar problems, , tried overflow: hidden, or adding overflow: auto .main, suggested, none of these solutions worked. have tried removing lines css, such float: left; didn't work. adding background: inherit ul gives background colour small area around nav bar, not width of header. .main { background-color: darkolivegreen; border-radius: 15px; max-width: 1000px; margin: 0 auto; text-align: center; height: 800px; } header { background: chartreuse; border-radius: 15px 15px 0 0; padding: 10px 10px 10px 10px; } ul { float: left; display: block; position: absolute; margin-left: -45px; } li { display: inline; background: cyan; border: 2px solid black; border-radius: 5px 5px 0 0; margin-left: -5px; } h1 { font-size: 35px; margin: 10px 0 0 0; } img { ma...

javascript - Angular.js compile partial view controller -

hi have mvc application, home page , partial view ( info.cshtml ) in homepage. when add angularjs controller _layout (after: var mymodule = angular.module("mymodule", ["kendo.directives"]);) , have in info.cshtml : <div id="aaaa" ng-controller="test">{{msg}}</div> <script> ///!!!!!!!!!!!!!important, not remove!!!!!!!!!!!!!! var $injector = angular.element($('#aaaa')).injector(); var element = angular.element($('#aaaa')); $injector.invoke(function ($compile, $timeout) { var scope = element.scope(); $compile(element)(scope); $timeout(function () { scope.$apply(); }); }) </script> , ok, when add controller directly info.cshtml breaks "error: [ng:areq] argument 'test' not function, got undefined" : <div id="aaaa" ng-controller="test">{{msg}}</div> <script> mymodule.controller(...

javascript - run a function before Firefox close the window -

this first topic here! so, i'm trying run ajax function before firefox's window close, code works when close tab, window not. how can this? detail: firefox don't run function when window closed , if possible without use jquery. window.onload = function(){ window.addeventlistener('beforeunload',function(event){ var ajax = new xmlhttprequest(); ajax.open("post","index.php",true); ajax.send(); }, false); } try navigator.sendbeacon var some_ajax_data; window.onbeforeunload = function() { navigator.sendbeacon('/data.php', some_ajax_data); };

objective c - Published app now won't run in XCode 7 simulator -

i have app has been in app store 2 years. published ios 7, updated , runs under ios 8, , downloaded xcode 7 make sure ready when ios 9 hits streets. i getting exc_bad_access error when run app in simulator, not when run on test device running ios 9. i using nsurlsessiondownloadtask pull file down server: nsurlsessiondownloadtask *getthenoticefromtheserver = [session downloadtaskwithrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:completefilepath]]]; [getthenoticefromtheserver resume]; the error hits after call resume. again, when run on simulator in xcode 7. works champ on ios9 device , on xcode 6 simulator well. else seen while using nsurlsession xcode 7? thanks! scott well thought xcode 7 beta 3 fixed this, changed behavior. app run fine on device itself, or in simulator. crash happens when run on device within xcode...you know, during development , debugging. awesome.

akka http - Outgoing connection stream closed -

i have actor behaviour: def receive: receive = { case info(message) => val res = send("info:" + message) installackhook(res) case warning(message) => val res = send("warning:" + message) installackhook(res) case error(message) => val res = send("error:" + message) installackhook(res) } private def installackhook[t](fut: future[t]): unit = { val answerto = sender() fut.oncomplete { case success(_) => answerto ! "ok" case failure(ex) => answerto ! ex } } private def send(message: string): future[httpresponse] = { import context.system val payload: payload = payload(text = message, username = slackconfig.username, icon_url = slackconfig.iconurl, icon_emoji = slackconfig.iconemoji, channel = slackconfig.channel) .validate http().singlerequest(requestbuilding.post(slackconfig.hookaddress, payload)) } and test va...

square connect - Add to Cart Programatically -

our shop sells ingredients , supplies, it's hassle our customers scroll through our entire huge inventory few things need or click of our pre-built recipes. i'm trying make script add items programmatically on our website, i'm running problems. since squareup uses cookies store cart, can't send data cart because of cross-domain access. i've tried using embedded iframe menu, still doesn't let me filter results or add script "hack" mouseclick on items add recipes. i don't know if belongs in connect api tag, last place figured me. i've read docs , saw billing wasn't available, i'm adding items cart. think have sort of ?cart-[shopname]= query appended "checkout" link. there, use connect api find item/variation codes , create json markup added cart's cookie. basically, problem know of no way add items cart programatically. we keep using squareup, we'd more sales magento or shopify since can filter results ,...

ios - App is not visible in App Store for iPad -

i have application. application supports iphone only, can launch on ipad. in itunesconnect see "your binary doesn’t support ipad. screenshots or app video preview ipad won’t shown on app store." so far understand shouldn't see screenshots ipad, should see application in app store (when @ ipad). but when search application in ipad can't find there (but iphone ok). why? when search app in ipad version app store there 2 categories: ipad , iphone only. you'll find iphone app in iphone category. to change category there navigation item button left one

javascript - Json request working on safari but not chrome/firefox -

http://www.imobilus.co.uk/json%20request/index.html - live version https://jsfiddle.net/5p6h3rtt/ cannot work out @ all, new jquery works perfect on safari blank on chrome , firefox $( document ) .ready(function() { $.ajax({ type: 'get', url: 'http://www.reed.co.uk/api/1.0/search?keywords=imobilus%20jobs', beforesend: function(xhr) { xhr.setrequestheader("authorization", "basic " + btoa(' b110030d-7491-48fe-9354-05c0ec0181d7' + ":" + '' )); }, data: { username: 'b110030d-7491-48fe-9354-05c0ec0181d7', password:'' }, datatype: 'json', success: function (data) { console.log(data.results); if(data.results.length > 0) { var numberofresults = data.results.length; $('.container').append('<div>found '+numberofresults+' results</div>'); $.each(data.results, function(index, element...

Where is the Open Source repository for Swift 2.0? -

apple announced swift becoming open source since 2 weeks , in web site https://developer.apple.com/swift , no information provided find repository, documentation or linux implementation announced @ wwdc. someone have information ? if have read says released later year. find no repository yet open source later year swift released open source. swift’s unique combination of elegance, power, , safety has opportunity move entire software industry forward. exciting imagine build together late year update: www.swift.org

performance - vb.net Is it better to do multiple OrElse's, or a single check if Mod = 0 -

there 2 easy ways check whether month first of quarter. the first way: if month = 3 orelse month = 6 orelse month = 9 orelse month = 12 'do stuff end if the second way: if month mod 3 = 0 'do stuff end if to me, both equally readable. though functionally different, long month known between 1 , 12 inclusive, same logic. way should used? in worst case, if month = 12 , there 4 comparisons performed. doing modulus , 1 comparison faster (not it's significant performance difference)? as davedoknjas stated in comments above, use method follows logic more clearly. if logic determines must because month 3rd, 6th, 9th, or 12th month in year, use: if month = 3 orelse month = 6 orelse month = 9 orelse month = 12 'do stuff end if but, on other hand, if need because number of month evenly divisible 3, use: if month mod 3 = 0 'do stuff end if the difference in performance miniscule wouldn't noticeable. in end, both evaluate t...

jquery - How to put new sequence in a Sortable Table wtih <input> field -

i put jsfiddle explain better need. i created similar table of work orders have in our system. created form able sort working sequence (the priority). added sortable plugin , can drag , drop place. however, cannot figure out how put new sequence input field call "sequence" in example of avtex blog steven ray can done need, except change line: //renumber table rows function renumber_table(tableid) { $(tableid + " tr").each(function() { count = $(this).parent().children().index($(this)) + 1; //alert(count); //$(this).find('.priority').html(count); <--- original line ////// i'm trying select input field, ////// , place value of count it. not ////// working, cannot figure out correct line. $(this).find('.priority').("input").val(count); }); } thank in advance curing ignorance. jp in kc thanks hackerman making jsfiddle work! the answer question is: ...

dynamic - How can I access the query for my cfoutput dynamically, based on a query name variable? -

i have struct contains 2 queries. have variable "key" of 1 of queries, , want output query dynamically using variable. basic code: <cfquery name="myqueries.names" ... >...</cfquery> <cfquery name="myqueries.places" ... >...</cfquery> <cfset queryname = "places" /> <cfoutput query="myqueries[queryname]"> ... </cfoutput> this gives me error attribute validation error tag cfoutput. the cfoutput "query" attribute doesn't seem support bracket notation. how can access query cfoutput? the query attribute of cfoutput requires valid variable name , can set intermediary value , use reference query <cfset realquery = myqueries[queryname]> <cfoutput query="realquery"> ... </cfoutput>

Starting Mesos slave in Docker on Amazon Linux results in cgroup error -

i'm taking docker-compose setup that's working on mac, , trying running on couple of aws ec2 instances. mesos master docker container came fine, did zookeeper/marathon, mesos slave having trouble: $ sudo docker run --name mesos-slave1 -p 5051:5051 \ -e "mesos_log_dir=/var/log" -e "mesos_master=zk://10.x.x.x:2181/mesos" \ -e "mesos_hostname=172.17.42.1" -e "mesos_port:5051" \ -e "mesos_isolator=cgroups/cpu,cgroups/mem" -e "mesos_containerizers=docker,mesos" \ -e "mesos_executor_registration_timeout:5mins" \ redjack/mesos-slave:0.21.0 i0708 19:26:09.559125 1 logging.cpp:172] info level logging started! i0708 19:26:09.569294 1 main.cpp:142] build: 2014-11-22 05:29:57 root i0708 19:26:09.569327 1 main.cpp:144] version: 0.21.0 i0708 19:26:09.569340 1 main.cpp:147] git tag: 0.21.0 i0708 19:26:09.569350 1 main.cpp:151] git sha: ab8fa655d34e8e15a4290422df38a18db1c09b5b failed creat...

tcp - How do sockets and ethernet work together? -

say have 2 computers connected single ethernet cable, using tcp/ip. if computer 1 connects computer 2 using port 12345, , computer 2 connects computer 1 port 54321, happens when both computers sending constant flow of data simultaneously? do computers each half of ethernet cable use 1 way pipes or take turns sending data through ethernet cable 1 piece of data being transmitted through @ time? on physical layer (and assuming regular cat5 tp cables , ethernet hardware), each communication partner has own pairs of wires, allowing both send , receive @ same time. called full duplex operation . in older hardware, such token ring, several computers must share same lines , can use full duplex in special situations. luckily (as has been pointed out), tcp/ip sockets work on higher layer in protocol stack , highly abstracted actual type of physical access. can have many open connections between 2 parters want, virtually @ least. network stack wraps communication packets, marks p...

html - Adjust width of td with rotated headers -

i have table uses javascript show or hide columns. column headers rotated 90 degrees. everything works functionally, there 1 issue haven't been able figure out. width of columns should 20px. appears width of column equal of div before rotated. i have tried adjusting width of div inside tds 20px. in case width of column correctly adjusts 20px, header text appears cut off. i've tried compensating via setting overflow: visible; when columns visible, appears change actual position of header divs. idea how can working? here code (background colors added visualize position of div relative td). function showhidematrix() { var privcells = document.getelementsbyclassname('privcol'); var privmatrixcells = document.getelementsbyclassname('privmatrixcol'); (var = 0, ilen = privcells.length; < ilen; i++) { if (privcells[i].style.height === '' || privcells[i].style.height != '0px') { privcells[i].style.he...

javascript - R leaflet package produces blank (grey) map [Ubuntu 14.04] -

i tried out examplecode leaflet package doc: devtools::install_github("rstudio/leaflet");library(leaflet) m <- leaflet() %>% addtiles() %>% # add default openstreetmap map tiles addmarkers(lng=174.768, lat=-36.852, popup="the birthplace of r") m # print map but produced grey, blank map in rstudio viewer, in firefox 38.0. maybe has ubuntu? here sessioninfo: > sessioninfo() r version 3.2.1 (2015-06-18) platform: x86_64-pc-linux-gnu (64-bit) running under: ubuntu 14.04.2 lts locale: [1] lc_ctype=de_de.utf-8 lc_numeric=c c_time=de_de.utf-8 c_collate=de_de.utf-8 lc_monetary=de_de.utf-8 [6] lc_messages=de_de.utf-8 lc_paper=de_de.utf-8 lc_name=c lc_address=c lc_telephone=c [11] lc_measurement=de_de.utf-8 lc_identification=c attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] leaflet_1.0.0.9999 rgdal_0.9-2 ...

Cannot build a project in Eclipse C -

when clicking hammer icon build c project, popup comes out following message. errors occurred during build. errors running builder 'cdt builder' on project 'learn c'. illegal character in path @ index 5: learn c as c starter have no clue means, please me out..

javafx - JavaFX8: How to tell when the mouse hovers over the header portion of a table column? -

i'd display legend in popover control when user hovers mouse on 'header' portion of particular tablecolumn . possible? how? if not possible, welcome suggestions other approaches. you can install tooltip on node, trick node in mouse neighbourhood of column header. there way using node.lookup it's not ideal since may change. i think simplest way set own graphic header instead of default text , add tooltip that. tablecolumn<data,string> tc1 = new tablecolumn<>(); tablecolumn<data,string> tc2 = new tablecolumn<>(); tooltip t1 = new tooltip("column one"); tooltip t2 = new tooltip("column two"); tc1.setgraphic(new text("col 1")); tc2.setgraphic(new label("col 2")); tooltip.install(tc1.getgraphic(), t1); tooltip.install(tc2.getgraphic(), t2);

python - matplotlib.pyplot scatterplot legend from color dictionary -

Image
i'm trying make legend d_id_color dictionary scatterplot. how can create legend based on these values actual color? #!/usr/bin/python import matplotlib.pyplot plt matplotlib import colors d_id_color = {'a': u'orchid', 'b': u'darkcyan', 'c': u'grey', 'd': u'dodgerblue', 'e': u'turquoise', 'f': u'darkviolet'} x_coordinates = [1,2,3,4,5] y_coordinates = [3,3,3,3,3] size_map = [50,100,200,400,800] color_map = [color color in d_id_color.values()[:len(x_coordinates)]] plt.scatter(x_coordinates,y_coordinates, s = size_map, c = color_map) plt.show() i want legend instead of color name, have actual color. a orchid c grey b darkcyan e turquoise d dodgerblue f darkviolet one way achieve this: d_id_color = {'a': u'orchid', 'b': u'darkcyan', 'c': u'grey', 'd': u'dodgerblue', 'e': u'turquoise', ...

php - Woocommerce: Show products filtered by attribute -

i want filter products attribute in woocommerce using checkbox or alternatively link. if mark checkbox or click link want products have attribute. how can this? files should edit? edit: need query products have custom attribute 'demo' in case. i'm doing this: $args = array ( 'meta_query' => array( array( 'key' => 'meta_value', 'value' => 'demo', 'compare' => 'like', ), ), ); whats wrong?? thanks! ok got result! i have this: $args = array ( 'post_type' => 'product', 'posts_per_page' => 12, 'meta_query' => array( array( 'value' => 'demo', 'compare' => 'like' ), ), ); thanks anyway help!

javascript - Page wise display is not working as expected -

i trying display records multiples of 5, getting first 5 records again , again. homepage-slideshow.php <select multiple class="form-control " id="sel2" size="10" > <?php session_start(); if (isset($_session["min"]) || isset($_session["count"])) { $time = (int)$_session["min"]; $something = $_session["something"]; $everything = $_session["everything"]; } $count = (int)$_session["count"]; $select_query= "select * video_details c_something = '$something' or c_everything = '$everything' having video_min <= $time limit $count,5"; $select_query_run = ...

r - How to perform further grouping and lookups on aggregated values in .SD for a data.table - -

this related previous question on grouping/lookups on data.table additional output. i trying perform grouping on subset .sd , select values each subset. example, in flights dataset, find out : each airport , month, uniquecarrier , destination has worst avg arrdelay. there 2 levels of aggregation. i have working solution follows.. understand if there better solutions. library(data.table) library(hflights) dt <- as.data.table(hflights) setkey(dt, origin, month) #the solution code... dt[, { t1 <- .sd[, .(mean(na.omit(arrdelay))) , by=uniquecarrier]; max1 <- which.max(t1$v1); t2 <- .sd[, .(mean(na.omit(arrdelay))) , by=dest]; max2 <- which.max(t2$v1); list( maxavgdelayforcarrier = t1$uniquecarrier[max1], maxavgdelaybycarrier = t1$v1[max1], maxavgdelaybydest= t2$dest[max2], maxavgdelayfordest= t2$v1[max2] ) }, = .(origin, month)] # checking correctness head(dt[ .("hou", 1), .(maxavgdelaybycarrier=mean(na.omit(arrdelay))), by=uniquecarrier][or...

mysql - Rails Active record doesnt have X as Y field -

rails beginner, query works on mysql -- select x y doesnt seem working on rails's query. count of field m1 "cnt" ==> active record doesnt exist ( query given works on mysql ) ab.where("m = 1").group("unix_timestamp(m_timestamp) div 6048000 ").select("m_timestamp, count(m1) cnt") ab load (3.5ms) select m_timestamp, count(m1) cnt `a_b` (m = 1) group unix_timestamp(m_timestamp) div 6048000 => #<activerecord::relation [#<ab id: nil, m_timestamp: "2014-08-01 22:21:09">, #<ab id: nil, m_timestamp: "2014-10-05 00:15:23">, #<ab id: nil, m_timestamp: "2014-12-20 11:55:45">, #<ab id: nil, m_timestamp: "2015-02-04 23:45:29">, #<ab id: nil, m_timestamp: "2015-04-02 03:51:14">, #<ab id: nil, m_timestamp: "2015-06-19 22:25:06">]> the above mysql query -- select m_timestamp, count(m1) cnt 'a_b' (m = 1) group unix_timestamp(m_t...

java - Converting a .txt into a .hprof -

i have .txt information of hprof need analyse, problem when opening example memory analyser or other tool same use following error: invalid hprof file header. (java.io.ioexception) invalid hprof file header. is there way convert txt valid hprof in order analyse memory leaks? thanks in advanced provided.

ruby - Is there a way to delete a line in a text file if it matches a specific text? -

my text file contains email/password list set accounts. once i've used email , password combo erase form text file. my text file looks this: email,pass email,pass etc.. once i've used e/p combo delete file: file.open("yahoo_accounts.txt") |email| email.each |item| email, password = item.chomp.split(',') emails << email passwords << password emails.zip(passwords) { |name, pass| browser = watir::browser.new :ff #using email , pass file.open("yahoo_accounts.txt", "w") |out_file| file.foreach("yahoo_accounts.txt","r") |line| out_file.puts line unless line == '#{name},#{pass}' end end browser.close end end the problem occurs when try delete them file. "browser.rb:382:in `assert_exists': browser closed (watir::exception::error)", might browser closing. if e/p's extracte...

javascript - Can't call angular ng-click from jQuery -

im trying call ng-click jquery cant work. can tell me how properly? html: <a ng-click="changedata()">testing</a> <a ng-click="changedata()">testing 2</a> <a ng-click="changedata()">testing 3</a> jquery: $(document).keydown(function(e){ if (checknav && checknav()) return; if (e.keycode == 37) { // left setcurrent(x,y-1); e.preventdefault(); } else if (e.keycode == 38) { // setcurrent(x-1,y); e.preventdefault(); } else if (e.keycode == 39) { // right setcurrent(x,y+1); e.preventdefault(); } else if (e.keycode == 40) { // down setcurrent(x+1,y); e.preventdefault(); } else if (e.keycode == 13) { $('a[ng-click="changedata()"]') } }); i want call same function ng-click when clicking enter . works fine if have following code hrefs when clicking enter: } e...

How to pass variable from shell to Ansible playbooks -

i have deploy.sh script call trigger deploy tasks ansible. in simplified form, deploy command triggered deploy.sh deploy_cmd="ansible-playbook -i hosts/$1 deploy.yml --extra-vars="site=$2 theme=$3"" this fragment of task: project_pre_build_commands_local: - path: "{{ project.local_path }}/web/app/themes/{{ theme }}" cmd: npm install - path: "{{ project.local_path }}/web/app/themes/{{ theme }}" cmd: bower install - path: "{{ project.local_path }}/web/app/themes/{{ theme }}" cmd: gulp --production unfortunately shell errors out with: msg: cannot change directory '/home/ltarasiewicz/dev/bedrock-stack/bedrock-ansible/{# project.local_path #}/web/app/themes/{# theme #}': path not exist the theme variable i'm passing deploy.sh 'cpkg'. specified directory exists. more so, if define path like: - path: "{{ project.local_path }}/web/app/themes/cpkg" (get rid of {{ ...

java - javafx keytyped event not working -

i have javafx editable combobox on key typed , key pressed events not firing while key released event firing. however, if change combobox textfield, works. fxml: <combobox fx:id="combo_box" editable="true" layoutx="311.0" layouty="194.0" prefheight="26.0" prefwidth="300.0" prompttext="enter name" onkeytyped="#keyaction" /> fxmlcontroller: public void keyaction(keyevent event) { system.out.println("works"); } help? i found works. can use "geteditor" method of combobox, key_typed event works. put code in controller : this.combo_box.geteditor().setonkeytyped((keyevent e) -> { system.out.println("works"); }); hope helps

javascript - Why does this form keep submitting stale params? -

i have comment form rendered multiple times on page, because each comment associated node , each node rendered multiple times. however, whenever comment sent (via remote), when try send 1 keeps sending first params. see logs here: started post "/nodes/101/comments" 127.0.0.1 @ 2015-07-08 16:48:46 -0500 processing commentscontroller#create js parameters: {"utf8"=>"✓", "comment"=>{"message"=>"comment 1"}, "node_id"=>"101"} user load (2.9ms) select "users".* "users" "users"."id" = 57 order "users"."id" asc limit 1 familytree load (2.7ms) select "family_trees".* "family_trees" "family_trees"."user_id" = $1 limit 1 [["user_id", 57]] role load (1.7ms) select "roles".* "roles" inner join "users_roles" on "roles"."id...

node.js - How to configure Symfony2 and Assetic settings for custom filters [Bootstrap, JQuery]? -

i've been working on symfony2 , problems appeared assetic compilers , filters. knows how make work on windows platform, because every example responds *nix environments? does routes .exe should have format: c:\\....\\ , in order done access to: java.exe , node.exe *nix has paths as: /usr/bin/local or symfony style: /../../ which right option accept? these settings worked me on: windows 8.1 (x64) phpstorm 8.0 nodejs v0.10.35 symfony 2.7 (recently updated) i want share else. these of great achieve result: use twitter bootstrap in symfony2 composer symfony 2 , bootstrap 3 assetic config , base html template twitter bootstrap glyphicons font's not found when using assetic in prod on symfony2 composer.json "twbs/bootstrap": "dev-master", "oyejorge/less.php": "~1.5", "bmatzner/jquery-ui-bundle": "*", "bmatzner/jquery-bundle": "dev-master", ...

Asterisk sip.conf Configuartion for outbound calls -

i'm sending outbound calls asterisk server using sip account. want use separate ips voice signaling these outbound calls. please guide if idea regarding this, how should configure in sip.conf. you can set rtp / media address ip in [general] section of sip.conf : [general] ; media address media_address=10.10.5.2 ; depending on nat & situation might need signalling: externaddr=10.10.5.1 localnet=192.168.1.0/255.255.255.0 then can confirm running: ast*cli> sip set debug on and media address in sdp payload under c= . word wise: make sure check routing on box too, e.g. route -n , make sure things headed expect them to.

sql server - SQLSRV PHP removing selected record -

there not many tutorials in web mssql using sqlsrv driver, followed similar tutorials mysql , using sqlsrv api converting code. far works, can add records popup form etc. now i'm trying delete multiple records checkbox. tried tutorials able find still not work. there no effect after selecting checkbox , pressing delete apart question ondelete script asking me if delete records. i have 2 php files - sqltest.php , delete.php . code sqltest.php <h1>sql testing</h1> <h1>component group modifications</h1> <table class="table_general"> <tbody> <tr> <th>id</th> <th colspan="2">modifications</th> <th colspan="3">applicable worksheet</th> <th>delete</th> </tr> <?php $servername = "thomas-pc\sqlexpress"; $connectioninfo = array( "database"=>"test"); $conn = sqlsrv_connect( $servername, $connectioninfo); i...

android - What's happening to my Fragments? -

i know there tons of questions fragments , read many, seems haven't grasped yet. my app has 9 fragments. on 1 of them, fragment x, playing media , there shows fragment on screen, y. perform that, thought best using replace() . my relevant code: // button clicked, goes x y getfragmentmanager().begintransaction() .replace(r.id.container, fragmenty) .commit(); when onbackpressed() called , fragmenty 1 returned fragmentmanager.findfragmentbyid(r.id.container) : fragmentmanager.begintransaction() .replace(r.id.container, fragmentx) .commit(); expected behavior: it'd remove x , add y. when going back, it'd remove y , add x. what happened: first time go y, y shown expected, x still running hear audio playing. when go back, y disappears , seems fine. however, next time click go y, x destroyed (audio stops playing) , app gets weird, since actionbar shows , shouldn't. moreover, keep hidde...

android - notifyDataSetChanged removes last view -

i have used base adapter populate listview , when removing item list , calling adapter.notifydatasetchanged deleting last view. read other posts instead of deleting last view might hiding last view because count of list decreases 1. can me display required contents. here adapter class public class listoffav extends baseadapter { textview qid,ques,category; arraylist<hashmap<string,string>> flightarray=new arraylist<hashmap<string,string>>(); private static final string tag_qid = "qid"; private static final string tag_ques = "question"; private static final string tag_cat= "category"; context context; listoffav() { } public listoffav(arraylist<hashmap<string,string>> flightlist,context c){ log.v("constructor", string.valueof(flightarray.size())); flightarray=flightlist; context=c; } public int getcount() { // todo auto-gener...

angularjs - Angular route resolve not passing to controller -

for reason whatever cannot data controller no matter do, keep getting error error: [$injector:unpr] unknown provider: initdataprovider <- initdata <- packingscancontroller first file var application = angular.module('reporterapplication', ['ngroute']); application.config(['$routeprovider', '$interpolateprovider', function($routeprovider, $interpolateprovider) { $interpolateprovider.startsymbol('<%'); $interpolateprovider.endsymbol('%>'); $routeprovider .when('/packing/scan.html', { controller: 'packingscancontroller', templateurl: 'packing/scan.html', resolve: { initdata : function () { return "shite"; } } }) etc more code second file application.controller('packingscancontroller', [...

c - Are child windows destroyed automatically if -1 is returned from WM_CREATE? -

lresult callback wndproc(hwnd hwnd, uint msg, wparam wparam, lparam lparam) { switch(msg) { case wm_create: { hwnd hstatic1, hstatic2; hstatic1 = createwindowex(0, l"static", l"", ws_visible | ws_child, 4, 20, 40, 40, hwnd, 0, getmodulehandle(0), 0); hstatic2 = createwindowex(0, l"static", l"", ws_visible | ws_child, 4, 80, 40, 40, hwnd, 0, getmodulehandle(0), 0); return -1; } break; default: return defwindowproc(hwnd, msg, wparam, lparam); } return 0; } are child windows created in wm_create destroyed automatically when -1 returned? hstatic1 , hstatic2 destroyed automatically when return -1 or need call destroywindow() on each 1 of them? all child windows destroyed when window destroyed, , includes when window destroyed during creation returning -1 wm_create .

java - Spring Rest- result page does not display results instead requested resource is not available -

i don't know if i'm doing correctly i'm using spring , creating rest client-server. index.jsp displays form user enters information dog, , click submit , should go result page should displays result (so they've entered). problem when user fills out form , clicks submit error "requested resource not available". can tell me going wrong, why welcome.jsp page create error? index.jsp (contains form) <body> <form action="welcome.jsp" th:action="@{/dog}" th:object="${dog}" method="post"> <p>id: <input type="text" th:field="*{id}" /></p> <p>name: <input type="text" th:field="*{name}" /></p> <p>heartbeat: <input type="text" th:field="*{heartbeat}" /></p> <p>temperature: <input type="text" th:field="*{temperature}" /></p> ...

Fitting a student t distribution in R using fitdistr() yields error “non-finite finite-difference value” -

reproducable example give mentioned error code every time is: (note without set.seed, error comes every time) library(mass) set.seed(seed = 1) data<-rnorm(n = 10000,mean = 0.0002,sd = 0.001) fitdistr(x = data,densfun = "t") the error message is: error in stats::optim(x = c(-0.000426453810742332, 0.000383643324222082, : non-finite finite-difference value [2] in addition: warning message: in log(s) : nans produced the problem "non-finite finite-difference value". fitdistr not give me result. my knowledge: researched , apparently mean parameter negative during iteration. , solution provide better or @ least different starting value. not figure out how , not sure if issue. my question: a) why error message , b)how can fix in r, can fit student-t distribution distributed data?

c++ - Member function with static linkage -

i'm trying understand why following error: class foobar { public: static void do_something(); }; static void foobar::do_something() {} // error! int main() { foobar::do_something(); } this errors "error: cannot declare member function 'static void foobar::do_something()' have static linkage" in g++, , "error: 'static' can specified inside class definition" in clang++. i understand way fix remove "static" in definition of do_something on line 6. don't, however, understand why issue. mundane reason, such "the c++ grammar dictates so", or more complicated going on? i think issue here keyword static has several different meanings in c++ , code you've written above uses them in 2 different ways. in context of member functions, static means "this member function not have receiver object. it's normal function that's nested inside of scope of class." in context of function decl...

Python: Pandas generating downward filling variables in DataFrame -

i have following dataframe df : s 2011-01-26 1 2011-01-27 0 2011-01-28 0 2011-01-29 0 2011-01-30 0 2011-01-31 0 2011-02-01 0 2011-02-02 0 2011-02-03 0 2011-02-04 0 2011-02-05 0 2011-02-06 0 2011-02-07 0 2011-02-08 0 2011-02-09 0 i trying generate following dataframe df : s s1 s2 s3 2011-01-26 1 0 0 0 2011-01-27 0 1 0 0 2011-01-28 0 1 0 0 2011-01-29 0 0 1 0 2011-01-30 0 0 1 0 2011-01-31 0 0 1 0 2011-02-01 0 0 1 0 2011-02-02 0 0 0 1 2011-02-03 0 0 0 1 2011-02-04 0 0 0 1 2011-02-05 0 0 0 1 2011-02-06 0 0 0 1 2011-02-07 0 0 0 1 2011-02-08 0 0 0 1 2011-02-09 0 0 0 1 you can see number of 1 in each columns increases downward multiple of 2. there in pandas function, fillna can specify fill downwards x rows? update in fact, have more complicated ...