Skip to content

Instantly share code, notes, and snippets.

View owlsperspective's full-sized avatar

Owl's perspective owlsperspective

View GitHub Profile
@owlsperspective
owlsperspective / Unit1.dfm
Created December 22, 2023 08:31
文字列を書記素クラスタで分割する
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 441
ClientWidth = 624
Color = clBtnFace
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -37
@owlsperspective
owlsperspective / PasswordUtils.pas
Last active February 12, 2020 08:03
(仮)パスワードを生成
unit PasswordUtils;
interface
{$DEFINE ENABLE_CHECK_ROUTINES}
uses
System.SysUtils;
type
@owlsperspective
owlsperspective / HardLink.pas
Last active July 26, 2019 08:44
WindowsのNTFSでハードリンクを扱う
@owlsperspective
owlsperspective / ConvertSID.pas
Last active December 6, 2019 11:08
Windows上のユーザ名とSIDを相互変換/Convert between username and SID on Windows
unit Unit2;
interface
uses
{$IF RTLVersion < 23.0}
Windows, SysUtils;
{$ELSE}
Winapi.Windows, System.SysUtils;
{$IFEND}
@owlsperspective
owlsperspective / HideQuickActionPanel.dpk
Last active March 20, 2019 02:39
RAD Studio IDEのクイックアクションパネルを非表示にする/Hide quick action panel on RAD Studio IDE
// Hide Quick Action Panel from Delphi 2010 or later
// Delphi 2010以降のクイックアクションパネルを非表示にする
// original by MartynA from https://stackoverflow.com/questions/41501400/delphi-xe4-ide-how-to-always-hide-the-bottom-panes-of-the-object-inspector
//
// How to use this package:
// Open HideQuickActionPanel.dpk and change project option/description page below, and select 'install' on project pane's context menu.
// 1.Set description 'Hide quick action panel' or something.
// 2.Set LIB suffix, for example '330'(compiler version) or '260'(Delphi version) or '200'(studio version) or 'Rio'(codename) or etc.
// 3.Set 'Design time only'.
//
@owlsperspective
owlsperspective / DumpExceptionStack.pas
Created November 10, 2017 06:00
JclDebugでスタックトレースを取得する/Get stack trace descriptions from JclDebug
unit DumpExceptionStack;
interface
uses
Winapi.Windows,
System.SysUtils,
JclBase, JclDebug;
function GetExceptionDescription(E: Exception): String;
@owlsperspective
owlsperspective / UCombSort.pas
Created March 22, 2017 02:26
ジェネリックスのリストをアルゴリズムを指定してソートする/Sort generic list by specifying algorithm
unit UCombSort;
interface
{$IF RTLVersion <= 20.00}
{$MESSAGE ERROR 'Need Delphi 2010 or later'}
{$IFEND}
uses
{$IF RTLVersion >= 23.00}
@owlsperspective
owlsperspective / Open PDF via DDE for Reader 10 or later.pas
Last active March 7, 2017 09:46
Adobe Reader(X以降)で指定したファイルの指定したページを開く
unit Unit2;
interface
uses
{$IF RTLVersion >= 23.00}
Winapi.Windows, System.SysUtils, System.Win.Registry, System.AnsiStrings,
Vcl.DdeMan;
{$ELSE}
Windows, SysUtils, Registry, {$IFDEF UNICODE}AnsiStrings, {$ENDIF}DdeMan;
@owlsperspective
owlsperspective / Class helper unit.pas
Last active July 11, 2016 09:42
Delphi 10.1 Berlinでもclass helperでprivateなクラス変数/クラスメソッド/インスタンスメソッドにアクセスしたい
unit Unit2;
interface
uses
Unit3;
type
TFooHelper = class helper for TFoo
public
@owlsperspective
owlsperspective / How to determine Windows is server SKU
Last active February 26, 2016 09:22
Windowsがサーバ版かどうかを調べる
function IsWindowsServer: Boolean;
var
OSVI: TOSVersionInfoEx;
ConditionMask: UInt64;
begin
FillChar(OSVI,SizeOf(TOSVersionInfoEX),0);
OSVI.dwOSVersionInfoSize := SizeOf(OSVI);
OSVI.wProductType := VER_NT_WORKSTATION;