Twitter
Wakoopa

Software tracking

Powered By
Powered by Squarespace
Navigation
Friday
Jan202012

Connecting an iOS device to a mixed 802.11b/n WiFi network

In a recent visit to home I was presented with an old problem that had become a real annoyance. The iOS devices owned by the family (minus the iPad) including my iPhone would not connect to the house WiFi network. They would happily detect them but the moment they tried to connect they would time out.

It took a bit of pecking around and trial and error but I found a single change that then allowed all the devices to connect.

It boils down to only allowing 802.11b to operate on the 2.4GHz band instead of the default dual b/n. It see,ms the iPhone and iPod Touch devices do not play nicely with dual use of that band by the b and n standards.

Monday
Jan172011

Event Handlers only firing once in Microsoft Office AddIns

I've just been working on a project where we were to create some AddIns for several versions of Microsoft Office. Now I knew there was a lot of bad blood around Office AddIns but thought they were being overblown as I finished off the 2010 AddIn without so much as a hiccup. The 2007 and 2003 AddIns however showed why Office has the reputation it has.

The problem I ran into was that I had to have several event handlers to catch two events. The opening of a new inspector and a simple button click. So I did what you'd expect to do and registered them in the startup methods.

Initial testing went fine as I started up Outlook and triggered one event, made some changes, restarted it and then tested the other event. It took a while until I tried to test both events following one another at which point I found only one would trigger and then both would even handler hooks would be forgotten and wouldn't rehook in until a restart of the application.

public partial class ThisAddIn
{
    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        Outlook.Explorer explorer = this.Application.ActiveExplorer();
        Outlook.Application app = (Outlook.Application)explorer.Application;

        app.NewInspector += new InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);
    }
}

After much searching I began to come across implications that the garbage collector was removing the references after the first event. I was at a loss at what to do until I came across another discussion where someone was having a similar problem and the response was to save the object in a class level variable to avoid the garbage collector from removing it.

A quick edit and some testing showed this to work reliably. So, if Office is only triggering an event once make sure there object references are stored somewhere the garbage collector won't go. And make sure to assign the object before you register the handler or the garbage collector will still find it.


public partial class ThisAddIn
{
    public Inspectors _appInspectors;

    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        Outlook.Explorer explorer = this.Application.ActiveExplorer();
        Outlook.Application app = (Outlook.Application)explorer.Application;

        _appInspectors = app.Inspectors;
        _appInspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);
    }
}

Wednesday
Aug112010

Starcraft II Patch Download Problem

Since getting Starcraft II I have bashed my head against the uselessness of the Blizzard Downloader. As is common knowledge that Blizzard uses the bittorrent protocol to transfer its patches and you might thin that it's pretty damn penny pinching of them to do it instead of just doing direct downloads. Unfortunately their bittorrent sucks from my repeated experience.

On both the 1.0.1 and 1.0.2 patches the downloader stopped part way through the download reporting the error "There were multiple problems saving data." As you can tell it offered up no useful help. A quick Google also turned up very little other than the basic and generic Blizzard Downloader FAQ page. After trying all of the suggestions I had got nowhere except swearing at Blizzard for not putting out a direct download patch.

To keep this short a few days later I tried downloading the patch files into the Updates folder using utorrent instead of the Blizzard downloader and five minutes later all the files had been downloaded. The Updates folder is located in the Starcraft II install folder and is only there when there's a patch needing to be downloaded. Starting up Starcraft II again it detected all the files were present and happily patched itself up.

So if you're having trouble downloading the Starcraft II patches wait a couple of days and try using a different bittorrent client to download the files. You'll find the bittorrent files near the Updates folder in the Starcraft II install folder.

Wednesday
Jun232010

Playing with Regex on OSX

RegExhibit

If you've ever been stuck with the problem of trying to build anything but a simple regular expression you know how painful it can be getting it to match just what you want.

When developing for .NET on Windows I was introduced to a brilliant free tool called Rad Software Regex Designer that gave you the ability to provide an example of the text you wanted to match and an area to slowly build up your regular expression while getting instant feedback on what it was doing. It even has dialogs to add specific regular expression commands in case your proficiency with regular expressions isn't high or you just forgot how to create a non matching group. After moving to OSX for work I went looking for a similar tool for the Mac. And after a while I found it.

RegExhibit is a GUI tool of OSX that uses the Perl regular expression library to help you build regular expressions. This should be fine for any other languages that use a PCRE library but make sure you check before deploying. The core part of the program are two text areas. you place an example of the text you want to match into the lower area and build up your regular expression in the top are. There are even tabs for doing matches and splits but you'll likely find yourself in the match tab for most of time. However it doesn't offer the same built in dialogs like the Rad Software Regex Designer so make sure you've got a regular expression reference handy.

This is a great tool that has saved my sanity several times already and I do recommend to anyone that has to play with regular expressions and is developing on the Mac.

Sunday
Apr252010

Should we remember all of those that have fought for our freedoms?  

Well today was ANZAC day in New Zealand and Australia and if you don't know it's our remembrance/veterans day.

One of the things that's always brought up as a reason for paying respects to the servicemen and women is for their actions in giving us our current freedoms. Now I've always had a small issue with this as this does not recognize everyone who has put effort in to gain and maintain the freedoms and rights we have and to improve our country. Things like universal suffrage, healthcare, the welfare state, representative democracy, police and government oversight, the freedom to disagree with those in power without fearing retribution. All of these things are just as important to improving our country as well as the military is in showing other powers in the world that we can and will put our money where our mouth is.

I'm not trying to trivialize the efforts of the men and women in uniform. I'm just trying to expand on the belief we pay our respects to those who have given their blood, sweat, tears, and lives to improve our lives.

So, do you think we should start to make efforts to recognize these other groups who have fought just as hard to improve the countries we live in at the same time we recognize and pay our respects to those who have fought with bullets and bombs?