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
ActionController::Routing::Routes.draw do |map| | |
map.connect ' daily/:year/:month' , | |
:controller => ' teetimes' , | |
:action => ' index' , | |
:month => Time.now.month, | |
:year => Time.now.year, | |
:requirements => { | |
:year => /\d+/, | |
:month => /\d+/ |
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
import com.facebook.thrift.{TBase, TDeserializer} | |
import java.io.{BufferedInputStream, DataInputStream, File, FileInputStream, InputStream} | |
import java.util.zip.GZIPInputStream | |
import net.lag.logging.Logger | |
import scala.reflect.Manifest | |
// you'll want to import your generated Thrift package too! | |
class ThriftFileScanner[T <: TBase](implicit man: Manifest[T]) { | |
val log = Logger.get | |
var bufferedIn: BufferedInputStream = null |
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 | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
// packageList returns the list of packages in the dag rooted at roots | |
// as visited in a depth-first post-order traversal. | |
func packageList(roots []*Package) []*Package { | |
seen := map[*Package]bool{} | |
all := []*Package{} | |
var walk func(*Package) | |
walk = func(p *Package) { | |
if seen[p] { | |
return |
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
// The API can be implemented as HTTP API, gRPC API, and/or Go code level API. | |
// The specification below uses Google Protobuf 3 IDL and gRPC framework: | |
// http://www.grpc.io/faq/ | |
// For overview of implementing service with this specification: | |
// https://github.com/grpc/grpc-common | |
syntax = "proto3"; | |
package immstore; |
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
tbl := client.Open("mytable") | |
... | |
unvKeyBeg, _, _ := ctx.UnversionedKey(tkBeg) | |
unvKeyEnd, _, _ := ctx.UnversionedKey(tkEnd) | |
rr := bigtable.NewRange(unvKeyBeg, unvKeyEnd) | |
err := tbl.ReadRows(bt_ctx, rr, func(r Row) bool { | |
// get all versions from this row and package into "versions" which is []*storage.KeyValue | |
... | |
// run it through our DAG to get the proper value given our version context. | |
// See the code: https://github.com/janelia-flyem/dvid/blob/master/datastore/datainstance.go#L71 |
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
VNC Pre-computed sharded volume worksheet | |
Scale 0: | |
Preshift bits = 9 | |
Minishard bits = 6 2^15 chunks if no collisions = 32 KiChunks @ 64^3 chunks (262 KiVoxels) = 8.46 GiVoxels | |
Shard bits = 16 | |
Block (335, 438, 1024) -> corresponds to 64^3 with first voxel at (21440, 28032, 66536) | |
X block 335 = 14F | |
Y block 438 = 1B6 |