Migrating a Project to Delphi Prism from Delphi.NET

As we know, now that the future of Delphi.NET is Delphi Prism (based on the RemObjects Oxygene compiler) we have to migrate our Delphi.NET projects to be compatible with the Prism compiler.

The Easiest way to get started is to look at the free Oxidizer tool provided on the RemObjects Wiki. The tool helps with the conversion of Delphi Win32 projects to Delphi Prism (but I’m uncertain about how it performs on Delphi.NET to Delphi Prism). The Wiki is also an excellent place to get started, particularly the pages on Delphi Win32 vs Delphi Prism which list the major incompatibilities between the two languages. 

 

Whilst converting my Delphi.NET Library for accessing Twitter, I encountered a few basic hints and tips which I felt I should share here:

  • You need to specify the namespace keyword at the top of your unit file instead of the unit keyword. The first time I tried to compile after doing this Prism still complained about not having a namespace keyword present, this was fixed by closing the solution and re-opening.
  • Delphi Prism automatically makes classes that are not explicitly marked otherwise as strict private. This meant that I had to go through my library and mark all classes that I wanted to make public. eg. TMyClass = public class(System.Object);
  • The overload keyword isn’t neccesary as overloading is now implicit. This isn’t a problem at all and isn’t dificult to fix as it simply meant doing a Search and Replace for the overload keyword and removing it.
  • TObject no long exists and instead needs to be replaced with System.Object which has much the same properties. 
  • I encountered a few problems with the use of for .. in loops. It would seem that Delphi Prism loop variables are local to the loop and therefore should be declared at the beginning of the loop (see the for wiki page for more info). In reality this meant changing: for strItem in list do to for strItem: string in list do and then removing the strItem: string; declaration in the method var section.

These are not the only changes that you will probably need to make but I found them to be a good starting point. You should definitely consult the Prism Wiki for help in which I was able to find answers very quickly (no wading boots required!).

Lastly: My project could do with a lot of refactoring in order to take advatages of the unique language features of Prism. This will take considerably more time as it means learning the new language features first!

Posted in .NET General, Delphi Programming, Development, Windows Development, codegear | Tagged , , | 1 Comment

Homecamp 08

 

A logo for homecamp, created by @ribotminimus

A logo for homecamp, created by @ribotminimus

I spent all day last Saturday at Homecamp at the Electrical Engineering building at Imperial College London. Homecamp is effectively a hack-day about Home monitoring, home automation reducing energy and energy resource requirements in your home.

Previous to hearing of the day, I had become interested in these subjects because I had seen Andy Piper’s Current Cost posts and the associated IBM’ers who had been doing some fantastic work on providing code libraries for accessing the Current Cost data. The CurrentCost unit is a great little electricity usage monitoring unit that is available to buy on eBay for about £40. Whilst a large amount of our discussion from that day did revolve around the CurrentCost unit, it was not the limit of our discussion in anyway (discussion around this was easy because it’s a cool little unit that is low-cost and easy to extract data from!).

 

The Day began with Dale Lane and Chris Dalby who had organised the day distributing name labels and wireless keys and asked us to give suggestions for sessions. We also had a quick word from James Govenor (@monkchips) who was generously sponsoring the event via his GreenMonk consultancy. 

The First talk of the day was from Andy Stanford-Clark who is a Master Inventor at IBM. As one might expect, Andy’s own house is a geeks dream (it even twitters!). Almost everything that can be is monitored and automated, even to the mouse traps that are set in his loft which text him or his family when a mousetrap is set off or the cheese used as bait has gone off. He measured his water usage by requesting a new meter which had a magnetised needle, thus allowing him to setup a device which gets a signal every time the needle rotates. Andy was also a big advocate of the MQTT protocol which he uses for client projects with IBM and as the central messaging service for his house works. MQTT is a Publish-Subscribe protocol which makes it ideal for things like the house networks that we were talking about. He also mentioned the use of X10 and ZigBee in controlling almost device or system in the house. You can see Andy’s full talk in the video that Andy Piper made.

Photo credit: Andy Piper

Photo credit: Andy Piper

