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
#!/usr/bin/env sh | |
# adapted from https://gist.github.com/jc00ke/b55cf7d16d584fbb2b92 | |
sudo update-alternatives --install \ | |
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.9 200 \ | |
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.9 \ | |
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.9 \ | |
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.9 \ | |
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.9 \ | |
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-3.9 \ |
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
# https://regex101.com/r/Serx4o/1 | |
# do not match the string if "someword" occurs anywhere in the string | |
# https://docs.python.org/3/howto/regex.html | |
^(?:(?!someword).)*$ |
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
cmake_minimum_required(VERSION 3.3) | |
project(bitcoin) | |
set(CMAKE_CXX_STANDARD 11) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
add_custom_target(build-bitcoin ALL | |
COMMAND ./autogen.sh | |
COMMAND ./configure | |
COMMAND $(MAKE) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
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
# tf quick test | |
# CUDA_VISIBLE_DEVICES=0 python | |
import os | |
# os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" | |
os.environ["CUDA_VISIBLE_DEVICES"]="0" | |
import tensorflow as tf | |
# gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.333) |
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
cmake_minimum_required(VERSION 3.3) | |
project(bitcoin) | |
set(CMAKE_CXX_STANDARD 11) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
add_custom_target(build-bitcoin ALL | |
COMMAND ./autogen.sh | |
COMMAND ./configure | |
COMMAND $(MAKE) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
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" | |
"strings" | |
"golang.org/x/tour/wc" | |
) | |
func WordCount(s string) map[string]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
package main | |
import "golang.org/x/tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dy) | |
for x := range pic { | |
pic[x] = make([]uint8, dx) | |
for y := range pic[x] { |
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" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(1) |
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" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
a := 1 | |
b := 1 | |
c := 0 |
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" | |
type IPAddr [4]byte | |
// TODO: Add a "String() string" method to IPAddr. | |
func (ip IPAddr) String() string { | |
return fmt.Sprintf("%v.%v.%v.%v", ip[0], ip[1], ip[2], ip[3]) | |
} |
OlderNewer