Delphi.Masterpiece.What is the log path in masterpiece platform ?

it is defined in application context

constructor TApplicationContext.Create;
...
FLogPath := IncludeTrailingPathDelimiter(TPath.GetHomePath) + csLogDir;
...

for me it is

'C:\Users\stanley\AppData\Roaming\Logs\'
Posted in Без рубрики | Comments Off on Delphi.Masterpiece.What is the log path in masterpiece platform ?

TpLink. Forward Port

Example

Posted in Без рубрики | Comments Off on TpLink. Forward Port

Delphi. ConstantArrays

Examples

type
    TShopItem = record
      Name : string;
      Price : currency;
    end;
 
 const
    Days : array[0..6] of string =
    (
      'Sun', 'Mon', 'Tue', 'Wed',
      'Thu', 'Fri', 'Sat'
    ) ;
 
    CursorMode : array[boolean] of TCursor =
    (
      crHourGlass, crSQLWait
    ) ;
 
    Items : array[1..3] of TShopItem =
    (
      (Name : 'Clock'; Price : 20.99),
      (Name : 'Pencil'; Price : 15.75),
      (Name : 'Board'; Price : 42.96)
    ) ; 
Posted in Без рубрики | Comments Off on Delphi. ConstantArrays

Delphi. Enum and strings

working approach

Result := System.TypInfo.GetEnumName (TypeInfo (TEnum), Ord (FEnum)));

other approaches

TEnum = (enOne, enTwo, enThree, enFour, enFive, enSix);

// 1
case Self of
    enOne   : Result := 'One';

// 2
const cOne: strig = 'One';
...
case Self of
    enOne   : Result := cOne;

// 3
const cEnumStr: array[TEnum] of string = ('One', 'Two', 'Three', 'Four', 'Five', 'Six');
...
Result := cEnumStr[Self];

Source

Posted in Без рубрики | Comments Off on Delphi. Enum and strings

Git.Add putty to System Variables

If to add putty to system vars, then we can fetch,pull and so on without logging. That’s cool when you have tons of submodules.

Posted in Без рубрики | Comments Off on Git.Add putty to System Variables

How to install openssl cert on local machine and how to combine them?

Example

Opent Git Bash and execute like the following

openssl 
pkcs12 -in C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Main\certificate_fc24d66b-7fdf-446b-85c4-b013d7371f17.p12 -nodes -nocerts -out C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Main\private.key

pkcs12 -in C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Main\certificate_fc24d66b-7fdf-446b-85c4-b013d7371f17.p12 -clcerts -nokeys -out C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Main\client_cert.crt

pkcs12 -in C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Main\certificate_fc24d66b-7fdf-446b-85c4-b013d7371f17.p12 -cacerts -nokeys -chain -out C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Main\cacerts.cer

After all install all certs.

Example combine

OpenSSL.exe 
pkcs12 –export –in C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Test\client_cert.crt –inkey C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Test\private.key –out C:\Work\ShopSberPayQR\Services\QRCode\Sber\Win32\sberPortalAppsCerts\Test\certfile.pfx
Posted in Без рубрики | Comments Off on How to install openssl cert on local machine and how to combine them?

Delphi.ManagedTypes.Const

Should put const before them

  1. string
  2. Interface
  3. Record
  4. Dynamic Array
  5. Анонимный метод
  6. Variant
Posted in Без рубрики | Comments Off on Delphi.ManagedTypes.Const

JS. Send PostRequest from Browser Console

first, request get with http://yoururl to exchange headers, then request post
await fetch(
    "http://yoururl",
    {
        method: "POST",
        headers: { "content-type": "application/json", "origin": "same-origin" },
        body: JSON.stringify({
            filter: {
                 ...fields
            },
            pagination: {
                ...fields
            },
            order: [
                ...objs
            ],
        }),
    },
)
Posted in Без рубрики | Comments Off on JS. Send PostRequest from Browser Console

React.AddLinterAndPrettier

1-eslint.js

Continue reading
Posted in Без рубрики | Comments Off on React.AddLinterAndPrettier

MockServerWorker Example

link

Posted in Без рубрики | Comments Off on MockServerWorker Example