How I got my AWS CSAA. Notes included

Disclaimer: I’m not being paid to promote anything here. I just received an email containing the badge from acclaim.com. It made me look back on how much things have changed for the better since I made this exam, so I thought of making a blog post on how things went for me. AWS Certified Solutions Architect – Associate was issued by Amazon Web Services Training and Certification to Oscar Chavez ...

May 14, 2020 · 4 min · oschvr

Blocking Ads with PiHole

Before going into the post carefully documenting my process in setting up everything, here’s what this post is about in short: Installed PiHole on a Raspberry Pi Zero W and connected it to my network to have DNS level ad blocking. It was reasonably fast to complete and works well. Here’s how it looks before and after: Now, for whomever wants to understand why and how to build this, carry on… ...

April 27, 2020 · 8 min · oschvr

De Mexico al Reino Unido

Ya tiene mucho, muchísimo (10 meses) que no escribo/tengo ganas de escribir acá. Me han preguntado si olvidé por completo del blog y del diminuto momentum que tuvo cuando lo estaba manteniendo, pero yo me cuestiono si fue uno de esos momentos de brillantez y dedicación completamente mal distribuida, como el que cualquier programador pasa: Debería registar mis pensamientos en algún lado… haré un blog ! O quizá debería enfocarme en artículos técnicos, con código y todo… reharé mi blog ! ...

March 2, 2020 · 4 min · oschvr

Merge Sort in Go and Javascript

Here’s my implementation of the Mergesort algorithm in Golang package main import ( "fmt" "io/ioutil" "math/rand" "strconv" "strings" "time" ) func main() { start := time.Now() arr := randArr(20) // Merge sort array fmt.Println("\n Sorted \n", mergeSort(arr)) fmt.Println("Sorted in: ", time.Since(start)) } // Function to generate random array func randArr(size int) []int { arr := make([]int, size, size) rand.Seed(time.Now().UnixNano()) for i := 0; i < size; i++ { arr[i] = rand.Intn(99) } return arr } // Merge sort accepts an array and recursively sorts it func mergeSort(arr []int) []int { if len(arr) < 2 { return arr } middle := (len(arr)) / 2 return merge(mergeSort(arr[:middle]), mergeSort(arr[middle:])) } // Merges two arrays into one func merge(left, right []int) []int { var sortedArr []int // Check for inversions while array for len(left) > 0 && len(right) > 0 { if left[0] <= right[0] { sortedArr = append(sortedArr, left[0]) left = left[1:] // Just like shift(), remove first and return slice } else { sortedArr = append(sortedArr, right[0]) right = right[1:] // Just like shift(), remove first and return slice } } // Append to sortedArr if no inversions and for len(left) > 0 { sortedArr = append(sortedArr, left[0]) left = left[1:] // Just like shift(), remove first and return slice } for len(right) > 0 { sortedArr = append(sortedArr, right[0]) right = right[1:] // Just like shift(), remove first and return slice } return sortedArr } and here’s in Javascript ...

May 26, 2019 · 2 min · oschvr

Understanding Recursion

Rather than using the popular joke about recursion (see bottom), I’ll reference a very peculiar adage which makes use of this particular mental model: The Hogstadter’s Law, states that: It always takes longer than you expect, even when you take into account Hofstadter’s Law. See what happened there? The law is a self-referential adage, that tries to describe the widely experienced difficulty of accuratelly estimate the time it will take to complete tasks of substancial complexity. ...

May 17, 2019 · 4 min · oschvr