i-think Twenty-Two

Now with more coherency.

Your travel survival plan - Part 1

| Comments

Recently a close friend travelled to China for many weeks. Whilst I can’t think of a good reason to go to China for pleasure, he certainly has (I have heard something about some little sports competition they have going at the moment).

So, having now “hooked up” with someone he has has to turn back to his friends in Australia to perform a very important duty: “Keeping track of his kidneys”. Unfortunately this plan was enacted too late and didn’t have enough detail to properly react to this scenario. Fortunately he still claimed to have his Kidneys less than 24 hours ago, but I can’t be certain he has them at the time of writing.

Don’t think this is purely limited to the stealing of Kidneys. Other problems you need to keep aware of include:

  • Stealing other organs. Sure, kidneys are the main ones, but you’ve already crossed a line, so why not harvest some other organs while you are at it, such as your liver or corneas.
  • Kidnapping. Even if you don’t have anyone back home willing to fork out for your ransom, you may still be worth something to kidnappers who can send your bodyparts in the place of genuine kidnap victims in order to encourage the ransomee (is that even the right word? If not, it is now) to fork out the dough.
  • Slavery. Don’t underestimate your worth on the slave market.
  • Being accidentally married and thus being financially responsible for your new bride/groom’s entire family

So with all these things that can possibly go wrong who in their right mind would want to even travel overseas? I’ve heard culture and life experience are a couple of reasons.

So that you can continue having life experiences that don’t involve getting you addicted to drugs and becoming someone’s sex slave in their dungeon, you can arrange a plan to communicate your whereabouts and status to the outside world. Depending on the level of the problem, a quick call to the local embassy or a crack team of mercenaries will be ready to assist and extract you from any situation lickety split.

Unfortunately my friend consulted someone else to make these arrangements, who despite their many years of watching violent television and films has not been left as paranoid about how to prevent or deal with these situations as I. It’s important to take life lessons from movies.

The first and most important step is regular communication. How regular will be dependent on where you are going and what sort of access you have to communication equipment. Communication can be either one-way or two-way. If the communication is one-way you need to establish a protocol for verifying the validity of the communique and a plan if the communique is malformed. Most importantly is the need for a duress word. This word needs to be arranged in advance when their is a high degree of certainty that the person is not under duress. Duress words

The best part about duress words is their ability to add extra meaning to your message. For this reason it is important to have more than one. Using these words you can communicate important information to give an approximate location, description of the problem and even a rough count of how large the team of mercenaries should be.

It is important that the duress words be able to be slotted in with your normal messages without arising suspicion. Poor choices of duress words include “help”, “I’m being kidnapped” and “get me the f@# out of here”.

Because the duress words are supposed to be so normal it is possible that a duress word may accidentally be used in a communique. That’s why it is important to have a procedure to follow when a duress word is received, a communique is late or malformed. Usually this procedure would have varying degrees of action as you increase your state of readiness. You can either use numbers or colours ((That’s right, colour is spelt with a “u”)) (or a combination of the two) to help make it easy to determine where in the process you might be.

In my next post I’ll describe what steps to take as you move from one alert level to another.

Adding WPF Windows to an existing Windows Form Project

| Comments

I’ve been recently reading Essential Windows Presentation Foundation (Chris Anderson) and I have been really looking forward to being able to create some funky WPF apps. I’ve almost finished (except for the sudden scope creep) a utility that I’ve been writing using Windows Forms. Like most good utilities it sits in the system tray just waiting to be used.

While using this tool yesterday I realised that I was being driven crazy by its need for interaction by the mouse. So I decided to create a global shortcut key and that would open a little navigation window to help you select the item you wanted (this is just some of the aforementioned scope creep).

I knew straight away that this was a job perfectly suited for WPF. So, I opened up the Add New Item dialog in Visual Studio 2008, selected WPF and was greeted with one solitary option: Add New Item
(WPF)

Unfortunately when you have a Windows Form project, User Control (WPF) is the only choice you are given. Fortunately, there is a workaround, but let’s first look at some reasons why mixing WPF into a windows form application might not be the best idea:

  • Consistent appearance is the first reason that comes to mind. WPF windows look just a little different to Windows Forms (with default settings) and even more different if you apply all the fancy styling options. Of course, if you are looking to create a window with a distinct look, this doesn’t apply
  • Maintainable code is another reason. Supporting multiple types of windowing increases the complexity of your project

There may be others and hopefully someone will point them out in the comments.

But now back to adding a WPF window into your Windows Forms project. Without the Window option, begrudgingly select User Control (WPF). Visual Studio then adds all the necessary references to your project and create a new XAML file and a corresponding CS file (or VB if you are that way inclined).

It turns out that User controls and Windows are very similar, so in your XAML file, change the “UserControl” tag to “Window” (remember to also update the closing tag). Your XAML should now look something like this:

<window x:Class="MyProject.UserControl1"
&nbsp_place_holder;&nbsp_place_holder;&nbsp_place_holder;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
&nbsp_place_holder;&nbsp_place_holder;&nbsp_place_holder;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
&nbsp_place_holder;&nbsp_place_holder;&nbsp_place_holder;Height="300" Width="300">
&nbsp_place_holder;&nbsp_place_holder;&nbsp_place_holder;<grid>  
&nbsp_place_holder;&nbsp_place_holder;&nbsp_place_holder;</grid>
</window>

Finally update your code file to remove the UserControl inheritance. (It’s already defined in your XAML anyway).

/// 
/// Interaction logic for UserControl1.xaml
/// 
public partial class UserControl1
{
    public UserControl1()
    {
        InitializeComponent();
    }
}

