Le Ralf, The Blog
All | Moods | Prog | Rants | Android | Projects | Trackday
Most recent entry: 2006-07-28 00:00:00 -- Generated on 2011-07-24 21:11:26 by Rig3 0.4-456
2006/07/28 sqrt
π 2006-07-28 00:00 by Ralf in Prog
From SGA 2x14 "Grace under pressure", when they zoom on McKay's tablet connected to the puddlejumper's crystals (around 11:46):

... print -u5 exec 3<&p

read -ru3 line print -r "$line" read -ru3 line print -r "$line" float r a=1 b=1.5 c=-1... (( r*sqrt(b*b-4*a*c) )) print r1=$(( (-b+r)/2 )) r2=$(( (-b-r)/2 )) integer even=0 odd=0 ... for ((count=0; count < 100; count++)) do if ((RANDOM%2=0)) then even=even+1 else odd=odd+1 fi done print even=$even odd=$odd TIMEOUT=10 select i in list edit quit do case $i in list) cat "$foo";; edit) ${EDITOR-vi} "$foo";; quit) break;; "") print ... esac ...

Outch. That seems like an awful syntax, very bash-like and extremely low-level. You'd expect something higher level for a scientific genius to use. Especially since it never takes more than a handful of keystrokes to reprogram entire subsystems.

Oh well, it's not like SG/SGA plots try to be logical very often.

Almost totally unrelated it would be fun to have a language where the reserved keywords are ortva raq vs gura ryfr sbe rnpu va pnfr fryrpg juvyr hagvy qb qbar. Another option would be to force Latin declinations when using verbs for method names in call statements :-) Sorry about that. I had too much fun with Intercal when I was younger and it obviously had some consequences.

2006/07/27 DualTimeZone
π 2006-07-27 00:00 by Ralf in Prog
I polished DualTimeZone and made it available on googlecode:
  • View Sources.
  • Release installer.
  • The development cycle was not too bad:

  • Just a handful of minutes to get the [application's skeleton|ProjectList#appskel] customized for this application.
  • An hour or so to find the best way to implement the functionality (a timer and 24 icons that get swapped periodically) and another hour to actually implement and check that.
  • Several hours to polish the application, create an about box, add a French translation and create an installer.
  • Another hour to blog about this, publish it, create the CVS import, fight with it not showing properly on viewcvs, etc.
  • Another extra hour to upload it to googlecode.
  • I'd estimate there was about a 1 to 5 ratio here: 1 hour to implement the real functionality (it's really low tech) and 5 hours to polish the chrome around it and deliver, the whole thing split over 3 days. And another day lost trying to make it available.

    Speaking of bloat, the resulting executable is 168 KB, the MSI installer file is 337 KB and according to the task manager the application uses 12 MB when running yet its VM size is 7 MB. For comparison, an empty .Net WinForm application (the default WinApp created by the C# wizard in VS.Net 2k3) generates a 16 KB executable that uses 8 MB of memory and 6 MB of VM when running.

    Obviously having a kitchen sink run under the hood has a price in terms of memory usage, not to mention the hefty 20 MB initial download (which I painfully forgot to load on my secondary vmware dev box :-( ).


    More pages: October 2008 June 2008 November 2007 May 2007 December 2006 August 2006 July 2006 April 2006 January 2006 December 2005 October 2005 September 2005 June 2005 May 2005 April 2005 March 2005 December 2004