tmp

Git多人协作维护仓库简单流程

别说谁变了你拦得住时间么 提交于 2019-12-02 06:32:57
Git多人协作维护仓库简单流程与常用指令总结 命令: git diff <branch name> 比较当前分支和另一个分支的区别 git merge x 将x分支合并到当前分支 git add . 或 git add -A 会提交所有修改 git commite -m "" git branch -b x 创建新的分支 git branch 查询当前有哪些分支,以及位于哪个分支 git remote -v查看当前远程仓库 git branch -d dev 删除没有未提交内容或未合并的分支 git branch -D dev 强制删除含未提交内容或未合并的分支 ... 使用 多人协作(一个简单流程) 通过clone克隆远程仓库 $ git clone git@github.com:michaelliao/gitskills.git 把自己远程仓库更新,保持与原作者仓库同步。(在GitHub网页上操作即可,即保持源仓库与自己fork的仓库内容同步) 把自己的本地库更新,更新方法使用如下指令 git pull origin master 以上指令可以把远程仓库的master分支,合并到当前分支 或者等价于 git fetch origin master:tmp git diff tmp git merge tmp git branch -d tmp

Git指令中fetch和pull的区别

邮差的信 提交于 2019-12-02 06:32:48
fetch和pull的区别 1. git fetch:相当于是从远程获取最新版本到本地,但不会自动 merge git fetch origin master git log -p master origin/master git merge origin/master 以上命令的含义: 首先从远程的 origin 的 master 主分支下载最新的版本到 origin/master 分支上 然后比较本地的 master 分支和 origin/master 分支的差别 最后进行合并 上述过程其实可以用以下更清晰的方式来进行: git fetch origin master:tmp git diff tmp git merge tmp 从远程获取最新的版本到本地的 tmp 分支上,之后再进行 比较、合并 2. git pull:相当于是从远程获取最新版本并 merge 到本地 git pull origin master 上述命令其实相当于 git fetch + git merge , 在实际使用中,git fetch 更安全一些,因为在 merge 前,我们可以查看更新情况,然后再决定是否合并。 来源: https://www.cnblogs.com/sxy370921/p/11734628.html

LeetCode-探索-初级算法-其他-3. 颠倒二进制位(个人做题记录,不是习题讲解)

匆匆过客 提交于 2019-12-02 06:20:43
LeetCode-探索-初级算法-其他-3. 颠倒二进制位(个人做题记录,不是习题讲解) LeetCode探索-初级算法:https://leetcode-cn.com/explore/interview/card/top-interview-questions-easy/ 颠倒二进制位 语言:java 思路:除了获取每一位,然后直接位运算和最开头的替换,暂时没想到比较好的方法. 参考代码1(1ms): https://blog.csdn.net/qq_33330687/article/details/81903145 public class Solution { // you need treat n as an unsigned value public int reverseBits ( int n ) { int result = 0 ; int i = 0 ; while ( i < 32 ) { int temp = n & 1 ; //得到最后一位 0或者1 n = n >> 1 ; //右移动1位 result = result << 1 | temp ; //首先把二进制往左边移动1位,然后|操作,1010左移 10100|1==10101 i ++ ; } return result ; } } 参考代码2(1ms):没想到参考答案的想法和我是一样的

devicemapper存储驱动下镜像的存储

依然范特西╮ 提交于 2019-12-02 06:03:17
docker配置devicemapper存储驱动 #查看当前使用的存储驱动,默认为overlay docker info | grep -i storage #停止dockersystemctl stop docker #移除原存储配置文件 rm /etc/sysconfig/docker-storage #使用vdb磁盘创建pv pvcreate /dev/vdb #使用vdb磁盘创建dockercg vgcreate dockervg /dev/vdb #配置docker pool为dockervg cat <<EOF > /etc/sysconfig/docker-storage-setup VG=dockervg EOF #配置存储 docker-storage-setup #重启docker systemctl restart docker devicemapper存储驱动下镜像的存储 docker数据存储的目录为/var/lib/docker,可以通过docker info | grep -i "Docker Root Dir" 查看 以下通过构建一个镜像来观察镜像的存储方式,Dockerfile如下 #创建测试目录 mkdir -p /tmp/docker-test && cd /tmp/docker-test #创建Dockerfile和测试文件 echo <

面试-算法笔记

跟風遠走 提交于 2019-12-02 05:23:52
目录 堆排序 快速排序 冒泡排序 选择排序 插入排序 迷宫问题 基数排序 归并排序 斐波那契数列 汉诺塔问题 计数排序 希尔排序 二分查找 单链表 找错, 快速排序 import time import random def cal_time(func): def wrapper(*args, **kwargs): start_time = time.time() res = func(*args, **kwargs) end_time = time.time() print("%s Running time: %s"%(func.__name__, (end_time - start_time))) return res return wrapper 堆排序 import random import time def sift(li, low, high): i = low tmp = li[low] j = 2 * i + 1 while j <= high: if j < high and li[j + 1] > li[j]: j += 1 if li[j] > li[i]: li[i], li[j] = li[j], li[i] i = j j = 2 * i + 1 else: break @cal_time def tree_sort(li, low, high): n

