I’m in the beautiful Bay Area this week, being shamelessly wined & dined by some of my favorite people in the ‘verse. As the logic goes: since I’m being exposed to such culinary excess, you should be too. Here, have some pecan pie.

pecan pie

Pecan Pie is happy to see you

Read More

I’ve been griping all too much about this Apache-config thing. Yes, it’s been a thorn in my side for some time, but that was all of my own doing. In my search to take the most systematic, educational approach to understanding what the configuration does, I deluded myself into believing I could grok the entire system. That may be feasible for smaller systems or more immediate coding challenges, but when applied to a massive open-source software project like Apache, it’s foolhardy at best.

The good news is that I realized this, which led me to scale back my expectations appropriately. That done, I was able to accomplish what I had originally set out to do without too much trouble. To recap, I needed to configure the server software such that if I opened a browser and navigated to, say, http://mysite.local/, I would see the website I was developing on my machine. Technically, the default setup does something like this, but I wanted my working site to stand apart from other files on my computer — the goal was to make it appear as if it were actually online. The best way to do this is by setting up it up as a virtual host. What’s a virtual host? I’m glad you asked.

Read More

This happens often enough that I feel I should hang the words above my doorway: “When all else fails, use Python instead.” Optional addition: “Like you should have in the first place.”

Around New Year’s, I wrote a little implementation of Conway’s Game of Life in jQuery. Why jQuery? For funsies. Unfortunately, after a few hours on a plane, the funsies went to a picnic, leaving me with manifest failure for poor decision-making skills. It’s not that javascript is incapable of building games; it’s just that it isn’t particularly well-suited to the task. Kind of like the way a spatula might not be the best tool for herding wild boar.

After learning that educational lesson, shaking my fists impotently, and returning to my lair to nurse my wounds, I decided it was time to approach the problem again. I won’t deny I was somewhat inspired by the recently-released online textbook Making Games with Python & Pygame. I had been eyeing the pygame library for a while (Python being one my favorite scripting languages), and this new resource offered a great opportunity to dive right in. Obviously, the imminent arrival of this term’s final exams played no part in the timing of this project.

Read More

Hey, remember that time when I said you shouldn’t set comestible rewards for coding failures? That was dumb. You should totally set comestible rewards for coding failures. And coding successes, for that matter. In fact, you should give yourself that kind of reward all the time! So let’s just pretend I never said that, k? K.

Alright, internet. We have a lot to catch up on. Last time I was here, I was about to start hacking into my Apache configuration files. I’ll get to that in a minute, but first, let’s zoom out to see what else has been going on over the past month. My last post was written and published  from the back of a lecture hall during one of the most stultifying courses I have ever attended. Though the subject matter (C++) is interesting, the professor managed to render it into enthusiasm-draining drudgery, leaving my mollified brain with little desire to write code after hours. Moreover, I was just starting on a series of site designs with short, drop-dead-style timelines, a couple of which were in a new content management system. Though the sites look good now, and I have learned that I really like Expression Engine, free time was not in abundant supply. Mere excuses, I know, but there you have it.

Read More

This just in: I hate Apache config files. I’ve been trying to set up the server software on my computer, but not only are the directives difficult to sight-read (to use a musical analogy), but the documentation seems particularly obtuse. Maybe I shouldn’t be too harsh; after all, the intended audience consists of  professional server administrators. But still! How is someone relatively new to the application supposed to approach it without shooting themselves in the foot? Even when I’m confident enough to try a particular set of directives — and consequently witness it fail miserably — I don’t have any reliable way to debug the setup short of returning to the documentation to find what I misunderstood.

In other news, I can let myself become very engrossed in C++ multi-threading, if only because it keeps me distracted from Apache config files.

Since I haven’t come up with something reliable enough to talk about, it’s time to pull out more food. (Note to self: be wary of this strategy — don’t set consumable rewards for coding failures.) This here is probably my favorite steak recipe of all time. I discovered it late in my college career, when a few friends and I established a monthly “Extravagant Cooking Night.” The “extravagance” in question was variable, but it was a fun opportunity for broke, dorm-kitchen-numbed, but nevertheless enthusiastic students to throw together some meals that we never would have otherwise.

