Pages

Thursday 24 November 2011

Windows Service Gotchas

  • the current directory is not the location of the executable, it’s System32! But that’s easy to change.
  • anything logged to the console will be lost. You can redirect anything you output with System.Diagnostics.Trace. That includes for instance the internal debugging output from log4net (useful when you don’t know why your service is not logging anything).

Quoted from log4net documentation:

 

There are 2 different ways to enable internal debugging in log4net. These are listed below. The preferred method is to specify the log4net.Internal.Debug option in the application's config file.

  • Internal debugging can also be enabled by setting a value in the application's configuration file (not the log4net configuration file, unless the log4net config data is embedded in the application's config file). The log4net.Internal.Debug application setting must be set to the value true. For example:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <appSettings>
            <add key="log4net.Internal.Debug" value="true"/>
        </appSettings>
    </configuration>

    This setting is read immediately on startup an will cause all internal debugging messages to be emitted.

  • To enable log4net's internal debug programmatically you need to set the log4net.Util.LogLog.InternalDebugging property to true. Obviously the sooner this is set the more debug will be produced.

Internal debugging messages are written to the console and to the System.Diagnostics.Trace system. If the application does not have a console the messages logged there will be lost. Note that an application can redirect the console stream by setting the System.Console.Out. The Trace system will by default send the message to an attached debugger (where the messages will appear in the output window). If the process does not have a debugger attached then the messages are sent to the system debugger. A utility like DebugView from http://www.sysinternals.com may be used to capture these messages.

As log4net internal debug messages are written to the System.Diagnostics.Trace system it is possible to redirect those messages to a local file. You can define a trace listener by adding the following to your application's .config file:

<configuration>
    ...
    
    <system.diagnostics>
        <trace autoflush="true">
            <listeners>
                <add 
                    name="textWriterTraceListener" 
                    type="System.Diagnostics.TextWriterTraceListener" 
                    initializeData="C:\tmp\log4net.txt" />
            </listeners>
        </trace>
    </system.diagnostics>

    ...
</configuration>

Make sure that the process running your application has permission to write to this file.

Tuesday 22 November 2011

Your Home Address on the Web

image

 

I’ve always thought privacy concerns over Facebook were exaggerated -they usually come from your parents who have been publishing their home address and phone number on the white pages for decades anyway. There is much much worse.

The mere act of voting in the UK ends up in having your home address published on the web.

If you registered to vote on the Electoral Roll and ticked the wrong box, the one with the confusing caption, something like “tick here if you don’t want your details to appear in the private listing”, then all your past addresses are on the web, year by year. Yippee!

It’s not just your home address, but also the list of people who lived with you. That must be the most blatant breach of privacy I’ve ever seen. It’s like Facebook for flatmates with privacy settings set to ‘Everyone’.

Look at this. Only the first part of the postcode is available. To get the full info all you have to do is register at 192.com.

Tuesday 1 November 2011

Currently Reading or Watching…

Sunday 16 October 2011

TeamCity, msbuild and Version Numbers

How to automatically set all your solution’s projects to the same version number with msbuild and TeamCity?

We have a number of solutions mixing native and managed projects.

The mechanism we use to ensure all DLLs and EXEs have the same version number relies on modifying 2 files:

  • A VersionInfo.h file for native projects
  • A VersionInfo.cs file for managed projects

The .h file contains something like this:

#define PROJECT_VERSION 3,9,0,1234
#define PROJECT_VERSION_STR “3.9.0.1234”

All native projects in the solution have a resource file (.rc) that includes this unique VersionInfo.h.  This is how the exe/dll obtain their version info.

On the .NET side, the VersionInfo.cs file contains:

[assembly: Assemblyversion(“3.9.0.1234”)]
[assembly: AssemblyFileversion(“3.9.0.1234”)]

All managed projects in the solution compile this VersionInfo.cs file (using a soft link, no duplication necessary).

So all we have to do in order to ensure that the 30+ binaries have exactly the same version number is to get our build script to modify the .h and the .cs just before building the solution.

Sounds easy!

Then there is the question of where to store the “3.9.0.1234” version. It should be in one single place of course. An obvious choice seems to be the TeamCity build number.

From Major.Minor.Build.Revision, we can set Major.Minor.Build by hand in TeamCity and have the Revision set automatically to the current SVN revision number, which is a handy way to relate builds to SVN revisions.

In the TeamCity project settings, the build number format field looks like this:

