Skip to content

Instantly share code, notes, and snippets.

View tseijp's full-sized avatar
💬
for (; ;)

sei tseijp

💬
for (; ;)
View GitHub Profile
/**
* ref: https://threadlocalmutex.com/?p=178
static const uint32_t mortonToHilbertTable[] = {
0x00000006, 0x20000005, 0x60000001, 0x40000007, 0xe0000001, 0xc000000c, 0x80000005, 0xa000000e,
0x40000000, 0xa000000a, 0x6000000c, 0x8000000d, 0x20000004, 0xc000000e, 0x00000007, 0xe0000008,
0x80000019, 0xe000001a, 0x6000001b, 0x00000010, 0xa0000012, 0xc0000013, 0x4000001c, 0x2000001d,
0x4000001a, 0x60000019, 0x20000018, 0x00000011, 0xa000001b, 0x8000001d, 0xc0000019, 0xe000001e,
0x00000020, 0x60000026, 0xe000002a, 0x80000024, 0x20000022, 0x40000023, 0xc000002c, 0xa000002d,
0x80000022, 0x60000023, 0xa000002a, 0x40000020, 0xe0000025, 0x0000002a, 0xc000002e, 0x20000024,
0x00000034, 0xe0000033, 0x20000032, 0xc0000038, 0x60000035, 0x80000034, 0x40000036, 0xa000003c,
export const getIndex = (size = 1, x = 0, y = 0, z = 0) => x + (y + z * size) * size
export const greedyMesh = (data: Uint8Array, size = 1, positions: number[] = [], scales: number[] = [], count = 0) => {
const isHitWidth = (x = 0, y = 0, z = 0) => {
if (x >= size) return true
const idx = getIndex(size, x, y, z)
return !data[idx]
}
const isHitHeight = (x = 0, y = 0, z = 0, w = 0) => {
# Determine the keyboard setting in use
isWindowsKeySetting=true # Change this based on your setting
findPath="/System/Library/PrivateFrameworks/CoreJapaneseEngine.framework/Versions/A/Resources"
# Retrieve the paths for both KeySetting files
if $isWindowsKeySetting; then
KeySettingPath=$(find $findPath -name "KeySetting_Windows.plist")
else
KeySettingPath=$(find $findPath -name "KeySetting_Default.plist")
fi
@tseijp
tseijp / img.h
Last active February 3, 2024 15:25
// #define USE_MAIN 1
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#ifndef PI
#define PI 3.14159265359
#endif // PI
#ifndef TWO_PI
#define TWO_PI 6.28318530718
import os
import sys
import time
import socket
import argparse
import subprocess
class Socket:
def __init__(self,opt):
self.port= opt.port if opt.port else 7001
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
int verbose=0, query=1;
double func( double t, double x, double v )
{
//return - 0.1 * x;
[
/*ショ-トカット*/
{Shift} 2 |""<{Left} 1>
{Shift} 7 |''<{Left} 1>
{Shift} 8 |()<{Left} 1>
{Shift} [ |{{}{}}<{Left} 1>
{Ctrl} [ |{Space}[<{Space} 2>]{Space}<{Left} 3>
{Ctrl} , |{ひらがな}{全角}{U+0020}{U+003C}={U+0020}
{Ctrl} . |{ひらがな}{全角}{U+0020}={U+003E}{U+0020}
Button b1;
Button b2;
Button b3;
void setup() {
background(0);
size(1600, 1600);
b1= new Button("タイトル1", "リンク1");
b2= new Button("タイトル2", "リンク2");
b3= new Button("タイトル3", "リンク3");
}
<!DOCTYPE html>
<html>
<head>
<!--processing.jsを読み込む-->
<script src="js/processing.js"></script>
<!--#wrapperのサイズを取得してcanvasの幅と高さに指定しcanvasを全画面に-->
<script type="text/javascript">
$(function () {
sizing();
<html>
<head>
<!--processing.jsを読み込む-->
<script src="js/processing.js"></script>