July 22, 2010
An Impasse in Web SQL Database land

From the spec (http://dev.w3.org/html5/webdatabase/):

This specification has reached an impasse: all interested implementors have used the same SQL backend (Sqlite), but we need multiple independent implementations to proceed along a standardisation path. Until another implementor is interested in implementing this spec, the description of the SQL dialect has been left as simply a reference to Sqlite, which isn’t acceptable for a standard. Should you be an implementor interested in implementing an independent SQL backend, please contact the editor so that he can write a specification for the dialect, thus allowing this specification to move forward.

That is an interesting predicament. Though, off the top of my head, I can’t think of another SQL backend that a browser implementor might be interested in using. Most of the others just feel too heavyweight for the purpose of this exercise. I might be wrong though.

I guess they could always just refer to the standard SQL dialect ;)

July 20, 2010
Find a PID for Specific Process

ps x -o pid=,command= | grep -E "^[0-9]+ INSERT_PROCESS_NAME" | grep -o -E [0-9]+

eg:

ps x -o pid=,command= | grep -E "^[0-9]+ lighttpd" | grep -o -E [0-9]+

Actually this is better

ps x -o pid=,command= | grep -E ^[0-9]+[[:blank:]]lighttpd | grep -o -E [0-9]+

In this format it can be used easily in an ANT build file or similar to find a process that you may need to kill:

<!-- lighttpd search and destroy functions -->
<target name="lighttpd.search">
    <exec executable="sh" outputproperty="lighttpd.pid" >
        <arg line="-c 'ps x -o pid=,command= | grep -E ^[0-9]+[[:blank:]]lighttpd | grep -o -E [0-9]+'" />
    </exec>
</target>

<target name="lighttpd.destroy" if="lighttpd.pid">
    <exec executable="kill">
        <arg line="${lighttpd.pid}" />
    </exec>
</target>

In the specific case of lighttpd and ANT

The regular expression lighttpd[[:blank:]]-f works better as it works regardless of the path in which lighttpd is run from. Which is good as it saves escaping slashes in the regex…

One last Update

Courtesy of the shellwise @neotrophy here is an implementation that uses cut instead of grep:

ps x -o pid=,command= | grep -E lighttpd[[:blank:]]-f | cut -d \ -f1

Additionally, he suggested implementations of awk and sed that were probably a little nicer, but I’m happy enough with the above - especially given it’s working and I’m killing lighttpd processes from ant now :)

June 2, 2010
Thanks to @Bill_Gross for tweeting from the D8 conference.  What a great quote this is, on a number of levels:

I wasn&#8217;t aware that Apple was running at a loss prior going into the advertising game.
While Apple have done a great job fostering a strong developer community around their product suite, I&#8217;m not sure they are doing such a good job in the future.
I guess the alternative is that he is saying providing developers with the mechanics to monetize their applications without having to charge for them - which is nice, but I was really looking forward to the a few people thinking outside of the box and coming up with alternative monetization strategies to advertising :/

Either way, I find it an amusing quote :)

Thanks to @Bill_Gross for tweeting from the D8 conference. What a great quote this is, on a number of levels:

  • I wasn’t aware that Apple was running at a loss prior going into the advertising game.
  • While Apple have done a great job fostering a strong developer community around their product suite, I’m not sure they are doing such a good job in the future.

I guess the alternative is that he is saying providing developers with the mechanics to monetize their applications without having to charge for them - which is nice, but I was really looking forward to the a few people thinking outside of the box and coming up with alternative monetization strategies to advertising :/

Either way, I find it an amusing quote :)

May 28, 2010

Not as bad as the Windows 7 party video, but close IMHO. Reasonably cool tech though, but I don’t think it needs to be implemented at the device OS level to work effectively…

May 28, 2010
Coding and Climbing

Coding in a dynamically typed language is to freeclimbing, as coding in statically typed language is to lead climbing. In each, what can be achieved is proportional to ones skill, but the different requirements in baseline skill to avoid injury can be significant depending on the challenge posed by the peak / problem.

Personally, I love to free climb in territory I know and understand well, but when exploring new territory the reassurance of well placed protection is hard to do without.

8:56am  |   URL: http://tmblr.co/ZtgoXyc4wgZ
  
Filed under: coding