Search Results

Search found 3 results on 1 pages for 'smallmeans'.

Page 1/1 | 1 

  • popen fails with "sh: <command>: not found"

    - by smallmeans
    I'm developing a server application and I recently encountered this wierd error on a testing server (Debian Squeeze). Every executable I pass to popen fails with a msg: sh: sort: not found // happens to any command This happens regardless whether I point to the full path returned by "type" or keep it short . As mentioned earlier, this happens at only one testing environment, to add confusion, am running the same OS and had no problem whatsoever. Popen is apparently using sh to execute commands, but if I run the same command thru the prompt (bash or sh), everything's fine Thanks in advance (PS: even tried Python os.popen just to nail this head scratcher, and it works!) Edit this is a simple call that fails: $command="tail -10 myfile"; $handle = popen($command.' 2>&1','r'); if($handle){ while (!feof($handle)){ ....//process buffer } } returns: sh: tail: not found

    Read the article

  • Flip <canvas> (rotate 180deg) after being published on page.

    - by smallmeans
    I'm trying to rotate a canvas element AFTER it's been appended to the DOM. Canvas is 600x50 and this is the code at hand: var canvas = document.getElementsByTagName('canvas')[2]; var ctx = canvas.getContext('2d'); ctx.translate(300, 25); // rotate @ center ctx.rotate(angle * Math.PI/180); which isn't accomplishing the task. Am I missing something? Thanks

    Read the article

  • AWK: compare apache dates without using regular expression

    - by smallmeans
    I'm writing a loganalysis application and wanted to grab apache log records between two certain dates. Assume that a date is formated as such: 22/Dec/2009:00:19 (day/month/year:hour:minute) Currently, I'm using a regular expression to replace the month name with its numeric value, remove the separators, so the above date is converted to: 221220090019 making a date comparison trivial.. but.. Running a regex on each record for large files, say, one containing a quarter million records, is extremely costly.. is there any other method not involving regex substitution? Thanks in advance Edit: here's the function doing the convertion/comparison function dateInRange(t, from, to) { sub(/[[]/, "", t); split(t, a, "[/:]"); match("JanFebMarAprMayJunJulAugSepOctNovDec", a[2]); a[2] = sprintf("%02d", (RSTART + 2) / 3); s = a[3] a[2] a[1] a[4] a[5]; return s >= from && s <= to; } "from" and "to" are the intervals in the aforementioned format, and "t" is the raw apache log date/time field (e.g [22/Dec/2009:00:19:36)

    Read the article

1