This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
"sort" | |
) | |
// RemoveOutliersSmallDataset removes outliers from a small dataset using the Modified Z-score method | |
// threshold is typically 3.5 (more conservative) to 3.0 (more aggressive) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
"sort" | |
) | |
// RemoveOutliers removes outliers from a slice of prices using the IQR method | |
// multiplier is typically 1.5 for mild outlier detection or 3 for extreme outliers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func BenchmarkFibRecursive(b *testing.B) { | |
for i := 0; i < b.N; i++ { | |
fibRecursive(uint(10)) | |
} | |
} | |
func BenchmarkFibIterative(b *testing.B) { | |
for i := 0; i < b.N; i++ { | |
fibIterative(uint(10)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
/* | |
* Fibonnaci's Number | |
* fb(pos) | |
* if n < 1 | |
* f[0] = 1 f[1] =1 | |
* else (n > 2) | |
* f[n] = sum(f[n-1] + f[n-2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func fibRecursive(position uint) uint { | |
if position <= 2 { | |
return 1 | |
} | |
return fibRecursive(position-1) + fibRecursive(position-2) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
var wg sync.WaitGroup | |
func readFib(c <-chan int) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Small screens, laptops (landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 769px) | |
and (max-device-width : 1024px) { | |
/* Styles */ | |
} | |
/* Desktops & large screens (landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 1025px) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"cmp" | |
"fmt" | |
) | |
func main() { | |
var num, num2, num3 int64 = 1, 2, 1 | |
var str, str2, str3 = "ab", "abc", "ab" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/exp/maps" | |
) | |
func main() { | |
m := map[string]string{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
intSlice := []int{1, 2, 3} | |
floatSlice := []float64{1.0, 2.0, 3.0} | |
stringSlice := []string{"a", "b", "c"} | |
mapString := map[string]string{ | |
"Name": "Pedro", |
NewerOlder