Sudden Urges

All of a sudden, I have a desparate need to redesign this site. I’ve been thinking about moving all the family pictures in Max’s page to a blog (I even figured out a cool way to take a PhotoShop generated web gallery and turn them into importable entries), and turn the Geekery into a blog as well, just to be able to update the pages a little easier, and be able to add tidbits as I come across them (like installing Apache2 and Tomcat the other day). I just seem to keep putting it off. Since we’re trying not to leave the house except when neccessary (why take a risk when you don’t have to), I should have time to do something this week… I hope.

Published
Categorized as computing

Wearing a New Hat (a Red One)

I got my uberBox at work upgraded to RedHat 8.0 today. It’s nice. The dithered fonts in XWindows look really good, and the admin tools actually work (as opposed to things like the X Services Tool in 7.2). There were some glaring omissions like ksh and the telnet server made in either the pursuit of ease-of-use or danger avoidance, but if you’re behind a firewall, telnet’s just fine to have installed.

So, the lesson today kids is to choose the “Custom” option and install what you want. Don’t expect “Workstation” to actually have everything you use in it.

And in non-geeky news, Jen and Max are coming home tonight instead of tomorrow. They were going to go to the beach, but because it’s been raining for three days, and is supposed to keep dripping right on through the weekend, they’re coming back. Last night was kind of tough. It was really boring without anyone to talk to, and no Max to play with. I didn’t know when to go to bed, partly because I didn’t want to go up there by myself. I’m glad they’re coming back tonight…

Published
Categorized as computing

It’s So NEW!

I’m learning a new language. Yes, I’m doing it. I forgot how much fun it is to jump into something brand new and see it work. We’re moving to Java/JSP/Tomcat at work, and that means that I get to switch from my beloved AOLserver to the strange world of virtual application urls, beans, servlets and JSP tags.

To make this fun, I found the fabulous Apache2/Tomcat bundle from the kind folks at Server Logistics. The setup was virtually painless past doing some configuration (that’s unfortunately not in their readme). So, I’ve replaced the Apache that comes with OS X with Apache 2 and a JSP engine. I’ve now written my first jsp. It’s ugly, but it works. I can now include files, do neat-o for loops, switches and if statements. I do like that you can switch from code snippet to regular HTML mid-process (like int he middle of an if statement). You can’t do that with AOLserver, which means you sometimes have problems with escaping quotes.

I’m looking forward to this move. This afternoon was a lot of fun.

In sad news, Jen and Max are in Pennsylvania with my mom for the next couple days. I’m aaaa-aaaall alone, which explains why I’m still at work.

Published
Categorized as computing

I Don’t Know an Alias From A Join In The Ground

In the spirit of learning something new every day (and the fact that the way I was doing it took 20 minutes each time I ran the query), I learned how to select aliased tables with Postgres today. For those of you who aren’t geeky, you may want to skip this post altogether.

I’ve been using SQL when I had to for almost five years now and never run into a spot where I’d do something like this, but it worked really really well and runs a whole lot faster than the old way (mostly because I was doing a JOIN of a table with almost a million records to one with 250k records).

I know the suspense is killing you… how do you do it? This example is completely unrelated to what I’m actually using it for, because it’s work related. Let’s say you have a table full of used car ads and you want to get each distinct manufacturer and how many ads there are for each of those manufacturers. Now, if you have a separate table of car makers, this is fairly easy. But, let’s (for sake of my precious example) say manufacturer is a free text field where the user can enter whatever they want. To get out the list of manufacturers and the number of cars ordered by most often listed, you could do the following:

select distinct lower(manufacturer) as carmaker,(select count(*) from car_ads where manufacturer = carmaker) as car_count from (select lower(manufacturer) from $table where timestamp between $begin and $end) as all_ads order by car_count desc,carmaker

How cool is that? You can create a virtual table with a select statement from either the same table or a separate one. You could even join your virtual table with another virtual table for even MORE fun!

Published
Categorized as computing

Geek Tip of the Day

If you create a database, don’t expect it to live forever. Always keep a backup of at least your schema, and preferrably your data. After having experienced a total data loss, I’m at least reassured that I kept my schema on a system other than the one the database was running on. I had to recreate all my tables and indexes, but thankfully I’d saved them offline and it was as simple as cutting and pasting. Now, if only I had backed up my data…

Published
Categorized as computing

If I Were Rich…

If I were rich, I’d get one of these for the office, one of these for upstairs to go along with my work provided Powerbook and abandon the PC World forever.

While I’m dreaming, I’d have 1.5mb/sec DSL, a wireless network and everything would have Airport cards so there aren’t wires strung all over the place. And because it’s OS X, everything would just work. I wouldn’t have to worry about Microsoft anymore, or the weirdness that is Windows XP. I might miss my games, but I have a PS2 now, and I don’t play games on my PC much anymore anyway.

It’s a nice dream, isn’t it? It’s a $6600 dream, but still nice (I actually thought it would be a lot more than that)

Published
Categorized as computing

Head of the Class

I love that I’m ahead of the curve on something. I used to use definition lists because they were easy to style (back in the wild days before CSS was widely supported). Now, unordered and ordered lists are easy to style. My favorite is to use margin-left:-15px to keep those bullets lined up with that that horrendous whitespace to the left of list items.

Yeah, I’m the ListGeek, bow before my orderly data!

Published
Categorized as computing

Hold My Hat While I Kvetch

This will interest no one but me, but I don’t care. I’ve found something completely annoying about AOLserver and I need to share. Let’s say you download these bigass (the technical term would be “friggin’ huge”) files every day and have to parse them out and dump them into a database so you can do a bunch of conversions on them and generate spiffy reports. Let’s just say this is a new system that worked fine in testing with small files, but now, it will only parse a small portion of each file before deciding to give up. Let’s then say that the reason it does this, and then doesn’t report any kind of error is a helpful feature in the server that closes active (and very busy) db handles after they’ve been open for a certain amount of time. Does it check to see if they’re doing something? Nope. It just closes it. Thankfully, there’s an obscure configuration setting (MaxOpen in the pool/POOLNAME section) where you can set that timeout to some insane number (did you know that 1,000,000,000 seconds is approximately 192 days?). This will run tonight… I hope it gets all twenty-four hours instead of just ten or eleven. The only good thing is that it made me go in and fix up a bunch of things it was doing that weren’t quite as efficient as they could have been, which got us from 9am to 1pm, but still, sheesh.

I love AOLserver. I use it for things it wasn’t intended for, like turning it into a cron job handler, and reporting system. I guess that’s why I run into this stuff. I can live with that. But I’m still gonna whine about it when I run into stupid stuff like this.

The other thing is that Postgres doesn’t handle databases with more than 200k records in them very well without creating a LOT of indexes (like on every column of every table). Before I deleted the records older than two weeks, it took five minutes just to get a count. If I were a real DBA, I’d go find out why. But, I’m not. I use it because it’s easy to install and configure for use with AOLserver. It also supports all the SQL features I’m used to with Sybase. It’s also reasonably fast for normal use.

If I didn’t have this headache, you all would never have known all this stuff. Thanks, Dr. Nik! (yes, my dentist’s name is Dr. Nik)

Published
Categorized as computing