Sunday, August 17, 2014

First Javascript function

Well, I put it off for years. Today I wrote an (albeit short) javascript function to toggle a check. I find the checkbox with the name specified, and set it to on. I meant to have a much more rich selection of all items by name, but I was getting confused between the code I was using to call this, and the code I was writing in.

I think the web developers deserve credit for existing in three levels and three languages simultaneously (php/perl/python/ruby/whatever for programming the server, html/css for presentation, and javascript for manipulating the page content and animations). When I was using lisp more, I think I would have solved this problem by moving one syntax into each of the three domains, and maybe adding a translation to the outside language. I'd have to look more into hunchentoot and seaside to see if this is how those are done. It looks like the dominant pattern now is a rich set of client side processing in javascript/jquery, and a gradually thinning server side logic for persistence and ubiquity.  I don't think I can ignore javascript any longer, and may need to make this my next language (along with relearning python at a functional competency.)

Tuesday, July 01, 2014


I'm a little new at mercurial. The merge process, though I'm sure it is well documented, was a little intimidating (lots of diff's with little clear context.) I also had the backward desire to bring changes from the default/main branch into a feature branch (it's taking a while, but I want to make sure I'm close to current.) That wasn't what I got from randomly pushing buttons in bitbucket, so I decided to make a throw away branch from default, and merge this into the feature branch. That actually did the right thing, and edit/commit seemed more straightforward a way to deal with conflicts than a weird vimdiff window. In their defense, I remember the first time I saw a monticello merge window, and it was only slightly more friendly to figure out without instructions, and I think you really need an internal model of what's going on.

I decided to move the live site into the 'live' branch, so default doesn't matter or mean anything, and can take whatever merges make sense.

Saturday, March 29, 2014

Quick Thoughts about Digital Ocean

I recently started playing with DO Droplets. From 0.7 cents per hour, the cost of experimenting is very low. The total time from creation to up and running a website, for me, without extensive prescripted deployment recipes, is under two hours, and seems to be a manageable cost at $5. This is very favorably priced compared to shared hosting, and the KVM vps seems to handle memory more adequately than my vz vps. SBCL always segfaults during build process on a VPS with more ram on the VZ side, and correctly built on the 512MB DO system. I find that needing to destroy the container when done to release the resources is not too bad, I could imagine spinning up a test container on the fly (60 seconds to do this) and releasing it after finishing. I also found that the same hostname yielded the same IP address a second time, a week later. I don't know that I should count on this, but it certainly saved a little trouble fiddling with DNS.

eshell and tty numbers

This may seem obvious after reading more, but it surprised me a little that emacs eshell mode does not reserve a persistent tty number, and grabs one on the fly for any command run. If I have a terminal window open, using tty 0, and run the tty command in eshell, it may tell me tty 2, but after closing the terminal, running tty in eshell now gives tty 0. This is not the case with real shells, or even with the shell mode in emacs, where the shell has a persistent controlling terminal.

Wednesday, March 12, 2014


Interestingly, has access to a bash console, and emacs-23 installed. So it's also almost like emacs-lisp anywhere, though I haven't experimented much with the server side and it appears the firewall prevents using things like erc (irc client) from within the web interface. I think the console is quite usuble, and the 100s per day is actually not bad for a free plan.

It took not very long to launch web2py at, and if I can use this for prototyping in django or web2py, I may pay for the larger plan.

Monday, November 25, 2013

Have I finally fooled Google?

I went to search for Douglas Kennedy, and was directed to his page in French. Since Cinq Jours is a translation "de l'American," there are one of two possibilities. Either the official page of Mr Kennedy is in French, or I have successfully convinced Google I'm not interested in the book "Five Days" from which this is translated. I suspect Mr Kennedy has a good reputation in Europe and puts his french face forward, but I may have won, quoi sais-je, moi?

Monday, October 21, 2013

Defining Pi

Sometimes, when working in Scheme, I'm surprised that pi is not defined. I'd define it myself, but to what precision? My current method is to exploit Euler's identity to get the basic precision supported by log. Is there a cleaner way to initialise this?

 (define pi (imag-part (log -1)))