Minority Opinions

Not everyone can be mainstream, after all.

Archive for October 2012

Initial Linux Kernel Configuration

leave a comment »

It has been over a week since I started configuring the Linux kernel.  It has over six thousand options, and many of them are decidedly non-obvious.  Half of the acronyms have been unfamiliar to me, and the rest I only know from a long history of poking around in computer internals.  Common words like “gadget” can have specific, sometimes unintuitive meanings.  The help text often gives me just enough information for a web search to teach me most of what I need.  I’ve made at least two major mistakes that I had to go back and fix in order to enable essential pieces.

Read the rest of this entry »

Advertisements

Written by eswald

30 Oct 2012 at 5:25 pm

Posted in Linux, Technology

Re-Installing Linux

leave a comment »

At the moment, my best video card is stuck in a machine with an operating system that I can no longer upgrade.  If I can get Pyglet to work on it, I just might be able to run Dandelion, the recent PyWeek winner.  I had considered wiping the whole machine, but it has some backups that I would rather not disturb, particularly given that some of them are from a laptop that no longer turns on.

That machine has three partitions: The operating system, swap space, and my home directory.  Unfortunately, that leaves no decent space to install a new operating system.  (Note to self: In the future, use five partitions.  Small /boot, two 10-20 GB roots, swap, and large /home.)  Fortunately, I had installed gcc before losing access to the package repositories, so I made the crazy decision to compile Linux From Scratch.  Again.

Read the rest of this entry »

Written by eswald

23 Oct 2012 at 6:35 pm

Posted in Linux, Technology

Interfacing with Self

leave a comment »

Graham Dumpleton noticed a problem with simple WSGI middleware, and provided a couple of templates for fixing it.  He wasn’t particularly happy with either; one subtly defied the WSGI specification, and the other split state tracking across two classes.  I noticed a way to repair those issues, but my comment seems to have been swallowed; perhaps the comment system didn’t like the non-breaking spaces I used to ram something that looks like Python through the limited format options available, or maybe my typos caused it to be rejected by the author.  Fortunately, I had saved my code on Pastebin, so I can share it with you:

class ClosingMiddleware(object):
    def __init__(self, application):
        self.application = application
        self.iterable = None

    def __call__(self, environ, start_response):
        self.iterable = self.application(environ, start_response)
        return self

    def __iter__(self):
        for data in self.iterable:
            yield data

    def close(self):
        if hasattr(self.iterable, 'close'):
            self.iterable.close()
 

Read the rest of this entry »

Written by eswald

16 Oct 2012 at 6:00 pm

Posted in Python, Technology

Seamless Level Transitions

leave a comment »

My ideal roguelike has neither stairs nor perfectly rectangular levels.  Unfortunately, that makes level generation tricky; as Dwarf Fortress found, it’s less satisfying to depth without being able to go over and under your position.  Fortunately, I’ve found a way to walk between levels without using explicit stairs; at any given point, everything you can see looks like it could be on a single level.  This is the feature that lets Rainbow Rooms generate mazes of infinite size on a finite screen, without scrolling.

In fact, I found two ways to do so; the first made movement and field-of-view calculations simpler, but creates some annoying restrictions on level generation.  Given that level generation is a much harder problem than the first two, and will need to be created anew for any given game, I’m going to describe the second method here.

Read the rest of this entry »

Written by eswald

9 Oct 2012 at 6:31 pm

Posted in Python, Technology

New and Improved Rainbows

leave a comment »

So Rainbow Rooms didn’t do nearly as well as I would have liked.  One user went so far as to claim I should be disqualified for failing to follow the theme, and for doing no work of my own.  To be fair, half of the work I put in failed to make it into the version I submitted for judging, but I think a good portion of that critic’s problem was a failure to entirely understand the central mechanic.  At certain points, though not always on every early maze, the doors prevent you from going back.  Usually, this means you’re on the right track.

Unfortunately, version 1.0 had a problem where it could trap you in other places, as well.  It also could take forever to generate a new maze; after a certain point, the heat death of the universe might not be enough time.  Both of these issues are fixed in Rainbow Rooms 1.1, now available for download from either my personal server or from the PyWeek site.

Read the rest of this entry »

Written by eswald

2 Oct 2012 at 9:32 pm

Posted in Entertainment, Python