Shinkansen wifi access (and Japan docomo/mobilepoint wifi WEP keys)

Back in 2011, I created a pretty popular post (that now redirects here) that contained the WEP key for Softbank’s “mobilepoint” wifi hotspot on the Shinkansen. For some reason, both docomo and Softbank encrypt their public wifi connections with publicly accessible keys which doesn’t prevent eavesdropping on connections at all. Docomo even sells “visitor” access passes via their mobile portal, only accessible if you know the wifi password in the first place!

In any case, the passwords to get on the wifi on the Shinkansen or pretty much anywhere in Japan are now:

OperatorSSIDWPA2/WEP Key
Docomodocomoe3f4aad65c
Docomo0000docomoB35D084737
Softbankmobilepoint262626d7032
Softbankmobilepoint696177616B

Once in, you can then log in with your roaming provider (I use Boingo, which works a treat in Japan, and is the source of the above info). The best “public” wifi provider in Japan is Wi2 if a hotspot is available – they provide a hotspot that doesn’t require a password and sells passes in English on the portal.

Evernote has no patience, drops WPF over fixed issues

Much noise has been made about Evernote’s new Windows client. For version 4, they dropped WPF/.NET and released a C++ native application.

They were pretty damning with their reasoning:

Evernote 4 is a major departure from Evernote 3.5 in every way. While 3.5 added tons of great new features, there were some problems we simply couldn’t fix: the blurry fonts, slow startup times, large memory footprint, and poor support for certain graphics cards were all issues that the technology behind 3.5 (Windows .net and WPF) was incapable of resolving. As a result, we ended up chasing down platform bugs rather than adding the great features our users wanted.

So we decided to start over from scratch, with fast, native C++ that we knew we could rely on. As you’ll see, the results are amazing. This new version will set a foundation for rapid improvement.

Evernote 4 is designed to give you a great experience on any computer that you use, whether you’re on a netbook, a five year old Windows XP machine or a super fast top-of-the-line Windows 7 computer.

On our test hardware, Evernote 4 starts five times faster, and uses half the memory of Evernote 3.5.

 

You cannot make statements like “issues that the technology behind 3.5 … was incapable of resolving” without providing more information on the problems they faced and the solutions they tried. For all we know, their Windows client development team could have tripled in size to get the native version out the door.

Evernote 3.5 was a textbook example of reasons to immediately upgrade to .NET 4.0 if you are building WPF applications. Visual Studio’s UI layer is now in WPF, presumably after fixing all these issues.

“The text is blurry”

This is fixed in WPF 4.0, which can render text almost exactly as Windows does if developers request it. The standard behaviour is a DPI-independent accurate representation of the font on the screen (the same way OSX renders text and also the reason why text is “blurry” on Macs).

This is a one-line fix in .NET 4.0, just apply TextOptions.TextFormattingMode=”Display” to your root XAML element. Asian text will also now use bitmap fonts so customers on Japanese XP machines will now get consistent text rendering between your app and their vintage OS (of course Vista/Win7 should be using Meiryo).

“The download size is too large”

The runtime for .NET 3.5 is 65MB or so. .NET 4.0 has reduced this to a 28MB download. Ironically, the Evernote 4.0 installer is 40MB – most likely larger than bundling the .NET 4.0 runtime in the installer of 3.5. Users with .NET 4.0 already installed would have got an even smaller download as the installer would not download the runtime.

Evernote 4.0 appears to include Chromium (the Chrome web browser base), Foxit Reader’s PDF libraries, SQLLite and libxml which could be replaced with the built in Web Browser control, XPS rendering, SQLCE and built in XML libraries of .NET 4.0.

“It uses too much memory”

If your application has hundreds of threads and handles complex local operations, it will require memory. Evernote’s statement about version 4.0 using “half” the memory of the managed 3.5 version is pretty damning considering that the application is not very complicated.

While you may never be able to match the memory consumption of a “native” application in .NET, there are some things you need to know to improve your memory use:

  • Use .NET 4.0 as it has background garbage collection
  • Keep your visual tree small (no endless nested Grids in XAML)
  • Virtualize your ItemControls! This might be the most important issue. You cannot bind a XAML WrapPanel to 1000 images without Virtualization and expect scrolling to be smooth or your memory consumption to be low.
  • Use the ThreadPool and Background Workers instead of manually creating threads. ThreadPool-based tasks intelligently carry out the number of simultaneous tasks based on the number of processor cores you have. Allowing your code to create and infinite number of threads is a recipe for disaster as each thread needs its own stack space of at least 1MB. Ideally use .NET 4.0s new parallel programming and async functions.
  • Read the correct memory numbers in Task Manager (Private Working Set).

