一、git、github、gitlab的区别
Git是版本控制系统,Github是在线的基于Git的代码托管服务。
GitHub是2008年由Ruby on Rails编写而成。GitHub同时提供付费账户和免费账户。这两种账户都可以创建公开的代码仓库,只有付费账户可以创建私有的代码仓库。
Gitlab解决了这个问题, 可以在上面创建免费的私人repo。

二、gitlab server搭建过程

[root@vm1 ~]#  yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python
//10.x以后开始依赖policycoreutils-python
[root@vm1 ~]# systemctl start postfix
[root@vm1 ~]# systemctl enable postfix

 

gitlab的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
安装gitlab:

[root@vm1 ~]# rpm -ivh gitlab-ce-10.7.-ce..el7.x86_64.rpm
warning: gitlab-ce-10.7.-ce..el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing... ################################# [%]
Updating / installing...
:gitlab-ce-10.7.-ce..el7 ################################# [%]
It looks like GitLab has not been configured yet; skipping the upgrade script. *. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,. _______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/ Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md [root@vm1 ~]#
 

gitlab的配置文件 /etc/gitlab/gitlab.rb, 编辑如下:

[root@vm1 ~]# vim /etc/gitlab/gitlab.rb
[root@vm1 ~]# grep "^external_url" /etc/gitlab/gitlab.rb
external_url 'http://192.168.60.119' 绑定监听的域名或IP(企业中最好是域名)
[root@vm1 ~]#
 

使用gitlab-ctl reconfigure 自动配置,并安装数据库,初始化信息,如下所示(第一次使用配置时间较长):

[root@vm1 ~]# gitlab-ctl reconfigure   <生成 /var/opt/gitlab/ 各种子配置, 该命令建议仅在初始化时使用一次>
.....

注: 第一次初始化后会产生当前gitlab的配置文件 /var/opt/gitlab/gitlab-rails/etc/gitlab.yml ,在后期维护的过程中尽量配置 /var/opt/gitlab/gitlab-rails/etc/gitlab.yml 文件,然后gitlab-ctl restart 即可生效新的配置;如果没有必要不建议做第二次初始化。
使用gitlab-ctl start 启动gitlab服务,如下所示:

[root@vm1 ~]# gitlab-ctl start
ok: run: gitaly: (pid ) 2922s
ok: run: gitlab-monitor: (pid ) 2921s
ok: run: gitlab-workhorse: (pid ) 2922s
ok: run: logrotate: (pid ) 2987s
ok: run: nginx: (pid ) 2993s
ok: run: node-exporter: (pid ) 2974s
ok: run: postgres-exporter: (pid ) 2919s
ok: run: postgresql: (pid ) 3047s
ok: run: prometheus: (pid ) 2920s
ok: run: redis: (pid ) 3053s
ok: run: redis-exporter: (pid ) 2962s
ok: run: sidekiq: (pid ) 3005s
ok: run: unicorn: (pid ) 3011s
[root@vm1 ~]#
[root@vm1 ~]# lsof -i:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx root 7u IPv4 0t0 TCP *:http (LISTEN)
nginx gitlab-www 7u IPv4 0t0 TCP *:http (LISTEN)
[root@vm1 ~]#
 

修改配置文件,添加smtp邮件功能

[root@vm1 ~]# vim /etc/gitlab/gitlab.rb
[root@vm1 ~]# grep -P "^[^#].*smtp_|user_email|gitlab_email" /etc/gitlab/gitlab.rb
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'username@domain.cn'
gitlab_rails['gitlab_email_display_name'] = 'Admin'
gitlab_rails['gitlab_email_reply_to'] = 'usernamei@domain.cn'
gitlab_rails['gitlab_email_subject_suffix'] = '[gitlab]'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] =
gitlab_rails['smtp_user_name'] = "username@domain.cn"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_domain'] = "domain.cn"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
user['git_user_email'] = "username@domain.cn" [root@vm1 ~]# gitlab-ctl reconfigure
...... [root@vm1 ~]# gitlab-ctl stop
ok: down: gitaly: 0s, normally up
ok: down: gitlab-monitor: 1s, normally up
ok: down: gitlab-workhorse: 0s, normally up
ok: down: logrotate: 1s, normally up
ok: down: nginx: 0s, normally up
ok: down: node-exporter: 1s, normally up
ok: down: postgres-exporter: 0s, normally up
ok: down: postgresql: 0s, normally up
ok: down: prometheus: 0s, normally up
ok: down: redis: 0s, normally up
ok: down: redis-exporter: 1s, normally up
ok: down: sidekiq: 0s, normally up
ok: down: unicorn: 1s, normally up [root@vm1 ~]# gitlab-ctl start
ok: run: gitaly: (pid ) 0s
ok: run: gitlab-monitor: (pid ) 0s
ok: run: gitlab-workhorse: (pid ) 0s
ok: run: logrotate: (pid ) 0s
ok: run: nginx: (pid ) 1s
ok: run: node-exporter: (pid ) 0s
ok: run: postgres-exporter: (pid ) 1s
ok: run: postgresql: (pid ) 0s
ok: run: prometheus: (pid ) 1s
ok: run: redis: (pid ) 0s
ok: run: redis-exporter: (pid ) 0s
ok: run: sidekiq: (pid ) 1s
ok: run: unicorn: (pid ) 0s
 

