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
# http://programmingpraxis.com/2009/06/30/steve-yegges-phone-screen-coding-exercises/ | |
# Steve Yegge's Phone screen questions | |
# reverse-string | |
# built-in in python: input[::-1] => "gnirts-tset" | |
def reverse_string(input, input_length): | |
result = "" | |
i = input_length - 1 | |
while i >= 0: | |
result += input[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
# http://programmingpraxis.com/2010/06/01/unwrapping-a-spiral/ | |
# Unwrapping A Spiral | |
# 1 2 3 4 | |
# 5 6 7 8 | |
# 9 10 11 12 | |
# 13 14 15 16 | |
# 17 18 19 20 | |
# input assumption: |
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 | |
# For the reddit daily programmer challenge | |
# Challenge: http://www.reddit.com/r/dailyprogrammer/comments/y5sox/8132012_challenge_88_easy_vigen%C3%A8re_cipher/ | |
# Solution: http://www.reddit.com/r/dailyprogrammer/comments/y5sox/8132012_challenge_88_easy_vigen%C3%A8re_cipher/c5socop | |
# by @dvoiss on github / @daveasaurus on reddit | |
from string import ascii_uppercase as up |
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 | |
# For the reddit daily programmer challenge | |
# Challenge: http://www.reddit.com/r/dailyprogrammer/comments/y5svk/8132012_challenge_88_intermediate_printing_out_a/ | |
# Solution: http://www.reddit.com/r/dailyprogrammer/comments/y5svk/8132012_challenge_88_intermediate_printing_out_a/c5soy7s | |
# run code at http://ideone.com/yFOA4 | |
# by @dvoiss on github / @daveasaurus on reddit | |
# Two variations: |
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 emu() { | |
green=$(tput setaf 64) | |
reset=$(tput sgr0) | |
# is VBoxManage available on the machine? | |
if hash VBoxManage 2>/dev/null; then | |
# print the emu: | |
echo "${green}" | |
echo ' | |
/-/-=/-= |
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 | |
# generate an xml podcast file for a directory of files | |
# | |
# I parse id3v1 tags but only for the artist and track title, | |
# most of the samples did not have reliable meta-data, so the | |
# file-name is used. | |
# | |
# I don't process id3v2 tags because an external library would be needed | |
# such as id3lib. |
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
/* | |
This must be added to ~/.gradle/init.gradle or to a .gradle file under ~/.gradle/init.d/ before applying. | |
initscript { | |
repositories { | |
maven { | |
url "https://plugins.gradle.org/m2/" | |
} | |
} | |
dependencies { |
OlderNewer