“The application is slow to start up”

Managed applications do not have to start slowly. A new application from a VS template will start up instantly – it is when you start adding references to other libraries, interop hooks and modules (for composite apps) that startup time starts dropping. Perhaps the most important thing to do is use NGEN to generate a native version of your application at install time, instead of waiting for the JIT compilation when the user launches the application. The application will slow down when loading modules for the first time if they have not been pre-compiled. There is some great information on improving start up times on MSDN, as usual.

In general, try to show some part of your application immediately. A splash screen might be okay for application start up times of less than a few seconds, but there is no reason why the main window can not be displayed and relevent data start loading in the background. This is mainly a perception issue. If you only show your main window after loading all data that your application could possibly need ever, of course start up will appear to be slow.

Did Evernote even try .NET 4.0?

The .NET development community is waiting for some sort of postmortem from the Evernote team. Most of the above problems would have been solved by upgrading to .NET 4.0 and running some decent profilers on the executable.

Rewriting your application natively will no doubt use less memory and start up faster, but it will also look worse, take longer, be more expensive to develop and your UI will break when high DPI screens start to be used. Portability is not a reason: if you want an application to work on Windows/Mac/Linux/iOS/Android, you write a web application.

If you want an example of an amazing WPF 4.0 application designed for the Windows platform, check out MetroTwit.

Free Cloud-based online Microsoft Money using Dropbox

I have used Microsoft Money to manage my finances for coming up 6 years now and still find it the best personal finance app around. The last version in the UK was 2005 after Microsoft cancelled the product and let Quicken take the market. Microsoft then discontinued the international versions in the wake of Mint.com and other Yodlee-based web applications. Mint.com appears to be the most successful of the bunch and was bought by Quicken to replace their terrible Quicken Online.

Microsoft Money was fantastic because it:

  • Supported multiple currencies properly (I need GBP, USD and JPY with the ability to transfer between accounts)
  • Had seperate business accounts and expense tracking
  • Amazing reporting features
  • The invaluable cashflow graph which I still have not found in any competing product, web or client based

The last version was released in 2008 and this was the first version to contain product activation. Thanks to the product’s cancellation, Microsoft has quietly released a “Sunset” edition of Microsoft Money – a full copy of Microsoft Money Plus without the product activation entirely for free so users won’t have to worry about installing Money after the activation servers have gone down. The bank synchronisation is not included but this was only supported for US bank accounts anyway.

With the fantastic Dropbox, you can sync your Money data file between all the computers you use (even Mac OSX running Money under Parallels). The Money data file is very small (6 years of transactions here total 10MB).

The combination of MS Money and Dropbox gives you the best of both worlds:

  • Cloud storage and backup
  • Nobody snooping on your data, datamining your purchase habits (see Mint, Wesabe etc)
  • Instant UI response times because Money is a local app
  • Access your data from multiple locations – just install the free Money edition and Dropbox

Need mobile access? Just add LogMeIn to your iPad or iPhone.

Lexmark adds Twitter to an All in One printer … why?

Just noticed on The Register that Lexmark have added Twitter to a new range of All In One printers. See

They have actually written a client for the tiny little touchscreen display on the scanner. Are people really that addicted that they need to use Twitter while waiting for something to copy or scan? Why not use their phone? Because this way it looks like you are “fiddling with the settings”?

This is almost as pointless as the stupid talking printer driver you have to install on Windows when using Lexmark printers. “PRINTING STARTED.” “PRINTING COMPLETE.”

No native Japanese text in Windows Phone 7 … yet

The first preview version of the Windows Phone 7 SDK is out and it doesn’t support Japanese (or non-Latin) text in the English ROM. This is a huge disappointment.

image

One of the major advantages the iPhone has over almost every other smartphone platform (and the major reason I bought mine in the first place – I needed Japanese language support) is the built in support for non-Latin languages and their input methods. This allows Apple to provide one single worldwide firmware edition.

Previous versions of Windows Mobile have required users to hack in Japanese fonts using the registry and rely on some awful third party hacks to get Japanese IMEs working. I seriously hope that before WP7 is finished, Microsoft just install worldwide fonts and IMEs like they started to do with Vista. There is no excuse. We are unlikely to get low-level access to the registry this time around to hack the support in ourselves to non-Japanese ROMs.

