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
n, k = gets.split.map(&:to_i) | |
processed = (0...1<<n).to_a.sort_by { |x| [x.to_s(2).count("1"), x] } | |
puts processed[k-1].to_s(2).rjust(n, '0') |
n,k = map(int, raw_input().split()) | |
processed = sorted(range(1<<n), cmp=lambda a,b: cmp(bin(a).count("1"), bin(b).count("1")) if cmp(bin(a).count("1"), bin(b).count("1")) else cmp(a,b)) | |
print bin(processed[k - 1])[2:].zfill(n) |
import re, urllib | |
htmlSource = urllib.urlopen("https://class.coursera.org/ml/lecture/preview/1").read(200000) | |
linksList = re.findall('data-lecture-view-link="(.*?)"', htmlSource) | |
allVideos = [] | |
for link in linksList: | |
print 'Open', link | |
htmlWithVideo = urllib.urlopen(link).read(200000) | |
videosList = re.findall('<source.*type="video/mp4".*? src="(.*?)"',htmlWithVideo) |
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
By Klaus Wuestefeld | |
1) Torne-se excelente. | |
Seja realmente bom em alguma coisa. Não fique só choramingando ou | |
querendo progredir às custas dos outros. Não pense q pq vc sentou 4 | |
anos numa faculdade ouvindo um professor falar sobre software q vc | |
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo | |
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo | |
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da |
#!/usr/bin/env ruby | |
# | |
# Put this script in your PATH and download from onemanga.com like this: | |
# onemanga_downloader.rb Bleach [chapter number] | |
# | |
# You will find the downloaded chapters under $HOME/Documents/OneManga/Bleach | |
# | |
# If you run this script without arguments, it will check your local manga downloads | |
# and check if there are any new chapters | |
# |