Wednesday 30 March 2011

Google Web Fonts

There appears to be an endless series of interesting things that Google offers developers that I've yet to bump into...

One more to knock off the list now is Google Web Fonts (and the Google Web Fonts API). There’s a great list of fonts there that are easy enough to embed into a web page (assuming you can get at the <head> tag).

Additionally, designers who want to play with these fonts can find a shortcut way of downloading/adding them all en masse in this blog post.

And yes, I should have showed off a few of the fonts in this post, but that involves messing with the whole blog template to get at the <head> tag, so I opted for the easier route of not doing so :)

Tuesday 29 March 2011

MS Tech.Days Live 2011

Microsoft are touting for attendees at their 4 free days of multi-track technical content from 23rd to 26th May, 2011 in Fulham Broadway.

Tech-Days Live 2011 features sessions on desktop, cloud, web, mobile, rich clients and database.

You can keep up to date by following them on Twitter.

If interested, register fast!

Wednesday 23 March 2011

In-depth article on iPhone Development with C# and MonoTouch

I’ve put together a lengthy tutorial article on programming the iPhone (and iPad and iPod Touch) with C#, Mono and MonoTouch.
This covers a number of areas and runs through using Interface Builder, outlets and actions, table views, navigation controllers, database access with SQLite, web browsing with the WebView, GPS support through CoreLocation and MapKit, Web Services (only SOAP in this article), splash screens, icons and more besides.
You can find the article by following this link.
The article covers the same ground as the previous white paper PDF on iPhone development using Delphi Prism, but this has been fully translated over to C# and had a few areas of confusion simplified.

Update: This article has been out of date for some while, thanks to MonoTouch having moved from v3 to v5 and Xcode having moved from v3.x to v4.x and markedly changing. I've spent some while updating this extensive tutorial and the updated version can be found here.

Wednesday 16 March 2011

Delphi Starter Edition March price offer

Following on from the earlier post about special UK March 2011 pricing for Delphi and C++Builder tools, I just received information about more March-only pricing regarding Delphi XE Starter Edition. You can buy it at the March-only price of £105.15+VAT.

This is a useful version of the product for those who want to experiment with Delphi or learn some Delphi programming building regular Win32 applications, or if you’re a hobbyist on a tight budget.

Delphi XE Starter contains:

  • A streamlined IDE, code editor
  • Ultra fast compiler
  • Integrated debugger
  • Two-way visual designers to speed development
  • 100s of visual components
  • InterBase Express for connectivity with the InterBase database
  • A limited commercial deployment license

More information on Delphi XE Starter can be found on the product page. You can buy online direct from Greymatter.

Tuesday 15 March 2011

IE 9 has arrived

Microsoft have released Internet Explorer 9, touting its Windows dependence as a strength, not a weakness. It runs on Windows Vista and above, so not on Windows XP. It boasts a new JavaScript engine (Chakra), HTML 5 support and support for HTML5, CSS3 and SVG, and taps into the GPU to boost graphics performance via DirectX 3D. You can find it at beautyoftheweb.co.uk or beautyoftheweb.com.

Friday 11 March 2011

Binding to Objective-C from MonoTouch

MonoTouch is a managed layer that binds onto the Objective-C CocoaTouch libraries using a binding layer. There’s a Mono tool called btouch that will generate a binding layer (or at least do much of the work) of binding an Objective-C API.

In a circuitous way, I recently got vaguely intimate with the MonoTouch binding mechanism.

Thursday 10 March 2011

Borland’s Old Testament Histories

I was just indulging in a spot of nostalgia over Verity Stob’s occasional historical archives that covered the to-ings and fro-ings of Borland and found that some of the old links that people had were no longer working. Also one of them seems to be lost forever in the current version of the Internet.
The Internet Archive Way Back Machine came to the rescue once more!
Here is the full (as far as I can determine) historical archive, which of course will mean nothing to those who weren’t immersed in the trials and tribulations of the life of Borland over the last couple of decades. Rather amusing to those of us who were though :o)

Borland Old Testament Histories
  1. Book of Anders (1996)
  2. Yocam hokum (1998)
  3. Book of Yoc-am (contd) (1999)
  4. Borland Revelations (2004)
  5. Borland's Delphi Goodbye (2006)
  6. A reading from the second book of Codh (2008)
  7. Sons of Kahn: The Apocrypha (2010)

HTML Source Code Formatting

When writing web-based articles on programming topics there comes a point when you have to insert a swathe of source code. There are various choices to make here.

You can simply embed the code between <pre> and </pre> tags and be done with it, and in the case of a small code clause or single statement that might do.

But for several lines of code, a whole subroutine or more, then this quickly becomes almost unparsable by the reader. This is particularly so for those who are used to working in a code editor that offers syntax highlighting (something we all take for granted nowadays).