使用gitlab-rails console命令进行发送邮件测试,如下所示:

[root@vm1 ~]# gitlab-rails console
Loading production environment (Rails 4.2.)
irb(main)::> Notify.test_email('user@destination.com', 'Message Subject', 'Message Body').deliver_now Notify#test_email: processed outbound mail in .5ms Sent mail to user@destination.com (.5ms)
Date: Fri, May :: +
From: Admin <username@domain.cn>
Reply-To: Admin <username@domain.cn>
To: user@destination.com
Message-ID: <5aec10b24cfaa_93933fee282db10c162d@vm1.mail>
Subject: Message Subject
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>Message Body</p></body></html> => #<Mail::Message:, Multipart: false, Headers: <Date: Fri, May :: +>, <From: Admin <username@domain.cn>>, <Reply-To: Admin <username@domain.cn>>, <To: user@destination.com>, <Message-ID: <5aec10b24cfaa_93933fee282db10c162d@vm1.mail>>, <Subject: Message Subject>, <Mime-Version: 1.0>, <Content-Type: text/html; charset=UTF->, <Content-Transfer-Encoding: 7bit>, <Auto-Submitted: auto-generated>, <X-Auto-Response-Suppress: All>>
irb(main)::>quit
[root@vm1 ~]#
 

三、gitlab的使用
在浏览器中输入 http://192.168.60.119/ ,然后 change password: ,并使用root用户登录 即可 (后续动作根据提示操作)
修改密码也可以:gitlab-rails console production
irb(main):001:0> user = User.where(id: 1).first // id为1的是超级管理员
irb(main):002:0>user.password = 'yourpassword' // 密码必须至少8个字符
irb(main):003:0>user.save! // 如没有问题 返回true
exit // 退出

如果需要手工修改nginx的port ,可以在gitlab.rb中设置 nginx['listen_port'] = 8000 ,然后再次 gitlab-ctl reconfigure即可

登录gitlab 如下所示:

创建 group ,组名为plat-sp ,如下所示:

去掉用户的自动注册功能:
admin are -> settings -> Sign-up Restrictions 去掉钩钩,然后拉到最下面保存,重新登录

创建用户Tompson如下所示:

同样的方法,再创建Eric 、Hellen 用户。用户添加完毕后,gitlab会给用户发一封修改密码的邮件,各用户需要登录自己的邮箱,并点击相关的链接,设置新密码。

将用户添加到组中,并指定Tompson为本组的owner:

同样的方法将用户Eric、Hellen也添加到组中,并指定他们为Developer:

使用Tompson用户的身份与密码登录到gitlab界面中,并创建Project ,如下所示:

指定项目的存储路径和项目名称,如下所示

为项目创建Dev分支,如下所示:

在 client 上添加Tompson的用户:

[root@vm2 ~]# useradd Tompson
[root@vm2 ~]# useradd Eric
[root@vm2 ~]# useradd Hellen
[root@vm2 ~]# su - Tompson
[Tompson@vm2 ~]$ ssh-keygen -C Tompson@domain.cn
Generating public/private rsa key pair.
Enter file in which to save the key (/home/Tompson/.ssh/id_rsa):
Created directory '/home/Tompson/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/Tompson/.ssh/id_rsa.
Your public key has been saved in /home/Tompson/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:SAoAH2zSxqEJqVgKKrxM5XMi6tKe61JMRdwMhwBNIrE Tompson@domain.cn
The key's randomart image is:
+---[RSA 2048]----+
|XX==o=. |
|*BOo+.o |
|E*=. . |
|*+.= + . |
|=oo = . S |
|.oo |
|.o |
|o... |
|.+=. |
+----[SHA256]-----+
[Tompson@vm2 ~]$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ8cRGHej+sZzlmK36W5MUXMLOGdTwFI9Jj44mGuabZCrlYW4GDpL6ppezN+Sur0wHtnKonYJzm8ntqS0S0UHyaPPQPl9Mrs/6Z4VrXZ/4RlqHdWeSrmOwCBQld0l8HvrmP4TyGHrOreO8uZqimd/Z+OiMqnYRZzENX11Pti/Px5g1MtJcoCi9uLtF42QYrt1X/fzAyPU9C5/5ZUq4Jln3EF20bzcA52oAzZIl0jrhI0TeTeW6zYq+KxdHGshL+qG7+Ne+akPOe4Ma5BQjcMZ2dQ2kbGuozXmLT8RDcj9YRKceQsUdTI71lJpwrWKGn8Vhra0EaK3hgoTuvMYaGfOF Tompson@domain.cn