Then you can play with the WPF window as you would expect.

MobileMe is making me angry

| Comments

[caption id=“attachment_162” align=“alignleft” width=“310” caption=“MobileMe: Another computer is syncing”]MobileMe: Another computer is syncing message
window[/caption]

I’ve seen this dialog far too many times today. The only saving grace of this error message is that it doesn’t seem to steal my focus. However it is so huge and in the middle of the screen it is quite probable that it is covering up whatever text I happen to be working on at the time. The fact it needs to remind me of this fact (it just did it again then) so often is just crazy.

But why is it even necessary? Will my world come to a grinding halt if I don’t know that my contacts couldn’t be synced in the background right now? Really? Who cares? Can I do anything about it? No. Clearly MobileMe just wants to point out its inadequacies.

[caption id=“attachment_163” align=“alignleft” width=“150” caption=“Violet iDisk icon”]Violet iDisk icon[/caption]Talking about inadequacies, who chose the colour for the background of the iDisk icon. Violet? Seriously? It’s as if they kept the “transparent colour” and forgot to substitute the real one. Come on Apple, you are all about design, but someone screwed the pooch on this one.

And the way MobileMe was installed, as part of iTunes, now that seems a bit unintuitive to me. (Why would a program that plays music have anything to do with keeping my calendar and contacts synchronised).

Of course, when MobileMe is working it seems to live up to some of the “cloud” hype. I finally have my contacts integrated into Outlook (plus the calendar), which is a big plus, or it would be if I put things in my calendar or opened outlook more frequently than once a week (but that’s my problem (or not)).

So hopefully Apple will fix this stupid error message (I’m happy to have a little notify icon flash or something if it really wants to get my attention). Less importantly I hope they change the background colour of the iDisk icon.

And once that’s done maybe we can focus on real problems.

Pitfalls of Proposing

| Comments

They say to “give the people what they want”. According to the stats, the fine people of the Internet want to hear what I have to say about such things as “When to Propose”. Despite the fact that the post is over two and a half years old and I remain as single today as I was then it is the number one post read on my blog. In fact, a quick Google search reveals that I am number 3 on the list when you search for “when to propose”. These posts have also seen the highest number of comments from people I don’t know.

This tells me three important things:

  1. I should write more posts about proposing, relationships, etc
  2. There must be a shortage of good information on the Internet about this topic
  3. The people of the Internet will listen to anyone for advice

With that out of the way, let’s start to explore this topic that the Internet seems to deem me an authority on, proposing.

I am a student of film and television (in the sense that I watch a lot of it). Most of what I’ve learnt about life I have picked up from movies and TV. Most importantly I have learnt that life is not at all like what I see on movies and television. There is no guarantee of a happy ending. Indeed, things don’t seem to quite end or wrap up nicely as they do on film. That’s why I like film and television. I watch it because it isn’t what I see around me every day, but I can still apply broad concepts.

Proposing is all about managing risk. Indeed, everything about life is about managing risk. Risk is what makes life enjoyable. Knowing the answer to every problem is not quite as gratifying as solving the problem.

So where was I? Right, proposing and risk. The trick I suppose to dealing with the risk of proposing is to break it down in to the factors that contribute most to the risk. By recognising these factors, it should become easier to pick the best time to propose, or even if you should.

Factors are likely to be different for each person, but it is probably best to look at the long term goals and aspirations of each side to see how well they combine. If sleeping with as many people as possible is your goal and your partner’s is to be involved in a committed monogamous relationship, perhaps your long term prospects aren’t tied well together. Similarly, if you are looking to travel and explore the world and you partner wants to settle down and start a family you might also be on the wrong track.

Ideally you want to find a partner whose life path travels parallel or intertwines with yours. There is obviously going to be some compromises along the way, but when one path winds to the left, so must the other for the relationship to continue. Of course, compromise has to go both ways.

Perhaps the hardest part of accepting the risk of proposing is to accept that there is no right answer to the question (the question being “will you marry me?” if you have lost track). A “no” can be a positive step as it may make it clearer that your paths are diverging. Similarly a “yes” may lead to further trouble down the road if those paths diverge.

But as I was saying earlier, the risks in life are what make it interesting. Importantly, these risks can come with great rewards. So if you are prepared and ready, take the plunge and best of luck to you.

Using Wordpress to track bugs

| Comments

Over the years I’ve had to make programs do what they were never designed to, like using Excel as a database or using Access as a database. I’ve been working on a little project (not an Excel or Access database) that I want to be able to publicly track bugs on. I don’t really want to set up a whole new web app, and I would like to integrate it with my blog (where I will eventually be putting aforementioned project).

After unsuccessfully trying to find a plugin that might do the whole thing I wondered if I was making it too complex. While waiting for my bus this morning I had a thought. Why not just use wordpress as it is?

This led me to think about what I wanted from my bug tracking. Basically I wanted the ability to:

  • Create bugs. How about a post being a bug?
  • Comment on bugs. Posts can have comments!
  • Mark a bug for a certain version and product. Posts can have categories
  • Show that a bug is active, complete, won’t fix, etc. Posts can have tags

To get bugs from other people, I could have a dedicated “triage” page that takes comments and I manually create bug posts from them (I’m looking for a plugin that will let me take a comment and turn it into a post).

Of course I don’t want the bugs littering my front page, or main feed, but I have been able to find a plugin that should deal with that issue. I am worried about polluting my tag cloud with bug related tags, but that is a compromise I’m willing to make.

Of course, I probably should focus on finishing that other project first so there is something to raise bugs about.