Archive for software

VS SP1 Installer

This is a pretty pessimistic outlook on an install – I suppose it is nice to see that they aren’t beating around the bush either – “….several minutes to several hours….”, yikes.

vs sp1 install msg

Arbitrary sorting in MySql

I recently needed to do a sql query in MySql that selected a bunch of items by their ID, the query was something like this:

SELECT * FROM Customer
WHERE CustomerID IN (502, 506, 398)

I just wanted some customers (more like 50, not just 3), but I also wanted them sorted in the exact order that I specified their ID’s by, so I wanted customer 502, then 506, and then 398, in that order.

It turns out theres a feature in MySql that allows you to specify an arbitrary sort order in a query, it looks like this:

SELECT * FROM Customer
WHERE CustomerID IN (502, 506, 398)
ORDER BY FIELD(CustomerID, 502, 506, 398)

You simply specify the field that you want to sort on, and then give the sort order of the items you want to use. You don’t even have to be selecting on the field that you order by, so this would also work:

SELECT FirstName, LastName FROM Customer
WHERE CustomerID IN (502, 506, 398)
ORDER BY FIELD(CustomerID, 502, 506, 398)

Here, I’m not including CustomerID in the results, but I can still use it in my custom sort.

S3 Backups

We just finished up the rest of our tasks for the next release of my project at work on Friday, and it feels great to be done right before getting a couple days off for the holidays.

I recently got my Amazon S3 account setup so that I can use S3 to backup my computers at home. I initially was trying to use a combination of JungleDisk, WebDrive, and robocopy to manage the backups. JungleDisk is the interface between S3 and windows, WebDrive allows you to map your S3 account to a network drive in windows, and robocopy is what I use to mirror my local directory structure on S3.

This solution was “ok”, not great cause it was complicated, but it got the job done. WebDrive also is not free, so it would cost money after the trial period ran up (~$50 I think).

Then, JungleDisk released a version that included built-in drive mapping support, which was great because that made the solution free beceause WebDrive was now out of the picture.

I was having some trouble though, because while I was testing my backups, I noticed that files were being uploaded each time I would backup, even though the files hadn’t changed. I came across this post by Scott Bellware about his switch from JungleDisk to S3Drive and I think I found the cause of my issues, the JungleDisk cache.

So I’ve now switched to S3Drive which also has built-in drive mapping support and no cache so its really a “WYSIWYG” way to manage your S3 account; you can be sure that what you see is actually whats on Amazon’s servers. While I liked the encryption feature in JungleDisk, I agree with Scott that I like having a simple mirror of my directory structure rather than encrypted files that need JungleDisk to function.
I’ve got my new laptop backed up on S3 as well as the server in the basement, all thats left is the desktop in the office, which is going to be ~25 GB when you put in all the pictures that Erin’s got on there. I’m still debating whether or not to backup all of our mp3’s since that will add a lot of space, but its so cheap its tempting.

We’re leaving for my parent’s house in about an hour, so I’m going to start the backup when we leave, so hopefully its done by the time we get back tomorrow night.

Merging conflicts

The project that I’m on has a biannual release schedule, so we’re in crunch mode to hit the next release thats coming up in the next couple weeks. I’ve been working late, but some other guys have been working even later; I’ve gotten build emails at midnight this week.

I just wanted to relay a funny thing that happened this week. I was working on a file that someone else was working on too, so I just manually made the file writable (we use source safe) and made my modifications. After I got his changes, I used WinMerge to merge our changes together and checked the result in.

Of course, I screwed up the merge and overwrote his changes. He emailed me later and said “Hey! You overwrote my code!”, so I apologized and merged the code correctly and got it all squared away.

After explaining to him what had happened, that I thought I had merged it correctly, he replied with this email:

The best WinMerge is in your head :)

That’s so true.

Trying out Linux Desktop

Since I’ve been reading Just for Fun, about Linus Torvalds, I’ve gotten more and more interested in using Linux as a desktop OS. I’ve tried Linux before, but I usually grabbed some old, shitty computer to install it on, and I never really forced myself to use it.

This time, I’ve taken a leap though. I have a second hard drive on my computer that has (had) Vista RC1 installed on it that I never used ’cause Vista wouldn’t recognize my wireless card and without the internet a computer is pretty much worthless.

So today I installed Ubuntu 6.10 on the second hard drive and I’m writing this post from my new linux install :)

The only downside so far is that it’s a pain in the ass for Erin to be using the computer and then having to restart the machine to use linux, I wish there was a way to have both OS’s running so I could switch out quickly. As it stands, I have to restart and press F11 when I boot up to manually change the boot order to boot from the linux hard drive when I want to log in.

