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
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.
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.
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
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.
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.
(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 source 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.
apt-get build-dep package
Subscribe to:
Posts (Atom)