Dec 02

DBus Tutorial Updated

I’ve updated the DBus tutorial. When I moved to WordPress, some of the escaped sequences were not quit rite. So, I’ve fixed all of those, and updated the text a little bit to reflect changes in dbus-cxx. If anything is still not right, please post – or any questions, please post those too! I can’t fix problems if I don’t know that they exist.

Oct 28

TV on PC

So a few weeks ago, I got a Hauppauge 950q to watch TV on my computer.  I finally got it working today, because of all the stuff that I’ve had to go through.  First, I got a new cable box from Comcast.  Once I had the box though, there is no Coax out from the box.  So I had to use the composite input.  That’s fine, so I try to fire up Windows Media Center to play it.  Well, it turns out that Media Center refuses to work properly unless there is an IR blaster remote to control the box.  I don’t care about that, because I can just use the standard remote.  So, I tried using the standard WinTV7.  Unfortunately, this seems to lock up my computer with alarming regularity.  So, I’ve now moved on to MediaPortal.  Fortunately, it does not lock up on me.  The only problem that I had was a syncing issue between the sound and the video.  Here’s what I did to fix the problem, which may or may not work for other people:

1. Change your codecs  to be Microsoft.  Do do this, open up the MediaPortal configuration in expert mode, and go to ‘Codecs and Renderer’.  This did not fix it for me, but at least one other person said that it fixed it for them.

2.   Under the Media Portal TV Server configuration, go to ‘TV Channels’ and pick the decoder that you are using.  Mine is ‘CVBS#1 on 3’.  In the ‘Channels’ section, click ‘Edit’, and make sure the tuning details are right.  For some reason, mine was on ‘The Netherlands’ for country.  I also selected ‘VCR signal’.  I’m not sure which of these actually fixed the problem, but once I did that my sound is properly synced with my picture.

Oct 17

A Wish for Opera

So I’ve used the Opera web browser for years now.  I’m used to it, I like it.  Not that I particularly have anything against Firefox, but hey.  It’s what I do.

Anyway, when Opera boots I always like to start clean.  But you know what would be very useful?

A way to close, but on the next start to come up with all the tabs that were open.

Many times, I find myself doing something important, and then I put my computer to sleep so that I don’t loose my place.  I would love if there was an option to close Opera, but load all of my currently open tabs on the next startup.  I don’t want this to happen all the time, which is why it would be great if it was some option, like “Exit and Save Tabs”.

(sometimes I get this to happen by just killing the Opera process forcefully.  The end result is the same, but it’s awkward to do)

Aug 21

Editing a file with no tools

So I came across this interesting question on SuperUser yesterday, and it got me thinking… would it be possible to create a full text editor using only standard terminal commands?  That is, could we create a text editor using only standard tools such as shell scripts, sed, awk, grep, etc.  That way it could be completely portable, and not depend on any binaries on the target system.  The only binaries which would be required would be for the standard tools – which should already be installed.

Anyway, that would be cool.

Jul 21

New Website Software

Okay.  I think I know what I’m doing here.

WHAT HAVE I DONE?!  you ask.  Well, it’s really quite simple.  I haven’t been updating the website software much, so I decided that I’d just move to WordPress.  I really got the webspace for learning PHP, and to see what I could do with a CMS system.  However, in order to do everything that I want to do, I’m not motivated enough to finish work on it.  Also, I’m not a web developer.  So there’s that as well.  But I have migrated the website over, so that all old posts and pages are still here.  Links will have changed, but the content stays the same.  I may pick up work on the CMS system again sometime, but probably not.  If anybody wants to take it over/use it though, I have no problem with that.

Jun 10

Star Wars and Romans

So I watched Star Wars: Attack of the Clones last night, and in the middle of it I realized that it’s very similar to Rome. How? Let’s see:

  • Near the end, there’s a big fight in a Colosseum. Where people get executed. Now, a lot of that stuff would have been held in the Circus Maximus in Rome, but the Colosseum would have been used as well.
  • The Senate has become increasingly useless.
  • Different factions are vying for power.
  • The Chancellor was granted emergency powers to be a dictator; this is essentially what happened in the Roman Republic. A dictator was appointed in an emergency, and would give up his powers when the emergency was over. As time went on though, the dictators of the Roman Republic became increasingly power-hungry. Thus, the word ‘dictator’ now refers to an oppressive leader, when it was originally a great title.

The same basic things that happened to the Romans happened in Star Wars as well. The Republic crumbled, and then the emperors took over.

May 09

SVN Syncing

