Python

Difference Between torch.tensor() and torch.Tensor() in PyTorch

This is a quick reference note on the differences between torch.tensor() and torch.Tensor(). Introduction Differences Between torch.tensor and torch.Tensor In Short In Detail Note: Creating Empty Tensors Conclusion References Introduction …

Building a Game from Scratch with Python | From Design to Implementation

I created my own game using Python. This article documents everything from the preparation involved in game development to the implementation challenges I encountered, and the final game design. Introduction Wanting to Create Something Why…

Equality Comparison for User-Defined Class Objects in Python

This article explains how to compare user-defined class objects for equality in Python. Introduction Comparing User-Defined Class Objects for Equality in Python Comparing Instance Variables in the __eq__ Method Comparing __dict__ in the __…

Checking Memory and Disk Space with Python

This article explains how to check memory and disk space on your execution environment using Python. Introduction Getting Disk and Memory Capacity Disk Space Memory Capacity Conclusion References Introduction I recently needed to check mem…

Behavior When Combining GPT Stream and Timeout | OpenAI Python Library

I'll verify what happens when calling the OpenAI API from Python with both stream and timeout settings enabled. Introduction Behavior When Combining GPT Stream and Timeout Hypothesis Testing Method Test Results Summary Conclusion Reference…

Implementing GPT Stream Responses with OpenAI API in Python

This article explains how to implement GPT streaming responses using the OpenAI API in Python. Introduction Implementing GPT Stream Responses with OpenAI API Conclusion References Introduction When you call GPT using the OpenAI API, the de…

Setting Timeout in the OpenAI Python Library

This is a guide on how to set timeouts when calling the OpenAI API using the OpenAI Python Library. Introduction Setting Timeout in the OpenAI Python Library How to: Using the request_timeout Parameter A Pitfall: The timeout Parameter Conc…

Adding Tags in AWS CDK

This is a quick reference guide for adding tags in AWS CDK. Introduction Environment Adding Tags in CDK Examples Adding Tags at the Stack Level Adding Tags at the Construct Level Note: Deprecated Tag Assignment Method Conclusion References…

Nesting Stacks in AWS CDK

This article describes how to nest Stacks when deploying with AWS CDK. Introduction Environment Nesting Stacks in CDK Problem: Stacks Cannot Be Simply Nested Solution: Use NestedStack Conclusion References Introduction When I tried to nest…

Deleting All Existing Objects in Blender Python

This is a quick reference guide on how to delete all objects in a scene using Blender Python. Introduction Deleting All Existing Objects in Blender Python Conclusion References Introduction When working with Blender Python through trial an…

How to AssumeRoles with Boto3 | AWS SDK for Python

This post summarizes how to perform AssumeRole using Boto3. Introduction Assuming Roles with Boto3 Implementing the AssumeRole function Example Usage Conclusion References Introduction There are many situations where you need to AssumeRole…

Combining GPT-4 Vision with Raspberry Pi | Making GPT the Brain of a Robot, Part 2

In this post, I’ll run a simple robot experiment on Raspberry Pi, combining a camera and servo motors with GPT-4 Vision. For Part 1, see: en.bioerrorlog.work Introduction Combining GPT-4 Vision with Raspberry Pi Concept Setup Hardware Soft…

Making LLM the Brain of a Robot - Part 1: Combining a Camera/Servo Motor with GPT

We'll conduct a simple experiment combining a camera, servo motors, and GPT on a Raspberry Pi. Introduction Combining GPT with Raspberry Pi, Camera, and Servo Motors Prototype Concept Setup Hardware Software Results Challenges Object Detec…

Controlling Multiple Servo Motors with Raspberry Pi (No PWM Module)

This is a quick note on how to control multiple servo motors using only the GPIO pins on a Raspberry Pi—without relying on any PWM or servo controller modules. Introduction Controlling Multiple Servos on Raspberry Pi OS Environment Wiring …

What the Underscore Suffix Means in PyTorch Function Names

It indicates in-place operations. Introduction Underscore "_" Suffix in PyTorch Function Names Meaning Example Conclusion References Introduction When working with PyTorch, you'll often see functions with a trailing underscore _ in their n…

