-
Python樹林
Creating and Customizing Bar Charts with Matplotlib in Python
Overview This is a guide for creating customized bar charts using Matplotlib, a data visualization library for Python. We will explain how to control major parameters like bar colors, border thickness, width, and axis tick labels to crea... -
Python樹林
【Python】Matplotlibで棒グラフを作成し見た目や目盛りを詳細に設定する
概要 Pythonのデータ可視化ライブラリであるMatplotlibを使用し、デザインを調整した棒グラフを作成するレシピです。 単にグラフを表示するだけでなく、棒の色、枠線の太さ、幅、軸目盛りのラベル設定など、主要なパラメータを制御して見やすいグラフを作... -
C#樹林
[C#] Defining Column Types and Constraints with Data Annotations
In Entity Framework Core, you can use "Data Annotations" (attributes) on your entity class properties. This allows you to control the details of the database table definition, such as data types, character limits, and NULL constraints. T... -
C#樹林
【C#】属性(Data Annotations)でカラムの型や制約を定義する
Entity Framework Core では、エンティティクラスのプロパティに「属性(Data Annotations)」を付与することで、データベース側のテーブル定義(データ型、文字数、NULL制約など)を詳細に制御できます。 ここでは「従業員マスタ」を例に、文字列の長さ固... -
C#樹林
[C#] Defining Table Relationships (One-to-Many) in Entity Framework Core
In database design, relationships like "One User to Many Posts" are very common. In Entity Framework Core (EF Core), you can automatically create relationships and foreign key constraints by defining navigation properties (properties tha... -
C#樹林
【C#】Entity Framework Coreでテーブル間のリレーション(1対多)を定義する
データベース設計において「ユーザー(1) 対 投稿(多)」のような関係性は非常に一般的です。 Entity Framework Core (EF Core) では、クラス間にナビゲーションプロパティ(相手のクラスを参照するプロパティ)を定義することで、自動的にリレーションと外... -
C#樹林
[C#] Defining Models and Creating a Database with Entity Framework Core
In Entity Framework Core (EF Core), you treat C# classes (POCOs) as database tables. These classes are called "Entities" or "Models." This guide explains how to create a simple message model (Post), define a DbContext to manage it, and g... -
C#樹林
【C#】Entity Framework Coreでモデルを定義してデータベースを作成する
Entity Framework Core (EF Core) では、C# のクラス(POCO)をデータベースのテーブルに見立てて操作します。このクラスを「エンティティ(モデル)」と呼びます。 今回は、簡単なメッセージ投稿モデル(Post)を作成し、それを管理する DbContext を定義... -
C#樹林
[C#] Entity Framework Core Setup Guide: Supporting SQLite, SQL Server, PostgreSQL, and MySQL
Entity Framework Core (EF Core) is an Object-Relational Mapper (ORM) that makes database operations easier in .NET applications. This guide covers the steps to set up EF Core for four major databases: SQLite, SQL Server, PostgreSQL, and ... -
C#樹林
【C#】Entity Framework Core 導入完全ガイド (SQLite/SQL Server/PostgreSQL/MySQL対応)
.NET アプリケーション開発において、データベース操作を効率化する ORM (Object-Relational Mapper) である Entity Framework Core (EF Core) の導入手順を解説します。 本記事では、主要な4大データベース(SQLite, SQL Server, PostgreSQL, MySQL)それ... -
C#樹林
[C#] Implementing Ultra-Fast Zero-Allocation Logging with ZLogger
ZLogger is a library that avoids memory allocation caused by C# string interpolation ($""), enabling extremely high-speed log output. It is highly effective for systems that handle large volumes of logs, such as IoT systems or game serve... -
C#樹林
【C#】ZLoggerを使って超高速・ゼロアロケーションなログ出力を実装する
ZLogger は、C# の文字列補間 ($"") によるメモリ確保(アロケーション)を回避し、非常に高速にログを出力できるライブラリです。大量のログを扱うシステムや、パフォーマンスが要求されるIoT/ゲームサーバーなどで威力を発揮します。 ここでは、指定され... -
C#樹林
[C#] Using log4net with Generic Host (Microsoft.Extensions.Logging)
Log4net is a reliable logging library with a long history. In modern .NET environments, you can use it through the standard Microsoft logging interface (ILogger). This is useful if you want to reuse existing assets or use specific featur... -
C#樹林
【C#】Log4netをGeneric Hostで使用する (Microsoft.Extensions.Logging)
古くから実績のあるロギングライブラリ log4net ですが、現在の .NET (Core) 環境でも、Microsoft の標準ロギングインターフェース(ILogger)を通して利用することが可能です。 既存資産の流用や、log4net 特有の設定(強力なローテーション機能など)を... -
Python樹林
[Python] Comprehensive Guide to Matplotlib Scatter Plots (ax.scatter): Visualizing 3D and 4D Data
The ax.scatter method in Matplotlib does more than just plot points. By changing the "size" and "color" of the points, you can show 3D or even 4D information on a 2D graph. This article explains everything from basic plots to creating bu... -
Python樹林
【Python】Matplotlibの散布図 (ax.scatter) 徹底解説:3次元・4次元データの可視化とデザイン設定
Matplotlibの ax.scatter は、単に点を打つだけでなく、点の「サイズ」や「色」を変えることで、2次元のグラフ上に3次元以上の情報を表現できる強力なメソッドです。 この記事では、散布図の基本的な描画方法から、バブルチャートの作成、透明度や境界線を... -
C#樹林
[C#] Outputting Logs to Files with NLog (.NET Generic Host)
The standard Microsoft.Extensions.Logging in .NET is excellent, but its default capabilities for "outputting logs to text files" and "log rotation" (switching files by date) are limited. By introducing NLog, a high-performance third-part... -
C#樹林
【C#】NLogを使ってログをファイルに出力する (.NET Generic Host)
.NET 標準の Microsoft.Extensions.Logging は優秀ですが、デフォルトでは「テキストファイルへのログ出力」や「ローテーション(日付ごとのファイル切り替え)」機能が弱いです。 そこで、高機能なサードパーティ製ライブラリである NLog を導入すること... -
C#樹林
[C#] The Correct Way to Include Variables in Log Messages (Message Templates)
When logging with ILogger, it is common to use C# string interpolation ($"") to include variable values in a message. However, for better log performance, readability, and easier analysis in the future, it is recommended to use "Message ... -
C#樹林
【C#】ログメッセージに変数を含める正しい方法 (Message Templates)
ILogger でログ出力を行う際、変数の値をメッセージに埋め込みたい場合、C# の文字列補間式($"")を使って結合してしまいがちです。しかし、ログのパフォーマンスや可読性、将来的な分析のしやすさを考えると、「メッセージテンプレート(Message Templat... -
C#樹林
Setting Log Levels and Filters in C# Code (SetMinimumLevel / AddFilter)
This guide shows how to set log levels and filtering rules directly in C# code without using appsettings.json. You can define fine-grained control as compile-time rules, such as "show warnings and above by default, but only show errors a... -
C#樹林
【C#】コードでログレベルとフィルタを設定する (SetMinimumLevel / AddFilter)
appsettings.json を使用せず、C# のコード上で直接ログレベルやフィルタリングルールを設定する方法です。 「デフォルトでは警告以上を表示するが、特定の名前空間だけはエラー以上にする」といった細かい制御を、コンパイル時のルールとして定義できます... -
C#樹林
[C#] Controlling Log Levels with appsettings.json
In .NET Core applications, you can adjust which log levels are output by modifying the configuration file (appsettings.json) without changing your source code. This makes it easy to switch between environments, such as showing only error... -
C#樹林
【C#】appsettings.jsonでログの出力レベルを制御する
.NET (Core) アプリケーションでは、ソースコードを修正することなく、設定ファイル(appsettings.json)を書き換えるだけで「どのレベルのログを出力するか」を調整できます。 本番環境ではエラーのみを表示し、開発環境ではデバッグ情報をすべて表示する... -
C#樹林
[C#] Logging with ILogger in .NET Generic Host
For console applications in .NET Core and later (including .NET 5, 6, and 8), the standard method for professional logging is combining Microsoft.Extensions.Logging and Microsoft.Extensions.Hosting. Unlike System.Console.WriteLine, this ... -
C#樹林
【C#】ILoggerを使ってログを出力する (.NET Generic Host)
.NET Core 以降(.NET 5/6/8含む)のコンソールアプリケーションで、本格的なログ出力を行うには Microsoft.Extensions.Logging と Microsoft.Extensions.Hosting を組み合わせるのが標準的な手法です。 System.Console.WriteLine とは異なり、ログレベル... -
Python樹林
Setting Basic Graph Elements with Matplotlib Axes Objects
This guide explains how to set basic elements like titles, axis labels, display ranges (limits), grid lines, and legends using the Matplotlib object-oriented interface (Axes object). These elements are essential for making your data visu... -
Python樹林
【Python】Matplotlibでグラフのタイトル・軸ラベル・範囲・凡例を設定する基本パターンの解説
Matplotlibのオブジェクト指向インターフェース(Axesオブジェクト)を使用して、グラフのタイトル、軸ラベル、表示範囲(リミット)、グリッド線、凡例といった基本的な構成要素を設定する方法を解説します。 データの可視化において、これらの情報はグラ... -
C#樹林
[C#] Extracting a Specific File from a ZIP Archive (ExtractToFile)
Sometimes, instead of extracting every file in a ZIP archive, you may want to search for and extract only one specific file. By using the ExtractToFile method of the ZipArchiveEntry class, you can write the retrieved entry (file informat... -
C#樹林
【C#】Zipアーカイブから特定のファイルだけを解凍・抽出する (ExtractToFile)
Zipファイルをすべて解凍するのではなく、中身を検索して「特定のファイル1つだけ」を取り出したい場合があります。 ZipArchiveEntry クラスの ExtractToFile メソッドを使用すると、取得したエントリ(ファイル情報)を直接指定したパスにファイルとして...