Posts

Showing posts from September, 2010

android - Samsung Galaxy XCover/Active button -

the galaxy s4/s5/s6 active , galaxy xcover models have hardware button. in settings user can choose app button should open when pressed. i'm developing app targeted @ galaxy xcover 3. when user opens app first time, want ask user if want let hardware button open app. i have tried register broadcastreceiver on "camera button" event, doesn't work. does know how achieve result? i had same problem , found solution. use code below find keycode. @override public boolean onkeydown(int keycode, keyevent event) { super.onkeydown(keycode, event); system.out.println("keycode -->" +keycode); system.out.println("key event -->" + event ); return false; } then make final int keycode. final int active_button = 1015; and last write onkeydown event. @override public boolean onkeydown(int keycode, keyevent event){ switch(keycode){ case active_button: //your action here return tru

sql - Oracle parallel hint on cluster -

Image
i wanted use parallel hint give best performance in query equi-join query 2 tables in cluster , join column cluster index. i wasn't sure if should use parallel option on 1 of tables parallel(table1, 4) , both of tables parallel(4) or on clusters index parallel_index(index_name, 4) ? here query: select /*+ use_hash(a, b) */a.name, b.price customer a, sales b b.cust_id < 2000 , b.cust_id = a.cust_id; here execution plan query:

scheduler events in mysql using if conditions -

i have written below query create event test_event_03 on schedule every 1 minute starts current_timestamp ends current_timestamp + interval 1 hour declare cnt1 bigint select count(*) cnt1, d.invoice_date invoice_date1 depot_sales__c d, advance_payment_request__c a, supplier_payment__c s d.supplier_code=a.supplier , d.supplier_code=s.supplier , s.supplier=80 if cnt1=0 select count(*) depot_sales__c d end if; i getting below error error code : 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near 'declare cnt1 bigint select count(*) cnt1, d.invoice_date invoice_date1 ' @ line 8 have error in sql syntax; check manual corresponds mysql server version right syntax use near 'if cnt1=0 then' @ line 10 why getting error? the problem can use declare statement inside begin..end block, , @ beginning of block. see mysql documentation @ http://dev.mysql.com/doc/refman/5.0/en/declare.ht

regex - replace a pattern using sed -

i have file containing lot of text , digits describing numbers < 1 3 digits of accuracy. i'd replace numbers equivalent integer percentages (numbers 0-99). 0.734 -> 73 0.063 -> 6 0.979 -> 97 it great round properly, not required. i've tried following , several variants , can't seem 1 match: sed -e 's/0\.(\d\d)/&/' myfile.txt which understand mean, match digit 0, decimal, capture next digits , have sed replace whole match captured part? even if got work, don't know how handle 0.063 -> 6 case. sure apprecaite helping hand on this. sed support character class use longer posix name. digits [[:digit:]] . it's shorter write [0-9] . try this: sed -e 's/0\.([0-9][0-9]).*/\1/;s/^0//' myfile.txt the -e flag tells use modern regex. there 2 commands here, separated ; : s/0\.([0-9][0-9]).*/\1/ : put 2 digits following 0 , dot capture group , replace whole string capture group. s/^0// : remove leading 0 s

ios - UICollectionView with two columns, different cell sizes and one after the other -

Image
this i'm aiming for: but collection view looks this: theres kind of separator between different rows. don't need them resize auto layout, it's repeated pattern of 4 cells know exact size of each one. i'm using func collectionview(collectionview: uicollectionview, layout collectionviewlayout: uicollectionviewlayout, sizeforitematindexpath indexpath: nsindexpath) -> cgsize { for size of each cell and flow layout: let flowlayout = uicollectionviewflowlayout() flowlayout.scrolldirection = .vertical flowlayout.minimumlinespacing = 10 flowlayout.minimuminteritemspacing = 5 how can approach separation? you cannot using uicollectionviewflowlayout . have subclass uicollectionviewlayout , create own custom collection view layout. thankfully great guys @ ray wenderlich have done tutorial on how create custom collection view layout mimicks layout of pinterest app. layout trying achieve. uicollectionview custom layout tutorial:

ios - Music stops after interruption -

hello working on background music portion of app. have of music running until interruption comes along, either call or siri. using singleton play music comes https://github.com/raywenderlich/sktutils/blob/master/sktutils/sktaudio.swift (ray wenderlich). have attempted use avaudioplayer code automatically start playing again after interruption after code adapted singleton. seem run many problems on route. love know if there easy way things going again. music called when switch in on position if helps @ all. if guys need code ask please help! in appdelegate in func applicationdidbecomeactive(application: uiapplication) i made if statement if switch true resumed background music. var defaults = nsuserdefaults.standarduserdefaults() if defaults.boolforkey("switchstate") == true { sktaudio.sharedinstance().resumebackgroundmusic() }

php - Not using a form to send form data -

to prevent spam i'm thinking of removing <form> and send data input fields ajax instead. on php side use make safer: $clean = strip_tags($html, '<p><br>'); any pitfalls? myself use ajax instead sometimes, downside me ajax have not been able send files (e.g. images) @ least without jquery. so, if don't need send files ok or @ least sometimes, although reason say: spam, don't

sql - Mysql query using group_concat and self referencing id in the table -

here table , sample data. create table `sections` ( `section_id` int(11) not null auto_increment, `name` varchar(100) not null, `parent_section_id` int(11) default null, primary key (`section_id`) ); insert `sections` (`section_id`, `name`, `parent_section_id`) values (1, 'city', null), (2, 'supplements', 4), (3, 'news', 5), (4, 'sunday', 2), (5, 'monday', 2), (6, 'tuesday', 2), (7, 'wednesday', 2), (8, 'thursday', 2), (9, 'friday', 2), (10, 'saturday', 2), (11, 'home', 4), (12, 'games', 4), (13, 'sites', 5), (14, 'sports', 5), (15, 'cyber space', 6); parent_section_id foreign key referencing section_id in same table can have null if doesn't belong other section. how can below output have tried using group_concat function doesn't give exact result. parent_section_id pointing id same table. should use other column achieve below output or use

ssh - How to push a large git repository without launching a git pack-index command? -

i know this question . performed local modifications, seem, official git project perform a git fsck locally before pushing origin. c:\cygwin\home\example\utils>git push origin master warning: permanently added '196.30.252.130' (rsa) list of known hosts. fatal: out of memory, malloc failed (tried allocate 2285522160 bytes) and command fails… the problem while pack format allows (size_t or unsigned long) , official git project use 32 bits signed integers internally handling tree objects size (limiting 2gb) . so there command won’t perform fsck before pushing ? or project/library (i couldn't found how libgit2) allowing me stay on laptop ? alternative documentation git on ssh protocol, can implement part myself.

java - Appending time taken to execute test into end-user friendly .xls/.csv file -

right now, successfully/accurately report test ids, descriptions, expected results, , pass/fail values. i'd add values can see @ end of running testng.xml (time taken execute , finish test) , append them file. is there way record time taken of testng tests , output them excel/csv? the test run times part of xml report: http://testng.org/doc/documentation-main.html#logging-xml-reports you can parse file , extract data need.

Training Tesseract 3.03 on Ubuntu 14.04 -

i try train new font on tesseract, follow steps on official guide problem in charset extractor phase. training app unicharset_extractor gives in output chars without right properties. ' if system use wctype functions, value set automatically ' app wctype disabled . how can use automatic char properties extraction on ubuntu?

java - Hide TextView until Button is pressed -

i wondered if it's possible hide view until button pressed without whole effort of creating blank view , switching between them. know tutorial or can guide me trough this? set view's visibility on gone when rendered. on onclick button reveals view set view visible hiddenview = (view) findviewbyid(r.id.hidden_view); hiddenview.setvisibility(view.gone); showbutton = (button) findviewbyid(r.id.show_button); showbutton.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { //when showbutton clicked show hidden_view hidden_view.setvisibility(view.visible); } });

How to run package in laravel 5? -

how run package in laravel 5? i have downloaded 1 chat package internet. and, have run command vendor:publish , published. now don't know how run that. first need check whether package ships service provider , facade. if so, add them in config/app.php file. package's service provider should go under providers array , facade should go under aliases array. as specify providers under providers array, laravel know have called external package, load them. thus, package available usage.

c# - How to automatically resolve named type in Autofac? -

in unity, can register named type this using microsoft.practices.unity; var container = new unitycontainer(); container.registertype<ioutputservice, consoleoutputservice>("console"); container.registertype<ioutputservice, messageboxoutputservice>("messagebox"); container.registertype<icalculatorreplloop, calculatorreplloop>(); icalculatorreplloop loop = container.resolve<icalculatorreplloop>(); and auto resolve using attribute this public class calculatorreplloop : icalculatorreplloop { public calculatorreplloop() {} [dependency("messagebox")] public ioutputservice outputservice { get; set; } } i know how register named service in autofac using autofac; using autofac.core; var builder = new containerbuilder(); builder.registertype<consoleoutputservice>().named<ioutputservice>("console"); builder.registertype<messageboxoutputservice>().named<ioutputservice>("messagebox

excel - Formula will not work in Conditional Formatting -

i have 3 page work book. pages 2 , 3 hold similar data different time periods (cases current, cases historic). takes information cases current , collates information using countif. i have been trying conditional format change text colour if countif cases current higher or lower countif on same data in historic page. e.g.: cell c3 has following formula : '=countifs('cases '!$d:$d,c$2,'cases '!$c:$c,$a3) , displays figure 7 . i have used if formula in regular cell , following work. (in example countif returns 10 .) if(c3<countifs(compare!$d:$d,c2,compare!$c:$c,$a3),"lower","higher") i have used same formula in conditional formatting triggers no change in font colour. have stripped 2 end conditions off end of if statement conditional formatting triggered on true return. =if(c3<countifs(compare!$d:$d,c2,compare!$c:$c,$a3) this formula incorrect you're attempting: =if(c3<countifs(compare!$d:$d,c2,compare!$c:$c,

Multiprocessing python. Error ''dict' object is not callable' -

i trying multiprocess run method in class. method returns dictionary. not understand why getting error "typeerror: 'dict' object not callable". have seen threads saying instance methods can not pickled , need pickled/unpickled manually. however, not getting error here , wonder why. want multiprocess 1 of instance methods , use result in instance method. attached minimum working example. #/usr/bin/python multiprocessing import pool class test: def __init__(self): print "init" def run(self): y = {'write_bandwidth': 3768.3135113756257} return y def pool(self): pool = pool(processes=2) result = pool.map(self.run(), range(10)) print result if __name__ == '__main__': t = test();

wordpress - Preview website doesn't work in virtualmin on nginx -

i've installed virtualmin on nginx (i wanted ispconfig on nginx, didn't succeeded). os centos 6.4. since dns didn't propagate want preview website i've created, through virtualmin->services->preview website . first worked, after i've added following lines on /etc/nginx/nginx.conf file didn't worked anymore. fastcgi_hide_header x-powered-by; # enforce no www if ($host ~* ^www\.(.*)) { set $host_without_www $1; rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent; } # unless request valid file, send bootstrap if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } the code above need making work permalinks on wordpress website. wrong? i'm not sure since not expert, but, per official documentation , nginx not support cgi, applications or virtualmin scripts use cgi not work. virtualmin should prevent installation of scripts require cgi, mod_perl or apache-specific features. and when tr

Android:Listview row background color changing on scroll -

this code public view getdropdownview(int position, view view, viewgroup parent) { viewholder holder = null; if(view==null) { view= inflater.inflate(r.layout.citylist, parent, false); holder=new viewholder(); holder.txttitle = (textview) view.findviewbyid(r.id.tv); holder.txttitle.settextsize(typedvalue.complex_unit_dip,db.getsettings().getint(15)-3); holder.txttitle.setpadding(10, 10, 10, 10); view.settag(holder); } else{ holder=(viewholder)view.gettag(); } holder.txttitle.settext(data.get(position)); if(position % 2 == 0)view.setbackgroundcolor(color.rgb(224, 224, 235)); return view; } when scroll color on row appearing on odd row help the view in list recycled. that's item view scrolled outside screed reused in item scrolled screen. need set od

css - absolute positioned div's relative positioned sibling has moved above -

below have absolute positioned div#in resides within relative position div#out. div#in pulled out of flow , stretched on div#out coordinate top,bottom,left,right being set 0. fine, don't understand if give div#sibling postion:relative appears above div#in. i've checked z-index of divs , "auto" believe same zero. i using version 45.0.2454.101 ubuntu 14.04 (64-bit) believe misunderstanding on part,not browsers problem. any appreciated. <style> #out { border: 1px solid red; background: red; position: relative; } #in { border: 1px solid green; background: green; position: absolute; top:0; right:0; bottom: 0; left: 0; } #sibling{ position:relative; } </style> <div id="out"> outer div<br> position relative <div id="in">inner div position absolute</div> <div id="other&q

AngularJS File upload with directive -

i use angularjs directive file upload , use directive way: <input type="file" file-model="myfile"> the directive looks this: myapp.directive('filemodel', ['$parse', function ($parse) { return { restrict: 'a', link: function(scope, element, attrs) { var model = $parse(attrs.filemodel); var modelsetter = model.assign; element.bind('change', function(){ scope.$apply(function(){ modelsetter(scope, element[0].files[0]); }); }); } }; }]); myapp.service('fileuploadservice', ['$http', function ($http) { this.uploadfiletourl = function(file, uploadurl) { var fd = new formdata(); fd.append('file', file); $http.post(uploadurl, fd, { transformrequest: angular.i

java - Create regex based on variables -

i having bit of trouble creating regex database query doing. im using accumulo database (which doesn't matter @ point). in accumulo row looks like: rowid columnfamily : columnqualifier [ ] value and allowed pattern match on each of 4 iterator. having trouble trying come pattern match rowid . entire row looks this 2beab7b3-0792-4347-a63b-3e2f3c6b048d.4ce7be2a-fb2e-4694-94db-877a0ed3e68b.edd1918d-9ddc-4597-891a-d12c8c7be602.1445442700588 transaction:occurrences [] @\x18\x00\x00\x00\x00\x00\x00 where rowid trying match looks like: 2beab7b3-0792-4347-a63b-3e2f3c6b048d.4ce7be2a-fb2e-4694-94db-877a0ed3e68b.edd1918d-9ddc-4597-891a-d12c8c7be602.1445442700588 this unique key created using 3 other keys (from 3 objects) , timestamp separated . . have this: 2beab7b3-0792-4347-a63b-3e2f3c6b048d //key 1 method below 4ce7be2a-fb2e-4694-94db-877a0ed3e68b //dont care key edd1918d-9ddc-4597-891a-d12c8c7be602 //key 3 method below 1445442700588

c# - AjaxControlToolkit PieChart graphic does not render if only one data value is added -

i enter data dynamically code behind: piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "1", data = count1 }); it supposed reflect number of ratings 1-10 use of switch (i didn't show entire switch because cumbersome). in case, if 1 person gives rating of 1, count1 = 1, , want pie chart reflect that, instead control remains blank , has 1 way @ corner, legend still there. is bug or missing something? update: here switch goes through ratings 1 - 10 , adds amount of particular rating chart: for (int = 1; <= 10; i++) { switch (i) { case 1: if (count1 > 0) { piechart1.piechartvalues.add(new ajaxcontroltoolkit.piechartvalue { category = "1", data = count

CSS transform issue with an image swap and border radius simultaneously -

i'm trying find solution slight issue i'm having css. goal switch square solid colored box, centered text, circular image. while have works, albeit clunkily i'm sure, fact both colored div , image end same size, means there faint colored line surrounding image. there way remedy this? thought scale colored div @ same time, ends scaling both. <head> <style> .images-container{ position: relative; width: 175px; height: 175px; margin-top: -191px; } .images-container > img{ display: block; width: 175px; height: 175px; position: absolute; -webkit-transition: 1s ease; -moz-transition: 1s ease; -ms-transition: 1s ease; -o-transition: 1s ease; transition: 1s ease; } .images-container > img:nth-child(1){ filter: alpha(opacity=100); opacity: 1; z-index: 0; } .images-container > img:nth-child(2){ filter: alpha(opacity=0); opacity: 0; z-index: 1; } .images-container:hover > img:nth-child(1){ filter: alpha(opacity=0); opacity: 0;

less - LessCss - extending css on the fly -

i aware of can declare class : .someclass { ... } and extend it .otherclass { &:extend(.someclass all) } but .someclass has declared ? in case callers apply logic , there no need someclass have logic declared well, placeholder similar css. it nice if there &:extend(groupingfunction all) . but maybe there already? currently less don't support "placeholder-equivalent". checkout issue: :extend mixins . you can use "@import (reference)" feature "simulate" behavior can cause unexpected problems in cases (there quite few issues import reference feature).

jquery boolean check to see which are selected -

i have 4 checkboxes uses boolean check see have been selected. issue having trying see if 2 of these boxes have been checked. if so, show alert. if .tb1 , .tb3 show alert inpatient. if .tb2 , .tb3, alert "outpatient" , @ default, display "default". gatestatus(); var inpatient = false; var outpatient = false; var contract = false; function gatestatus(){ if(inpatient == true && contract == true){ alert("in patient gate open"); } else if (outpatient === false && contract == true) { alert("outpatient gate open"); } else{ alert("default"); } $("#result1").on("click", ".tb1", function(){ var inpatient = true; gatestatus(); } $("#result1").on("click", ".tb2", function(){ var outpatient = true; gatestatus(); } $("#result2").on("click", &qu

java - Not able to get correct Currency symbol for countries -

i tried java.text.numberformat.for denmark english, gave me 'dkk' .but need 'kr'. locale denmark = new locale("en","dk"); numberformat denmarkformat = numberformat.getcurrencyinstance(denmark); system.out.println("denmark: " + denmarkformat.format(num)); i tried java.util.currency.getsymbol(). denmark english,it gave me 'dkk' only. locale denmark = new locale("en","dk"); currency curr = currency.getinstance(denmark); string symbol = curr.getsymbol(denmark); (or) i can custom currency symbols in jsp if pass symbol java,it not able properly.for uk,'£' symbol passed jsp received &pound; in java. how in java, string currency=(string)pagecontext.getrequest().getattribute("currencysymbol"); getting solution of these problems great.thanks in advance. i need below currency symbols, usa-$ ca-$ cn-¥ pl-zÅ‚ tr-try nl-eur se-kr dk-kr fi-eur au-$ de-eur ch-chf gb-£ it-eur at-eur fr-

javascript - Send data from websocket to socket.io -

Image
i used websocket interface connect websocket server . if want send data receive websocket server through websocket interface client connected me through http server , should use socket.io ? so @ end have socket.io attached to http server , websocket interface data , in case of message come send client through socket.io . best setup ? code example : // require http module (to start server) , socket.io var http = require('http'), io = require('socket.io'); var websocket = require('ws'); var ws = new websocket('ws://localhost:5000'); // start server @ port 8080 var server = http.createserver(function (req, res) { // send html headers , message res.writehead(200, { 'content-type': 'text/html' }); res.end('<h1>hello socket lover!</h1>'); }); server.listen(8080); // create socket.io instance, passing our server var socket = io.listen(server); ws.on('open', function ope

playframework - Generate HTML report for JGiven with SBT -

i using jgiven tests in 1 of play 2.3.x application. documentation explains how generate html reports maven , gradle. nothing available sbt. is there workaround generate reports @ end of tests ? maybe adding in build.sbt ? tried play "javaoptions in tests" couldn't figure out how make work. thanks. i not know sbt in detail, however, @ahus1 mentions in comment, can call com.tngtech.jgiven.report.reportgenerator main class. example: build.sbt: librarydependencies += "com.tngtech.jgiven" % "jgiven-html5-report" % "0.9.3" on command line: $ sbt > run-main com.tngtech.jgiven.report.reportgenerator --sourcedir=target/jgiven-reports/json/ --targetdir=target/jgiven-reports/html it great if tell me if final solution, can document in jgiven documentation.

javascript - 6 Grid DIVs with 2 Content DIVs each and toggle-Function -

ok, might not seeing wood trees - here's (probably solveable) problem: i have markup (6x times "col-4"-div content): <div class="partner inner"> <div class="col-4"> <div class="logo" id="logo-one"></div> <div class="caption hidden"> <h3>company one</h3> <address> addressinfo here... </address> </div> </div> </div> css situation: each id class "logo" has background-image switches background-position vertically on hover. class caption hidden on default through helper-class "hidden" what want achieve: using jquery toggle class "hidden" clicked logo. using jquery toggle div "caption" show addressinfo each company. my problem jquery code: $(".logo").click(function(){ $(".hidden").toggle(500); $(this).toggleclass("hidden");

apache - bcmath in a shared hosting throught .htaccess -

i need use bcmath in shared hosting not provide default. asked hosting company , not going provide it. have left hosting of modern hosting provide , other features not provided current hosting. want job done , not start suggesting customer leave hosting before trying plan b. possible bc math in shared hosting using .htaccess or other method? have not been able find during search except http://php.net/dl , not know if applies case , have not found enough information it. php build: php version 5.4.20 system linux lamp.xxx.yy 2.6.18-348.18.1.el5.centos.plus #1 smp ... i686 build date sep 24 2013 11:06:51 server api apache 2.0 handler virtual directory support disabled additional .ini files parsed /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/ioncube-loader.ini, /etc/php.d/json.ini, /etc/php.d/ldap.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/pdo.ini, /etc/php.d/p

count - R: counting consecutive days -

i having trouble solving one, have df list of count data. example this: date time id 2014-02-14 15:02 1 2014-02-15 15:12 1 2014-02-16 08:34 2 2014-02-17 02:02 2 2014-02-19 11:02 1 2014-02-20 15:42 1 2014-02-22 16:02 2 2014-02-25 15.02 1 .... now want make function measures length of consecutive period of days, want function have ability set number of days dates allowed apart (default = 1 day). output should df has multiple rows per id (as these represent there multiple periods of activity) , per consecutive periods should display amount of days period consisted of. example of output should be: id periodid days 1 1 2 2 1 2 1 2 2 .... so first question is, how can construct df this? secondly, how can extend can have input in function makes sure dates e.g. 2 or 4 days apart included in same period (so not consecutive dates, dates allowed >1 day apart

ios - After I updated to Xcode7, my apps can't connect to specific address -

Image
in of apps use nsurl connect specific address; doesn't work following upgrade xcode 7. what can do? from ios 9 onwards, have set nsallowsarbitraryloads key yes under nsapptransportsecurity dictionary in .plist file. hope helps!

apache pig - Pig sum on data -

i have file - (1950,10) (1951,33) (1952,15) (1953,17) (1954,17) (1955,14) (1956,60) (1957,98) (1958,73) (1959,87) (1960,123) i want sum of second field through pig. eg out put should (547) please help you can this. have group records.. x = load '/root/stack.txt' using pigstorage(',') (year:int,score:int); y = group x all; z = foreach y generate sum(x.score); dump z; answer: (547) is solves problem......

Why does my python function return the wrong result? -

i'm attempting create simple python game, 'higher or lower'. i'm extremely new programming please give me improvements. this have far: import random score = 0 def check_choice(lastcard, newcard, userinput): if newcard >= lastcard: result = "higher" else: result = "lower" if result == userinput: print("correct! \n") return true else: print("incorrect! \n") return false def generate_card(): return str(random.randint(1,13)) def get_user_choice(): choice = input("please enter 'higher' or 'lower': ") return choice def change_score(result): global score if result: score += 1 else: score -= 1 def play_game(): play = true card = generate_card() while play: print ("current card is: " + card) choice = get_user_choice() if choice == "stop":

android - Add custom headers in volley request -

i have volley request code requestqueue queue = volley.newrequestqueue(this); string url =<my url>; // request string response provided url. stringrequest stringrequest = new stringrequest(request.method.get, url, new response.listener<string>() { @override public void onresponse(string response) { // display first 500 characters of response string. mtextview.settext("response is: "+ response.substring(0,500)); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { mtextview.settext("that didn't work!"); } }); // add request requestqueue. queue.add(stringrequest); how set header called authorization in this?? you can write class extends request.(override getheaders() , on) like public abstract class absrequest<t> extends request<t>{ public absrequest(int method, string url, response.errorlistener listener) {

laravel - Envoyer deployment hooks - command not found -

i use envoyer.io deploying apps. recently removed compiled css/js files git repo. instead want compile them on production server. tired add couple of deployment hooks after composer install. without success, each try failed "command not found" for example, 1 of hooks like: cd {{release}} npm install i tried both {{release}} , full path , got "bash: line 2: gulp: command not found" though when did console worked. any solutions? thanks in advance the npm install not install gulp itself, rather elixir , of pieces uses use gulp. when install gulp, should install globally: npm install --global gulp

java - Does serialization apply to other object instances that are not defined as serializable? -

if have main class, serializible , create instances of other classes (no inheritance) not defined being serializible, state of classes preserved along state of main class, if not static? know constructors of other objects bypassed, states? , yes, did search , google, came out empty handed, hope nice gent clear me. if there reference object not serializable, notserializableexception thrown. when traversing graph, object may encountered not support serializable interface. in case notserializableexception thrown , identify class of non-serializable object. source: https://docs.oracle.com/javase/7/docs/api/java/io/serializable.html you may work around it, answers on suggest, e.g. java serialization non serializable parts

Python pygame.midi error portmidi -

i use debian 8 version of python pygame when try ear midi clicking got : une erreur est survenue la lecture de ce film exige un greffon décodeur audio/x-midi-event qui n'est pas installé. but can ear : aplay monfichier.mid if try run prog python/pygame know example find on web im sure works : import pygame import time import pygame.midi pygame.midi.init() player= pygame.midi.output(0) player.set_instrument(48,1) major=[0,4,7,12] def go(note): player.note_on(note, 127,1) time.sleep(1) player.note_off(note,127,1) def arp(base,ints): n in ints: go(base+n) def chord(base, ints): player.note_on(base,127,1) player.note_on(base+ints[1],127,1) player.note_on(base+ints[2],127,1) player.note_on(base+ints[3],127,1) time.sleep(1) player.note_off(base,127,1) player.note_off(base+ints[1],127,1) player.note_off(base+ints[2],127,1) player.note_off(base+ints[3],127,1) def end(): pygame.quit() i have: python3 p

C# way of telling how many enemies alive -

i have base game class , enemy class. when instantiate enemy using base game integer increase , when 1 dies need decrease integer. the end result being new enemy spawns every few seconds long integer less max_enemies any way i'm clue less , hoping direct me how should arrange ( have enemies increase number when spawn? ) here's basic idea: use factory method. may want handle of specifics differently. void main() { var game = new game(); game.createenemy("blinky"); console.writeline(game.enemycount); game.createenemy("clyde"); console.writeline(game.enemycount); game.destroyenemy(game.enemies[0]); console.writeline(game.enemycount); } public class game { public list<enemy> enemies = new list<enemy>(); public void createenemy(string name) { if (enemycount >= max_enemies) return; var enemy = new enemy { name = name}; enemies.add(enemy); } public void

crystal reports - Choosing which parameter to use -

i have created crystal report populated view. have 4 parameters. want able filter 1 parameter @ a time. parameters studio, division, supervisor, date. need able filter parameter alone. so, if filter studio need data studio no matter division, supervisor or date are. need able 4 parameters. any appreciated. using version 14.1.6.1702 i figured out. 4 parameters pop @ same time when report opened. user has choose 1 wants filter , other 3 parameters user adds values. accomplishes needed. to filter single division: area - choose values studio - choose values division - choose 'east' division date - choose values this result in areas, studios, , dates correspond east division.

swing - Java syntax for separating action listeners -

please me out separate these actionlisteners in periodic table attempting complete. when execute program , click on 'h', opens other elements , when others clicked, not work. need way separate these using method... import javax.swing.*; import java.awt.*; import java.awt.event.*; public class periodictable { public static void main (string[] args) { jframe frame = new jframe("elements"); frame.setvisible(true); frame.setsize(1000,1500); frame.setdefaultcloseoperation(jframe.exit_on_close); jpanel panel = new jpanel(); frame.add(panel); jbutton button1 = new jbutton("h"); panel.add(button1); button1.addactionlistener (new action1()); jbutton button2 = new jbutton("he"); panel.add(button2); button2.addactionlistener (new action2()); jbutton button3 = new jbutton("li"); panel.add(button3); button3.addactionlistener (new action2()); } static class action1 implements actionlistener { public void

Frequency of Characters in Strings as columns in data frame using R -

i have data frame initial of following format > head(initial) strings 1 a,a,b,c 2 a,b,c 3 a,a,a,a,a,b 4 a,a,b,c 5 a,b,c 6 a,a,a,a,a,b and data frame want final > head(final) strings b c 1 a,a,b,c 2 1 1 2 a,b,c 1 1 1 3 a,a,a,a,a,b 5 1 0 4 a,a,b,c 2 1 1 5 a,b,c 1 1 1 6 a,a,a,a,a,b 5 1 0 to generate data frames following codes can used keep number of rows high initial<-data.frame(strings=rep(c("a,a,b,c","a,b,c","a,a,a,a,a,b"),100)) final<-data.frame(strings=rep(c("a,a,b,c","a,b,c","a,a,a,a,a,b"),100),a=rep(c(2,1,5),100),b=rep(c(1,1,1),100),c=rep(c(1,1,0),100)) what fastest way can achieve this? appreciated we can use base r methods task. split 'strings' column ( strsplit(...) ), set names of output list sequence of rows, stack convert data.frame key/value columns, frequency table , convert 'data.frame' , cbind origi

angularjs directive - ng-change not working with dropdown list -

in code ng-change not working gives error. why? need execute method show() every time selected value changes. below div tag should visible after selection of valid list value. <div class="form-group"> <label>source</label> <select class="form-control" name="ddlfirst" ngmodel="ddlsource" ng-change="show()"> <option value="null" ng-selected="true">--select sprint--</option> <option ng-repeat="s in alls" value="{{s.id}}">{{s.name}}</option> </select> </div> //this div should visible when valid list value selected.s.id hv +ve value on valid list value selection <div ng-show="ddlsource==isnumber()"> <label> hiiiiii</label> </div> result is: error: [$compile:ctreq] controller 'ngmodel', required directive 'ngchange', can't found! http://errors.ang