Read More

With the beginning of the new term — and, consequently, a new course load — I’ve been trying to work out the right balance between class work and hobby projects. And maybe even spending some time away from the computer (imagine that!). For that reason, I put aside Conway in order to focus on a lighter task: futzing about with the web application database. Though I did get a few tasks accomplished, I was doing just that: futzing. So this update won’t be particularly fascinating, by any accounts.

Rewind to a few weeks ago, and you’ll recall I was discussing the basics of designing and building a database. Primary Keys and Foreign Key contraints and all that. Well, with the database schema (the configuration of tables & columns) firmly in place and tested, I was almost ready to build a very basic prototype/proof-of-concept. All I lacked was actual data to manipulate, which meant it was time to generate some. Verisimilitude wasn’t the top priority here, but I figured, the more realistic the data, the better: the prototype will then provide a better subjective “sense” of how the app works.

Read More

Howdy. I’m in Russia. (Ok, not anymore, but I wrote most of this last week.)

I just wanted to get that out of the way, because I think it’s awesome and worthy of attention. Also, it explains why I haven’t been doing too much since around Christmas. I’ve been spending all my time between the opulent museums, palaces, & churches and hidden little corners of St. Petersburg. It’s fantastic and wonderful and I’m having the time of my life. I am not, however, accomplishing much on my computer.

That said, traveling is a mixed blessing when it comes to coding projects. Even though the art and history and architecture and LIFE of the city is distracting, I also spent a lot of time in planes and airports to get here. As it turns out, restricting oneself to 3x3x5 cube feet of space for 22 hours is pretty good incentive to write some programs — games, in this case — offline. Though I suppose Tetris would have been more appropriate given my destination, I used the journey to implement Conway’s Game of Life.

Read More

I had an extraordinarily unpleasant time last week, giving me little energy or incentive for a more technical update. To be honest, I spent most of my time either studying for my final or frenetically playing Bastion and Black Mesa to distract myself from… life. Hey, nothing like an immersive story or raging alien warfare to save me from the burden of self-reflection.

Things are infinitely better now, but I don’t want to leave this blog untended until I actually accomplish something. So that means it’s time for more food! Today, Norma’s Peanut Sauce. This is nothing new; anybody who knows me is aware that I always have a jarful of the stuff on hand. It’s my culinary Old Faithful. It’s been put online before, and I’ve passed it on to many people personally, but I want it never to be forgotten. Because this, my friends, is a meal with an origin story.

Read More

Last week, I took advantage of a few precious days off to stretch my SQL chops and start designing a usable database. This presented a couple of challenges, the first of which was simply remembering the syntax for creating tables, columns of a specific type, etc. The second challenge was figuring out the multifaceted approach to maintaining data integrity. This latter piece involves judiciously-placed constraints on the data, ensuring that it will always make sense in a real world scenario (even without an application to interpret it). More on this later.

I’ve talked about the tabular format of a database before (like an Excel spreadsheet, remember?). What I avoided discussing earlier are the inherent limitations in modeling an arbitrary system as a series of tables. Individual entities fit in well — for instance, you can easily define a person by their most salient details:  username, first name, last name, email address, etc. — but relationships among entities becomes more difficult. How would you denote that two people, as two separate rows in the Person table, are friends? There’s no place for that sort of detail in the Person table. I mean, sure, you could try to add a “friend” column, but that would take either only 1 entry (thus restricting every person to have only 1 friend) or an amalgam of all the friends’ names, which would be an unparsable blob of text.

No; it’s best to keep entities and relationships separate. So to implement the example above, you would create a a second table, Friends, in which each row contains the names of two people who are friends. This way, every person in the system has exactly one entry in the Person table, but a variable number of rows in the Friends table depending on how, uh, socially active they are. A misanthrope will not appear in any rows in the Friend table, whereas a social butterfly will have many, many entries.

Read More