So then we come to the question of how to get your syntax highlighted code from, say Visual Studio, into HTML, still supported a nice array of colours.

There are actually quite a few online web-based source code formatters, and also plug-ins for blog editors, such as Windows Live Writer. I tried a few of them out and settled on the multi-language source formatter at http://manoli.net.

This CSS-based formatter supports C#, Visual Basic, HTML, XML, T-SQL and PowerShell highlighting options and generates HTML that conforms to the HTML 4.01 specification. It also has options for alternating line backgrounds, line numbers and a choice as to whether the style sheet is embedded or expected to be referenced.

I like it, and kudos to the author. It was very helpful to me when writing a lengthy article recently that involved *many* code snippets and listings.

Wednesday 9 March 2011

Intro Article for iPhone Development with C# and MonoTouch

To accompany the in-depth walk-through on MonoTouch development for iPhone devices using C# posted earlier, I’ve also uploaded a much shorter introductory article on the same subject.
It could be a good starting point if you want to get started quickly.
The article can be found here.
Update: This article has been out of date for some while, thanks to MonoTouch having moved from v3 to v5 and Xcode having moved from v3.x to v4.x and markedly changing. I've now updated this introductory article and the updated version can be found here.

Tuesday 8 March 2011

C# Language Specification

When C# was first released upon the world by Microsoft, it was also sent through the standards bodies, ECMA and ISO. The standards bodies eventually formalised the language specification and published versions of them.

For example, the ECMA version of the C# standard, ECMA-334, is available to freely download as a PDF. Also the ISO version of the C# standard, ISO/IEC 23270:2003, can also be freely downloaded.

However the standards bodies always have a large lag. Both the ECMA and ISO versions of the C# standard are based on C# 2.0 and were last updated in 2006.

Microsoft, on the other hand, is always moving things along and the current release version of the language is C# 4.0, accompanying .NET 4, released in April 2010.

Since C# 2.0 we've had neat improvements like lambda expressions, object initializers, implicitly typed variables, query expressions, extension methods and more besides.

There are various good books that cover this most recent release of the language. I find Andrew Troelsen's Apress texts give pretty comprehensive coverage, and his latest edition Pro C# 2010 and the .NET 4 Platform is a good addition to a programmer's bookshelf.

 

However, and here is the point behind this post, you can always get the formal language specification directly from Microsoft. The C# 4.0 language specification can be found either on MSDN or on the Microsoft Download site.

Friday 4 March 2011

The other IT

In the About Me page, I proselytized about running. This is still quite an exciting subject for me as back in school, any attempt to run left me in paroxysms of acutely painful breathlessness. And then a couple of decades or so later it turns out I can run  reasonable distances with relative competence.

So in 2009 I started running and managed a 5km event. Then I let it slide for a while. Then in 2010 I started running again, in between mountain biking. I worked my way up to being able to accomplish 10km runs and to prove the point to myself entered a number of events.

The first was the Burnham Beeches 10km run, which I completed in 55:07 , albeit with a quick stop for a breather about half way through after a bit of a steep hill.

Then came the Milton Keynes Mo-Run, which despite another quick stop for a breather, I did in 52:11. A nice improvement.

The final event of the year was the Swindon 10km Run. This time there was no stopping and I finished in 50:16. I’m pleased with that time.

Over the winter I’ve been out a couple of times, but nothing consistent. Then I tried pushing it a bit too far by attempting to do a local 10km loop a bit too soon.

The net result of that was to be limping home well before the target distance. After a week’s rest, an attempt to run about 8km had the same result. A week later and a 5km run had much the same.

Oh dear.

In my body (and, I daresay, in yours too) I have a couple of IT bands (aka iliotibial bands). I know, I know – I thought IT was just a contraction of Information Technology too! However it turns out I have an IT band in each of my two legs.

Moreover, it seems I’ve antagonised the IT band in my left leg and given myself ITBS (IT band syndrome) aka ITBFS (IT band friction syndrome). This is, apparently, a very common problem with people doing too much running. Or perhaps more often too much too soon, as is the case with me. I should've worked my way up from a very small distance, but common sense is often an elusive thing when your own health and fitness come into it.

Anyway, the result of all this is I am now waiting for a foam roller to arrive in the capable hands of my postman. I've now heard from multiple sources that other than avoiding running for a bit, the best thing for ITBS is rolling the band up and down a foam roller using your own body weight to give the equivalent of an expensive sports massage. Foam rolling gives myofascial release and can also massage tight muscles without the large bills associated with sports masseurs.

I’m really hoping it gives good results as I was just getting into the running mind set after the freezing winter conditions…

March 2011 pricing for developer tools from Embarcadero

