The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • 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,842 other followers

Archive for the ‘.NET’ Category

ThreadBarrier/ThreadBarrier.pas at master · lordcrc/ThreadBarrier

Posted by jpluimers on 2017/10/12

I mentioned Asbjørn Heid on wiert.me before. While prepping for the Deadlock Empire workshop at EKON20, I needed a Delphi equivalent for the .NET [Way: Barrier Class (System.Threading)

The game uses that in level deadlockempire.github.io/#H4-Barrier [WayBack].

Edwin van der Kraan found the ThreadBarrier/ThreadBarrier.pas at master · lordcrc/ThreadBarrier implementation via [WayBack] Is there a way to create memory barriers in Delphi? Something like .NET’s System.Threading.Barrier class, java.util.concurrent.CyclicBarrier… – Horácio Filho – Google+

It’s from Asbjoørn who is known as lordcrc on GitHub. Cool stuff!

–jeroen

Posted in .NET, C#, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 1 Comment »

Multithreading in C# .NET 4.5 (Part 2) – CodeProject

Posted by jpluimers on 2017/10/10

Always good having a reference article at hand: [WayBackMultithreading in C# .NET 4.5 (Part 2) – CodeProject

via: [WayBackBest C# Article of September 2016 PureNsanity – Multithreading in C# .NET 4.5 (Part 2)Runner UpSnesh Prajapati – Factory Patterns – Simple Factory … – CodeProject – Google+

–jeroen

Posted in .NET, .NET 4.5, C#, C# 4.0, C# 5.0, C# 6 (Roslyn), Development, Software Development | 1 Comment »

Visual Studio Code – getting started – some links

Posted by jpluimers on 2017/10/05

It might sound like I’m late in the game, but remember that blog posts are usually scheduled like a year in advance.

So I found out a long time ago (I think it’s Matthijs ter Woord who attended me) about Visual Studio Code.

At the start [WayBack] it was more limited (from memory something like C#, TypeScript, Java Script languages and frameworks Node.js and ASP.NET 5) than my other development environments but now it’s much richer.

It’s based on the Electron framework which I kew from the Atom.io editor and Koush‘s framework Electron Chrome that wraps Chrome Apps in Electron so he ensured Vysor would live after Google will kill Chrome Apps.

Oh it’s free and runs multi-platform which I like a lot (and was one of the reasons to start using Atom.io): Mac OS X, Windows and Linux are supported.

So here are a few links to get started:

I got reminded a while back** that it is now supported by OmniPascal [WayBack] which I like because of my Turbo Pascal -> VAX/VMS -> csh -> Delphi -> AS/400 -> .NET background.

Like Visual Studio Code is updated often, the Omni Pascal blog [WayBack] shows regular updates and I like it a lot better than the Lazarus IDE (I’m not a visual RAD person: I’m a RAD code person) especially the refactorings.

So start playing with it. I will post more about my Visual Studio Code experience in due time.

–jeroen

** via [WayBackFinally: OmniPascal 0.11.0 released – Implement an interface via key stroke …

Posted in .NET, ASP.NET, C#, Delphi, Development, JavaScript/ECMAScript, Node.js, Omni Pascal, Pascal, Scripting, Software Development, TypeScript, Visual Studio and tools, Visual Studio Code | 1 Comment »

reStructuredText Interpreted Text Roles

Posted by jpluimers on 2017/10/04

There is so much great stuff in reStructuredText, take for instance [WayBackreStructuredText Interpreted Text Roles where basically can create your own role (for instance :csharp: or :delphi: roles based on :code: for syntax-highlighted code blocks given the right syntax highlighters).

I got there via this great piece by[WayBackChris who answered [WayBackInline code highlighting in reStructuredText – Stack Overflow:

Having looked into this some more I stumbled upon the document reStructuredText Interpreted Text Roles. From this document:

Interpreted text uses backquotes (`) around the text. An explicit role marker may optionally appear before or after the text, delimited with colons. For example:

This is `interpreted text` using the default role.

This is :title:`interpreted text` using an explicit role.

It seems that there is a code role, so you can simply type

:code:`a = b + c`

to render an inline code block. To get syntax highlighting you can define a custom role. For example

.. role:: bash(code)
   :language: bash

which you can then use like so:

Here is some awesome bash code :bash:`a = b + c`.

Note, the document I link to makes no mention of the version of docutils to which it refers. The code role is not available in docutils 0.8.1 (which is the only version I have to test against).

–jeroen

Posted in .NET, C#, Delphi, Development, Lightweight markup language, reStructuredText, Software Development | Leave a Comment »

Checking KeyPress is not the place to do your input validation

Posted by jpluimers on 2017/09/19

I have seen too many projects over the years trying to do input validation by checking KeyPress. This is not limited to Delphi projects (C#, VB and other projects suffer from this just as much). Most of these projects suffer from these::

  • Much of the KeyPress logic logic in the UI byusing half-baked copy-pasted code fragments.
  • They all fail missing important functionality (like paste, clear, Ctrl-key handling and such) either supporting or suppressing that functionality where needed

If doing Delphi, then that code should be rewritten in a generic way based on examples like like these:

–jeroen

Read the rest of this entry »

Posted in .NET, Delphi, Development, Software Development, Windows Development | Leave a Comment »

 
%d bloggers like this: