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
// Predict predicts for a given complex C if it belongs to the mandelbrot set or not | |
func Predict(svc *machinelearning.MachineLearning, c complex128) bool { | |
params := &machinelearning.PredictInput{ | |
MLModelId: aws.String(modelID), | |
PredictEndpoint: aws.String(endpointURL), | |
Record: map[string]*string{ | |
"real": aws.String(fmt.Sprintf("%.6f", real(c))), | |
"imag": aws.String(fmt.Sprintf("%.6f", imag(c))), | |
}, | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int *merge(int *left, size_t leftSize, int *right, size_t rightSize) ; | |
int *mergeSort(int *a, size_t len) ; | |
const int ARRAY_SIZE = 1000000; | |
int main() { | |
int a[ARRAY_SIZE]; |
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
// MergeSortMulti sorts the slice s using Merge Sort Algorithm | |
func MergeSortMulti(s []int) []int { | |
if len(s) <= 1 { | |
return s | |
} | |
n := len(s) / 2 | |
wg := sync.WaitGroup{} | |
wg.Add(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 msort | |
import "testing" | |
var a []int | |
func init() { | |
for i := 0; i < 1000000; i++ { | |
a = append(a, i) | |
} |
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
var sem = make(chan struct{}, 100) | |
// MergeSortMulti sorts the slice s using Merge Sort Algorithm | |
func MergeSortMulti(s []int) []int { | |
if len(s) <= 1 { | |
return s | |
} | |
n := len(s) / 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
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data | |
''' | |
1. first feed forward the data: | |
input -> weights -> hidden layer 1 -> activation -> | |
weights -> hidden layer 2 -> activation -> | |
weights -> output layer | |
2. Compute cost function (cross entropy) to figure out how close we are |
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 fnvbench | |
import ( | |
"hash/fnv" | |
"math/rand" | |
"testing" | |
) | |
const ( | |
maxElems = 10000000 |
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
ffmpeg -i trailer.mov -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis trailer.webm |
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
// MergeSort sorts the slice s using Merge Sort Algorithm | |
func MergeSort(s []int) []int { | |
if len(s) <= 1 { | |
return s | |
} | |
n := len(s) / 2 | |
var l []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
func merge(l, r []int) []int { | |
ret := make([]int, 0, len(l)+len(r)) | |
for len(l) > 0 || len(r) > 0 { | |
if len(l) == 0 { | |
return append(ret, r...) | |
} | |
if len(r) == 0 { | |
return append(ret, l...) | |
} | |
if l[0] <= r[0] { |