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 pool from "ndarray-scratch" | |
import pack from "ndarray-pack" | |
import concatRows from "ndarray-concat-rows" | |
import concatCols from "ndarray-concat-cols" | |
import qr from "ndarray-householder-qr" | |
export function regression2d( | |
y0, | |
y1, | |
x0, |
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 { promises as fs } from "fs"; | |
import createContext from "gl"; | |
import beamcoder from "beamcoder"; | |
const w = 100, h = 100; | |
async function main() { | |
const decoder = beamcoder.decoder({ |
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 numpy as np | |
from PIL import Image | |
from skimage import transform | |
def gnomonic2equirectangular(ishape, oshape, fov): | |
def inner(xy): | |
ones = np.expand_dims(np.ones(xy.shape[0]), 0).transpose() | |
v = np.concatenate((xy, ones), axis=1) | |
v /= np.linalg.norm(v, axis=1, keepdims=True) |
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
#!/usr/bin/osascript | |
tell application "Terminal" | |
contents of selected tab of the front window | |
end tell |
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 | |
vim -T builtin_dumb --not-a-term -c "$1" -c 'qa!' --cmd 'set nomore t_cl= t_cm=.' | sed -e 's/\.//g' |
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 astropy.coordinates | |
import astropy.units as u | |
from astropy.coordinates import EarthLocation, AltAz | |
from astropy.time import Time | |
from datetime import datetime | |
from scipy import optimize | |
tt = EarthLocation(lat=35.6585 * u.deg, lon=139.7455 * u.deg, height=250 * u.m) | |
def alt(timestamp): |
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
#!/usr/bin/env ruby | |
# -*- coding: UTF-8 -*-; | |
require 'open3' | |
require 'shellwords' | |
EDITOR = ENV['EDITOR'] || 'vim -b' | |
EXCLUDE_EXTENTSONS = %w(psd gif jpg png DS_Store tmp JPG PNG swp swf o bundle dylib so) |
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
IMAGE_WIDTH = 256 | |
IMAGE_HEIGHT = 256 | |
NSUBSAMPLES = 2 | |
NAO_SAMPLES = 8 | |
class Vec | |
def initialize(x, y, z) | |
@x = x | |
@y = y | |
@z = z |
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
# OK | |
class A | |
def a=(a) | |
@a = a | |
end | |
end | |
# OK | |
class B | |
def a=(a);@a = a;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
package main | |
import "fmt" | |
import "math/cmplx" | |
func dot(bits uint8) string { | |
bits = bits & 7 | (bits & 112) >> 1 | (bits & 8) << 3 | bits & 128 | |
return string(0x2800 + uint32(bits)) | |
} |
NewerOlder