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
# (c) 2010 Benjamin Shyong | |
# | |
# Studious Student | |
# You've been given a list of words to study and memorize. Being a diligent student of language and the arts, you've decided to not study them at all and instead make up pointless games based on them. One game you've come up with is to see how you can concatenate the words to generate the lexicographically lowest possible string. | |
# Input | |
# As input for playing this game you will receive a text file containing an integer N, the number of word sets you need to play your game against. This will be followed by N word sets, each starting with an integer M, the number of words in the set, followed by M words. All tokens in the input will be separated by some whitespace and, aside from N and M, will consist entirely of lowercase letters. | |
# Output | |
# Your submission should contain the lexicographically shortest strings for each corresponding word set, one per line and in order. |
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
var x = 0; | |
var y = 0; | |
var xDirection = 1; | |
var yDirection = 1; | |
var canvas = null; | |
var context2D = null; | |
var background = new Image(); | |
background.src = "bg.gif"; | |
window.onload = init; |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html lang="en"> | |
<head> | |
<title>Binary Cat</title> | |
<script type="text/javascript" src="binary_cat.js"></script> | |
<style type="text/css"> | |
body { font-family: Arial, Helvetica, sans-serif;} | |
</style> | |
</head> | |
<body> |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html lang="en"> | |
<head> | |
<title>Canvas 1</title> | |
<script type="text/javascript" src="canvas1.js"></script> | |
<style type="text/css"> | |
body { font-family: Arial, Helvetica, sans-serif;} | |
</style> | |
</head> | |
<body> |
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
$.ui.autocomplete, { | |
_renderMenu: function( ul, items ) { | |
// use this to manipulate the entire array of results | |
// if you overwrite this method, make sure to call _renderItem for each item | |
// or else the individual items will not render, only the menu will render | |
// example below. | |
var self = this; | |
$.each(items, function(index, item){ | |
self._renderItem(ul, item); | |
} |
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
<h4>TELECAST HOVER</h4> | |
<div class="kontainer"> | |
<div class="a"></div> | |
<div class="b"></div> | |
<div class="c"></div> | |
<div class="d"></div> | |
<div class="e"></div> | |
<div class="f"></div> | |
</div> |
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
# SQLite version 3.x | |
# gem install sqlite3 | |
# | |
# Ensure the SQLite 3 gem is defined in your Gemfile | |
# gem 'sqlite3' | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 |
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
# Add account credentials and API keys here. | |
# See http://railsapps.github.io/rails-environment-variables.html | |
# This file should be listed in .gitignore to keep your settings secret! | |
# Each entry sets a local environment variable and overrides ENV variables in the Unix shell. | |
# For example, setting: | |
# GMAIL_USERNAME: Your_Gmail_Username | |
# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"] | |
# Add application configuration variables here, as shown below. | |
# | |
SENDGRID_USERNAME: Your_Username |
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
#!/bin/bash | |
# call command with bash pull_production_to_local | |
function LastBackupName () { | |
heroku pgbackups --app APPNAME | tail -n 1 | cut -d " " -f 1 | |
} | |
heroku pgbackups:capture --expire --app APPNAME | |
new_backup=$(LastBackupName) |
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 BSTnode(object): | |
""" | |
Representation of a node in a binary search tree. | |
Has a left child, right child, and key value, and stores its subtree size. | |
""" | |
def __init__(self, parent, t): | |
"""Create a new leaf with key t.""" | |
self.key = t | |
self.parent = parent | |
self.left = None |
OlderNewer