I’m Eric Tummers, Technical Consultant at Valid, and this is how I work

me and big chick
Eric Tummers likes challenges and sharing the solutions with others. His work is focused on the Microsoft .NET framework. He writes unit tests when he develops. Not all developers he has worked with share this necessity for unit tests and he has made it his task to convince them otherwise.
For 2014 Eric hopes to participate in a big Windows Azure project. That would give him enough to write about on his blog. We’ll see what comes his way.

Location: Sittard, NL
Current Gig: Technical Consultant, Valid
Word that best describes how you work: unittesting.
Current mobile device: iPhone 5
Current computer: HP Probook 6570b

What apps/software/tools can’t you live without? Why?

As a Microsoft developer I can’t work without Visual Studio. Recently we started using http://visualstudio.com for our projects, before we used on-premise Team Foundation Server. I like that SAAS (Software as a service) takes the sting out of staying up-to-date.

The entire family of Evernote (clipper, clearly, iPhone app) Since last november I’m a premium user to keep me from running out of upload allowance. I log interesting articles, emails I need to hold on to and scan most of the paper that comes in.

iSmoothrun is my preferred activity tracking app. My recent half marathon is a result of the history of captured data. Just logs everything I want and syncs with other online services like runkeeper.

What’s your workspace setup like?

Work setup

Work setup

Docking station with external monitor, keyboard and mouse. Powers my laptop (I don’t even carry my adapter in the bag anymore)

As a consultant I’m mostly on the go and this is a flex desk, so no papers laying around.

Good coffee is a must.

Home setup

Home setup

At home I have a wireless keyboard / mouse setup. The laptop is tilted and raised for better viewing. This is where my power adapter lives.

More clutter here, but I don’t mind.

What’s your best time-saving shortcut/life hack?

Avoid traffic by starting early. Also gives you a good hour of silent working before everybody gets in screaming about the horrible commute.

What’s your favorite to-do list manager?

Actually I use different to-do lists for my tasks. I use Trello for daily taskboard and for projects. Wunderlist for recurring tasks/chores like clean the sink or check the fire alarm. For longer running tasks, or tasks with content/documents The Secret Weapon in Evernote.

Besides your phone and computer, what gadget can’t you live without and why?

My Apple TV2 (jailbroken) hooked up to my NAS for movies and series. Also hooked to my stereo for music streaming. Awesome device!

What everyday thing are you better at than everyone else? What’s your secret?

Unit testing. Is that an everyday thing? Yes. The advantage of unit testing is the work it saves in the end. But you’ll have to put in the extra work in the beginning. With my experience from other projects I think “How can I unit test this” every time I program something. Reviewing code from others gives me great ideas how to do things better.

What do you listen to while you work?

When everything is working out like planned, silence is the working sound I prefer. But when the sh*t hits the fan: I’m a drum-and-bass fan. My latest powersong is also my ringtone: Run riot by Camo & Krooked.
run riot on soundcloud

What’s your sleep routine like?

My alarm clock is set to 7 AM when I’m working from home, to beat traffic it is set to 6 AM. When I wake before that my day is great. Also in the weekends I tend to get up as soon as I awake and it’s light outside.

Fill in the blank: I’d love to see _________ answer these same questions.

Have to go with Scott Hanselman. He’s the guy that gets 27 hours out of a day.

What’s the best advice you’ve ever received?

someecards.com - Make a shit first draft you cannot edit a blank page
I believe this is a variant on a Hemingway quote.

Original idea from Lifehacker.com.

Posted in Uncategorized | Tagged , , , , , , , , , | Leave a comment

Week 38 roundup

Last week recap and links:
Image courtesy of kanate / FreeDigitalPhotos.net

  • Powershell syntax in Sublime Text 2, the method is for Windows but also applies to Mac
  • We used the build definition settings (TFS2015) to use a two digit month and dayOfTheMonth buildnumber. The key is to use the Date token in stead of Month and DayOfMonth: $(Year:yyyy).$(Date:MM).$(Date:dd)$(Rev:.rr)
  • Continuous deployment with TFS and Azure Websites can be customised. Applies to all real-life, multiple-websites-solution and more-advanced-than-the-demo projects.

Image courtesy of kanate / FreeDigitalPhotos.net

What are your best reads this week? Leave them in the comments below.

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Spark as alternative to Cloudmagic

Cloudmagic used to be my email client on iOS. But with the introduction of Newton it became a paid service. Since there are free alternatives I decided to switch. My new favourite is Spark.

sparkapp

What I want

My list of requirements is short but specific:

  • Support for IMAP, iCloud and GMail
  • Integration with Evernote
  • Free or one-time-purchase

Spark

Setup was simple. Spark recognised my (dutch) provider and only needed my email address and password. Integration with 1Password made entering the credentials a no-brainer.
The integration with Evernote is great. Just grant access via the Evernote App and now you can swipe an email to Evernote. Swipe actions are customisable.
The interface needs some getting used to and I’m not sure if I’ll ever use the quick reply feature.

Alternatives

In my quest I noticed Boxer. Swipe actions just like Spark. Paid app usually mean great support but setup of IMAP failed miserably.
Outlook is praised everywhere. The integration is limited to Calendar events for Evernote reminders. So no chocolate.

