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

Archive for the ‘Conferences’ Category

Davidlohr Bueso on Twitter: A programmer had a problem. He thought to himself, “I know, I’ll solve it with threads!”. has Now problems. two he

Posted by jpluimers on 2020/05/27

When doing multi-threading, I’m always reminded of [WayBack/Archive.isDavidlohr Bueso on Twitter: A programmer had a problem. He thought to himself, “I know, I’ll solve it with threads!”. has Now problems. two he

Even with the advent of multi-core architectures long behind us (multi core hardware has been in a mature state for a long time), software for it often is not.

It is not just that programmers are not ready to do it (indeed often they are not: multi-threading is hard), but also that many pieces of software run perfectly fine in a single thread.

So when you do want to implement multi-threading, think twice.

It is one of the reasons I ported a C# version of the Deadlock Empire game (written in HTML + JavaScript) to generate Delphi code and examples. I was really glad that Dalija Prasnikar pointed to it in [WayBack] What is thread safety anyway?, and also pointed to the very important [WayBack] What is this thing you call “thread safe”? – Fabulous Adventures In Coding.

That last one stresses that multi-threading has vague definitions. It will stay vague because the problems you can encounter are virtually endless. There is no silver bullet: Lars Fosdal made this really nice remark in [WayBack] Multithreading can be hard to do right… – Dalija Prasnikar – Google+:

Locking too much is even worse than locking too little. It is very easy to deadlock with overly detailed locking. Applying locking in the wrong place, can serialize threads through a lock bottleneck.

Learning multithreading is a long series of mistakes that you probably can’t avoid, even if told about them up front. You are probably best off having to make the mistakes yourself and then learn from them ;)

To which Asbjørn Heid added:

… after a while I came to the realization that recursive locks are evil. They make it so easy to “just lock everything”. In contrast, non-recursive locks forces you to have explicit “thread-safety borders” in your code. And such borders really leads to better designs.

Here are the games:

Related:

–jeroen

 

 

Posted in Conference Topics, Conferences, Development, Event, Multi-Threading / Concurrency, Software Development | Leave a Comment »

Why the compiler generates a `”E2018 Record, object or class type required”` on typed types…

Posted by jpluimers on 2020/05/21

From [WayBack] Why would the compiler generate a "E2018 Record, object or class type required" helper when I use a ToUpperInvariant (or any TStringsHelper call) on t… – Jeroen Wiert Pluimers – Google+:

Why would the compiler generate a "E2018 Record, object or class type required" when I use a ToUpperInvariant (or any TStringsHelper call) on the Text property of a TEdit?

Full failing code is at [WayBack] https://gist.github.com/jpluimers/b5e3684f725216622bdcb80bf5f10698

Failing line is this:

Edit1.Text := Edit1.Text.ToUpperInvariant;
// the above line generates this error:
// [dcc32 Error] MainFormUnit.pas(29): E2018 Record, object or class type required

This fails as well:

Edit1.Text := TStringHelper.ToUpperInvariant(Edit1.Text);

Why would the compiler (in this case XE8) throw this error?

Note the workaround is simple:

var
  lText: string;
begin
  lText := Edit1.Text;
  Edit1.Text := lText.ToUpperInvariant;

My suspicion is that the Edit property is of type TCaption which is type string.

Could it be that simple?

To which David Heffernan responded:

Yup, the issue is TCaption has no helper. Pretty distressing.

