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 4,262 other subscribers

Archive for August 5th, 2021

Be aware of vendor lock-in, especially when serving CMS content in an inclusive way

Posted by jpluimers on 2021/08/05

The below thread was a response to me indicating that serving content mainly in Microsoft Word documents on a site aiming at visually impaired makes it needlessly hard for those visually impaired to consume the content.

The really odd thing was absolute no reaction whatsoever (not even a Twitter like) after explaining how to get rid of the vendor lock-in.

References:

Site and Word document example:

Thread: [WayBack] Thread by @jpluimers: “@JoostKon @marcvisio Het Kentico CMS zou dit ook met Markdown moeten kunnen doen. Is veel universeler dan Microsoft Word, en bovendien gebas […]”

Het Kentico CMS zou dit ook met Markdown moeten kunnen doen. Is veel universeler dan Microsoft Word, en bovendien gebaseerd op puur text (wat dan vanzelf wordt gerenderd naar HTML of andere output).

github.com/Kentico/custom…

1/…

De soorten opmaak uit het Word document kennisportaal.visio.org/CMSPages/GetFi… zitten allemaal in Markdown.

2/…

Google gaat dan vrijwel zeker jullie site beter indexeren, dus dan werkt iets als zoeken op “Notenschrift, tabs of songtekst met akkoorden” site:visio.org meteen goed.

google.com/search?q=“Notenschrift%2C+tabs+of+songtekst+met+akkoorden”

3/…

Die term komt namelijk voor in het Word document, maar wordt nu niet op de site teruggevonden.

Om het toch te vinden, moet je nu delen van het Microsoft Word document in het HTML gedeelte van de site kopiëren en – wanneer het Word document wijzigt – synchroon houden

4/…

Het gebruik van Word zorgt dus dat een deel van je processen te ingewikkeld zijn: ze zijn namelijk afhankelijk van je technologie keus, en niet van je organisatorische wensen.

Ik denk dat je met gebruik van een open standaard als Markdown het uiteindelijk simpeler wordt.

5/…

Introductie van Markdown lost meteen een deel van je vendor lock-in probleem op zodat je meer flexibel bent in toekomstige technologie keuzes.

en.wikipedia.org/wiki/Vendor_lo…

6/6

  1. [WayBack] Marc Stovers on Twitter: “Handig overzicht van Android apps om #bladmuziek of #akkoorden te lezen voor wie #slechtziend is en behoefte heeft aan bijvoorbeeld vergroten van de noten. Bij de app keuze is rekening gehouden met mogelijkheden voor #toegankelijkheid. … @konvisio…”
  2. [WayBack] Jeroen Pluimers on Twitter: “Waarom moet je dat overzicht downloaden in plaats van meteen online in de je android embedded browser te kunnen zien?… “
  3. [WayBack] Marc Stovers no Twitter: “@JoostKon jij een idee of en hoe dit zou kunnen met kennisportaal docs?… ” .
  4. [WayBack] KonVisioJoost on Twitter: “@jpluimers Hallo Jeroen, onze schrijvers werken momenteel in Word. Om deze Word documenten direct te kunnen tonen dienen we deze om te zetten naar HTML of op een andere wijze te tonen (Onze CMS is qua mogelijkheden beperkt). Mocht je mogelijkheden weten dan horen we die graag.…”

–jeroen

Read the rest of this entry »

Posted in Development, Software Development | Leave a Comment »

Two might lead to a pattern

Posted by jpluimers on 2021/08/05

There is a known saying phrased using cardinal, adverbial or ordinal numbers, and several naming for the first:

  • One is change, two is coincidence, three is a pattern
  • Once Is Chance, Twice is Coincidence, Third Time Is A Pattern
  • One is an anomaly, two is a coincidence, three is a pattern
  • First time is an incident, second a coincidence, third a pattern

Sometimes the second can lead to a pattern.

Read the rest of this entry »

Posted in Algorithms, Development, LifeHacker, Power User, Software Development | Leave a Comment »

DUnit with FastMM: Detecting memory leaks in individual tests.

Posted by jpluimers on 2021/08/05

Steps:

  1. Add the conditional define FASTMM to your project
  2. Ensure you have $(BDS)\source\DUnit\src  in your search path in your project (as otherwise Delphi will pick the pre-built TestFramework.dcu file which was compiled without the FASTMM conditional define)
  3. Inside a test method, or the SetUp method of a class, set FailsOnMemoryLeak to True
  4. If the SetUp method of the class allocates memory, ensure the TearDown de-allocates it. Otherwise you will have leaks:
    • DUnit will check memory differences from the start of the SetUp until the end of the TearDown
    • DUnit will not take into account what is freed in the destructor or by automatic finalization after the destructor!
  5. Re-build your application (otherwise the DUnit TestFramework unit will not take into account the FASTMM conditional define)

