Skip to main content

Bienvenue

Ce blog est consacré au conception et développement de logiciels et de bases de données (notamment Microsoft SQL Server et Delphi/Lazarus).

A propos, qu'est-ce que "Arbinada" ? Voir ce lien.

Install HP LaserJet Pro CP1025 on Ubuntu

Posted in

HP LaserJet Pro CP1025 is detected automatically by Ubuntu but it is not sufficient for printing. You should configure HPLIP.

Free Pascal bencmark: array vs TList vs dynamic array

Posted in

Let's make a simple benchmark test for random and sequential access. I will compare:

  • array with predefined size (allocated on stack)
  • TList container class (allocated on heap)
  • dynamic array (allocated on heap)

I use an array of 10M elements having integer and varaint data type. You can easily change its type definition in "type" section if need.

Pourquoi spécifier les noms de modules

Posted in

Dans l'article précédente "Crack C# namespaces in 30 secondes" je vous ai montré comment tomber sur une erreur en C# sans la savoir et donc passer les heures après sur la débogage. Mais en C# vous êtes condamnés à utiliser la directive using sinon le code devient illisible rapidement avec tout ces MySolution.AppModules.Accounting.AccountingType.DefaultValue.

En Delphi et Free Pascal vous n'êtes pas obligés de spécifier le nom d'unité, mais cette pratique vous préviendra des erreur de genre décrit dans l'article.

Voici une exemple simple.

Crack C# namespaces in 30 secondes

Posted in

The namespaces conception in C# seems exhaustive and insufficient at the same time in comparison with strong module notation like in Oberon-2 and even with modular programming like in Free Pascal/Delphi.

Why insufficient? You cannot declare constants and functions within namespaces but you should add a class with constant field or static method for it. It's really sad...

Why exhaustive? The "using" directive with such introduced classes is the source of unexpected errors. Here is an example below.

FGL extension for FPC 2.6.4

Posted in

As Free Pascal 2.6.4 distribution does not include generic tree implementation (there are some limitation of compiler), I use my own named FGLExt for different purposes.

Here are 2 files attached:

  • fglext.pas - implements TFPGTree, TFPGTreeNode and TFPGStack classes
  • fglexttest.pas - some unit tests for it and use cases

FPCUnit: GUI runner improvements

As I'm working constantly with both DUnit and FPCUnit, the differences of shortcuts and ergonomic are significants when running in GUI mode. I.e.

  • "Run all tests" on Ctrl+R is less intuitive and usable that F9 in DUnit. Indeed, I run tests from Lazarus by F9 and would run them all immediately by F9 too.
  • Check box states of selected tests are not saved between the runs so we need to do it every time... very annoying.
  • Cannot close form by simple "Escape" as in DUnit but Alt+F4 or mouse manipulations are required.

To avoid these inconveniences I modified slightly source files of "guitestrunner.*".

Syndicate content