A couple of days ago I received an email from David I at Embarcadero to various partners publicising special pricing for developer tools, including an upgrade amnesty. A prĂ©cis of the post is available on David I’s blog and a summary can be seen below.

Since the post focused on US$ and € pricing I figured I should find some £ pricing as well and have got some figures from Grey Matter.

  • Upgrade Amnesty

    Normally, upgrade prices to the XE range (Delphi XE, RAD Studio XE, etc.) are only available to users of the 2007-2010 range of products. For March 2011 there is an amnesty, and the upgrade prices apply to all earlier versions.

    For UK customer, this gives the following prices:

    Upgrade to Price
    Delphi XE Professional or C++Builder XE Professional £356 + VAT
    Delphi XE Enterprise or C++Builder XE Enterprise £714 + VAT
    Delphi XE Architect or C++Builder XE Architect £1,642 + VAT
    RAD Studio XE Professional £571 + VAT
    RAD Studio XE Enterprise £1,071 + VAT
    RAD Studio XE Architect £1,999 + VAT

    More information is available at http://www.embarcadero.com/radspecial.

  • XE Professional to XE Enterprise Upgrade Special Prices

    Delphi, C++Builder and RAD Studio XE Professional owners get $700-$1000 off upgrades to XE Enterprise by purchasing discounted XE Professional to XE Enterprise upgrade SKUs. With this offer, Professional users can get DataSnap and more.

    The UK pricing on this offer looks like this (the XE license must have been purchased before 1st February 2011):

    Upgrade from Upgrade to Price
    Delphi XE Professional or C++Builder XE Professional Delphi XE Enterprise or C++Builder XE Enterprise £428 + VAT
    RAD Studio XE Professional RAD Studio XE Enterprise £571 + VAT

    More information at http://www.embarcadero.com/radoffer.

  • XE Enterprise Upgrade Special Prices

    Users of any earlier version, any edition, of Delphi, C++Builder, RAD Studio or BDS get $300 off Delphi XE, C++Builder XE and RAD Studio XE Enterprise Upgrades. Delphi or C++Builder upgrades were $1,299 now $999. RAD Studio was $1,799 now $1,499.

    The UK pricing on this offer looks like this (for the last price, the XE license must have been purchased before 1st February 2011):

    Upgrade from Upgrade to Price
    Delphi Professional or C++Builder Professional (pre-XE) Delphi XE Enterprise or C++Builder XE Enterprise £714 + VAT
    Delphi Professional or C++Builder Professional (pre-XE) RAD Studio XE Enterprise £1,071 + VAT
    RAD Studio Professional (pre-XE) RAD Studio XE Enterprise £1,071 + VAT
    Delphi XE or C++Builder XE (Professional or Enterprise versions) RAD Studio XE Enterprise £785 + VAT

    More information at http://www.embarcadero.com/radoffer.

  • DB PowerStudio Special Offers for XE Enterprise Users

    Delphi, C++Builder or RAD Studio XE Enterprise purchasers or users get DB PowerStudio Developer for Microsoft SQL Server for just $595 by purchasing the special RAD Bundle Edition (listed with the RAD products on the Dev Tools Price List).

    For UK customers you get DB PowerStudio Developer for £535 + VAT if bought with an Enterprise level XE product (instead of the current price of £660 + VAT)

    More information at http://www.embarcadero.com/sqloffer.

All this special pricing runs up to 31st March 2011

Thursday 3 March 2011

Old Blog Posts

I mentioned somewhere that I had a couple of faltering attempts at blogs in the past. I posted a few things, but the blogs died and disappeared off the web, so I lost them. This was a shame, as one of them was a vaguely detailed analysis of a tricky problem causing a VBScript overflow on some hardware, which was partly assessed with WinDbg. I couldn't remember how the situation progressed and was rather cross that I hadn't kept a record of the old blog posts.

And then I remembered the Internet Archive Way Back Machine.

And so now I have all my old blog posts back. I’ve popped them all in one of this blog’s pages over there on the right.

There are 6 old posts in all:

  • Conditional Defines, etc. from 19th June 2004. This post runs through various conditional symbols defined by various versions of Delphi, as well as the conditional constants defined in Delphi 6 and later. Various product release dates are also listed.
  • Pure evil? Me? from 19th June 2004 . A trawl through the guts of .NET’s WinForms to get a list of all the windows in a WinForms app, with masterful code from Embarcadero’s Roy Nelson.
  • Stories Of The Demise Of Brian's Blog Are Greatly Overstated from 26th November 2006. An intro post on a new blog I briefly started.
  • Shortcuts from 26th November 2006. Some useful Windows keyboard shortcuts and tips.
  • TechEd Developers 2006 from from 27th November 2006. A report from the Microsoft conference I spoke at.
  • Problems at Work from 20th December 2006. An analysis of a gnarly problem on certain hardware that resulted in an unexpected overflow message in VBScript.

