Ian’s Sept 2024 Meeting Summary
- an Introduction to Quartex Pascal – Dr. Kevin Bond
- Hashing Algorithms and their use in an Amazon voucher scheme – Mark Jacobs
- SQL System Tables in CodeDeck – Patrick Davey
Ian’s Summary
Welcome and News
This was a hybrid meeting with a dozen people at a new venue in London and half a dozen people on-line. Unfortunately, issues with the wifi at the venue on the day meant that those on-line did not get a very good experience. There is still some work to do, to get hybrid meetings to work the way everyone would like.
The meeting began with the usual housekeeping. Someone had questioned the value of the cost of membership and there was a brief discussion about how to add value to membership, how it compared to other groups and whether in-person meetings were valuable. We each have our own views and perspectives on this topic.
Jason mentioned the possibility of another meeting in Nottingham, possibly in November. He then looked at the talks offered in the planning channel and the number of votes for each. He is trying to get someone from GDK to talk on Spring4D.
Was there anything interesting in the recent series of webinars by Embarcadero? No-one seemed to think so. The recent release of Delphi 12.2 seemed to have issues with seeing the values of in-line variables of the same name in the same routine in the debugger.
an Introduction to Quartex Pascal – Dr. Kevin Bond
The first scheduled session was by Dr. Kevin Bond on an Introduction to Quartex Pascal.
Quartex Pascal is a stand-alone IDE, compiler, runtime library and development system for Object Pascal, to build high performance javascript for the browser or servers running node.js.
Quartex Pascal, when released, will run on multiple platforms and with no dependencies, except for Edge, on Windows. Internally it uses DWScript. It also uses css and style files. For personal use it is intended to be free, with a cost of £300 for commercial use.
Kevin then connected his phone to his laptop and held it up so that people in the room could see it running a website created with Quartex. Returning to the main screen, he showed the form designer, with a flow panel containing 3 more panels. Looking at the code, it had pascal code to add a css style sheet.
The form create method has a bunch of code for initialisation and a small delay at the end to allow for all of the visual stuff to be completed, before it becomes “live”. Javascript is asynchronous, so it does not all happen sequentially, as it would with a normal Delphi app. Code for anonymous methods and event handlers in both Delphi and Quartex was compared, to see the similarities.
The main screen offers a set of project types for creating new projects. Each project has a config file with the basic settings. There is a visual form designer, as would be expected in any IDE. Components are widgets and, in Quartex, are, by default, implemented in html as divs, but can be other types if required. Each html component has a handle, by which it can be referenced and/or accessed in code. Kevin showed a html file and talked through it. Javascript code can be embedded in the pascal using the asm…end tags.
Kevin has been writing a manual for it for a bit over a year and is close to release, probably in a month or two. He showed a preview of it and a couple of examples from completed chapters. The last example showed inserting a video player and playing a video on screen.
He talked about the difficulties of getting pascal back into schools as a teaching language, which is something that is important to him. The session ended with a discussion about how this might be done and why pascal, rather than javascript or python.
Hashing Algorithms and their use in an Amazon voucher scheme – Mark Jacobs
The second scheduled presentation, by Mark Jacobs was on Hashing Algorithms and their use in an Amazon voucher scheme.
Hashing was defined in 1953 as a method for creating a fixed size output key from a piece of data. The same data should always generate the same key. It should be noted, however, that a key value can be generated from different sources. For short items, like passwords, seed keys are usually added to the source data before hashing and using larger keys can help to avoid clashes, or duplicated outputs.
Mark has written his own hashing process and also a hash cracker, which he demonstrated. He uses 2 seeds, to try to ensure unique hashes. It uses 32bit number substitution, which basically bit-shifting. Using the cracker, he showed that it could crack the hash to show an alternative source value and also that some numbers have no source, or would not be derived as the result of a hash.
There are many commercial encryption algorithms. MD5 produces 16 byte output as 32 character hexadecimal strings. The SHA family is also popular. Mark showed an on-line hash calculator and explained that for C# there is a lot of support, but for C++ there is no support and you have to write it yourself.
In the past, hackers have built “rainbow tables” of common password hashes to use when attempting to enter systems. Salting passwords with extra strings helps to produce more secure systems. HMAC, hash-based message authentication code, is a cryptographic authentication technique that uses a hash function and a secret key. The key can be either before the message or after it, but the outputs will be different.
Amazon uses SHA-256 with 2 keys, a secret key and an access key. There are then 4 rounds of HMAC to get the final output, which Mark uses for voucher codes. He also logs each key, to make sure that there are never any duplicates issued.
SQL System Tables in CodeDeck – Patrick Davey
The third talk was by Patrick Davey on using SQL System Tables in CodeDeck.
Patrick showed CodeDeck in a presentation at the July meeting. This was a follow up with the theme of how SQLServer implements Codd’s Rule no.4, which states that the database description at the logical level should be the same as ordinary data. This was a demo based presentation.
The GetSchema method call on the database connection returns a list of collections for the database. To find primary key columns, it was necessary to use the index columns and join on key types. Patrick showed the TSQL online help pages, which he had been consulting.
System tables are more detailed than the information schema. Information about auto-increment columns can be found in sys.identity_columns. Patrick showed sql to get a list of foreign keys, and examples of querying the system tables in CodeDeck in order to build scripts.
Fleks and any other business
There was time for a couple of flecks to finish the meeting. Simon Hooper spoke about the hex representation of numbers. Consider that “12” is twelve in decimal and eighteen in hexadecimal. He has written a spec for @hex, which uses [A..O] to represent numbers [0..15]. The terminator can be “+”, “-”, or character that is not @hex.
The second fleck was from Jason, who showed a gadget called a LoupeDeck Live S. This was about the size of a phone, with a set of physical keys, or buttons. It has programmable virtual keys which can be used to represent keyboard combinations and change behaviour and images on the keys based on the application you are in.
The meeting in London finished with a move to the bar.
Jason would like to thank all those who attended the meeting in person, who brought along extension cables.