Joe Short and Phoebe Bright then did a talk on Dynamic Demand. This is essentially about smoothing out the hour by hour and minute by minute variations in power demands on the national grid. This is important becuase peak time power requirements mean that power companies have to bring very expensive and very environmentally damaging types of power generator online. We discussed about how this requires social change and we discussed dynamic energy pricing as a method of bringing about this change. In Italy for example the government required dynamic pricing smart meters to be installed in every house. This means that people are rewarded for putting their tumble dryer (if you needed a tumble dryer in a hot country like italy!) on at 3am in the morning when electricity is considerably cheaper. The general message here seemed to be that we have limited scope for activity here until we can push suppliers for dynamic pricing. This will take some time but once this is done, you can for example program washing machines to automatically start when the national price of electricity is at it’s cheapest throughout the day (very cool).  

Dale Lane took us through some of the ways in which the IBM Hursley users of the CurrentCost units have been trying to address the social aspects of getting people to use less electricity. They have been working on a realtime site for sharing and contrasting data from their units and would like to start creating some XBox live style point scoring awards. This would mean awards for biggest 1 day improvement or lowest house rest point. 

We also had a talk from Nicholas O’Leary who gave an interesting talk about the potential for Arduino use in the home. The Arduino is an open-source electronics platform that allows the flexibility to program and build low cost sensor inputs (light, heat, magnetic etc) to interact with a number of outputs. Nick showed us an ambient orb that he had built to show the amount of power his house is using at that particular moment. It glows green, yellow or red depending on whether the house electricity usage falls within certain limits. You can buy arduino units and shields from a number of sources but I am planning on getting a starter kit which should be back in stock soon at tinker.it

There was discussion in both Andy’s talk and Nick’s talk about how you could end up consuming more power by measuring and monitoring your home by the time you’ve got a server plugged into all manner of electrical monitoring devices. We discussed the Viglen MPC-L device which runs on a rediculously small amount of electricity usage (there was some discussion of costing you approx £10 per year on electicity usage). The Arduino can be powered with a normal 9V battery.

 

We also had a presentation from the Patchube (Patch-U-Bay) folks who were explaining about how you can get data in to the site and the various ways you use and share that information. I could see a lot of potential for this site but first I need to generate some data to share!

 

Photo Credit: Andy Piper

Photo Credit: Andy Piper

Overall I had a very inspiring day and met some extremely interesting people from all manner of backgrounds, interests and areas. It was nice to meet so many people who I had interacted with on Twitter and some who I had never met before but whom I shall certainly be looking forward to meeting again soon. I will be ordering all sorts of kit to play with as a result of the talks given at Homecamp and so the day will almost certainly cost me a lot of money in gadgets and time in the future but at least I will have a lot of fun doing it! The first thing I will be doing is writing a native Delphi library for the CurrentCost unit and contributing that to the Google Code Repository. There is another Homecamp planned for March which I hope that I will be around for again and this time able to contribute some ideas and projects towards it.

 

Thank-you to Chris Dalby, Dale Lane and James Governor for their work in setting up the day and to everyone who presented or otherwise contributed to the day. I can’t wait to share what I do as a result of the inspiration that the first day gave me!

Posted in Home Automation, Home Monitoring, Miscellaneous, Much ado about Nothing, Windows Development | Tagged , , , | 2 Comments

A New Beginning for Delphi

Delphi programming is currently being rejuvenated on so many different levels. I was pleased to see that in the November 2008 TIOBE Index of Programming Languages Delphi shot up to 8th place (only .020% behind c#). I believe that this is partially on the excellent efforts of my good friend Jim McKeeth whose community herding has helped out Delphi community to become more visible (”Delphi Programming” is simply not a phrase we were used to using!) and partially because of the excellent reviews and community noise that Delphi 2009 is receiving!

Delphi Prism was announced finally at the Microsoft PDC where we discovered (or some of us) that Delphi Prism is the new Delphi .NET Development solution which drops the slightly crippled compatibility approach that Delphi used to employ and instead fits within the Visual Studio IDE. Delphi Prism now supports all the latest and greatest .NET technologies including WPF, LINQ and Various Language methods. They’ve achieved this by making use of the extremely cool RemObjects Oxygene Compiler which I would highly recommend that you investigate right away if you’re interested at all in .NET Development! I will be doing a post soon to discuss some of my favourite new Delphi Prism language features!

 

This rejuvenation of Delphi is causing a product marketing effect and is slowly gathering momentum and I fully intend on doing whatever I can to generate enthusiasm for the Delphi Programming Community. This concept of User-led marketing has been widespread for many years as Apple fans will testify. As part of this I have a new project in mind for the Delphi community and will be explaining this in due course. I will certainly require Delphi enthusiasts to help with this venture, if you’re interested then please contact me.

Posted in .NET General, Delphi Programming, Development, codegear | Tagged , , , | 2 Comments

Delphi Man to the rescue

As part of my efforts to try to help Jim Mckeeth’s push to get Delphi Programming the recognition that it deserves I recently dug out a copy of my orginal Borland Branded “Delphi Man” Super Hero. If you haven’t already got him then I would encourage you to print and cut out a copy for your desk. Mine has been sitting on my desk for a good few years and needed backing in cardboard to prevent him from drooping. (who wants a drooping super hero anyway! ;-) )
I have also been maintaining a repository of links mentioned or used on the Podcast at Delphi.org on my ma.gnolia.com page. The group for Podcast at Delphi.org links can be found at:

