Skip to content

Instantly share code, notes, and snippets.

@pgtwitter
pgtwitter / shichijyuunikou72_2024.ics
Last active February 13, 2024 01:11
2024年 七十二候 iCalenderファイル
BEGIN:VCALENDAR
VERSION:2.0
PRODID:p_g_
X-WR-CALNAME:七十二候
BEGIN:VEVENT
DTSTART;TZID=Asia/Tokyo;VALUE=DATE:20240101
DTEND;TZID=Asia/Tokyo;VALUE=DATE:20240101
SUMMARY:雪下出麦(ゆきわたりてむぎのびる) - 冬至
URL;VALUE=URI:https://ja.wikipedia.org/wiki/%E5%86%AC%E8%87%B3%23%E4%B8%83%E5%8D%81%E4%BA%8C%E5%80%99
BEGIN:VALARM
@pgtwitter
pgtwitter / nijyuushisekki24_2024.ics
Last active February 13, 2024 01:12
2024年 二十四節気 iCalenderファイル
BEGIN:VCALENDAR
VERSION:2.0
PRODID:p_g_
X-WR-CALNAME:二十四節気
BEGIN:VEVENT
DTSTART;TZID=Asia/Tokyo;VALUE=DATE:20240106
DTEND;TZID=Asia/Tokyo;VALUE=DATE:20240106
SUMMARY:小寒
URL;VALUE=URI:https://ja.wikipedia.org/wiki/%E5%B0%8F%E5%AF%92
BEGIN:VALARM
@pgtwitter
pgtwitter / .py
Created January 9, 2024 07:43
iDirのpngをoDirに連番のファイル名になるよう複写を作る
# %%
import glob
import shutil
import os
iDir = '/Users/Work/Downloads'
oDir = '/Users/Work/Desktop/out'
if not os.path.isdir(oDir):
os.makedirs(oDir)
for idx, f in enumerate(sorted(glob.glob(iDir + '/*.png'))):
print(f)
@pgtwitter
pgtwitter / memo.py
Created December 28, 2023 13:06
Physics(rigid body等)で動かした後の位置と座標を得る方法
#emptyを追加
#emptyのparentを目的物にする
bpy.data.objects["Empty"].matrix_world
bpy.data.objects["Empty"].matrix_world.to_euler('XYZ')
@pgtwitter
pgtwitter / a.ipynb
Last active December 10, 2023 11:45
y^2=x^3+2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pgtwitter
pgtwitter / .py
Created October 16, 2023 06:24
Collatz, Euler, Prime Stair
#%%
def collatz():
for i in range(1, 1000000):
ns=[i]
while(ns[-1]!=1):
ns.append(3*ns[-1]+1 if ns[-1]%2==1 else ns[-1]/2)
print(i, len(ns))
#%%
import sympy
@pgtwitter
pgtwitter / py.ipynb
Created August 15, 2023 16:32
y'=y^2+x^(-2)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pgtwitter
pgtwitter / py.ipynb
Created July 24, 2023 15:58
-1の11乗根の1から10乗において,奇数乗を加え,偶数乗を引いた時の和
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pgtwitter
pgtwitter / py.ipynb
Last active July 25, 2023 00:44
Tridiagonal matrixのDeterminant
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import bpy
import mathutils
import math
# 参考動画1 https://www.youtube.com/watch?v=sOOBYJhELH8
# 参考動画2 https://www.youtube.com/watch?v=0c6yGBhpd9s
# 参考動画1(3:39-)にあるようにMixamoから'MMA Kick'を用意してください.
# スカートは球(UV Sphere)からコード中で作ってます.
def setLayers(target, lidx):