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,860 other subscribers

Archive for the ‘Delphi’ Category

Scala programming language and Venkat Subramaniam videos

Posted by jpluimers on 2015/06/30

A long while ago, someone (it was too long ago, so I sincerely forgot who, it probably was in the JBuilder era) told me that I should try out Ruby and Scala.

I did take a short look at Ruby back then, but since Ruby was so focussed on Web Development, and my heart really wasn’t there, postponed it to the times that the Web would be hot for me.

Then I should have taken a look at Scala (which compiles to Java bytecode), but since I abandoned Java (JBuilder wasn’t nice, Java programming was slow and modern IDEs like IntelliJ IDEA and Eclipse weren’t there yet).

Now that I’ve done truckloads of work in the .NET and Delphi world (including domain specific languages and Pascal based products), I bumped into these Scala videos by Venkat Subramaniam:

Boy, I should have taken a look earlier: like Delphi and C# it is a statically typed compiled language, but it is on steroids.

Yes, I know it leans on the Java bytecode as a run-time platform, but so does the Android SDK as one of the Java Platforms. Contrary Ruby, which with IronRuby runs on .NET and RubyMotion runs Mac and iOS, Scala does not run on the .NET platform any more.

Given the witty way of presenting I’m surely going to follow Venkat Subramaniam and watch some of his other videos too.

Shortly after watching the above I bumped into this video by Steve Yegge (Google): Dynamic Languages Strike Back – YouTube.

–jeroen

Posted in .NET, C#, Delphi, Development, Java, Java Platform, Ruby, Scala, Software Development | 3 Comments »

20 years ago today: Here’s a nickel kid. Go buy yourself a real computer.

Posted by jpluimers on 2015/06/24

An eternal Dilbert strip that is based on the tiny Here’s a nickel kid. Go buy yourself a real computer fragment from single.h:

#if _FP_W_TYPE_SIZE < 32
#error "Here's a nickel kid. Go buy yourself a real computer."
#endif

Read the rest of this entry »

Posted in *nix, ARM, Assembly Language, Delphi, Delphi 1, Development, Fun, Geeky, History, MS-DOS, Power User, Software Development, Windows, Windows 8.1, Windows 95, Windows NT, x86 | 2 Comments »

Aspect Oriented Programming in Delphi

Posted by jpluimers on 2015/06/24

I’ve been doing Aspect Oriented Programming (AOP) in .NET for a long while, mostly using PostSharp LAOS as that was the first AOP .NET library I encountered (5 years ago it became PostSharp 2.0, now it is already at its 10th anniversary!).

AOP allows you to perform separate of concerns (SoC) in your application, especially in the area of cross-cutting concerns like for instance logging, authorization, monitoring, etc.

It took a while in Delphi to allow for AOP, but the TVirtualMethodInterceptor (that introduced in Delphi 2010) can be used to do AOP (only for Virtual Methods, which is still way better than having no AOP at all).

The code requires a lot of manual labor. so I was glad that DSharp (a great library by Stefan Glienke – one of the leading Spring4D contributors) contains a nice wrapper around TVirtualMethodInterceptor so you can use AOP in an attribute based fashion.

Nick Hodges recorded a good introductory video on AOP in Delphi with slides and demo code:

Note that besides DSharp, also MeAOP and Infra provided support for AOP in Delphi, but these haven’t had updates since 2010.

Read the rest of this entry »

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, C# 6 (Roslyn), Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | Leave a Comment »

Yahoo Pipes Blog – Pipes End-of-life Announcement

Posted by jpluimers on 2015/06/05

Too bad. It was fun while it lasted: Yahoo Pipes Blog – Pipes End-of-life Announcement (thanks to Dennis for reporting this).

Which means that in a few months time, this pipe will be gone: Delphi Pipe – Delphi related RSS feed running on Yahoo Pipes – via twm’s blog « The Wiert Corner – irregular stream of stuff.

There is an alternative: http://www.beginend.net/

That redirects to https://www.beginend.net/ which works fine from home, but at the client for I the McAfee gateway currently cannot handshake to it:

Host: http://www.beginend.net

Reason: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

Anyone who knows what that is?

–jeroen

 

Posted in Delphi, Development, Software Development | Tagged: , | 11 Comments »

HTML book “Multithreading – The Delphi Way..” (via: How do I perform processing in multiple threads in Delphi? – Stack Overflow)

Posted by jpluimers on 2015/06/04

Interesting book:

Quote:

This is a comprehensive tutorial on thread programming, containing over 50 example pieces of source code.

Improvements to Version 1.1 include:
Read the rest of this entry »

Posted in Delphi, Delphi 5, Delphi 6, Delphi 7, Development, Software Development | 2 Comments »

The Zen Of Programming

Posted by jpluimers on 2015/05/27

From The Zen Of Programming:

The novice thought for a moment. “I will design a new editing program,” he said, “a program that will replace all these others.”

There are different forms of the above.

