0

Linklist

by Dirk 18. January 2012 23:05

Tags:

ASP.NET | Design | Development | Programming | Windows

0

DevCamp 2010 Keynote Speaker Announced

by Dirk 18. September 2010 00:06

I wrote about DevCamp 2010 earlier, and I'm happy to report that the keynote speaker has been announced the day before yesterday: my fellow countryman Bart de Smet from the SQL Cloud Programmability team.

Tags: , ,

Development | Programming

0

Shameless Plug 2: Certified Scrum Developer Course

by Dirk 18. August 2010 17:02

TechTalk (the company I work for) is organizing a "Certified Scrum Developer" course.  The purpose of the course is to teach you (or reinforce your knowledge of) the way software development can be done in a scrum environment.  Successful completion of the course can be applied towards the Certified Scrum Developer credential that was recently introduced by the Scrum Alliance.  The course will be held from 13-15 October 2010, by TechTalk at Microsoft Austria's Microsoft Innovation Center.

The tentative schedule allows for large chunk of Test Driven Development-related content on day 2, and I am deeply involved in the preparation of that part.  I hope you'll attend to enjoy the fruits of my work :-)

Tags: , , ,

Development | Programming

0

Shameless Plug 1: DevCamp 2010

by Dirk 18. August 2010 16:53

TechTalk (the company I work for) is once again part of the organization of DevCamp - the 4th edition already.  DevCamp is an Austrian developer conference held yearly in October in Vienna.  This year's edition will take place on tuesday 12 October 2010, at Vienna Marriott, Parkring 12a, 1010 Wien.  There will be three tracks: Windows Azure – Über oder in der Wolke?, Application Lifecycle Management and User Experience & Applications.

Tags: , ,

Development | Programming

0

Troubleshooting SQL Server CE 3.5

by Dirk 15. August 2010 05:48

If SQL Server CE 3.5 mysteriously cannot be found by an application anymore - even if another one is perfectly able to load it - with this exception message: Cannot open “X:Pathtodatafiledatafile.sdf”. Provider ‘System.Data.SqlServerCe.3.5′ not installed then you might try the solution suggested at http://www.geekfreeq.com/linq-sql-server-ce-35/.  It worked for me.

Tags: , ,

Programming

0

Lessons Learned about Software Development for Windows Mobile using the .NET Compact Framework

by Dirk 16. April 2010 17:42

Note: I am writing about ?Windows Mobile? as in ?based on Windows CE 5.x? rather than ?Windows Phones? as in ?based on Windows CE 6.x?.

Test-Driven Development

It came as a surprise to me ? a welcome one, to be sure, but a surprise all the same ? that there actually is a Unit Test framework for the .NET Compact Framework that is both easy to use and really runs on the .NET Compact Framework.  It is called MsTest ? Unit Testing for .Net Compact Framework is now friendly enough! describes how to use it.

Debugging Unit Tests on .NET CF is said to be a pain (at least according to Debugging Smart Device MSTEST Unit Tests). My team and I are of the opinion however that if things come to the point where you need to debug a unit test, you are doing something wrong.  So we decided to accept this problem.

There?s one pitfall there though.  Every Smart Device project in Visual Studio has an associated target device.  However, the unit tests do not run on the associated target device of the test projects.  They run on the target device of the test configuration instead.

SmartDeviceTestRunConfig

What?s with the Network?

Enabling network on a Windows Mobile Device is simply a matter of running the emulator, pointing to File ?> Configure on the emulator, clicking on the Network tab and making sure that the NE2000 checkbox is activated.

MobileNetwork

However, on Windows 7 you may receive the following error when you try to enable the checkbox and click on OK: ?The required Virtual Machine Network Driver could not be found. Make sure that Virtual PC 2007 is installed. You can install Virtual PC 2007 from  http://go.microsoft.com/fwlink/?linkid=46859?.

This is a bit of a quandary: Virtual PC 2007 does not work on Windows 7, there is a separate ?Virtual PC for Window 7? (part of Windows XP Mode on Windows 7).  In order to enable networking on the emulator, you need to install Virtual PC 2007.  That results in Virtual PC for Windows 7 being broken (at least the network).  So if you need Virtual PC on Windows 7, you need to uninstall Virtual PC 2007.

Fortunately, it is possible to install the network components of Virtual PC 2007 only, so you can have the best of both worlds: working network on the device emulator, and working Virtual PC on Windows 7.  Windows Virtual PC and the Microsoft Device Emulator describes how to set this up.

ActiveSync, USB and DMA Connections

In order to connect a Windows Mobile device to your PC, you need ActiveSync on Windows XP and Windows Mobile Device Center on Windows Vista or 7.  If you want to connect a Windows Mobile Emulator to your PC as well, you will need to allow DMA connections.

connectionSettings

Once you have allowed DNA connections, you need to ?cradle? your emulator, using the Device Emulator Manager (%ProgramFiles%\Microsoft Device Emulator\1.0\dvcemumanager.exe).  Your emulator will then behave exactly like a physical device connected to your PC.

cradle

/etc/hosts

