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

Archive for the ‘Event’ Category

Foto’s 14e editie van de Katwijkbinse Truckrun – Oranjevereniging Katwijk a/d Rijn

Posted by jpluimers on 2011/08/22

Afgelopen zaterdag was alweer de 14e editie van de Katwijkbinse Truckrun.

Dit geweldige evenement laat mensen met een verstandelijke beperking meerijden in één van de 100 trucks en 3 touring cars door de bollenstreek.

Ook dit jaar mocht ik mijn broer wegbrengen en ophalen, en heb meteen de kans schoon gezien ‘s ochtends en ‘s middags wat foto’s te schieten van de trucks op het voormalige Marinevliegkamp Valkenburg.

  • Foto’s ochtend (foto’s op volgorde van binnenkomst, het blauwe formulier achter elk raam bevat het trucknummer)
  • Foto’s middag (foto’s op volgorde van Trucknummer)

Dit jaar was de eerste keer dat de vrachtwagen van Adest Musica mee mocht rijden.

Met nieuwe bestickering van al onze sponsors luidt dit twee belangrijke dingen in:

  1. De Adest Night of Music op 8 oktober die de Rotary Sassenheim samen organiseert, en waar – samen met de diverse afdelingen van Adest Musica – de bekende trombonist Ben van Dijk, saxofonist Wouter Kiers en partyband Ain’t no Secret zullen optreden.
    De opbrengst komt ten gunste van de Jeugdband van Adest Musica, en natuurlijk geven zij die avond ook een mooi optreden!
  2. De aanloop naar het Wereld Muziek Concours 2013 (de tijd gaat snel: over 2 jaar dat alweer achter de rug!) waar de Drum- en Showband Adest Musica weer een puik product gaat neerzetten.

Ben je trucker of deelnemer, en wil je graag originele foto’s, laat het dan even weten via het contactformulier: vul in ieder geval het nummer van je Truck in.

Ben je benieuwd naar Adest Musica? Schrijf je in voor de nieuwsbrief van Adest’ Night of Music!

Volgend jaar is de 15e Katwijkbinse Truckrun, tot dan!

–jeroen

via: Oranjevereniging Katwijk a/d Rijn.

Posted in About, Adest Musica, Event, Personal, Truckrun | Leave a Comment »

