Ian’s July 2024 Meeting Summary
- A Utility for Code Generation – Patrick Davey
- CodeSite – Tamas Nagy
- An enhanced hex file viewer to help with viewing/decoding binary files – Dave Martel
- pfSense – The open source firewall-router platform – Glenn Dufke
Ian’s Summary
Welcome and News
News covered the September meeting which will be a mixed event again, with potential for a larger group. It will be in the Sir Christopher Hatton pub in Holborn (London). The session then moved on to questions or problems from members. Paul W. mentioned problems with the taskbar when updating from Delphi 7 to Delphi 12. What is a fleck? Jason explained (a short talk <= 15 mins, suggested and done on the day). Paul M. mentioned an app on a Samsung, to which Jason, Will and Conrad produced mini keypads. Chat continued during the lunch break.
A Utility for Code Generation – Patrick Davey
The first scheduled session was by Patrick Davey on CodeDeck, his home-brewed code generator for C#.
Described as an extensible framework of C# classes designed to generate computer code, the session covered an attempt to build a demo application with this process. It starts with an empty VS solution and inserts the code. Currently it supports WinForms and MS SQL.
Meta data for or about the application is stored in a tree structure as a set of name/value pairs. The tree is stored as JSON and the console can import JSON files with various elements defined in them. The generators create code based on the content of this meta data. The management console uses pre-built assemblies to handle parts of the process, including a database assembly and a model UI assembly. The database assembly handles table and schema design and related issues, while the UI assembly handles item editors.
The process builds SQL statements and UI elements as forms. The form generator required some SQL connection info, which appeared to be hard-coded. SQL joins can be created as views and the demo included importing a JSON file defining a parent/child relationship and then creating both the database and UI elements, resulting in an editable form.
It has the concept of a database version and incrementing the version number will create a new SQL file and a new JSON file. Manually created code outside of the generated region is not updated by the process. The generators are designed to be extensible.
CodeSite – Tamas Nagy
This is a process from Raize Software, which Tamas said works with all versions of Delphi from 2009 on, but note that the website states that the current version works with Delphi from 10.0 (Seattle) to 12 (Athens) and VS 2015 to 2022. CodeSite Express is included with Rad Studio and can be downloaded free from Getit, when it works. CodeSite Studio has more features but is not free and is available from Raize Software.
Logging is invisible to end users and should not interrupt the application flow. It can log complex data structures. It comprises a bunch of pre-compiled binaries (.exes) to handle the various parts of the logging processes. When installed, it adds new items in the tools menu.
The session was done mainly as a live demonstration, showing the commands and features in a demo app. There are many different message types and settings available to use, including, but not limited to, levels of severity, info/warning/error types, blue/green/other colours, bitmap/text file/other formats and/or as a dataset.
The output was shown in a CodeSite Live Viewer app, which appears to offer some different ways of formatting the display of the logging output. In the application, CodeSite.EnterMethod() and CodeSite.ExitMethod() pairs can be used to identify blocks of logging code and for nesting logging data.
Many features were demonstrated during the session, too many to list them all. It can be turned on and off during the application execution but does require set up code to be run before it will work. Set up was shown in the application start up and in an initialization section, to be freed in the corresponding finalization, of course.
An enhanced hex file viewer to help with viewing/decoding binary files – Dave Martel
The third session was presented by Dave Martel on viewing and decoding binary files with his own hex viewer.
It started a long time ago as an attempt to read output from scientific instruments. It was possibly started in Delphi 4 and has been updated all the way to Delphi 12 now. It uses Orpheus components, which are now free.
Dave showed a typical source file in ascii format in Notepad and then loaded it into the hex viewer, shown above. As the data came from a Sparc workstation, it was necessary to be able to switch between big-endian and little-endian.
There is a jump menu, which provides options to move forward or backwards by a fixed number of bytes, 1, 2, 4, 6 or 8. It also allows jumping to an arbitrary position in the file and back and forward by a specified amount and searching for specific values with tolerances.
Code for flipping bytes and other bits was shown. It also compares files. Dave finished by offering to provide the code for anyone who wants it and by suggesting that AI code is a modern implementation of the infinite number of monkeys scenario.
pfSense – The open source firewall-router platform – Glenn Dufke
The fourth session was presented by Glenn Dufke on pfSense, the open source firewall-router platform.
It is built on a FreeBSD base. The project was started in 2004, released in 2006 and is deployed in millions of places around the world. Netgate took it over in 2014 and the latest release was in April this year. Netgate provides support and training. They also offer a commercial version of the product, as well as purpose built hardware.
PfSense can be virtualised and has good documentation and configuration examples. It supports high-availability and multi-wan failover / balancing set ups. It has built-in package manager support with BSD’s pkg, which allows for your own plugins if you want to.
Glenn then explained some of the rules and priorities, rules are evaluated top down, with a first match and exit approach. The session then switched to a live demo, using the main pfSense dashboard.
He began by creating a VLAN and then going through the process of setting all of the options. If you are not familiar with this stuff, then it will definitely require a manual. The dashboard can show a list of connected devices.
Firewall rules can be set for WAN, LAN, IOT or floating. After creating a new rule, as it was the first rule created, the blocking package had to be installed. The dashboard includes a package manager and installer. Patches are made available between major releases.
Config files are in XML format and the dashboard includes backup processes, which can maintain a history of config changes, as well as restoring a config from backup.
The session finished with the usual Q&A.