Building a MCP Server in Go

This is a memo on how to implement an MCP server using Golang. Introduction Prerequisite: Is there an official Go MCP SDK? Implementing an MCP Server in Go The Target MCP Server Implementing the MCP server in Go Implementing the Tool Imple…

How to use uv: A Fast Python Package & Project Manager

This is a quick memo on how to use the Rust-based Python package & project manager, "uv". Introduction How to Use uv Installing uv Listing uv Commands Creating a Python Project Creating a Virtual Environment Adding a Python Package Checkin…

Streamlining MCP Server Development with MCP CLI

This guide summarizes how to use the MCP CLI. Introduction How to Use MCP CLI Installing MCP CLI List of MCP CLI Commands How to Use mcp run How to Use mcp dev How to Use mcp install Conclusion References Introduction MCP CLI is a tool inc…

How to Use MCP Inspector: A Testing Tool for MCP Servers

This is a quick guide on how to use "MCP Inspector," a browser-based test tool for MCP servers. Introduction How to Use MCP Inspector Preparation: Set Up a Minimal MCP Server Launching MCP Inspector Using MCP Inspector Conclusion Reference…

AI Agent Patterns & Practices

Learn about AI agent patterns and practices from Anthropic’s article "Building effective agents" and its follow-up video. Introduction Background: What Is an AI Agent? AI Agent Patterns Augmented LLM Workflow: Prompt chaining Workflow: Rou…

Connecting GPT with MCP Server: MCP Tutorial

In this post, we'll connect GPT / OpenAI API with MCP (Model Context Protocol), and learn how MCP works. Introduction Recap: What is MCP? Connecting GPT to an MCP Server Implementing the MCP Server Implementing the MCP Client Running the M…

Blender Python Not Showing print() Output: How to Fix It

This post summarizes how to fix the issue: print() doesn't display any output in Blender Python. Introduction Blender Python: How to See print Output Open the System Console (Windows only) Launch Blender from the Command Line Use Alternati…

LLM-Based 3D Modeling in Blender: Trying Out MeshGen/LLaMA-Mesh

Exploring LLaMA-Mesh, an LLM that outputs 3D model data, and its Blender add-on, MeshGen. In addition, we'll also try using ChatGPT for 3D modeling. Introduction Understanding LLaMA-Mesh 3D Modeling with MeshGen Installing MeshGen in Blend…

Running Artificial Life "Lenia"

Let's explore and play with the artificial life model "Lenia." Introduction Running Artificial Life "Lenia" What is Lenia? Running Lenia Exploring Different Lenia Patterns Conclusion References Introduction There is a beautiful artificial …

Installing bpy via pip: Blender Python

Be mindful of the compatibility between bpy versions and Python versions. Introduction Installing bpy via pip 1. Check the Python version 2. Install bpy via pip Conclusion References Introduction I attempted to install the Blender Python m…

Fix Error: "Object of type datetime is not JSON serializable" in Python

This article summarizes how to fix the following error that occurs when using Python's json module for JSON conversion: "Object of type datetime is not JSON serializable" Introduction Background Solutions Preliminary: The default Parameter…

How to Fix pip/pip3 Installation Errors on Ubuntu

When using Ubuntu, I found that Python's pip and pip3 were not pre-installed. I unexpectedly ran into trouble during the installation, so here's the record of how to solve it. Introduction Installing pip/pip3 on Ubuntu Premise: pip vs pip3…

How to Handle Errors in boto3 | AWS SDK for Python

This article summarizes how to handle errors in boto3, AWS SDK for Python. Introduction Handling Errors in boto3 Using client.exceptions Using botocore.exceptions Example Code Handling BucketAlreadyExists error in S3 create_bucket Handling…

boto3 vs boto: Differences and History

This post summarizes the differences between boto3 and boto, the origins of "boto" itself, and the history of the AWS SDK for Python. Introduction The History of AWS SDK for Python Differences Between boto3 and boto What Happened to boto2?…

Image