Entries Tagged 'Programming' ↓
February 10th, 2010 — Programming
I like many people get shed loads of letters from anyone who doesn’t care about the trees. Yesterday I got a letter from O2 (my mobile network) saying that they are going to stop sending me paper bills and instead I have use their website or iPhone app to check my bill.
Typical for big corporates stuck in old days, not only did they create a user name for me, they used my abbreviated name with a random four digit number as they user name. I now have to use this username and come up with a password that has at least 5 different “security” requirements. A website that I am going to use once or twice a year with a very bad user name and a worse password means disaster.
This time instead of putting the letter in my draw, I decided to use my Brother DC-540CN printer/scanner and scan the letters. This scanner has an automatic document feeder which makes it even easier. But the beauty of it was when I realised I can scan the letters to a TIFF file and turn on Windows 7 OCR feature. Seconds later, I could type O2, mobile or iPhone in my Start Menu and a scan of the letter from my stupid network provider popped up instantly. Brilliant!

February 9th, 2010 — Programming
Hoptoad is a web based application that captures your application’s exceptions and errors. It has some simple de-duplication algorithm and forwards new exceptions to your email box. It also tracks your deployment and resolved exceptions.
It is build for Ruby projects but it can be used for .NET apps as well (I wish people behind it would make it more generic than what it is now). For ASP .NET applications, there is another similar application called Exceptioneer but it doesn’t have an open API (you need to add their assembly to your project) and is very isolated to ASP .NET web applications. It is also in private beta.
I use log4net for almost all my projects, so I thought I should write a Hoptoad appender for log4net. The Hoptoad client itself is not locked into log4net and can be used standalone as well. Download the code here
Perhaps the next step is to write the same thing for ELMAH.
To configure the log4net appender use something like the following section:
<appender name=&quot;HoptoadAppender&quot; type=&quot;SharpHop.HoptoadAppender, SharpHop&quot;>
<ApiKey value=&quot;xxxx&quot;/>
<EnvironmentName value=&quot;Dev&quot;/>
<AppName value=&quot;Your app name&quot;/>
<AppVersion value=&quot;1.0.0.0&quot;/>
<AppUrl value=&quot;http://yoururl.com&quot;/>
<layout type=&quot;log4net.Layout.PatternLayout&quot;>
<conversionPattern value=&quot;[%thread] %-5level %logger{1}: %message&quot; />
</layout>
</appender>
UPDATE: SharpHop now has a home at GoogleCode as an open source project with Apache Licene.
January 15th, 2010 — Programming
Facebook has a HTTP REST API exposed to the outside world. It is used by thousands of developers in different languages. Google API for most (if not all) of its services is also based on HTTP REST. This seems to be working for almost any “web 2.0″ application out there. Now bring Microsoft into the complex: Facebook SDK by Microsoft. I’m trying to get the news feed from a multi-threaded application using this SDK and here is what I get: System.Threading.ThreadStateException: ActiveX control ’8856f961-340a-11d0-a96b-00c04fd705a2′ cannot be instantiated because the current thread is not in a single-threaded apartment.
And for now I’m getting this in my unit tests (which are running under ReSharper), I am going to have so much “fun” doing it in the real app.
I just want to ask WHY? Why is there an ActiveX anywhere in this SDK? Forget about the old and redundant technology. Couldn’t MS guys put a simple SDK together like ANY other REST based SDK out there that just works based on a bundle of wrappers around HTTP REST calls?
Why does Microsoft want to do everything their way and ignore every single standard under the sun?
January 3rd, 2010 — Programming
I love Windows 7. So much that when my MacBook batter died for the third time in two years because of a manufacturing fault, I didn’t bother to go to an Apple shop again! I now use my Samsung NC10 netbook with Jolicould pre-beta and Windows 7 on my main desktop.
I also love Chrome as a browser. I’m using the main release and not Dev or Beta channels since it’s my main browser and I have other things to worry about at the moment. However, one thing bugs me a lot about Windows 7 and Chrome. Here is a snapshot of my taskbar. I have a Chrome App for my Last.fm and ever time I start it, all other instances of Chrome are displayed under that as multiple tabs.

