The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

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

    Join 1,839 other subscribers

Archive for the ‘Development’ Category

.NET/C# – InvalidCastException for two Objects of the same type (via: G+/Stack Overflow)

Posted by jpluimers on 2013/08/03

If you ever get something similar to

InvalidCastException: [A]Person cannot be cast to [B]Person.

then you are (or more precise: your process is) probably loading the same assembly twice, but from a different context.

.NET allows that, and for reason (side by side loading, appdomains, etc).

Delphi doesn’t (thanks Warren Postma for noticing). But a mistake you see quite often is that Delphi developers try to load the same Delphi type from both an EXE and a DLL wondering why they don’t match. If you want to spread your types in Delphi, then use BPLs (run-time packages) for that. BPLs are similar to .NET assemblies, but cannot be loaded in memory twice.

–jeroen

via c# – InvalidCastException for two Objects of the same type – Stack Overflow.

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 8.0, VB.NET 9.0, Visual Studio 11, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

The rather cool programming language APL introduced in a 1975 film/video (via G+: Warren Postma)

Posted by jpluimers on 2013/08/03

Thanks Warren Postma post posting this in #Programming to which I added a few context links:

The rather cool programming language APL introduced in a video/film from 1975. Read the rest of this entry »

Posted in APL, Development, Keyboards and Keyboard Shortcuts, Power User, Software Development | Leave a Comment »

Delphi: Embarcadero Summer School lesson 6 Q&A (Powerful multi-tier applications with DataSnap.)

Posted by jpluimers on 2013/08/01

Lesson 6 of the Embarcadero Mobile Development Summer School was titled Powerful multi-tier applications with DataSnap.

Download of the video will be at streaming.embarcadero.com/summerschool2013.

The Twitter coverage is at Twitter / Search – #embtdd.

Here is the Q&A chat for that session: Read the rest of this entry »

Posted in Delphi, Delphi XE4, Development, Software Development | Leave a Comment »

Some cloud storage / online backup providers compared (DropBox, Sugarsync, Bitcasa, …)

Posted by jpluimers on 2013/07/31

I’ve been using a few cloud storage / online backup providers for a while on Mac and Windows now, with the primary goals of

  • being able to sync data between machines
  • having a backup online

Here are some pros/cons. Read the rest of this entry »

Posted in Cloud Apps, Development, DropBox, Encoding, Internet, Power User, SocialMedia, Software Development, Unicode | 4 Comments »

Getting a fresh root hint file on SUSE 12.x

Posted by jpluimers on 2013/07/31

Wrote a small script that goes into my monthly crontab.

It gets ftp://ftp.internic.net/domain/named.cache into /var/lib/named/named.cache.new, and logs when you need to copy it over into /var/lib/named/root.hint

Read the rest of this entry »

Posted in *nix, Development, Linux, Power User, Scripting, Sh Shell, Software Development, SuSE Linux, wget | Leave a Comment »

Conversion between absolute and relative paths in Delphi – Stack Overflow

Posted by jpluimers on 2013/07/30

A while ago, I needed routines to work with absolute and relative paths on Windows.

These links were very useful:

  1. The Delphi TPath.IsDriveRooted function (I think it was introduced in Delphi 2010) serves as a IsPathAbsolute function
  2. Conversion between absolute and relative paths in Delphi – Stack Overflow showing how to use the Windows API functions PathRelativePathTo and PathCanonicalize functions declared in the ShLwApi unit to create AbsToRel and RelToAbs functions.

Thanks Andreas Rejbrand and David Heffernan for the last two!

–jeroen

via: Conversion between absolute and relative paths in Delphi – Stack Overflow.

Posted in Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | 4 Comments »

Delphi: do not do “if (not DirectoryExists(path)) then ForceDirectories(path))”

Posted by jpluimers on 2013/07/26

During code reviews, I often see people do things like this:

if (not DirectoryExists(Path)) then
  ForceDirectories(Path))

or this:

if (not TDirectory.Exists(Path)) then
  TDirectory.CreateDirectory((Path))

Half a year ago, I wrote about .NET/C#: do not do “if (!Directory.Exists(path)) Directory.CreateDirectory(path))”. Read the rest of this entry »

Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | 16 Comments »

SVN/Subversion and CodePlex: for now stick to SVN/TortoiseSVN 1.7.x or lower

Posted by jpluimers on 2013/07/25

Introduction

Over the last month or so, two incompatibilities between SVN and CodePlex have risen. I’m not sure which side caused it (see below for the error messages), who will fix it and when. Some details I bumped into.

CodePlex knows about both issue. I’m not sure the SVN team does yet about the second issue.

Recommendation

If you are using CodePlex with SVN/SubVersion, then you shoud stick to SVN versions lower than 1.8, or you will run into the error messages below.

So:

  • Stick to version 1.7.x or lower of SVN and/or TortoiseSVN.
  • DO NOT UPGRADE YOUR LOCAL CHECKOUT TO 1.8 OR HGHER!
    (you cannot downgrade your local checkout to a lower version)

You can find older 1.7.x versions of SVN here:

Issues with CodePlex and SVN 1.8.x Read the rest of this entry »

Posted in CodePlex, Development, Source Code Management, Subversion/SVN, TFS (Team Foundation System) | Tagged: , | 17 Comments »

Embarcadero SummerSchool 2013 Lesson 4 Q&A

Posted by jpluimers on 2013/07/25

Replay video’s can be viewed through streaming.embarcadero.com (where you can also find the other series, downloads, etc).

The SummerSchool 2013 replay videos are at streaming.embarcadero.com/summerschool2013.

The Q&A from today’s session on “Accessing local storage” demonstrating iOS specifics in Delphi XE4: Read the rest of this entry »

Posted in Delphi, Delphi XE4, Development, Software Development | Tagged: , , , , , | Leave a Comment »

Reminder to Self: Messagepack / BSON / ProtocolBuffers

Posted by jpluimers on 2013/07/25

Need to find/create a Delphi compatible version of Messagepack or BSON.

–jeroen

via Serializing and deserializing (packing/unpacking) to a file and/or memorystream with MessagePack in C# ».

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Delphi XE2, Delphi XE3, Development, Software Development | 4 Comments »