Wordpress Themes

A place for my programming projects and the occasional blog about technology related matters.

Subtitle Fixer

Author einar | 20.03.2008 | Category code, python, utilities

I was watching a movie on my computer the other day and I had gotten the subtitles for it off the internet, I think from http://opensubtitles.com or something like that. The only problem was that they were a bit out of sync with the picture, about 2 seconds too late. Using a good media player, such as VLC you can add an offset to the subtitles every time you watch the movie but I figured I could probably whip up a small script to do it for me so I could just do it once and then have the subtitles correct every time I watched the movie. Read More…

Developing ASP.NET 1.1 in Visual Studio 2008

Author einar | 15.01.2008 | Category ASP.NET, C#, Visual Studio, tips & tricks

I have an old ASP.NET 1.1 application that I have to maintain and which for reasons beyond my control can’t be updated to a later .net version. I hadn’t touched it in a few months but recently I had to make some small changes and realized I didn’t even have Visual Studio 2003 anymore. I got a new computer a few months ago and I have Visual Studio 2008 and IIS 7 on it but no VS 2003. I didn’t really want to install it, it’s pretty old at this point and not very well supported in Vista, and like most programmers I like to play with the shiny new toys, not the old obsolete ones. So I decided to try to maintain this application in Visual Studio 2008. Now, VS 2008 can target different versions of the .NET framework, but only 2.0, 3.0 and 3.5 so I was out of luck. But, thanks to a nice article I found by Jomo Fisher on compiling .NET 1.1 in VS2005 and some extra hacking I got it working pretty well. My setup was IIS 7 on Windows Vista, IIS 6 on Windows XP is pretty much the same although some of the options I point to may be located in different places. So, here’s what you need to do to develop ASP.NET 1.1 in Visual Studio 2008:
Read More…

Binary Tree Image

Author einar | 20.09.2007 | Category C#, code

Recently I had a school project where we needed to parse a certain grammar into a syntax tree and do some analysis on the code. Everytime I’ve had to work with trees (which has only been for school projects actually) I’ve been frustrated because it can be hard to visualize the tree, especially when it starts getting large. I’ve pretty much done two things in that situation, either draw the tree on a piece of paper, which takes a lot of time and is very boring, or try to look through the structure in the debugger, which gives you some idea but is not really very convenient. So, when I was working on this new project I figured I could probably come up with some simple way of displaying the tree while I was working on it. I wanted the solution to be re-usable so I could pull it out again the next time I have to work with binary trees without having to change it to match the new project. So, here’s what I came up with.
Read More…

Extension development tip

Author einar | 26.08.2007 | Category extensions, mozilla, tips & tricks

If you’re developing Mozilla Extensions it can be quite annoying to keep packaging your extension after every change, installing it and restarting Firefox/Thunderbird to test your changes. Fortunately there’s an easier way.
Read More…

Run Windows Service as a console program

Author einar | 15.08.2007 | Category C#, code, tips & tricks

Visual Studio and the .NET framework make it really easy to create Windows Services. All you have to do is create a new project, select ‘Windows Service’ as your project type and you’re all set. However, debugging Windows Services in Visual Studio can be a big pain. The recommended way is to use InstallUtil to install them, and then restart the service and attach the debugger everytime you want to debug it. I wanted Windows Live! Bot to be available as a Windows Service, but I also wanted to be able to debug it without the hassle, so here’s what I came up with: Read More…

Export Haloscan comments

Author einar | 13.08.2007 | Category code, haloscan, python

A few weeks ago I was helping my sister change her blog. She has a Blogger account but uses Haloscan for comments, since when she started blogging Blogger didn’t offer comments as a part of their service. That has changed now, so I thought it would be much more convenient to have the comments and blog all at the same place. I just needed a way to export her Haloscan comments and import them into Blogger. So I wrote a small Python script to do the exporting for me. Read More…

Who has deleted you from MSN?

Author einar | 09.08.2007 | Category C#, code, msn

My wife showed me a website the other day where you could type in your email address and password for MSN Windows Live! Messenger, and it would show you which of your contacts didn’t have you in their contact lists, either because they’d never added you, or because they’d deleted you at some point. It’s a cool idea and a good way to prune some of the contacts that you never speak to from your contact list. But I don’t really wanna give up my user / pass to some third-party site, even though they promise not to log it anywhere, and most of these sites (at least the ones I saw) tried to make some money by sending advertisements to your contacts while they were checking them, which I definitely didn’t want. So, since I already have a project that uses the MSN protocol I figured I could probably whip something up myself. Read More…

Using Wordpress authentication in Zenphoto

Author einar | 08.08.2007 | Category code, wordpress, zenphoto

In a previous post I talked about how to integrate ZenPhoto into Wordpress. After I had done that for my own site I still wasn’t happy. I didn’t like the fact that I had to use seperate logins for Wordpress and ZenPhoto, I wanted this to be as integrated as possible. So I figured out a way to make ZenPhoto ask Wordpress for authentication credentials. In other words, if you’re logged into Wordpress, you’re also logged into ZenPhoto. This makes the user/password in the ZenPhoto config file meaningless. Here’s what you have to do to get this working: Read More…

Integrating ZenPhoto into Wordpress

Author einar | 06.08.2007 | Category plugins, wordpress, zenphoto

ZenPhoto is a great image gallery written in php that I use on another page I have. It has a great admin interface and themes that are simple to use. I wanted to integrate it into a Wordpress blog so I looked around on the net and found a great article about it by a guy named Steffen Rusitschka. It explains how you can get your ZenPhoto gallery to look like your blog by including some Wordpress pages in your ZenPhoto theme. The article is at http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/.

His method works great but there were a few things that bugged me about it. Read More…

Mozilla Extension Generator

Author einar | 01.08.2007 | Category code, extensions, javascript, mozilla, python

Since I started creating Mozilla extensions I spent a lot of time writing boilerplate code, and copying from one extension from the next. Then I found Ted Mielczarek’s Extension Generator which is a great page that takes some parameters and creates an extension ready for you to use. I used that for some time but in the end I still kept modifying each extension to fit my own style and include my library functions. So I decided to make my own Mozilla Extension Generator in Python Read More…