Archive for May, 2008

Found a Decent Windows Blogging Client

Friday, May 30th, 2008

wordpress.gif

I have started to use WordPress at work for my daily journal of activities. Previously, I had a simple static HTML page that I'd write in daily and it worked - but it wasn't really nice and it certainly didn't make it easy for others to join in and do their journaling as well.

So I set up a WordPress infrastructure and it's working very well. But the problem is that I can't run MarsEdit on linux or Windows - and the web-based WordPress posting page works, but is far far too wasteful of screen real-estate for my tastes. So I have been looking for a nice, free Windows or Linux blogging client. I've tried a few and they seem to work OK, but the problem with the best of the linux clients is that they don't allow for multiple Category selections, and I do that often to indicate which projects this entry 'touches'.

So I had to broaden my horizons to include Windows apps.

I found w.bloggar and it seems at first look to be just what I'm looking for - monospaced font editing (in HTML, please), multiple category selections, easy editing and posting, and it's free. Can't beat that. Small... compact... just what I was looking for. It's a shame that it's on Windows and not Linux - or that Drivel (the best linux blogger) doesn't allow for multiple category selections, but that's life, and I do not feel like writing one myself.

So... good to know that I've got the tools on Windows (at least) to do the updates efficiently and cleanly. Not bad.

Interesting Windows IE/Firefox Applet Rendering Bug

Thursday, May 29th, 2008

comboGraph.png

A few days ago, a couple of developers stopped by to ask me if I'd seen a problem with the VantagePoint graph initialization when used in applets. Basically, an applet built using the VantagePoint graphs would initialize quickly (sub-second) when only one core was available to IE. Add a second core, and the initialization time stretched out. In fact, adding successive cores stretched out the time so much that at four cores the initialization time was measured in minutes. Clearly, there was a problem. Their initial assessment was that the locking and unlocking of the VantagePoint data tables was the culprit, but I told them that knowing the guys who built it, I doubted that - but I sent them an email just in case.

Today, one of the developers gave me an update and it turned out that it wasn't just IE. Firefox had the same behavior. The other developer had created simply HTML files that would show the problem. So I decided to get that file and see what I could see for myself.

Interesting problem.