Typed types are indeed different types. They have been there for a long time (to facilitate generating different type information so you can for instance hook up different property editors to TCaption (a typed string) or TColor (a typed integer).

It is explained at [WayBack] Declaring Types. but has existed since Delphi 1 or Delphi 2.

More on the implications is at [WayBack] pascal – Delphi Type equivalence and Type equality syntax – Stack Overflow.

–jeroen

Read the rest of this entry »

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

Binary search for finding problematic versions: install a specific version in homebrew and git bisect

Posted by jpluimers on 2020/04/14

I’ve used these excellent posts to find out which youtube-dl version started to exhibit troublesome NPO downloads, then later find the actual failing commit:

Why the effort? I needed an as recent as possible youtube-dl working on as many sites as possible because of some work preparation.

The first link is very important because brew versions and alternatives have stopped working some 6 years ago, even though they turn up high on Google searches for brew install specific version. Hence the quote from the first link:

Installing software packages on Mac is very easy with homebrew. You typically get the latest version, however often in production you do not have the latest version of a software package. Another use case is when you upgrade to the latest and you find out there is bug which blocks you doing something. In this case you would like to downgrade to the previous version until the bug is fixed.In both cases you need to install a specific version of a software package with homebrew on your Mac, which tends to be not that trivial. There is a lot of discussion about this on stackoverflow but some of them are outdated based on brew versions which is not available anymore.

Read the rest of this entry »

Posted in Apple, Conference Topics, Conferences, Development, DVCS - Distributed Version Control, Event, git, Home brew / homebrew, Power User, SocialMedia, Software Development, Source Code Management, YouTube | Leave a Comment »

Determine actual message size limit when you only get “552 5.3.4 Message size exceeds fixed limit”

Posted by jpluimers on 2020/03/26

Often when you send large emails the only  reply you get is a non-descriptive message like 552 5.3.4 Message size exceeds fixed limit from the SMTP server without an indication what the limit actually is.

Most SMTP servers however implement extensions in the EHLO greeting that returns a SIZE mail parameter. You can query it by hand using this:

telnet aspmx.l.google.com smtp
Trying 108.177.119.27...
Connected to aspmx.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP 32si3005669edb.510 - gsmtp
EHLO example.org
250-mx.google.com at your service, [80.100.143.119]
250-SIZE 157286400
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
QUIT
221 2.0.0 closing connection 32si3005669edb.510 - gsmtp
Connection closed by foreign host.

There you can see the maximum message size at the time of writing is 157286400 bytes which is about 150 megabytes.

There is a nice Python script showing how to obtain it at [WayBack] Getting Information from EHLO | Erle Robotics Python Networking Gitbook Free (note this one does send an email, so you might want to trim the example if you just want to see the size).

More background reading:

Trimming down the Python script so it queries message size for each mail server of a domain

This turns out to be a tad more complex, because DNS functionality isn’t part of core Python, and the rdata part of DNS records ends with a dot, which might not be usable with the SMTP library.

References for me when trimming down:

–jeroen

Posted in Communications Development, Conference Topics, Conferences, Development, Event, Internet protocol suite, Power User, SMTP | Leave a Comment »

Working around [Fatal error] F2084 Internal errors like AV101E53EB-R0000000C-0

Posted by jpluimers on 2020/03/17

A few notes from my response to [WayBack] [Fatal error] F2084 Internal error : AV101E53EB-R0000000C-0 I’m getting this when trying to do some code completion. Any idea ? – Stéphane Wierzbicki – Google+:

This compiler related error usually made it go away for me either when it occurs during project compilation or when using code completion: Close the IDE. Delete your DCU files. Then restart the IDE.

Starting fresh gives a high chance if fixing this unless it is indeed a compiler related error in which case it returns. For that you need to trim down your code to see under which circumstances.

Reasoning (please shoot at it when things are wrong/missing):

Both the IDE code completion and the project compilation use the compiler. The DCU cache is shared between these compiler instances. The DCU cache depends on internal memory structures. Various pointer related errors (both from the IDE, compiler and 3rd party extensions) can damage this cache.

Especially weak IDE uses of the compiler are the find symbol and rename symbol functionalities. I’ve stopped using those about a decade ago.

Sometimes the F2084 (which I often mistype as F2048) is indeed an error in the compiler. Over the years, some of them have been fixed too. See my earlier articles on F2084.

–jeroen

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

The last thing you need to do when you cause link rot is to list the page as “online banking is down”

Posted by jpluimers on 2020/03/10

Nice example on how not to copy with link rot: as a bank is to indicate “internet banking is unavailable” scares your customers away.

[WayBack] Jeroen Pluimers on Twitter: “dit heet overigens link rot, en gebruiksvriendelijke sites proberen dat te voorkomen; is zeker niet gecompliceerd en eigenlijk ook niet complex: het is een kleine moeite om dat in je ontwerp en onderhoud-proces mee te nemen. 1/2 …

[WayBackJeroen Pluimers on Twitter: “de huidige down-melding zet sowieso je klanten volledig op het verkeerde been, dus daar moet zeker iets aan gebeuren. 2/2 “I.v.m. een storing kunt u geen gebruik maken van Internet Bankieren. Internet Banking is unavailable”…”

–jeroen

ABNAMRO

Posted in Conference Topics, Conferences, Development, Event, LifeHacker, Power User, Software Development, Usability, User Experience (ux), Web Development | Leave a Comment »

Delphi Conference 2018 – Barnsten.com

Posted by jpluimers on 2020/02/25

I missed this one, so I was glad I archived it because I was curious for Daan van der Werf – Delphi op de werkvloer “Groothandel & Magazijn”.

So here it is: [WayBack] Delphi Conference 2018 – Barnsten.com, with fixed and archived links where possible.

Presentations and code from the Delphi Conference 2018

–jeroen

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

Alex Thissen @ Techorama Netherlands 2018: Building real world production-ready Web API’s with .NET Core

Posted by jpluimers on 2020/02/12

[WayBack] Alex Thissen @ Techorama Netherlands 2018: Building real world production-ready Web API’s with .NET Core

Follow [WayBack] Alex Thissen(@alexthissen) on Twitter

Pictures taken during session (likely in reverse order; needs cleanup of duplicates/blurs).

Many more [WayBackTechorama 2018 Netherlands stuff at:

More pictures I took during sessions:

They are in reverse order of the what I attended of the [WayBack] Techorama Netherlands 2018: Schedule: Pathé, Ede, The Netherlands – See the full schedule of events happening Oct 2 – 3, 2018 and explore the directory of Speakers & Attendees.

Sessions I could archive, or find recordings of:

--jeroen

Read the rest of this entry »

Posted in .NET, .NET Standard, ASP.NET, Conferences, Development, Event, Software Development | Leave a Comment »

The magic Delphi ReturnAddress intrinsic

Posted by jpluimers on 2020/02/05

I could not find any official place where ReturnAddress is documented even though it is used at quite a few places in the RTL, VCL, FMX and 3rd party libraries like DUnitX, Spring4D, JCL, ReportBuilder, TeeChart.

I tried searching it in the contexts of Delphi 2007, Delphi 2009, but there is only a [Archive.is] different System.ObjAuto.TParameters.ReturnAddress documented in XE2 and higher.

procedure Abort;
begin
  raise EAbort.CreateRes(@SOperationAborted) at ReturnAddress;
end;

There is a (usually broken*) ReturnAddr function used in various places of the RTL/VCL/FMX and (therefore wrongfully copied) in many other peoples code.

  function ReturnAddr: Pointer;
  // From classes.pas
  asm
    MOV     EAX,[EBP+4] // sysutils.pas says [EBP-4], but this works !
  end;
  • See the above link; I think this was fixed in Delphi XE, but the issue is still open.

Related to the above is the documented ExceptAddr.

I’ve used this in my ExceptionHelperUnit to build a GetStackTrace function in the example gist below.

I found these posts documenting the behaviour of the above intrinsic functions and more:

–jeroen

Read the rest of this entry »

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

Dependencies

Posted by jpluimers on 2020/01/28

Last week in Delphi developer switching to C# – Stack Overflow « The Wiert Corner – irregular stream of stuff I wrote about having a broad toolset.

Having such a toolset however does not mean you should stuff your project with dependencies. Choosing a limited set of tools is a very important part of building solid projects.

It does not mean you should avoid dependencies, just that you need to be aware on them and how they add up.

To get a feel for that, the comics on the right and below.

Sources:

Read the rest of this entry »

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