Chrome Team: Please fix this! Thank you!
January 2nd, 2010 — Programming
My recent project was hosted on a virtual server in GoGrid. The server was a Windows 2008 running IIS7 and SQL 2008 Express. The application was in .NET 3.5 SP1 and was running as a ASP MVC front end and a Windows Service as a back end. NHibernate as ORM, Spring.net for IoC and DI, Log4Net for logging and a few other open source tools and frameworks.
With my BizSpark partnership approved, I tried to move the system to Windows Azure and now after spending 2 weeks on that I am moving it back to a dedicated server and trying to recover from the time wasted on this.
In my opinion, Azure is a brilliant framework but it is not ready for prime time yet. It can become a great cloud development environment within a year or so, but not now.
The problem is Microsoft is inventing lots of new concepts and tools to make Azure happen. The logging framework, communication between the worker instances (done only through WCF and queues) and many other new concepts are being tried at the moment as Azure is in CTP. However, this means no serious commercial product can really be ported to it until the tools and framework is set and gets to a certain level of maturity. Until then, developers will lose a lot of time, tracking this moving target and that is something many startups cannot afford.
Compare this with other MS technology based cloud computing services offered by Amazon, GoGrid, RackSpace and others. These are based on tried and tested technologies and that makes it easier for developers to develop for.
Cloud computing hosting and development is still a new technology and is still suffering from teething problems. I think Microsoft is doing a good job in inventing new tools for this new paradigm. However, it should try to open up its standards and to the open source standards if it wants to see Azure take off and more importantly, it should stay in the game for a long time and the developers will gradually move to the new platform slowly.
For now, the pain of moving my application to Azure was too great: Front-end/Back-end comms had to be replaced with MSMQ backed WCF, Lucene directories had to be re-written for Azure storage, logging had to be replaced with traces and some other issues.
Very long deployment process, VS SDK issues, SQL server accessibility problems and lack of good personal development/business support structure within Microsoft added on top of my other problems meant that I will be visiting Azure sometime later this year but not for this project.
December 20th, 2009 — Programming
Comments on the previous posts (here and here) about Growl for Windows and Snarl has made me realise that the problem is not about the frameworks, it is about platforms. Let’s get one thing straight: Windows doesn’t have a notification framework, it only has components of it, mainly a place for Tray Icons and that is hardly enough.
A framework for notification should allow developers to delegate their notification tasks to it and forget about them. Users can choose the minimum level they want to get notified about, how they would like these to be displayed/sent, when are the “quite” hours and so on. These are problems that keep popping up in most UI notification scenarios and without a framework in place, developers have to address them separately every time themselves. This means these are addressed inconsistently since each programmer sees the problem in light of different use cases.
Growl started its life for Mac as a solution for the lack of a “system tray”. It was widely adopted by developers since the alternative was to write the system tray themselves. This subtle point makes all the difference between the original Growl and Growl for Windows. Growl for Windows tries to be a clone of Growl and thinks the problem of market penetration is down to the fact the the original Grown has enjoyed a longer life. Give it enough time and it will become popular they claim.
I don’t think that way. The relative low cost of using System Tray in Windows means many developers are not going to bother using GfW as their notification tool. Add this to the relative cost of learning how to integrate GfW/Snarl into your app and it becomes less attractive.
The reason Growl for Mac was successful was that developers had incentive to use it. GfW/Snarl as they stand, offer very little incentive and I believe the current adoption rate of these tools is a result of that. This means GfW and Snarl should rethink their offerings. They should change them from mere tools to “platforms”. This means a better and tighter end-to-end experience for users and developers.
Currently not many Windows apps use GfW or Snarl natively. This means there are going to be loads of “bridges”. These bridges define the user experience for both tools and at the moment neither of the tools offer much to control these bridges.
GfW and Snarl should offer centralized configuration for plug-ins. Make installation and upgrade of plug-ins dead easy and integrated. Have a central “app store” like plug-in directory and control who is putting the plug ins on it. If a plug in installs its DLLs directly into Snarl extensions folder and therefore breaks the uninstall process of the tool as well as causing other issues for the user, it should be stopped. Now it is not a question of Apple App Store like policing. It can be done easier by forcing the use of a controlled set of APIs that offers the above features as well as blocking “DLL droppers” to work. If a dropped DLL cannot work, no developer will bother doing it and they will go through the proper way which is actually easier for them as well since they don’t need to worry about installation and in most cases even any UI exposure.
A range of high quality bridges will help the adoption rate which in turn give developers more incentives to leverage the large user base GfW and Snarl will enjoy. The rest will be a self fulfilling prophecy!
December 19th, 2009 — Programming
I’m glad that my previous post has attracted comments from the developers of both Snarl and Growl systems as well as others. I wasn’t expecting much agreement by posting such writing in Growl and Snarl users’ forum. They are all bought into the idea of those systems after all.
When I think of Growl and Snarl, I think of a consumer tool. To me they are not programming frameworks like Spring or Hibernate, neither they are tools for computer savvy people like Process Explorer. I see them and I think of my Logitech diNovo keyboard.
My old Microsoft media keyboard had some “media” keys: Play, Stop, Forward and so on. But it was pain to use: They only worked with Windows Media Player until iTunes 6. After iTunes 6 came out I think Microsoft realised there are more media players in the market than WMP. So a driver update later and I starting playing nice with iTunes. But still no WinAmp or others. While ago for reasons not related to the media keys I decided to buy a diNovo keyboard. And it was then when I realised I actually enjoy using the media keys that I had always thought were for non-IT users. Not only did they play nicely with WMP, iTunes and WinAmp, but they work with Spotify too! And for those who don’t know, Spotify is newer than diNovo by far.
Now try doing that with Gmail and Snarl or Thunderbird and GFW. I am not saying it is not possible, but the experience is by far different. Don’t get me wrong, I’m not suggesting GFW and Snarl teams should carry the burden of integration themselves. It is not about doing the work yourself, it is about making it more difficult for developers to do the wrong thing which in turn would make it easier for end users. As it is, the developers have to do the installation and configuration themselves. This makes the final product, non-integrated and inconsistent.
This for me is a good end-user experience. What was the GFW or Snarl equivalent? Well you got your diNovo and you have Spotify. Now you can go and search for a piece of software that connects them, install it spearately, configure it separately, upgrade it separately and so on. And probably every time you upgrade your diNovo driver or Spotify, you’d have to worry if they still are friends.
To me, good software is not equal to good code or even nice UI. For me consumer software is a full experience and I think GFW and Snarl can improve hugely by introducing frameworks and support tools (very similar to the ones used successfully by Firefox) for their developers. At the moment the burden is on the developers although in a consumer market the blame is mostly put on “Growl” or “Snarl” not the particular plugin. If you disagree I suggest you work in an IT support department of a non-software house to appreciate the value of this experience.
I am writing this as a contributing to both tools. Not all contributions have to be in code I’d like to think.
Good luck
December 18th, 2009 — Programming
Mac users have enjoyed an almost universal support for Growl for years. Almost all good Mac applications support Growl and just use it if it is installed. This makes the whole experience with notifications very pleasant. Windows on the other hand has never had a single an unified experience for user notification. Growl for Windows (and Snarl) is trying to be that. There are some problems with that however:
- Both Growl and Snarl have been in development/beta for a long time. Growl and Snarl are consumer software and need to be easy to find and install. You don’t really expect everyone to find the best version of a software on SoureForge and install it?
- There is no single application directory for their plug-ins. No reviews, ranking, bug reports. Nothing. Try finding a Google Wave notifier for Snarl now.
- The biggest problem with both Growl for Windows and Snarl is that their plugins are stand-alone applications. That is just stupid. I can write an application and use Growl for my notifications if it is installed. But why should I install a separate application if I just want to have Gmail notifications? This means a separate install, separate tray icon, separate “Start with Windows” settings and no unified configuration experience. What’s wrong with Firefox plug-in system. Snarl and Growl plugins don’t have to talk to the host application like an external tool. The external API is for external applications.
Should I start a new open source Growl for Windows replacement?!
November 13th, 2009 — Programming
Today one my Google Alerts found 3 instances of new mentions of a website. They are alegedly from different websites written in form of website reviews. Have a look here:
Site number 1
Site number 2
Site number 3
November 9th, 2009 — Programming
If you are getting a message from DotNetOAuth like this “The message expired at 11/8/2009 4:28:42 PM and it is now 11/9/2009
12:15:40 AM.”, check your server’s date time and time zone. OpenId providers/relays uses UTC to communicate and a wrong clock/time zone can cause this issue.