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

ModelMaker Code Explorer 9.1.0 available for Delphi XE2

Posted by jpluimers on 2011/09/08

ModelMaker Code Explorer 9.1.0 was released yesterday which supports Rad Studio / Delphi XE2.

Highly recommended for building and refactoring Delphi applications!

–jeroen

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

Cleanup: IntelliTrace Log ( .iTrace ) files and Visual Studio 2010 SP 1

Posted by jpluimers on 2011/09/08

While cleaning up my system, I found a while bunch of .iTrace files in “C:\Documents and Settings\All Users\Application Data\Microsoft Visual Studio\10.0\TraceDebugging” on a Windows XP system at a client that yet has to upgrade to newer Windows versions that store them under “C:\Users\All Users\Microsoft Visual Studio\10.0\TraceDebugging”.

Contrary to what IntelliTrace iTrace files and IntelliTrace Log ( .iTrace ) files and Visual Studio 2010 SP 1– Some Hidden Stuff « Abhijit’s World of .NET explains, these files are not always automatically removed.

And they are big, since Visual Studio 2010 Ultimate will automatically generate them.

So it is important to once in a while cleanup the “C:\Documents and Settings\All Users\Application Data\Microsoft Visual Studio\10.0\TraceDebugging” directory manually.

–jeroen

Posted in .NET, Development, Software Development, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

WebSphere MQ Client 5.3 and 7.0

Posted by jpluimers on 2011/09/07

After having worked earlier with other Message Queuing systems like AS/400 Data Queues, MSMQ, Apache ActiveMQ and Oracle AQ, I recently was involved using IBM WebSphere MQ. WebSphere MQ Clients are available for free on many platforms. The project involved using WebSphere MQ Client 5.3 and will most likely upgrade to 7.0, so here are some download links that help during the process of preparing for the upgrade:

One of the reasons for being at least at V6.0, is that it allows you to specify credentials during a MQCONNX call and using MQCNO_VERSION_5 which enables the use of the SecurityParams (a demo is here) of the MQCNO structure. There is much more to diff, so hopefully more on that later.

–jeroen

Posted in Development, MQ Message Queueing/Queuing, Software Development, WebSphere MQ | 5 Comments »

EmbarcaderoTechNet’s Channel – YouTube

Posted by jpluimers on 2011/09/06

EmbarcaderoTechNet published a couple of interesting videos on YouTube covering Delphi XE2 including FireMonkey HD/3D, FireMonkey xPlatformVCL Styles and more.

All of them short (couple of minutes each) studio work with good video and audio quality (they default to 360p, but most are available in 720p HD, some just in 480p).

–jeroen

Via: EmbarcaderoTechNet’s Channel – YouTube.

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

Entity Framework: simple solution for cryptic error message “System.NotSupportedException: Unable to create a constant value of type ‘System.Object'”

Posted by jpluimers on 2011/09/06

The drawback of using ORM layers is that often the error messages are very cryptic, and it takes some getting used to in order to find the (often deceptively) simple solution.

This case was an Entity Framework wrapper around a SQL Server database where the primary and foreign keys were all GUIDs, and some of the foreign keys were optional.

So the generated model has a mixed use of Guid? and Guid data types.

Below is the full stack trace, but here is the exception class and message:

System.NotSupportedException: Unable to create a constant value of type ‘System.Object’. Only primitive types (‘such as Int32, String, and Guid’) are supported in this context.

The exception is caused by a piece of code like this:

        public static long CountChildren(ParentEntity parentEntity)
        {
            using (EntitiesObjectContext objectContext = new EntitiesObjectContext())
            {
                Guid? parentId = parentEntity.ID;

                if (null == parentId)
                    throw new ArgumentNullException("parentEntity.Id");

                IQueryable<ChildEntity> ChildEntitys =
                    from content in objectContext.ChildEntity
                    where content.ParentID.Equals(parentId)
                    select content;

                long result = ChildEntitys.Count(); // BOOM!

                return result;
            }
        }

The stack trace at the end of this post contains a truckload of ExpressionConverter lines. Since the LINQ expression contained only one WHERE clause, the mentioning of the list of primitive types in the message (Int32, String, and Guid) made me change the code into the one below.

Read the rest of this entry »

Posted in .NET, .NET ORM, C#, Development, EF Entity Framework, Software Development | 5 Comments »

Rad Studio XE2 demos up at SourceForge.net: Repository – [radstudiodemos] Index of /branches/RadStudio_XE2

Posted by jpluimers on 2011/09/05

Note to Self:

A few days ago, the Rad Studio XE2 demos became available at sourceforge.net: SourceForge.net Repository – [radstudiodemos] Index of /branches/RadStudio_XE2.

You can get them by SVN as well: http://sourceforge.net/projects/radstudiodemos/develop

–jeroen

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

vervolg op #yellowbrick en #anwb #fail: wachten op yellowbrick, anwb gelukt, maar foute informatie

Posted by jpluimers on 2011/09/02

