You are heresoftware

software


NoMachine NX is awesome

Short-version:
Use NX. VNC sucks.

Using XML for Code Documentation is Just Plain Wrong

I was just looking at some C# code at work today and it had XML Documentation (like javadoc or python docstrings, only with XML). Who was the idiot that came up with that idea? It's the most insane thing I've ever seen. Let's look at the predecessors to C#'s XML documentation:

mp3 Sample Clip Creator With Fade-In/Out

This script will create mp3 sample clips. I created it to automatically create sample mp3 clips for a friend of mine's (Will Stroet) website. You can tweak the length of the clip and the fadeout. Unfortunately it can only create samples that start at the beginning, however, it could be easily modified to start anywhere. It depends on the quelcom library, lame, and mpg123.

Limit Size of Subversion Commits With this Hook

We have experienced some abuse of our subversion repository at work recently. Someone committed 400 MB of data all at once including many object files, libraries, and executables. I did not get very harsh with the person who did this. Because a) I have no objection to binaries in subversion in the first place, b) I don't really know what he's working on, c) disk space is cheap and we are no where near capacity, and d) his commit was still smaller than a few commits we had a long time ago (which were legit). Still, if you just allow people to commit whatever they want to your subversion repository, in the worst case, you could run out of disk space, necessitating an svn dump-and-load onto a new larger drive (pain). It would suck to have to do that just because some people were committing large binaries (without any legitimate reason to). There are other annoying consequences. Our tarball backups of svn currently fit on a DVD, which is cheap and easy, if we allowed this abuse to continue it would complicate our backup process.

What I wanted was a way to limit the commit size for certain users automatically. There did not seem to be any hooks out there to do this, so I wrote one.

Just paste the following into your pre-commit hook:

/svn/repos/hooks/check_txn_size.py "$REPOS" "$TXN" || exit 1

and paste the following into a check_txn_size.py file in your hooks directory and make it executable.

Maven is Amazing

After 2 senior developers recommended maven over ant and another told me he was planning on switching to it (from ant) for his next major project, I knew I would eventually try it when I had the chance. Today I was forced to try it because building my project with ant started becoming a total nightmare. I had added a dependency to my project and now the ant script failed. Time to modify the ant script. Said dependency had some dependencies of it's own.

Ugly Bit-Wise Arithmetic

I just had a WTF moment today. If I ever see code like this again I swear I will go postal:

answer = new long[(size + 0x3F) >>> 6];

one simpler ways to write this would be:

answer = new long[size/64 + 1];

This is java by the way, not C.

Firefox/Opera Shootout

I've been getting really pissed off lately at how much memory Firefox is using up. I decided to give Opera a try. I opened up the exact same tabs in Opera (about 10 of them) and I got about the same memory consumption. I disabled all the Firefox extensions except for the del.icio.us one (because last time I disabled it and re-enabled it, it totally screwed up the bookmarks menu, and I had to create a new profile from scratch to get it back to normal).

Switched from Portage to Paludis

I switched to Paludis yesterday. For those who don't know what Paludis is, it's an alternative Gentoo package manager, or a Portage/emerge replacement. It has not all been smooth. I had to fight with it for a while, re-installing a bunch of packages that thought they depended on an installed package that no longer existed. I think this was because Portage left some cruft around that made it think that.

Drag & Drop from Linux (KDE, Gnome) File Managers (Konqueror, Nautilus) to Java Applications

I tried a few months ago to get drag & drop working from Konqueror to a Java application but it didn't work. Two programmers (myself and another) each had a crack at it and couldn't get it to work. I found one link through Google that seemed to be promising (see reply 23 or 23) but that didn't work.

Small Gotcha When Copying Paths With Subversion

I was trying to do an svn copy from a specific server path into a local working copy. I basically wanted to copy over the vanilla mediawiki-1.8.1 sources from my repository into a local directory (called trunk). Here is what I did:

svn copy svn+ssh://david@server/svn/repos/Projects/wiki/mediawiki/1.8.1 ./trunk

You would think that this would copy the contents of the 1.8.1 directory into the trunk directory. Wrong; it copies the 1.8.1 directory and its contents into the trunk directory, thus creating a 1.8.1 directory inside trunk. It took me forever to figure out why it was doing this instead of what I wanted it to do (which is to copy the contents of 1.8.1, not the 1.8.1 directory itself).

Backing up MySQL Databases With AutoMySQLBackup

I just discovered a very useful bash script tonight, AutoMySQLBackup. It is a nice and easy way to backup your mysql databases daily, weekly, and monthly. It was very easy to set up and works great. A great suggestion to prevent having to put the username and password for a database user with read/write access in the script is to do the following:

mysql -u root -p -e "GRANT SELECT, LOCK TABLES ON *.* TO 'backup'@'localhost' IDENTIFIED BY 'backupPW';"

MythTV 0.20 Released

MythTV 0.20 was released today. I can't wait to install it and check out the new features. I completely rebuilt my MythTV box last week and it is totally kick-ass now. It has a new 250GB hard drive which allows me to record 100 hours of TV. Some other improvments I made were, setting up XvMC which allows my video card's GPU to help out with some of the MPEG-2 decoding (bringing my CPU usage from 20% to 10% during video playback). Thanks to the Hauppauge PVR-350 card my CPU usage during recording is nil. I also got a new video card with composite out rather than s-video. That fixed a problem with the flaky s-video connector I had (whereby it would slip out and cause the screen to go all fuzzy) and also fixed a problem I had with 3 vertical lines on the TV during playback. We also bought and expensive composite cable to make sure that there are no problems. Finally stuck everything in an Antec Sonata II case for maximum silencing and cooling (not to mention how cool the black case looks).

An X-Ray Pixel Sensor for Large-Area Imaging in VHDL-AMS

Class: ECE 741
Professor: Dr. Jim Barby
Year: Fall 2002

An X-Ray pixel sensor is modelled using the VHDL-AMS mixed-signal modelling language. The components of the model include: the x-ray source, a selenium detection layer and charging capacitor, and the switching and amplifying TFTs. A passive pixel and active pixel configuration are both investigated.

Flickr Uploading Tools in Linux: juploadr and kflickr

I tried two applications for uploaded photos to flickr in Linux. The first is juploadr-1.0, which crashed many times for me and after an entire day of trying I just couldn't get all of the 500 photos I wanted to upload, uploaded. I had much better luck with kflickr-0.6. There seems to be a trend of quality KDE applications (amarok, KDE itself, k3b). Not so many Java or Gnome ones, but I digress. Originally I liked the way of editing descriptions and tags in kflickr but then I realized that neither of these applications compared to flickr's organizer feature, so it didn't matter. kflickr did crash on me if I right-clicked anywhere on the imported images.

Blogtk

Just found the program I was looking for, a blog client for Linux called Blogtk. I found it by doing eix blog in Gentoo and it was the only "stable" one listed that sounded like it would do what I want. Hopefully this will allow me to post quickly to my blog without having to use the browser (which I find slow and clumsy at least in Drupal).