Further reading

50 getting started tips for new Spark users on 9to5mac.com
Vimeo promotional video

Posted in Tooling | Tagged , , | Leave a comment

Allow only release build to be published

We have a WPF application that we distribute with click-once deployment. The update feature is exactly what we need for our product. Getting the new build from Development into Production is easy, just publish.

The problem is that we only want Release builds to be published. Config transformation, code optimisation and custom icons are some of the main reasons we want to publish a Release build. Sometimes we forget to change the configuration and a Debug build is released into the wild.

As a safety net we added the BeforePublish build target to the project.

<Target Name="BeforePublish">
    <Error Condition="'$(Configuration)'!='Release'" 
           Text="Only Release build can be published" />
</Target>

Now when we try to publish without setting the configuration to Release the build fails.

publish.debug.fails

Since this is a very small project we haven’t setup automated build. The errors should keep us safe for now.

Posted in Development | Tagged , , | Leave a comment

Version store out of memory

In our current project we use Sql Server Data Tools (sqlproj) to put our database in source control. Recently we experienced random exceptions during loading and building the solution with multiple sql projects.

EsentVersionStoreOutOfMemoryException

Last week our builds started to fail. The logging showed something like

MSB4018: The “SqlBuildTask” task failed unexpectedly.
Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted)

On Microsoft Connect we found a workaround. By adding commandline option /p:CmdLineInMemoryStorage=TRUE the build worked again. Seems there is someone working at Microsoft with a great name ;) microsoft.connect.eric.msft

Posted in Development | Tagged , , , | Leave a comment

AngularJs and special characters from json webservice

My current project creates a Single Page Application (SPA) using ASP.NET MVC and AngularJs with data from ASP.NET MVC webapi REST webservices. With the buzzwords out of the way, let me describe the issue we had.

Some data from the webservice contains strings with special characters like “COÖRPERATIE” (dutch). After binding the json data with curly braces the webpage would show malformed strings like “COÃ-RPERATIE”.

Image courtesy of Kittikun Atsawintarangkul / FreeDigitalPhotos.net
Image courtesy of Kittikun Atsawintarangkul / FreeDigitalPhotos.net

We started looking for a solution with ngSanitize. Google gave lots of answers, but none helped. We tried filters, no chocolate. HTML escaping. The horror!

Right after the $http.get we added a $log of the string and found that it already was wrong. But Fiddler said it was correct? Seems to be a header you can send in the request: Accept-Charset: UTF-16

We added the extra header to our request and it worked. No more gibberish. The code samples below add the header to requests.

// client script angular
$http.get(url, headers : { 'Accept-Charset' : 'utf-16' })
     .then(function(response) { });
// client csharp code
var client = new System.Net.WebClient();
client.Headers.Add("Accept-Charset", "utf-16");

Since we always want to return UTF16 we made it the default response over UTF8. With the code below the webservice is configured to use the UTF16 encoding for the json formatter.

// add to global.asax or startup.cs
var utf8json = GlobalConfiguration.Configuration.Formatters.JsonFormatter.SupportedEncodings[0];
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SupportedEncodings.Add(utf8json);
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SupportedEncodings.RemoveAt(0);

The webservice can stil return UTF8 but the client must explicitly request it.

Posted in Development | Tagged , | Leave a comment

Create Loadtest repository

Sometimes I clean up / remove / uninstall to much. During spring cleaning I uninstalled some localdb versions because I have a full SQL Server installation already. After some time I noticed my loadtest in Visual Studio would not start. Apparently I was using localdb for the repository database.

First create a new LoadTest2010 database with the script loadtestresultsrepository.sql. See How to: Create a Load Test Results Repository Using SQL

To change the connectionstring go to Manage Test Controllers in the LOAD TEST menu of Visual Studio. There is the Load test results store.

loadtest.repository.connectionstring

Everything is operational again, until my next cleanup.

 

Posted in Uncategorized | Leave a comment

Be careful when using mocked repository

One of the software development best practices is to use interfaces and dependency injection. But be careful when using a mocked version of your repository.

With FakeDbSet an InMemory IDbSet can be created for unit testing purposes. During setup you’d add the records and the test will simply use those records. But there is a small difference with the actual Entity Framework implementation used with most applications: reading from the database will result in a new object.

The properties of the object will be the same, no matter how often you’d get it, but it is a new object. During integration testing I noticed some strange behaviour due to this. Changes made to the object by my business logic would disappear.

Extra utils used are the Fakes generated by Visual Studio and the Copy extension from github. In my code I changed the setup of the test repository to mimic this behaviour:

private IRepository CreateFakeRepository(object[] records) {
   var fakeRepository = new Fakes.StubIRepository();
   fakeRepository.RecordsGet = () => {
      var fakeDataSet = new FakeDbSet.InMemoryDbSet(true);
      foreach (var record in records) {
         fakeDataSet.Add(record.Copy());
      }
      return fakeDataSet;
   };
   return fakeRepository;
}

After this half (!) my unit tests turned red. Fixing it took some time, but I’m more confident about the business logic now.

Posted in Test | Tagged , , , , , | Leave a comment