Wednesday, October 19, 2011

Hexidecimal Words

Looking for a easily recognizable and memorable hex sequence?
Look no further.

cat /usr/share/dict/words | egrep ^[abcdefsilo]*$

For example:



Output below the fold.

Saturday, October 1, 2011

Dissecting a bootloader

I am sick of bootloaders being mysterious and inaccessible, so I have decided to take a closer look at mine.

Thursday, August 25, 2011

Color indexing not supported.

I'm going to start documenting the solutions to errors I encounter while programming when I feel the error is likely to be encountered by others. So, anyhow, this is the first one.

When trying to compile the GLUT redbook examples, you may get the following runtime error:
craigp@liasson> make && ./aaindex.bin
gcc -Wall -I/lusr/X11/include -I/lusr/include -o aaindex.bin -L/lusr/X11/lib -L/lusr/lib -lglut -lGLU -lGL -lpthread -lm aaindex.c
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 128 (GLX)
Minor opcode of failed request: 26 (X_GLXMakeContextCurrent)
Serial number of failed request: 49
Current serial number in output stream: 49
What was happening in my case was that the system dose not support color indexing mode. Change the following line
glutInitDisplayMode (GLUT_SINGLE | GLUT_INDEX);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGBA);
I'm not exactly sure where to view the capabilities of X11 or if it is possible to enable color indexing mode at all without root access. The header states
* Initialization functions, see fglut_init.c
. . .
FGAPI void FGAPIENTRY glutInitDisplayMode(unsigned int displayMode);
. . .
so if you absolutely must know, that may be the place to start looking.

Friday, August 12, 2011

Sphere inversion versus spherical reflection

A reflection in a spherical mirror is not exactly the sphere inversion (1), but it is awfully close (2).

Friday, August 5, 2011

Degenerate fun

Thinking about how homogenous coordinates degenerate to lower dimensions. For one dimension, you can scale and shift points on a number line. For zero dimensions, you get the identity matrix. I wonder if it's rotation all the way up, or if there are better ways to view the higher level transformations that open up in larger matrices.

Sunday, July 24, 2011

Buffalo Wings

250mL flour
10mL salt
5mL pepper
3mL cayenne
3mL paprika

1 egg
250mL milk

1000mL chicken
1500mL oil

100mL hot sauce
15mL margarine

Saturday, July 23, 2011


600 mL water at 50C
2 ct yeast packet
15 mL salt
30 mL butter
45 mL sugar
1500 mL flour

30 minutes at 220C

Saturday, July 16, 2011


1L ~= 4 cups
1L ~= 200 teaspoons
1L ~= 60 tablespoons

1 cup = 250mL
1 teaspoon = 5mL
1 tablespoon = 15mL

First mix:
400mL flour
17.5mL baking powder
20mL sugar

Then mix:
300mL milk
45mL molten butter
1 egg

Saturday, May 7, 2011

Occupational closure for computer science?

In Communications of the ACM Bjarne Stroustrup argues that computer science should undergo occupational closure..

What were the economic implications when this happened to medicine, engineering, and law? It seems that there inevitably follows a proliferation of lesser certifications. Perhaps it would displace the commercial certifications designed to encourage vendor lock-in.

Is the field of computer science mature enough to know what should be involved in certification?

Would certification have prevented the Arianne5 and Patriot accidents? Weren't certified engineers on those projects as well as the Challenger project?

Maybe we should be pushing formal verification for critical software?

Tuesday, April 12, 2011

Evolution and Entropy

Here are some of my thoughts that could clear up the creationist's questions about complexity and information.

What is information? It correlates to the entropy of a system. A messy space has a lot of information in it. This can be stressful to people who like things neat because they must process all that information to model their space. Failure to model it properly could result in getting a stubbed toe or eaten. It is useful to things which hide because the searcher is less likely to find the hidden information in the competing rush. While organizing someone is actively using energy to transport entropy out of the local system.

The image of the clean office contains 0.87 times the amount of information in the image of the dirty office. You can check this yourself by saving the two halves as separate jpegs and then comparing the file sizes. Most image file types have built in compression.

