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 <Cocoa/Cocoa.h> | |
@interface AppDelegate : NSObject <NSApplicationDelegate> | |
@end |
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
# %% | |
# reference https://qiita.com/hibit/items/5a49bedaa826fddf0a33 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
fig, ax = plt.subplots() | |
ax.set(aspect=1) | |
theta = np.linspace(0, 2*np.pi, 100) | |
colorlist = ["r", "g", "b", "c", "m", "y"] |
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
# %% | |
def gcd(a, b): | |
a, b = (a, b % a) if a < b else (b, a % b) | |
return (a, b) if b == 0 else gcd(a, b) | |
gcd(3525, 4794) |
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 <Cocoa/Cocoa.h> | |
@interface MyView : NSView | |
@end | |
@implementation MyView | |
double len(NSPoint p){return sqrt(p.x*p.x+p.y*p.y);} | |
NSRect bboxOfCircumscribedCircle(NSPoint p0, NSPoint p1, NSPoint p2) { | |
double a= len(NSMakePoint(p2.x-p1.x, p2.y-p1.y)); | |
double b= len(NSMakePoint(p2.x-p0.x, p2.y-p0.y)); | |
double c= len(NSMakePoint(p1.x-p0.x, p1.y-p0.y)); | |
double Ca=a*a*(b*b+c*c-a*a); |
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
#! /bin/sh | |
# reference: https://stackoverflow.com/questions/38262829/awk-command-to-convert-date-format-in-a-file#answer-38271260 | |
/usr/bin/awk -F'\t' '{ | |
split($1,a," "); | |
printf "%04d-%02d-%02d", a[3], (match("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",toupper(a[1]))+2)/3, a[2]; | |
for(i=2;i<=NF;i++)printf("\t%s",$i); | |
printf("\n") | |
}' << EOF | |
Sep 9, 2024 142.1234 143.1234 142.1234 142.1234 142.1234 | |
Aug 8, 2024 146.1234 147.1234 145.1234 146.1234 146.1234 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#! /bin/sh -x | |
DIR=`pwd` | |
FPS=24 | |
S_NUMBER=83 | |
LOOP=10 | |
STEREO="left-right" #"top-bottom" | |
DIST_PREFIX="dist" | |
SRC_DIR="360" | |
DIST_DIR=${DIR} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.