Skip to content

Instantly share code, notes, and snippets.

我用的蓝牙键盘 Logitech K380(支持三个设备,Windows,Android,iOS,macOS不同系统键盘布局) 鼠标 M350 支持蓝牙和 USB A 无线匹配器双模式,很满意,买了好几套。😄

刚发现 Logitech 出了新的型号 Pebble 2,换一次电池号称可以用 3年,😄 因为用了更省电的无线协议。 https://www.coolblue.nl/product/936183/logitech-pebble-2-combo-qwerty-wit.html

Pebble 2 combo 鼠标和键盘兼容新的 Logi Bolt USB 匹配器 https://www.logitech.com/zh-cn/business/work-setups/logi-bolt-wireless-technology.html

K380s 和 M350s 比 K380 M350 升级了更好用。鼠标自带一个新的 Logi Bolt USB 无线匹配器,键盘也支持。这样在家里的连接坞

@howardrotterdam
howardrotterdam / disk catalog index.md
Last active August 22, 2025 09:16
Open source disk catalog index tools like WhereIsIt and lolcate

Gemini 2.5Pro:

Of course. For open-source disk cataloging and file searching, Virtual Volumes View (VVV) is an excellent GUI-based alternative to WhereIsIt, and plocate / mlocate are standard CLI tools similar to lolcate.

Here are the best open-source recommendations, broken down by interface type.


🖥️ GUI-Based Tools

@howardrotterdam
howardrotterdam / pytest_exception.md
Created May 4, 2025 09:22
Show code example for usage of ExceptionInfo in pytest

Gemini 2.0flash:

You're right, ExceptionInfo in pytest is a powerful tool for inspecting exceptions raised during test execution. It provides a structured way to access details about the exception, such as its type, value, and traceback. This allows you to write more specific and informative tests that assert the correct exception is raised and potentially examine its properties.

Here's a code example demonstrating various ways to use ExceptionInfo with pytest.raises:

import pytest

def divide(x, y):
@howardrotterdam
howardrotterdam / pytest_notebook.md
Created May 4, 2025 08:58
How to use pytest to write tests in Jupyter Notebook or Google Colab?

Gemini 2.0flash:

Ah, bringing the power of pytest into the interactive environments of Jupyter notebooks and Google Colab! While the typical pytest workflow involves running tests from the command line, you can definitely integrate it into these environments for more immediate feedback and experimentation. Here are a few approaches you can take:

Method 1: Using ! (Shell Commands)

This is the most straightforward way to run pytest from within a notebook cell. You essentially use the ! prefix to execute shell commands.

  1. Install pytest (if you haven't already):
@howardrotterdam
howardrotterdam / GitHub_Copilot_Chat.md
Last active February 7, 2026 04:29
What the difference between VS Code plugin GitHub Copilot and GitHub Copilot Chat? Do I need both of them for vibe coding?

What the difference between VS Code plugin GitHub Copilot and GitHub Copilot Chat? Do I need both of them for vibe coding?

Gemini 2.5 Pro:

Okay, let's break down the difference between the core GitHub Copilot functionality and GitHub Copilot Chat, especially within the context of VS Code.

1. GitHub Copilot (Core Inline Suggestions)

  • What it is: This is the original AI pair programmer functionality.
  • How it works: It works directly within your code editor as you type. It analyzes the context of your code (the file you're editing, other open files, comments, function names, etc.) and automatically suggests lines of code or entire functions to complete what you're writing.
@howardrotterdam
howardrotterdam / common_metrics.md
Created March 30, 2025 09:09
How to evaluate the performance of different recommendation models

How to evaluate the performance of different recommendation models like ALS and FP-growth? Are there any common metrics that are meaningful across different models?

Grok3:

Evaluating the performance of recommendation models like Alternating Least Squares (ALS) and FP-growth involves assessing how well they predict user preferences or generate relevant recommendations. While these two models differ in their approach—ALS is a matrix factorization technique commonly used in collaborative filtering, and FP-growth is an association rule mining algorithm often applied to market basket analysis—they share some common evaluation principles. The choice of metrics depends on the task (e.g., rating prediction or item recommendation) and the data available (e.g., explicit ratings or implicit feedback like clicks). Below, I’ll outline key methods and metrics that are meaningful across different recommendation models.

1. Evaluation Approaches

Before diving into metrics, it’s worth noting the typical ways to ev

@howardrotterdam
howardrotterdam / association_rule.md
Created March 30, 2025 08:58
What's Association Rule in machine learning?

What's Association Rule in machine learning?

Grok3:

In machine learning, Association Rule refers to a technique used to uncover interesting relationships or patterns between variables in large datasets, typically in the form of "if, then" statements. It’s widely applied in data mining, especially for market basket analysis, where the goal is to find items that frequently occur together in transactions.

An association rule is expressed as A → B, where:

  • A (the antecedent) is an item or set of items, and
  • B (the consequent) is another item or set of items.
  • The rule suggests that if A occurs, then B is likely to occur as well.
@howardrotterdam
howardrotterdam / git_submodule_subtree.md
Created March 28, 2025 08:51
git submodule and subtree

How do you compare git submodule and subtree and what are the choice considerations between them?

Grok3:

When comparing git submodule and git subtree, we're looking at two different approaches to managing nested repositories or dependencies within a Git project. Each has its strengths, weaknesses, and use cases. Let’s break it down:

Git Submodule

  • What it is: A submodule is essentially a pointer to a specific commit in another Git repository. It’s like embedding a separate repo inside your main repo, tracked via a reference.
  • How it works: You add a submodule with git submodule add <repo-url>, and it lives in its own directory. The parent repo stores the submodule’s commit hash, not its full content.
  • Key Characteristics:
@howardrotterdam
howardrotterdam / gui_test_headless.md
Created March 26, 2025 11:57
How to do automated test of non-web GUI applications written in eg. tkinter or pyqt headless in a CI/CD pipeline?

How to do automated test of non-web GUI applications written in eg. tkinter or pyqt headless in a CI/CD pipeline?

Grok3:

Automating tests for non-web GUI applications (like those built with Tkinter or PyQt) in a headless environment within a CI/CD pipeline can be challenging because these frameworks are designed to interact with a graphical interface, and headless systems (like CI servers) typically lack a display. However, there are strategies and tools to make this possible. Here's a step-by-step approach:


1. Understand the Challenges

  • Headless Environment: CI/CD systems (e.g., GitHub Actions, Jenkins, GitLab CI) often run on servers without a display, while Tkinter and PyQt expect a graphical environment (X11 on Linux, Windows GUI, etc.).
@howardrotterdam
howardrotterdam / conda_local_path.md
Last active March 22, 2025 10:12
Why do shared libs in conda created Python environments include environment folder path strings in the binary

Why do shared libs in conda created Python environments include environment folder path strings in the binary? How does conda create them on the fly?

gemma3:27b: It appears you're asking about why shared libraries (.so files on Linux, .dll on Windows) within a conda environment include the environment's path within the binary itself, and how conda manages this.

Here's a breakdown based on the search results and general conda behavior:

Why the Environment Path is Embedded

Conda, when creating an environment, essentially builds a self-contained Python distribution. This includes not just the Python interpreter and packages, but also the necessary shared libraries (like libpython, NumPy's libraries, etc.). To ensure that the environment is truly isolated and doesn't rely on system-wide libraries (which could cause conflicts), conda copies these shared libraries into the environment's directory.