Personal

Fun with Programming a Technology Tree

Technology Tree for Civilization version 2

I spent over a day writing a silly Python program to read in a Civilization 2 Technology Tree.

I learned:

  • Python assert statements tend to fail silently during common misuse. Blogged about it. Suggested fixing it on the Py3k mailing list. Guido says there is a SyntaxWarning now.
  • Google docs appears to use the python csv module to export to csv. Their spreadsheet works fairly well. I like the auto-save/auto-versioning.
  • The csv package is pretty inflexible. It cannot discover the dialect of comma-separated-vague file it is passed. It works for, and is designed for, times when the export is either excel or Python. The Dialects do allow you to set some other basic options.
  • nose is a great testing tool. nose.tools confuses pylint because of its on-the-fly playing with __all__. I should probably write a Wikipedia article on it.
  • Whenever debugging recursion, make a note both when calling the recursed function and when returning. It makes digging through the log much easier.
  • Nothing tests your code like a large, real world, example.
  • The logging function rocks far less well. I filed bug on it: it picks up the wrong %(filename)s. This bug has apparently been going back and forth for years.
  • Reading a correctly validated input file is about 10x the effort of reading an incorrectly validated one.
  • Testing code is fairly easy and a bit bulky. It’s real cost is that it forces that 10x effort in validating the input in order to pass the tests. I could get behind Test Driven Development.
  • The Civilization 2 Technology Tree has five errors, including two “Destroyer” units and a bunch of redundant dependencies, such as Fusion Power doesn’t need to depend on Nuclear Power.
  • Sets in Python work well.
  • WordPress has syntax coloring plug-ins that work fairly well, and it can handle arbitrary files.
  • Programming is still fun.

So, with no plans to do anything with this:

tech.py — This is Python code. It loads the technology tree and doesn’t do anything with it.

civtech.csv — A CSV file with the Civilization 2 technology tree

CivChart — A GoogleDoc spreadsheet with that same technology tree

This post cleverly delayed for a few days to space out my postings. :)

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Tailrank Yahoo Bloglines Newsvine Spurl Fark

Coding
Personal
Write-up

Comments (0)

Permalink

12 Impossible Things Before Bed

Nebuala

Lewis Carroll’s queen sometimes believed ten impossible things before breakfast. I have my list of a dozen impossible things before bed. Some of these are habits, some are time commitments, and some are maintenance to stem the the onrushing tide of life. How many do you lust after?

1. Only one refined carbohydrate item per day.
This is only a single item per day that has sugar or white grains as a main ingredient. That means cereal for breakfast OR a mocha OR a brownie OR a muffin OR ice cream. My diet would be overrun with fruits, green things and protein.

2. Thirty minutes of serious exercise.
Ah sweat, my old nemesis. I need to get my cardio up from a fast walk, lifting weights, or helping random strangers move to a new apartment. Stretching is good, when preceded or postceded by sweating.

3. Three difficult phone calls.
There are always phone calls I find difficult to make and easy to delay. These can be hiring contractors, dealing with vendors that are needlessly obtuse, or working through some paperwork snarl on the phone.

4. One blog entry.
A good blog entry, like this one, usually takes some thought and some work. Most of my blog entries are about new ideas and require coming up with stories, a drawing, and some business details. Formulating a basic idea is easy; dragging the words and pictures out in the right order takes effort.

5. No video games the entire day.
Annoyingly, I find that one quick game is nearly impossible to avoid. Also two. Also three.

6. Clean out inbox and desk.
I follow David Allen’s flow-chart from “Getting Things Done”, sometimes. I would like all physical and electronic inflows be unclogged and either completed or transformed into an orderly project. It hasn’t happened yet, so it belongs on the impossible list.

7. One thirty minute microproject.
Creating a small project of very limited scope and completing it every day feels impossible, but accomplishing it will feel magical. These projects could range from “Hello World” in a new language to disassembling a robot. Learning what I can accomplish in a short time is valuable in itself.

8. One full page of notes about what I learned.
Every day I read and research. Having a page of organized notes at the end of the day would be great. It would be grand to be able to review my knowledge, know my references, and have key facts at my beck and call.

9. Record of everyone I meet.
Just a note, a name, an entry, a reminder of the people that I meet.

10. Clean sink and laundry buckets.
The bane of keeping my physical house in order. If these are done, all else will follow.

11. Twenty minutes of spiritual reading.
It could be the traditional spiritual book, or poetry, or anything to feed my soul. Comic books do not count.

12. One good joyous time.
A good day includes a nice long laughing break, a joyous rumpus with my son, or a moment of zen. Joy is necessary to success.

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Tailrank Yahoo Bloglines Newsvine Spurl Fark

Personal

Comments (0)

Permalink

Event Write-up: First Tuesday Notes for Tuesday, August 1.

Overall:

The basic topic, “Improving Communications in Face to Face (Meatspace) Meetings” presented challenges. It may be the topic with the most opportunity that we ever covered.

The group was small, about 15 people, with good participation by all. As mechanics worked out, no one was that interested in dinner and the lack of a babysitter sidelined Judith for much of the conversation.

Some Ideas Covered:

  • Achut Reddy and others suggested improvements to the general calendaring and scheduling of meetings.
    1. A universal cut-and-paste function that would recognize calendars would be helpful. The idea would be that a calendar item could be highlighted text from an email, webpage, IM, Evite, or other source and be copied into a calendar in an intelligent manner.
    2. We need to easy share calendars by role (social, work, technology interest, politics, etc.), by group (kw-comm, our tribe, everyone we know), and social circle (1 degree of connection, 2 degrees, etc.)
    3. It would be nice to have a slick implementation to take over the world.
  • Bubbles, Laura, and others pointed out the low-tech solutions for meeting at a convention, the Voodoo Board.
    1. See Wikipedia for a description of this low tech method involving push pins, index cards, and a bulletin board.
    2. The Voodoo Board allows easy message passing fast, simple, and cheap.
    3. The secondary social aspects, such as meeting people who are checking messages, make the board worthwhile.
  • Joe, myself, and others talked about discovering interesting people.
    1. One of the modes or roles is to find interesting people, break the ice, and chat.
    2. Use of markings for common interest was discused. For example, Judith mentioned one gathering where badges held symbols for different fields of law. Also mentioned were Bujold’s “Betan Earings” and the Geek Code.
    3. I came up with the overboard technical solution: wearable LCD panels with near range communication. When you come close to someone else with a similar wearable tag, it might light up with “I’m also interested in Python” or “I also know Richard Threadgill”. I’ll write this idea up in detail soon.
  • The core human problems still trump: calendars might be inundated by promoters; slimy people lie about existing relationships; etc. The nuances of communication are an opportunity to automate.

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Tailrank Yahoo Bloglines Newsvine Spurl Fark

Coding
Personal
SelfEd
Write-up

Comments (0)

Permalink

Hello world!

Yes, I’m moving my blog to its permanent home.

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Tailrank Yahoo Bloglines Newsvine Spurl Fark

Personal

Comments (0)

Permalink