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
#!/usr/bin/python | |
import sys | |
import wikipedia | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
import os | |
from threading import Thread | |
import unicodedata | |
import commands | |
import json |
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
int latchPin = 1; | |
int clockPin = 0; | |
int dataPin = 2; | |
//kek, last column is on pin 3 | |
int powers[] = {0,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072}; | |
char a[][5][5] = {{{B00000, B00000, B00000, B00000, B00000},{B00010, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000}},{{B00110, B00000, B00000, B00000, B00000},{B00110, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000}},{{B00110, B00100, B00000, B00000, B00000},{B00110, B00100, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000}},{{B00110, B00110, B00000, B00000, B00000},{B00110, B00110, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000},{B00000, B00000, B00000, B00000, B00000} |
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
const fs = require('fs'); | |
function makeId (length) { | |
var result = ''; | |
var characters = 'abcdefghijklmnopqrstuvwxyz'; | |
var charactersLength = characters.length; | |
for ( var i = 0; i < length; i++ ) { | |
result += characters.charAt(Math.floor(Math.random() * | |
charactersLength)); | |
} |
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 random | |
size = 7 | |
map = [] | |
for x in range(size): | |
tmp = [] | |
for y in range(size): | |
tmp.append('') |
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
public void updateLighting(Pos pos, Short level) { | |
if (pos.blockY() < 0) | |
return; | |
int section = pos.blockY() / 16; | |
int sectionY = pos.blockY() % 16; | |
int chunkX = pos.blockX() / 16; | |
int sectionX = pos.blockX() % 16; |
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 | |
import math | |
vec = (1.3*4, -2.7*4, 0) | |
start = (1,1,0) | |
bb = (2,-3, -1) | |
bbSize = (1,1,2) | |
xStep = 1 |
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
// Extended from 2d implementation found here https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/swept-aabb-collision-detection-and-response-r3084/ | |
// Broad-Phasing not implemented but needed to work accurately | |
#include <iostream> | |
#include <limits> | |
#include <algorithm> | |
#include <initializer_list> | |
struct Box | |
{ |
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 random | |
paths = {} | |
SIZE = 7 | |
def printPuzzle(): | |
puzzle = [] | |
for x in range(0, SIZE): |
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 itertools | |
values = [-2.24, 0.46, 2.69] | |
toFind = 0.91 | |
def solve(vals, target): | |
counter = 0 | |
while (counter < 2 ** (len(vals))): | |
sum = 0 |
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
package net.minestom.server.collision; | |
import net.minestom.server.MinecraftServer; | |
import net.minestom.server.coordinate.Vec; | |
import net.minestom.server.entity.Entity; | |
import net.minestom.server.entity.EntityType; | |
import net.minestom.server.entity.GameMode; | |
import net.minestom.server.entity.PlayerExtended; | |
import net.minestom.server.item.ItemStack; | |
import net.minestom.server.item.Material; |
OlderNewer