maandag 26 november 2012

Surface RT in a developer's life



I've had the pleasure to play around with the surface rt now for a couple of weeks.  It’s a well build, good looking piece of technology, though the I haven’t been using it much.  Why?  Well simply put, it doesn’t have a direct purpose in my everyday life.  The main reasons I use my PC is: for browsing the internet, watching youtube and the most important part… developing applications, whether it is professional or just for fun.  

So the surface is great for browsing and watching youtube, no?  Yes, but when do I have the need to use the tablet when my laptop is near me and I hardly ever turn it off. When I'm in the couch and I whish to quickly search something online, I'm better off just getting my lazy ass of the couch then I am trying to browse using the onscreen keyboard of the surface, it just isn't as practical.
So you could argue that when you're on the move it can be a handy device.  Sure for people who commute by train or plane allot, this can be a very practical tool.  Yet, I'm sitting in a car for over 2 hours a day and I hardly use the public transit anymore.  Also the surface isn't equipped with 3G.  Do I really want to drain my Lumia's battery, tethering all the time, when I can just as easily browse the web on my phone?

A reason I resent to travel with the surface is that I'm barely able to write code on the damn thing!  When I was on the plane from Chicago to Amsterdam, I had to resort to writing script in powershell.  It is possible to do a bit of coding in javascript, for which I have another blogpost in queue, but it is pretty cumbersome to do so.

That being said, I'm not saying the surface (or any other tablet for that matter) is a useless device.  It can be the only device you need... when you're not a developer.  For the average consumer this can be an awesome device.  It browses smoothly, the integrated kickstand is awesome and the touch cover works great (let's face, typing on glass sucks).  I have a very hard time believing people who say the learning curve is hard.  It took me 5 minutes to teach the mother of my girlfriend all the gestures she needed to know to be able to use the tablet.  Bear in mind, this is a woman that uses a PC for less than an hour or so every week!  If you can't remember swipe up, down, left and right, then I'm sorry to tell you this, but no device will be good for you (including fisher-price laptops).

Untill next post ;-)

woensdag 31 oktober 2012

Breakfast and Keynote delight at build


The first day of build ended yesterday and it was great.

After a great breakfast provided by Microsoft, which was allot better than what our hotel has to offer, we got in line for the keynote.  The tent in which the keynote was hosted was impressive.  Jordan Rudess gave us a musical show on his musical windows 8 app.

Next Ballmer entered and demoed a whole range of windows 8 devices. He did a pretty good job entertaining us and I’ve never seen hem perform like this.  Then off course the big announcement came and after teasing us with the 100gb of skydrive storage (which is also great) he announced that we would get a surface RT.  Good move as it would force developers to start writing the apps they miss on the RT version of windows 8.

Windows Phone 8 was extensively shown after and as a last guest Richard Kerris of Nokia came on stage and told us we would receive the newest Lumia 920!  The crowd was ecstatic after that and the mood was set for everyone at build. 

I’m off to breakfast now and the second keynote.  It’s kind of a mystery what they’ll announce there, but I’m guessing it will be azure, office and xbox.

Till next post!

dinsdag 30 oktober 2012

Build 2012



Yesterday a colleague of mine and I went to the registration of the Microsoft Build conference.  When we arrived after driving fifteen minutes on the Microsoft Campus we finally found building 92 for the registration.  The waiting line was pretty long, but after an hour we got inside and received our badge and ‘goodiebag’. The goodiebag was pretty empty, besides a shirt and an MSDN magazine.  Guess whatever goodies Microsoft will hand out, they will do it at one of the two keynotes, Tuesday or Wednesday. We also got a discount coupon so we could buy stuff in the Microsoft employee store.

Then we got to a demo room with all kinds of Windows 8 tablets and PCs.  I finally got to lay my hands on the surface, and it feels like on sturdy, well build, good looking device.  The mechanical satisfaction of clapping out the kick stand is phenomenal and the way the keyboard clicks into the tablet is flawless. 


I’ve got to get myself ready now so I won’t be late for breakfast.
Keep tuned for more Build ramblings! ;-)

woensdag 11 juli 2012

NCrunch: completing the TDD experience


This Saturday, while attending the legacy code retreat of agileminds,  a colleague told me about a tool he’s using called NCrunch.  While I’m a very skeptical person regarding productivity tools, seeing that there is no valid competition for Resharper,  NCrunch rather seems to complete the experience rather than copy it.  The tool is free at the moment but that might change when the beta is over.

Basically what it does is build and run your tests in a separate process.  This alone made me want to back away from it because: how stressful will this be for my processor? Actually I barely notice any performance loss on my PC while developing.  My development laptop is an i5 quadcore with 8 GB ram, rather good but not a power beast.  The very first time you launch NCrunch you get the option to choose how many processor cores you want to use.  I used the typical 2 core setup with the engine mode option set to ‘run all tests automatically’.

It seems ridicules when I say that this tool boosted my performance allot.  Just by running the tests in the background?  Yes! You get a constant feedback of what code is covered, if your tests are green, a build that is not working, ...  Sure you can do this with Resharper and Dotcover.  But with NCrunch the feedback is in real time.  No need to build and no need to use alt + r + u + n (shortcut in resharper for running tests).  Actually since I’ve been using NCrunch, I’ve barely build and run my tests manually.  This saves me a bunch of time.

Instead of boring you with more fan ramblings, try it out yourself!  It’s free at the moment so no harm in trying.  Until next post!

maandag 9 juli 2012

