Letter | Phonetic letter |
---|---|
A | Alpha |
B | Bravo |
C | Charlie |
D | Delta |
E | Echo |
F | Foxtrot |
G | Golf |
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
function sha1() { | |
function random() { | |
var characters = "abcdef0123456789"; | |
return (function () { | |
var index = Math.floor(Math.random() * characters.length); | |
return characters.charAt(index); | |
})(); | |
} | |
var MAX_LENGTH = 40; |
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
function shuffle(array) { | |
var counter = array.length - 1; | |
var tmp; | |
var index; | |
for (; counter > 0; counter--) { | |
index = Math.floor(Math.random() * counter); | |
tmp = array[counter]; | |
array[counter] = array[index]; | |
array[index] = tmp; | |
} |
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
#/usr/bin/python env | |
import abc | |
import unittest | |
class StringUtilities(object): | |
@staticmethod | |
def is_palindrome(s): | |
if not isinstance(s, str): |
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
from datetime import datetime | |
import csv | |
import math | |
import sys | |
import time | |
class Record(object): | |
EARTH_RADIUS_IN_KM = 6371 |
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
function min(array) { | |
if (Array.isArray(array)) { | |
return Math.min.apply(null, array.filter(isFinite)); | |
} | |
throw { | |
name: "Illegal argument", | |
message: "Argument must be an array" | |
} | |
} |
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
""" | |
Copyright (c) 2012 Anthony Wu, twitter.com/anthonywu | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
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
#include <algorithm> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
// create alphabet (lowercase) | |
char letters[26]; | |
for (int i = 0; i < 26; i++) { | |
letters[i] = 'a' + i; |
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
#!/usr/bin/env python | |
import os | |
import random | |
import zipfile | |
def is_zipfile(f): | |
return os.path.isfile(f) and os.path.splitext(f)[1].lower() == ".zip" |
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 com.lchau; | |
public class Permutations { | |
public static void main(String[] args) { | |
String str = "Hello, world"; | |
Permutations.permute(0, str.length() - 1, str.toCharArray()); | |
} | |
private static boolean match(int i, int j, char[] chars) { |
OlderNewer