Using RapidFort on Windows WSL

| category: My notes | author: st
Tags:

RapidFort services can optimize and secure your containers. The command line interface (CLI) tools enable you to interact with RapidFort services.

See also the official manuals.

The "native" way is using a Linux distribution on your desktop. However, the majority of desktops are running Windows. Fortunately we have WSL (Windows …

SQL Server: kill all database connections

| category: My notes | author: st
Tags:

How to kill all database connections before dropping it?

USE master;
GO
DECLARE @sql nvarchar(max);
WHILE 1=1 BEGIN
    SELECT TOP 1 @sql = N'KILL ' + convert(nvarchar(10), spid)
    FROM sysprocesses WHERE dbid = DB_ID('my_database');
    IF @@rowcount = 0  BREAK;
    EXEC sp_executesql @sql;
END;
DROP DATABASE IF EXISTS my_database;

C/C++: how to clear a linked circular list

| category: My notes | author: st
Tags: ,

In the case of linked circular list you need to add some checks to avoid memory corruption.

Full example (compiled OK with GCC 8.x)

#include <iostream>
#include <cstdlib>

struct Node
{
    Node(Node* prev, int val)
        : prev(prev), next(NULL), value(val)
    { }
    Node *prev, *next;
    int value;
};

void clear_list(Node …

Classic backgroud color in Windows 10

| category: My notes | author: st
Tags:

How to set classic background color in Windows 10?

  • Right click on desktop and select "Personalize" menu
  • Set "Background" option to "Solid color"
  • Click on "+ custom color" button
  • Click on "More"
  • Check that "RGB" is set
  • Enter "#336EA5" and click "Done" button

That's all.

C++Builder: using variant type variable to store Delphi interface

| category: My notes | author: st
Tags: ,

Delphi case

Delphi supports interfaces natively. Any variable of variant type can store an interface like any allowed data types.

program IntfDelphi;

{$APPTYPE CONSOLE}
{$R *.res}

uses
  Classes, SysUtils, Variants;

type
  ITest = interface(IInterface)
    ['{BEDC5E17-2C40-4F7C-8C78-34448F5CE146}']
    procedure Foo(const Msg: string);
  end;

  TestImpl = class(TInterfacedObject, ITest)
  public
    procedure Foo(const Msg …

Create live USB stick on Debian

| category: My notes | author: st
Tags:

Debian distribution doesn't have USB startup disk creator software. However, you can make live USB stick based on Live-DVD ISO from command line.

sudo dd bs=4M if=///.iso of=/dev/sdX && sync

where sdX is the USB device name. Don't use trailing digits like sdb1.

Example

sudo dd bs …

How Model Driven kicks off Agile

| category: My notes | author: st
Tags: ,

The text below is not mine but I completely agree with author, after many years in software engineering using models to generate programs, components and codes. See also Geniel Lamp tool and my presentation "[MDA/MDD approach - Relation to the software development life-cycle](https://www.researchgate.net/publication/287201275_Architecture_of_enterprise_automated_information_system_-Layers_and_levels_-MDA_MDD_approach_-Relation_to_the_software_development_life-cycle".

The …