Tuesday, 30 October 2012

Bring your own device

So why am I excited to have a surface?
My current company Laptop has an extend life time and is a Windows XP Pro SP3 from 2002 running on duel core Intel Centino with 3GB RAM. As an OS goes XP has been very successful, it has survived over 11 years, but now it’s getting very old and there are a number of apps that I cannot develop on it, in fact in about 1 year from now Microsoft will stop producing security patches for it. It takes 2min 45 seconds to get from a cold start to the login and another 3 minutes to after login before I can start working.

My new Surface has a smaller screen than my old laptop that now begins to look more like something that belongs in a museum. The surface is less than half the thickness and weighs a fraction of the weight with a start up time that is practically instantaneous. But unfortunately it cannot replace my development environment because it runs on an ARM processor which also means all apps must be downloaded from the AppStore. So I checked out the Microsoft shop for the new ultrathin windows 8 notebooks but they had all sold out. But it is still a very cool device

But even though my old laptop may seem slow and old, I think it might be possible to install Windows 8 on it. Microsoft has done a lot of work over the last 10 years to make a leaner and faster OS. So if my old laptop belonged to me I would try installing Windows 8 on it. I am certain that the speedup will not be due to Moore’s law but rather a more efficient implementation of an OS.

So what makes this better than say an iPad?
Well because it is a windows machine it can be added to an AD domain making single sign on possible. When I edit a power point-slide I don’t need to use a third party SaaS tool that streams from drop box, which means if I am serious about security I cannot do this with PowerPoint presentations with sensitive data. Instead I can directly edit my power-point slide in a secure and user friendly way via a native app (office). In fact, because it is Windows it is just going to work seamlessly in a Windows environment. The Pro version of surface uses Intel processors, meaning that there is a good chance that most of the apps that currently run on my old laptop will probably work on my new one. The WinRt version of surface uses a reduce version of Windows 8 to optimize power consumption. Since this does not run on an Intel processor my old apps will not work on it. But for most business users this is not a problem.

Why would I expect my old Laptop to perform significantly better with Windows 8?
Several years ago at the PDC Microsoft had some presentations about Moore’s law. To correctly interpret this law you need to know how it is defined http://en.wikipedia.org/wiki/Moore's_law

“Moore's law is the observation that over the history of computing hardware, the number of transistors on integrated circuits doubles approximately every two years.”

The density of transistors is already down to the atomic level and has reached a physical limit for several years. This means that the “free lunch” is over and in order to make use of the processing power of an integrated circuit you can no longer take the easy way of programming sequentially instead you need to go asynchronously. Because Moore’s law is scoped to an integrated circuit it has been able to survive by just adding more cores on the same integrated circuit and bringing everything closer together. This law won’t hold up much longer because of the space available, the cooling needed to prevent such tiny circuits melting which also limits the clock speed. So coming back to why will my old laptop performing significantly faster on Windows 8: Microsoft has restructured there code eliminating layers of inefficient code that has built up over the years and has stripped this down to a single layer that sits directly on the metal called WinRT (Windows Run Time) not to be confused with Windows 8 RT! Also Microsoft has stripped a number of processes making the overall operating system much faster and worth the effort to upgrade.

Over the last 4 years Microsoft has made a lot of progress in tooling for high performance programs. This ranges from things like the async await syntax in .net 4.5 that significantly simplifies asynchronous programming from something like a rocket science to something mortal programmers can do. To making super computer power available in Azure. To make use of computing power you really need to understand what your application is doing with computer resources, is it CPU, memory or io bound. What is the latency and speed between resources etc. There are lots of technology that can be applied (HPC, MPI, OpenMP, Hadoop, ATL, GPU) but you need to invest time to understand what the problem that is to be solved and plan how to use which technology to solve it. In other words the free lunch is over, to make useful applications these days you need to know something about software engineering

Monday, 27 August 2012

First steps in adding security to an Azure WCF application

Just recently I was asked to look into making a pricing tool available via Azure. Here is a log of how we came up with the final solution. The application is Excel based and the motivation was to move the sensitive pricing parameters from the excel sheets to use cloud based WCF services.


http://www.nigelfindlater.com/KnowHow/PublicKnowHow/3877

Wednesday, 27 June 2012

"The webpage cannot be found"

I came across an interesting problem where some users despite having the right access rights could not able to connect to a web page where others could. It turns out that the users who could not connect where members of more active directory groups than the ones had access. The root problem is somewhere in the authentication/authorization of Active Directories. Since I don’t have access to the configuration of AD I could not address the root of the problem. Here is a work around for this problem...

http://www.nigelfindlater.com/KnowHow/PublicKnowHow/3801

Friday, 22 June 2012

WCF Services

About 2 years ago I made some WCF services. Today I needed to create a new service. Here is a step by step guide how to create and deploy a WCF service together with how to setup the WAS server. Some aspects could be improved in particular it would be a cool idea to use ESB in the base classes for the WCF services.

http://www.nigelfindlater.com/KnowHow/PublicKnowHow/3790

Wednesday, 6 June 2012

Making graphs in javascript

I have started experimenting with some javascript libraries for plotting charts. The best one that I have found so far is called dygraphs. Here's an example

http://www.nigelfindlater.com/Static/danvk-dygraphs/tests/temperature-sf-ny.html

Thursday, 3 May 2012

Some notes from Julie Lehrman on EF5 at the Inner Schweiz .Net User group

I visited a great talk by Julie Lehrman on Entity framework held at the Inner Scwiez .Net user group. Here is a brief summary. The next release of Entity framework EF5 builds upon EF4.5. What we know as the EF becomes the "Core" on top of this 2 new classes in a EntityFramework.dll. One of these classes is DbContext which surfaces a leaner API than the underling ObjectContext. The idea is that by having a lean API the funtionality will be discovorable via intellisense. In the current version of EF it is possible to cache queries, this avoids the overhead that is needed in generating the native sql when querying the database. In EF5 this becomes an automatic "auto cache" process. Another new feature is called Migrations that allows the code first approach to gracefully upgrade or down grade database versions.

The programming of CRUD DAL was easily made by inheriting from Dbcontect. The EntityFramework dll can be downloaded direct from NuGate. In Vs2010 the default databse is sqlexpress in vs2011 it is something else. If no database connection is provided a search is initiated for a database name corresponding to the name of the class that inherits from DBContext. If none is found then one will be created. The tables and properties are the created by code conventions and data annotations. These updates are made via a database initialisation, changes in versions are made via migrations with versioning being kept both via a special table in the database and in vs under the migrations file. There are various ways of seeding the database via DatabaseInitializer, Updgrading is made via Up() and downgrades via Down()

The talk also went through the basic nuts and bolts of EF and how to optimize performance, for example at the start of an application the reading of the edmx and the reflection of entities is an expensive operation. There are ways around this by making bounded entity context which makes it possible to give a subset of the POCO entities.