Posts

jquery - Web Worker Javascript cannot find functions in other javascript files -

i have html file this: <html> <head> <title>world aviation</title> <script language="javascript" src="./jquery-min.js"> </script> <script language="javascript" src="./jsdraw2d.js"> </script> <script language="javascript" src="./script.js"> </script> </head> <body> <input onclick="startanimbackground();" type="button" value="start"/> <script language="javascript"> initairports(); initroutes(); var w; function startanimbackground() { if(typeof(worker) !== "undefined") { if(typeof(w) == "undefined") { w = new worker("start_script.js"); ...

php - set values to fields in adminhtml form template -

Image
i'd created template file admin form tab as: class excellence_designer_block_adminhtml_designer_edit_tabs extends mage_adminhtml_block_widget_tabs { protected function _beforetohtml() { $this->addtab('images', array( 'label' => mage::helper('designer')->__('images'), 'title' => mage::helper('designer')->__('images'), 'content' => $this->getlayout()->createblock('designer/adminhtml_designer_edit_tab_images')->tohtml(), )); return parent::_beforetohtml(); } } class excellence_designer_block_adminhtml_designer_edit_tab_images extends mage_adminhtml_block_template implements mage_adminhtml_block_widget_tab_interface { public function _construct() { parent::_construct(); $this->settemplate('designer/edit/tab/images.phtml'); } public function gettablabel() { retu...

ios - Change text into strong Bold,Italic etc -

i getting response api shown below. want show text strong, bold etc. according api response. message = { <strong>helloooo</strong> }; status = 1; } look @ using nsattributedstring initwithdata:options:documentattributes:error: , include nsdocumenttypedocumentattribute value of nshtmltextdocumenttype in options dictionary. if need support older versions of ios, @ dtcoretext .

regex - Python error log pattern matching -

i python newbie , want learn hardway. writing function extract content between patterns. log file construct follows <time-stamp>[begin cache] <...some content> <time-stamp>. <time-stamp>. <time-stamp>. <time-stamp>. <time-stamp>[error] <..some content> <time-stamp>. <time-stamp>. <time-stamp>. <time-stamp>. <time-stamp>[end cache] <....some content> <time-stamp>. <time-stamp>. <time-stamp>. <time-stamp>[begin cache] <... content> <time-stamp>. <time-stamp>. <time-stamp>. <time-stamp>[end cache] <... content> i interested in extracting part between begin cache , end cache if there pattern error between them. code have written far no way getting me goal. logic used find positions of begin cache pattern , end cache pattern if error tag present , print file between positions. appreciated. import re import os import mmap file="\\\\xx...

sql server - Recursive References are not allowed in Sub_queries T-SQL -

i have cte query so: declare @stop datetime set @stop='2014-12-12 00:00:00.000' declare @start datetime set @start='2011-12-12 00:00:00.000' declare @temp datetime set @temp=@start x(a,b) as( select @temp a,count(*) b table1 left(convert(varchar,table1row1,120),4)=left(convert(varchar,@temp,120),4) union select dateadd(year,1,(select x.a x)) a,count(*) b table1 left(convert(varchar,table1row1,120),4)=left(convert(varchar,(select x.a x),120),4) , datediff(yyyy,(select x.a x),@stop)>0) select a,b #temptbl1 x option(maxrecursion 32767); i'm trying count of rows each year @start @stop. query accepts select x.a x @ select statement not @ clause. i'm getting compile time error stating: recursive member of common table expression 'x' has multiple recursive references. on executing, i'm getting error recursive references not allowed in sub-queries. but, i...

javascript - using onclick function to store CSV file to database -

<i> i ask how store csv file database after upload html form. had tried use onclick store csv file database , work. @ same time need validate other fields in form cannot make using onclick function. in project integrate javascript php code , know cannot done. can me solve problem? jest need store csv file database , validate other fields. ` <?php require_once "lib/base.inc.php"; ?> <script> function checkmail(){ var subject = document.getelementbyid('subject').value; var message = document.getelementbyid('message').value; var csv = document.getelementbyid('csv').value; if(empty(subject)){ alert("subject required."); } else if(empty(message)){ alert("message required."); } else if(empty(csv)){ alert("csv file required."); } else{ <?php $file = $_files[csv][tmp_name]; $handle = fopen($file,"r"); //loop through csv file , insert database { if ($data[0...

linux - kill function after specific time in php? -

i have 5 exec() function in script.i want if function not give response in given time function kill , next function starts execution. <?php exec("timeout 5 /usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat'",$uptime); exec("timeout 5 /usr/local/bin/trun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat'",$uptime); exec("timeout 5 /usr/local/bin/drun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat'",$uptime); ?> in timeout argument not working.please correct or gives alternative method. create bash script caller.sh , execute via exec. command automatically killed after 5 seconds. caller.sh #!/bin/sh /usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat' & sleep 5 kill $! 2>/dev/null && echo "killed command on time out" php exec("caller.sh",$uptime);