Skip to content

Instantly share code, notes, and snippets.

import { promises as fs } from 'fs';
interface FieldData {
x: number;
w: number;
}
type KeyboardLayoutField = FieldData | 'key';
const u = 19.05;
const hole_width = 14;
import numpy as np
# A simple, no-frills gram schmidt implementation
def gram_schmidt(A):
for k in range(0, A.shape[1]):
# Normalize
A[:, k] /= np.linalg.norm(A[:, k])
# Subtract from vecs below
for j in range(k+1, A.shape[1]):
r = np.dot(A[:, k], A[:, j])
184936275235714689679258134427369518568147923913582467751693842892471356346825791
185923746423756189679418352346175928918342675752689413594837261261594837837261594
185923746342675918679418352837261594594837261261594837913742685756189423428356179
183942567567183942942567183426375891891426375375891426759618234234759618618234759
183942567426375891759618234537486912294153678861729345648597123972831456315264789
183942567426375891759618234537486912861729345294153678972831456648597123315264789
183942567426375891759618234315264789972831456648597123294153678537486912861729345
183942567426375891759618234972831456315264789648597123294153678861729345537486912
183942567759618234426375891294153678537486912861729345648597123972831456315264789
183942567759618234426375891972831456315264789648597123861729345294153678537486912
1
-------------
189 423 756
267 591 834
345 678 912
423 756 189
591 834 267
678 912 345
from constraint import *
# board = [
# "1 | 48| ",
# " 6| |831",
# " | 5| 6 ",
# # -
# " 5| |7 9",
# " |5 7| ",
11
Oisin Carroll
That does nante look like good weather.
8
Paul Mooney
I just got home from work and am way too fucking tired to go out.
8
Oisin Carroll
class Solution:
def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
dimX, dimY = len(matrix), len(matrix[0])
for i in range(dimX+dimY):
#print("mat", matrix)
for x in range(dimX):
for y in range(dimY):
@oisincar
oisincar / Hydra.cpp
Last active February 13, 2019 02:20
#include <bits/stdc++.h>
using namespace std;
int main(){
int o,O;
while(cin>>o>>O,O++||o)
cout<<(2>O&&o%2?-1:(o+O/2+O+3-O%2*3)/2+(o+O/2)%2*3)<<"\n";
}
#include <bits/stdc++.h>
using namespace std;
int main() {
double score = 0;
for (int i = 0; i < 2048; i++) {
string st = "";
for (int s = 0; s <= 10; s++) {
if ((i >> s) % 2) {
import numpy as np
def main():
print intersectLines([0.,2.], [1.,1.], [3.,3.], [-1., -5.])
def intersectLines(s1, e1, s2, e2):
# Append 1 to all points. Make them (x, y, 1)
s1, e1, s2, e2 = [np.append(p, 1) for p in [s1, e1, s2, e2]]