将Tompson的公钥复制到gitlab中: 使用Tompson用户的身份与密码登录到gitlab界面中,然后在ssh-key中添加 相关的key ,如下所示:

为Tompson用户配置git ,如下所示:

[Tompson@vm2 ~]$ git config --global user.email "Tompson@domain.cn"
[Tompson@vm2 ~]$ git config --global user.name "Tompson" [Tompson@vm2 ~]$ git clone git@192.168.60.119:plat-sp/chathall.git
Cloning into 'chathall'...
The authenticity of host '192.168.60.119 (192.168.60.119)' can't be established.
ECDSA key fingerprint is SHA256:CDxAQmj6gUkIxB6XUofbZ853GuPM5LS2QO4a5dD7jRo.
ECDSA key fingerprint is MD5:4e:20:72:a7:46:c6:d7:5d:bb:9d:ce:c3:f3:da:43:f9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.60.119' (ECDSA) to the list of known hosts.
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
[Tompson@vm2 ~]$
[Tompson@vm2 ~]$ cd chathall/
[Tompson@vm2 chathall]$ ls
Readme.txt
[Tompson@vm2 chathall]$

创建一下新文件,添加内容,并提交到master分支:

[Tompson@vm2 chathall]$ vim test.sh
[Tompson@vm2 chathall]$ cat test.sh
#!/bin/bash
echo "gitlab test"
[Tompson@vm2 chathall]$ git add .
[Tompson@vm2 chathall]$ git commit -m '201805101649'
[master 80edf6b] 201805101649
1 file changed, 2 insertions(+)
create mode 100644 test.sh
[Tompson@vm2 chathall]$
[Tompson@vm2 chathall]$ git push -u origin master
Counting objects: 4, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 305 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@192.168.60.119:plat-sp/chathall.git
4611654..80edf6b master -> master
Branch master set up to track remote branch master from origin.
[Tompson@vm2 chathall]$

使用Eric用户登录,并clone 项目,如下所示:

[root@vm2 ~]# su - Eric
[Eric@vm2 ~]$ ssh-keygen -C Eric@domain.cn
Generating public/private rsa key pair.
Enter file in which to save the key (/home/Eric/.ssh/id_rsa):
Created directory '/home/Eric/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/Eric/.ssh/id_rsa.
Your public key has been saved in /home/Eric/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:VZaJvjA5SJZEB+yuRpDBNHCECCZ5R8X0DYcNE0f1B6E Eric@domain.cn
The key's randomart image is:
+---[RSA 2048]----+
|*O=..B*o**+o+oo. |
|*.+.. *o.*oooo . |
| . + + ..oo E . .|
| o o =.. . |
| . . S+ . |
| . . . |
| . . |
| o |
| . |
+----[SHA256]-----+ [Eric@vm2 ~]$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDxQcn4UjRW/5PT5witeV9+S2w8WK5ouawHxEF7s9wuWsT4pqhcu5BN74NG3CPaq1jJZnkV+aQsTw+60BAd1gOK0FBbKWxmohmE61n9vfpUT5igJ72t2jpXjfKwLIHw+Iq5yM4yUhkwSsoBuZkxYSEltnj8OvXaOlCDYnXuGBa9+xO8f5yVIcOtiwRvv+Y1PRRzSIcazPVZax9FLK26t1R4NPiY4xWkIJyK2OrKMeiaBBzyMfWzHdmsCWa51oSrYSmz3PDBXpzIBs3OdKxcaJs9Lc5u87YCV5RMUjLrPcA7nPK6crOabLXhz3d5GSYggMTOByQkyKOo7WlYpARCHOt/ Eric@domain.cn
[Eric@vm2 ~]$

同样需要使用Eric用户登录gitlab web 界面,并添加相应的ssh-key。然后设置git ,并clone项目:

