Monday, June 04, 2007

The FePy blog -- The Iron Python community blog. (Also, interestingly, it seems that the MSFT DLR team are contributing to improvements in Mono for cross platform support of the language).

Review Board -- Google's web-based code review tool

Analysis of Palm's new Foleo --; thin-terminal device

Sunday, June 03, 2007

Summer

Following a wet long weekend, mainly spent moving the main bedroom into the spare room; and a wet week that washed out the chance of a photocall for the local paper about cycling to work, it was suddenly sunny and hot at the weekend.

And, taking me by surprise, Strawberry Fair.

Not as good as it used to be. The T-shirts tend to be faux-countercultural; and the counter-culture is just demented (No2ID being the only island of sanity). But I did manage to pick up a new Panama hat, since I was wanting a spare for the office — and at the point I did, was in need of some portable shade..

Today did gardening to a logical stopping point (refilled the newly empty green bin); and repainted the metal flap on the drive that looked like this

Multi-purpose access

but had become chipped and rusty. I also glued on a couple of pads made from offcuts of heavy-duty flooring vinyl to cushion the front (under-) side when I drive — the chipping coming from crushing stones from the driveway under the metal.

[Now playing - Planet Rock]

Friday, June 01, 2007

The best code of all

I had been planning to write a short essay today on how I felt that I have just completed a few very productive days, where my net code output has been negative to the tune of a few hundred lines.  After all, this is something I have touched on previously, albeit in passing, but I felt needed a bit more emphasis.

And then, in a fit of synchronicity, Jeff Atwood blogs on essentially the same topic, albeit from a different direction -- The Best Code is No Code At All.

It may be something of an acquired taste, but one of the best experiences I find in software development is the point where you are able to delete code.  In project terms, being able to do so marks the point at which the metaphorical rough-cut timber is finally getting sanded down and polished.  Source control systems are there to remember how things were, for good or for ill; so code that is obsolete, or that there is a just plain simpler and plainer way to do, can get the chop with a clean conscience.

While exploratory phases of development may involve a measure of throwing code at a problem until enough of it sticks, and on the first time, cut-and-paste may seem the more attractive code-reuse strategy, coding smaller will pay dividends in the long run.

Just don't leave the flabby code there expressly to get the deleting-it-all kick later.

Links for 1-Jun

I HAS 1337 CODE, LOL -- LOLCODE, a scripting language infused with the Zeitgeist (YARLY, KTHXBYE)

AD FS SDK documentation due in July 

In Defence of Checked Exceptions (Not Really) 

Zen of the DLR and DLR Experiences -- Two presentations on DLR design philosophy and architecture

Simple ASP.NET 2.0 Tips and Tricks --  that you may not have heard about

Secure Python Interpreter -- Sandboxed to restrict socket and file access.

IronPython Cookbook Wiki -- Using .Net from Python/DLR

Thursday, May 31, 2007

Links for 31-May

Google Gears -- Offline web apps

Bulletproof Ajax (Book review)

Pre- and post- advice in Ruby -- more metaprogramming

Let's build a grid -- Thinking about your layout. Some of this is applicable to general UI

Widown't for Rails -- preventing that one dangling word after a line-break

Spawning a process in IronPython

I've been using IronPython recently as a scripting language because its string handling and ability to provide structured programming support is so much richer — and accessibly documented — than old .BAT & .CMD file programming supports. The downside is that the old style files make launching sub-processes trivial. So, in the spirit of DRY (Don't Repeat Yourself), here's the file to import.

And yes, this is really another example of how to use .Net rather than how to use Python.

Wednesday, May 30, 2007

Links for 30-May

Icebreakers -- interview questions designed to put you both at ease and break out of the scripted, stilted talk that results in bad hires and missing good hires (from the same source as the "Design a Monopoly Server" question)

Hygienic Macros -- practice safe meta-programming

Top 300 XSS sites -- Hall of Shame

Accessible expanding and collapsing menu&

Tuesday, May 29, 2007

Links for 29-May

Compiler Lab : Second Day -- more silverlight material from Microsoft

DLR in .Net 3.5 -- and related topics 

Virtual Desktop inside the browser -- more silverlight goodies. This looks seriously interesting, and would make things like browser appliances worthwhile.

