For my link archive, a bunch of task state diagrams that include transitions between the states.
The diagrams are in no particular order.
–jeroen
Posted by jpluimers on 2021/07/06
For my link archive, a bunch of task state diagrams that include transitions between the states.
The diagrams are in no particular order.
–jeroen
Posted in Development, Software Development | Leave a Comment »
Posted by jpluimers on 2021/07/06
Even though RIVM twitter-care did not respond at all on my raised issue that the production environment leaded an acceptation environment URL, it did gain me some knowledge on their systems and the (then upcoming) European QR code systems.
[Archive.is] Jeroen Wiert Pluimers on Twitter: “Onhandig op de #CoronaCheck site van het @rivm de link hier (1) wijst nog naar de acceptatie omgeving en daar heb je authorisatie voor nodig. Zonder “.acc” werkt het ook niet: (2) Dit werkt wel: (3) CC @locuta… “
The problem digging into it was that it only reproduces when inside the [Archive.is] Coronacheck Print Portaal after you have logged on via DigiD, so you cannot save it in the WayBack machine nor Archive.is.
This print portal isn’t a straightforward hierarchy of web-pages, but an actual Vue.js app that injects itself into [Wayback/Archive.is] nl-covid19-coronacheck-website/index.html at main · minvws/nl-covid19-coronacheck-website and dynamically changes the URL depending on the application state.
It also means that you cannot archive pages like coronacheck.nl/nl/print/vaccinatie-ophalen or coronacheck.nl/nl/print/keuze-papieren-bewijs as the Vue.js app will not understand state from those sub-URLs and go back to coronacheck.nl/nl/print/
The only other results of [Wayback] “acc.coronacheck.nl” – Google Search were:
I had a hunch the CoronaCheck code would be open source, though finding it through the most obvious [Wayback] open source coronacheck app – Google Search failed. Since the web-site and app look very similar to the CoronaMelder web-site and app, I tried [Wayback] open source coronamelder app – Google Search and found the page with links: [Wayback] Colophon – Stop the spread of the coronavirus, download CoronaMelder.
Note that [Wayback] Open-Source Project Corona-Warn-App is a different beast. Though internationally available and released way earlier than the Dutch apps, the Dutch government has a huge ego (maybe even abbreviatable to Hugo) resulting in severe “not invented here” syndrome despite having had to be bailed out when “code black” happened in hospitals.
One thing that I learned is that there is one version of the code behind coronacheck.nl/nl/print/print-vaccinatie in the main branch of github.com/minvws/nl-covid19-coronacheck-website that has only acceptance URLs. They are in these locations:
Apparently, replacing these with production URLs is done during deployment, but I could not find the code that does it in the main repositories at [Wayback] github.com/minvws
One answer to my tweet was [Archive.is] Joel Haasnoot on Twitter: “gir.st/blog/greenpass.html… “ which provides more information on the European
These are the links I thought were interesting:
–jeroen
Posted in Development, JavaScript/ECMAScript, Scripting, Software Development, Vue.js, Web Development | Leave a Comment »
Posted by jpluimers on 2021/07/06
Doing a “DefaultUsrPwDm” – Google Search, I bumped into the System.Classes.TLoginCredentialService class.
There is hardly any documentation.
It was introduced as [WayBack] System.Classes.TLoginCredentialService – XE2 API Documentation with the standard TObject template:
TObject is the ultimate ancestor of all objects and components.
System.Classes.TLoginCredentialService inherits from System.TObject. All content below this line refers to System.TObject.
TObject is the ultimate ancestor of all objects and components.
…
Although TObject is the based object of a component framework, not all objects are components. All component classes descend from TComponent.
Note: TObject is never directly instantiated. Although it does not use programming language features that prevent instantiation, TObject is an abstract class.
The documentation was updated in Delphi XE4 to [WayBack] System.Classes.TLoginCredentialService – RAD Studio API Documentation
TLoginCredentialServiceprovides functionality for login action, regardless of framework.
TLoginCredentialServicerepresents an extensible, framework agnostic, login credential service with support for callbacks (success, failure). It includes methods for:
- Getting user credentials: Domain, Username and Password.
- Registering and unregistering credentials from handlers.
See Also
That version also added [WayBack] System.Classes.ELoginCredendialError – RAD Studio API Documentation
ELoginCredendialErroris the exception class for handling invalid login credentials.
ELoginCredendialErroris raised when an application attempts to get specified, but unexisting, login credentials.
Nothing ever got added, no examples, no documentation, just look at for instance the Delphi Rio documentation:
Luckily, I found this for my research list (code at [WayBack] tlogincredentialservice.zip) : [WayBack] delphi – TLoginCredentialService usage example – Stack Overflow which uses globals, but that’s not the point of the demo (you can use different storage in your actual code)
I’ve just created a small demo of how to use it
Click here to download the code
In the following I’ll show some of the code:
First I need a record to hold Credentials, and a list of them :
Type TCredential = record Username, Password, Domain: string; constructor Create(const aUsername, aPassword, aDomain: string); function AreEqual(const aUsername, aPassword, aDomain: string): Boolean; end; TCredentialList = class(TList<TCredential>) public function IsValidCredential(const aUsername, aPassword, aDomain: string): Boolean; end;then we need to define a context in wich we are calling this. Thats just a application unique string wich identifyes each Loginfunction
const Context = 'TForm1';In Form create I create my list and add dummy data to it
procedure TForm1.FormCreate(Sender: TObject); begin CredentialList := TCredentialList.Create; //Add Dummy data CredentialList.Add(TCredential.Create('AA', 'AA', 'DomainAA')); CredentialList.Add(TCredential.Create('BB', 'BB', 'DomainAA')); CredentialList.Add(TCredential.Create('CC', 'CC', 'DomainAA')); // Register your Login handler in a context. // This method is called when you try to login // by caling TLoginCredentialService.GetLoginCredentials(); TLoginCredentialService.RegisterLoginHandler(Context, LoginCredentialEvent); end;I have placed a button on my form from wich I make my call to login :
procedure TForm1.Button1Click(Sender: TObject); begin // The actual call to login // First param is the context // Second Parameres is a callback function given to the event handler. TLoginCredentialService.GetLoginCredentials(Context, function { LoginFunc } (const Username, Password, Domain: string): Boolean begin //The actual user validation Result := CredentialList.IsValidCredential(Username, Password, Domain); end); end;Finally I just need to implement my loginhandler:
//This is the "onLogin" event handler. //This is called durring a login attempt //The purpose of this event handler are to call tha callBack function with correct information //and handle the result procedure TForm1.LoginCredentialEvent(Sender: TObject; Callback: TLoginCredentialService.TLoginEvent; var Success: Boolean); begin //Call the callback Callback(Sender, LabeledEdit1.Text, LabeledEdit2.Text, LabeledEdit3.Text, Success); //Handle the success. if Success then Label1.Caption := 'Yes' else Label1.Caption := 'No'; end;Hope this answers the question.Dont forget to download the complete code here
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2021/07/05
By now it should be able to order them normally, as this link is from early 2019: [WayBack] New version Smart Citizen Kit available | Waag
An improved 2.1 version of the Smart Citizen Kit is now ready for pre-ordering.
…
What does the 2.1 version measure?
The Smart Citizen Kit focuses on the weather, sound, light and air quality. The following overview shows the different sensors in version 2.1:
- Temperature (°C) – Sensirion SHT31
- Relative humidity (% rh) – Sensirion SHT31
- Noise level (dBA) – Invensense ICS4342
- Ambient light (lx) – Rohm BH1721FVC
- Air pressure (barometer, kPa) – NXP MPL3115A2
- Equivalent carbon dioxide (CO2 in ppm) – AMS CCS811
- Volatile organic compounds (ppb) – AMS CCS811
- Particulate matter (PM1/2,5/10 in μg/m3) – Plantower PMS 5003
…
Our findings in 2014 showed that the housing can be an important factor by influencing the sensors; there must be sufficient air flow, but also a watertight environment. And the placement is important (not in full sun for example).
Some relevant links and information:
Fablab Amsterdam is open to the public on Thursday afternoon (12:00-17:00 hrs).
Via:
–jeroen
Posted in Development, Hardware Interfacing, Power User, Software Development | Leave a Comment »
Posted by jpluimers on 2021/07/05
I wish I had blogged about this a lot sooner, as then far less people would use var aFoo: array of TFoo as method parameters for results that are just out parameters and could be a function result.
You cannot have array of TFoo as function result, but you can have TArray<TFoo>. The former would be an open array, the latter is a proper array type.
I see many people use var aFoo: array of TFoo with all sorts of SetLength calls before calling and inside a method where a function returning a TArray<TFoo> would be far more appropriate, both in the sense of readability and maintainability.
–jeroen
Posted in Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2021/07/01
For a very long time, it has been possible to name threads visible in debuggers: How to: Set a Thread Name in Native Code.
In the mean time, under Windows 10, you can both Get and Set the thread name. This brings native applications on par with with .NET where this has always been possible. Chrome uses these new API calls.
Which means I have some reading to do:
–jeroen
Posted in Debugging, Development, Software Development, Windows Development | Leave a Comment »
Posted by jpluimers on 2021/07/01
[WayBack] Maggs on Twitter: “Had to get a bucket to catch all the dropped packets.… “
To me it seemed the bitbucket was the final destination of /dev/null, but others chimed in as well:
Apart from my [WayBack] Jeroen Pluimers on Twitter: “Is that where /dev/null ends?… “, it totally reminded me of the below Dilbert strip which I could not find at first. So I was glad with [WayBack] David Sheryn Twitter: dilbert.com/strip/1996-05-02.
Posted in Development, Fun, Infrastructure, Software Development | Leave a Comment »
Posted by jpluimers on 2021/07/01
The Spring Framework for Delphi has some cool tuple support.
The [WayBack] Tuple class has 3 create methods that build generic Tuple<> records with 2, 3 and 4 fields:
class function Create<T1, T2>(const value1: T1; const value2: T2): Tuple<T1, T2>; overload; static; inline;
type Tuple<T1, T2> = record end; having fields Value1: T1, Value2: T2.class function Create<T1, T2, T3>(const value1: T1; const value2: T2; const value3: T3): Tuple<T1, T2, T3>; overload; static; inline;
type Tuple<T1, T2, T3> = record end; having fields Value1: T1, Value2: T2, Value3: T3.class function Create<T1, T2, T3, T4>(const value1: T1; const value2: T2; const value3: T3; const value4: T4): Tuple<T1, T2, T3, T4>; overload; static; inline;
type Tuple<T1, T2, T3, T4> = record end; having fields Value1: T1, Value2: T2, Value3: T3, Value4: T4.–jeroen
Posted in Delphi, Development, Software Development, Spring4D | Leave a Comment »
Posted by jpluimers on 2021/06/30
Sometimes your development stack is not fully ready to handle signed 64-bit BIGINT values across all layers, which is when [WayBack] A How-to Guide for Resolving Database Record Limitations | Distillery comes in handy.
For data type ranges: [WayBack] int, bigint, smallint, and tinyint (Transact-SQL) – SQL Server | Microsoft Docs
–jeroen
Posted in Database Development, Development, Software Development, SQL Server | Leave a Comment »
Posted by jpluimers on 2021/06/30
For me this unaccepted answer from [WayBack] Regex for a file name without an extension – Stack Overflow by [WayBack] Bohemian worked best:
Assuming the extensions are up to 4 chars in length (so filenames like
mr.smitharen’t considered as having an extension, butmr.smith.docandmr.smith.htmlare considered as having extensions):^.*[^.]{5}$No need to capture a group, as the whole expression is what you want – ie group 0.
Depending on the extension length, increase 5 to like 7 for 6 character extensions (it’s always N+1 when you want to match extensions of N characters).
--jeroen
Posted in Development, RegEx, Software Development | Leave a Comment »