Information entropy has the same formula as physical entropy. A disordered string such as 110100 has more information than orderly strings such as 000000 or 101010. The universe began very hot and simple, and is now cold and complicated as random processes leave evidence of their action.

This definition seems to defy the common sense idea that information must be meaningful. Meaningful information is information with somehow corresponds to another structure. Database experts have terms which make a distinction between information and meaningful information but I won't state them here because they are parochial and not informative.

The creationist's question might then be rephrased; how do natural processes create meaningful information? To the extent that a system is internally structured it can be said to model itself. A tree ring contains meaningful information about the weather. That information was already there, in the environment. Evolution also uses information that is already present in the environment. The process of it's accrual is more tortuous though.

Yet this information is less readily understood. It has a richer internal organization. Tree rings are obvious but more structured organization seems to need a designer to some people.

Here I present a rather tenuous taxonomy of modelling processes. Criticism is welcomed.

All editing processes involve two different classes of operation; correction and compression. Compression includes organization of objects, organization of ideas, removal of duplication and uninformative wordiness, and throwing out garbage. Compression always reduces the total information needed to express the meaningful information. Compression requires no insight to perform. An editor can copy edit a document with no knowledge of the subject. The editor must only know how to parse the encoding. A program can compress a file without any regard to what it represents (noise, a picture, a book). Correction includes fact checking, on a lower level of encoding, correcting spelling, or otherwise making your model more accurate. Correction requires insight to perform. An editor must have access to the system being modelled in some way in order to make corrections. A spell checker is a corrector with recourse to a set of data concerning spelling. A fact checker would verify using an outside source.

Care must be taken to be clear about what metric you are compressing by. If you are compressing visually, you would line up the columns of text in a source program so that they all appear to be a single entity. If you were compressing for space in a source program you would remove all the white space. If you are compressing by physical space, you would jam everything you could into your backpack. This would increase the visual complexity of the system.

When adding information, meaningless information can be added by injecting noise or disordering the model or duplicating parts of it. Meaningful information can be added by a process akin to correction.

Evolution never compresses. It adds noise and it corrects. It does so blindly, by trial and error, with the model slowly accreting meaning as it interacts with the environment. An organism can be said to contain information about its environment. By looking at an animal out of it's normal context, one can infer many facts about where it lived. The lack of compression gives genomes their horribly messy, profuse, and disorderly nature. To the extent that the genome IS the environment this rule is violated.

The normal human way to edit is to verify with the environment for meaning and then add the information. Evolution adds the information, and then checks with the environment for meaning.

Saturday, April 9, 2011

On the subject of untapped ideas...

Jeff Atwood talks about how quantity always trumps quality.

Aesop Rock's paean to Lucy says it well:
I've never had a dream in my life
because a dream is what you want to do, but still haven't pursued
I knew what I wanted and did it till it was done
so I've been the dream that I wanted to be since day one

Ze Frank want's to get us off braincrack.

Zammuto and de Jong go about their transcendent subtlety, letting us know there is a quality in not expecting something big, huge and exciting.

Thursday, February 10, 2011

Evaluating units

I spend a lot of time thinking about units. As the framework in which we take the measure of all things, our choice of units is vital.

There are several desirable qualities one should strive for when considering the design of units. These qualities are often contradictory and we can evaluate a unit in terms of those it does satisfy. In my opinion, these are the most valuable properties a unit can have:

A unit that is natural arises directly from our understanding of nature. In order to be considered natural, a unit must reduce the complexity of the physical constants when they are considered with the unit as part of the basis. An example of a natural unit is the charge of a single electron, or the charge of a single quark. Examples of non-natural unit are pH mol and meter.

A unit that is anthropic corresponds directly to a low-variation fact of human life that is directly intuitive to the human imagination. An example of an anthropic unit is the day. An example of a non-anthropic unit is the meter, since Earth's radius is not a direct part of the human experience.

A primal unit is an anthropic unit that is in some sense the most directly related to human experience. A unit of this type is normally a reference point that cuts across all human cultures with little variation. Of all the distinctions I will draw here, this one is the least precise. Regardless, I feel it is an important goal to find the primal unit when designing anthropic units. A perfect example of a primal unit is human body temperature, for things are classified as "cold" and "hot" in reference to it. A non-example would be the boiling point of water (or in the case of centigrade, some fraction of it, but see 'simple' below).

