Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
object scala { | |
val version = "SCALA_VERSION$" | |
} | |
val xml = <dependencies> | |
<dependency> | |
<groupId>org.scalanlp</groupId> | |
<artifactId>scalala_${scala.version}</artifactId> | |
<version>0.3.1</version> | |
</dependency> |
// Objective: demonstrate that there are more use cases | |
// for union types than previously thought. | |
// http://groups.google.com/group/golang-nuts/browse_thread/thread/fbde059a7cfd2fa9 | |
// | |
// Interface inference. | |
// We already have type inference, so this would be very Go-like: | |
type typeA int | |
func (x typeA) A() {} | |
func (x typeB) C() {} |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
db.Collection.find({ | |
created_at : { | |
'$gte': new Timestamp(new Date(2012, 0, 21), 0), | |
'$lte': new Timestamp(new Date(2012, 0, 22), 0) | |
}) |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 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 | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
/* | |
A Tour of Go: page 44 | |
http://tour.golang.org/#44 | |
Exercise: Loops and Functions | |
As a simple way to play with functions and loops, implement the square root function using Newton's method. | |
In this case, Newton's method is to approximate Sqrt(x) by picking a starting point z and then repeating: z - (z*z - x) / (2 * z) |
import java.io.IOException; | |
import java.util.Properties; | |
import kafka.server.KafkaConfig; | |
import kafka.server.KafkaServerStartable; | |
public class KafkaLocal { | |
public KafkaServerStartable kafka; | |
public ZooKeeperLocal zookeeper; |
#!/bin/bash | |
###################################################################### | |
#This is an example of using getopts in Bash. It also contains some | |
#other bits of code I find useful. | |
#Author: Linerd | |
#Website: http://tuxtweaks.com/ | |
#Copyright 2014 | |
#License: Creative Commons Attribution-ShareAlike 4.0 | |
#http://creativecommons.org/licenses/by-sa/4.0/legalcode |
# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis) | |
# Check our Studio: https://gentlenode.com/ | |
meteor add iron:router | |
meteor update iron:router | |
# Iron Router > Configuration |