Name | |||||||
---|---|---|---|---|---|---|---|
L1 cache reference | 0.5 | ns | |||||
Branch mispredict | 5 | ns | |||||
L2 cachereference | 7 | ns | 14x L1 cache | ||||
Mutex lock/unlock | 25 | ns | |||||
Main memory reference | 100 | ns | 20x L2 cache, 200x L1 cache | ||||
Compress 1K bytes with Zippy | 3,000 | ns | 3 | us |
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
echo "33:34" | awk -F':' '{ print $1, $2 }' | read a b <<< (cat) | |
read c d <<< $(echo "21:22" | awk -F':' '{ print $1, $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
#!/bin/bash | |
# Uninstall old version | |
sudo apt-get remove docker docker-engine docker.io | |
# Update apt package index | |
sudo apt-get update | |
# Install packages to allow apt to use a repo over HTTPS | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
# Add Docker offical GPG Key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
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
# Protobuf Builder | |
# ================ | |
# | |
# This image builds protocol buffers library from source with Go generation | |
# support. The builder and runner images are produced. | |
# Builder Image | |
# ------------- | |
FROM golang:1.8.3-alpine3.6 as builder |
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
# Generate a random Alphanumeric string | |
Function Get-RandomAlphanumericString { | |
[CmdletBinding()] | |
Param ( | |
[int] $length = 8 | |
) | |
Begin{ |
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
# Create a folder where you want to install different Pythons, and cd into it: | |
# Note that it doesn't need to be your home folder. Put it wherever you want to maintain such software: | |
export PYTHON_BASE="$HOME/python" | |
mkdir -p $PYTHON_BASE | |
cd $PYTHON_BASE | |
# Download source tarball into a subfolder named src, and untar: | |
curl --create-dirs -L -o src/Python-2.7.10.tgz https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz | |
cd src | |
tar -zxf Python-2.7.10.tgz |
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
public class WsFilter implements Filter { | |
private ApplicationContextProvider springContext; | |
private FilterConfig filterConfig; | |
private MessageFactory msgFactory = null; | |
private static final Logger logger_ = Logger.getLogger(WsFilter.class.getName()); | |
private static final Logger soap_logger = Logger.getLogger("soapLogger"); | |
@Autowired | |
private WsFilterHelper helper; |
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just