- 拉开发分支 git checkout -b {branch} master
- 有改动后, git push --set-upstream origin {branch}
- 跟上 master 的最新改动
- git checkout {branch}
- git fetch origin
- git rebase origin/master
- 自己的分支,合并多次小提交
- git rebase -i 3a4226b
- 请注意3a4226b这个版本是不参与合并的,可以把它当做一个坐标
- git push origin +{branch}
This file contains hidden or 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
| def calc_precision_recall(recommend_method, training_data, testing_data, user_colname, item_colname, sim_matrix, top_k): | |
| users_testing_and_training = list( | |
| set( testing_data[user_colname].unique() ).intersection( | |
| set( training_data[user_colname].unique() )) | |
| ) | |
| hit = 0 | |
| n_recall = 0 | |
| n_precision = 0 | |
| for user in users_testing_and_training: |
This file contains hidden or 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 sys | |
| import os.path | |
| import configparser | |
| import mmh3 | |
| import math | |
| import redis | |
| import time | |
| import requests | |
| import json |
This file contains hidden or 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 now = Math.floor(Date.now() / 1000) | |
| var db = connect("10.70.0.140:10002/admin", "ikdx_admin", "vws6XGl78Q4D") | |
| db = db.getSiblingDB("channel_biz") | |
| var table = db.getCollection('fixed_pos_channels') | |
| var cursor = table.aggregate([ | |
| {"$group": {_id:"$cid", count:{$sum:1}}} | |
| ]) |
安装
- npm install --global yarn
- yarn init
- yarn add eslint typescript standard --dev
- eslint --init
- 调整 tsconfig.json 和 .eslintrc.json
运行
This file contains hidden or 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
| Here's what I ended up doing - it worked perfectly. Note that I was moving from my old host (Bitbucket) to my new one (Gitlab). My comments are above the commands: | |
| # First, shallow-clone the old repo to the depth we want to keep | |
| git clone --depth=50 https://...@bitbucket.org/....git | |
| # Go into the directory of the clone | |
| cd clonedrepo | |
| # Once in the clone's repo directory, remove the old origin | |
| git remote remove origin |
This file contains hidden or 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 job | |
| import ( | |
| "fmt" | |
| "git.yy.com/ihago/yalert/v2" | |
| "git.yy.com/ihago/ylog" | |
| "git.yy.com/ihago/ylog/zap" | |
| "git.yy.com/ihago/yruntime" | |
| "github.com/robfig/cron/v3" | |
| "hago-room-srv-metrics2/util" |
This file contains hidden or 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
| function hex_dump (str) | |
| local len = string.len( str ) | |
| local dump = "" | |
| local hex = "" | |
| local asc = "" | |
| for i = 1, len do | |
| if 1 == i % 8 then | |
| dump = dump .. hex .. asc .. "\n" | |
| hex = string.format( "%04x: ", i - 1 ) |
This file contains hidden or 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 cloud.youxin.logserver.controller; | |
| import cloud.youxin.logserver.config.SchedulerConfig; | |
| import lombok.extern.slf4j.Slf4j; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.annotation.Qualifier; | |
| import org.springframework.boot.context.event.ApplicationReadyEvent; | |
| import org.springframework.context.event.EventListener; | |
| import org.springframework.data.redis.core.RedisTemplate; | |
| import org.springframework.data.redis.core.script.DefaultRedisScript; |
OlderNewer