ISO 8601 Date, Time and DateTime in Delphi (was: Simple example to show DateTime.Now in ISO 8601 format on ideone.com | Online C# Compiler & Debugging Tool)

Posted by jpluimers on 2011/08/18

In the past I wrote about a Simple example to show DateTime.Now in ISO 8601 format on ideone.com | Online C# Compiler & Debugging Tool , using ISO 8601 in batch-files, and how ISO 8601 is used in Google Calendar URLs.

Time to write something about ISO 8601 Date, Time and DateTime and Delphi.

First of all the DateUtils unit contains a bunch of routines (for instance DecodeDateWeek) that understand ISO 8601 week numbers, where:

  • Weeks start at Monday
  • The first week of a year contains (these are equivalent):
    • The first thursday in that year
    • Has at least 4 days in that year
    • Contains the 4th of January

Otherwise the week containing January 1st is week 52 or 53 of the previous year

ISO 8601 also specifies how to format Dates, Times,  DateTimes and durations according to some basic principles.

XML uses ISO 8601 to format Date, Time and DateTime and some other formats as text too.

So it is no wonder that since Delphi 6, it contains a XSBuiltIns unit covering (among other things) ISO 8601 formatting.

Given the many Delphi ISO 8601 relates questions on StackOverflow of which I answered two, and my need for ISO 8601 DateTime conversion for exporting Excel XML, here is are some samples to get started in the unit below (and in this codeplex changeset).

The unit covers Date, Time and DateTime.
You can write similar code for Duration.

Oops, I covered it already in ISO 8601: Delphi way to convert XML date and time to TDateTime and back (via: Stack Overflow)

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, Event, ISO 8601, Power User, Software Development | 4 Comments »

Speaking at DelphiLive! 2011 in San Jose, CA, USA from September 12th to 14th 2011

Posted by jpluimers on 2011/08/04

I’ll be speaking at a few conferences this fall.

The furthest for me will be DelphiLive! 2011 in San Jose, CA, which will be held from September 12th to 14th (slightly more than a month from now).

Note that if you want to come, the early bird discount is until augusts 15!

Part of the sessions and speakers lists are already published, but it will be extended shortly (some nice Delphi XE2 sessions are in the pipeline), followed by a workshop tutorials list, and agenda.

My sessions are going to be these:

Not everything for those sessions is set in stone yet, so if you have ideas for things I should include, exclude, emphasize or understate, please let me know.

I’m looking forward to meet (often again!) a lot of attendees and speakers.

The social part of conferences is very important too.
Last year, after the conference, a few speakers, attendees and other people had a marvelous steak dinner. Great fun!

Hope to see a few of my blog readers at one conference or the other.

–jeroen

PS: Like last year, the conference will be held at Crowne Plaza Hotel San Jose Downtown, 282 Almaden Boulevard, San Jose, CA 95113, USA (it has a special room rate of USD 139 per night for conference attendees).

PS2: Some more events will follow shortly.

Posted in Conferences, Delphi, DelphiLive, Development, Event, Software Development | 1 Comment »

ISO 8601: Delphi way to convert XML date and time to TDateTime and back (via: Stack Overflow)

Posted by jpluimers on 2011/07/19

Recently I needed a way of concerting back and forth ISO 8601 DateTime values used in XML from Delphi.

Thoug the Delphi DateUtils unit has some ISO 8601 features for calculating week numbers, you actually need to the XSBuiltIns unit for converting back and forth to ISO 8601 text representation of a DateTime.

I remembered answering the related In Delphi is there a function to convert XML date and time to TDateTime question on StackOverflow a while ago (and forgot that this was back in 2009 <g>).

ISO 8601 dates can either include a time-zone, or be in UTC, which is not part of that answer. So lets elaborate on that answer a bit now:

UTC times in ISO 8601 format end in a Z time zone designator like this:

    <Created>2011-06-29T17:01:45.505Z</Created>

The Z UTC indicator is basically a shortcut for a timezone offset of +00:00 or -00:00, effectively being a zero (or zulu) timezone.

Nonzero timezones start with an optional + or -, followed by the hours and minutes offset from UTC, for instance +01:00 for the Central European Time zone.

    <Created>2011-06-29T17:01:45.505+01:00</Created>

When you want historical time zones, then you need the Delphi TZDB interface to the historical TZ database.

To do the timezone calculations, I used the TimeZoneBias function from Indy, which is either in the IdGlobal unit (Indy <= version 9) or the IdGlobalProtocols unit (Indy 10 and up).

Conversion is done by using the TXSDateTime (that like all the XS conversion classes descends from TRemotableXS in the InvokeRegistry unit).

Most of the classes descending from TRemotableXS contain two methods: NativeToXS and XSToNative doing the underlying conversions.

Since I didn’t need the historical reference in the TZDB, this is the code that I came up with:

unit Iso8601Unit;

interface

type
  TIso8601 = class(TObject)
  public
    class function DateTimeFromIso8601(const Value: string): TDateTime; static;
    class function UtcDateTimeToIso8601(const Value: TDateTime): string; static;
    class function DateTimeToIso8601(const Value: TDateTime): string; static;
    class function UtcNow: TDateTime; static;
    class function ToUtc(const Value: TDateTime): TDateTime; static;
    class function FromUtc(const Value: TDateTime): TDateTime; static;
  end;

implementation

uses
  IdGlobalProtocols, {IdGlobal for Index   SysUtils,
  XSBuiltIns;

class function TIso8601.DateTimeFromIso8601(const Value: string): TDateTime;
begin
  with TXSDateTime.Create() do
  try
    XSToNative(value); // convert from WideString
    Result := AsDateTime; // convert to TDateTime  finally
  finally
    Free();
  end;
end;

class function TIso8601.UtcDateTimeToIso8601(const Value: TDateTime): string;
begin
  with TXSDateTime.Create() do
  try
    AsUTCDateTime := Value;
    Result := NativeToXS; // convert to WideString
  finally
    Free();
  end;
end;

class function TIso8601.DateTimeToIso8601(const Value: TDateTime): string;
begin
  with TXSDateTime.Create() do
  try
    AsDateTime := Value; // convert from TDateTime
    Result := NativeToXS; // convert to WideString
  finally
    Free();
  end;
end;

class function TIso8601.UtcNow: TDateTime;
begin
  Result := ToUtc(Now);
end;

class function TIso8601.ToUtc(const Value: TDateTime): TDateTime;
var
  Bias: TDateTime;
begin
  Bias := TimeZoneBias;
  Result := Value + TimeZoneBias;
end;

class function TIso8601.FromUtc(const Value: TDateTime): TDateTime;
var
  Bias: TDateTime;
begin
  Bias := TimeZoneBias;
  Result := Value - TimeZoneBias;
end;

end.

–jeroen

via In Delphi is there a function to convert XML date and time to TDateTime – Stack Overflow.

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 7 Comments »

Some great links to Quotes on Programming and Software Development #fun #bastacon

Posted by jpluimers on 2011/02/23

Many, many nice sayings have been done about Programming, Software Development, the people that do the work, etc.

I collected a few links to nice lists of them, and used some of them at my talk on The Best C# Extension Methods at the BASTA! Spring 2011 conference this week in Darmstadt, Germany (yes, I do speak German, don’t ask me about my German writing though <g>).

A few teasers:

Programming is similar to a game of golf.  The point is not getting the ball in the hole but how many strokes it takes.
~Harlan Mills

If debugging is the process of removing software bugs, then programming must be the process of putting them in.
Edsger Dijkstra

They don’t make bugs like Bunny anymore.
~Olav Mjelde

So here it goes:

Enjoy ;-)

BTW:
You can download all the sample code on my session from our bo.codeplex.com sourcecode repository.
If you want a PDF of the slides, just drop me an e-mail.

–jeroen

Posted in BASTA!, Conferences, Event, Opinions | Leave a Comment »

PowerShell: the 2 most common error messages for starters

Posted by jpluimers on 2010/11/11

I’ve waited for PowerShell to become pretty mature before diving into it:
Version 2 has been out for a year, no service packs have been needed, so time to get into it.

PowerShell code can be stored in scripts.
The convention is to use the .ps1 extension for that (even when running PowerShell 2.0. Lesson learned: don’t put version numbers in file extensions).

Having lots of scripting and programming experience, I was a PowerShell beginner, and similar people usually bump into a few error messages.

Luckily, lots of people have gone through that phase, so there is lots of help on the internet.
So this post is not only to show you about some common things you bump into when starting with PowerShell, but also about the power of the internet as a collective pool of knowledge.

This was the first error message I bumped into:

C:\bin>powershell first-script.ps1
The term ‘first-script.ps1’ is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
At line:1 char:16
+ first-script.ps1 <<<<

A message by mosoto (Marcel J. Ortiz Soto) answered this as one of the first in the search results for “is not recognized as a cmdlet, function, operable program, or script file”.
The reason for this error is that unlike cmd.exe (but similar to unix shells), PowerShell does not include the current working directory (.) in the search path.

Solution: prepend the directory for your script file, in this case by prefixing it with “.\”.

This immediately leads to PowerShell rookie error message 2:

C:\bin>powershell .\first-script.ps1
File C:\bin\first-script.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.
At line:1 char:18
+ .\first-script.ps1 <<<<

Even though searching for “cannot be loaded because the execution of scripts is disabled on this system” quickly reveals a few posts describing the cause, the error message gives a hint: get-help about_signing.

Executing this on the command-prompt gets youa lot of help about signing:

c:\bin>PowerShell get-help about_signing

This is the summary:

  • PowerShell scripts can be signed.
  • PowerShell as a global execution policy defaulting to Restricted (see below).
  • By default, PowerShell does not want to run any scripts at all.
  • You can assign these values to the execution policy: Restricted, AllSigned, RemoteSigned and Unrestricted
    (note if not specified, the policy is global, so changing this changes it for your whole system, so better define the scope)

Documentation is at:

If you set the execution policy in all scopes to Undefined and the Group Policy is not set, the default execution policy, Restricted, is effective for all users of the computer.

This is how you ask for the current policy:

C:\bin>powershell Get-ExecutionPolicy

This is how you set the current policy to only require remote scripts to be signed:

C:\bin>powershell Set-ExecutionPolicy RemoteSigned

Now you can run unsigned local scripts.
Beware: if anyone sends you a virus in an unsigned PowerShell script, that can now be executed too!

Hope this helps a few other PowerShell rookies too :-)