3.9.0.%build.vcs.number.MyProject_SVN_Root%

ScreenHunter_01 Oct. 15 18.37

Then within our msbuild XML file we refer to the build number set in TeamCity like this:

$(BUILD_NUMBER)

The following msbuild lines update the version number stored in the VersionInfo.cs.

    <FileUpdateFiles Files="VersionInfo.cs"
      Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)"
      ReplacementText="$(BUILD_NUMBER)"/>

This regex does wonders to replace “1.2.3.4” with “3.9.0.1234”. But now, more tricky: when doing the string replace in VersionInfo.h (it’s always the native projects that cause trouble Winking smile), how do you replace

#define PROJECT_VERSION 1,2,3,4

with

#define PROJECT_VERSION 3,9,0,1234

given the string in $(BUILD_NUMBER) “3.9.0.1234”.

Can’t do anything a bit subtle with msbuild without having to download and install third-party tasks… So I’m currently looking into the TextString task from the MsBuild Extension Pack to tokenise the version string and then concatenate it back to the appropriate format. It’s all a bit complicated, there must be an easier way to do this…

Update (16/10/2011):

It’s actually not that bad, here is the code that formats $(BUILD_NUMBER) and updates the .h /.cs VersionInfo files.

    <TextString TaskAction="Replace"
                OldString="$(BUILD_NUMBER)"
                OldValue="."
                NewValue=",">
      <Output PropertyName="FormattedBuildNumber"
              TaskParameter="NewString"/>
    </TextString>
    <Message Text="Replacing version in VersionInfo.h with $(FormattedBuildNumber) and $(BUILD_NUMBER)">
    </Message>
    <FileUpdateFiles Files="VersionInfo.h"
      Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)"
      ReplacementText="$(BUILD_NUMBER)"/>
    <FileUpdateFiles Files="VersionInfo.h"
      Regex="(\d+)\,(\d+)\,(\d+)\,(\d+)"
      ReplacementText="$(FormattedBuildNumber)"/>
    <Message Text="Replacing version in VersionInfo.cs with $(BUILD_NUMBER)">
    </Message>
    <FileUpdateFiles Files="VersionInfo.cs"
      Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)"
      ReplacementText="$(BUILD_NUMBER)"/>

Tuesday 4 October 2011

Getting Ready For FOWA London 2011

This is the schedule for tomorrow’s first day of FOWA (Forum of Web Apps) at the Brewery between Shoreditch and Whitechapel.

http://futureofwebapps.com/london-2011/schedule/

Wednesday 28 September 2011

Body of Lies

I just saw Body of Lies by Ridley Scott. At minute 1h38’ there is a scene where Di Caprio talks on the phone to the bad guys who kidnapped his girlfriend. The call is recorded so to make that obvious to the audience, there is a massive old-school tape recorder spinning in the background. Cell phones, drones and satellites… You can never go wrong with good old reel-to-reel tape recording.

Sunday 25 September 2011

I Own a Domain Name I Can’t Use!

Checkout2

I bought a domain name through Blogger a few months ago, got my receipt through Google Checkout and went on holiday. The Google Checkout receipt has a link to retrieve the Google Apps account to manage the domain: that link doesn’t work any more and the domain does not appear in Blogger.

My domain fell into a black hole: I can prove I bought it, but I can’t use it!

Saturday 10 September 2011

Fire-proof Software #2: Designing Fault Tolerant Systems

OLYMPUS DIGITAL CAMERA

Follow-up from part 1.

This is a few of the failure conditions we see with real production software, along with some approaches to deal with them. The general idea is to define activities.

  • Each activity is a unit of work that may either complete or fail and that can be retried if necessary.
  • An activity has a start and an end, as well as a status (Complete/Failed).
  • An activity also has success criteria that allow a process to check the activity actually completed.

The database contains a schedule of those activities along with a MaxRunTime value and a flag indicating if it's currently running. The MaxRunTime allows processes to spot an activity that timed out.

Input data not available (Failure of one of the upstream systems)

You can’t bet on the fact that upstream systems will work, regardless of the reason why, they will fail. There is no point trying to imagine the reasons behind the potential failure, what matters is the impact of the failure on your system and on the business.

  • Have a retry policy for each activity (retry period + retry window)
  • Use a stale version of the data (previous day for instance) if acceptable with the business.

