Skip to content

Instantly share code, notes, and snippets.

package advent
import adventutil.io._
import scala.annotation.tailrec
object Day2 {
def splitInstruction(instruction: String): (String, Int) = {
@pcalcao
pcalcao / binarysearchtree.py
Created January 29, 2013 00:37
Binary Search Tree implementation, supporting article in http://intothewebs.tumblr.com
#!/etc/python
class BinarySearchTree():
def __init__(self, parent=None):
self.key = None
self.value = None
self.left = None
self.right = None
#!/usr/bin/env python
def is_triangle(a, b, c):
return not collinear(a, b, c)
def collinear(a, b, c):
return slope(a, b) == slope(b, c)
<?php
/*
Template Name: Contact Form
*/
include("header.php"); ?>
<div id="content">
21<div class="container_16 col_16">
<div class="grid_11 alpha">
var selected_social_elem;
$(document).ready(function(){
function closeSocialPopup(e, element_div, element_top){
element_div.css("visibility","hidden");
element_div.css("opacity","0");
element_top.removeClass("greyedOut");
}
@pcalcao
pcalcao / binary_tree.py
Last active December 10, 2015 23:38
Absurdly basic implementation of a Binary Tree. Used as an example in http://intothewebs.tumblr.com
class BinaryTree():
def __init__(self, val):
self.value = val
self.left = None
self.right = None
self.parent = None
def set_left(self,node):
self.left = node
self.left.parent = self
@pcalcao
pcalcao / wordsEn.txt
Created November 18, 2012 01:04
Cena de caminhos entre palavras e o camnadro
This file has been truncated, but you can view the full file.
a
aah
aahed
aahing
aahs
aardvark
aardvarks
aardwolf
ab
abaci