–jeroen

Posted in CommandLine, Conference Topics, Conferences, Development, Event, PowerShell, Software Development | 2 Comments »

Delphi: Use TStrings to parse non-standard separated strings, and validate it with DUnit tests

Posted by jpluimers on 2010/09/08

Recently, I was at a client where in a project strings had to be split from:

'FI-150 1U; FI-049-I L=20 MM;LET OP LASVORM'

Into:

  • 'FI-150 1U'
  • 'FI-049-I L=20 MM'
  • 'LET OP LASVORM'

At first sight, this looks simple: Semicolon Separated Values and you are done.
Not so fast Mr Smart Alec: watch the optional spaces!

The best thing for problems like these is to start with an empty implementation that some units tests covering it.
I use DUnit for Delphi unit testing.

Unit testing should go with code coverage, but there are few Delphi code coverage articles.
I’ll get into code coverage later on, as I’m working with two of the code coverage people to get this to work nicely with Delphi 2010.

Mock objects can be a good addition to unit testing too, so in a future article, I will cover using mock objects with Delphi.

Read the rest of this entry »

Posted in Agile, Conference Topics, Conferences, Delphi, Development, DUnit, Event, Software Development, Unit Testing | 8 Comments »

Speaking at Delphi Live 2010 USA and EKON 14 Germany