[Eric@vm2 ~]$ git config --global user.email "Eric@domain.cn"
[Eric@vm2 ~]$ git config --global user.name "Eric"
[Eric@vm2 ~]$ git clone git@192.168.60.119:plat-sp/chathall.git
Cloning into 'chathall'...
The authenticity of host '192.168.60.119 (192.168.60.119)' can't be established.
ECDSA key fingerprint is SHA256:CDxAQmj6gUkIxB6XUofbZ853GuPM5LS2QO4a5dD7jRo.
ECDSA key fingerprint is MD5:4e:20:72:a7:46:c6:d7:5d:bb:9d:ce:c3:f3:da:43:f9.
Are you sure you want to continue connecting (yes/no)? yes
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
[Eric@vm2 ~]$

切换到dev分支,修改文件内容,并将新code提交到dev分支(Developer角色默认并没有提交master的权限):

[Eric@vm2 chathall]$ git checkout dev
Branch dev set up to track remote branch dev from origin.
Switched to a new branch 'dev'
[Eric@vm2 chathall]$ ls
Readme.txt test.sh
[Eric@vm2 chathall]$ vim test.sh
[Eric@vm2 chathall]$ cat test.sh
#!/bin/bash
echo "gitlab test"
echo "brahch test"
[Eric@vm2 chathall]$ git add .
[Eric@vm2 chathall]$ git commit -m '201805101658'
[dev 6687039] 201805101658
1 file changed, 1 insertion(+)
[Eric@vm2 chathall]$ git push -u origin dev
Counting objects: 5, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 306 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote:
remote: To create a merge request for dev, visit:
remote: http://192.168.60.119/plat-sp/chathall/merge_requests/new?merge_request%5Bsource_branch%5D=dev
remote:
To git@192.168.60.119:plat-sp/chathall.git
80edf6b..6687039 dev -> dev
Branch dev set up to track remote branch dev from origin.
[Eric@vm2 chathall]$
[Eric@vm2 chathall]$ git checkout master
Switched to branch 'master'
[Eric@vm2 chathall]$ git branch
dev
* master
[Eric@vm2 chathall]$

使用Eric 用户登录gitlab web,在界面中 创建一个合并请求:

提×××并请求:

然后使用Tompson用户登录 gitlab web ,找到“合并请求” ,然后将dev分支合并到master分支,如下所示:

大部分公司的处理流程如下:
PM在gitlab创建任务,分配给开发人员
开发人员领取任务后,在本地使用git clone拉取代码库
开发人员创建开发分支(git checkout -b dev),并进行开发
开发人员完成之后,提交到本地仓库(git commit )
开发人员在gitlab界面上申请分支合并请求(Merge request)
PM在gitlab上查看提交和代码修改情况,确认无误后,确认将开发人员的分支合并到主分支(master)
开发人员在gitlab上Mark done确认开发完成,并关闭issue。这一步在提×××并请求时可以通过描述中填写"close #1"等字样,可以直接关闭issue

转自

gitlab搭建与基本使用-WorkNote-51CTO博客 https://blog.51cto.com/caiyuanji/2114796

参考

Gitlab环境快速部署(RPM包方式安装) - 散尽浮华 - 博客园
https://www.cnblogs.com/kevingrace/p/5985918.html

Gitlab备份和恢复操作记录 - 散尽浮华 - 博客园
https://www.cnblogs.com/kevingrace/p/7821529.html

gitlab配置邮件通知功能操作记录 - 散尽浮华 - 博客园
https://www.cnblogs.com/kevingrace/p/6114336.html

[原创]CI持续集成系统环境--Gitlab+Gerrit+Jenkins完整对接 - 散尽浮华 - 博客园
https://www.cnblogs.com/kevingrace/p/5651447.html

[原创]CI持续集成系统环境---部署Gitlab环境完整记录 - 散尽浮华 - 博客园
https://www.cnblogs.com/kevingrace/p/5651402.html