Wednesday 2 March 2011

Home Computing Nostalgia

When I were a lad (to use the dialectal verb form preferred by some residents of the northerly parts of my country) the wide spread use of the the IBM PC or compatible was still some years away, so in my adolescent period the various home computers on the market (or 'games machines' as they more typically were) were rife among my crowd.

In the circle I hung out with most of the popular computer models were present: the Commodore-64, Commodore Amiga, Vic-20, Dragon 32, Camputers Lynx, Sinclair ZX81 and the Sinclair Spectrum. All fine machines for various reasons, although the choice of materials used to create the keys of the ZX80, ZX81 and Spectrum still baffles me. The ZX80 and ZX81 had odd clicky, flat membranous keys and the Spectrum had rubbery, squishy keys…

Anyway, I didn’t have any of those models – I had a BBC Micro Model B (aka a Beeb). This was Acorn’s successor to the Atom and predecessor to the Electron and was to be called the Acorn Proton until the BBC took the machine on with its BBC Computer Literacy Project and pushed it heavily in the education sector.

The Beeb was never the best at graphics in comparison to some of the other machines more directly targeted at games, although many of the published games pushed its abilities to the limits as time drew on.

I cut my teeth with the Beeb, learning about how computers worked, having fun with graphical games and text adventures, and doing the other thing that was so common back in the early 80s. There were lots of magazines targeting these computers and they all had lots of program listings, which the keen and patient would painstakingly type in to get another little game to play.

Typing in published game listings was very commonplace. Typos in published game listings were also very commonplace. These two facts led to two results. Firstly, I learned how to type reasonably quickly, albeit the hunt and peck approach with a small subset of fingers (alas, to my chagrin, I never did learn to touch type). Secondly, thanks to a Breakout game that I spent a long time typing in from an issue of Computer & Video Games, and then spent days if not weeks not only fixing the typos, but also fixing the logic problems, by the time the game was working I had read so much of the BBC BASIC manual and the system reference manual that I had morphed into a BASIC programmer. So poor proofreading turned me into a coder. An unexpected result.

I had quite a few games for the Beeb and was not really that good at many of them (possibly due to lack of time investment in them) other than Aardvark Software’s Zalaga (a re-make of the arcade game Galaga, penned by Orlando). Some of the games were text adventures (apparently now termed interactive fiction) and I wasn’t very skilled at completing those either. The one that occupied me the most was Acornsoft’s Countdown to Doom by Peter Killworth.

BootupRecently, as an opportunity to show old-school technology to the younger generation, I found the BBC emulator BeebEm (which is just one of several emulators available, but is the one I’ve been playing with). This is an awesome endeavour, completely emulating various machines in the BBC Micros series, including the Model B and Model B Plus as well as the BBC Master 128. It even supports the second processors you add onto the Beeb (65C02, Z80 or ARM).

Pac-ManThe emulator web site has links to sites with images of various old games, so immediately I was lost in my own teenage years, bouncing from classic game to classic game.

The Beeb was known for having various very faithful clones of arcade games released by the host software company Acornsoft. So for Pac-Man we had Snapper, Defender was Planetoid, Scramble was Rocket Raid, Galaxian was Arcadians, Frogger was Hopper.

EliteOf course there is the classic Elite (you can download it from the web site of one of the co-authors), which started life incomprehensibly squeezed into the Beeb’s paltry 32kB RAM. This set a new bar for games in such small devices and is said to be the title that set the mould for modern space flight simulation games. The idea was you were a space trader navigating around 8 galaxies each containing 256 planets. Between the planets you often were forced into battle with the Thargoids.

Zalaga
After all the colourful (and not so colourful) graphics I spent quite a few hours revisiting Countdown to Doom, finding the things I’d totally overlooked and then getting stuck again. I went through solving the puzzles, mapping the mazes, and collecting the ‘treasure’ initially on a PC version of the game I found, as the BBC version had some corruption and crashed out any time something unrecognised was entered.

DoomThen I worked out how to fix the corrupted line in the BASIC code and tried to replicate the solution there, only to find that the PC version was somewhat larger with more locations and items to collect and use. Either the low memory in the BBC put a fixed limit into what was possible to build in, or the game map was extended in the subsequent version coded for the PC. Also some of the commands had changed slightly, and multiple commands on one line were not available.

But now, after a break of around a quarter of a century, I have solved Countdown to Doom.

Twice.

Yay!

Next stop is to see how the Nintendo 64 emulators have come along. The last time I tried them out, Goldeneye didn’t play so well in 1964, but I should probably do a quick compare of the current version of 1964 as well as Mupen64Plus, Project64 and MESS.