Posts

$ sign in jquery to javascript -

i looking way write file in javascript.i found excatly looking here but problem uses jquery.i suppose task pure javascript. my question how convert $ sign pure javascript without including jquery script in code. in short how convert code pure javascript if possible. function createdownloadlink(anchorselector, str, filename){ if(window.navigator.mssaveoropenblob) { var filedata = [str]; blobobject = new blob(filedata); $(anchorselector).click(function(){ window.navigator.mssaveoropenblob(blobobject, filename); }); } else { var url = "data:text/plain;charset=utf-8," + encodeuricomponent(str); $(anchorselector).attr("download", filename); //when try document,getelementbyid not work. $(anchorselector).attr("href", url); } } $(function () { var str = "kgopelo name in place"; createdownloadlink("#export",str,"file.txt...

php - How can I suppress a notice error in codeigniter? -

i want suppress notices in codeigniter error log during cronjob. i've tried using @ in front of line, still prints notice in log: this row generating notice: @$resultarray[1][2]++; the notice: ... severity: notice --> undefined offset: 1 ... what doing wrong here? (i'm using overthought, please no messages claiming not use @, :) ) to have php report errors except e_notice, call php error_reporting function so: error_reporting(e_all & ~e_notice); i believe best way configure index.php @ root of application first detect application environment , conditionally set php errors reported. index.php if (defined('environment')) { switch (environment) { case 'development': case 'testing': case 'staging': error_reporting(e_all & ~e_notice); break; case 'production': error_reporting(0); break; default: exit('the application environment not set correctl...

How PostgreSQL execute query? -

can explain why postgresql works so: if execute query select * project_archive_doc pad, project_archive_doc pad2 pad.id = pad2.id it simple join , explain looks this: hash join (cost=6.85..13.91 rows=171 width=150) hash cond: (pad.id = pad2.id) -> seq scan on project_archive_doc pad (cost=0.00..4.71 rows=171 width=75) -> hash (cost=4.71..4.71 rows=171 width=75) -> seq scan on project_archive_doc pad2 (cost=0.00..4.71 rows=171 width=75) but if execute query: select * project_archive_doc pad pad.id = ( select pad2.id project_archive_doc pad2 pad2.project_id = pad.project_id order pad2.created_at limit 1) there no joins , explain looks like: seq scan on project_archive_doc pad (cost=0.00..886.22 rows=1 width=75)" filter: (id = (subplan 1)) subplan 1 -> limit (cost=5.15..5.15 rows=1 width=8) -> sort (cost=5.15..5.15 rows=1 width=8) ...

c - How to do this initialization? -

i have structure, need initialize @ compile time. here current (pseudo)code: struct { int a; int b; }; struct b { struct а[16][3]; }; #define default {{ \ .a = 1, \ .b = 2, \ }, \ { \ .a = 3, \ .b = 8, \ }, \ { \ .a = 11, \ .b = 29, \ }} #define default2 default, default #define default4 default2, default2 #define default8 default4, default4 #define default16 default8, default8 struct b b = {{default16}}; i don't understand code: why need double braces on last line? moreover, why need double braces in definition of default. understand { .a = 3, .b = 8, } is ordinary structure initialization. second pair of braces seems if initializing b array of 16 objects of type struct [3] . why not list values ...

javascript setTimeout(); doesn't work on linux (firefox) -

i making animation, uses settimeout(); function in javascript. animation works on chrome, firefox, on smartphone. problem firefox on ubuntu. console giving me error: referenceerror: loop not defined @ file:///home/nigga/github/imgdrop/imgdrop.js:45 the code: function loop() { regenerate(); animate(); settimeout("loop()", 1000/fps); } edit: i tried @lol suggested, works on linux, doesnt work on windows (firefox , ie). function loop() { regenerate(); animate(); settimeout(function() {loop();}, 1000); } or function loop() { regenerate(); animate(); settimeout(loop, 1000); }

supervisord - Nginx with Supervisor keep changing status b/w Running and Starting -

here's preview of status running supervisorctl status every 2 seconds: [root@docker] ~ # supervisorctl status nginx running pid 2090, uptime 0:00:02 [root@docker] ~ # supervisorctl status nginx starting [root@docker] redis-2.8.9 # supervisorctl status nginx running pid 2110, uptime 0:00:01 is normal thing nginx respawn every few seconds ? knowing nginx setup run in background setup: [program:nginx] command=/usr/sbin/nginx stdout_events_enabled=true stderr_events_enabled=true its been long time, might else... set daemon off in nginx config. supervisord requires processes not run daemons. you can set directly supervisor command: command=/usr/sbin/nginx -g "daemon off;"

maven - How to avoid the manifest file being overwritten by proguard -

i'm using several libraries in java application. in pom.xml proguard maven plugin includes them so: <inclusion> <groupid>javafx</groupid> <artifactid>jfxrt</artifactid> <library>true</library> <filter>!meta-inf/**</filter> </inclusion> i noticed, when include libraries <library> set true, manifest file gets replaced, allthough specify <filter> libraries. need include them <library> set true, since otherwise of them don't work. now after building jar, won't start, because manifest doesn't contain path main class more. i found 2 approaches, solve this. however, both don't work. first approach: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-antrun-plugin</artifactid> <version>1.3</version> <executions> <execution> <phase>install</...