With the latest commit to the http://code.google.com/p/mcwatin/ repository can now open and close firefox all by itself. :-)

The next feature to add is detection if a browser is open with jssh running and to re-use that browser instead of always launching a new one, or close as appropriate.

On thing that I have noticed is that the lack of a debugger in mono develop on the mac is really slowing me down as I can’t easily follow the code execution.

So I haven’t worked on my WatiN Mac os x port for a few days, but I got back into it last night. The main hurdle at the moment is that the System.Diagnostics.Process class is not fully baked on Mono 2.4 on the Mac platform, because it doesn’t implement the /proc filesystem that linux does.

The correct thing to do would be to learn how the Mach kernel process structure works and fix mono, but I haven’t programmed in non managed C since 1990 and I would be very dangerous, especially at such a low level in mono.

So the first approach was to use the parts of mono that were working, namley Proces.Start() to call a shell script that I wrote to /tmp, then redirect standard out to a file, then parse that file and act accordingly.

StreamWriter sw = new StreamWriter("/tmp/watin-listprocess.sh",false);
sw.WriteLine (@"ps x | grep" + processname + " | grep -v grep > /tmp/watin-processlist.out");
sw.Flush();
sw.Close();

Process shScriptProcess = new Process();
shScriptProcess.StartInfo = new ProcessStartInfo("/bin/sh","/tmp/watin-listprocesses.sh");
shScriptProcess.Start();

A hack, yes, in fact a very messy hack. So messy there had to be a better way.

And there is …

Enter Monobjc. Monobjc is a managed wrapper around the Mac os x Cocoa API’s. A quick search pointed to the NSTask and NSPipe classes as a way to start a process with NSTask, and capture standard out with NSPipe, then parse the result.

A much more technically correct solution.

public static void Main(string[] args)
{
// spin up the objective-c runtime
ObjectiveCRuntime.LoadFramework("Cocoa");
ObjectiveCRuntime.Initialize();
NSAutoreleasePool pool = new NSAutoreleasePool();

// Create our process
NSTask task = new NSTask();
NSPipe standardOut = new NSPipe();
task.StandardOutput = standardOut;
task.LaunchPath = @"/bin/ps";

// add some arguments
NSString argumentString = new NSString("-ax");
NSArray arguments = NSArray.ArrayWithObject(argumentString);
task.Arguments = arguments;

// We have liftoff
task.Launch();

// Parse the output and display it to the console
NSData output = standardOut.FileHandleForReading.ReadDataToEndOfFile;
NSString outString = new NSString(output,NSStringEncoding.NSUTF8StringEncoding);
Console.WriteLine(outString);

// Dipose our objects, gotta love reference counting
pool.Release();
}

So this needs to be fully baked in and then put into my Watin on mac os x port and then it should work stand alone, without shell script assistance.

This is just brilliant … check out this ad for Microsoft Office for mac.

You have to hand it to the folks at Apple. I only noticed today that their Mac OS X icon for a Windows based server comes complete with old CRT monitor and a blue screen.

generic-pc.jpg

Nice to see some people have a sense of humour.

Microsoft has released a tech preview for Mac OS X for their live mesh service. The installation was seamless and worked as expected.

I just don’t seem to get the whole point of mesh, at the moment it only puts a nice UI on the features already offered by live foldershare.

The latest nightly builds of webkit, includes the new improved web inspector. It includes great new features such as:

- A Javascript debugger
- A Javascript profiler
- A resources panel so you can find where your page takes time to load
- Support to look into HTML 5 databases

For all the details check out the post here, then download your latest sword and get testing.

What is “Skymarket”, well according to a Computerworld blog post for the Skymarket Senior Product Manager:

“… the Windows Mobile marketplace “the place to be” for developers wishing to distribute and monetize their Windows Mobile application”

Why didn’t Microsoft just copy Installer.app before Apple copied it, then they could have beaten them to the punch instead of chasing tail lights once again.

There is a little project called Monoobjc which is a mono to Objective C bridge that allows you to use the native Mac OS X libraries in .net code on the mac.

That is pretty cool, but one of the features is to allow the .app folder to contain the mono dll’s that it needs and execute with out the mono runtime installed.

So if you take that one step further, it should be possible to build an iPhone app, the same way and just bundle the mono code along for the ride.

So I wonder how long it will take until this happens, my bet is someone will do it in less than six months.

Apple’s iPhone is a landmark product in a number of ways. It really highlights the sort of great product that can happen when development is driven by great design and not the other way around. However, I think that the product is based on a flawed assumption that the device will always have an internet connection. This has led to the situation where the iPhone is probably the single most hacked device on the planet at the moment. Let me explain how that happened.

There must have been a bit of a which came first, the chicken or the egg moment in regards to using AT&T as the provider for the iPhone. Did apple have a device that needed a constant internet connection and went shopping for a phone network, or did they make a deal with AT&T and then build a device knowing that it would always have a connection? Either way it doesn’t matter but it definitely shaped the way the device works.

Normally with a mobile phone you can buy it in one of two ways. You can either buy a subsidised phone on a contract where your monthly access fee pays for the phone, or you can buy the phone outright. In recent years telco’s started locking some subsidised phones to their networks in a way to ensure that their subsidised phones weren’t being used on other, competitors networks.

Apple currently does not provide a version of the iPhone that is unlocked at any price. What this means is that currently, if you want a phone in the US in the next 5 years, you have to be a customer of AT&T. That single move reduces Apple potential market base to 27% of the US market and locks out the rest of the global market until they strike similar deals in other countries. If actively reducing your potential customer base isn’t enough it actively encourages the remaining 73% of the US installed base to look for ways to unlock an iPhone to use on their current network. We’ll come back to this in a moment.

As soon as Apple released the iPhone, they also released a way for developers to write applications for the iPhone … web applications. Seriously. From a user experience point of view, there is no comparison to a native application compared to a web app. Apple needs to take a leaf out of Microsoft’s playbook here and provide a sandboxed runtime on the iPhone, and provide a platform not a product. If apple provides a great set of tools and API’s then developers will flock to the iPhone and make the product something much bigger than what ships out of the box.

So with the lack of a controlled development platform and non AT&T customers wanting to use the phone, there is HUGE motivation to hack this thing until it can be hacked no more. If apple keeps locking people out, I would bet that in a couple of years you may even see a clone OS based on Linux that you can install instead of the out of the box Apple one.

So here are my tips for Apple to dominate the world and stop people hacking their product.

  1. Sell an unlocked version of the iPhone, at a higher price. People are already paying more than twice RRP for these things on eBay.
  2. Encourage development the same way Microsoft does for their phones and now the XBOX 360 through the XNA program. Give them tools and a controlled sandbox that you let them play in and then step back and watch greatness happen.

Apple’s recent 1.1.1 firmware update has, for now, locked out the hackers and given them a steep hill to climb, but if history is a guide, it won’t be long before they are back in the phone again. So my advice to Apple is this. Go and study the Xbox 360 development model and apply something similar to your iPhone, and support the communities that want to extend your products, don’t fight them, because it’s just a waste of everyone’s time and effort.

Safari for Windows Public Beta Downloads Top 1 Million in First 48 Hours. Wow. You can read about it in the Apple press release here.