I’ve not been active on this blog lately, but kept the writings as an archive. Find out who I am or check my CV. Social media links at the menu.
Posts
Using Protocol buffers v3 with ASP.NET core
By default ASP.NET core API methods operate on JSON: they deserialize JSON from request/response body to model type and back. JSON is everywhere and works well… unless you have very high throughput requirements. There are many alternative formats, but Google’s serialization format Protocol Buffers is one of the most used. It has overgone some changes recently: the old proto2 syntax is replaced with proto3. The latter even has an official C# support.
Don’t let techies design game user experience
Today I had some 20 minutes spare time and I wanted to try games my co-workers had recommended for me.
Using VS Team Services with go get
I use VS Team Services for some of my repositories. I use the Git repository type, and most of the time everything works fine. Until today I reorganized some of my Go code to be more idiomatic, meaning that I leverage the native Go package system as it is designed: the only way to reference packages is by their full repository URL:
Azure Blob Storage CORS headers and ScriptCS
One of Basware’s products I work for uses CDN to deliver content for end users. CDN provider is Edgecast, and primary & secondary origins are Azure Blob storage accounts. So far we have not needed any cross domain access to the CDN, but now a new feature required Javascript requests from our application domain to the CDN domain… and browsers naturally block this nowadays.
ASP.NET vNext presentation at Microsoft devdays 2014
How-to deploy to Azure website deployment slot from TFS
I changed some of my websites deployment to use different deployment slots on a single Azure web site instead of having different web sites for different staging areas. I deploy all my staging areas automatically from TFS (using the GitContinuousDeploymentTemplate.12.xaml process), each area from different Git branch. Works for my setup.
How to change your Outlook default calendar
Since Office 2013 was launched, I’ve had some problems with Outlook and account settings: I can set up all the accounts, but Outlook refuses to display my default Exchange calendar on the todo-pane, and instead shows an empty calendar from one of the other accounts that I use for email only. I like the todo-pane as its easy to glance whats coming with it. I’ve searched for resolution a couple of times, and most Microsoft community answers suggest to change the default data file on via Outlook > Account Settings:
What has pharmacy to do with programming?
I visited my local pharmacy last Friday to get some prescription drug. I sat in front of the pharmacist, who gave me very thorough guidance about the usage. At the time of payment - before she handed me the boxes - she suddenly said:
The promise of OWIN starts to materialize
OWIN stands for the “Open web interface for .NET”. Basically it is a reasonably simple specification that defines how data goes through the request pipeline, and how to attach to that pipeline. It is a specification for both the server and the application (middleware on OWIN’s terms) part.
Yet another take on Internet Explorer compatibility mode
I have touched this subject already twice: first I I blogged about forcing site rendering to be done with Internet Explorer’s latest engine. Then I faced a situation where separate intranet zone (bad idea, Microsoft!) fallbacks to compatibility mode and does not respect the IE=edge meta tag as internet zone web sites do.
Mass convert WMA files to MP3’s
I’ve always been a music fan. Not a die-hard-fan, but one with lots of music and decent equipment. During the era of CD’s, I routinely bought new discs, and they accumulated in hundreds. And then hard disk prices fell and network speeds grew, and I wanted to digitize all I had. This was years ago, maybe around year 2004. I wanted everything in lossless format, as digitizing was slow and I was not going to do it again. “Alternative” media format (.flac, .ogg) support was poor in Windows world, and I chose lossless windows media audio (WMA). I spent many evenings changing the disc on my laptop, and typing album and track names when they were not automatically found from media info databases.
Blog migrated to Github pages
I already blogged about the original platform Orchard I used to host this blog. I needed a new blogging platform, and after all the complexity I wanted something simpler and easier to upgrade.
The Orchard experience
When I originally started this blog I had two options: use some readymade blogging platform, or host one of the blogging platforms myself. I wanted a complete control of everything, and decided to build the blog to my own hosting. As .NET was (and partly still is) my thing, I wanted the platform to be .NET based. Sadly, none of the available platforms pleased me: dasBlog was aging and was not updated, DNN was too complex and written in Visual Basic. Luckily there was one new emerging platform called Orchard that was exactly what I wanted.
0x80070005 revisited
A while ago I blogged about a recurring problem in my laptop: event log was filling with Software protection service scheduling errors, and the fix was to change one system folder’s permissions. I ended up re-installing my laptop from scratch (to Windows 8.1), and again after I joined the machine to our company domain and installed Symantec Endpoint Protection the problem re-appeared. I still do not know which - domain or SEP or both together - is the root cause, but as the problem emerged over and over again, I gave up and automatized the change. I created one batch file:
Windows 8 fix: Failed to schedule Software Protection service for re-start - 0x80070005
I have had some weird problems on my Windows 8 laptop, and while fixing those I noticed a recurring Error event on my event log:
How to survive a 12 hour drive with your kids (a nerd edition)
It is again winter holiday time here in Finland, and as our land is mostly flat, you need to travel a long way to reach any hills suitable for real downhill skiing. For me that means ~12 hour drive from my home town Lohja to Finnish Lapland, more specifically Ylläs ski resort. You can get there by train or with an airplane, but as some of our friends live half way there we usually end up driving the whole way.
Techdays 2013 – SignalR
A week ago we had Microsoft TechDays 2013 at Finlandia Hall, Helsinki. For me this was fifth year in a row talking at Finnish Techdays; once I have talked about Azure, all the other talks have been about web technologies and trends. This time was no exception: I talked about real time web need and patterns, and about SignalR as one implementation tool. I enjoyed talking, and I hope I provoked at least some of the 200 listeners to think beyond the traditional HTTP Request/Response pattern we use to build web apps.
Web site that narrates input text (for kids)
Last year, when my kids got interested in learning to read and write, I decided to do what I tend to do: bring technology to the table. I created a simple web site that narrates input text, and shows navigable history of the given input on the page.
TypeScript, the new CoffeeScript?
Today Microsoft’s Anders Hejlsberg introduced TypeScript, which basically is a language that compiles into JavaScript, very similar to CoffeeScript. There are some differences, though: whereas CoffeeScript tries to make writing JavaScript very brief and removes lots of {}-stuff from the language, TypeScript tries to create an efficient type system on top of JavaScript.
Using PowerShell to narrate text
I visited NDC 2012 and enjoyed the conference a lot. Again. Awesome speaker lineup without too much product group advertisements. Lots of thought provoking lessons. Lots of fun tongue-in-the-cheek style stuff in between. Like Damian Edwards and Rob Conery “fighting” each other with SignalR and Socket.io, respectively (video here). On that cage match Rob used a cool narrator from command line (they used narrators since Damian had lost his voice), and for some reason that fascinated me.
First impressions of Nokia Lumia 800
I know I’m late to the game but I received my Lumia only yesterday. I’ve had a Windows Phone 7 LG E900 a.k.a LG Optimus 7 for 16 months now and I’ve generally been very happy with it. Even though the Lumia is so much newer, spec-wise it does not add much to my old LG: slightly faster HSPA network, faster processor, and some Nokia software, that’s all. Below I’ve listed some pros and cons of Lumia over LG.
Problems with Internet Explorer compatibility view
A while ago I blogged about forcing site rendering to be done with Internet Explorer’s latest engine. This feature is very well documented by Microsoft. Not that well documented is that adding the X-UA-Compatible header with value “IE=edge” does only half of the job: it overrides document mode, but not browser mode, and therefore you might end with situation like below - even if you carefully tried to avoid it by placing the meta tag (I know, I just did).
Different ASP.NET MVC master page for authenticated and unauthenticated users
I guess this is a common problem: you need to have different web site layout for unauthenticated users. In simple cases this is very easy: just use masterPageFile attribute on views. But it gets more complex when you have views that are used in both authenticated and unauthenticated context. Luckily MVC lets you plug into almost anything, and this can be solved with an action filter like this:
SSL, IE8 and strict cache headers (will not work)
Recently I encountered a bug that only some users saw, and which did not reproduce locally on development environment. The setup was:
Disable Internet Explorer compatibility view via web.config
New Internet Explorers have a necessary (?) but annoying feature called “Compatibility view”. I do not need that in my sites since I try to keep my HTML in good shape. Therefore on all projects I want to disable the feature since usually it breaks the layout. Disabling compatibility view can be done by adding a meta tag to HTML head:
How ASP.NET Web forms feels after 3 years of not using it
I have been an ASP.NET developer since it was invented, and a legacy ASP developer before that. For long I spent most of my time doing ASP.NET Web Forms and it was OK: I remember lots of weird problems that needed extensive trial and error –debugging, but things weren’t that bad.
Appharbor first impressions and gotchas
Lately I have done too much work and too little play. I decided to fix the situation a bit by starting to go through my never ending list: “TODO: Try these technologies or services”. Since I had one site that needed relocation to new hosting I decided to finally try AppHarbor. The service is a no friction cloud hosting with a tagline “Azure done right”.
Element cloning problems with jQuery mobile AJAX page transitions
I’m building a site that will mainly be used with mobile browsers (> 60 %), and so I decided to build it mobile first and then adapt to desktop browser widths with CSS media queries. Natural framework choice for easy mobile development is jQuery mobile; now I’ve been playing a couple of nights with it already and mostly have liked the experience: this framework is very convention based, and at least as long as you follow the conventions everything is remarkably easy.
Fixing some Orchard CMS blog problems
Blog archives part not working when blog is the site home page
WP7 Mango update - the good parts
When the Mango update was released with all the warnings about backups of backups, I decided not to go for it. But then, only half a day later, I was in a process of installing the update. Couldn’t resist. It took long but I succeeded not to brick my phone, and now I’m running Mango and mostly like what I see. Here is a list of some of the improvements that I value and see on my daily use from an end user point of view (i.e. not developer). I expect to see even more when applications start to support Mango, and Microsoft polishes the OS before RTM.
JavaScript bind and curry polyfills
Although I’m a C# guy, I’ve recently really started to like JavaScript. It is so dynamic and “different” that it forces you to really think what you are doing and how do you want it structured – which is a good thing. And if you just want to get things done quick and dirty JavaScript is also a perfect match for that.
Blog feed moved to Feedburner
I intended to use Feedburner from the beginning, but I did not find an easy way to modify Orchard (the CMS behind this blog) to link to an external feed. Luckily Bertrand Le Roy came to rescue and created Vandelay Feedburner plugin, which works great.
How-to localize jQuery UI Datepicker within ASP.NET MVC site
JQuery’s date picker UI component is very easy to localize on Javascript level. On this blog post I’ll describe how to ensure that date picker culture follows site’s server side culture. This is pretty trivial to accomplish, but it won’t hurt to document it here.
Disable submit buttons on form submit with jQuery.validate and ASP.NET MVC 2
I had a very common requirement to fill: when user clicks form submit button (or enter on keyboard) the button needs to be disabled in order to prevent double submits. Double submits could of course be filtered at server side with various timestamp mechanisms, but this was not what I was after this time.
Controller dependency missing on test? Try MvcContrib TestControllerBuilder
Ever faced this situation: You have nice and easy controller method, say:
Selecting MVC action method based on any named form value
Yesterday I blogged about using form button names to select action methods on an ASP.NET MVC controller. After using that attribute for a while I realized that I can make a generalization out of that: why not use any form value in the action method selection process? This way I can avoid code like this:
Selecting MVC action method based on the button clicked
Very common problem in form-heavy solutions is to be able to have one HTML form, but two different submit buttons for it. Think “Save” and “Delete”:
IIS 7.x cache optimizations
I find myself searching for this information over and over again for each web site I develop, so I guess I must blog this topic to remember it from now on.
Applying zebra striping with jQuery tablesorter and tablesorterPager plugin
A small but annoying bug I found today (and seems that someone else is having the same problem): when using jQuery.tablesorter) plugin together with tablesorterPager, applying the pager clears some properties from the table; In this case namely zebra striping. After initialization first table page is not striped, but next ones are after the first table page change.
How to shoot yourself in the foot with an IoC container
In the project I recently worked for our solution’s web interface froze every now and then. This problem had been going on for a while, but every time the problem went away by itself without any intervention. No problem, until the issue escalated even to developer workstations, making them slow.
Hello world!
I started to actively follow blogs about 6 years ago. I still remember the first blog I regularly followed was Brad Abrams’s blog. I followed blogs because they were interesting, they showed me a world outside my current company, and they contained lots of technical tidbits. Also, at that time they were the fastest way to spread information and helped to understand what’s cool right now.