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
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
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" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"time" | |
) | |
type Person struct { |
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 | |
// Restorer holds a function that can be used | |
// to restore some previous state. | |
type Restorer func() | |
// Restore restores some previous state. | |
func (r Restorer) Restore() { | |
r() | |
} |
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
function g = sigmoidFunction(z) | |
% Compute sigmoid function | |
% You need to return the following variables correctly | |
g = zeros(size(z)); | |
% Instructions: z can be a matrix, vector or scalar | |
g = 1.0 ./ ( 1.0 + exp(-z)); % For Matlab | |
% g = 1.0 ./ ( 1.0 + e.^(-z)); % For Octave, it can use 'exp(1)' or 'e' | |
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
# If you're looking into the C10M problem (10 million concurrent connections) | |
# you might want to play with DPDK (Originally proprietry Intel, now open source) | |
# | |
# C10M: http://c10m.robertgraham.com/ | |
# DPDK: http://dpdk.org/ | |
# | |
# This is a quick summary how to install dpdk on ubuntu | |
# running inside virtualbox on a mac | |
# On my Mac: |
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
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |
OlderNewer