The Wiert Corner – irregular stream of Wiert stuff

Jeroen Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    MPS_9791

    MPS_9795

    MPS_9793

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 430 other followers

Archive for March, 2011

online: Create a GUID

Posted by jpluimers on 2011/03/10

Don’t you love this kind of sites:

Create a GUID at createguid.com

–jeroen

via Create a GUID.

Posted in .NET, Delphi, Development, Software Development | 14 Comments »

c# – PRISM + MEF — How to specify which export to use? – Stack Overflow

Posted by jpluimers on 2011/03/10

When you export different implementations of the same interface, importing the right one requires a “named contract“.

Like Danny Thorpe wrote: “Ah, named contracts. I had forgotten about that!”, indeed the first answer is nice!

–jeroen

via c# – PRISM + MEF — How to specify which export to use? – Stack Overflow.

Posted in .NET, Development, MEF, Software Development | Leave a Comment »

C# generics: Constraints on Type Parameters

Posted by jpluimers on 2011/03/10

I usually forget the exact details on C# constraints when using generics.

One of the especially irritating things is that you cannot apply all the constraints you want.

Some built-in language features are covered by special types in the .NET framework class library, for instance enums.

Which means that code like this will not compile:

        // Error	1	Constraint cannot be special class 'System.Enum'
        public static T StringToEnum(string name) where T : System.Enum
        {
            return (T)Enum.Parse(typeof(T), name);
        }

You need to replace it with the code below, which uses the fact that an enum is a ValueType (hence the struct constraint) implementing the interfaces IComparable, IFormattable and IConvertible constraints: Read the rest of this entry »

Posted in .NET, C#, C# 2.0, Development, Software Development | Leave a Comment »

How to: Back Up a Team Foundation Server

Posted by jpluimers on 2011/03/09

A client tried to backup their TFS server with individual database backups.

You can’t properly restore those backups, because the underlying databases are correlated. The only way to backup them is using maintenance plans like the How to: Back Up a Team Foundation Server link shows.

–jeroen

via: How to: Back Up a Team Foundation Server.

Posted in Development, Source Code Management, TFS (Team Foundation System) | Leave a Comment »

Cool tool: .NET Version Detector

Posted by jpluimers on 2011/03/09

Cool tool from ASoft.NET Version Detector.

.NET Version Detector is a native application, which means it isn’t dependent on any version of .NET to run.

.NET Version Detector is a handy tool for vendors of .NET applications also.

Knowing which versions a user has installed and where they are located on the hard drive.

ASoft allows for a vendor to bundle .NET Version Detector with its application (for free!) so that it is easier to get some generic and exact information on the frameworks.

But before doing so, contact ASoft first!

–jeroen

via: .NET Version Detector.

Posted in .NET, Development, Power User, Software Development | Leave a Comment »

Why is the result of RoundTo(87.285, -2) => 87.28 – Stack Overflow

Posted by jpluimers on 2011/03/08

Programmers on all sorts of platforms get this wrong all the time (I admit having done this in bad ways myself too).

In short: Don’t expect floating point values in a computer to be represented as decimals.

Rob Kennedy wrote a very nice answer on this:

The exact value 87.285 is not representable as a floating-point value in Delphi. A page on my Web site shows what that value really is, as Extended, Double, and Single:

87.285 = + 87.28500 00000 00000 00333 06690 73875 46962 12708 95004 27246 09375

87.285 = + 87.28499 99999 99996 58939 48683 51519 10781 86035 15625

87.285 = + 87.28500 36621 09375

And David Heffernan points to the best link you can get on this topic:

The classic reference on floating point is What Every Computer Scientist Should Know About Floating-Point Arithmetic.

For currency based calculations, if indeed this is, you should use a base 10 number type rather than base 2 floating point. In Delphi that means `Currency`.

–jeroen

via delphi – Why is the result of RoundTo(87.285, -2) => 87.28 – Stack Overflow.

Posted in .NET, C#, Delphi, Development, Software Development | 14 Comments »

If you use MonoTouch for iOS, be sure to update the iOS SDK (it doens’t auto update)