Extensions for Entity Framework Code First


A couple of months ago I blogged about an extension I wrote to execute a stored procedure more easily with Entity Framework CodeFirst.  It certainly bumped up the number of visitors I got on my blog, which I of course love to see, but it also made me think of so many things that are missing in EF CF.


During my time spend on a project that uses EF CF, I’ve bundled some extensions I wrote to facility my needs and to make developing a whole lot easier.  It surprises me that the Entity Framework team didn’t ship these features in their release. 

Below you’ll find an explanation for every extension I wrote.  The code is on github, so feel free to make any additions as you like.


1.  Executing Stored Procedures

I already wrote an extensive blog post about this one so feel free to read it here.

To  summarize, the extension allows you to execute a stored procedure as so:

var testProcedureStoredProcedure = new TestProcedureStoredProcedure() { Iets = 5, NogIets = true };
var result = DbContext.Database.ExecuteStoredProcedure(testProcedureStoredProcedure);

I’ve made a small addition that now you can decide which class will be used to resolve the stored procedure name: the result class or the stored procedure class.


2.  Map to custom dto’s with ESQL

By default you can only map to entities when using ESQL. If you write your select statement explicitly then you get a DbDataRecord.   This is a PIA when customizing you selects to minimize data transfer.  The extension I wrote can map all selected fields to your dto.

var query = _unitOfWork.CreateQuery<DbDataRecord>(queryString);var dtos  = query.Map<YourDTO>();
 
3. Retrieve the DbSet with a generic

The datacontext object of EF CF exposes a number of DbSet’s.  I found it quit useful to be able to generically address these DbSet’s.  So I’ve come up with the following solution.  With this extension you can select a DbSet by supplying the type of the entity as a generic.

dataContext.GetDbSetReference<YourEntityType>();




4. Include with lamda

Why on earth they didn’t include this in version 1.0 I have no idea but unless you’ve already wrote your own extension for it (probably!), I’ve included a way to do this in the extensions project also.  Basically it enables you to write:

EntitySet.Include(x => x.NavigationProperty)



So that’s about it.  You can find the code on github.  As I’ve said, I’m happy to accept any useful additions to the code base.
Have fun coding, till next time!

woensdag 4 juli 2012

Stateless service

Taken from the BelFirst service specifications:

3. General Principles

3.1 Stateless service

While using the web service a state is maintained on the server. This allows the interface to use more atomic operation and hence richer functionality. Using the web service is done with a short session consisting of different calls$

Good job guys... /s
.

dinsdag 1 mei 2012

Convert any text to a string literal



The last couple of months I found myself trying to convert pieces of code or html to a string allot.  Some of the stuff I was trying to do includes:
All of the above required me to convert text with allot of quotes and abnormal characters into a string.  I searched the internet for some conversion site that would do this for me but couldn’t find one.  The only option that I had left was to write one of my own.

So if you are ever in the need to convert some pesky piece of text to a string and you’re not masochistic enough to do it manually, then be free to go to http://texttostringliteral.lucbos.net/ and this utility website will do it for you :-)

Till next time!

Small note: I’ve noticed the site takes a couple of seconds to load when my host recycled it.

vrijdag 27 april 2012

Removing a stuck sim in the Samsung Omnia 7


After attending the call for projects for windows phone 7 I got a lumia 800 from David Henry for submitting three apps in the marketplace.  It took me a while to switch phones but yesterday I finally got to it.  So then I would do what you’re supposed to do when switching phones, switch your sim card from one phone to the other.  That didn’t seem to go well and my sim card broke in half while trying to get it out of the Omnia 7.  Luckily for me it was just the adapter for the micro sim that broke of so the actual sim card could still be used.

I then tried to use some tweezers to get the sim card out but that didn’t seem to do any good. My last option then was getting the metal casing off, which surprisingly wasn’t that hard to do.

The first thing you’ve got to do is go to your usb charger port on the top of your phone and use a needle or screwdriver to get the top off.



When that’s done you’ll see 3 screws, unscrew them.  When the screws are out you can take the top lit off and slide the metal casing of your Omnia 7.



It’s that easy :-)  I didn’t see any warranty stickers or anything that can indicate loss of warranty so I think you’ll be safe on that part.  Removing the metal casing also doesn’t expose any of the electronics inside so there isn’t any risk of damaging anything.

Next posts I’ll try to cover some bits and pieces of the lumia 800.  Until next time ;-)

maandag 23 april 2012

Clean windows 8 metro project



Last week I attended a Windows 8 session at MIC.  While everyone was working on the labs I was trying to set up my project structure for my own metro project.  When I created a new Windows 8 metro project it struck me that the project template is just a PIA to start a new project with. 

The project starts up with a whole lot of redundant imports of namespaces and you get a free “default viewmodel” of which I can see no real world usage.  And the best thing of all is that all the item templates hook into this horrible standard project template by providing test data which plugs into this default viewmodel…

I’ve cleaned up the standard project template by releasing resharper on it and doing a code cleanup.  The default viewmodel has also been removed… I don’t think anyone will feel a big loss there.  You can download the new windows 8 project template here.

To be able to use that project template you have to place it in your project templates folder.  You can find this folder by going into the options menu in Visual Studio. Under the ‘General’ settings located under ‘Project and Solutions’  you can find the ‘User project templates location’ setting.



A small caution is that most of the default item templates won't build when the default viewmodel is removed but I consider this a good thing as you’ll probably don’t want that code anyway ;-)