This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
This file contains hidden or 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 permutation | |
// Based on https://stackoverflow.com/a/30230552/14660 by Paul Hankin | |
// perm := NewPermutation( slice ) | |
// for next := perm.Next(); next != nil; next = perm.Next() { | |
// ... | |
// } | |
// | |
// or |
This file contains hidden or 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
<dgryski@kamek[powbench] \ʕ◔ϖ◔ʔ/ > go test -test.bench=. | |
BenchmarkPolyPow-4 5000000 286 ns/op | |
BenchmarkPolyFast-4 100000000 16.7 ns/op | |
PASS | |
ok github.com/dgryski/powbench 3.430s |
This file contains hidden or 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
function _gocomplete_() | |
{ | |
# What do we want to autocomplete ? | |
local word=${COMP_WORDS[COMP_CWORD]} | |
# list packages that match in src/ subfolder, discarding warnings if no result | |
COMPREPLY=($(go list ./src/"${word}"... 2>/dev/null)) | |
} | |
# register autocomplete function for `go` | |
complete -F _gocomplete_ go |
This file contains hidden or 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 ( | |
"compress/flate" | |
"encoding/hex" | |
"fmt" | |
"io" | |
"io/ioutil" | |
// "bufio" | |
"bytes" |
The contents of this article have moved to a new, happier home https://aka.ms/Redis/DataLoss
This file contains hidden or 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
yum install cmake | |
yum install python-devel numpy | |
yum install gcc gcc-c++ | |
yum install gtk2-devel libdc1394-devel libv4l-devel ffmpeg-devel gstreamer-plugins-base-devel libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel | |
yum install libtiff-devel libwebp-devel tbb-devel eigen3-devel python-sphinx texlive | |
pushd /tmp | |
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.11/opencv-2.4.11.zip | |
unzip opencv-2.4.11.zip | |
cd opencv-2.4.11 |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains hidden or 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" | |
"unicode" | |
"golang.org/x/text/transform" | |
"golang.org/x/text/unicode/norm" | |
) |
This file contains hidden or 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" | |
"image" | |
"image/color" | |
"image/gif" | |
"math" | |
"os" | |
) |