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
# 图片 https://www.kaggle.com/benhamner/python-data-visualizations/notebook | |
# First, we'll import pandas, a data processing and CSV file I/O library | |
import pandas as pd | |
# We'll also import seaborn, a Python graphing library | |
import warnings # current version of seaborn generates a bunch of warnings that we'll ignore | |
warnings.filterwarnings("ignore") | |
import seaborn as sns | |
import matplotlib.pyplot as plt |
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
t := time.Unix(1362984425, 0) | |
nt := t.Format("2006-01-02 15:04:05") | |
fmt.Println(nt) |
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
var idx = $scope.adverts.indexOf(adv); | |
if (idx > -1) { | |
$scope.adverts.splice(idx, 1); | |
} | |
notify("删除成功!") |
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
for _, module := range moduleList { | |
mongodb.ExecBulk(mongodb.GetMgoSession(), DiscoveryOrderTable, func(bulk *mgo.Bulk) { | |
bulk.Insert(module) | |
}) | |
} |
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 ( | |
"flag" | |
"fmt" | |
"linkedin/bootstrap" | |
config_handler "linkedin/handler/config" | |
"linkedin/log" | |
"linkedin/middleware" | |
"linkedin/xlnt/handler/experiment" |
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
client := &http.Client{} | |
req, _ := http.NewRequest("GET", url, nil) | |
res, err := client.Do(req) | |
bodyBytes, _ := ioutil.ReadAll(res.Body) | |
fmt.Println("body is", string(bodyBytes)) |
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 ( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
) | |
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
func main() { | |
serv := bootstrap.Service(make(map[string]bool)) | |
serv.DefaultInit() | |
//serv.EnableESRedis() | |
bootstrap.Init(serv) | |
var seg jiebago.Segmenter | |
seg.LoadDictionary("/Users/xiuchen/Projects/chitu/html/relevance_share/dict_jieba.txt") |
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 IP4toInt(IPv4Addr string) int64 { | |
IPv4Int := big.NewInt(0) | |
IPv4Int.SetBytes(net.ParseIP(IPv4Addr).To4()) | |
return IPv4Int.Int64() | |
} |