One of their slides is supposed to imply that the Metro theme “Celebrates Typography”

image

— more like it totally ignores it. I suppose screens of square boxes fits the “Authentically Digital” principle.

iPhone O2 – how to fix the image compression

O2 in the UK butcher images while using GPRS/3G/EDGE – seriously effecting the iPhone. Images are recompressed to horrendous levels – look at the App Store here:

photo.jpg

As you can see, the Facebook and Super Monkey Ball banners have been recompressed. This effects webpages aswell – meaning downloading new wallpapers or browsing Flickr is a waste of time. However, if you change the username for the O2 access point under Settings > General > Network > Cellular Data Network to “bypass” from the default “vertigo” like so:

photo.jpg

The compression is now turned off! Now the “whole internet in your pocket” is actually the whole internet in your pocket.

photo.jpg

Symfony in Enterprise – Tips and Experiences

200807021841.jpg

At work I am currently tasked with redeveloping an intranet application used to track customers, products owned, support contracts, support records and all sorts of other CRM-esqué functions. The version used at the moment is a very fast Perl/MySQL/Mod_perl/Apache setup built over a few years. Its got to the point where the company needs more functionality and hacking extra functions into the current code is getting more and more difficult.

Why Symfony? Why PHP?

The current trend for “rich internet applications” is Ruby on Rails. Ruby has very powerful Object Role Modelling features that completely abstract the database from your code – no more writing SQL queries once the initial database has been set up. Database tables become class generators and rows become class references, free to be instantiated, updated and saved. Symfony is probably the closest PHP Framework to Ruby, as it utilises the Propel ORM layer (so can use almost any RDMS) and has a full Model View Controller structure. PHP runs on the vast majority of Apache installations and requires no extra software installed on the server – in addition finding skilled PHP programmers is far easier (although this might change). Symfony is also probably one of the most well documented Open Source web framework projects that I have come across, featuring a whole book written by a member of the community very close to the development team, an expansive Wiki on the project homepage and hundreds of plugins to simplify everything from AJAX to RSS feed generation.

Symfony can be used in two ways – through config files (text files defined using YAML, a simple markup language) which are passed to Generators to create the final scripts, or by manually coding the actions and pages. In reality, a combination of the two will be used. Tweaking the included Administration Generator will yield respectable results for the standard CRUD (Create, Read, Update, Delete) functions and it is extremely simple to create modules and actions with the included command-line tool that creates skeleton templates for you to use.

No longer do you have to plug in debugging tools (such as the Xdebug php extension) to get decent errors and stack traces when your application fails – Symfony provides a development view of your application that will output extremely useful information (such as execution time, a list of all SQL queries made and globals) right in the page outputted to your browser. Debugging the application I’ve been working has been as easy as that of a desktop app (coming from my experience of Visual Studio) – Symfony will work in conjunction with many PHP debugging extensions for further information if you need it (I haven’t).

Plus, Symfony is good enough for Yahoo to use it for a 20 Million user app, Yahoo Bookmarks!

Results

I’ve been working alone for a month on the project and what strikes me is the huge amount of already achieved with no prior experience of Symfony:

  • A complete database redesign using the excellent MySQL Workbench. Adding many-to-many relationships where there were none before requires a good deal of thought but the results when the ORM classes are generated by Propel in Symfony are well worth the effort
  • Database migration handled by the CLI features of Symfony. One command will generate a .php file you can run at the command line (or cron job) with automatic access to all the features of your main application. Where the database had been vastly redesigned to support relationships, custom migration code had to be written (but where tables have not changed, you can copy table data directly in one line of manual SQL). The migration script takes about half an hour to run (approx. 3,000,000 records).
  • User security and session support, timeouts etc
  • Full creation and editing of all the major record types with administration control panels
  • AJAX views and manipulation of information with per-user rearrangeable panels ala iGoogle
  • Full filtering functions for searches with auto-paginated results (soon with Excel export)
  • Global per-user filters that effect all searches
  • …and lots of other actions specific to the application

Tips