Posted by jpluimers on 2011/03/08

If you don’t update the Apple iOS SDK (which doesn’t auto update), then the Apple Store will reject your MonoTouch apps.

A big thank you to Peter van Ooijen for figuring this out

–jeroen

via: The appstore, iOs versions and Monotouch (4.0 won’t do) | Visual Studio Feeds.

Posted in .NET, Development, MonoTouch, Software Development | Leave a Comment »

Amazon.com: DVI + Audio (SPDIF & Toslink) to HDMI Converter Adapter: Electronics

Posted by jpluimers on 2011/03/07

Since modern TVs don’t do DVI any more, only HDMI, and you need to combine your (digital!, HDMI does not do analog) audio:

device that combines digital video (DVI) and digital audio into HDMI

Edit: this is the same device as this one: http://cableorganizer.com/quest/hdi-6160.html; Amazon is a LOT cheaper!

–jeroen

via Amazon.com: DVI + Audio (SPDIF & Toslink) to HDMI Converter Adapter: Electronics.

Posted in Power User | Leave a Comment »

supportformum.philips.com registration mail sender #fail – unknown sender domain

Posted by jpluimers on 2011/03/07

Sometimes you wonder when companies that have been on the Internet since ages start to adhere at basic rules.

This time it is the Philips SMTP server sending mail from their support forum confirming your new forum registration:


Mar 7 13:21:31 snap sm-mta-rx[13129]: p27CL8xw013129: ruleset=check_mail, arg1=, relay=gw-nam6.philips.com [161.88.253.62], reject=553 5.1.8 ... Domain of sender address pccprd1@pce-1012web107.pce-1012web107 does not exist
Mar 7 13:21:31 snap sm-mta-rx[13129]: p27CL8xw013129: from=, size=3273, class=0, nrcpts=0, bodytype=8BITMIME, proto=ESMTP, daemon=MTA-RX, relay=gw-nam6.philips.com [161.88.253.62]

When sending mail through SMTP, please use a valid sender domain!

–jeroen

Posted in Opinions | Leave a Comment »

Mac Buyer’s Guide: Know When to Buy Your Apple products

Posted by jpluimers on 2011/03/07

When (or when not) to buy a new Mac, iPhone, iPad or iPod.

Purely based on rumours and statistics.

–jeroen

via: Mac Buyer’s Guide: Know When to Buy Your Mac, iPod or iPhone.

Posted in Apple, iPad, Power User | Leave a Comment »

Bolt and fastener chart: what’s that dingus called? – Boing Boing

Posted by jpluimers on 2011/03/07

Very handy chart:

–jeroen

Via: Bolt and fastener chart: what’s that dingus called? – Boing Boing.

Posted in DIY | Leave a Comment »

So much for e-Government: #Amsterdam cannot connect to #DigiD server #fail

Posted by jpluimers on 2011/03/06

So much for e-Government:

Er is geen verbinding met de server. Probeer het later opnieuw.

and

Request is unsuccessful

Those are the messages I get for the last couple of hours when trying to see my community TAX information in Amsterdam.

It means the Amsterdam community TAX office server cannot connect to the country wide government DigiD authentication server.

It basically means that you cannot get reliably get to your on-line TAX information.

Don’t give me the ‘oh, this is outside business hours, we’ll fix it during business hours’ crap.

When you - as a business or government - offer information on-line, people expect it to work 24/7, so you need to have  a system for 24/7 monitoring and response-upon-failure.

The paperless era is still ages away…

–jeroen

via: http://www.dienstbelastingen.amsterdam.nl/taxatieverslag

Posted in Opinions | Leave a Comment »

CeBIT: Cloud computing blijft een droom | Computerworld

Posted by jpluimers on 2011/03/06

Wel een heel interessante research droom:

Cloud computing zal echt doorbreken, maar laten we daar nog niet teveel over dromen

–jeroen

via: CeBIT: Cloud computing blijft een droom | Computerworld.

Posted in Opinions | Leave a Comment »

How To Turn An Old Router Into A Wireless Bridge

Posted by jpluimers on 2011/03/04

