I hereby claim:
- I am felipernb on github.
- I am felipernb (https://keybase.io/felipernb) on keybase.
- I have a public key whose fingerprint is 8D4A 1D47 F552 1FBF 3D38 B844 E377 FFCC 6551 ABB6
To claim this, I am signing this object:
#!/bin/bash | |
function is_mac() { | |
if [ `uname -s` = "Darwin" ]; then | |
return 0 | |
else | |
return 1 | |
fi | |
} |
I hereby claim:
To claim this, I am signing this object:
cat access.log | awk -F'"' '{print $2}'| cut -d ' ' -f2 | uniq > uris.log |
package com.feliperibeiro.bowling; | |
public class BowlingGame { | |
int[] rolls; | |
int currentRoll; | |
public BowlingGame() { | |
this.rolls = new int[21]; | |
} |
long recurFact(int n) { | |
if (n == 0) return 1L; | |
return n * recurFact(n-1); | |
} | |
long iterFact(int n) { | |
long fact = 1; | |
for (; n > 1; n--) fact *= n; | |
return fact; | |
} |
#http://acm.uva.es/p/v1/105.html | |
buildings = [[1,11,5], [2,6,7], [3,13,9], [12,7,16], [14,3,25], [19,18,22], [23,13,29], [24,4,28]] | |
def skyline(buildings) | |
#initialize the skyline setting 0 in all points | |
line_size = 0 | |
buildings.each {|b| line_size = [line_size, b[2]].max} | |
line = Array.new(line_size+1).fill(0) | |
buildings.each {|b| (b[0]..b[2]-1).each {|x| line[x] = [line[x], b[1]].max}} |
func MaxSubarray(a []int) []int { | |
currentSumStart := 0 | |
currentSum := 0 | |
maxSumStart := 0 | |
maxSumEnd := 0 | |
maxSum := 0 | |
for currentSumEnd := 0; currentSumEnd < len(a); currentSumEnd++ { | |
currentSum += a[currentSumEnd] |
func factorial(n int) int64 { | |
fact := int64(1) | |
for i := int64(n); i > 0; i-- { fact *= i } | |
return fact | |
} |
import random | |
def quicksort(a, l, r): | |
if l >= r: | |
return a | |
p = partition(a, l, r) | |
quicksort(a, l, p) | |
quicksort(a, p+1, r) | |
return a |
package sorting | |
func InsertionSort(a []int) []int { | |
for i := 1; i < len(a); i++ { | |
n := a[i] | |
j := i | |
for j > 0 && a[j-1] > n { | |
a[j] = a[j-1] | |
j-- | |
} |