Skip to content

Instantly share code, notes, and snippets.

View 34j's full-sized avatar
🐠

34j

🐠
  • Japan
View GitHub Profile
@34j
34j / tqdm_redirect.py
Last active March 5, 2023 05:35
Always use tqdm.rich, tqdm.gui, tqdm.tk instead of tqdm.std without changing the original code
from tqdm.rich import tqdm
# sys.modules['tqdm'].__dict__["tqdm"] = tqdm
sys.modules["tqdm.std"].__dict__["tqdm"] = tqdm
@34j
34j / physics-materialderivative.sty
Created January 18, 2023 09:22
physics-materialderivative.sty
\RequirePackage{xparse}
\DeclareDocumentCommand\materialderivative{ s o g d() }
{ % Total materialderivative
% s: star for \flatfrac flat materialderivative
% o: optional n for nth materialderivative
% g: optional (f in df/dx)
% d: long-form d/dx(...)
\IfBooleanTF{#1}
{\let\fractype\flatfrac}
@34j
34j / Tree With CheckBoxes.lua
Last active August 16, 2022 15:21
DaVinci Resolve UIManager.Tree with checkBoxes
--Licensed under CC0 1.0 https://creativecommons.org/publicdomain/zero/1.0/
--Add this file to C:\ProgramData\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Comp
--tree:SetItemWidget is no available unfortunatelly, which means we cannot add custom widgets to TreeItems.
--So we have to use this method. (only checkBoxes are supported)
local ui = fu.UIManager
local disp = bmd.UIDispatcher(ui)
-- create a new window
local win = disp:AddWindow({
# https://opensource.org/licenses/GPL-3.0
import control.optimal as opt
import control as ct
import numpy as np
import pandas as pd
from numpy.typing import NDArray
X0 = np.array([1, 1])
Tf = 1
horizon = np.linspace(0, Tf, 15, endpoint=True)
@34j
34j / PI7Segment.cs
Last active September 15, 2019 05:02
void LEDDisp(){
for (int i = 0; i < DigitOfLED; i++) {
if (i == 3) {
LED9 = 0;
} else if (i == 2) {
LED8 = 0;
} else if (i == 1) {
LED6 = 0;
} else if (i == 0) {
LED12 = 0;