Posts

Showing posts from June, 2015

javascript - What is difference between chrome.webNavigation.onCompleted and chrome.tabs.onUpdated.addListener with 'complete' -

in chrome apis there 2 functions theoretically points same evet. chrome.webnavigation.oncompleted , chrome.tabs.onupdated.addlistener changeinfo=complete . what difference between these 2 , 1 guarantee everthing in page have loaded. have found chrome.tabs.onupdated.addlistener fire when few http requests remaining. the chrome.webnavigation.oncompleted invoked when navigation occurs in subframe whereas chrome.tabs.onupdated.addlistener triggered when tab updated due change in tab's property status or url . observe changeinfo object passed callback function here . also, chrome.webnavigation.oncompleted supports filtered events, can specify filter event triggered when filter passed. observe here how apply filters event. so, if use both event listeners, observer chrome.webnavigation.oncompleted fired many times single tab whereas chrome.tabs.onupdated.addlistener might fire once or twice (due status change loading complete). i hope helps.

php - SQL Injection conundrum -

as know usual sites use functions mysqli_query() , mysql's php driver not allow multiple queries in single ->query() call (but can many in phpmyadmin sql running section) cannot directly add delete/update/insert abusing of possibilities modify data under circumstances. 1st thing in case think 80% of potentially being @ risk (maybe lost of data) gone! & 2nd 1 is, rely on knowledge, why of injecting tutorials based , focused on multiple queries? 80% of potentially being @ risk (maybe lost of data) gone! this assumption wrong. why of injecting tutorials based on multiple queries? because it's simple understandable example, proof of concept . 1 "if john have 2 apples , mike five...". if real mike doesn't feel spare apples, doesn't mean arithmetics wrong. sql injection concudrum there no conundrum in injections. there no point in musings on injections. there no percents of risk calculated dichotomy: either have applic...

C# WinForm DataGridView Update, Insert, Delete Not Working -