I’ll spend some more time tomorrow getting all the necessary stuff installed (Apache, MySql, etc.), and I’ve already got MonoDevelop but I’m still looking for a good PHP IDE, one that has intellisense preferably, but for now I’m going out to try out one of Surly’s newer beers, the Darkness.

Just for Fun

I’ve been reading this book lately, Just for Fun: The Story of an Accidental Revolutionary. It’s a first person account of the creation of Linux, as told by Linus Torvalds to David Diamond.  So far it’s been very interesting, I like the way they’ve mixed the technical details of developing Linux with some personal background on Linus’s life as well.  Hearing about the viral growth of Linux is really cool too, it’s funny how it makes you want to go and download a copy and start using Linux as your desktop OS.

just for fun

Error 0×8ffe2740

I was doing some web development this morning and after installing some software I needed to do a restart. After the machine came back up, I tried to access the local site that I had been working on, but it was trying to download “index.php” rather than serving it up in my browser, which was weird.

I opened up IIS and for some reason my Default Web Site was stopped. I tried starting it, but got this great error message, “unexpected error 0×8ffe2740 occurred.” Wonderful. Thankfully, the first result on Google was a MS site for this error and the reason. The problem is that something else had already taken port 80, so my site couldn’t use it. (As an aside, you’d think IIS could catch this error a little better, its not a very exotic situation). So I switched my site to port 8080 and it worked, but I still wanted to find out what was using port 80.

After running “netstat -a” from the command line, I could definitely see that something was using it, but didn’t know what. If you run “netstat -a -b” you will get a list of all ports, and the program thats using it as well, and low and behold, Skype had decided to use port 80. I quit Skype and my web site started with no problem. I believe that Skype searches for an open port to use when it starts up, so it must have gotten to port 80 before IIS could and took it, lame.

Ahh, random recruiter emails

I got a pretty flattering email today from a recruiter:

Unknown,
Good morning, I thought you might be interested in a programming opening we have available……

They must have misinterpreted my name from “Ben” to “Unknown”, it’s a common mistake. But seriously, if anyone is looking for work in the Twin Cities, contact the company below, they probably pride themselves on the personal touch the bring to the table. :)

On-Demand Services Group, Inc.
12400 Portland Avenue South, Suite 105, Burnsville, MN 55337
952-894-9039

Walnut Time Entry

I thought I’d show some screenshots of the project that I’ve been working on in my spare time for awhile now. I haven’t touched this in a couple weeks, but I’ve just got a couple more tweaks to do on it, then I’ll put it up for download, if anybody wants to use it.

The app is called Walnut, for no reason in particular. It’s a time entry tool that I use at work to track the time that I spend on any given project. The reason I made this in the first place is that I was working on 3 different billable projects and I was just making paper notes of the time that I spent on each one on each day and I wanted something a little better.

I tell Walnut that I’m starting work on a project and it starts a timer and when I’m done it stops the timer, then at the end of the day I can check my totals and fill out my timecard. I’ve started using it for other stuff too, like surfing the web, to see exactly where my time has gone. You can also enter in notes for each task throughout the day. You can click the screenshots for full size images.
walnut screen

This is the main screen in Walnut. You can see the current elapsed time for your current task and Start/Stop/Pause/Resume the task. Below is a list of today’s tasks. On top if you switch to the Notes tab, you can enter notes about the current task.

walnut aggregate view

This is the view if you switch the bottom tab to Day’s Totals. This shows an aggregate view of the day, with some basic stats. It groups the tasks together and adds up the time, so if I surf the web for 5 times for 10 minutes each time, the Web task would show up here with 50 minutes. You can view the totals for any other day by switching the date in the date box. One of the things that I think is really cool is that the aggregate view updates in real time if you are viewing the current day’s tasks.
I have some more ideas for features here and there, but I’d like to have something to download soon, let me know if you’re interested, if anyone emails me I’ll be more likely to finish it faster :)

New Server Setup

Haven’t been posting much lately, I haven’t been feeling too morivated lately to much computer related stuff outside of work, so the blogging usually slides in sync with that.

I have been working on setting up a new server down in the basement however.  Erin’s previous employer was getting rid of some computers so I had her grab me one. 1Ghz, 512 RAM, 10GB hard drive for free?  I like that price :)

Setting up a new machine is kind of a pain in the ass because you have to go download all the software you need to run all your stuff, its usually hard enough to simply remember what needs to be installed.  Here’s my list of server software that I install, this list grows as I learn new things:

I would love to have all these on a DVD or something so I could streamline the process a bit, but the problem is that some of these change so quickly that it would be out of date by the next time I want to install them.