Sooner or later during development of any non-trivial project there comes the need to match DNS names to IP addresses. In other words, you need a hosts file.  Too bad that there is no hosts file on Windows Mobile.

As it turns out, you can achieve the same goal by using the registry of the mobile device, as described in /etc/hosts file equivalent in Windows Mobile device.

Remotely Controlling a Windows Mobile Device

It is much more comfortable to control a device by using the keyboard and mouse of your own PC than to use a stylus and tap around on small squares. Additionally, it comes in handy if you can copy text on your pc and paste it on the mobile device, or vice versa.  MyMobiler is a freeware program that does exactly that; SOTI Pocket Controller is a commercial alternative.

Tags: , ,

Programming | Development

0

TDD Master Class with Roy Osherove

by Dirk 25. February 2010 02:00

Last week, I took part in Roy Osherove's TDD Master Class in Vienna. The name "Master Class" is thoroughly appropriate: the 5 days are packed with loads of useful advice, best practices (including what will go happen if you don't follow them), concise theory and lots of exercises.  The exercises are pair programming sessions, and Roy occasionally looks over your shoulder and gives helpful advice or asks annoying (*) questions like "is this the simples thing you can think of?".

(*) annoying as in "he's right and I'm probably wrong".

Some things I learned (the top two for each day):

  • Think like the laziest developer in the world
  • Beware of the serial killer
  • TDD Kata
  • The difference between stubs and mocks
  • A feel for the API differences between Rhino Mocks, Moq and Typemock Isolator
  • When to use an isolation framework and when not
  • The three pillars of trustworthy unit test
  • How to review unit tests
  • Dealing with legacy code
  • Object Oriented Design and Testable Design are sometimes at odds with each others

Honorable mentions go to the recurring topic of using Visual Studio without a mouse.

Roy is both very knowledgeable and very down to earth - a good combination in a teacher. I wholeheartedly recommend his master class. Do yourself a favor and make sure you have some experience with unit testing before you attend the course, otherwise you will find the master class rather overwhelming and will miss many of the nuances.

I'll finish with Roy's and mine favorite quote by Arthur C. Clarke (slightly adapted): Any sufficiently advanced unit test is indistinguishable from magic.

Tags: , ,

Programming

0

Random - For a Given Value of Random

by Dirk 24. August 2009 17:10

I had some fun with .NET's random number generator (System.Random) last week. In my defense, I want to point out that

  1. I do know that System.Random is not a true random number generator, but rather an algorithm that "fulfills certain statistical properties" of randomness.
  2. I do know that if two instances have the same seed, then they will produce the same series of random numbers.
  3. I do know that if you instantiate an instance of System.Random using the default constructor, the seed is taken from the current time of the computer.

What I did not fully realize until last week was that the length of a clock tick is 100 nanoseconds (0.1 microsecond). So creating 5 instances of System.Random in a row may (and did) happen in the course of a single clock tick - resulting in 5 identical random number series. Very random indeed.

The MSDN documentation of System.Random actually mentions this problem (and its solution), but hey, who reads the manual?

Tags:

Programming

0

Optional Parameters in C# 4.0- Use them wisely!

by Dirk 21. August 2009 16:32

Christoph, one of my TechTalk colleagues posted his views on optional parameters in C# 4.0. His advice is: don't use them. I partly agree with him: the values of the optional parameters are compiled as literals (which is probably not how I would have implemented it) and this makes the concept questionable from the point of view of dependency injection. So I would recommend not to use optional parameters in a dependency injection scenario.

I disagree, however, with Christoph's blanket statement "don't use them [at all]." Optional parameters are meant to be used when wrapping COM libraries - think Outlook: you have COM interfaces and methods with a truckload of parameters, many of which do not need to be passed to the method. C# requires values for all parameters, though, so you have to specify default values or "System.Type.Missing" for all the optional parameters. In the past, if you were wrapping the COM library with a C# library you had to create lots of overloads if you wanted a better API.  In C# 4.0 you can use optional parameters and need only provide one version of the method.

So I recommend: use optional parameters wisely.

Tags: ,

Programming

0

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.

by Dirk 24. July 2009 17:03

Problem: you are publishing a WCF service, and when you try to access it, you receive the error ?This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.?

The problem is caused by the fact that IIS supports specifying multiple IIS bindings per site (which results in multiple base addresses per scheme), but a WCF service hosted under a site allows binding to only one base address per scheme.

The solution is to specify a baseAddressFilterPrefix:

<system.serviceModel>
    <serviceHostingEnvironment>
        <baseAddressPrefixFilters>
            <add prefix="net.tcp://payroll.myorg.com:8000"/>
            <add prefix="http://shipping.myorg.com:9000">
        </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
</system.serviceModel>

Source: How can WCF support multiple IIS Binding specified per site?

Note: this solution assumes you are using .NET 3.5.  For a solution that works in .NET 3.0, see Supporting Multiple IIS Bindings Per Site.

Tags: ,

Programming

Powered by BlogEngine.NET 2.5.0.6
Original Design by Laptop Geek, Adapted by onesoft