http://ma.gnolia.com/groups/podcastatdelphi

This allows you to get them in RSS form or view links by episode if you missed any from the podcast. I shall slowly be increasing the amount of Delphi content on this blog and have plans for quite a few things (including finding a more suitable theme!).

Posted in Much ado about Nothing | Leave a comment

Delphi 2009 is a rising star!

Many programmers keep a loose eye on the TIOBE Language Index table which gives an indication of the popularity of programming languages based on the results returned using the Google, MSN, Yahoo!, and YouTube search engines. This index is not without its controversy and the index and ratings are calculated on debatable terms however it is what it is. After Borland began to destroy spin-off delphi and Codegear the ratings dipped to an all time low.

However as the seasons change so did Delphi’s fortunes. The Delphi programming index has been rising which may or may not be related to the much improved Delphi 2009 release. Whilst we can only draw very haphazard conclusions as to what this means but in my mind it can only be a good thing in so far as it will give Delphi a much needed PR Boost.  

 

As a keen examiner of this raise Jim McKeeth of the excellent Podcast at Delphi.org has been urging the community to ensure that the search terms for which the TIOBE Index is measured on +”<language> programming” is reflected in the bulk of delphi sites. This is a very good cause and I would join Jim in urging all Delphi Programmers to update their blogs and delphi related sites to include the phrase “Delphi Programming” where suitable. This is not an attempt to game the system, we’re merely encouraging people who have a delphi related blog/site to make sure that it is counted as part of the community.

 

Jim has also discovered that Delphi has been put on a shortlist to be the TIOBE language of the year which would be a great coup for the community. I feel that since CodeGear found a new home with Embarcadero they have really taken on a new lease of life as we’re seeing: 

  • Increased Blog Activity
  • Increased Roadmap visisbility
  • Massive changes in product strategy
  • Less “Red Tape” surrounding what CG staff can talk about

I genuinely feel that we can start to make a fight back for Delphi and see if we can get some new life in the community!

Posted in codegear | Tagged | Leave a comment

A Lesson in Customer Support?

When customer service startup GetSatisfaction first launched I was initially skeptical. It seemed like a good way of leaving customer support requests to be solved in a peer-supported way allowing you to provide little or no official support. However, it soon began to pickup larger support products such as Twitter which still seems to be it’s most active support area (not hard given the scale of twitter’s recent problems). I still couldn’t actually see how it was solving support requests until recently.

 

My new Blackberry Bold recently arrived and whilst I shall leave the full review to another post but so far I think it is by far the best phone that I have ever used.

Blackberry Bold

Blackberry Bold

However, when I first set it up, many of my applications were complaining of no Blackberry Internet Service which caused Blackberry Maps and some other applications to fail. By the time I discovered this it was a weekend so I couldn’t call the support line and go though the usual repeat 10 times “is it turned on sir?” and “do you have reception right now” before getting through to someone who maybe understands the issue. So I googled for the error and found a thread linked on the new Vodafone support e-Forums.

 

Wow. After a tiny amount of searching I found that the problem appeared to be linked with new Vodafone BB Bold’s being misconfigured in their factory configuration process by RIM. Many of the posters claimed that they had phoned the Vodafone support centre many times and were left with a helpless feeling that none of the operators understood the issue. This is a feeling that I’m almost certain you will have all felt before - that support centres are often not that helpful beyond reading you a list of general troubleshooting procedures from their internal support site. 

