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

Archive for the ‘Software Development’ Category

Property/event differences between Delphi forms and frames

Posted by jpluimers on 2018/08/22

From a while back, but still interesting especially because there some differences similar to base/inherited designer objects: [WayBackvcl – How to do bulk -transformation of form to frame- in Delphi? – Stack Overflow:

Observe the differences of a Form and a Frame in your project.

First the project.dpr source:

program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit3 in 'Unit3.pas' {Frame3: TFrame};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

Differences:

  1. Frame as a more elaborated comment to tell the IDE which designer it should use
  2. Form can be autocreate

Dfm files:

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 348
  ClientWidth = 643
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
end

and

object Frame3: TFrame3
  Left = 0
  Top = 0
  Width = 320
  Height = 240
  TabOrder = 0
end

Frame does not have these properties:

  • Caption
  • ClientHeight
  • ClientWidth
  • Color
  • Font.Charset
  • Font.Color
  • Font.Height
  • Font.Name
  • Font.Style
  • OldCreateOrder
  • PixelsPerInch
  • TextHeight

Sidenote: Frame does not have these events:

  • OnCreate
  • OnDestroy

A Frame has not global variable like this:

var
  Form1: TForm1;

And a Frame descends from TFrame, whereas a form descends from TForm.

Note: with Frame/Form inheritence, your steps become a bit longer.

–jeroen

Some of these are similar to the differences you see here:

–jeroen

PS: Idea: make a wizard or conversion tool for this.

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

Reminder to self – check some of the Delphi bug reports to see of they are solved

Posted by jpluimers on 2018/08/22

Reminder to self: check the entries referenced in [WayBack] Judging from recent QP bug resolutions, current status of Delphi compiler is “Leaks all the way” or “Broken by design”. Take your pick… – Dalija Prasnikar – Google+

–jeroen

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

Marvin the Paranoid Android moans about requests for missing pages

Posted by jpluimers on 2018/08/22

A great 404-page: [WayBackMarvin the Paranoid Android moans about requests for missing pages.

The fun about the WayBack link is that it fills the first memo field it finds (:

https://web.archive.org/web/20170503071729/http://bcn.boulder.co.us/~neal/humor/marvin-the-server-404.html

–jeroen

via: [WayBackRuurd Pels on Twitter: “@jpluimers https://t.co/TKFlzTmQLW”

Read the rest of this entry »

Posted in Development, Fun, Software Development, Web Development | Leave a Comment »

Nick Craver on Twitter: “This is worth repeating: We’re migrating Stack Overflow to .NET Core. **It’s not because of performance**. There are enough major wins without even factoring performance for us to move. Any performance gains are 100% in the bonus category. We’d migrate with a 0% perf improvement.…”

Posted by jpluimers on 2018/08/21

If you are on .NET, migrate to .NET Core. If you start with .NET, start with .NET Core.

Based on:

–jeroen

Edit: nice comment on [WayBack] If you are on .NET, migrate to .NET Core. If you start with .NET, start with .NET Core. Based on: [WayBack] Nick Craver on Twitter: “This is worth repea… – Jeroen Wiert Pluimers – Google+:

Vincent Parrett's profile photo

We are porting Continua CI to .net core 2.1, I’ve been working on it for a few months now (along with other things of course), I had to contribute to a few open source projects to help get all our dependencies onto .net core, and for the most part it’s been pretty easy. I did have to change the windows service stuff, and since there is no WCF server stuff in .net core we have to find a replacement for that for server to agent communications (still exploring options, but probably going with halibut).

What hasn’t (and still isn’t) easy is porting MVC4/5 stuff to asp.net core. So many little changes that drive me absolutely potty. I was getting so frustrated that I had to put it aside for a while and work on other things, just to get my sanity back!

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

Delphi SOAP service: only publish WSDL in RELEASE mode

Posted by jpluimers on 2018/08/21

If you want to restrict the WSDL publishing so it only is published in DEBUG mode, then add a [WayBack] TWSDLHTMLPublish to your [WayBackTWebModule descendant, then add this in the [WayBack] OnCreate event handler of that TWebModule descendant:

// Enable/disable handling of "/wsdl*" requests during DEBUG/RELEASE mode. Enabling sends them via
//  Handled := WSDLHTMLPublish1.DispatchRequest(Sender, Request, Response);
{$ifdef DEBUG}
  WSDLHTMLPublish1.WebDispatch.Enabled := True;
{$endif DEBUG}
{$ifdef RELEASE}
  WSDLHTMLPublish1.WebDispatch.Enabled := False;
{$endif DEBUG}
end;

I have limited this because there are so many hard coded strings in the TWSDLHTMLPublish, see the thread by [WayBack] Marjan Venema at [WayBack] Hide WSDL document in SOAP app – delphi

–jeroen

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

Full Duplex Asynchronous Read/Write with Named Pipes – CodeProject

Posted by jpluimers on 2018/08/21

When you run on Windows: [WayBackFull Duplex Asynchronous Read/Write with Named Pipes – CodeProject

via:

–jeroen

Posted in .NET, C#, Development, Software Development, WinForms | Leave a Comment »

For my research list: Delphi and ZeroMQ

Posted by jpluimers on 2018/08/21

Last year, ZeroMQ – of late Pieter Hintjens ancestry – got a decent support library for Delphi https://github.com/grijjy/DelphiZeroMQ.

While writing, there is a reasonable chance I need to do message queue work and ZeroMQ is excellent. I’ve done MQ already in other environments with various projects involving Wintel/iSeries, WebSphere MQ (now IBM MQ, formerly MQSeries), Oracle AQ and Microsofts MSMQ stacks so I’m anxious to see if and how this works out.

via:

–jeroen

https://wiert.me/2017/05/10/one-year-ago-im-writer-and-free-software-author-pieter-hintjens-and-im-dying-of-cancer-ask-me-anything-iama/

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

Reading files that are locked by other references: c# – Notepad beats them all? – Stack Overflow

Posted by jpluimers on 2018/08/16

Cool feature borrowed from Notepad, which can read files locked by other references (for instance a process having the handle open): [WayBackc# – Notepad beats them all? – Stack Overflow.

The example from the answer is in .NET, but can be used in a native environment as well (Notepad is a native application).

Notepad reads files by first mapping them into memory, rather than using the “usual” file reading mechanisms presumably used by the other editors you tried. This method allows reading of files even if they have an exclusive range-based locks.

You can achieve the same in C# with something along the lines of:

using (var f = new FileStream(processIdPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var m = MemoryMappedFile.CreateFromFile(f, null, 0, MemoryMappedFileAccess.Read, null, HandleInheritability.None, true))
using (var s = m.CreateViewStream(0, 0, MemoryMappedFileAccess.Read))
using (var r = new StreamReader(s))
{
    var l = r.ReadToEnd();
    Console.WriteLine(l);
}

Via: [WayBack] Maintaining Notepad is not a full-time job, but it’s not an empty job either – The Old New Thing

–jeroen

Posted in .NET, Delphi, Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Cape Cod Gunny Does Delphi: Gunny Meets Uncle Bob – Part 1

Posted by jpluimers on 2018/08/16

I like how Michael Riley compares his learning quest of software development to things he learned in real life:

  • Gang of Four Patterns = Chess
  • POSA Patterns = Golf
  • SOLID = JJDIDTIEBUCKLE

Note that JJDIDTIEBUCKE is actually 14 parts of Marine Corps leadership.

Software development is all about learning and making connections. Like life: learn new things and relate them to existing ones each and every day.

Given Michaels military background, I understand the comparison and the reference that Eric Grange makes. I think good software development is finding the balance between guerrilla and traditional thinking. Don’t loose yourself into patterns and processes, pick the ones that fit you best at the time you use them. This requires reflection which is often neglected.

I also like the comment thread in the post, so I’ve extracted some really useful information below.

Source: [WayBackCape Cod Gunny Does Delphi: Gunny Meets Uncle Bob – Part 1

From the comments

Note I don’t agree with everything, but I they make me think about my profession.

Joseph Mitzen:

Don’t give in to the conventional thinking about “design patterns”. Design patterns are language smell. They’re a sign of places where a language is broken. They’re not some sort of gospel truth. Most of the patterns don’t even exist in languages like Lisp.

Google’s Joe Gregorio emphasized this point in a talk in 2009:

You don’t need to understand 24 patterns for a language you don’t program in to be a good programmer.

Embrace Joe Gregorio, Dr. Peter Norvig, and Paul Graham… become the anti-Hodges!

Michael Riley:

+Joseph Mitzen I agree when Martin says, “Your system architecture should be as ignorant as possible about how it is to be delivered. You should be able to deliver it as a console app, or a web app, or a thick client app, or even a web service app, without undue complication or change to the fundamental architecture.”

I agree when Martin says at a minimum software professionals should be able to describe the GoF patterns and have a working knowledge of the patterns describe in the POSA books.

My pursuit to learn Dependency Injection is taking me in directions I didn’t know about and didn’t expect I be going.Hodges is my fallback position because the only mainstream language I know is Pascal. When I see the code examples he uses I understand them… it’s the concepts I’m having a hard time with.

I just now today am learning Java. This time around it is very exciting and fun. I’m totally amazed at the NetBeans IDE. I’m very impressed with JavaDocs. At this point I’m finding myself question why I should continue to pursue Delphi.

The bottom line is this: I want to make the next release of my software able to support mobile customers, web customers, windows customers and mac customers.

I feel like I’ve been given a chance to go back to high school and start over again.

Michael Thuma:

It’s not Java that confused you. It’s the combination of the Class Library and Framework. Object Orientation simply starts with using Objects. No one needs to go further beyond, which is the original idea.

There is no such a ‘dumb’ Delphi developer for example who just uses components or the classes provided. The programming world is not divided into programmers or not. Those who define classes and provide them share a common space with those who simply use (Framework). You need to play first and play it loud.

Different example from the relational world. A DB design has nothing to do with Entity Relationship which is maybe the dominating approach. The relational model is capable of a lot more than this tiny but widely used subset.

Thinking in terms of E/R limits the scope of taking opportunities. The same way you limit yourself to one specific paradigm when it comes to programming languages. All the others make up the difference.

The Java framework is heavy. It was redesigned about 15 years ago with design patterns in mind. Design patterns were introduce to extend or put the focus on reusability which does come for anything but free even in the object oriented world. That’s why these patterns became integral part of software architecture.

Eric Grange:

All good points, but one key difference with military is that in development, Rambos routinely trounces whole armies, and not just in movies. And guerilla tactics usually win over more formal armies and approaches.

IOW shops with established methodologies are regularly overtaken by startup proof of concepts, and experienced teams are all too often outsourced by management that think they’ve found a (cheaper) guerilla team.

Don’t let that stop you from learning, but it’s a wholly different battlefield…

The comment thread also reminded me that  the GoF patterns in Delphi has moved since I wrote GoF Patterns in Delphi | Implementations of the famous Gang of Four Design Patterns in Delphi language – via Nick Hodges, so I learned this:

–jeroen

via: [WayBackLars Fosdal – Google+

Read the rest of this entry »

Posted in Dependency Injection, Design Patterns, Development, Inversion of Control / IoC, LISP, Software Development | Leave a Comment »

Have NoMessageBoxes depend on a global boolean · Issue #58 · pleriche/FastMM4 · GitHub

Posted by jpluimers on 2018/08/16

Reminder to self: [WayBackHave NoMessageBoxes depend on a global boolean · Issue #58 · pleriche/FastMM4 · GitHub

–jeroen

Posted in Delphi, Development, FastMM, Software Development | Leave a Comment »