It turns out that it's not the locking and unlocking, it's the redrawing that's done after the unlocking that's causing the problem. What was happening was that every additional data point added (parsed from the applet's param tags) was causing a redraw, and Windows was trying to slice things in between the redraws and that was causing the slowdown. Even after I put a lock around the entire data parsing, the delay simply moved to the parsing and setting of the graph's structure.

The solution was to hold-off on all redraws while parsing all the applet's param tags. Then, after it's all set-up and ready to go, unlock the graph and let it redraw the viewport once. This made the four core initialization faster than the old single core because no redraws were being done at all. Since this is a time that you really don't need to look at the intermediate results, it seems like a reasonable compromise.

What amazes me is that Windows isn't smarter about this. When multiple cores are available, Windows should improve performance not have it get worse. This might be as simple as upgrading the video drivers - who knows, but the fact that an applet in a browser is causing this kind of problem for Windows is amazing. Anyway... the code in BKit is fixed and the developers are back at it loading faster than ever.

Mac OS X 10.5.3 is Out!

Thursday, May 29th, 2008

Leopard.jpg

This morning I was able to use Software Update to get Mac OS X 10.5.3 which look pretty tame - about the only thing I really look forward to is the fixes to Spaces where it doesn't re-order the windows when hopping from one to another. I'm sure there are other things I'll like that I don't see right away, but it's not like getting 10.5 in the first place.

Still... it's nice to see that Apple is fixing security issues in iCal and the like. Not bad for a few minutes of my time.

Learn Something New about Solaris crontabs

Thursday, May 29th, 2008

Solaris.gif

I learned a new thing - at least it appears to be new, about crontabs on Solaris 8 - maybe later versions as well. It seems that if you have blank lines in a crontab it's going to give you errors. This is news to me for I've had a crontab on a Solaris 8 box for about 4 years that has blank lines in it and it's working fine. But today I had to update my crontab on my main Solaris development box and it was giving me fits about an illegal end of line.

I tried a ton of things, finally I dug into the man pages on the Solaris box and it said right there that blank lines should be avoided. Odd. I looked at another Solaris box and it's crontab has blank lines and it's working fine. But sure enough, take the blank lines out of the crontab and it's working fine.

Odd... but at least I know what to avoid on Solaris.

It’s Amazing What Vendors Call Support These Days

Wednesday, May 28th, 2008

pirate.jpg

I know I shouldn't be surprised given the recent history I have had with software Vendors recently, but today was once again an eye-opener. I have known that an upgrade of a certain vendor's API was coming for many months. It took a lot of negotiations, explanations of the usage patterns, etc. to get to the point where things are all signed and executed so that we can actually get the software. Today was the day we could finally start the process of actually getting and using the new API.

It started out with the same problems I've come to expect from this vendor - the software was for Windows, Solaris, and Linux - yet in order to download it, you had to be running a Windows client app. Why? Why not just have a password-enabled web site where you can get the files? It seems that when you're charging what these cats are charging, you can invest the modest sum to get someone on your staff to figure this out. Nope. It was a sign of things to come.

After getting the packages I asked the 'installation specialist' what I needed to know during the install. What questions would be asked, etc. so that I could have all the proper data available to me before the install started so that I wouldn't have to start over or back up during the process. Also, I like to have all this documented so that when I do it on the next box, I'm ready to go and the delays will be minimal.

'No problems, it's self-explanatory' he says.

Wrong. Several times I had to email him to get the specifics of what the question is asking for - things like the version of the API to install? What's the difference in the versions? Why choose one over the other? Things like this are essential in an install app, and there's no documentation - nothing, to help.

I get him on the phone and work my way through the install questions. Then I'm passed off to an 'installation technician' that is going to assign a login and certificate for the installed software. I'm asked if I have my key fob - What key fob?

Clearly, they have forgotten to tell me I needed this, what role it plays in the software, and so on. It's a ridiculous situation. A simple text file would have explained all the steps and why each was necessary. I'm not sure if I'm the first that's asked these questions, but I'm betting not. Why I had to get as many people on the phone and have them explain these things to me I do not know. In the end, I'm not really sure that I have the real explanation, but it appears that the software is working, so I'm willing to take a few things on faith. But how easily this all would have been avoided with a simple installation guide.

Once I got that working, the production box running the old version of the software stopped working! I was not surprised. They had made so many mistakes like this in the past that it wasn't an amazing surprise that by turning on the new version on the development box, they disables the old version on the production box. I had to call back and yell that they had taken my production box offline and they needed to get it back up ASAP. 45 mins later, it was back up, and I was able to tell my users things were back to normal.

The software upgrade itself is a welcome upgrade. There are fewer libraries to link and they are all shared libs as opposed to static libs - which is nice. So it's clear that someone was thinking when they did this, but it's also clear they didn't give a lot of thought to the converting users. There were no code changes - just a recompile and re-link and we're good to go. But what an ordeal. It's amazing what some vendors call support these days.

Transferring Daily Journal to WordPress

Wednesday, May 28th, 2008

wordpress.gif

Today I finally got the WordPress installation for my daily work journal up and going the way I wanted it. I then started back-filling the entries from my old manual HTML journal to the WordPress blog. It's slow work, but in the end, I'll have the complete, searchable, history in WordPress for management to see.

It's not that the old system was bad, it's just that this system can be used by all the developers to make a consistent journalling system for all the daily work which makes the generation of management reports far simpler. No one has to guess or search their memories to remember what they were doing when. Just throw in a paragraph on every topic worked on in a day and you're good to go. Simple.

Simple for me, anyway. In a few weeks I'll have the complete history moved and I can take that old journal offline. It'll be nice.

Getting WordPress 2.5.1 Going on RHEL3

Tuesday, May 27th, 2008

wordpress.gif

It came up amongst my fellow developers that having a simple blogging install on one of the machines would make it easier for them to maintain a list of what they do each day, and therefore make the creation of monthly reports a lot simpler. Seems reasonable, as I keep a simple HTML journal each day, and converting it to WordPress would be very nice. So I set out to do just that.

The first thing was identifying a machine. Since the requirements for WordPress are PHP 4.3 and MySQL 4.0, it would have been nice to have found an RHEL5 box that could be used, as RHEL5 has those in the standard install RPMs. But that was not to be. I did, however, have a good RHEL3 box that I could use. Unfortunately, the MySQL RPMs with RHEL3 were at 3.2.x - no good. So I had to do some searching.

I ended up finding what I needed at the MySQL web site and downloaded:

    MySQL-client-standard-4.1.22-0.rhel3.i386.rpm
    MySQL-devel-standard-4.1.22-0.rhel3.i386.rpm
    MySQL-server-standard-4.1.22-0.rhel3.i386.rpm
    MySQL-shared-compat-4.1.22-0.rhel3.i386.rpm

I also had to get the PHP RPMs from the CentOS site:

    php-4.3.2-40.ent.i386.rpm
    php-mysql-4.3.2-40.ent.i386.rpm
    php-pgsql-4.3.2-40.ent.i386.rpm

and then I was ready to go. Or so I thought.

The default install for MySQL places the data files in /var/lib/mysql and that worked great. The problem was that I wanted to have them in a different location. Ideally, all I'd need to do was simply move them and put in a symlink back to the /var/lib/mysql directory. But it was not that simple due to where I wanted to put the files and the rules governing placement there.

Basically, I was unable to set the user/group for the files in the location I wanted to put them based on some rules in-place by the Unix engineering team. Understandable, I just needed to find another way. The simplest way to make it work was to have the MySQL server run as another user - in this case, gomer. The trick was that it wasn't that simple to figure out all the places it needed to be changed. In the end, I was able to get it by using the following file as /etc/my.cnf - the default configuration file for MySQL:

    #
    # Point the MySQL server to this location for the databases
    #
    [mysqld]
    user=gomer
    basedir=/home/data/rooster/
    datadir=/home/data/rooster/mysql
    socket=/home/data/rooster/mysql/mysql.sock

    [mysql.server]
    user=gomer
    basedir=/home/data/rooster/

    [client]
    user=gomer
    socket=/home/data/rooster/mysql/mysql.sock

where the location of the files is /home/data/<machine>, and in this case the machine name is rooster. I chose this to make it easy to distinguish the data files for one instance from another - put the machine name in the path and you're pretty sure to not have conflicts.

With this, I could start and run the MySQL server without error. Whew! That was an important step to take. Now we need to get PHP talking to MySQL. In order to do this we need to edit /etc/php.ini and set the MySQL socket reference to:

    ; Default socket name for local MySQL connects. If empty, uses the
    ; built-in MySQL defaults.
    mysql.default_socket = /home/data/rooster/mysql/mysql.sock

and then restart the web server with:

    /etc/init.d/httpd graceful

The next thing to do is to create the user and database for WordPress to hold all it's information. Interestingly, what you need to do is to make the database first, and then assign the rights to the user (thus creating a new user in the process). To do this, we first need to log into MySQL as the root MySQL user and create the database:

    mysql -u root -p

and enter the root MySQL password. Then create the database:

    create database wp_drbob;

I've chosen the convention wp_login so that the databases are easy to tell apart. Then you need to assign right to that database to a new user:

    grant all on wp_drbob.* to drbob@localhost identified by "coder";

where the last argument is the new password for the local account. At this point you can verify the user's database is set up properly by logging out of mysql with a quit and then log in as the new user:

    mysql -u drbob -p

...and enter the new password (coder), and then have a look at all the available databases:

    mysql> show databases;
    +------------+
    | Database   |
    +------------+
    | test       |
    | wp_drbob   |
    +------------+
    2 rows in set (0.01 sec)

One little wrinkle with the PHP 4.3.2 using the MySQL 3.23.58 Client API is that the passwords in MySQL 4.1.22 are stored in a slightly different way. This means that you need to do the following in order to get the password into the old format for PHP. Log in under the root MySQL account:

    mysql -u root -p

give it the root MySQL password, and then issue to following:

    mysql> UPDATE mysql.user
        -> SET password=OLD_PASSWORD('coder')
        -> WHERE user='drbob'
        -> AND host='localhost';
    Query OK, 1 row affected (0.00 sec)

the flush this out to the system:

    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

At this point we have a database and we're ready to install WordPress and configure it.

Assuming that the WordPress distribution is in a tgz file called wordpress-2.5.1.tar.gz then as the user gomer go to the location where the blogs are going to be stored and unpack the distribution. It'll be named wordpress - change the name to the user's login (our convention here again). This looks like:

    $ cd /home/data/rooster/blogs
    $ sudo su gomer
    $ tar zxvf wordpress-2.5.1.tar.gz
    $ mv wordpress drbob

at this point, you need to go into that directory, rename the file wp-config-sample.php to wp-config.php and then edit it and put in the correct values for the database connection:

    // ** MySQL settings ** //
    define('DB_NAME', 'wp_drbob');
    define('DB_USER', 'drbob');
    define('DB_PASSWORD', 'coder');
    define('DB_HOST', 'localhost');

You can then install WordPress by going to the web page: http://server/blogs/drbob/wp-admin/install.php (assuming that you have the directory symlinked into the var/www/html/ directory of the web server). This will pull up a simple page where you can set the name of the blog and the email address of the administrator. They will receive an email with the login information which they can then use and customize as they see fit.

It's certainly no easy, and a lot of the little details took me hours to figure out. But in the end, I have something that's working and it's not too terribly hard to set up another. That was the goal, and it's achieved. Good enough.

Twitter Outages Part of a PR Stunt? Not Likely…

Thursday, May 22nd, 2008

Twitterrific.jpg

Making the rounds this morning is an implausible idea that the Twitter downtimes are actually planned to keep people 'wanting more'. While drug dealers have used this in the past, to great success, I don't think the geek-mentality would think this trade-off on the pride of creating a stable, useful system would be worth it.

Take a look at Slashdot... the ultimate geek hang-out. If they went down, it's a scream-fest and they loose credibility - not gain it. Twitter is a communication channel, no one thinks the phone company is good for killing service. Nope. This is something they are trying to prevent, and simply can't. I'm not sure why, but it's got to be that there are things going on behind the scenes that the casual user doesn't see.

The excuse for the latest outage is a database outage due to a routine update going bad. Now this I know about... if you're updating a 'production' database during working hours you need to make sure that you have a back-up, or a fail-over, or something so that if, on the one-in-a-million chance that something goes wrong you aren't out of business. They messed up on their disaster/recovery plan. Maybe it's not big enough to have one of them, but I think it's time they think about it.

In the end, it's nice, and people will use it, but they'd use it more if it were more reliable - not less.

Creating Some Interesting Data Storage Templates

Wednesday, May 21st, 2008

CKit.jpg

Today I've spent a good bit of time adding two interesting (and useful) data storage template classes to CKit. The reason I added them today was that I had noticed their use in a few other projects I've been working on, and they are just complex enough to cause 'clutter' in the project and not enough to be a significant part of the project. They're right where I find the things to strip for re-use.

The first is a 1:1 map where the data is added with a simple put() command but the underlying data structure is really two STL std::map objects - one going from keys to values and the reverse going from values to keys. This 'bi-directional' map allows me to be able to quickly and easily get a key for a value and a value for a key. In a few of my projects I do encoding mapping or translational mappings - where the map is 1:1, but it's as often that I need to go in the 'reverse' direction as the 'forward' direction. Scanning the map was far too inefficient and the size of these guys wasn't an issue, so it made sense to have two 'opposing' maps and place (and remove) the data in pairs using both maps.

The second is a many:many cross-reference map where the pairings do not have to be unique - similarly to the STL multimap, but in this case, the data is maps of std::sets which makes it easy to get iterators on the values for a key - or the keys for a value. This guy is used in a project of mine where there are several representations of the same thing, and a 1:many is a simplistic case of the many:many. I'm not sure if I'll go back and retrofit the code in the projects for these new template classes, but it's nice to have them should the need arise again.

When Not to Realize Your Car has No Brakes

Wednesday, May 21st, 2008

cubeLifeView.gif

I was having lunch with a good friend of mine today and we were swapping stories of things that have been happening recently - both at home and at work, just like we always do. My friend tells me a story that I must say had me in tears I was laughing so hard. Not that the situation was itself very funny, it wasn't. It was that his delivery was wonderful.

It goes like this: The time you don't want to realize you car has no breaks is when you're flying down the highway. By then, if you have no brakes, you're in a world of trouble. Best to check the breaks before you hit 65.

That's not what happened, it's just the lack of planning management did on this project he's involved in. They are in the final stages of testing and they haven't even really stopped to ask if they have the support system in place to maintain this additional system. So much energy has been put into finishing this, yet none has really been put into seeing if it can be supported long-term. Nothing like getting there and then realizing that you can't really use it because there's no one there to hold it up.

No brakes in the car.

While everyone can claim that they were heads-down getting to the finish line, my friend recalls several conversations (quite humorously) he's had with his boss about this, and other long-term maintenance points. All the while being told that things will work out, and we'll cross that bridge when we get to it, etc.

It's sad, but funny in a way. I think we help each other by letting off some steam, and I know he gave me a wonderful laugh with this tale of woe. I just hope it does work out for him, he's too nice a guy to get really hurt by such foolishness.