Think about them for a while.

Then name at least three.

Now go back to work.

–jeroen

via: The Zen Of Programming.

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

Woot: AsciiImage for Delphi http://memnarch.bplaced.net/blog/?p=129

Posted by jpluimers on 2015/05/21

Woot!

AsciiImage for Delphi by Alexander Benikowski on GitHub repository Memnarch/AsciiImage..

AsciiImage for Delphi

AsciiImage for Delphi

–jeroen

via: And here it is: AsciiImage for Delphi http://memnarch.bplaced.net/blog/?p=129.

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

On the Delphi TCommandParser class for parsing command-lines and arguments (via: Suggestions for how to define command line parameters – Stack Overflow)

Posted by jpluimers on 2015/05/13

A while ago, I posted [WayBack] the below StackOverflow answer. Recently a friend asked me about command-line parsing in Delphi, so here is the re-run:

Delphi contains a really nice unit called CommandParser with a [WayBack] TCommandParser class that does commandline parsing for you. Since it has [WayBack] virtually no documentation, here are a few things to get started. It works even in Delphi 2007.

I have a HiddenExecutable example at our open source bo repository.

Basically you:

  • TComponent that contains the properties you want to expose as commandline parameters (that is THiddenExecuteSettings in the HiddenExecuteSettingsUnit
  • a commandline parser controller. In our case THiddenExecuteArguments in theTHiddenExecuteArgumentsUnit (in retrospect not such a good name) that contains an InitCommandLine method that sets up a TCommandParser instance passing it your TComponent
  • It then executes a couple of [WayBack] AddSwitch calls to setup the parameters with both abbreviated and full commandline switches (like h and help)
  • ProcessCommandLine method on the TCommandParser instance to process the commandline and fill the properties of your TComponent (in my example, this is done in the ProcessCommandLine method).

Now comes the fun:

  • TCommandParser has a HelpText method that fully automatically assembles a helptext based upon what you fed it with the AddSwitch methods.
  • TCommandParser also has a SaveOptions method that allows you to save the current settings of your TComponent into a settings file.

The Delphi units you need are these which you can get from the Embarcadero [WayBack] radstudiodemos.sourceforge.net demo repository:

CommandParser in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\Utils\CommandParser.pas',
PropertyHelpers in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\DbxDataPump\PropertyHelpers.pas',
ParseIds in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\DbxDataPump\ParseIds.pas',

Edit: [WayBack] John Kaster wrote a nice [WayBack] article on EDN that includes [WayBack] more details on using the TCommandParser.

Note the above mentioned code mostly is on [WayBack] https://bitbucket.org/jeroenp/wiert.me/src/tip/Native/Delphi/Apps/Console/HiddenExecuteConsoleProject

Since Delphi XE7, this unit does not ship with Delphi any more, but it is still at [WayBack] RAD Studio Demo Code / Code / [r2029] /branches/RadStudio_XE6/Object Pascal/Database/dbExpress/Utils/CommandParser.pas.

–jeroen

via: [WayBack] delphi – Suggestions for how to define command line parameters – Stack Overflow.

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 4 Comments »

Delphi Component vendors: when you ship source code, make it IDE-browsable as well by compiling with $YD or $Y+

Posted by jpluimers on 2015/05/06

It took me a while to figure this one out:

When you have a registered Delphi, you can Ctrl-Click browse both the units and symbols of RTL, VCL, etc. But Delphi will not recompile these units.

Some third party components you cannot Ctrl-Click browse the units or symbols, unless you put the source directory in the Delphi Library Path (which causes them to be compiled each and every time).

This is because:

  • the precompiled DCUs are in the Delphi Library Path.
  • the source code is added to the Delphi Browsing Path (and sometimes not even that).
  • the DCUs don’t contain information that the source code is Browsable or Referencable as it was compiled with {$Y-}.

These are the possible values for that directive:

  1. {$Y-} or {$DEFINITIONINFO OFF} or {$REFERENCEINFO OFF},
  2. {$Y+} or{$REFERENCEINFO ON},
  3. {$YD} or {DEFINITIONINFO ON}

So please component vendors: when you ship source code, make it IDE-browsable as well by compiling with $YD or $Y+.

–jeroen

via:

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | 2 Comments »

Lars Fosdal: VS/C#6 is out-delphi-ing Delphi. I hope EMBT is paying attention. Currently…

Posted by jpluimers on 2015/05/01

Interesting, Lars Fosdal writes:

VS/C#6 is out-delphi-ing Delphi.

I hope EMBT is paying attention.

Currently live at http://channel9.msdn.com/

I already liked the 7 minute C#6 video from last year. This is even better.

–jeroen

via: VS/C#6 is out-delphi-ing Delphi. I hope EMBT is paying attention. Currently….

Posted in .NET, C#, C# 6 (Roslyn), Delphi, Development, Software Development, VB.NET, VB.NET 14.0 | 10 Comments »