Image
here code : public partial class form1 : form { sqlcommandbuilder cmbl; string con = "data source=localhost;initial catalog=db;persist security info=true;user id=sa;password=1234"; sqldataadapter sdahfp; string querydgvhfp = "select * hfp"; datatable dthfp; sqlconnection cn; public form1() { initializecomponent(); } private void form1(object sender, eventargs e) { sdahfp = new sqldataadapter(querydgvhfp, con); dthfp = new datatable(); sdahfp.fill(dthfp); foreach (datarow item in dthfp.rows) { int n = dgvhfp.rows.add(); dgvhfp.rows[n].cells[0].value = item["hfp"].tostring(); dgvhfp.rows[n].cells[1].value = item["yearperiod"].tostring(); if (item["active"].tostring() == "y") { dgvhfp.rows[n].cells[2].value = true; } else ...

how to get build number for jenkins job via python code -

i developing python code deal jenkins using jenkinsapi package. looking simple way pass job name , latest build number job. example from jenkinsapi import jenkins ci_jenkins_url = "job url" username = none token = none job = "test 3" j = jenkins.jenkins(ci_jenkins_url, username=username, password=token) if __name__ == "__main__": j.build_job(job) this triggering builds successfully, need build number proceeding further. highly appreciated the job object implements several methods getting build number of last build, last completed build, last stable build, etc. jenkins_server = jenkins.jenkins(ci_jenkins_url, username=username, password=token) my_job = jenkins_server.get_job('my job name') last_build = my_job.get_last_buildnumber() you can use python interactively explore api packages don't have complete online documentation: >>> jenkins_server = jenkins.jenkins(...) >>> job = jenkins_server.get_jo...

django - Ubuntu/ Virtualenv/ Python3.4/ Gunicorn/ Nginx gunicorn ERROR: Connection in use: ('0.0.0.0', 8000) -

i have looked across internet, including stackoverflow, , have seen similar problems, after several hours stumped. i can add in information thinks might of use. on digitalocean droplet ubuntu14.0.4, in virtualenv named 'sod22', python3.4, django1.8, gunicorn19.4.5, nginx1.4.6 here error output in bash: (sod22) root@shapeofdata2:~/.virtualenvs/sod22# gunicorn --bind 0.0.0.0:8000 sod22.wsgi:application [2016-01-27 02:25:18 -0500] [25609] [info] starting gunicorn 19.4.5 [2016-01-27 02:25:18 -0500] [25609] [error] connection in use: ('0.0.0.0', 8000) [2016-01-27 02:25:18 -0500] [25609] [error] retrying in 1 second. [2016-01-27 02:25:19 -0500] [25609] [error] connection in use: ('0.0.0.0', 8000) [2016-01-27 02:25:19 -0500] [25609] [error] retrying in 1 second. [2016-01-27 02:25:20 -0500] [25609] [error] connection in use: ('0.0.0.0', 8000) [2016-01-27 02:25:20 -0500] [25609] [error] retrying in 1 second. [2016-01-27 02:25:21 -0500] [25609] [error]...

.net - How do I find greater number folder from root folder path using c#? -

Image
i have 3 folders in controllers folder z1 , z2 , z3 how compare , find out z3 greater among listed folders? this code give me folder depth . public static int folderdepth(string path) { if (string.isnullorempty(path)) return 0; directoryinfo parent = directory.getparent(path); if (parent == null) return 1; return folderdepth(parent.fullname) + 1; } greater means in name 3 greater 2 &1 z3 greater. out put should z3 var directory = directory.getdirectories(path) .orderbydescending(dir => dir) .firstordefault(); now, may have problem. supposed "greater", z15 or z2 ? , how computer find out? folders follow pattern?

java - Why we need to implement certain methods when we extend classes in android? -

even if going empty. for example oncreate method. when write extends "some class name",a warning shown methods have implemented. they abstract classes/methods , need overridden. can choose override functionality or let parent classs doing. an abstract class class declared abstract—it may or may not include abstract methods. abstract classes cannot instantiated, can subclassed. an abstract method method declared without implementation (without braces, , followed semicolon), this: abstract void moveto(double deltax, double deltay); if class includes abstract methods, class must declared abstract, in: public abstract class graphicobject { // declare fields // declare nonabstract methods abstract void draw(); } when abstract class subclassed, subclass provides implementations of abstract methods in parent class. however, if not, subclass must declared abstract.

c# - WCF WebHttp service for both XML and JSON choose serializer based on endpoint address -

i'm trying make wcf restful web service return both xml , json . problem it's working xml serialization it's ignoring xml attributes. as can see in endpoint configuration have 2 address xml , json . so access url - for xml - http://localhost:59310/testservice.svc/xml/getresponse for json - http://localhost:59310/testservice.svc/json/getresponse now want use datacontractformat when access json url , use xmlserializerformat xml url. how can achieve this. please help. this response class xml attributes. namespace wcfmultiformattest { [xmlroot(elementname = "response")] public class response { [xmlattribute(attributename = "message")] public string message { get; set; } } [xmlroot(elementname = "test")] public class root { [xmlelement(elementname = "response")] public list<response> response { get; set; } } } this service implementati...

openerp - Error during module installation due to xml records referring to each other -

i'm working on odoo module development, left me previous programmer. figured out how of code works, there weird parts, hard understand. 1 example down below: 2 records (form , action of form), referring each other <!-- temp validation action--> <record id="model_action_id" model="ir.actions.act_window"> <field name="name">password validation</field> <field name="type">ir.actions.act_window</field> <field name="res_model">scores.temp</field> <field name="view_type">form</field> <field name="target">new</field> <field name="view_mode">form</field> <field name="view_id" ref="scores.my_specific_view"/> </record> <!-- temp validation form--> <record id="my_specific_view" model="ir....

c# - ASP.NET 5 Microsoft.Dnx.Runtime >= 1.0.0-rc2-16237 could not be resolved -

i have asp.net 5 solution working on desktop computer while, today tried running on laptop , can't solution open, either crashes after initializing or loads , gives "nu1001 dependency microsoft.dnx.runtime >= 1.0.0-rc2-16237 not resolved 1.0.0-rc2-16237 installed according dnvm list: active version runtime architecture operatingsystem alias ------ ------- ------- ------------ --------------- ----- 1.0.0-beta5 clr x64 win 1.0.0-beta5 clr x86 win 1.0.0-beta5 coreclr x64 win 1.0.0-beta5 coreclr x86 win 1.0.0-rc1-final clr x64 win 1.0.0-rc1-final clr x86 win 1.0.0-rc1-final coreclr x64 win 1.0.0-rc1-final coreclr x86 win * 1.0.0-rc1-update1 clr x64 win 1.0.0-rc1-update1 clr x86 win 1.0.0-rc2-1635... 1.0.0-rc1-update1 core...

ios - The data couldn\U2019t be read because it isn\U2019t in the correct format using Af networking -

i'm hitting data format... nsdictionary *params = [nsdictionary dictionarywithobjectsandkeys: [defaults valueforkey:kuseridkey],@"user_id", @"0",@"page", @"0",@"lastpage_id", @"0",@"connection_id",nil]; nsstring *path = [nsstring stringwithformat:@"%@",kusersamepagekey]; [path stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; [[apihttprequest sharedinstance] executerequestwithheaderpostparam:params forpath:path oncompletion:^(nsdictionary *response) { nslog(@"response %@", response); }]; please me.. thanks , advice.

"No such file or directory" on simple bash redirection -

here code of mine: gzip -c $path > /var/www/wiki/backup/$now/$file.gz i'm gzipping contents of $path (the path directory), , sending compressed file /var/www/wiki/backup/$now/$file.gz . $now contains directory name, $file name want write compressed file to. however, on running program, error: backup.sh: line 20: /var/www/wiki/backup/sunday/extensions.gz: no such file or directory ^$now ^$file (line 20 line given above) why program breaking? know sunday/extensions.gz doesn't exist (although sunday does), that's why i'm asking write it! full program code: #!/bin/bash now=$(date +"%a") mkdir -p /var/www/wiki/backups/$now databases=(bmshared brickimedia_meta brickimedia_en brickimedia_customs) locations=("/var/www/wiki/skins" "/var/www/wiki/images" "/var/www/wiki/") db in ${databases[*]} #command passwords , shoodle : done path in ${locations[*]} #echo "...

How to invoke MobileFirst adapters with curl and SOAP? -

good day, we have requirement call mobilefirst adapter via curl , soap, ommiting authentication. an example how curl , application/x-www-form-urlencoded looks this, require invoke adapter using soap. curl -xpost -d 'adapter=pushadapter&procedure=sendnotifications&parameters=["[\"usera\",\"userb\"]", "pushed.you"]' http://localhost:10080/application/invoke the reason is, want trigger sending pushnotifications through network zone allows soap. we open different suggestions, implementing new javaadapter (not js), implementing webservice, or pops fulfil requirement in acceptable way. i hope can come idea how call adapters via soap, ommiting authentication. thank you, gizmore ---- edit --- i added new java adapter, video hasan suggests. thank hint :) there added webservice this: @webservice @path("/soap") @oauthsecurity(enabled=false) // disable imfauthentication :) public class externalpushservice ...

Android Google fit recording API not working -

i wanted integrate google fit recording api application. , want read data using history api. phone have uninstalled google fit application can make sure recording api integration working perfect. please find code below have done. when retrieving data using history api, getting buckets walks done data point coming empty. can me. client = new googleapiclient.builder(context) .addapi(fitness.history_api) .addapi(fitness.recording_api) .addscope(new scope(scopes.fitness_activity_read_write)) .addconnectioncallbacks( new googleapiclient.connectioncallbacks() { @override public void onconnected(bundle bundle) { log.i(google_fit_tag, "connected!"); subscribe(); bus.post(new googlefitconnectevent()); } ...

ios - Is there a way to create "Search Suggestions" interface with UISearchController -

Image
in app, need create search suggestions interface -- similar google search (it starts displaying suggestions type in search field). i did uisearchcontroller search bar in navigation bar, set this: // setup search controller searchcontroller = uisearchcontroller(searchresultscontroller: searchsuggestionscontroller) self.searchcontroller.searchresultsupdater = searchsuggestionscontroller self.searchcontroller.hidesnavigationbarduringpresentation = false self.navigationitem.titleview = self.searchcontroller.searchbar // issue!! definespresentationcontext needs false or can't push // controller multiple times on navigation stack self.definespresentationcontext = true while works fine when search controller pushed navigation stack first time, doesn't let search bar focus when pushed second time, shown below but if set false: start typing search bar, navigation bar (along search bar) disappears. expected behavior since (because of definespresentationcontext = false ) ...

javascript - What's the best way to log in Single Page Application -

just want insight on this. currently i'm using console log in angular spa. log viewable when develop it. when out there in other people's browse, have no way see , check. what library/tools can use have sort of runtime information when spa in beta test, or in production? as you're using angularjs, best option use $log service (which have inject own controllers, etc.) then, there few options relevant bits out: sentry - focused on error/warning reporting, integrated angularjs - production loggly - collects everything, staging environments build own - if feeling brave!

runtime.exec() at Java ME 8 not supported. Is there an alternative? -

i have call shell script java me 8 application cldc 8 doesn't implement runtime.exec() . there other opportunities call shell script java me? if understand correctly, might want consider using processbuilder : this class used create operating system processes. each processbuilder instance manages collection of process attributes. start() method creates new process instance attributes. start() method can invoked repeatedly same instance create new subprocesses identical or related attributes. usage example docs: process p = new processbuilder("mycommand", "myarg").start();

c++ - So, what exactly is the deal with QSharedMemory on application crash? -

when qt application uses qsharedmemory crashes, memory handles left stuck in system. "recommended" way rid of them if(memory.attach(qsharedmemory::readwrite)) memory.detach(); bool created = memory.create(datasize, qsharedmemory::readwrite); in theory above code should work this: we attach left on piece of sh...ared memory, detach it, detects last living user , gracefully goes down. except... not happens in lot of cases. see happening, lot, this: // fails memory.error() = sharedmemoryerror::notfound memory.attach(qsharedmemory::readwrite); // fails "segment exists" .. wait, what?! (see above) bool created = memory.create(datasize, qsharedmemory::readwrite); the working way i've found me work around write pid file on application startup containing pid of running app. next time same app run picks file , does //qprocess::make sure pid not reused app @ moment //the output of command below should empty ps -p $previouspid -o comm= //qprocess::(r...

android - Notification doesn't appear in foreground service -

i'm using following code: private void startforeground(boolean isactive) { intent notificationintent = new intent(this, mainactivity.class); pendingintent pendingintent = pendingintent.getactivity(this, 1, notificationintent, pendingintent.flag_update_current); notification notification = new notificationcompat.builder(this) .setsmallicon(r.mipmap.ic_launcher) .setcontenttitle(getstring(isactive ? r.string.title_agent_active : r.string.title_agent_inactive)) .setcontentintent(pendingintent) .build(); startforeground(1, notification); } and @override protected void onhandleintent(intent intent) { startforeground(true); ... with code notification not appear. but if replace startforeground(...) notificationmanager.notify(...) — shows notification, so, think, @ least notification building code ok. where problem? if you're using intentse...

Map @CookieValue, @RequestHeader etc. to POJO in Spring Controller -

i have bunch of params in controller , want map of them separate pojo keep readability. there @cookievalue, @requestheader need evaluate , aim solution map them pojo. how? i saw possible solution on blog doesn't work, variable stays null. controller: @requestmapping(path = mapping_language + "/category", produces = mediatype.text_html_value) @responsebody public string category(categoryviewresolvemodel model) { dosomething(); } and pojo this: public class categoryviewresolvemodel { private string pagelayoutcookievalue; public categoryviewresolvemodel() { } public categoryviewresolvemodel( @cookievalue(value = "some_cookie", required = false) string pagelayoutcookievalue) { this.pagelayoutcookievalue = pagelayoutcookievalue; } ... other requestparams, pathvariables etc. } according documentation it's not possible @cookievalue , , @requestheader . this annotation supported annotated handler methods in servlet ...

FOSElastica + FosRest + Doctrine + REST Api -

versions symfony 2.8.2 foselastica 3.1.8 fosrest 1.7.7 doctrine 2.5.4 problem hello, have mysql's tables many relations. build rest api, in html json, them. working in html, doesn't in json. indeed, in json returning array multi dimensional, , doctrine made each request data. maneuver makes many times , fail. solution make sql join return of elasticsearch don't how make that. idea? the better solution make rest api. rest api never reterning deep json object, asked object. for instance 1 entity people containing list of cars. you have make routing : returning users light object (only id ans important informations) : /users returning 1 full user without cars : /users/{userid} returning full list if cars (as light objects) : /users/{userid}/cars returning full car object (without sub object obviously) : /users/{userid}/cars/{carid} after can manage routing want restfull

java - Overriding paintComponent -

Image
ok have been trying figure out past 26 hours guide , online no success. all want draw oval when user clicks in paintpanel please can sleep :p in paintapplet class: private void paintpanelmouseclicked(java.awt.event.mouseevent evt) { // todo add handling code here: if(fillradiobutton.isselected()) { paintpanel.setbackground(jcolor.getcolor()); paintpanel.repaint(); } if(brushradiobutton.isselected()) { point componentpoint = paintpanel.getlocationonscreen(); paintpanel.add(new painter(componentpoint)); } } painter class: import java.awt.color; import java.awt.dimension; import java.awt.graphics; import java.awt.graphics2d; import javax.swing.jframe; import javax.swing.jpanel; import java.awt.*; public class painter extends jpanel{ point component; public painter(point com) { component = com; } public void paintcomponent(graphics g) { super.paint(g...

javascript - How to show success message after insertion through form submitting -

i want show success message when insertion complete.here code [httppost] public actionresult create(string txthospitalname, int city) { var hospitals = new hospital() { name = txthospitalname, fkcityid = city, createdat = datetime.now, createdby = 1, }; _db.hospitals.add(hospitals); _db.savechanges(); return redirecttoaction("create"); } view.cshtml @using (html.beginform("create", "hospital", formmethod.post, new {enctype = "multipart/form-data", id = "hospitalform"})) { //text fields } using tempdata ideal post-redirect-get pattern. your post action: [httppost] public actionresult create(string txthospitalname, int city) { var hospitals = new hospital() { name = txthospitalname, fkcityid = city, createdat = datetime.now, createdby = 1, }; _db.hospitals.add(hospitals); _db.savechanges(); tempdat...

python - How to change the name of .csv Response on Flask -

i'm using flask web service , in point have send report user. has on .csv format, i'm using code: # ... def generate(): head 'some headers' # loops data lists , dbs yield 'the data' # ... return response(generate(), mimetype = 'text/csv') the name of report 'someletters.csv' , user want name more descriptive, how can change name of report? looking on flask documentation , didn't find useful. you can following in code: filename_ = 'myfilename.csv' # or format like. return response(generate(), mimetype="text/csv", headers={"content disposition":"attachment; filename=" + filename_})

javascript - Create dataTable column definition from uploaded csv data -

m trying create datatable out of uploaded csv file. problem i'm facing defining table column header. have done this, defining header manually. var table = $('#example').datatable({ columns: [{ "title": "number", "data": "number" }, { "title": "category", "data": "category" }, { "title": "assignment group", "data": "assignment group" } ] }); and passing csv data through jquery csv var f = event.target.files[0]; if (f) { var r = new filereader(); r.onload = function(e) { console.log("on load function"); var result = $.csv.toarrays(e.target.result); table.rows.add($.csv.toobjects(e.target.result)).draw(); } r.readastext(f); } else { alert("failed load file"); } this working fine. want define co...

vb.net - Entity Framework connecting to wrong database -

i have existing database , i'm trying connect using entity framework, throws exception saying the server principal "user" not able access database "databasetwo" under current security context. however, i'm not trying connect databasetwo, there no reference anywhere in entire solution. my dbcontext: (databaseone) public class mycontext inherits dbcontext public sub new() mybase.new("databaseone") end sub public property objects dbset(of object) end class web.config connection string: <add name="databaseone" connectionstring="server=myserver.com;database=databaseone;uid=myuser;pwd=mypwd; app=myapp;" providername="system.data.sqlclient"/> the other database exist on server , user have access both database 1 , two, strange consdering says dosen't have permission the entity had different name table, using attribute specify exact table name seemed fix pro...

ruby on rails - Fetch all CC emails - Gmail -

i using gmail gem within rails app: https://github.com/gmailgem/gmail i'm trying retrieve emails have recipients cc'd. here have: gmail.inbox.search(gm: "cc:").each |email| this gives me emails. how work?

How to debug iOS Handoff? -

i've added small amount of code app supposed handle handoff. nothing fancy, creating simple nsuseractivity , setting -[uiviewcontroller useractivity] property , make current. , did added proper nsuseractivitytypes array info.plist , still nothing works. both devices logged in same icloud account, , safari handoff works perfectly. tried everything: app icon not appears on other device lock screen. no errors, no warning, no nothing. how can debug it? if nothing helps, try see suspicious messages in both of devices console. in xcode menu choose window -> devices, select 1 of devices , related handoff. in case found was: jan 27 13:24:40 my-iphone useractivityd[1176] <warning>: <nsxpcconnection: 0x145566b0> connection pid 2012: warning: exception caught during decoding of received message, dropping incoming message. exception: decodeobjectforkey: class "universallink" not loaded or not exist so problem was: setting -[nsuseractivity webpa...

c# - Loading same Assembly with different versions and instnatiating multiple .xaml instances -

Image
this follow-up question here . i want load same assembly in different versions , create multiple instances of types these assemblies. here have: i have assembly asm.dll whos version (within assemblyinfo.cs) set 1.0.0.0. then, modify code , increment version 2.0.0.0 , build again asm.dll. now, have dir1/asm.dll , dir2/asm.dll. here do: assembly = assembly.loadfile(assemblyfile); var types = assembly.gettypes(); type type = types.first<type>(t => t.name.equals(backbonememberclass + "editor")); myobject myobject = (myobject)assembly.createinstance("theclassiwanttoinstantiate", false, bindingflags.createinstance, null, new object[] { }, null, null); here problem: the above works fine if use "dir1/asm.dll" assemblyfile: call assembly.createinstance(...) returns me requested instance. if use again wit "dir2/asm.dll" still works fine. assembly.createinstance returns correct instance. but, if again want create inst...

php - Login with email on codeigniter from database -

i'm building api, need login in codeigniter-restserver project email + password stored on mysql database. this tried far: in rest_controller changed _check_login function this: $this->load->model('model_logiin'); $valid_logins = $this->model_logiin->get_by(array('student_id'=>$username)); please take @ complete code here : https://github.com/chriskacerguis/codeigniter-restserver model model_logiin this: class model_logiin extends my_model{ protected $_table = 'students'; protected $primary_key = 'email_adress'; protected $return_type = 'array'; protected $after_get = array('remove_sensetive_data'); //specified in my_model class protected function remove_sensetive_data($student){ unset($student['ip_adress']); unset($student['student_id']); ... return $student; } } the problem: in login stage.. if type can login ** if need more info please let me know ** if ...

angularjs - How to do unit testing using jasmine on that factory? -

i try make unit test on code consists of factory take behavior name , contracts http request in closure ? var app = angular.module("behaviour",[]); var behaviour = app.factory('behaviours',['http',function(http){ var behavioursjson = $http.get('data.json'); return { getbehaviour : function(behaviourname) { if (behavioursjson[behaviourname]) { var behaviour = behavioursjson[behaviourname]; return function (behaviourdata, callback) { var keys = object.allkeys(behaviourdata); var headers = {}; var data = {}; var url = behaviour.path; // process fill headers , data objects $http({ method: behaviour.method, url: url, data: data, headers: headers }...

javascript - Hide and show on specific row? -

when click on image show , hide row show sub rows , same in hide . problem define in snippet . $(".sub").hide(); function diffimage(img) { if (img.src.match("minus")) { img.src = "http://www.bls.gov/images/icons/icon_small_plus.gif"; // $(img).closest('tr').next('.sub').hide(); $(".sub").hide(); } else { img.src = "http://www.bls.gov/images/icons/icon_small_minus.gif"; // $(img).closest('tr').next('.sub').show(); $(".sub").show(); } } ! function($) { $(".sub").hide(); $(document).on("click", "ul.nav li.parent > > span.icon", function() { // $(this).find('em:first').toggleclass("glyphicon-minus"); $(this).show(); // $('.sub').show(); }); $(".sidebar span.icon").find('em:first').addclass("glyphicon-plus"); } <script ...

php - How to use dynamic observable variable names in html files in knockoutjs -

i using knockjs , have created dynamic observablearrays in js file. ex. product+productid creates dynamic observablearrays product123 . i want use in data bind foreach loop , want create variable dynamically again in html file. something : data-bind="foreach: { data: "product"+product.id()()} so "product"+product.id()() binding should call product123() array. how can achieve this? you can use $data refer current context, , use array notation index dynamically-named element. vm = { product: ko.observable('123'), product123: ko.observablearray([ 'one', 'two', 'three' ]) }; ko.applybindings(vm); <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script> <div data-bind="foreach: $data['product'+product()]"> <div data-bind="text: $data"></div> </div>

sockets - How to add heartbeat messaging on top of this Java code( for KnockKnockClient/Server)? -

Image
i'm studying following basic java socket code( source ). it's knock-knock-joke client/server app. in client , set socket usual: try { kksocket = new socket("localhost", 4444); out = new printwriter(kksocket.getoutputstream(), true); in = new bufferedreader(new inputstreamreader(kksocket.getinputstream())); } catch( unknownhostexception uhe ){ /*...more error catching */ and later, read , write server: bufferedreader stdin = new bufferedreader(new inputstreamreader(system.in)); string fromserver; string fromuser; while ((fromserver = in.readline()) != null) { system.out.println("server: " + fromserver); if (fromserver.equals("bye.")) break; fromuser = stdin.readline(); if (fromuser != null){ system.out.println("client: " + fromuser); out.println(fromuser); } and on server , have corresponding code, joke punch-line. knockknockprotocol kkp = new knockknockprotocol(); outputline ...

ios - Meteor application install on iphone ipad with custom server -

hi situation this. have application build on meteor , test on phone. did following steps tutorial https://github.com/meteor/meteor/wiki/meteor-cordova-integration so did meteor run ios --mobile-server http://192.168.1.2:3000 the command above started xcode, did select iphone , did click [run], xcode said app has been built. ok, it's not showing on phone. if can me great thank in advance.

vba - Copying All columns based on specific IF statement -

i'm having issue line of code in debugger: sheets("datadetail").range(cells(2, 80)).copy i trying copy columns in datadetail(worksheet) based on if user "olive thompson" in column1 of datadetail. however, doesn't column copy. i'd range of column cells dynamic if possible. here code below. sub copycolumns() dim variant dim lastrow long, erow long application.screenupdating = false application.enableevents = false sheets("trackerdetail").rows("2:" & rows.count).clearcontents lastrow = sheets("datadetail").cells(rows.count, 2).end(xlup).row = 2 lastrow if sheets("datadetail").cells(i, 1) = "oliver thompson" sheets("datadetail").range(cells(2, 80)).copy erow = sheets("trackerdetail").cells(rows.count, 1).end(xlup).offset(1, 0).row sheets("datadetail").paste destination:=worksheets("trackerdetail").cells(erow, 1) e...

How to use var javascript in innerHTML? -

how use javascript variable when setting innerhtml of element? see problem first click click 1 . show delete , click delete . why alert not show 111-aaaa,1 ? how can that? https://jsfiddle.net/brf75wvp/ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <input id="test_id" value="1"/> <div onclick="test_fn1()">click 1</div> <div id="demo"></div> <script> function test_fn1() { var test_id_val = document.getelementbyid("test_id").value; document.getelementbyid("demo").innerhtml = "<span onclick= delete_fn('111-aaaa, test_id_val')>delete</span>"; }; </script> <script> function delete_fn(no_delete) { alert(no_delete); }; </script> you should add variable string following. function test_fn1() { var test_id_val = document.ge...

css - Plupload: get id of file input -

i have multiple instances of plupload included @ 1 page of application, divided in 3 categories , can added manually adding new table row. need test uploading dynamically codeception , it's difficult attach file specific plupload file input, because don't know generated id , seems not possible add css class. i'm trying id of current plupload file input doing: init: { init: function(up) { console.log(up.id); // o_1aa1e71ku20lole1v7s1veqetje0 console.log(up.runtime); // html } } the problem up.id not equal id of file input: <input id="html5_1aa1e71krlg119o9ks61uvl17ledv" type="file" style="font-size: 999px; opacity: 0; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" accept="image/jpeg,image/png,image/gif,application/pdf"> how id add custom css class based on section resides? or know way target 1 specific dynamically added plu...

swift2 - Actions buttons not showing up in local notifications ios 9.2 swift 2 -

Image
i creating notifications in loop, relevant code is: func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { appdelegate = self sernotificationtype = uiusernotificationtype.alert.union(uiusernotificationtype.sound).union(uiusernotificationtype.badge) let completeaction = uimutableusernotificationaction() completeaction.identifier = "complete" // unique identifier action completeaction.title = "clear" // title action button completeaction.activationmode = .background // uiusernotificationactivationmode.background - don't bring app foreground completeaction.authenticationrequired = false // don't require unlocking before performing action completeaction.destructive = true // display action in red let callinaction = uimutableusernotificationaction() callinaction.identifier = "callin" callinaction.title = "call now" c...