Sunday, May 27, 2007

Anime — what I'm watching

This season: well MGLN StrikerS should be obvious, even though I don't think spreading the story so thinly is doing what should be a "Gosh, wow!" roller-coaster action series any favours.

From good to so-so of the rest of the current season, Seirei no Moribito, Bokurano, Marimite 3rd season OAVs (see previous review), Claymore (so-so Nihon-meets-D&D), Rocket Girls (harmless fluff), El Cazador de la Bruja (Noir in Mootxico), Moonlight Mile (lumbering cash-in of Planetes).

Catching up on older stuff: Yokohama Kaidashi Kikou OAVs (cute, chill-out), Mahou-shoujotai (teeny witches!), Aria the Animation (more chill-out, with Natural queued), Busou Renkin (OTT Japan-style superheroes), GitS:SAC 2nd Gig (well stalled).

And I really need to get around to Paranoia Agent, Texhnolyze and Narutaru.

Looking to the top spots of the season to date:

Bokurano

The "art" favourite of the season, based on a manga with the motif of a mecha powered by the suffering of damaged children, I'm not sure how well the anime is going to keep up with some of the more raw parts. And as it hasn't ended the story yet, the anime is going to have to pull something out of thin air or just end unresolved.

Seirei no moribito

A fantasy set in some mythic Asia, apparently based off a novel. Not hyperkinetic, just quietly understated, and shaping up well.

Anime — Le Chevalier d'Eon

France, second half of the 18th century. The murder of his sister, Lia, brings d'Eon de Beaumont into a web of intrigue, quicksilver-powered zombies and Illuminated history.

As one of "four musketeers" serving in the King's Secret (the King being Louis XV), he follows revolutionaries to the Russia of Elizabeth and Catherine; and then to England to confront Father Sir Francis Dashwood at Medmenham Abbey, before returning again to France to find the one who killed his sister; and all the time avoiding the plots of the Comte Saint-Germain, the Count of Cagliostro, and the nefarious Maximilien Robespierre, who seemed to be too close to his sister.

Oh, and he keeps being possessed by his sister's spirit, and invoking the magick of the Psalmists, as well as kicking righteous ass in the pursuit of justice and in the name of France.

The history is a bit “:lol: Japan” and uses Psalms as western writers might use Buddhist sutras — but enough buckles get swashed in the expected style for this to be a fun romp. Recommended.

24 episodes, and apparently becoming available in R1 DVD.

Friday, May 25, 2007

FePy r6 + 1 line of code runs PyFit

Following up this trail again --

IPCE-r6 doesn't run PyFit out of the box, but it gets a lot closer than the mainline does:

Traceback (most recent call last):
 File C:\PyFIT-0.8a1\fit\FitServer.py, line 7, in Initialize
 File , line 0, in __import__##4
File C:\PyFIT-0.8a1\fit\fitnesse\FitServerImplementation.py, line 49, in Initialize File , line 0, in __import__##4 File C:\PyFIT-0.8a1\fit\fit\Fixture.py, line 21, in Initialize File , line 0, in __import__##4 File C:\PyFIT-0.8a1\fit\fit\TypeAdapter.py, line 34, in Initialize File , line 0, in __import__##4
File C:\PyFIT-0.8a1\fit\fit\taBase.py, line 36, in Initialize File C:\PyFIT-0.8a1\fit\fit\taBase.py, line 82, in TypeAdapter AttributeError: 'module' object has no attribute 'ast'

This line is the first to look for compiler.ast members to initialise data members. Looking at the IPCE bundle, C:\IPCE-r6\Lib\compiler\ast.py exists and has the values required.  It's just that its __init__.py is empty. , so we can patch C:\IPCE-r6\Lib\compiler\__init__.py to be

import ast

and it all works, without having to touch PyFit code at all.

This is the "no change to client code" equivalent to decorating PyFit with a suitably guarded explicit load

import fepy
fepy.install_option('ast')

The behaviour is not a bug, but a feature as FePy by default does not load code that is rarely used, so as to speed start-up.

Note

We still don't have parsing of lists, tuples, dictionaries or complex numbers as arguments, since we still don't have the transformer.parse method to expose as compiler.parse; the unit tests in TypeAdapterTest.py report

