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 2,466 other followers

Archive for January 21st, 2020

Today’s Organizations Waste Talent. Here’s How To Change That. | Corporate Rebels

Posted by jpluimers on 2020/01/21

[WayBack] Today’s Organizations Waste Talent. Here’s How To Change That. | Corporate Rebels

Our research into more than 100 workplace pioneers reveals an important shift –“from job descriptions to talents and mastery”. It’s a clear differentiator between traditional and pioneering organizations.

Traditional organizations focus on fixed job descriptions, and linear careers that move from one description to the next. Progressive organizations focus on “talents & mastery”– and craft jobs and development opportunities around the specific skills employees would love to exploit.

The article goes on how to get the best from your talent and talents in other people.

via [WayBack] Today’s Organizations Waste Talent. Here’s How To Change That. | Corporate Rebels – Marjan Venema – Google+

–jeroen

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

Delphi, compiler intrinsics and generic type matching

Posted by jpluimers on 2020/01/21

For my link archive in case I ever need to do Delphi generic type matching on intrinsic types. This will be tricky as you can have typed types like [WayBacktype TDate = type TDateTime since the early Delphi ages.

[WayBack] Hi, by using compiler intrinsics, is it possible to check if a generic type parameter is an unsigned integer? – Malcon X Portela – Google+

It will probably come down to fast intrinsic type mapping and slower typed type mapping.

The above WayBack link contains the most important bits of the Google+ post:

Hi, by using compiler intrinsics, is it possible to check if a generic type parameter is an unsigned integer? I have the following code:

function TChecker<T>.CheckIsUnsigned: Boolean;
begin
  if GetTypeKind(T) = tkInteger then
  begin
  if SizeOf(T) = 4 then
  begin
    // TODO: Check if it is an unsigned 32-bit integer
    Result := True;
  end else if SizeOf(T) = 2 then
  begin
    // TODO: Check if it is an unsigned 16-bit integer
    Result := True;
  end else
  begin
    // TODO: Check if it is an unsigned 8-bit integer
    Result := True;
  end;
  end else
  begin
    Result := False;
  end;
end;

The code should return True only if the ‘T’ generic type parameter is an unsigned integer. I remember that +Stefan Glienke posted here some code that can do this trick, however, I am not able to find that now.

Thanks!


Hi +Jeroen Wiert Pluimers, my answer can be a bit disappointing, sorry :( Some time after writing this question here, I just realized which for the things I was originally trying to do, being signed or unsigned would not change anything on the final result hehehehe :D But from this amazing project https://github.com/d-mozulyov/Rapid.Generics (entire credits goes to Dmitry Mozulyov for the magic), it is possible to write the check to the generic type parameter in order to identify if it is a 32-bit/64-bit signed or unsigned number.

LTypeData := PTypeInfo(TypeInfo(T)).TypeData;

case GetTypeKind(T) of
  tkInteger:
  begin
    {case LTypeData.OrdType of
      otSLong: Writeln('32-bit signed');
      otULong: Writeln('32-bit unsigned');
    end;}
    // the above code does the same thing
    if LTypeData.MaxValue > LTypeData.MinValue then
    begin
      Writeln('32-bit signed');
    end else
    begin
      Writeln('32-bit unsigned');
    end;
  end;
  tkInt64:
  begin
    if LTypeData.MaxInt64Value > LTypeData.MinInt64Value then
    begin
      Writeln('64-bit signed');
    end else
    begin
      Writeln('64-bit unsigned');
    end;
  end;
end;

The [WayBack] Rapid.Generics project is indeed cool, but unmaintained and has no unit tests. The main code is in some [Wayback] 30k lines Rapid.Generics.pas unit with some cool ideas and implementations. Hopefully people will find time to integrate some of the ideas there into basically the only well maintained Delphi generics library Spring4D.

A big limitation might be that the code is Delphi XE8 and up only, whereas Spring4D supports older Delphi versions.

–jeroen

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

Some things I learned from “Git tips and tricks | GitLab”

Posted by jpluimers on 2020/01/21

Via [WayBackGit tips and tricks | GitLab “Handy Git commands for everyday use” I learned these:

 

–jeroen

Via: [WayBack] GitLab on Twitter: Ready to get #backtowork? Brush up on a few tips and tricks we use at GitLab everyday: https://t.co/W8zFjxnSN6

Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

 
%d bloggers like this: