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

Why does the Windows calculator generate tiny errors when calculating the square root of a perfect square? – The Old New Thing

Posted by jpluimers on 2016/12/07

In the continued “floating point code is hard for most software developers” series:

[WayBack] Why does the Windows calculator generate tiny errors when calculating the square root of a perfect square? – The Old New Thing

Because it doesn’t know that it’s a perfect square.

–jeroen

Posted in Algorithms, Conference Topics, Conferences, Development, Event, Floating point handling, Software Development, The Old New Thing, Windows Development | Leave a Comment »

One of the #EKON20 running gags: Raize condition

Posted by jpluimers on 2016/11/11

When Ray Konopka enters the room you have a Raize condition.

Via the EKON20 sessions, it made its way into the workshop If you thought you could do multi-threading, then play “The Deadlock Empire” games – Entwickler Konferenz

–jeroen

Posted in Conferences, Delphi, Development, EKON, Event, Software Development | Leave a Comment »

EKON 20 link archive – anniversary edition of the famous Delphi related conference with lots of English sessions

Posted by jpluimers on 2016/11/03

My EKON20 link archive so I can refer to it through web.archive.org:

–jeroen

via: EKON 20 – anniversary edition of the famous Delphi related conference with lots of English sessions « The Wiert Corner – irregular stream of stuff

 

 

Posted in Conferences, Delphi, Development, EKON, Event, Software Development | Leave a Comment »

EKON 20 – anniversary edition of the famous Delphi related conference with lots of English sessions

Posted by jpluimers on 2016/11/01

Next Monday-Wednesday (7th till 9th of November) will the the 20th edition of the famous Delphi related EKON conference and post-conference workshops at the Hotel Meliá Düsseldorf.

It will be a blast, not the least because it’s an anniversary.

There are still a few spots left, so drop me a note if you’ve not reserved yet as I can get you a discount code.

Below is the the speaker line up. It’s an awesome bunch of guys and there’s plenty coverage for English speaking attendees: English sessions are below the speaker list.

Speaker line up:

  • Andrea Magni – Freelancer
  • Arnaud Bouchez – Synopse
  • Arne Limburg – OPEN KNOWLEDGE
  • Bernd Ua – probucon Business Consulting
  • Daniel Wischnewski – OCTAX Microscience
  • Girish Patil – Gnostice
  • Jens Fudge – Archersoft Aps
  • Jeroen Pluimers – Wiert.me
  • Joachim Dürr – Joachim Dürr softwareengineering
  • Jörg Neumann – Acando
  • Marco Cantù – Embarcadero Technologies
  • Marco Frodl – Thinktecture
  • Matthias Eißing – Embarcadero Germany
  • Max Kleiner – kleiner kommunikation
  • Peter Schütt – TimoCom Soft- und Hardware
  • Ray Konopka – Raize Software
  • Rüdiger Kügler – Wibu-Systems
  • Sebastian Gingter – Thinktecture
  • Stefan Glienke – Aagon
  • Steffen Jahr – Thinktecture

English sessions and workshops:

Read the rest of this entry »

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

InitialKeyboardIndicators registry setting to fix NumLock in a certain state.

Posted by jpluimers on 2016/09/30

There are odd things with the InitialKeyboardIndicators registry setting. Technet only documents bitflag value 2.

According to the docs it should be a bitflag, but sometimes you encounter InitialKeyboardIndicators value 2147483648 (0x80000000) especially as part of the .DEFAULT profile at HKEY_USERS\.DEFAULT\Control Panel\Keyboard.

The problem I had was having these symptoms:

  1. while logging in locally, I manually turned of the NumLock (as I have a 46W6740 UltraNav keyboard without a numeric keypad)
  2. after logging in locally, it magically turned itself on even with InitialKeyboardIndicators=0 in my local profile at HKEY_CURRENT_USER\Control Panel\Keyboard.
  3. after logging in locally and turning it off, future local logons would keep it off
  4. after logging in remotely, it would magically turn itself on while logged in
  5. after having logged in remotely, the local logon console would have it turned on again