Depending in your test framework, FailsOnMemoryLeak might be by default be False or True:

  • TestInsight by default has FailsIfMemoryLeaked set to True for the root test suite (which is then applied to FailsOnMemoryLeak of any test method).
    procedure RunRegisteredTests(const baseUrl: string);
    var
      suite: ITestSuite;
      result: TTestResult;
      listener: ITestListener;
    begin
      suite := RegisteredTests;
      if not Assigned(suite) then Exit;
      result := TTestResult.Create;
      result.FailsIfNoChecksExecuted := True;
      result.FailsIfMemoryLeaked := True;
      listener := TTestInsightListener.Create(baseUrl, suite.CountEnabledTestCases);
      result.AddListener(listener);
      try
        suite.Run(result);
      finally
        result.Free;
      end;
    end;
  • Console DUnit runners (Text, or XML) by default have FailsIfMemoryLeaked set to False.
  • GUI DUnit runner has FailsIfMemoryLeaked depending on the options:

DUnit source differences

Note that recent Delphi versions (I think XE and up) ship with almost the same sources as https://sourceforge.net/code-snapshots/svn/d/du/dunit/svn/dunit-svn-r44-trunk.zip, with these Embarcadero changes:

  • all SVN timestamps are based on time zone -0400 instead of +0000:
    • $Date: 2008-04-24 07:59:47 -0400 (Thu, 24 Apr 2008) $
    • $Date: 2008-04-24 11:59:47 +0000 (Thu, 24 Apr 2008) $
  • Embarcadero removed:
    • all comment lines having TODO in them
    • all files of types .dof, .cfg, and.wmz
    • the files NGUITestRunner.nfm and NGUITestRunner.pas
    • the file /etc/usermap
    • the directory trees /private and /projects
  • Embarcadero changed
    • file /src/versioninfo.res from 9.3.0 to 9.2.1 (which is odd, as all files are from 9.3.0)
    • unit TextTestRunner to support:
      • CLR (used last in Delphi 2007)
      • FailureCount
      • ErrorCount
      • IndentLevel
      • PrefixChars
      • conditional defines ADDITIONAL_INFO, BASIC_INFO
      • output of UnitName
    • unit TestExtensions to support:
      • CLR (used last in Delphi 2007)
      • conditional defines ANDROID_FIXME and LINUX
      • compiler directive LEGACYIFEND
    • GUITestRunner.dfm to have ResultsView: TListView property Height value 45 instead of 39
    • the below methods to use ReturnAddress in stead of CallerAddr:
      • TGUITestCase.FindControl
      • TGUITestCase.Click
      • TGUITestCase.EnterKeyInto
      • TGUITestCase.EnterTextInto
      • TGUITestCase.Show
      • TGUITestCase.CheckTabTo overloads
      • TGUITestCase.CheckFocused overloads
      • TGUITestCase.CheckEnabled overloads
      • TGUITestCase.SetFocus overloads
      • TGUITestCase.CheckVisible overloads
    • method TGUITestRunner.RunTest
      • from
        class procedure TGUITestRunner.RunTest(test: ITest);
        begin
          with TGUITestRunner.Create(nil) do
          begin
           try
            suite := test;
            ShowModal;
           finally
            Free;
           end;
          end;
        end;
      • to
        class procedure TGUITestRunner.RunTest(test: ITest);
        var
          GUI :TGUITestRunner;
        begin
          Application.CreateForm(TGUITestRunner, GUI);
          with GUI do
          begin
           try
            suite := test;
            ShowModal;
           finally
            Free;
           end;
          end;
        end;
    • unit GUITestRunner:
      • from
        procedure RunTest(test: ITest);
        begin
          with TGUITestRunner.Create(nil) do
          begin
            try
              Suite := test;
              ShowModal;
            finally
              Free;
            end;
          end;
        end;
      • to
        procedure RunTest(test: ITest);
        var
          GUI :TGUITestRunner;
        begin
          Application.CreateForm(TGUITestRunner, GUI);
          with GUI do
          begin
            try
              Suite := test;
              if Suite <> nil then
                ShowModal;
            finally
              Free;
            end;
          end;
        end;
      • method TGUITestRunner.SetUp not to set SubItems[0] := ''; when there is no test suite.
      • method TGUITestRunner.FormCreate to use FormatSettings.TimeSeparator instead of TimeSeparator.
  • unit TestFramework to support:
    • HPPEMIT
    • LEGACYIFEND
    • CLR and _USE_SYSDEBUG_
    • AUTOREFCOUNT
    • NEXTGEN
    • ANDROID
    • the RunCountAttribute and RunCount support
    • a CheckEquals overload for uint64
    • a CheckNotEquals overload for TCharArray
    • CheckCircularRef
    • CompareFloatRelative
    • NotSameErrorMessage with WideString arguments instead of string
    • a TestDataDir function
    • ReturnAddress for older compilers
  • a new unit DUnitTestRunner
  • a new Makefile file
  • a new UnitTests.log file

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, DUnit, Event, FastMM, Software Development, TestInsight | 1 Comment »