Posts tagged programming
MIT/GNU Scheme in OS X
0ИконописikoniI’ve not mentioned this previously, but I bought a Macbook Air a few months back and it’s one of the greatest purchases I have ever made. I love this thing! It is so damned sexy (observing both its hardware and software), and so damned fast. I picked-up the baller, 13″ model with the Core i7 processor and 256 GB solid-state drive … it’s portable personal computing perfection! The more Apple products I buy (and, I’ve now accumulated quite a few), the fewer reasons I can produce to not dedicate future technology spend to Cupertino. </rant>
Macbook Air in-hand (or, more appropriately, surgically fused to my hands!) and pursuing Lisp (and Scheme) as a new programming language (dialect), I needed to install MIT/GNU Scheme on my constant companion — more specifically, I wanted to install it in such a way that I can run Scheme / Lisp programs from the shell without having to fire-up the X-Windows application that is installed by the package by default (“Edwin”). A relatively straightforward process, although not particularly well-documented.
Steps to complete are below:
- Download the OS X binary for MIT/GNU Scheme from the GNU site here.
- Mount the binary disk image and copy the appropriate files from the disk image to /usr/local/lib
It is worth pausing here to note that one may have to create this path, as I did. Commands to create and then copy the files are below:
$ sudo mkdir /usr/local/lib/mit-scheme-x86-64 $ sudo cp -R /Volumes/MIT\:GNU\ Scheme/MIT\:GNU\ Scheme.app/Contents/Resources/ /usr/local/lib/mit-scheme-x86-64/
- Create a symbolic link — scheme – to the newly installed mit-scheme binary
$ sudo ln -s /usr/local/lib/mit-scheme-x86-64/mit-scheme /usr/bin/scheme
This last step is critical in fully integrating Scheme into the shell, as one would expect it to be after installing it in a Unix environment.
Onward to Lisp hacking greatness!
Postscript: I’m using the Lisp-in-a-Box IDE distributed by the Common Lisp software repository in OS X as my platform for development in Common Lisp in parallel … learn both dialects simultaneously — seems prudent!
Installing MySQL for Python in Ubuntu
0иконографияКартинивик услугиWhilst on the grind this evening, hacking on some Python code in a newly-installed Ubuntu virtual machine, I needed to install MySQL for Python. Building the package, pre-installation, requires mysql_config — which I had some difficulty locating in the repositories. After flailing about a bit, the solution is to install the libmysqlclient-dev package.
$ sudo apt-get install libmysqlclient-dev
The package also requires setuptools, which is available here. Download it (I’m running Python 2.6.5, so I downloaded setuptools-0.6c11-py2.6.egg) and run it as a shell script.
$ sh ~/Downloads/setuptools-0.6c11-py2.6.egg
A second error — i.e. gcc could not find python.h — was resolved by installing the Python development package.
$ sudo apt-get install python-dev
Back to it …
Core Dumps in Ubuntu
0I resolved this year that I would take time to pursue one of my passions — computer science. As such, I am learning how to write applications for Linux. I’ve just spent 30 frustrating minutes trying to figure out why on earth my deliberate segmentation fault in the small C program I have written is not producing a core dump in Ubuntu 9.04. It turns out that Ubuntu disables core dumps in Bash by default. The fix is simple enough — use the ulimit command to enable core dumps.
bash$ ulimit -c 100
In this case I have enabled core dumps and given them a limit of 100 blocks. Problem solved! Hopefully this makes it into the search engines and helps someone else frustrated by this same issue.
recently on cg.com