Posted by jpluimers on 2010/08/18

Next week, I’ll be speaking at Delphi Live 2010 in San Jose, California., USA.
At the end of september, I’ll be speaking at EKON 14, in Darmstadt, Germany. My 14th appearance at EKON!

Delphi Live (sessions in English):

EKON 14 (Sessions auf Deutsch / in German):

Hope tho see some of you people at one of those events.

I will bring some USB audio equipment, so I might do a bit of geek stuff doing ASIO audio on those events too.

–jeroen

Posted in Conferences, Delphi, DelphiLive, Development, EKON, Event, Software Development | 5 Comments »

Bookmarklets: empower your webbrowser

Posted by jpluimers on 2010/06/02

Next to Greasemonkey – the script engine that empowers FireFox and Chrome, there is another very powerful way to enhance your browser:
Bookmarklets.

Bookmarklets are like shortcuts, but they don’t point to a static URL: they add action, usually by some JavaScript.

If the bookmarklet returns a string, then the browser will follow that as a URL.
But the since bookmarklet  has access to the current page, it can also perform just a local action.

The cool thing is that most bookmarklets work on almost any popular browser.

These are a few bookmarklets that I use on a regular base, most are from bookmarklets.com: Read the rest of this entry »

Posted in Bookmarklet, Conference Topics, Conferences, Development, Event, Power User, Software Development, Web Browsers, Web Development | Leave a Comment »

Windows 7: new shortcut keys (windows hotkeys and more)

Posted by jpluimers on 2010/05/06

In the past there were already a lot of shortcuts, including a few including the windows key.

SEO Consultants has a good overview of both lists.

Microsoft has the classic list.

Windows 7 introduced quite a few more, which I’ll list below.
Read the rest of this entry »

Posted in Conference Topics, Conferences, Event, Keyboards and Keyboard Shortcuts, Power User | 5 Comments »