// Diagnose
Intl.DateTimeFormat().resolvedOptions() // Lists the locale used to format dates.
new Date().toLocaleString() // Main date format things are returned as.
// These are normally correct. They show what languages are requested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Related to https://github.com/pydata/xarray/issues/10135 | |
| Result (in VS Code debugger): | |
| Shape | NumPy → Polars | NumPy → Pandas → Polars | |
| ----------------------------------------------------------------- | |
| 10,000 x 10 | 0.003997 s | 0.033097 s | |
| 10,000 x 200 | 0.002424 s | 0.050915 s | |
| 100,000 x 10 | 0.000278 s | 0.021541 s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pandas as pd | |
| import polars as pl | |
| import time | |
| from memory_profiler import memory_usage | |
| # Array shapes to test | |
| shapes = [ | |
| (10_000, 10), | |
| (10_000, 200), |
Main guide: https://etoast.net/posts/agilent_repair/
Repairing the power supply is not very feasible.
- Power Supply: RPSG-160-12 [1x]
- RPSG-160-12 Datasheet
- Install VS Code.
- In VS Code, install the "MicroPico" extension.
- Download the MicroPython firmware from: https://micropython.org/download/RPI_PICO/RPI_PICO-latest.uf2
- Connect the RP2040-Zero to the computer. If a USB Drive doesn't appear, press: reset-down, boot-down, reset-up, boot-up.
- Open the USB Drive that appeared. Copy on the MicroPython uf2 file. Wait 30 seconds.
- Optional: Run
pip install micropython-rp2-rpi_pico-stubsto install Python type checking helpers.
- This install the type hints required for the
import machinepackage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sympy import symbols, Eq, solve | |
| # Define symbols | |
| k1, k2, k3 = symbols('incoming_slope normal_slope outgoing_slope') | |
| # Define the equation | |
| equation = Eq((k1 - k2) / (1 + (k1*k2)), (k2 - k3) / (1 + (k2*k3))) | |
| # Solve the equation for k3 | |
| solution = solve(equation, k3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip install virtualbox | |
| import virtualbox | |
| vbox = virtualbox.VirtualBox() | |
| machine = vbox.find_machine("Ubuntu 20") | |
| session = machine.create_session() | |
| session.console.keyboard.put_keys("Hello, world!") | |
| # Source: https://github.com/sethmlarson/virtualbox-python/issues/142 |
NewerOlder