The third site in the stack overflow trilogy,superuser.comlaunched yesterday. I can say quite proudly that I have the 25th highest rep of anyone on the site. For now. Here is a pic to remember the moment, as I am sure I won’t stay there for long.

The third site in the stack overflow trilogy,superuser.comlaunched yesterday. I can say quite proudly that I have the 25th highest rep of anyone on the site. For now. Here is a pic to remember the moment, as I am sure I won’t stay there for long.

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.
Building: McWatiN (Debug) Building Solution McWatiN Building: McWatiN (Debug) Performing main compilation... Build complete -- 0 errors, 0 warnings ---------------------- Done ---------------------- Build successful.
Two words that mean so much … this time they refer to WatiN built using MonoDevelop on Mac OS X.
1. Get a subset of WatiN to compile with no PInvokes done
2. Get McWatiN to successfully start firefox.
2. Replace all the windows and IE stuff that was removed with code from Watir.
My presentation at the Microsoft SDC open day alongside Devtest CEO Sarah Richey is now up on Microsoft’s site.

http://www.microsoft.com/australia/services/microsoftservices/sdc_openday.mspx
For my presentation you need to open the “How we do: Testing” video and I am in the last half following Sarah.
Next Monday will be interesting, as I am presenting at the SDC Open day alongside Devtest CEO, Sarah Richey.
Here’s the blurb from the Microsoft site.
In challenging economic times, software development projects that are critical enablers to achieving business goals, will be looked at favorably and expected to deliver the results with a high degree of certainty. At the SDC open day, Microsoft’s own software development arm the Solutions Development Center (SDC) will present and share with you its formula to achieving certainty and success in project delivery.
You will hear from the SDC project teams on how they apply agile planning and development processes to deliver the right solution. How metrics-driven project management is used to keep the project on track. How daily builds and deployments help to maintain the project “heart-beat”, and how the SDC incorporates unit testing and automated testing into the process to ensure ongoing quality. .
You will also learn how Microsoft development tools and technologies are put to use throughout the software development lifecycle to enhance individual and team productivity.
Finally, you’ll have the opportunity to step inside the SDC facility and learn how the workspace is used to promote innovation, team collaboration and knowledge sharing.
I only have 10 minutes so it will be a “short and sweet” session, and attendance has closed, but there will be ~130 people in attendance.
This is just brilliant … check out this ad for Microsoft Office for mac.
So I installed Windows 7 beta 1 today on my macbook, inside parallels. The installation process was seriously impressive. Here is a sh0t of my desktop at the moment.

As you can see I am quite happily running Vista and Windows 7 inside Mac os x 10.5.5 using parallels. The only real gotcha was that I couldn’t install all the parallels tools, as one of the device drivers caused a blue screen.
Back on my 32nd birthday I went for a helicopter ride in over Sydney harbour. On that trip I took a ton of photos.
I thought that one of them would be a great candidate to “tilt shift” and here is the result.
I have a few more up in this flickr photo set.
With little fanfare Google has “released” the first version of Google Chrome. What does that really mean ?
Not a lot, unless you previously had developers who wouldn’t fix Chrome specific rendering errors in their pages because it was “beta”.