Skip to content

Instantly share code, notes, and snippets.

def recursive_word_is_valid(word, board, pos):
"""
Arguments:
- `word`: the remainder of the word to be searched.
- `board`: the current board.
- `pos`: the current position in the board.
"""
if board[pos[0]][pos[1]] == word[0]:
def reindex():
dictionary = open('US.dic', 'r')
linecount = 0
length = 0
length_breaks = []
for line in dictionary:
word_len = len(line)
def validate_word(self, word, board):
for x in range(len(board.board)):
for y in range(len(board.board[x])):
if board.board[x][y] == char:
if self.recursive_word_is_valid(word, board, (x, y)):
return True
return False
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\noindent\textbf{5:}
{\center \[ f(x) = \frac{(x^2 - 8x + 7)}{(x - 6)} \]}
\includegraphics[width=5in,height=3.1in]{question5.pdf}
\noindent\emph{The Asymptotes:}
import socket
import threading
import Queue
import time
def wait_for_connection():
HOST = 'localhost'
PORT = 49999
new_connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
new_connection.bind((HOST, PORT))
failregex = ^%(__prefix_line)s(?:error: PAM: )?Authentication failure for .* from <HOST>\s*$
^%(__prefix_line)s(?:error: PAM: )?User not known to the underlying authentication module for .* from <HOST>\s*$
^%(__prefix_line)sFailed (?:password|publickey) for .* from <HOST>(?: port \d*)?(?: ssh\d*)?$
^%(__prefix_line)sROOT LOGIN REFUSED.* FROM <HOST>\s*$
^%(__prefix_line)s[iI](?:llegal|nvalid) user .* from <HOST>\s*$
^%(__prefix_line)sUser .+ from <HOST> not allowed because not listed in AllowUsers$
^%(__prefix_line)sUser .+ from <HOST> not allowed because none of user's groups are listed in AllowGroups\s*$
^%(__prefix_line)sauthentication failure; logname=\S* uid=\S* euid=\S* tty=\S* ruser=\S* rhost=<HOST>(?:\s+user=.*)?\s*$
^%(__prefix_line)srefused connect from \S+ \(<HOST>\)\s*$
^%(__prefix_line)sAddress <HOST> .* POSSIBLE BREAK-IN ATTEMPT\s*$
$ git push origin develop
Counting objects: 47, done.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (25/25), 1.87 KiB, done.
Total 25 (delta 6), reused 22 (delta 3)
error: unable to create temporary sha1 filename ./objects/06: File exists
fatal: failed to write object
error: unpack failed: unpacker exited with error code
To remote/repo
fields_i_care_about = ["f1", "f2"]
new_dict = {}
for field in fields_i_care_about:
new_dict[field] = old_dict[feild]
#!/bin/bash
# Simple script to list version numbers of critical development tools
export LC_ALL=C
bash --version | head -n1 | cut -d" " -f2-4
echo "/bin/sh -> `readlink -f /bin/sh`"
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
bison --version | head -n1
if [ -e /usr/bin/yacc ];
then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
@jxcl
jxcl / LICENSE
Last active October 28, 2015 15:12
Time Since Last Pacman Sync/Upgrade
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit