T FindTrack<T>(PlayableGraph graph) where T : TrackAsset
{
var director = (graph.GetResolver() as PlayableDirector);
foreach (var binding in director.playableAsset.outputs)
{
if (binding.sourceObject is T track)
{
return track;
This file contains 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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Net.Http; | |
using System.Text.RegularExpressions; | |
using UnityEngine; | |
using ResponseCallback = System.Func<System.Net.HttpListenerRequest, System.Text.RegularExpressions.Match, ResponseValue>; | |
public class ResponseValue |
クリフォード/デヨン アトラクタ https://gihyo.jp/book/2021/978-4-297-12383-3
def Clifford(x, y, a = -1.1, b = -1, c = -3.0, d = -0.1): # -3 ~ 3
x_ = np.sin(a*y) + c*np.cos(a*x)
y_ = np.sin(b*x) + d*np.cos(b*y)
return x_, y_
def DeJong(x, y, a = -2, b = -2.3, c = -1.4, d = 2.1): # -3 ~ 3
Generate AnimatorController by editor scripting
[SerializeField]
RuntimeAnimatorController ControllerAsset;
[ContextMenu("Generate")]
void Generate()
{
var controller = ControllerAsset != null ?
var pos = AnimationCurve.Linear(0f, 0f, 2f, 3f);
var rotate = AnimationCurve.Linear(0f, 0f, 2f, 45f);
var scale = AnimationCurve.Linear(0f, 0f, 2f, 2f);
var clip = new AnimationClip();
clip.SetCurve("", typeof(Transform), "m_LocalPosition.x", pos);
clip.SetCurve("", typeof(Transform), "localEulerAnglesRaw.y", rotate);
This file contains 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 | |
from PIL import Image | |
import matplotlib.pyplot as plt | |
with open("test.depth", "rb") as file: | |
bins = np.frombuffer(file.read(), dtype = np.uint16).reshape(cols, rows) | |
plt.imshow(bins) | |
Image.fromarray((bins / 24).astype(np.uint8)).save("./test.jpg") |
This file contains 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 selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support import expected_conditions | |
driver = webdriver.Chrome("./chromedriver_win32/chromedriver.exe") | |
driver.get("https://.../") |
This file contains 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
require 'mechanize' | |
require 'nokogiri' | |
agent = Mechanize.new | |
page = agent.get("http://yourei.jp/%E6%A4%9C%E7%B4%A2") | |
doc = page # Nokogiri::HTML.parse(File.read("body.html")) | |
table = doc.search("#sentence-example-list") | |
table.search("span.the-sentence").each do |node| | |
puts node.inner_text |
This file contains 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
using UnityEngine; | |
using UnityEditor; | |
public class FindMissingEditor : EditorWindow | |
{ | |
[MenuItem(itemName: "Menu/Find Missing References")] | |
public static void Open() | |
{ | |
EditorWindow.GetWindow<FindMissingEditor>("Find Missing References").Show(); | |
} |
This file contains 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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; http://ahkwiki.net/KeyList | |
; ! = alt | |
; ^ = ctrl | |
; + = shift | |
; # = win |
NewerOlder