Some advice to newcomers to Symfony from my experience:

  • Don’t rewrite the wheel. Use the plugins available and tweak them if necessary.
  • Use the Admin Generator, don’t fight it. Instead of writing custom create/edit/list actions when the Administration Generator does not meet your requirements (or altering the CSS won’t help), override templates with per-module versions of your own. Even better is creating a new Generator all together (although it is a headache writing PHP code that writes PHP code!) – check out the sfAdvancedAdminGenerator plugin for inspiration.
  • Don’t worry too much about performance especially if your application is running a bit sluggish on your local machine. On a proper server with a production installation of Apache and MySQL, the application I thought was a bit slow flew given the chance. You can optimise later.
  • Don’t be scared of upgrading – I went up a symfony version during production without a hitch and without a change in my code (from 1.0 to 1.1 this will be different)
  • Use a decent IDE. I use PDT Eclipse and it definitely speeds up development. You will frequently have to edit several files at once so at least use a text editor with tabs.
  • Read the book! I can’t stress this one enough. It is extremely well written and is available for free on the website.

I’ll post some more impressions and a brief postmortem when the project is finished.

Free pro Microsoft tools for students

image

Wow. Microsoft has just launched “DreamSpark” – a programme that lets higher education students download pro Microsoft development tools – not the cut-down Express versions of Visual Studio, but the full Professional editions. UK Microsoft student champ Ed Dunhill sums it up the best on his blog here.

You get access to:

  • Visual Studio 2008 Pro
  • The whole Expression suite
  • SQL Server 2005 Developer edition
  • Windows Server 2003 Standard (and hopefully soon 2008)
  • The best bit is a whole years XNA Creators Club subscription FREE! This costs £65 normally with no real free alternative to get games running on the Xbox.

This is evidently a battle against pirated versions of the above products and this is the perfect way to do it. To enroll in the programme, your University needs to provide a Single Sign On authentication system to verify you or you need a ISIC card or NUS Extra card. Unfortunately, Oxford Brookes doesnt have a SSO Auth system (and I doubt they ever will – Oxford Uni does though) so I have had to order an NUS Extra card for a tenner to get in. Your status as a higher education student needs to be verified once a year, so students leaving Uni soon should sign up quick. Other than the XNA Creators Club subscription, I don’t think the products have time limits.

Expect Adobe to follow suit soon with their products if they want to get students hooked – although the academic discounts on Adobe CS3 stuff are great (only £400 for the Master Suite, down from £2500…) students will still pirate. Give students free access to professional tools and they’ll get hooked on them and buy them when they are earning a living.

Tomoyo 0.5 theme for WordPress

UPDATE! This version is out of date, please see the latest verson on the main theme page here: //www.edandersen.com/projects/tomoyo-wordpress-theme/

 

EdAndersen.com - Windows Internet ExplorerI toiled away for quite a while to create this WordPress theme which I think is pretty unique. I’m offering it up to the WordPress-using world. Just unzip into your themes directory.

Download Tomoyo theme for WordPress (303kb zip)

Features include:

  • Sexy Flash-based headings using sIFR, for post and page titles and sidebar headings (degrades gracefully when no Flash or Javascript available)
  • Full WordPress Widget support with three sidebars to customise (the one on the right, and two in the footer)
  • No horizontal scrolling on a 800-wide screen (perfect for eeepc users!)
  • Uses the new Meiryo Vista font if available for seamless latin and japanese mixed text
  • Tested with WordPress 2.3

I still need to style the comment system and there are a few rough edges, but I thought I’d release it anyway. All you need to do it change the header image from my ugly mug and its pretty much your theme!

Windows Live ID Return URL banned words

UPDATE: No need to do this now, its fixed!

For edngames.com I use Facebook, Yahoo! and Windows Live as sign on solutions. However, Windows Live is the only system with a restriction on the domain names you can register. For instance, because of the word “games” in my domain, I get the error message “The Return URL field contains a forbidden word or domain. Please use a different Return URL and enter the HIP solution again.”

image

Facebook and Yahoo, competing single sign on solutions, do not have this restriction, which the word “game” I assume is to block gambling sites from the authentication.

To get around this, I have had to set up a dummy domain (edslife.co.uk) without the banned words and perform authentication on that – you cannot simply do a redirect because the signature returned by the Windows Live server will be invalid because its a different return URL. I then have to create my own authentication (I use a hash function based on the time and a secret word) to move between the dummy domain to the real one securely.

image 

Although this works, and is just as secure as authenticating on the target site I reckon, it provides a pretty shoddy user experience because I have to explain that there is another domain name involved. You also cannot use this method to get data from the Windows Live server such as contact information because from a different domain, the authentication is invalid.