Java vector与数组相互转换

◇◆丶佛笑我妖孽 提交于 2019-12-02 05:10:00
vector转换为数组 方法一:使用for循环 Vector<String> vec=new Vector<String>(); String tmp[]=new String[vec.size()]; for(int i=0;i<vec.size();i++) tmp[i]=vec.get(i); 方法二:使用vector的toArray方法 String tmp[]=vec.toArray(new String[vec.size()]); 方法三:使用vector的copyInto方法 参考此链接: https://blog.csdn.net/u014372225/article/details/69267279 数组转换为vector 方法一:使用for循环 Vector<String> vec=new Vector<String>(); for(int i=0;i<tmp.length;i++) vec.add(tmp[i]); 方法二:先使用asList转换为list,然后再转换为vector(感觉这个有点麻烦,不如list) List<String> list=new ArrayList<String>(Arrays.asList(tmp)); Vector<String> vec=new Vector<String>(list); 来源: https://blog

LeetCode 53. 最大子序和

江枫思渺然 提交于 2019-12-01 23:50:21
LeetCode 53. 最大子序和 给定一个整数数组 nums ,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 示例: 输入: [-2,1,-3,4,-1,2,1,-5,4], 输出: 6 解释: 连续子数组 [4,-1,2,1] 的和最大,为 6。 进阶: 如果你已经实现复杂度为 O(n) 的解法,尝试使用更为精妙的分治法求解。 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/maximum-subarray 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 解法: 一:暴力求解 class Solution: def maxSubArray(self, nums: List[int]) -> int: tmp = nums[0] max_ = tmp n = len(nums) for i in range(1,n): # 当当前序列加上此时的元素的值大于tmp的值,说明最大序列和可能出现在后续序列中,记录此时的最大值 if tmp + nums[i]>nums[i]: max_ = max(max_, tmp+nums[i]) tmp = tmp + nums[i] else: #当tmp(当前和)小于下一个元素时,当前最长序列到此为止。以该元素为起点继续找最大子序列,

centos7的服务管理systemctl

。_饼干妹妹 提交于 2019-12-01 20:18:00
Linux Systemctl是一个系统管理守护进程、工具和库的集合,用于取代System V、service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器。通过Systemctl –help可以看到该命令主要分为:查询或发送控制命令给systemd服务,管理单元服务的命令,服务文件的相关命令,任务、环境、快照相关命令,systemd服务的配置重载,系统开机关机相关的命令。 1.启动、重启、停止、重载服务以及检查服务(如 httpd.service)状态 systemctl start httpd.service systemctl restart httpd.service systemctl stop httpd.service systemctl reload httpd.service systemctl status httpd.service 注意:当我们使用systemctl的start,restart,stop和reload命令时,终端不会输出任何内容,只有status命令可以打印输出。 2. 如何激活服务并在开机时启用或禁用服务(即系统启动时自动启动mysql.service服务) systemctl is-active mysql.service systemctl enable mysql.service systemctl

Shell基本命令

情到浓时终转凉″ 提交于 2019-12-01 18:57:19
Linux命令行的组成结构 [root@oldboy_python ~]# [root@oldboy_python ~]# [root@oldboy_python ~]# [root@oldboy_python ~]# [root@oldboy_python ~]# Linux系统命令操作语法格式 命令 空格 参数 空格 【文件或路径】需要处理的内容 rm -rf /tmp/* ls -la /home 结婚 -没车没房 女的就行 结婚 -有车有房 白富美 1.一般情况下,【参数】是可选的,一些情况下【文件或路径】也是可选的 2.参数 > 同一个命令,跟上不同的参数执行不同的功能 执行linux命令,添加参数的目的是让命令更加贴切实际工作的需要! linux命令,参数之间,普遍应该用一个或多个空格分割! 创建一个目录 /oldboy windows下: 鼠标右击 > 新建文件夹 Linux下: make directory > mk dir > mkdir------------------------------- mkdir /oldboy------------------------------- cd / mkdir oldboy#递归创建a/b c/dmkdir -p a/b c/d#递归创建test/a,b,c,d四个目录mkdir -p test/{a,b,c,d}

Rails3: Change location of temp (tmp) directory

守給你的承諾、 提交于 2019-12-01 18:21:09
I usually develop in my local Dropbox folder. Some files in the tmp-folder get locked by the browsers (and keep Dropbox busy), Growl throws exceptions and so on. Therefore I am looking for a configuration setting to put the tmp-folder outside the Rails-app bundle. Is that possible? Not the answer you're looking for - but I can definitively say that there's no configuration option to change where Rails thinks the tmp folder is. The location is hard coded in many different places in the Rails codebase. Looks like the symlink will sync the original file, so you'll probably have the same locking