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" | |
type foo struct { | |
val int | |
} | |
func main(){ | |
arr := make([]foo, 5) |
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
tmpdir=`mktemp -d` | |
tree=`git write-tree` | |
git archive $tree \ | |
$(git diff --cached --name-status | | |
grep -v "^D" | | |
awk '{print $2}' | |
) | | |
tar xv -C $tmpdir |
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
func TestRangeScan(t *testing.T) { | |
store := getLoadedStore() | |
testData.load() | |
sorted_words := sort.StringSlice(testData.words) | |
start, stop := sorted_words.Search("hello"), sorted_words.Search("world") | |
i := 0 | |
fmt.Printf("scanning from %s to %s\n", start, stop) | |
for iter := store.Scan().From(str("hello")).To(str("world")).Start(); iter.Next(); i++ { | |
iter_word := iter.Entry().GetValue().(string) | |
word := testData.words[start+i] |
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 smap | |
import ( | |
"bytes" | |
"testing" | |
) | |
type skey string | |
func (s skey) Cmp(other Key) int { |
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 bisect | |
import collections | |
import random | |
import ply.lex as lex | |
import sys | |
import time | |
tokens = ( | |
'NUMBER', | |
'WORD', |
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
from itertools import islice, chain | |
import random, sys, collections, bisect | |
def index(words, queue): | |
""" | |
Generate a prefix index for an input word sequence. | |
The prefix length is the queue length. | |
The index tracks suffixes and following words, taking frequency into account. | |
The output index will contain, for each suffix, an ascending tuple of |
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
/* app.yaml | |
application: ping | |
version: 1 | |
runtime: go | |
api_version: go1 | |
handlers: | |
- url: /_ah/spi/.* | |
script: _go_app |
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
from sqlalchemy import Column, Integer, ForeignKey, create_engine | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import relationship, Session | |
Base = declarative_base() | |
class Person(Base): | |
__tablename__ = 'persons' | |
id = Column(Integer, primary_key=True) |
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" | |
var counter = 0 | |
func turnstile(turns int, done chan bool){ | |
for i := 0; i < turns; i++{ | |
counter = counter + 1 | |
} |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
OlderNewer