Posts

javascript - Can't get gulp watch to trigger build function on file change within supposedly watched folder -

i've tried couple of ways gulp watch folder of files in order rebuild on file change , stop me having manually. i'm sure in grunt worked adding watch task array of build tasks , finish initial build leaving watch open listen changes during development session. i've tried this, taken this example gulp readme - i've removed batch call want build trigger on every event. gulp.task('watch', function () { watch('src/**/*.js', function (events, done) { gulp.start('build', done); }); }); the call gulp watch works , appears watching, error displayed make change file in folder. my build function works - i've been not happily triggering manually far! /users/tonileigh/node_modules/gulp/node_modules/orchestrator/index.js:89 throw new error('pass strings or arrays of strings'); ^ error: pass strings or arrays of strings @ gulp.orchestrator.start (/users/tonileigh/no...

GnuPlot: stacked histogram causes hovering bars -

Image
since 2 days trying solve problem. bars of stacked histogram not printed above each other. floating freely around. secondly, want print 5th xtic-label. using gnuplot v 4.6 patchlevel 6. hovering bars in stacked bargraph here first data rows (generated libreoffice): 05.06,-,-,1 06.06,3,-,0 07.06,12,-,3 08.06,0,5,4 09.06,7,2,0 10.06,86,2,1 11.06,31,4,1 12.06,17,1,0 01.07,1,7,1 here comes command set: gnuplot> set datafile separator ',' gnuplot> set style data histogram gnuplot> set style histogram rowstacked gnuplot> set style fill solid border -1 gnuplot> set xlabel "zeit" gnuplot> set ylabel "anzahl" gnuplot> set yrange [0:250] gnuplot> plot 'test.csv' using 2:xtic(1) title "menge a",'' gnuplot> using 3:xtic(1) title "menge b",'' gnuplot> using 4:xtic(1) title "menge c" gnuplot seems confused - column content. set datafile missing '-' doesn...

C# Foreach statement does not contain public definition for GetEnumerator -

i'm having problem windows form application i'm building in c#. error stating "foreach statement cannot operate on variables of type 'carbootsale.carbootsalelist' because 'carbootsale.carbootsalelist' not contain public definition 'getenumerator'". i can't seem understand causing this. this code throwing error: list<carbootsalelist> sortcarboot = new list<carbootsalelist>(); foreach (carbootsale c in carbootsalelist) { if (c.charity == "n/a") { sortcarboot.add(carbootsalelist); textreportgenerator.generateallreport(sortcarboot, appdata.charity); } } and carbootsalelist class it's saying there isn't getenumerator definition: public class carbootsalelist { private list<carbootsale> carbootsales; public carbootsalelist() { carbootsales = new list<carbootsale>(); }...

scala - Passing Type Constructor to Var Args of `Any` Type -

given: scala> def f(x: any*): string = "foo" f: (x: any*)string my understanding it'll take 1 or more arguments of any , , return "foo" . scala> f(1, 2, list(4), "foo") res5: string = foo scala> f(null) res6: string = foo but, passed in higher-kinded type: scala> f(option) res7: string = foo ... expected compile-time failure since edit - think it's type constructor. why did f(option) work, i.e. output "foo" ? that not type constructor, , there's nothing special var args in case. companion object of option . if make f generic on type parameter a , can see option.type (the type of option s companion object) inferred. scala> def f[a](a: a) = f: [a](a: a)a scala> f(option) res1: option.type = scala.option$@59f95c5d

iphone - Error: SyntaxError: DOM Exception 12 setRequestHeader@[native code] -

i in process of developing mobile application android , ios, phonegap , angularjs, cors_rest. have working headers on android. when testing on iphone gapdebug. here example of authentication code: $http.post('someurlhere', {username: username, password: password}) .then(function (response) { if(!response.isauthenticated) { alertsmanager.addalert('username or password incorrect', 'alert-danger'); } callback(response); console.log(response); }); i getting error: syntaxerror: dom exception 12_img if please appreciate it. thank you: please, check headers params, ios9 not accept parameters in http headers has space @ beginning of value. example: "token":" token12345" => wrong "token":"token12345" => correct i hope helps you.

mysql - PHP Calculation from database not calculating correctly. -

i trying run sum numbers taken database. can't seem work. does have ideas why keep getting 0 instead of percentage? if guide me in right direction. php: //sql original goal $goal = "select * login username = '$login'"; $goalquery = mysql_query($goal); $goalarray = mysql_fetch_array($goalquery); $endgoal = $goalarray['goal']; //latest weight $latestweightarray = mysql_fetch_array($latestweightq); $currentweight = $latestweightarray['weight']; //first weight recorded $firstweightarray = mysql_fetch_array($firstweightq); $firstweight = $firstweightarray['weight']; $percent = "100"; $progress = (($firstweight - $currentweight) / ($firstweight - $endgoal)) * $percent; print result: <?php echo $progress ?> this gives: 0 rookie error, had updated database twice in 1 day conflicted results somehow, changed 1 of dates in database , solved problem

facebook - Python - Addition and merging with an array -

i'm using facebook api collect data on mentions. i'm collecting month , amount of times term (eg: banana) has been mentioned in post. have data coming in looks this: 12, 0 12, 0 11, 1 11, 0 11, 1 10, 0 10, 0 10, 0 each row represents 1 post. want merge months (first column) , number of times term has been mentioned (second column) looks this: 12, 0 11, 2 10, 0 i tried putting data in array so: [12, 0] [12, 0] [11, 1] [11, 0] [11, 1] [10, 0] [10, 0] [10, 0] but unable figure out way of merging , adding columns. there anyway of doing this? assuming data list of tuples or lists, can use defaultdict , iterate on list, e.g.: >>> collections import defaultdict >>> d = defaultdict(int) >>> m, c in data: ... d[m] += c >>> list(d.items()) [(10, 0), (11, 2), (12, 0)]