programming


After trying to get the mysql gem working on my new macbook in Leopard, I realized that although I can get the gem to compile correctly it still doesn’t work with the mysql 64-bit version. This realization mostly came from searching and finding this useful blog post.

I reinstalled the 32 bit version of mysql and then recompiled the mysql gem. Then magically things started working the way I needed them to. Hopefully this can get fixed in a future version of Ruby.

Here is the command I had to use to finally install the gem properly.


sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-mysql-lib=/usr/local/mysql/lib --with-mysql-dir=/usr/local/mysql --with-mysql-include=/usr/local/mysql/include

Notice the i386 arch. I was previously using x86_64 as the arch which compiled properly and appeared to work until you actually tried to use the gem in ruby and got a stack trace.

How do you estimate development tasks? For most this is usually a process of guessing. Sometimes the guesses are accurate and many times they are not. One person I highly respect in the software development field is Joel Spolsky. He wrote an article explaining the process of doing evidence based estimates. This is very similar to one of the new features in a product his company makes called fogbugz (which I have not used). A bug tracking system does seem like an obvious place for this type of functionality to live. Especially since it should be one of the core tools used as part of your software development process. The idea of doing estimates this way is interesting though. It got me thinking, why don’t more estimates get calculated this way? I hope to be using a system similar to this in the future myself.

For some reason Windows Vista enables IPv6 by default. Why? I wasn’t aware of this so I ended up troubleshooting a non-problem with PHPUnit. I have unit tests that connect to the web server to test a web service. The URL my tests were using was “localhost”. Because vista was resolving localhost to ::1 the tests couldn’t make a socket connection.

All I had to do to fix the problem was disable IPv6 and comment out the localhost ::1 line in my hosts file. This took a significant amount of troubleshooting to figure out though. I thought there was some type of problem with PHPUnit or php itself. Luckily I was finally able to solve the problem.

It seems like a really bad idea for Microsoft to enable IPv6 by default and additionally put it higher in the resolution order than IPv4 addresses. Based on the number of active IPv6 networks this can’t be a good default decision. Supporting IPv6 is a good idea, but it shouldn’t be the default method of resolving addresses. Windows should have knowledge that you are connected to an IPv4 network and disable or lower the priority of IPv6 accordingly.

My Tip of the day…

I finally found out how to use Svn auto-props today. These are very nice. You can set a given property based on a files extension or filename pattern. This allows for doing things like:

[auto-props]
*.py = svn:keywords=Author Date Id Revision

This means I don’t have to keep adding svn keywords on every file I add. It just gets turned on for all python files I add to svn. These properties are set in the svn config file on the client, so every client can have their own settings. Very handy.

I recently did a presentation on PEAR. This presentation mainly goes over basic PEAR usage and installing PEAR on windows. If you have any suggestions for improvement let me know.

PHP has the intention to make PEAR a repository of common libraries similar to CPAN in Perl. This still isn’t the case though. Every time I’ve used PEAR it is a bit kludgy. There should be some support functions as part PEAR itself to do simple operations through php scripts.

For example I wrote a report generation class for Testlink that uses Spreadsheet_Excel_Writer and I wanted to check that this dependency is met during installation. This isn’t as clear cut to do as it should be though. I wasn’t able to find any standard way in documentation for how to check if a PEAR module is actually even installed. First I tried to use the built in is_file() function in php. This doesn’t honor the include_path though so it isn’t very useful with PEAR. So I ended up just doing an include_once() for the module. This isn’t very clean though as it throws a really ugly error for the user if they have error reporting turned on in their PHP configuration.

So here’s to hoping that PHP and PEAR will someday work together in a more clean way. I would think this would be a very common operation for any project that relies on PEAR modules. Apparently it isn’t though.

I needed to programatically print a pdf from the command line. This was easier than I expected it to be. Simply use acrobat reader to spool the pdf to the printer. In Windows this meant running something like “acrord32.exe /t filename.pdf” the /t switch was the key. The most difficult part was finding the documentation for this feature.

I was having trouble with maven today and trying to figure out what was going on because none of the error messages I was getting made any sense. After troubleshooting I finally figured out I somehow didn’t have a build.properties file. This was causing everything to behave differently than what I expected. I’m still not sure how this file ever got deleted in the first place. Luckily I was able to recreate it quickly.
So the moral of the story is to make sure you have a build.properties file in your home directory if you start having trouble with maven.

It is now over and what an experience it was. I competed in Rails Day 2006 with some great teammates. We wrote a web app called HugTracker. I thought of the concept to have a tracking system that was opposite of a bug tracker so you could tell someone how good of a job they are doing. I am very excited about what we were able to create in under 24 hours. That isn’t really much time and yet we have a fairly useful app I think. The more I use Ruby on Rails the more impressed I am. It is truly the first framework I’ve seen that does so many things so well right out of the gate. When you use the features of the framework doing things that are normally fairly difficult become very easy. A great example of this is the ActiveRecord validations and rjs templates. Let me know what you think about our entry. Check it out

I wanted to try out Microsoft’s Flip4Mac which looked like it would be pretty neat. see it here
Unfortunately it isn’t a universal build so it doesn’t work on intel macs. Why is this? Everything released for mac should be universal at this point. Hopefully this will get fixed soon and people will start seeing the light.

Next Page »