Monday, September 15, 2008

Why You Should Consider PostgreSQL

I'll be presenting at the Utah PHP Users Group (UPHPU) this Thursday on PostgreSQL. I'm not much of a PHP person. The last time I used it heavily was shortly after PHP5 was released, and I found between changes I had to make to get PHP4 code to work in PHP5, plus frequent security patches I had to install, plus changes I had to make to get my code to work with the patched PHP, it was all more work than I felt I wanted to endure. So I switched to Java. That was also an inappropriate choice for many reasons, but it was an excellent introduction to the sorts of things the programmers were doing at the job I started around that same time, and since the project for which I was doing all this programming never went anywhere anyway, it's probably all for the best.

Anyway, I met "mindjuju", the president of UPHPU at the recent Utah Open Source Conference, and since I'm president of the Utah Database Users Group we started chatting user groups. We're trying to get UDBUG off the ground, and since most of our membership is already involved in other users groups, we figured one way is to have meetings in conjunction with other groups.

A few days later, I got a message on IRC from mindjuju suggesting that, as I'd expressed my devotion to all things PostgreSQL to him at UTOSC, I might want to do a presentation to introduce people to PostgreSQL and let them know why they might want to use it. Another message a few days later told me that the scheduled presenter at this month's UPHPU meeting might have to cancel and could I step in if that happened. Hence the talk, the first draft of which is above.

Sunday, September 14, 2008

Schematic, etc.

I'm hoping to get this blog caught up with the current state of the project, and as such, have spent the last $way_too_long messing with KiCad to draw a workable schematic of what I plan to do. See the image associated with this post for the somewhat disappointing results. KiCad made a nice postscript schematic, but I had to settle for a ATmega8 in the image instead of the ATmega168 I'm using, and the multiplexers I've got aren't the 74LS154s shown, because of limitations in the KiCad component libraries such as they exist on my laptop. Also, wouldn't, so far as I could see, allow me to upload the original postscript, so I've had to convert it to PNG, with a fair bit of lost resolution as a result. Anyway, the idea is that the microcontroller counts, as quickly as possible, from 0 to 255, and puts the value out on PORTB, four bits of which act as the selectors for each of two 1:16 multiplexers. One multiplexer has a constant +5V input, and it electrifies one of 16 possible rows in a matrix of switches, depending on the selector values from the ATmega168. Then the other multiplexer, whose selectors are the lower four bits of PORTB, iterates through all 16 columns of the matrix. The output of that multiplexer goes to a pin on the microcontroller; if a charge manages to show up on that pin, the microcontroller knows that a switch has been pushed. The software on the ATmega168 will keep track of what keys are pushed at any given time, and when something changes, will send a signal to a computer somewhere. Here's hoping it actually works.

The multiplexers are really neat. In this project, they serve simply to give me a bunch more pins to work with. You can put a signal on its "input" pin and send it to one of 16 possible outputs by applying a binary number between 0 and 15 inclusive to the four selector pins. They also work in reverse, so if you're applying signals to the 16 pins, you can choose which signal ought to be fed out of what would then be the "output" pin. That lets me control a 16x16 matrix of 256 "switches" (the organ pedals, keys, and whatever else I want to control) with only eight microcontroller pins to selecting the switch I'm interested in. I feed +5V into one multiplexer constantly, and use one more microcontroller pin to see if that +5V gets through the switch matrix to tell me a key is pressed. Quick thanks to Intersil for sending me two free 1:8 multiplexers (three selector bits, eight possible outputs). If I don't find a place for them in this project, I'll find a place in another project :)

Yesterday I soldered together a 5V power supply with pretty much the schematic shown here. Now my test circuit on a breadboard on the floor next to the baby cradle behaves predictably :)

Tuesday, September 9, 2008


I started this blog principally so I could document projects I'm working on, or thinking of working on, or concluding not to work on, etc. Principle among these is the organ I'm hoping to refurbish. One Christmas, my grandma called me to say that an aunt of mine was getting a new organ for Christmas (similar, if I remember correctly, to this one, giving her old one to grandma, and would I like grandma's old Hammond that's been sitting in the basement for years (similar to this one), and kinda still works?

I said yes, and with much grunting, straining, and herniating, we got the thing up the stairs and into my second floor condo, whereupon I discovered what little it could do. Half the time it doesn't even turn on, and the sounds it makes are pretty rough. However, thanks to a nice, open source, software organ synthesizer called Aeolus, my computer can do a decent organ impression. So I figured I'd build a MIDI interface into my new Hammond, whose console is pretty decent, internals notwithstanding, and via MIDI the console could tell my computer what sounds to make.

So I started learning electronics. It's loads of fun -- I've wanted to learn this stuff for years anyway, and now that I have a real project to apply it to, I find it's not too tough. Yet. :)

Monday, September 8, 2008


Someone asked me today, "Are you blogging this somewhere?" Having never felt the need to start a blog, much less update one (regularly or otherwise), I was somewhat taken aback. Who, after all, could possibly be interested, and if no one was interested, what difference if I just stick to scribbling occasional poorly composed ramblings into my neglected journal while slumped listlessly in a chair at the kitchen table at 4:00 AM, having once again allowed the nocturnal demands of my two little boys to chase from me all capacity for more sleep?

Whew... take a breath...

The answer: The Greater Good. Or perhaps not. In fact, it has been suggested that some of the activities I've seen fit to engage in (or to make vague plans one day to engage in) might prove useful or interesting or something to various denizens of the InterTubes. Not only that, I realized that my embarrassingly spotty journal writing habits didn't lend themselves well to the strict documentation required by experiments such as I intend to conduct in relation to the above activities, and that perhaps the convenience of blogging would somehow encourage more consistent record-keeping.

If you've made it this far with some measure of comprehension, my congratulations to you.

In short, I'm writing this because someone suggested they might be interested. That being the case, I'll try to ensure that the stuff I post aligns with the expressed interests of my readers, such as they are(n't). Should I fail in those efforts, well, phooey.