After reading Num Lock problem: Strange number in InitialKeyboardIndicators in Registry, I set both values to 0.

Now that it is 0 in both at HKEY_USERS\.DEFAULT\Control Panel\Keyboard and HKEY_CURRENT_USER\Control Panel\Keyboard, symptoms 4-5 still hold. Strange.

It is not the same problem as Num Lock state not retained after resume from Hybrid Shutdown in Windows 8 and Windows Server 2012.

If it persist, I might just put a script in: [Partially Solved: re-wired keyboard lol] Registry key “InitialKeyboardIndicators” NEVER keeps NumLock ON + ScrollLock ON (6) at startup and reverts back to NumLock ON (2).

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Event, Keyboards and Keyboard Shortcuts, KVM keyboard/video/mouse, Power User, ThinkPad, UltraNav keyboards, Windows | Leave a Comment »

Happy “Day of the Programmer”

Posted by jpluimers on 2016/09/12

Happy debugging, suckers

Happy debugging, suckers

Or maybe not…

(yes, this year it’s not on the 13th of September, but the 12th, guess why…)

--jeroen

via: Day of the Programmer – Wikipedia, the free encyclopedia

PS: The oldest reference I could find for define true (rand() > 10) was this one from 20121014:

// Happy debugging, suckers
# define true (rand() > 10)

Source: codecrap.com – snippet #6

It reminds me of a 1990s prank I once put in central consts unit of a Turbo Pascal project somewhere way beyond the right margin in a search directory outside of version control:

                                                                                     const True = False; False = not True;

A lot more pranks are at Happy debugging, suckers : ProgrammerHumor – reddit

Posted in Conference Topics, Conferences, Development, Event, Fun, Prank, Software Development | Leave a Comment »

C#, XSD.exe, xsd2code and generating nullable fields+properties from an XSD with and without Specified fields/properties

Posted by jpluimers on 2016/07/27

It comes down to these cases for XML elements having maxOccurs="1" (which the default for maxOccurs):

  1. adding nillable="true" will convert from a regular type to a nullable type.
  2. adding minOccurs="0" will add boolean …Specified properties in the generated C# for each element.
  3. you can have both nillable="true" and minOccurs="0" in an element which gets you a nullable type and a …Specified property.

Note I’m not considering fixed or default here, nor attributes (that have use instead of minOccurs/maxOccurs, but do not allow for nillable) nor larger values of maxOccurs (which both xsd.exe and xsd2code regard as unbounded).

From the above, XML has a richer type system than C#, so in XML there are subtle a differences between:

  1. an explicit nil in the XML element
  2. the XML element being absent
  3. the XML element being empty.

Hopefully later more text and examples to show how to actually work with this.

Delphi related to minOccurs:

Note that xsd2code.codeplex.com (unlike XmlGen#) has at least two forks at github:

From the specs:

–jeroen

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), Conference Topics, Conferences, Development, Event, Software Development, XML, XML/XSD, XSD | Leave a Comment »

Delphi packages I have disabled by prefixing their description with an underscore (and why)

Posted by jpluimers on 2016/07/19

There is a little trick to disable “Known IDE Packages”: you can stop Delphi from loading one by either making “Value data” of the registry blank, or prepending it with an underscore:

packages that might have been disabled, by checking any string entries where the data has been pre-pended with an underscore OR is blank