After reading the thread I registered myself on the forums and posted to the thread asking for help at about 12:35AM on Saturday night. By 08:04AM on Sunday morning there was a response from an official member of the Vodafone e-Forum team saying that I should check my email for the first steps towards help. After going providing them some account and security information as well as confirmation of the problem they got back to me first thing on Monday morning and by 9:00AM Monday morning, my BIS problems were sorted.

This whole experience left me with a great feeling of satisfaction surrounding the help I was given. Whilst this form of customer service will certainly not appeal to time-sensitive queries or to businesses, I found it to be my most gratifying customer service experience for a long time! Thank-you to the Vodafone eForum team and I truly hope that this service has enough support internally, I will certainly be writing to Vodafone to provide feedback on this service! 

 

Whilst these types of support forum contain the same types of poorly specified, badly spelled and possibly over-expletive filled posts that any forum contains, what amazed me was that without exception the team were very calm and were usually able to provide resolution. The eForum at Vodafone is a venerable gold mine of well researched information from official Vodafone staff members. No flim-flam answers about expected handset release dates, queries on phone unlocking (a contentious issue for networks) and even suggestions for gettign the most out of your plan or phone (the only way I found the fantastic BetaVine site) can all be found on the site.

Posted in Mobile Development, apps-i-love, mobile telecomms | Tagged , , | Leave a comment

Yet Another iP***** post

I realise everyone is sick of hearing about the iPod Touch / iPhone version 2 firmware updates however I felt that I would happily ignore that so I could share a few things with you. About 36 hours after reading about various iPhone users receiving their updates via links sent over twitter I noticed the little box on the iTunes store offering the upgrade for iPod Touch users. After paying £5.99 I was able to download the update which weights in at about 300Mb (not small) and requires backup, wipe and then restore operations on your iPod before it is complete.

My initial impressions of the AppStore are pretty good, the process is very smooth and the Applications that are currently available seem to be of a pretty good calibre. A Couple of things still annoy me immensely about the whole iPod/iTunes operation and the first is that it still requires a long and painful snyc of everything, even when I’ve only added a single app. The Second is that iTunes is so determined to send me an invoice email even for songs, applications and videos which are absolutely free, there is already so much unnecessary email in the world, why worsen the problem!

After the update and small reboot, I was greeted by the welcoming icon of the AppStore being added to my homepage where I promptly set about adding 4 of my most desired applications.


The ones that I have added so far are:

  • Facebook application - The only notable features of this is that it allows you to chat to facebook chat users via the application, this would be incredibly useful (or annoying) to an iPhone user. The other notable feature is the addressbook facility which for some (most of my friends don’t keep their number on there) would be extremely useful to an iPhone user.
  • Remote Application - Does what it says on the tin: Allows you to control iTunes remotely. Amazingly useful if not a little buggy sometimes!
  • Twitterific - Currently the only Native twitter client which is annoying because the interface is confusing and frustrating.
  • NetNewsWire for iPhone - The iPhone RSS client produced by Brent Simmons of Newsgator who created the best RSS Reader for macs by the same name. This syncs all my news and feeds with FeedDemon, My Blackberry client and every other Newsgator client that I use. Utterly useful.

NetNewsWire for iPhone

The only problems that I encountered where a slight problem with Syncing my NNW feeds from Newsgator. If you are having problems with NNW hanging then goto Newsgator online and reduce the number of feeds that the iPhone version is subscribed to. It’s not a problem for me because I certainly don’t want all my feeds clogging up my iPod and would only want to read a slightly smaller subsection of my total feeds.

I haven’t yet paid for any applications but as I’ve just been given a nice shiny iTunes gift voucher I suspect that I will branch into some of those ones very soon.

Posted in Development, Mobile Development, Much ado about Nothing, apps-i-love | Tagged , | Leave a comment

iTunes Movies finally reach the UK

iTunes movie rentals and purchases finally reach the UK market. Until now they had only been available to other countries such as the US. The prices are, at first glance, terrible. £2.49 to rent movies and £6.99 to buy the movie. One of the titles available is Team America: World Police

Team America: World Police

