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 os.path | |
import sys | |
import random | |
import re | |
import argparse | |
from pathlib import Path | |
def main(fast=False, once=False): | |
if fast: | |
get_exe = random_walk |
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 Sudoku::Cell; | |
use Moose; | |
use warnings; | |
use parent 'Clone'; | |
use integer; | |
has 'possible' =>( | |
is => 'rw', | |
isa => 'Int', #an array of booleans | |
default=>0b111111111, #9 1s |
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 argparse, locale, timeit, random | |
from math import * | |
""" | |
We are given the following problem: | |
Given a text file with 999,999 lines, one number per line, | |
numbers in random order from 1 to 1,000,000 but a single number is | |
missing, figure out what number is missing. | |
Source: http://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html#comment-1165807320 |
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 csv, argparse, _thread, os, time | |
#TODO: break these out into command line opts | |
in_file_open_args = dict(newline='', encoding='CP1252', errors='strict') | |
out_file_open_args = dict(newline='', encoding='UTF-8', errors='backslashreplace') | |
#opens files from the list of paths provided as csv files and writes all | |
#of their rows into the output FILE provides as out_file. | |
def merge(infile_names, out_file): |