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
def perms(arr): | |
if len(arr) == 1: | |
return [arr] | |
ret = [] | |
head = arr[:1] | |
for tail in perms(arr[1:]): | |
for i in range(len(arr)): | |
ret.append(tail[i:] + head + tail[:i]) | |
return ret | |
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
__author__ = 'cody' | |
finished = False # found all solutions yet? | |
def backtrack(a, k): | |
if is_a_solution(a, k): | |
return process_solution(a) | |
else: | |
candidates = construct_candidates(a, k) |
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
def quicksort(ls, low, high): | |
if high - low > 0: | |
pivot = partition(ls, low, high) | |
quicksort(ls, low, pivot-1) | |
quicksort(ls, pivot+1, high) | |
def partition(ls, low, high): | |
pivot = ls[high] | |
firsthigh = low |
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
valid_input = '((()()))()' | |
invalid_input = '())' | |
bracket_stack = [] | |
count = 0 | |
for c in invalid_input: | |
count = count + 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
class node(object): | |
pass | |
class linked_list: | |
size = 0 | |
def append(self, node): | |
if self.size == 0: | |
self.head, self.tail = node, node |
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 patmat | |
import common._ | |
/** | |
* Assignment 4: Huffman coding | |
* | |
*/ | |
object Huffman { |
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
Option Explicit | |
Sub SaveAttachments() | |
Dim strPath As String | |
Dim SH As Shell32.Shell | |
Dim Fldr As Shell32.Folder | |
Dim olFolder As Folder | |
Dim olItem As MailItem | |
Dim olAttach As Attachment | |
Const strSubject As String = "VA SSIM" 'text to look for in the subject line |
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
/*! | |
* Bootstrap v2.2.1 | |
* | |
* Copyright 2012 Twitter, Inc | |
* Licensed under the Apache License v2.0 | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Designed and built with all the love in the world @twitter by @mdo and @fat. | |
*/ |
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
/* | |
author: jbenet | |
os x, compile with: gcc -o testo test.c | |
linux, compile with: gcc -o testo test.c -lrt | |
*/ | |
#include <time.h> | |
#include <sys/time.h> | |
#include <stdio.h> |
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
//----------------------------------------------------------------------------- | |
//----------------------------------------------------------------------------- | |
// Camera Rotate | |
// | |
// Give the camera rotate tool some mass so that | |
// camera motion is smoothed out | |
// | |
// Directions: | |
// Adjust the properties of the camera rotation by calling the various | |
// set____() methods of the cameraController object at the end of the script. |
OlderNewer