Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / google-weather-api-conditions.xml
Created February 1, 2011 23:13
Google Weather API Conditions List
<?xml version="1.0" encoding="UTF-8"?>
<!--Google Weather API Conditions. Compiled by Dennis Delimarsky, http://dennisdel.com/content/conditions.xml-->
<!--Tweaked by Brian Zerangue, February 1, 2011-->
<conditions>
<type handle="partly-sunny">Partly Sunny</type>
<type handle="scattered-thunderstorms">Scattered Thunderstorms</type>
<type handle="showers">Showers</type>
<type handle="scattered-showers">Scattered Showers</type>
<type handle="rain-and-snow">Rain and Snow</type>
<type handle="overcast">Overcast</type>
@medecau
medecau / opcp.md
Last active March 7, 2024 18:11
Online Programming Contests and Puzzles
@ameerkat
ameerkat / order_statistics.py
Created December 10, 2010 21:04
Order statistics using randomized pivot
# Order Statistics
# Ameer Ayoub <ameer.ayoub@gmail.com>
import random, copy
# From quicksort
# Nonrandomized Pivot
def partition(l, p, q, pivot=None):
r = copy.copy(l)
if pivot:
r[pivot], r[p] = r[p], r[pivot]
@ameerkat
ameerkat / sorts.py
Created December 7, 2010 15:04
Various sorts implemented in Python (Insertion, Bubble, Merge, Quick, Counting)
# BunchO Sorting Algorithms
# Ameer Ayoub <ameer.ayoub@gmail.com>
# Last Modified 12/2/2010
import random
#
# Insertion Sort
#
def insertion_sort(l):
"""Given an input list, returns a sorted permutation of the list
@ameerkat
ameerkat / BoyerMooreStringSearch.py
Created October 14, 2010 17:46
Boyer Moore string search implementation in Python
# Boyer Moore String Search implementation in Python
# Ameer Ayoub <ameer.ayoub@gmail.com>
# Generate the Bad Character Skip List
def generateBadCharShift(term):
skipList = {}
for i in range(0, len(term)-1):
skipList[term[i]] = len(term)-i-1
return skipList
using System;
using StructureMap;
namespace ConsoleApplication1
{
class Program {
private static void Main(string[] args) {
IContainer container = ConfigureDependencies();
IAppEngine appEngine = container.GetInstance<IAppEngine>();