-
VBA樹林
[Excel VBA] How to Manipulate Table Data by Record: Using ListRow
When working with Excel Tables (ListObject) in VBA, there are often times when you want to retrieve, edit, or delete data one row (record) at a time. In VBA, you can use ListRows(row_number) to easily manipulate specific records. This ar... -
VBA樹林
[VBA] How to Determine Which OptionButton is Selected in a UserForm
In VBA UserForms, there are many situations where you want the user to choose only one item from multiple options (e.g., selecting gender or survey ratings). The OptionButton control is perfect for this purpose. OptionButtons within the ... -
VBA樹林
[VBA] How to Lock and Unlock Cells: Using the Locked Property
I recently wanted to lock only specific cells using VBA, so I learned the method for locking and unlocking cells programmatically. Solution: Using the Locked Property In Excel VBA, you can control whether cells are locked (editing prohib... -
VBA樹林
[VBA] How to Display Long Scrollable Text in a UserForm TextBox (Read-Only)
In VBA UserForms, there are times when you need to display long text—such as Terms of Service, application help, or detailed notes—that the user should read but not edit. In such cases, using a multi-line TextBox as a "read-only display ... -
VBA樹林
[VBA] How to Set the Initial Folder for File Dialog Boxes (ChDrive and ChDir)
When using a dialog box to select files in VBA, it can be very tedious to manually navigate to deep folder hierarchies if the initial folder is not set correctly. This article explains how to specify the folder that appears first when a ... -
C#樹林
[C#] How to Get File Size and Convert Units
In many programming scenarios, such as checking file upload limits or monitoring the growth of log files, you often need to retrieve the physical size (number of bytes) of a file. In C#, using the Length property of the System.IO.FileInf... -
C#樹林
【C#】ファイルのサイズ(容量)を取得する方法と単位変換
ファイルのアップロード制限チェックや、ログファイルの肥大化監視など、プログラム内でファイルの物理的なサイズ(バイト数)を取得したい場面は頻繁にあります。 C#でファイルサイズを取得するには、System.IO.FileInfo クラスの Length プロパティを使... -
Python樹林
[Python] Accessing SQLite3 Data by Column Name Using sqlite3.Row
By default, Python's sqlite3 module returns data as tuples. However, by changing a specific setting, you can access values by specifying their "column names," just like a dictionary. This eliminates the need to worry about the order of c... -
Python樹林
【Python】SQLite3でカラム名を指定して値を取得する方法
Pythonの sqlite3 モジュールでは、デフォルトのデータ取得形式はタプル(tuple)ですが、設定を変更することで辞書のように「カラム名」を指定して値にアクセスすることが可能になります。これにより、SQLのSELECT文で取得したカラムの順序を気にする必要... -
Python樹林
[Python] Basics of Retrieving Data with SQLite3: Cursor Loop vs. fetchall vs. fetchone
When retrieving data from a database using Python's standard sqlite3 module, there are several methods available. This article explains how to directly iterate over the cursor object, how to retrieve everything at once using fetchall(), ... -
Python樹林
【Python】SQLite3でデータを取得する基本:cursorループ・fetchall・fetchoneの使い分け
Python標準ライブラリの sqlite3 モジュールを使用してデータベースからデータを取得する際、いくつかの方法が存在します。ここでは、cursor オブジェクトを直接反復処理する方法、fetchall() でリストとして一括取得する方法、そして fetchone() で1行ず... -
Python樹林
[Python] Executing SQL with SQLite3: Creating a Member Table and Inserting Data
This article demonstrates how to use the sqlite3 module to perform "Table Creation (CREATE)" and "Data Registration (INSERT)" operations. We will simulate a database that manages member information for a web service, implementing securit... -
Python樹林
【Python】SQLite3でSQL文を実行する:会員テーブルの作成と登録
sqlite3 モジュールを使用し、データベースへの「テーブル作成(CREATE)」と「データ登録(INSERT)」を行う実装です。 ここでは、Webサービスの会員情報を管理するデータベースを想定し、セキュリティを考慮したプレースホルダを使用した実装を行います... -
Python樹林
[Python] Connecting to and Disconnecting from SQLite3 Databases: File vs. In-Memory
Using the Python standard library sqlite3, you can create and manage lightweight relational databases that run on local files or in memory, without needing to set up a separate server. This article explains how to connect to a database f... -
Python樹林
【Python】SQLite3データベースへの接続と切断:ファイルDBとオンメモリDB
Python標準ライブラリの sqlite3 を使用すると、別途サーバーを立てることなく、ローカルファイルやメモリ上で動作する軽量なリレーショナルデータベースを作成・操作できます。 ここでは、データベースファイル(永続化)への接続方法と、データ保存しな... -
C#樹林
[C#] Changing File Extensions (Path.ChangeExtension)
When renaming files, especially when you only want to change the extension (e.g., .jpeg -> .jpg), performing manual string manipulation often leads to errors in determining the position of the dot. Using the Path.ChangeExtension metho... -
C#樹林
【C#】ファイルの拡張子を変更する (Path.ChangeExtension)
ファイルをリネームする際、特に「拡張子だけを変えたい(例:.jpeg → .jpg)」という場合、手動で文字列操作を行うとドットの位置の判定などでミスが起きがちです。 Path.ChangeExtension メソッドを使用すると、パス文字列内の拡張子部分だけを安全に書... -
C#樹林
[C#] Copying, Moving, and Deleting Files (Basic Operations of the File Class)
File system operations, such as creating file backups, moving processed files, or deleting unnecessary logs, are performed using the static methods of the System.IO.File class. When performing these operations, exceptions (errors) can ea... -
C#樹林
【C#】ファイルのコピー・移動・削除を行う (Fileクラスの基本操作)
ファイルのバックアップ作成や、処理済みファイルの移動、不要なログの削除など、ファイルシステムへの操作は System.IO.File クラスの静的メソッドを使用して行います。 これらの操作を行う際は、対象のファイルが存在しない場合や、移動先に同名のファイ... -
C#樹林
[C#] Converting Relative Paths to Absolute Paths (Full Paths) (Path.GetFullPath)
When "relative paths" (e.g., ..\Data\input.csv) are specified in command line arguments or configuration files, you often need to convert them to "absolute paths" (full paths) inside the program to correctly locate the file. Using the Pa... -
C#樹林
【C#】相対パスを絶対パス(フルパス)に変換する (Path.GetFullPath)
コマンドライン引数や設定ファイルで「相対パス(例:..\Data\input.csv)」が指定された際、プログラム内部ではファイルの場所を特定するために「絶対パス(フルパス)」に変換したい場合があります。 Path.GetFullPath メソッドを使用すると、現在のカレ... -
お金樹林
【ロレックスマラソン】「信用ポイント制」ではありません。その実態を「古本探し」に例えて解説
ロレックスの正規店に通い詰め、希望のモデルを探し求める「ロレックスマラソン」。 言葉は聞いたことがあっても、具体的にどのような仕組みで、なぜそこまでしなければならないのか、疑問に思う方も多いのではないでしょうか。 「常連にならないと売って... -
C#樹林
[C#] Getting Directory Names, Extensions, and Other Components from a File Path
When you want to extract specific parts from a file path string (e.g., C:\MyData\report.pdf), such as "just the file name," "the extension," or "the parent folder path," performing string manipulation (using Substring or IndexOf) can oft... -
C#樹林
【C#】ファイルパスからディレクトリ名や拡張子などの構成要素を個別に取得する
ファイルパス文字列(例:C:\MyData\report.pdf)から、「ファイル名だけ欲しい」「拡張子を調べたい」「親フォルダのパスを知りたい」という場合、文字列操作(Substring や IndexOf)を行うのはバグの原因になります。 System.IO.Path クラスには、これ... -
C#樹林
[C#] Safely Joining File Paths Without Worrying About Separators (Path.Combine)
When building file or directory paths in a program, using simple string concatenation (like the + operator) is dangerous. This is because path separators differ by OS (Windows uses \, Linux/Mac uses /), and mistakes often occur regarding... -
C#樹林
【C#】パスの区切り文字を気にせず安全にファイルパスを結合する (Path.Combine)
ファイルやディレクトリのパスをプログラムで組み立てる際、単なる文字列連結(+ 演算子など)を使用するのは危険です。OSによってパスの区切り文字が異なったり(Windowsは \、Linux/Macは /)、末尾の区切り文字の有無によるミスが発生しやすいためです... -
C#樹林
[C#] Specifying Multiple Regex Options Simultaneously (Combining RegexOptions)
When using regular expressions, you might want to enable "Case Insensitive (IgnoreCase)" and "Multiline Mode (Multiline)" at the same time. Since RegexOptions in C# is defined as bit flags, you can combine multiple options using the bitw... -
C#樹林
【C#】正規表現で複数のオプションを同時に指定する (RegexOptionsの組み合わせ)
正規表現を使用する際、「大文字小文字を区別しない (IgnoreCase)」設定と、「複数行モード (Multiline)」設定を同時に有効にしたい場合があります。 C# の RegexOptions はビットフラグとして定義されているため、ビット演算子の OR (|) を使用することで... -
C#樹林
[C#] Performing Case-Insensitive Regex Searches (RegexOptions.IgnoreCase)
By default, C# Regular Expressions (Regex) strictly distinguish between uppercase and lowercase letters (e.g., "Apple" and "apple" are treated as different). If you want to allow for variations in user input and match text regardless of ... -
C#樹林
【C#】大文字と小文字を区別せずに正規表現で検索する (RegexOptions.IgnoreCase)
C#の正規表現(Regex)は、デフォルトでは大文字と小文字を厳密に区別します(例:"Apple" と "apple" は別物として扱われます)。 ユーザー入力の揺らぎを許容したい場合など、これらを区別せずにマッチさせるには、RegexOptions.IgnoreCase オプションを...