Ran 117 tests in 2.468s

FAILED (failures=3, errors=5)

However real tests that don't have these non-scalar types do run happily on FePy-r6.

Tuesday, May 22, 2007

C++/CLI

Notes on mixed types -- the invaluable gcroot<T> template.

Mixing Native and Managed Types in C++ -- plus AutoPtr generic

AutoPtr revisited.

Silverlight -- more than just Flash

A lot -- almost all -- the talk about the new Silverlight technology from Microsoft has been about the "shiny", the ability to place hevyweight UI in the browser, and whether or not it will succeed in displacing Flash in a way that Java applets never managed to (But see also here).

Somewhat lost in all this has been what the technology is, especially in the 1.1 release, currently in alpha.  Of course this isn't new -- remember all the "What is .Net?" thrashing about that took place when that technology was first announced -- all talk of web services and "Hailstorm" (MSFT Passport-on-steroids) -- and what we understand by the term now over 5 years down the line

The basis of the sliverlight technology is a portable version of the CLR (.Net) framework, referred to as the Core CLR.  This is the bytecode engine and a slightly cut down set of APIs, though cut down in different ways to the .Net Compact framework -- it relies on APIs not present in that version.

And then comes the good bit.

Layered on top of the CLR is the new DLR (Dynamic Language Runtime), which abstracts the flexible duck-typing behaviour seen in JavaScript, Ruby and Python -- and these (along with the inevitable VB) are the target languages for the DLR support in coming releases. Python and JavaScript (EcmaScript 3.0) are in the 1.1 alpha, with the others to follow.  More... Yet more...

The DLR has also appeared in the refactoring of IronPython -- and the recent 2.0 alpha release includes the Microsoft.Scripting.dll that is at the heart of the DLR (though the current transition state is made apparent by there being a Microsoft.Scripting.Vestigial.dll representing the remains of a first cut at refactoring to separate out what is now the DLR).

Two blog posts from one of the DLR developers (who's also been involved in Jython as well as IronPython) on how dynamic objects are being modelled in the CLR

and the start of a series on how compilation is handled (DLR Trees, part 1), which shows how it is complementing the LINQ features of C# 3

With IronPython and, soon, IronRuby as first class languages for the .Net framework there seems to be some hope that the .Net == C# (or, for those who want to join a sort of Coke vs Pepsi style debate, .Net == C# or VB) status quo may actually be coming to an end.

MSBuild -- build from solutions without DevStudio

This is a tool that had passed me by until I spotted a passing reference to it just the other day. Buried in your C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 folder is an executable called MSBuild, which will take .*proj and .sln files and build them.

It consumes XML files in a format of which the .*proj files are a special case; and handles solutions (.sln files)  as a special case.  While I've not had chance to explore the ramifications of the XML build format, this appears to be Microsoft's own preferred build system and one that will bear investigation and adoption, especially for those projects (like Callisto) which use DevStudio for developer builds and thus have had it  installed on their build machines, when they could have gotten by with just the .Net 2.0 Framework.

MSBuild with solutions -- how to capture the temporary script file generated from a solution; and how to actually build just one project from a solution

MSBuild with ASP.Net -- Visual Studio 2005 no longer uses project files for ASP.NET; this is how to roll your own from the solution.

Solution files and MSBuild -- Automated hoisting of project build from the solution file.

These latter look like something that could be ported into an IronPython script with ease.

…and caught up. Phew!

Interviewing

Now I've just finished a round of interviewing, time to let out some of the secrets. It's really about whether the candidate can think on their feet (and can work elegantly around places where they aren't familiar with detail) and knows general software engineering techniques in some depth (according to their length of experience).

Five essential phone-screen questions -- not bad at all

Job Interview 2.0, now with extra riddles -- Is moving Mt Fuji really the way you want to go?  Or does it just select for those with an eye to making the solutions more complicated? Me? I'd not work for a company that uses this interview style. The 10/5/2/1 minute problem I know the answer is 1 minute faster than the obvious one using the 1-minute runner, and if I wanted to do it again, I'd write a program to solve it.

"My favorite interview question" -- it's "How might you design a program that lets people play Monopoly with each other over the internet?"  Not a question that I personally have tried, but the post analyses what makes this question a good one.