Wednesday, March 12, 2014

PythonAnywhere

Interestingly, pythonanywhere.com 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 djuber.pythonanywhere.com, 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)))

Monday, October 14, 2013

Information Hiding

(I'm not going to talk about steganography.) There's an idea in object oriented design that suggests that information hiding is part of the success of encapsulation. Having worked in OO languages that do not have the notion of private/public interfaces (Smalltalk is a great example) the way Java or C++ do, I am sometimes skeptical of the benefits of this. I believe I see a point in programmatically specifying your level of abstraction and sticking to it. You worked hard to make the abstraction layer, and it would be useful to be able to see it used, and perhaps know where it was misused or bypassed. On the other hand, I think enforcement of this leads to a huge level of headaches, and changing the interface after the design is daunting, since the compiler will likely throw a fit. In conclusion, since it interferes with redesign and rethinking, for me it's a misfeature.

I always thought it was silly if you have the source to 'hide' the implementation. The pointer to implementation pattern in C++ is the ultimate expression of this fetish, trying to move the guts out of the header (since there is a weird amount of required information in the header files) and into the source, where I guess it can be compiled and hidden in object code. Here I disagree with both the sentiment and the technique.

Monday, September 30, 2013

I finally get it

I have spent too long wondering why things were harder in apt than I wished they were. Mainly this involves my constant complaint that a package could somehow install without the documentation, and not knowing if it's possible to configure synaptic to honor 'suggests' hints, and automatically install -dev and -doc for any selection. I now finally understand apt-get source and apt-get build-dep, which go a long way toward allaying my problems.

In the past, what I had done was something similar to

apt-get install package

and if package was unfortunately lagging (sbcl is a prime example where the repositories kept an old version, but anything under active development is going to have this issue) I would clone a git repo and build myself. Now, the development tree assumes, you know, that you have current versions of all the development tools, and all the development headers for all the dependencies. Since I had run off the apt track, I regressed ten years back and started package hunting, configure, scratch head, read error message, find next dependency, configure, scratch head...

Remember, this is the problem these package managers were supposed to solve. So I now see how it is solved.

apt-get source package
(does not need privileges) downloads the patched sources to build the binary version in dpkg. This is great, you can modify the options a little, but still let dpkg know you have a version installed for this (to prevent a stupid binary being installed into /usr when the live version is in /usr/bin). However, it still gives me the stable/stale version. So this is where the next part comes in handy.

apt-get build-dep package
will make sure that you have a workable toolchain to satisfy configure's needs. Now I clone the latest and greatest from git or svn, and apt-get build-dep package, and then I'm having nearly an 100% success ratio in building. I always knew the debian tools were the best, I had only forgotten why.

Saturday, September 28, 2013

Ventra, your wallet, and you.

The CTA recently rolled out it's new payment system, Ventra. This is an RF chip used in major credit cards that allows you to tap your card above the turnstile reader and go right in. This has the added benefit of flexibility, in that tourists or anyone need not buy a farecard, but can simple use their existing credit or debit card for fare payment.

This is great, except that you may three or four of these cards in your wallet. Looking over my recent activity, at least on train ride was paid by my bank atm card, and another was paid by my america express card. I guess simply holding my wallet up to the reader will not be sufficient, and instead I will need to carefully hold the ventra card alone up to the reader when entering a station. For the most part, it seems that this has been working fairly well, since I have less than a 20% error rate for cards essentially next to each other in my wallet.

This is only a quirk for me, since I don't have a monthly pass (which wouldn't have been used when I pay directly with a different card) and am not yet using the pretax fare payments through my employer. I can see this catching a number of people by surprise, and it's a departure from the previous chicago card chip, which would not accept outside payments, and would work right inside your wallet.

Tuesday, August 27, 2013

Nights

I now have on average 3.5 nights per week of free time, where I can't go out since the sun's down (years in San Diego have persuaded me that the sun is the critical deciding factor for outdoor activity, years in Chicago have terrified me of the night), and have time to spend doing something meaningful. By meaningful, I intend not involving alcohol or /b/.

So, what have I been up to? I installed antiweb at beta-reduction, my vps at work. This was a simple case of (1) finding a CL implementation which works on CentOS with a nazi kernel eager to kill off any memory hogs -- in this case Clozure works marvels, SBCL fails to build for me, and building even CLisp proved troublesome, segfaulting the moment quicklisp was loaded; it's possible ecl is viable here, (2) install anti-web, (3) create /var/aw, (4) add a few dummy workers, in this case beta-reduction.com and iota.beta-reduction.com. What I'd love to do is investigate dynamic page generation, particularly using UCW. How workers handle cgi marshalling is yet beyond me, my light goals may be to implement simple pages in guile or ccl, with antiweb acting as a dispatcher.  Everything I learned at work about what a LAMP site does is completely overthrown by this setup, since for one hub and two workers each at 512GB Virtual memory, thus I have over 1.5TB of VM allocations, which aren't triggering OOM conditions. In contast, it seems most programs assume they can and will use the memory they allocate, and controlling mysql and php allocations for customers is maybe 1/8 of my job.

 I've started working again on 99 lisp problems, which keeps me busy this week. I'm surprised to look at previous times I started this and where I stopped.  I must be getting more proficient, to have made it several problems further. The best part is solving an intermediate problem in one or two lines using the last result. I never understood mapcan until I needed it. I think there's an internal timer in me, if a problem takes more than one hour to solve, I tend to move on. This time I made it to problem twenty-seven : given a list of items acting as a set, generate all possible sets of disjoint subsets of a specified size, as


(defun group (set sizes)
 ; something interesting here)

Also, this is the first week of classes at Roosevelt, so I think I will not be there for this fall semester. I may contact Dr's Pivarski and Urbina to see if this Spring makes more sense. It hurts to be 3 courses from a MS, but I can't afford more time to a degree without an exit plan. I also can't spend 36-48 hours per week at work and then take 1-2 nights from my free time to go to school without making Beth sad panda. I guess college might not have been my thing. (It really was, but what can you do?)

Still plowing through French and English readings. Just finished 'The Spectator Bird' and 'Bug-Jargal', moving into 'Dernier jour d'un condamné'. Before that was 'La Philosphie dans le Budoir' and a collection of poetry from 'Le Chat Noir', which was interesting, though I wish it had had more Allais. I read Villette, which I think is perhaps at least as good as Jane Eyre.