Notification not available

  • Back-up the notification mechanism with an activity schedule: an activity should automatically start at a defined time if it hasn’t already.
  • If an activity has already started following a notification, the DB flag in the activity schedule table will guarantee that it doesn't start again.

Process crash

  • Have a Windows service detect the process crash and restart the process.
  • If the process crashes following an unhandled exception, the currently running activity will be automatically marked as failed. When the process starts again it should attempt to schedule or start the failed activity.
  • If the process is simply killed with no opportunity to mark the current activity as failed the activity will still appear as running in the ActivitySchedule. When the process starts again it will see that its activity is currently running and will simply schedule a check at StartTime + MaxRunTime. Obviously the check will fail and the process will restart the activity.

Process stalls

  • Kill it with a watchdog thread: this is a pattern used by embedded systems on real-time OSs to reset a stalled CPU. Inside the app server process the main thread –the one that does all the work- should periodically reset the watchdog flag. If the watchdog flag is not reset after a defined period of time the watchdog thread kills the process after failing the current activity.

Server down or unreachable

  • Use 2 servers, one primary and one backup.
  • Each server runs identical processes scheduling the same activities. Both processes will attempt to start their activity at the same time however the ActivitySchedule table in the DB will allow only one process to actually start the activity.
  • If one server goes down, all processes will simply attempt to reschedule their activities upon restart.
  • If one server goes down while an activity is running, the activity will still appear as running in the ActivitySchedule. Upon restart processes will see the activity is marked as running and will schedule a check at the expected completion time.

Database not available

  • Avoid maintaining a single DB connection for too long, that reduces the opportunities of the system to reconnect.
  • If you can detect the connection failure and don’t want the complexity of implementing a retry mechanism, at least fail the current activity to take advantage of the activity’s retry policy.

Saturday 3 September 2011

Sink-Proof Software #1: Designing Fault Tolerant Systems

OLYMPUS DIGITAL CAMERAMiddleware Enterprise apps usually do straightforward things: they pump data from here, crunch it a bit, dump it there. Complexity comes from the variety of data sources, their reliability and more importantly how much availability (up-time) the business requires.

Say you write an app that processes a daily list of financial instruments to perform a Present Value calculation. What if the input data is not available, i.e. if that list of instruments is not ready? Do you raise a critical fault and give up? Do you use a stale list of instruments? Do you wait a bit and retry? How long should you retry, should you retry forever until the list is available or is there a point where you should give up? Should the retry period be constant or should it increase exponentially to save resources?

What if one of your processes was waiting for a notification from another system and that notification was never received?

What do you do if a process crashes because of an unhandled exception, an out-of-memory exception or a third-party library bug? Is there a system in place to restart the process automatically? Does it take over its task where it left off or does it restart from scratch?

What do you do if a process stalls? Because of a blocked DB call for instance, or some synchronous API call that never comes back…

What if that process was handling client requests? Do you have a backup process to handle the requests while the primary process recovers? Can the system handle a down time?

What do you do if the entire application server goes down either because an engineer tripped on the power cable, the server room was flooded by hurricane Irene, a plane crashed on your main datacentre, the datacentre's power supply failed or there is no more network connectivity to the datacentre?

What do you do if the database is not available for some time? Do you store data in memory temporarily? Do you detect it and try and reconnect or do you just fail on all subsequent DB calls? Do you reroute the DB logging to log files so that logs remain accessible?

Thursday 18 August 2011

Do I need this config file?

Config files are all over the place with .NET: WCF, Log4Net, everything comes with an XML config file even if you didn't ask for one.

But when you think about it, why do you need config files really? Usually that's because you want to change some behaviour without having to rebuild the code. Ok. But what is so bad about rebuilding the code?

