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
#coding=utf-8 | |
from bs4 import BeautifulSoup | |
import urllib2 | |
request_header = dict() | |
request_header['User-Agent'] = "kanjianbox spider" | |
url = "http://www.kanjian.com/" | |
request = urllib2.Request(url, None, request_header) |
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 os |
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
{ | |
"agentNames": { | |
"fMMJNda6xN": "dtynn" | |
}, | |
"customerNames": { | |
"XebA6tvhbf": "d@dtynn.me" | |
}, | |
"ticket": { | |
"assignedTo": "fMMJNda6xN", | |
"belongToOrganization": "RNPnzmohvD", |
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 ( | |
"log" | |
"github.com/blevesearch/bleve" | |
) | |
func main() { | |
indexMapping := bleve.NewIndexMapping() |
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
panic: runtime error: slice bounds out of range | |
goroutine 1 [running]: | |
github.com/blevesearch/bleve/search/highlight/fragmenters/simple.(*Fragmenter).Fragment(0x2088f6f40, 0x208972299, 0x3, 0x3, 0x2089200a0, 0x1, 0x1, 0x0, 0x0, 0x0) | |
/Users/dtynn/work/gopj/src/github.com/blevesearch/bleve/search/highlight/fragmenters/simple/fragmenter_simple.go:57 +0x927 | |
github.com/blevesearch/bleve/search/highlight/highlighters/simple.(*Highlighter).BestFragmentsInField(0x208927290, 0x20891e640, 0x20891e7c0, 0x208972328, 0x4, 0x1, 0x0, 0x0, 0x0) | |
/Users/dtynn/work/gopj/src/github.com/blevesearch/bleve/search/highlight/highlighters/simple/highlighter_simple.go:84 +0x3c0 | |
github.com/blevesearch/bleve.(*indexImpl).Search(0x2088fc230, 0x208922230, 0x0, 0x0, 0x0) | |
/Users/dtynn/work/gopj/src/github.com/blevesearch/bleve/index_impl.go:447 +0x13a0 | |
main.main() |
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 ( | |
"log" | |
"github.com/blevesearch/bleve" | |
) | |
func main() { | |
indexMapping := bleve.NewIndexMapping() |
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 ( | |
"log" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
) | |
func main() { |
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" | |
func main() { | |
for i := 0; i < 5; i++ { | |
fmt.Println("Hello, World!") | |
} | |
} |
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 restore(repos []string) error { | |
errChan := make(chan error, 1) | |
sem := make(chan int, 4) // four jobs at once | |
var wg sync.WaitGroup | |
wg.Add(len(repos)) | |
for _, repo := range repos { | |
sem <- 1 | |
go func() { | |
defer func() { | |
wg.Done() |
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 code | |
import ( | |
"fmt" | |
) | |
type Stack struct { | |
stack []int | |
minIdx int | |
} |
OlderNewer