Kort geleden schreef ik over de #yellowbrick en #anwb #fail: Als de website nu ook nog nice was… (deal: ANWB – Ledenvoordeel – Yellowbrick – gratis registratie).

Inmiddels is er lichte voortgang:

  1. Mijn ISP heeft ervoor gezorgd dat deze specifieke anwb mail door de SPAM filters gaat komen.
  2. Stappenplan voor de ANWB uit de vorige post gevolgd (zo weinig mogelijk invullen) en: het heeft gewerkt, want ik hem me opnieuw bij de ANWB kunnen aanmelden.
    Helaas heb ik niet mijn favouriete inlognaam kunnen gebruiken, die ik bij mijn vorige aanmelding jaren geleden wel had: die was natuurlijk niet gereserveerd, maar al aan iemand anders vergeven.
    Gelukkig ging deze keer de mail wel goed, met dank aan mijn ISP voor het goede werk, zie de log onderaan.Even daarna via de bevestigingslink in de e-mail naar de ANWB site gegaan en ja, waarmempel:- mijn account is aangemaakt
    – ik kan inloggen
    – de site vertelt onjuist dat ik sinds 1 januari 2007 lid ben (gelukkig weet mijn lidmaatschapspas wel dat ik in 1992 lid geworden ben)
  3. Van Yellowbrick heb ik een initiële bevestigingsmail gehad dat ik over enkele werkdagen (eeuwig in het internettijdperk!) mijn ‘klantnummer en informatie om uw persoonlijke “Mijn Yellowbrick” pagina te activeren’ wordt gerstuurd en dat daarna .
    Pas daarna worden kaarten verstuurd.
    Kortom: dit weekeinde kan ik vast Yellowbrick nog niet gebruiken :(

Kortom: Read the rest of this entry »

Posted in Opinions, Power User, User Experience (ux) | Leave a Comment »

Excel XML Spreadsheet: going the XSLT way

Posted by jpluimers on 2011/09/01

Because of Excel XML Spreadsheet: Date.Type is mandatory :), I researched a bit more about how people use the XML Spreadsheet format.

I found that Technobabble is using XSL to generate Excel XML Spreadsheets.

Be patient following the above link; it takes a while to completely load, and while loading the style sheet shows black text on a dark grey background :) When loaded completely, the background becomes white.

The article talks more about styles and formulas (XML Spreadsheets store formulas in relative R1C1 style notation which is far easier to parse than the absolute A1 style notation, which most people use).

It seems to imply that for a ss:Column, a ss:AutoFitWidth of 1 (True) combined with a specified ss:Width will autosize text values, but the ss:Column documentation is right: “We do not autofit textual values”.

The default Excel 2003 font has a Width of about 7 points per character, so you can use that as a base to calculate ss:Width values for a column.

–jeroen

Posted in Development, Software Development, XML, XML/XSD, XSD | Leave a Comment »

.NET SecureString – storing/retreiving passwords and other sensitive data

Posted by jpluimers on 2011/08/31

Let me start that you should store as little sensitive information as possible. But if you do, you should store it in a secure way. That’s why the .NET 2.0 introduced the SecureString class.

I won’t go into detail here, as the links below and the demo source do that much better than I can:

One warning: be very cautious when you convert a SecureString in a regular unsecure array of characters, string, or compare the unsecured content. To quote Fabio Pintos, everytime you do, a little village bursts on fire. When you access it in an insecure way, make sure it is pinned, clear and release the insecure memory as soon as possible.

The problem with a garbage collected environment like .NET is that strings live on the heap, and you can’t deterministically eliminate a string from memory like you could in deterministic environment like Delphi or C/C++.

Have fun with it!

–jeroen

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

Batch file to get parent directory (not the directory of the batch file, but the parent of that directory)

Posted by jpluimers on 2011/08/30

The problem solved here is two-fold:

  1. The ~dp syntax for getting the directory/path part only works for parameters and loop indexes, not on variables.
    You can work around this by having a 1-iteration for-loop.
  2. The :~ syntax for getting the substring works only for variables, not for parameters and loop indexes.
    You can work around this by assigning to a temporary variable.

Example:

  echo batchfile=%0
  echo full=%~f0
setlocal
::http://stackoverflow.com/questions/636381/what-is-the-best-way-to-do-a-substring-in-a-batch-file
  set Directory=%~dp0
echo Directory=%Directory%
:: strip trailing backslash
  set Directory=%Directory:~0,-1%
echo %Directory%
::  ~dp does not work for regular environment variables:
::  set ParentDirectory=%Directory:~dp%  set ParentDirectory=%Directory:~dp%
::  ~dp only works for batch file parameters and loop indexes
  for %%d in (%Directory%) do set ParentDirectory=%%~dpd
  echo ParentDirectory=%ParentDirectory%
endlocal

This will show:

  1. The directory of the batch file
  2. The directory but without the trailing backslash
  3. The parent directory of the batch file

Hope you can give this some use.

–jeroen

Posted in Batch-Files, Development, Power User, Scripting, Software Development | Leave a Comment »