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

Delphi Spring, Mocks and how to use them: some links

Posted by jpluimers on 2011/09/27

Now that there is Spring and Mocks for Delphi, it is time to post a few links:

Hope you enjoy them as much as I do!

–jeroen

Posted in Delphi, Development, Software Development | 3 Comments »

A few more classics on BitSavers in the /pdf/borland tree

Posted by jpluimers on 2011/09/27

Hope you like these classics from the early Borland era:

Oh, and if you – like me – started in the Apple ][ and Lisa era, there are lots of nice documents of Apple products from that period to, for instance:

–jeroen

Via: Index of /pdf/borland.

Posted in BitSavers.org, Delphi, Development, History, Software Development | 5 Comments »

C# Using Blocks can Swallow Exceptions | DigitallyCreated

Posted by jpluimers on 2011/09/22

I got to the SafeUsingBlock extension method because of a nice StackOverflow thread on exceptions swallowed in a using block.

Actually, you can broaden the case into a wider scope: in any language when you protect resources in a try finally block (essentially, a using will turn into an implicit try finally block), and both the core logic and the finally throw an exception, the exception from the core block is swallowed.

Simple C# example:

using System;
public class Example
{
    public void Main()
    {
        try
        {
                try
                {
                    throw new ApplicationException("logic block");
                }
                finally
                {
                    throw new ApplicationException("finally block");
                }
        }
        catch (Exception error)
        {
            Console.WriteLine(error.ToString());
        }
    }
}

Simple Delphi example:

program Example;
begin
  try
    try
      raise Exception.Create('logic block');
    finally
      raise Exception.Create('finally block');
    end;
  except
    on error: Exception do
    begin
      Write(error.ClassName, ' ', error.Message);
    end;
  end;
end.

Both examples will only write out the finally block exception message, not the logic block exception message.

This is a corner case (like the example from the MSDN documentation), from which the SafeUsingBlock protects you from by providing an AggregateException class.

In C#, it is a guideline to avoid throwing exceptions in the Dispose when implementing the disposable pattern.

This is good practice in any programming environment: when disposing objects, only throw exceptions in very critical situations when the containing process has been corrupted.

Practically this is very easy as the disposers are very thin and should not contain any business logic, so it is pretty easy to spot places where the program state really is corrupt.

An other alternative is for instance have a Close method that throws an exception, and a disposer not throwing.

–jeroen

via C# Using Blocks can Swallow Exceptions | DigitallyCreated.

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

MQCONNX 2058 (080A) (RC2058): MQRC_Q_MGR_NAME_ERROR

Posted by jpluimers on 2011/09/21

Solved a “2058 (080A) (RC2058): MQRC_Q_MGR_NAME_ERROR” error when calling MQCONNX; My bad.

I forgot that both the Queue Manager name must be passed both as the pQMgrName parameter and as the ClientConnPtr (MQCD).QMgrName of the ConnectOpts (MQCNO) parameter to MQCONNX.

–jeroen

Posted in Development, MQ Message Queueing/Queuing, Software Development, WebSphere MQ | Leave a Comment »

Comparisons for EBCDIC CCSID 37, 500 and 1047

Posted by jpluimers on 2011/09/20

The referenced article explains the difference in code points between EBCDIC CCSID 37 and EBCDIC CCSID 500, and the difference in code points between EBCDIC CCSID 37 and EBCDIC CCSID 1047:
IBM CCSID Comparisons – United States.

Basically, these are the codepoints that are sensitive:

4A, 4F, 5A, 5F, AD, B0, BA, BB and BD.

–jeroen

Posted in Development, EBCDIC, Encoding, MQ Message Queueing/Queuing, Software Development, WebSphere MQ | Leave a Comment »

Dropbox – Simplify your life – easy way to sync your iOS Delphi XE2 FireMonkey stuff between your Mac and PC

Posted by jpluimers on 2011/09/20

One of the things hard when doing FireMonkey iOS development Delphi XE2 is that you have a multi stage process:

  1. Develop and test using Delphi XE2 on Windows
  2. Compile and deploy on the iOS Simulator using xCode on OS X
  3. Deploy on the real iOS hardware using xCode OS X

Basically you need to share your project files both ways between Windows and OS X.

Naturally, you would share files between your Mac and Windows using Samba. With the introduction of OS X Lion, the Samba support was rewritten, causing all sorts of problems.

One of the problems is that it uses a lot of CPU (I tried copying over a 40GB VM, and stopped because the fan in my MacBook Air was making so much noise, I was afraid it was going to take off).
I didn’t even realize it had one, but a MacBook Air has a Fan, and it vents through the keyboard :)

Now I use DropBox to share files between it. If you like that to, sign up with the URL at the end of this line. The 2GB account is free! http://db.tt/6f95UJW

And if you know a better way of sharing: please let me know!

–jeroen

Via: Dropbox – Referrals – Simplify your life.

Posted in Apple, Delphi, Development, FireMonkey, Mac OS X 10.7 Lion, Power User, Software Development | 15 Comments »

aacPlusCLI – encoding AAC+ from the commandline using Coding Technologies aacPlus encoder enc_aacPlus.dll from WinAmp

Posted by jpluimers on 2011/09/15

Just found out about this open source project aacPlusCLI.

Nice C++ stuff!

–jeroen

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

Windows Metro Style Apps Developer Downloads: very early version of Windows 8

Posted by jpluimers on 2011/09/14

The download page states

The Windows Developer Preview is a pre-beta version of Windows 8 for developers.

But of course this is also interesting to designers and regular users: getting a hands-on impression of what Metro will bring to Windows 8.

–jeroen

via: Windows Metro Style Apps Developer Downloads.

Posted in .NET, Delphi, Development, Power User, Software Development, Windows, Windows 8 | 2 Comments »

Delphi XE2 x64 Extended floating point support: CodeCentral 28488 TExtendedX87: FPU-backed 80-bit Extended type for Win64

Posted by jpluimers on 2011/09/14

in the Delphi 64 world, there is no official support for the Extended data type for various reasons.

If you really need it, then you can use the TExtendedX87 unit by Philipp M. Schlüter as mentioned in this Embarcadero forum thread.

–jeroen

Via: 28488 TExtendedX87: FPU-backed 80-bit Extended type for Win64.

Posted in Algorithms, Delphi, Delphi x64, Development, Floating point handling, Software Development | 2 Comments »

Windows WebSphere MQ client DLLs

Posted by jpluimers on 2011/09/14

There are multiple DLLs you can use as MQ Client.

Most interfaces directly or indirectly use MQM.DLL, which is the interface to the local running WebSphere MQ Manager.

But sometimes your installation doesn’t contain a local WebSphere MQ Manager, and you need to connect remotely as a client.

You need one of these client DLLs, depending if you are using extended architecgture (XA) or not:

  • mqic.dll: Connect as a non-XA client
  • mqicxa.dll: Connect as a XA client

Note that depending on x86 machines, the DLLs can be called mqic32.dll and mqicxa32.dll as well.

–jeroen

via: WebSphere MQ – Defining which connection type to use.

Posted in Development, MQ Message Queueing/Queuing, Software Development, WebSphere MQ | Leave a Comment »