A unit that is ratio produces a meaningful result when two values in that unit can be directly and meaningfully divided. An example of a ratio unit is the Kelvin. A non-example is Celsius.

A simple unit lacks arbitrary complexity such as named subdivisions, named supersets, extra ratios between subdivisions, and various caveats. By this I do not mean something like the SI prefixes, which do not belong directly to any one unit. Joules are a simple unit, whereas centigrade, which introduces a hundred gradations needlessly, is not.

Taking these metrics in hand, any unit can be directly scored and compared to those measuring the same dimension. While not perfect, this score provides a good qualitative comparison of the various units.

Lets look at a few units. Sometimes I propose a new unit. I have not presumed to name these and perhaps some already exist and I am merely ignorant of them. These I give shorthand names. For example, artime would be an instance of one possible anthropic ratio time. The others should follow in a similar and hopefully obvious vein.

natural anthropic primal ratio simple score notes
foot 0 0 0 1 0 1 non-simple subdivision inch
meter 0 0 0 1 1 2 non-simple usage cm
nrlength 1 0 0 1 1 3
arlength 0 1 1 1 1 4 average human height
fareheit 0 0 0 0 1 1
celcius 0 1 0 0 1 2
kelvin 0 1 0 1 1 3
nrtemp 1 0 0 1 1 3 absolute hot, absolute zero
artemp 0 1 1 1 1 4 body temp, absolute zero

Wednesday, February 9, 2011

Reflecting on Programming Pratices

While reading the Extreme Programming booklet, I have been doing a lot of thinking about my internships. I feel that it has given me some good perspective on the things that didn't go as smoothly as they could have. I recognize that I have done some things wrongly, and my management has done things wrongly, and some times we both did the same thing wrongly. I had written more but as a professional this is all I want to say publicly. The important thing is that in the future, I will be able to face similar challenges with greater ease and professionalism.

I've been applying the XP practices to my operating systems project and they have been helpful. One thing I don't like is that 8 hours of pair programming is much more intense than 8 hours of cowboy programming. We are bad at taking frequent breaks, as advised. It's harder to do because the Linux lab has been moved in the bowels of the experimental physics dungeon.

Tuesday, February 1, 2011

Random obstacles to academic performance

Well I missed another quiz in addition to those I missed due to registration problems after they dropped all my classes because of a $16 testing fee. I was calling the police while this particular quiz was being given. I'll just post my follow-up email they had me write to the maintenance department:
To whom it may concern,
Yesterday around 1:00 PM, I witnessed one of UT's white maintenance trucks numbered 166 push a pedestrian out of the way aggressively. Instead of letting a pedestrian cross behind the truck, the operator accelerated in reverse, turning to chase the pedestrian. The pedestrian, a young man, had to run and brace himself against the tailgate of the truck with his arms to avoid getting pulled under the wheels. The truck chased him perhaps 15 feet. I phoned the police who told me to contact UT directly since it was not a criminal matter. I do not understand how intentionally running into pedestrians is not a criminal matter. From where I stood I could see what appeared to be a male in the passenger side. I sincerely hope that this incident is not allowed to pass without something being done to remedy this dangerous situation.
Best regards,
Craig Pemberton
Aside from this cursory email nothing has really happened:
Mr. Pemberton--
Thank you for bringing this matter to our attention. I am copying this email to our Associate Vice President for Campus Safety and Security, Bob Harkins, for review.
Once again, thank you for bringing this matter to our attention.
Julien Carter
Sent from my iPhone
I hope the driver gets his driver's license revoked. The victim just walked away in a hurry. I don't think he knew what to do. He was probably also worried about being late for class.

So in non-exceptional news, things seem to be going well. The project hasn't really seemed to get any momentum going. There are loose ends everywhere. I'm sure I'll make it on time. The lectures are about exceptions which are nice and all but don't seem relevant unless Dr. Downing is working up to giving us a project that uses them heavily. Personally the exception style never occurs to me while I am writing my own code. Of the intern-ships I have worked at, none of them were very exception-friendly. Dr. Shmatikov referred to exceptions as "structured gotos" which is a nicely clinical view of the matter.