[WayBackAccess violation at address 00000000 read of address 00000000, when starting the IDE or opening a project after installing the updates

I’ve pre-pended underscores to some packages in the registry key [HKEY_CURRENT_USER\Software\Borland|Codegear|Embarcadero\BDS|Delphi\#.0\Known IDE Packages] and intend to keep the list below updated over time.

Note that you have to prepend the description with an underscore: it is not sufficient to add these to [HKEY_CURRENT_USER\Software\Borland|Codegear|Embarcadero\BDS\#.0\Disabled Packages].

Empirically, the Disabled Packages seem to work only for packages starting with dcl in their filename.

Read the rest of this entry »

Posted in Castalia, Conference Topics, Conferences, Delphi, Delphi XE8, Development, Event, Keyboards and Keyboard Shortcuts, Power User, Software Development | 5 Comments »

Delphi XE8 does not adhere the `$(PROJECTNAME)` in a “Unit Output Directory”, but does recognise `$(SanitizedProjectName)`…

Posted by jpluimers on 2016/05/24

The background here was a quick project at a client where many .dproj files were in the same directory, but they suffered from conditional define differences. Which meant that even if they were all using the  DEBUG configuration, some defines in the .dproj directories were different therefore poisoning shared .DCU files (as Delphi does not automatically rebuild them when the sources have not changed even though the IDE switched to a new project).

There was no quick possibility to reorganise the project structure (a combination of a version system history being problematic and potentially lots of relative path references in the .dproj and .dpr files could still be broken) so I wanted different “Unit Output Directories” for each project preferably using non-hardcoded project name.

So I tried putting $(PROJECTNAME) in a “Unit Output Directory”. But unlike build-events – where that one has a value – in the Directory it hadn’t.

To cut things short, Uwe Raabe did some spelunking in the .dproj file and found that $(SanitizedProjectName) was recognised so I switched to .\$(Platform)\$(Config)\$(SanitizedProjectName).

Putting it in the OutputDirectory (where your .EXE gets emited) fails for most part. Yes, the .EXE gets put in the right directory. No, the debugger cannot find it as it thinks it needs to use %SanitizedProjectName%. No for TestInsight: it cannot find the EXE either because of the % expansion.

Based on SanitizedProjectName, I did some more spelunking coming with the below list. Remember though:

Only tested for Win32 applications for Delphi XE8

I assembled the list by doing a quick sed on a Delphi XE8 Win32 .dproj file transforming all XML element names to $() form then running it through a uniq like script. After that I added each of them in a “Unit Output Directory” prepended with .\_\ (well I cheated a bit, I did them in groups separated by a back-slash and went back to single items in case of failures. A kind of ‘binary search’).

Ensure the ones you use, are defined before you use them. For example: the definition of SanitizedProjectName need to be in the .dproj file before actually using SanitizedProjectName.

These expand to empty strings:

Read the rest of this entry »

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

RubyMania has reached Delphi – Times helper method implementation for integers – from Asbjørn Heid

Posted by jpluimers on 2016/04/21

The below fragment is one of the favourite kinds of examples in the Ruby world:

5.times { |i| print i, " " }

It uses the times method on Integer and prints:

0 1 2 3 4

There are many implementations of this in other languages, for instance Ruby’s ‘times()’ function in C# | Of Code and Me (which the WordPress.com editor fucked up as it replaced Action<int> with Action which is a totally different thing, so the gist with code is below.

public static class IntExtensions
{
    public static void Times(this int i, Action func)
    {
        for(int j = 0; j < i; j++)
        {
            func(j);
        }
    }
}

Which you use as

5.Times(i => Console.Write(i));

It’s slightly off as it prints:

01234

I know; nitpicking, but this code works (did I ever tell I love .NET fiddle?):

5.Times(i => Console.Write("{0} ", i));

Well, Mason Wheeler encouraged Asbjørn Heid for the below Ruby Mania in Delphi; just read the comments at In C# nearly everything is an object, so when writing a unit test for a string…

Since the WordPress.com editor fucks up TProc<Integer> into TProc and TProc behaves differently from TProc<Integer>, I’ve included a gist link with the actual code below.

program RubyManiaConsoleProject;

uses
  System.SysUtils;

type
  TRubyMania = record helper for ShortInt
    procedure times(const IterBody: TProc);
  end;

procedure TRubyMania.times(const IterBody: TProc);
var
  i: Integer;
begin
  for i := 0 to Self-1 do
    IterBody(i);
end;

begin
  5.times(
    procedure(i: Integer)
    begin
      Write(i, ' ');
    end
  );
end.

It also shows why I hardly use anonymous methods in Delphi: they’re way too verbose.

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, Software Development | 1 Comment »