Regularly Expressing

science, sci fi, writing, spirituality

Archive for the ‘Programming’ Category

ODT to RTF converter —

Recently I discovered that OpenOffice can’t really generate RTF files, so I wrote my own converter. It’s rather basic, just handles italic, double space, paragaraphs, and centering. However, for what I need it for it works a lot better than the built-in OpenOffice export ability. The program is written in Java and you can get […]

Learning Haskell —

If you do any programming, you may have heard of a strange language called Haskell. It’s gaining rapidly in popularity, and has many cool features. Implicit Strong Typing – It provides the compile time error checking that one gets with C++ or Java generics, but it deduces types on its own without explicit programmer input […]

Memory Conserving Regex Engine for Java —

Many regular expression engines, my own package pat included, suffer from a tendency to produce stack overflows in some circumstances. This seems to be a widespread problem, common to many java regular expression engines. To overcome this limitation I recently wrote a new regular expression library, completely from scratch, designed to avoid this problem. It […]

Custom Dictionaries, Aspell, and LaTeX —

It took me a bit of hunting and twiddling to figure out exactly how to use aspell with a custom dictionary that supplements (not replaces) the master dictionary, so I thought I’d document it for posterity. aspell –lang en create master ./custom_dict.aspell < ./custom_word_list.txt aspell --add-extra-dicts=./custom_dict.aspell -t -c my_document.tex And that's it for the checking […]

Infinite Sunshine Computing —

I have been thinking about the struggle to build large computing systems. The major challenges of the current age of computing are power, cooling and scalability. The machine room and energy costs are dwarfing everything else. This concern has even spawned the creation of a new ranking of supercomputers, the Green 500, which ranks machines […]

Functional Programming —

Many people bemoan the difficulties of programming in the multi-core era. What many programmers do not realize is that a way out of deadlock/race condition hell is known — it’s name is “Functional Programming.” This term should not be contrasted to “Object-Oriented Programming,” rather it should be contrasted to “Imperative Programming.” The idea in functional […]

How to build a Universal Translator —

It occurred to me that something like the “Universal Translator” of Star Trek could be constructed without very advanced technology. I call my more primitive device a “Drongo.” If you have two technologically advanced races, and they meet, there is a need to construct a basic vocabulary quickly. One can sit in a room, point […]

Regular XML Expressions —

I have been toying with the idea of a specialized regular expression syntax for XML. Often, the regular expression questions that people email to me indicate that they are using them on XML and HTML. There is a very nice discussion of part of the problem here on Joe Gregorio’s blog. On that blog, he […]

Coding Conventions —

It is important to follow standard naming conventions when writing code. It increases clarity and readability. Thus, in the "Elements of Java Style," we are told to capitolize class names but not function names, etc. A recent elaboration on this basic idea was put forward by a colleague of mine (Adam French) and his associate […]

Python’s “with” keyword —

Python recently introduced the “with” keyword. It is another way of automatically cleaning up something at the end of a block. It is a way to try and get some of the destructor functionality of C++ into a garbage collected language. Garbage collection, IMHO, continues to be a mixed blessing and I think the “with” […]