Category Archives: Programming

More than anything, this post succinctly describes how to get up and running with Clojure + Emacs. Virtually no thinking is required if you are working from a default install of Ubuntu, and not much more is required for any linux distro – you just need to know how to use your package manager.

Furthermore, if any of these steps would cause you trouble (deleting .emacs* comes to mind), you probably already know how to handle it.
Read More »

Not many people know that I run Gentoo (a source-based linux distribution) at home. Largely this is because most people don’t care. But for those who may care, I’ve decided to explain how Gentoo is better, at least for me.

Gentoo is known for taking a lot of time to set up – which is well deserved. Gentoo typically takes 1-3 days to complete a full install, and requires more work in maintenance than most other distros.

However, as I developer, I find that it is quite nice.
Read More »

Cross platform software can be difficult to debug.  Having a set of virtual machines on hand that can be used for testing can be quite handy.  Here are a few resources I’ve found for pre-made disk images.

VMWare Player images (seems to have much less variety):

ThoughtPolice

Gentoo (didn’t find a VirtualBox image)

VirtualBox images (large variety):

VirtualBoxImages (mainly torrents, large index)

VirtualBox Images (direct download, hosted on sourceforge)

HelpDeskLive (older)

I think that should cover most open-source OSs.

As far as windows goes, one option is to roll your own and save it in its initial state.  If you have access to the MSDN, most OS releases are quite readily available.

Clojure is a new Lisp on the block.  It runs on the JVM, giving it full access to any Java library (and its complement), but it leans more towards the functional paradigm, so data structures are immutable (a big boon for concurrent programming, as locks become obsolete).

In addition to supporting the usual data types of Lisp, Clojure has added syntactic support for vectors, maps and sets.  Some sacrifices have been made for performance; in order to have immutable data structures, it returns a new data structure for each mutation.  However, because the parent data structure is immutable, much of the structure can be shared. Performance-wise, Rich Hickey has stated that “I’ve tried to keep [operations] all within 1 to 4 times [the equivalent] Java data structure, [but lookup times are frequently faster]“.

Read More »

Update: this post is now obsolete with the advent of official exherbo installation instructions.

As the Exherbo developers say, this distribution is not finished/supported/full featured and is very volatile. The project has been alive for less than a year, and there is a significant amount of work to be done before it will be ready for the mainstream.

That said, this is what I did to get it working…

This information should be used to get an idea of Exherbo’s status, not as a reference for installation. If you are unfamiliar with any of these steps, you probably shouldn’t try Exherbo.

Read More »

How many times have you needed to sort a file based on random or arbitrary criteria?  Well, probably not too frequently, and even if you have the need, you should be able to write one in less time than it takes to find a base.  But let’s ignore that.

One solution might be to do some fancy-schmancy mapping operation on the file, such that your data is preserved, but an alphabetical sort will give you your desired order, after which point you can remove whatever processing you did to it.

That sounds like it would be painful.  Or fun, if you have enough time or an interesting idea crosses your mind.

At any rate, a friend of mine recently was faced with an interesting dilemma, where he needed to sort a file based on some unusual criteria.  Here are the basics of his problem.  He forgot the last few characters in a password, but he was fairly sure they were letters and lower-case numbers.  So, he wanted to prioritize the the order in which he checked the 15 million combinations (62^4).

Read More »

I don’t even know if this program I am building deserves the title of grammar checker.  Regardless of what it deserves, it must be referred to as something.  I will refer to it as a probabilistic grammar checker.

My basic premises are these:

  1. It is impossible to precisely parse natural languages, due to grammatical ambiguities
  2. Simple algorithms can often provide results that are superior to more complex algorithms
  3. Simple algorithms are easier to analyze
  4. Effective analysis can bring significant insights on how to improve an algorithm

Based on these premises, I am building a brain-dead grammar checker.  As I test it, I will see its failings, and from those failings will be able to analyze its weaknesses.  With a knowledge of its weaknesses, I will be able to either enhance the algorithm in minor ways, or discover what issues exist in my underlying assumptions. Read More »

A Followup:

Well, I did some C file IO, along with implementing a simple binary search on a dictionary.  I can’t believe how easy it was.  I haven’t done straight C since my first internship, which was just after my freshman year.

As a side note, I do use C/C++ pretty heavily in competitions; it’s definitely C++, because I use lots of the C++ libraries, but almost anything else I slop together using structs and functions.  While in competition, it’s best to reduce the mental overhead as much as possible.  Plus, I love C format strings.  They are a lot easier than having to remember C++ formatting… Read More »

I have recently come to the realization of how rusty I am at programming.  I haven’t been doing enough small applications to keep APIs, etc. in memory.  A few years ago, when I was pretty new, I studied and programmed compulsively, but I haven’t been giving as much in school of late.

To solve this problem, I have decided to go through a sort of training regime.   The first phase is to brush up on or become more proficient at I/O, and implementing basic algorithms.  As I progress, I will probably focus more on specific languages.  The second phase may be to develop a basic application in these languages, hopefully changing languages and challenges every week or so.  I may stagger the study, focusing on a few at a time.  We will see how things go.

These are my target languages: Read More »