This DVD can be bought brand new from Amazon.co.uk for £4.98 or used for £1.98, this means that even with postage and packaging on a single purchase you can still beat the price that iTunes is selling it to you! There seems to be a very limited range of titles including newer titles such as Batman Begins which still seems to be overpriced when compared to buying brand new from Amazon. Do not forget that buying from Amazon also gets you a hard-copy instead of the (possibly self-destructing) DRM’ed copy that you download from iTunes UK.

When compared to my subscription with Amazon DVD rental (now transferring to the UK market leader LOVEFiLM) the iTunes offering still seems overpriced. By my calculations as long as I receive more than 2 films per month (I currently get about 5-6) the mailed film borrowing seems much cheaper, as well as giving me a greater choice of films. I know that there are additional advantages to the iTunes service here (such as it being on-demand) but the price raise isn’t enough to convince me to give up my subscription yet.

Additionally, it would seem that some films (presumably with distribution restricted licenses) are available for either Rental or Sale only which seems a little discouraging if it is one of the films that you really want to watch or buy.

I shall wait until I have tried out the store before I decide on whether I will be using iTunes or not but at first glance it would appear that the pricing is severely discouraging when compared to other comparable services.

Posted in Miscellaneous, apps-i-hate | Leave a comment

CAPTCHA My Cat

Simply terrible. This is a sample of a CAPTCHA shown to users of German file-sharing service Rapidshare. In case you skipped over the first part (as I did at first) to enter the letters shown, you’d be wrong. You have to work out which letters are hiding a cat and which ones are hiding a dog and only enter the ones with a cat.

Captcha from hell?

A CAPTCHA is a program that protects websites against bots by generating and grading tests that humans can pass but current computer programs cannot. The idea behind such a device is to prevent scripts, spammers, search engines and other unwanted automated visitors from getting behind your page, the most visited sites on the internet implement some kind of CAPTCHA (yahoo, facebook, myspace, hotmail, gmail etc).

Sounds sensible does it not? It is highly sensible except that it has developed into an arms race of sorts as news of the recent crackings of Gmail’s Captcha, Yahoo’s Captcha and frequent crackings of Hotmail’s Captcha show. What this means to the end user is that CAPTCHAs increasingly get harder to solve. Facebook was caught out by a particularly unfortunate CAPTCHA bug as shown below.

Unfortunate

There are various alternate solutions being banded around such as Client Side Javascript CAPTCHAs and verbal reasoning (via 37Signals) tests. The prize for most imaginative so far has to be the image based effort by alipr.com which can be quite to be dificult to grasp the concept of first time around.

I don’t think any of the above efforts have yet proved to be a viable replacement and sadly I can only see the arms race waging on for a couple more years yet. Still RapidShare has sucessfully implemented the worst CAPTCHA I have ever had to deal with on a regular basis so far! Where will the madness end?

Posted in Much ado about Nothing, Web2.0 | Tagged | 1 Comment

Spend time viewing photos?

I spend a great deal of my time on the internet browsing my friends photos, its one of the primary uses of social networking sites such as Facebook and Flickr. I do sometimes wonder if even this simple function is too painful when having to wade through paging or search function however this is a problem that Danny Thorpe, Ex Chief Compiler Dude at Borland, has been working to address. He now works for a company called CoolIris where he works on a product called PicLens which is a browser plugin for IE/Win, Firefox/Win, FireFox/Mac and even Safari/Mac that enhances your photo browsing experience.

Once installed PicLens places a small translucent play button over photos on supported sites when you put your mouse over them. Supported sites include:

Photo Sites Social Networking Image Search
Flickr
Photobucket
Picasa Web Albums
DeviantArt
Smugmug
Facebook
MySpace
Bebo
Hi5
Friendster
Google Images
Yahoo Images
Ask Images
Live Images
AOL Images

It also supports any site which uses the mediaRSS format. Once activated the PicLens plugin opens up a fantastic full screen app for viewing photos. Danny recently announced version 1.6 which includes a fantastic new feature called “the wall” which displays your photos in all their glory in a 3D environment allowing a fun and very easy way to skip through a photostream as shown below in the screenshot I capped of my own photostream.

piclens.jpg
I would highly recommend that everyone downloads this plugin, I have never found a more pleasurable interface to browsing photos. Rendering is smooth and satisfying and I wish to congratulate Danny and the team for their excellent work!

Posted in Development, Web Development, apps-i-love | Tagged , , , , | Leave a comment
Twitter Logo

From jamiei

    Photos

    Flickr Logo
    www.flickr.com