In the Enterprise world if you intend to make a change to a config file in production, you’re not going to just change the file on the production server (unless you're Jack Bauer and you have a death wish after your wife was murdered). You're going to make the change in the staging environment first then test it. If the system didn’t collapse then you'll raise a change request, have it approved by change management and eventually release it in prod. Well now compare that with rebuilding the code... mmm? Same amount of hassle, you'd have to go through the same steps anyway.

I find the main benefit of config files in Enterprise server apps is to ease the pain involved in moving from development to staging and from staging to production. This is where the config files are really useful because you have one code base for many environments. Connection strings, timeout values, environment identifiers, log file paths, simulated dates, weekend definitions, job start times, retry windows, SMTP servers, Tibco RV transport settings... They all depend on where you run the code from.

Friday 1 July 2011

Using Mobile Broadband in Europe with Huawey Mifi

Blog 2011-09-03 001 (478x640) (373x500) (224x300)I was in Singapore recently and used the little Huawey with a local SIM card to get mobile internet for the iPhone, iPad and Vaio.

To do the same in Europe, I’m trying out MaxRoam. You pay 10 Euros for the SIM card then you top it up as you go.

Steps:

  1. Buy the card
  2. Activate it on the MaxRoam website
  3. Insert the SIM in the Mifi device
  4. Plug the Mifi device to your PC over USB
  5. Install the drivers located on the Mifi. This also creates a little shortcut on the desktop.
  6. Launch the shortcut that opens the configuration page of the Mifi.
  7. There you can unlock the SIM by typing its code and specify the MaxRoam APN details.
  8. The MaxRoam website tells you how much you have left on your account and lets you top-up.

Thursday 26 May 2011

UK tech.days Day 3–Client Apps

The last day was all about writing Windows GUIs.

UKTechDays 2011-05-25 001During the intro Mark Quirk listed the technologies currently available for building client apps. He gave his personal recommendation about which one to choose: “if you’re not sure which one to go for give a try to Silverlight and see if it works for you.” When he asked “show of hands, who here has written code in Silverlight?” most of the attendees in the packed room raised their hand (I didn’t).

Amazing how Silverlight has quickly moved from something that was rather niche to a mainstream Windows technology. Now it is the toolkit you use by default when you don’t have a compelling reason to use any other (a bit like MFC 15 years ago). What used to be just a cut-down version of the .NET framework for browser plug-in is now much more…

Mike Taulty went over what’s coming in Silverlight 5:

  • access to low-level XNA APIs for 3D graphics
  • video: playback rate control and pitch correction
  • the client networking stack is faster and was moved to its own thread.
  • faster app startup through multi-core JITing
  • faster XAML parser
  • WS-Trust support for SAML security tokens
  • support for multiple top-level windows
  • trusted browser application: if you sign the XAP you can run an in-browser Silverlight app in fully trusted mode and therefore be able to do nasty things such as P/Invoke…

Impressive… One by one the limitations associated with Silverlight are going away.

Laurent Bugnion talked about MVVM, showing a solution where 3 projects (Silverlight, WPF and Web) were accessing the same service. Some videos of his previous talks here and here.

Wednesday 25 May 2011

Windows Phone 7–Day 2 of UK tech.days

UKTechDays 2011-05-24 002

If (Developpers.Happy()) return OnInvestment;

Today’s track was all about Windows Phone 7.

Brendan Watson talked about the Windows Phone Marketplace.

There are currently 17000 apps registered in the market place. The average selling price of an app is $2.93.

The Nokia deal will bring more carrier partnerships with countries where it’s difficult to get into (China for instance).

You can currently create apps in 30 countries but sell them in only 16. This number is expected to go up to 35 by the time Mango comes out.

Something clever about the market place: devs have the possibility to initiate beta testing programs.

Most of the other talks centred around UI design and performance. We heard a good number of tips and tricks from coders who faced specific performance issues when building apps and showed how to solve them.

Gergely Orosz described how his team spent a month discussing how Cocktail Flow would look like, building photoshop prototypes.

  • small team, rapid prototyping and iteration.
  • full visual plans with Photoshop and Flash. Several iterations.
  • found inspiration in design guidelines for Windows Phone (MSDN)…
  • …and YouTube videos of app demos

Some of his graphic design tips:

  • You don’t have to stick with black (even if this is the default for most apps)
  • Use images in menu items. Square images with grey frame look good.
  • Use non dominant background images
  • Keep dominant images for headers
  • Spice up the buttons with gradients or different typo

Quotes from Gergely:

“Allow your designer gene to come out”

“Content is king but don’t ignore the chrome”

Oren Nachman gave lots of tips to optimise performance:

  • Don’t use the ProgressBar control that comes out the box. It’s jerky. Instead use the PerformanceProgressBar from the Silverlight Toolkit.
  • Enable RedrawRegions flag in debug mode to make it obvious when Silverlight is redrawing regions for no reason.
  • Use the CacheMode property (on the WrapPanel for instance) to put images on the GPU and avoid redrawing them.
  • Alternatives to the current ListBox: LongListSelector, LowProfileImageLoader

Also Oren mentioned that in the coming Mango release,

  • the ListBox was completely revisited and will be faster.
  • Networking: HttpWebRequest will take place on a background thread.

Tuesday 24 May 2011

Overview of HTML5 – Day 1 of UK tech.days

UK Tech Days

It’s day 1 of UK Tech Days at the Vue cinema of Fulham Broadway where I attended the Web track.

I heard a number of talks today, one of them about HTML5 by Bruce Lawson.

HTML5 is an on-going effort and is not yet complete but lots of bits can already be used now.

In 1999 the W3C decided that HTML was finished and that the future was XML with XHTML1. Then it started planning XHTML2 where a lot of importance was given to language purity. No one cared.

Following work initiated by Ian Hickson with WHATWG, W3C decided to start working on HTML again and created HTML5. XHTML2 was eventually deprecated. So how come did HTML5 prevail on XHTML2? Bruce said:

  • it’s backward compatible with existing websites and
  • it’s more tolerant to error handling: the spec precisely defines what to do when markup does not validate.

The design principles that guide HTML5 are based around:

  • the 80/20 rule and
  • the belief that users are more important than authors, authors are more important than theoretical purity.

Other technologies not part of HTML5 but often used together: SVG, geolocation and CSS3.

HTML5 defines markup elements but also many JavaScript APIs.

HTML5 introduces the commonly used <div> as proper elements that actually mean something (header, footer, side bar). This makes it easier to build accessible apps because the browser can immediately identify the footer, the header, the side bar…

It also standardises some commonly used input forms (such as date pickers for instance) with the <input type=”…”/> element.

The <video> element displays play/pause controls on top of the video, works with many formats and remove the need for a plugin.

Media queries allow you to define several files with various resolutions depending on the capabilities of the device.

The <track> element shows subtitles over a video. The subtitles are in plain text therefore searchable and you can define several languages.

Other features:

  • detection of connection loss
  • offline application cache
  • server-sent events (to avoid polling)
  • web sockets

Good quotes by Bruce:

“HTML5 wants you to go to the pub”

“Nobody likes their bits to be in a black box, everybody likes their bits to be manipulated”

Wednesday 18 May 2011

Upgrading from iPad1 to iPad2

It’s a bit thinner and a bit lighter, the screen is a bit brighter but nothing very spectacular.
The most striking difference is with the app start-up time. All apps that take a little while to load initially, such as BBC iPlayer, Google Earth, Friendly, Evernote, the New York Times, MobileRSS, BBC News all take less time to start-up on the iPad2.

And it's a bit more slippery as well when handled bare.

Facetime on a tablet is fun (although the image quality for the other party is better when using the iPhone 4, because the iPad2 camera is so poor). 

Monday 16 May 2011

The New Safari Books Online app for iPad!

 

IMG_0005

At last!!! The reason why I bought an iPad in the first place! Being able to browse the wonderful Safari Books Online library from the iPad and download entire books for offline reading in the tube.

Last year O’Reilly released a first version of Safari To Go that was one of the worse apps on the planet at the time. They removed it from the app store less than a month after release.

So far the least worse way to browse the books from an iPad was to use the full web front-end, which wasn’t too bad with a browser supporting full-screen. But reading a book on the web was sluggish: you had to wait every time you clicked the next page, offline reading was not possible so no way to read in the London tube.

Version 2.0.1 of Safari To Go is a proper native iPad app that uses the whole screen and allows you to touch swipe between pages (compare that to the wasted space and sluggish web feel of version 1.0).

When flipping pages you have access to a very handy pop-up Table of Contents (I wish iBooks had that).

Table Of Contents

You can cache the entire book you’re currently reading. This is a very useful functionality that even the web front-end did not allow: all you could do with Safari Books Online was download individual chapters as PDF. Because there was a limit on how many chapters you could download each year you always had to think twice before downloading an entire book. That made offline reading very tedious.

Saving a book for offline use looks like this:

Offline Bookbag

Saving Offline Bookbag

Sunday 8 May 2011

Conferences List

 

Conference When Next Where
FOWA Miami February   Miami
SXSW March   Austin
DevWeek March   London
Qcon March   London
DevTeach March   Toronto
MIX March April 12-14, 2011 Las Vegas
VBug4Thought April   Midlands, UK
Microsoft Tech Days UK April May 23-27, 2011 London
Future of Web Design May May 16-28, 2011 London
FOWA Dublin May   Dublin
DDD Southwest June   Bristol
Norwegian Developers Conference May May 25-27, 2011 Oslo
TechEd US May May 16-19, 2011 Atlanta
Code Generation June   Cambridge
TechEd Europe June June 25-29 2012 Amsterdam
FOWA London October   London
DDD Any time of the year   Reading
PDC November   Redmond
LeWeb December   Paris

Tuesday 19 April 2011

Safari Books Online on the Ipad

Text and TOCFull-screen text

The best way I know to read Safari Books Online on the Ipad is the full web interface (not the mobile web version).

  • Install an alternative to Safari called Perfect Browser that allows full-screen browsing.
  • Browse to a Safari book.
  • Enable HTML View and Full Screen. Without HTML View, the text doesn’t scale properly when you zoom.
  • In Perfect Browser, hide the address bar and the tab bar.
  • Display the table of contents on the left.

You are now browsing your Safari books full screen with a table of contents in sync. Double tap on a paragraph to zoom in and hide the TOC. Double-tap again and the TOC comes back.

Obviously flicking pages is not as smooth as with a PDF and you can’t read the books offline. We’ll have to wait for the next version of Safari To Go for that…

By the way Perfect Browser is not perfect: if it was it would be able to post to Twitter and Read It Later.

Sunday 17 April 2011

Each Technology Has Its Place

OLYMPUS DIGITAL CAMERAYou would think software engineering is an activity where the decision to use such or such tool is based on pragmatic considerations: short term development costs and long term maintenance costs. In reality there is often a mix of religion (belief that ONE language is better than all others because it’s the language I learnt from an old bold master in a temple somewhere in Tibet) and fashion (technology perceived as cool because its name often appears in blogs and job specs).

Software libraries form a giant, ever-evolving toolset where each tool is optimal only for a narrow range of applications. This is in spite of the massive efforts by standard bodies to build all-purpose languages. No language is truly all-purpose, each one has its preferred applications.

Languages:

  • C++ stack: native programming with Win32, STL, Boost… Best for situations where the CPU or the memory usage becomes a bottleneck: embedded systems, server apps handling large volumes of requests. The focus is on execution speed and low memory footprint.
  • C# stack: .NET, CLR, Linq, WCF, Windows Forms… Best for situations where the performance bottleneck is in the database or the network. Need for high level of customisation while keeping development costs down: the focus is on ease of development.

GUI toolsets:

  • MFC: extremely responsive front-end for consumer-grade applications (as opposed to Enterprise apps). Has been around for ages and is still actively maintained by Microsoft.
  • Windows Forms: all-purpose front-end, ideal for Enterprise apps. Plenty of of 3rd party controls available. Very easy to code (when you compare to MFC for instance). Acceptably responsive. Deployment over ClickOnce easy as long as no admin rights are required and the target machines have the right .NET framework.
  • WPF: suitable for front-ends with relatively simple functionality, with an accent on good looks or advanced interaction. Feels a little bit overkill for Enterprise apps in terms of ratio between programming effort / result. Model apps for WPF should be those cool-looking interfaces you see in films. You can also do boring-looking Windows apps (with a menu, drop-down lists, trees and grids…, but there is no much point, you might as well use WinForms). Deployment over ClickOnce similar to Windows Forms.
  • Silverlight: suitable for extremely simple Enterprise front-ends (think IPhone apps but on the desktop), very easy Enterprise deployment via the web browser. The architecture guarantees that the client-side set of DLLs will be lean: you can’t deploy any 3rd party DLL, only Silverlight classes. Any 3rd party functionality has to run on a server, behind a WCF endpoint. In an enterprise context this type of constraint is actually a good thing because it forces you to leave complexity on servers.
  • HTML5/Javascript: web apps with a large reach, required to work on any browser/platform. Would sound like a really tedious choice in a Windows-based Enterprise environment where much better tools are available. However for pure web apps HTML5/Javascript makes more sense than Flash or Silverlight.

Thursday 24 March 2011

Using Mobile Broadband in Singapore with Huawey Mifi

How to use mobile internet when visiting Singapore?

I’m currently on holiday in Singapore and I carry around an Iphone, an Ipad and a Vaio (as you do when you’re on holiday). I bought a Mifi device (Huawey E585) a few weeks ago, which means I can create my little Wifi hotspot anywhere I go as long as I have a 3G SIM card.

Starhub sells a pre-paid SIM card called MaxMobile Prepaid. It contains a credit of SGD12.

  • You can buy it in any Starhub outlet (they tend to run out of stock at the weekend). You will need to show your passport during registration.
  • The SIM card goes into the Huawey (I use the E585) and connects to Starhub network immediately.
  • However it’s not operational until you activate the credit. Because you registered using your passport, the only way you can activate the credit is by talking directly to customer care on 1633.
  • To identify yourself you will need to quote the 8-digit number that appears on the package of the pre-paid SIM that you bought.
  • The lady on the phone will ask how many days you want to activate using your available credit. After she activates it, you will be able to connect to the internet immediately.

To top up your account,

  • buy a SGD18 Happy Top-up card from Starhub or Seven-Eleven. 
  • call 1633 to credit your account and activate more days.
  • You will need to quote your 8-digit SIM identifier as well as the codes that appear on the Happy Top-up scratch card.

I used Starhub with the Huawey without any problem during my stay in Singapore and could connect the IPhone, IPad and Vaio to it.

Saturday 19 March 2011

Self-Defense Techniques

It took me some time before I got to a stable and convenient backup system. I think I got there now. It’s hassle-free, complete and entirely automatic. This is the setup I use now for backup and synchronisation between all my portable gizmos.

1st level

Dropbox to synchronise my essential documents between

  • home PC,
  • 2 VAIO laptops,
  • IPhone
  • IPad.

I have less than 2 GB of essential documents so the free version of Dropbox is fine. I find the synchronisation very fast and more reliable than using the Windows offline files feature or Live Sync. This acts as a first form of backup since all files are saved on the Dropbox server by default. Dropbox files are always available offline under Windows. On the IPad/IPhone versions of Dropbox you must manually tick the files to make them available offline. By essential files I mean

  • technical Books
  • travel documents, flight tickets, travel insurance policy, conference tickets….
  • Visual Studio projects
  • OneNote files

2nd level

Daily incremental backup on an external hard drive of all documents on my D drive using the backup tool that comes with Windows 7. The drive is a 1TB Western Digital. This protects absolutely everything in case my main drives fail, which is a very likely occurrence.

3rd level

Off-site backup with Mozy, just in case my flat burns or I get burgled. This is an industrial-scale backup: documents, video, raw sound files, VM files, everything gets saved. I currently have 130GB saved on Mozy. At the time I bought the subscription, the backup size was unlimited. No matter how big a video is it will save it, it’s just a matter of time. It took me about one week to finish the initial backup. After that it does very quick daily automatic incremental backups.

I’m happy about this system so far, it’s entirely automatic and very exhaustive.

Saturday 26 February 2011

Books I currently flip through #9

 

41vMVJPzNBL._SL160_

  • Introducing Silverlight 4 (Ashish Ghoda)

51IvXoq4JtL._SL160_

  • Programming Windows Phone 7 (Charles Petzold) Free e-book that now works on the IPad (the version from a few months ago had trouble being displayed on Ipad/Iphone)

Monday 24 January 2011

Preparing a trip to South East Asia…

I’m gathering some info about the countries around Singapore, with a mix of web links, books and Kindle books.

General

Lonely Planet: South East Asia on a Shoestring

41up4BBrZUL._SL160_

southeastasia.org

Singapore

Singapore Journey Planner (SMRT)

Taiwan

Lonely Planet: Taiwan, ebook Edition

31HuVLbb7VL._SL160_

Taipei Insight City Guide

51CMb6F2X1L._SL160_

Malaysia

Timeout Kuala Lumpur

Diving Spots

Sipadan: Dive the World.com, sipadanvacations.com

Monday 10 January 2011

How to re-build your PC in less than 2 hours

 

Pre-requisites:

  • Your data is on D:, the OS on C:
  • Your backup is done (nothing to do because you have an automatic full C+D-drive incremental back-up scheduled to run every day )
  • Your CD case with all legally acquired original CDs for software and drivers
  • Access to the spreadsheet where you carefully store all serials for the above.
Go:
  1. Boot from DVD
  2. Format C:.
  3. Click Next, OK, next, Ok, I agree, OK, Next, London GMT
  4. Install your favourite software. For me it is:
    1. Microsoft Security Essentials
    2. Slysoft Virtual Clone Drive
    3. Office
    4. Chrome, Firefox
    5. Set-up backup with Mozy
  5. Check the time: if it took you more than 2 hours, start all over again.