Today’s Annoyances

Today has been a buggy day at work.

First, I tried again to get Java Web Start working on an application. It launches JWS, but then my application hangs leaving a javaw.exe process in the background. From some searching on the forum, it seems that other people are having the same problem. In fact, it may be due to a bug in Java Web Start, which means there’s nothing I can do about it.

Next, I’m having a problem with Selenium tests on a PHP application which uses sessions. It took me a while to figure out why my test user would get logged out immediately without any error messages when running tests with the Test Runner instead of the Selenium IDE. I have ini_set(‘session.referer_check’, ‘stuffhere’); set to improve security a bit, but when I run the test suite through the Test Runner, $_SERVER[‘HTTP_REFERER’] is set to the Selenium Test Runner’s URL, which obviously fails the referrer check. And since errors were being pushed to a session that was immediately lost when the referrer check failed, I wasn’t seeing any errors. So what’s my solution? Well, for now I’ll have to disable the referrer check. It can be spoofed anyway… That means changing a fair amount of apps though… bleh.

XML as data interchange format

This article by James Clark, the Technical Lead of the original XML Working Group, puts into words exactly what I was thinking when XML first came out and was being touted as the be-all end-all of data interchange formats. For years I haven’t been confident in my knowledge of XML to vocalize my disenchantment with it, so hearing a similar opinion from the horse’s mouth is rather comforting!

Found via ongoing

Coming soon: Embattle

New articles, Collaborative editors

There are a couple of new articles on the Tech section of my web site. I’m slowly porting over things which have just been sitting around. The articles are about my FuseboxXF project, and my Physics simulation program. I still need to redesign the site and decide how to make it all dynamic, but at least there is more content!

I also added a placeholder for my newest idea: a web-based concurrent file editor (multiuser/multiplayer text editing). I came up with the idea while thinking about the next project I’ll start at work. Since the projects we do are (relatively) small, I can use Circuitmaker (another project I’ll be posting about soon) to create a framework for most of the application. After that though, it’s a free-for-all on the entire project, using Dreamweaver’s annoying file check in/check out functionality to avoid problems with multiple people editing the same file (clobbering). It’s annoying because you have to constantly ask someone if they are done with a file so you can edit it, and if they aren’t or they aren’t there, you could be out of luck and it is very disruptive. If three of us could all edit files at the same time, this problem would be virtually eliminated.

So, I searched and downloaded MoonEdit which doesn’t work the way I though it would. It’s fairly slick and it works, but it doesn’t give you a list of all the files in the directory you run it from. Instead, you can only edit files you create from within MoonEdit, and those files always end in “.me”.

In any case, there are some others out there now that I look at Wikipedia. Collaborative_real-time_editors and Collaborative_editor are good reference pages. Mine would be different from these in that users wouldn’t be able to edit the same line at the same time, and it would be optimized for LAN usage. Another feature which might be cool is to allow users to hold a lock on the entire XML element your cursor is in (if it’s an XML-compliant document).

SVN – maintaining code history through reorganization

The following is some advice I’ve given to my student programmers from time to time:

Occasionally, you may need to split up a file in one of your projects into more than one file. Or, you may need to combine two pieces of similar code into one reuseable piece of code. This kind of code refactoring happens all the time, but unless you are careful you may be losing valuable revision history behind those lines of code.

For example, if you split a file into two files you may cut the code from an existing file, and then paste it into a new file. You would then add the new file to your working copy and commit it. In doing so, you would have lost the revision history of those cut & pasted lines.

To get around this issue, instead use SVN to make a copy of the versioned file you wish to split up. If you are using Tortoise SVN, this would be a right-click drag and a “SVN copy and rename versioned files here…” Then, you can remove the appropriate lines from both files and commit. The revision history of all of your lines will still remain!

Unfortunately, the act of merging near-duplicate code into a single file is not as graceful. Instead, you must pick the file closest to the generic end-result (or the file with the biggest history) and modify it to be generic. To avoid losing some of the history, you should note in the commit log what files you are consolidating.

What’s Up / StatSVN

So, what are you up to, you ask? Well, my biggest project right now is adding SvnKit support to StatSVN. Instead of calling the svn command-line client executable many times while building statistics, SvnKit will allow StatSVN to make calls in native Java to the SVN API, meaning that it should be much faster. Hopefully, that will be the case. If so I’m also hoping my code will make it into StatSVN. The biggest challenge about this is adding this new functionality in while leaving the svn bin as a fallback option. The SvnKit calls will need to be multithreaded in a different way than the svn bin calls, which are using Runtime.getRuntime().exec() which has no requirement to “execute asynchronously or concurrently with respect to the Java process that owns the Process object.” Instead of using static methods to call Runtime.getRuntime.exec() multiple times from several threads, I’d prefer to use non-static methods. It’s an ongoing process.

In addition, I am trying to figure out what to do with my website here. I wrote the layout you see on the home page, but I’m not sure whether I want to continue using it. I’d like to have a site that’s somewhat integrated with a blog, but to which I can easily add any kind of advanced content or features. WordPress is nice, but I don’t yet know how easily extensible it is especially in regards to creating additional databases. I’ve been messing around with an installation of CakePHP. So far it’s kind of nifty, but I have a lot of learning to do. I already know the Fusebox framework very well, but I’d rather learn something new. I also need to get RoR set up. My friend Roy and I are working on a project, and I’ll need to know RoR for it anyway.

In other news, I woke up today and watched a baby squirrel running around like nuts on the tree outside my window. Very amusing.