In Dr. Emerson's class my girlfriend sat in with me because we were going to drive home afterward. Emerson was going over CTL and saying a lot of things like "P holds infinitely often everywhere" and "in all possible futures, eventually P will always hold". So she writes me a note about holding your pee infinitely. I could barely hold it together I almost broke out laughing in front of a Turing award winner in a class of about 15 people! I felt so embarrassed. Now if she wants to wait for a ride she will wait outside the classroom! She agrees and so on Tuesdays and Thursdays when we drive home together in the evening she will do something else and be less bored and I will be able to concentrate on the lecture fully.

Wednesday, January 19, 2011

The Harvard Guide to Collegiate Happiness

In my experience Downing's first focus has always been on the student and scholastic excellence. The first reading was "The Harvard Guide to Collegiate Happiness", a gesture of good will and total mess of a paper written by and for students of the humanities. It is wrong on most points by way of a consistent confusion of causation and correlation.

1) Meet the Faculty.
I have drank with my instructors. Some have offered to share their cigarettes with me. I have had engaging discussions with them after class, over Facebook, or by email. These experiences are rewarding and enriching. They aren't something that can be forced; they arise naturally. Often these interactions are simply not appropriate. Some relationships offer no adaptive transactional strokes and are not open to pursuit. Often this is the case when working with research-oriented professors in the natural sciences. Excel in the class and you may get a position on their team but the relationship will still stay strictly professional. The small-group discussion-oriented professors more commonly found in liberal arts are the welcome exception in the natural sciences. This later type of class is normally easier and less rigorous. Take more easy courses of this nature and naturally you will perform better and meet more professors. But your success was not had because you met them.

2) Take a mix of courses.
I agree with this. I thought I was going to be a graphic designer or a linguist coming out of high school. Take a lot of different tangents and you will be rewarded. Many students on more difficult paths are financially or academically constrained from choosing to do this. The reality is that some paths through college are less fun and more work.

3) Studying in groups.
In my experience in groups a small fraction of people do the work, and the rest mooch. Averages go up and the correlation is made, to the detriment of the industrious who come away having expended a lot of energy for an incommensurate reward. (Short aside: I recall an experience in a world literature discussion session in which the TA insisted that Newton had invented science. I argued that no, science is a storied philosophical and methodological tradition pioneered over a long period of time, citing examples from Sextus Empircus to Claude Bernard. Afterward I was drained, little improved, and yet I prevented the others from experiencing an academic travesty. Hopefully I prevented some number of misconceptions.)

4) Write, write, write.
This section argues that courses with fewer, larger writing grades are bad and I agree. Few and large papers are awful, both didactically and for GPAs. Don't do that to your students.

5) Speak another language.
This would have been nice, but many people simply can't justify the huge number of hours on something they have already tested out of. Again, those who can have easier majors and will tend to do better.

6) Consider time.
Long study sessions may be better than multiple short sessions, but can someone change their study habits or are they deeply ingrained in one's personality? Has Light tested his time log idea empirically? The superficial "just keep a log" type of quick-fix suggestion seems naive to me.

7) Hold the drum.
Students who engage in extracurricular activities are more successful. It is pretty easy to see how they have confused causation and correlation here. I feel happier when I have the resources to self-actualize, but I when I don't choose to self-actualize, it is because I don't have the ability to choose otherwise.

Software Engineering

Professor Downing has asked us to keep a blog for the CS373 Software Engineering course. I registered this blog months ago hoping to revive a pleasant old habit and never got around to doing any actual blogging. This course offers a perfect opportunity to start.

The syllabus is promising, brimming with a panoply of shiny modern lightweight tools like Django, Google App Engine, Torvald's baby git, assembla, and epydoc.

Whenever I browse the larcenous Coop bookstore I have eyed the refactoring book with a great deal of interest. I'm glad I own it now. I find the process of refining a big messy project into a fine-tuned and orderly one very rewarding, and this is the only book I have ever seen entirely devoted to the process. I hope we get to spend a good chunk of time on it.