So I just spent a good half of the day today trying to figure out how to sync two repositories together. We’re moving repositories, and so we had to import data from one repository to the other. However, this process took a while, so once we had imported the data into the new repository it was several revisions out of date. There didn’t seem to be a way to use SVN tools to do this. So, I went and wrote a script which would take all the changes from one repo and commit them to the other one with all the data. This was needed because we didn’t have shell access to the new SVN repo, and because of how that repo has to be set-up it would be somewhat infeasible to do another SVN dump.

There are a few limitations with this; there’s no way to add new files to the repo(though you could probably do an svn add right before you commit). There’s also no way to delete any files. In our case, this is not a problem, as there have been only file modifications.

Before you do this, you must checkout both repositories into different directories.

So, without further ado, here’s the code:

#!/bin/bash

ORIG_DIR=<original directory>
NEW_DIR=<new SVN directory>
START_REV=<start revision of original SVN>
END_REV=<end revision of original SVN>
CURRENT_DIR=`pwd`

while [ $START_REV -ne $END_REV ]
do
cd $CURRENT_DIR
cd $ORIG_DIR
svn update -r "$START_REV" #update to next revision of old directry
let "START_REV += 1"

cd $CURRENT_DIR
echo "About to diff, this may take a while..."
diff -qr --exclude=".svn" $ORIG_DIR $NEW_DIR > /tmp/svn_out_orig #figure out what files changed
cat /tmp/svn_out_orig | grep Only > /tmp/svn_diff_files
cat /tmp/svn_out_orig | grep Files > /tmp/svn_out
LINES=`wc -l /tmp/svn_out | cut -d' ' -f1` #how many files changed?
cat /tmp/svn_out | cut -d' ' -f2 > /tmp/sources
cat /tmp/svn_out | cut -d' ' -f4 > /tmp/dests
echo "LINES = $LINES"
while [ $LINES -gt 0 ]
do
    SOURCE=`sed -n "$LINES"p /tmp/sources`
    DEST=`sed -n "$LINES"p /tmp/dests`
    cp $SOURCE $DEST #copy each file that changed to the new directory
    let "LINES -= 1"
done
cd $ORIG_DIR
LOG=`svn log --xml -l 1 | grep msg | sed 's/<msg>//p' | sed 's/<\/msg>//p'` #get the log message for  that commit
cd $CURRENT_DIR
cd $NEW_DIR
echo "ABOUT TO COMMIT"
svn commit -m "$LOG" #commit with message

done
Apr 17

Without a Title

A few years ago, a friend of mine gave me a draft of a book to read, called Without a Title. Well, I read it at that point, and let me tell you, it was freaking hilarious. I told my friend to tell me when it was published; he never told me, and I never found it anytime that I searched for it online.

Until the other week.

Yes folks, published two years ago, is Without a Title. Why is this book so hilarious? Well, let me reprint the first few sentences here for your reading pleasure:

Once upon a time in a far off kingdom there lived a beautiful princess who was homicidally insane. She lived in a time that never really existed. It was a time of knights and kings and damsels who caused distress. It was not the accurate historical Middle Ages where half the population walked around with rotting teeth. No, these were the Middle Ages that are featured in animated films with singing forest creatures that appear on lunchboxes in every red brick schoolhouse in suburbia. It was a time in which knights could read, peasants would bathe and the main characters always had perfect hair.

Seriously, how could that not be a great story?

Of course, what I also really love is the large number of puns in the story. Such as Mike Rosoft’s dealings with Mr. Apple. Or perhaps the various… oddball methods of torture. Really. Trust me on this one, it’s hilarious.

All in all, I would give this 5/5 stars. It’s totally hilarious, with a great number of puns and jokes that just make you want to continue on.

Oh, before I forget, here’s the book on Amazon.

Mar 24

Stripping Katos

Alright, so I’m working on an SD40 here, a Kato unit to be exact. And I tried to strip the paint off of it. First, I tried using rubbing alcohol. That didn’t work too well. Then I put it in some brake fluid, as that seems to strip other locomotives. It didn’t get fully stripped, but what I suspect is that a few rounds alternating between the alcohol and the brake fluid would strip it fairly well. These pictures might not show it too well, but the piece underneath the cab was stripped quite well; the main shell, not so much, and the deck practically nothing.

The pictures don’t show it quite well, but the paint is cracked in several places. It’s a cool effect that I would keep if I were not re-painting it; as it is, I’m just going to paint over it. If some of it shows through, I’m not too concerned about it because it will be a cool effect.

Picture 1

Picture 2

Picture 3