Transform your old WiFi router into a WLAN Bridge using DD-WRT:

You may be able to upgrade your old router with a different firmware that will allow it to act as a wireless bridge. That is, turn your old router into wireless bridge. A wireless bridge allows you to connect one network to another over the airwaves, rather than having to run wire from one room to another.

–jeroen

via: How To Turn An Old Router Into A Wireless Bridge.

Posted in Power User, WiFi | Leave a Comment »

Blacklist Check

Posted by jpluimers on 2011/03/04

To check if/why an IP is on a blacklist: Blacklist Check.

–jeroen

Posted in Internet, Power User | Leave a Comment »

.NET JIT bugs

Posted by jpluimers on 2011/03/03

All software contains bugs, so for my own reference, when I bump into one of those below, it is good they are known .NET JIT bugs:

http://stackoverflow.com/questions/2135509/bug-only-occurring-when-compile-optimization-enabled/2135904

http://stackoverflow.com/questions/2056948/net-jit-potential-error/2057228

–jeroen

Posted in .NET, Development, Software Development | Leave a Comment »

Semantic Versioning

Posted by jpluimers on 2011/03/02

It seems so simple that everyone would understand it.

Practice shows this theory is very wrong. So here are the most important rules about Semantic Versioning:

  1. … (see Semantic Versioning)
  2. … (see Semantic Versioning)
  3. … (see Semantic Versioning)
  4. … (see Semantic Versioning)
  5. … (see Semantic Versioning)
  6. Version 1.0.0 defines the public API. The way in which the version number is incremented is now dependent on this public API and how it changes.
  7. Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior.
  8. Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. It MAY be incremented if substantial new functionality or improvements are introduced within the private code. It MAY include patch level changes.
  9. Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY include minor and patch level changes.

–jeroen

via Semantic Versioning.

Posted in Development, Source Code Management | 1 Comment »

They should have pushed object oriented programming a lot more a lot sooner – PHP: Manual Quick Reference

Posted by jpluimers on 2011/03/02

Boy I wished the PHP guys have pushed object oriented programming a lot more a lot sooner.

–jeroen

Via: PHP: Manual Quick Reference.

Posted in PHP, Scripting | Leave a Comment »

Weird Errors With EF4 CTP5 Code First? Close All Database Connections » Danny Thorpe

Posted by jpluimers on 2011/03/01

Often solutions are simple, but the steps finding that simple solution can take a while.

This time, good friend Danny Thorpe found out the hard way using the joungest Community Technology Preview version of Entity Framework 4, he writes:

I don’t claim to know why, but after a day of permutations and combinations, this is what I found cleared the problem for me.

The solution for his problems – all sorts of stranges errors when using DropCreateDatabaseAlways in the Entity Framework – is simple: make sure you don’t have any other connection to your underlying database open.

–jeroen

via: Weird Errors With EF4 CTP5 Code First? Close All Database Connections » Danny Thorpe.

Posted in .NET, Development, EF Entity Framework, Software Development | Leave a Comment »

Ask yourself: “are you writing a framework now?” – How (not) to write Factorial

Posted by jpluimers on 2011/03/01

On the Development Choas Theory blog, I bumped into a brilliant blog post titled How (not) to write Factorial in Java.

It is not about Java, or any other programming language, platform or library for that matter.

It equally applies to your favourite programming language and framework (be it shell scripts, assembler, .NET, Delphi, haskell, PHP, ruby, Eiffel, Java or any other).

It is about the question that Neal Ford taught me quite a while ago that you should ask yourself several times a day:
“Am I writing a framework now?”

Developing software is about only developing the things you really need to.

Framework development is in a totally different league than developing ‘just’ software.
It requires even more thought, attention, testing, etc.
And after that, you need to support it on a different level too.

Frameworks are far more costly than you would guess at first sight…

So only develop a framework  for something (*) if you observe that it is actually used in a lot of places and requires a framework.

(*) insert what you are currently working on here.

–jeroen

Via:  Development Chaos Theory » Blog Archive » How (not) to write Factorial in Java

Posted in .NET, C#, Delphi, Development, Software Development | 6 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 430 other followers