This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
var possibleCombinationSum = function(arr, n) { | |
if (arr.indexOf(n) >= 0) { return true; } | |
if (arr[0] > n) { return false; } | |
if (arr[arr.length - 1] > n) { | |
arr.pop(); | |
return possibleCombinationSum(arr, n); | |
} | |
var listSize = arr.length, combinationsCount = (1 << listSize) | |
for (var i = 1; i < combinationsCount ; i++ ) { | |
var combinationSum = 0; |
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
# Signal catching | |
def shut_down | |
puts "\nShutting down gracefully..." | |
sleep 1 | |
end | |
puts "I have PID #{Process.pid}" | |
# Trap ^C | |
Signal.trap("INT") { |
INTERVIEW QUESTIONS
1.- Imagina que tienes un arreglo de 1,000 valores (del 1, 2, 3,.. 1,000). Sin embargo, al analizar el tamaño del arreglo te das cuenta que faltan dos valores, no sabes cuales son. Escribe un método que permita saber los valores faltantes y dime por qué decidiste hacerlo de esa manera, ¿Cual es la ventaja?
2.- Construye Pinterest.
##BONUS. Algo de Git. 3.-El equipo de desarrollo está implementando una serie de features importantes, por lo que tenemos las branches: feature1, feature2 y feature3, a demás de Master. Surgió un pendiente y se tiene que
#!/bin/ruby | |
n = gets.strip.to_i | |
a = gets.strip | |
a = a.split(' ').map(&:to_i) | |
#puts a | |
endPos = a.count-1 | |
swapCont = 0 | |
#puts "ENDPOS=#{endPos}" |
class Solution | |
# Write your code here | |
def initialize | |
@stack = Array.new | |
@queue = Array.new | |
end | |
def pushCharacter(c) | |
@stack.push(c) | |
end |
# Enter your code here. Read input from STDIN. Print output to STDOUT | |
n = gets.to_i | |
arr = gets.split(" ") | |
arr.map! { |i| i.to_i } | |
#puts arr | |
arr = arr.permutation(3).to_a.sort.uniq | |
work = Array.new | |
arr.each do |perm| | |
#puts "PERM => #{perm.sort}" | |
work.push(perm.sort) |
#!/bin/ruby | |
n = gets.strip.to_i | |
bin = n.to_s(2) | |
#puts bin | |
state = nil | |
max = 0 | |
count = 0 | |
bin.each_char do |char| | |
if state == char |