Posts

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.