gitlab搭建与基本使用【转】的更多相关文章

  1. 用GitLab搭建自己的私有GitHub

    相信很多技术人员都知道有个github造福开发人员的git(分布式版本管理工具)代码管理社区,可以说现在git是开发人员的必备技能之一 本周有个朋友公司需要一个类似github的代码仓库管理系统,本人 ...

  2. Jenkins+Gitlab搭建持续集成(CI)环境

    利用Jenkins+Gitlab搭建持续集成(CI)环境 Permalink: 2013-09-08 22:04:00 by hyhx2008in intern tags: jenkins gitla ...

  3. GitLab搭建详细过程

    一.前提 系统:Centos 6.5 软件版本:gitlab-7.8.4 Selinux:关闭 防火墙规则:先清空(搭建好了后续自己添加相关放行规则) 二.yum源配置和相关依赖包 1.添加epel源 ...

  4. Ansible+Jenkins+Gitlab搭建及配置

    Ansible+Jenkins+Gitlab搭建及配置,已经生产环境使用,运行良好. 主机组文件里面好多ip敏感信息就不写了

  5. gitlab搭建之互备模式

    gitlab搭建之互备模式   gitlab搭建之互备模式 前言:gitlab目前默认的部署方式是本地单机部署,为了提高gitlab环境的可靠性和稳定性,必须构建一套互备搭建方案:借助gitolilt ...

  6. GitLab → 搭建私有的版本控制的托管服务平台

    开心一刻 睡着正香,媳妇用力把我晃醒说:“快起来,我爸来了.” 我一下醒了,手脚熟练的把衣服一抱,滚到床底,顺便把鞋也收了进去 媳妇蹲下无奈的说:“快出来!咱俩都结婚半年了.” 我:“对哦,搞习惯了” ...

  7. GitLab → 搭建中常遇的问题与日常维护

    开心一刻 隔壁有一个80多岁的老大爷,昨天在小区的一棵树下发现一条黑色的蛇,冻僵了,大爷善心大发,就把蛇揣在了怀里,想给它一点温暖. 今天一大早看到大爷在树上挂了一个牌子,写到:不准随地大小便! 搭建 ...

  8. gitlab 搭建(基于现有nginx)

    普通搭建请看:gitlab 搭建 一.gitlab搭建 1.添加GitLab镜像源并安装gitlab服务器 wget https://mirrors.tuna.tsinghua.edu.cn/gitl ...

  9. ubuntu12.04 gitlab搭建

    最近在尝试内部搭建gitlab,wiki这些工具...我使用的官网的gitlab-ce包一键安装,自己搭建的ubuntu12.04 server服务器. 分配253地址,放在办公室的小角落. 配置过程 ...

随机推荐

  1. Ceph FS 挂载

    Cephfs使用挂载方式有两种 1.使用linux kernel挂载 mount 2.使用ceph-fuse挂载. 1.下图为mount挂载 mount -t ceph 10.110.180.112: ...

  2. 2013.4.26 - KDD第八天

    下午上Android课,我看中秋也选这个课了,然后在上半节的时候速补了一下秦海龙师兄的那篇文章.中间休息的时候窜到了中秋那里,然后讨论了半节课现在的情况. 现在的情况是这样的: 中 秋开始是没有进行主 ...

  3. 微信小程序分享朋友圈 长海报 canvas 动态高度计算

    业务场景 在微信中 小程序无法分享到朋友圈,目前大部分的解决方案都是,canvas动态绘制 生成图片后,保存到用户相册,用户进行分享照片到朋友圈,朋友圈打开图片后识别二维码进入小程序,达到分享目的 g ...

  4. SecurityProtocolType 枚举

    地址:https://docs.microsoft.com/zh-cn/dotnet/api/system.net.securityprotocoltype?redirectedfrom=MSDN&a ...

  5. React组件库Ant Design的安装与使用

    一.什么是 Ant Design 1.Ant Design 提炼自企业级中后台产品的交互语言和视觉风格 2.Ant Design 使用 TypeScript 构建,提供完整的类型定义文件 二.Ant ...

  6. 《BUG创造队》作业9:【Beta】冲刺 Scrum meeting 1

    项目 内容 这个作业属于哪个课程 2016级软件工程 这个作业的要求在哪里 实验十三 团队作业9:Beta冲刺与团队项目验收 团队名称 BUG创造队 作业学习目标 (1)掌握软件黑盒测试技术:(2)学 ...

  7. CH6801 棋盘覆盖

    6801 棋盘覆盖 0x60「图论」例题 描述 给定一个N行N列的棋盘,已知某些格子禁止放置.求最多能往棋盘上放多少块的长度为2.宽度为1的骨牌,骨牌的边界与格线重合(骨牌占用两个格子),并且任意两张 ...

  8. Redis面试基本问题

    Redis有哪些数据结构? 字符串String.字典Hash.列表List.集合Set.有序集合SortedSet.如果你是Redis中高级用户,还需要加上下面几种数据结构HyperLogLog.Ge ...

  9. Tensorflow细节-P174-真正的图像预处理

    注意这里的读取image_raw_data = tf.gfile.FastGFile("./datasets/cat.jpg", "rb").read(),写入 ...

  10. Java【基础学习】之暴力求素数【用数组返回】

    Java[基础学习]之暴力求素数[用数组返回] */ import java.util.*; public class Main{ public static void main(String[] a ...