最后就差把 bugFix 分支里的工作合并回 main 分支了。你可以选择通过 fast-forward 快速合并到 main 分支上,但这样的话 main 分支就会包含我这些调试语句了。你肯定不想这样,应该还有更好的方式……实际我们只要让 Git 复制解决问题的那一个提交记录就可以了。跟之前我们在“整理提交记录”中学到的一样,我们可以使用git rebase -igit cherry-pick来达到目的。
使用git rebase -i时将某几个提交放弃,就会只保留最新的提交
在原分支cherry-pick某个提交即可只保留该提交
2.当我们一次性提交了5个提交,后三个提交已经merge,而第二个提交需要有新的修改时
我们就可以使用git rebase -i HEAD~4指令,然后将顶部的我们要修改的提交改为edit状态,然后修改后使用git add+git commit --amend再使用git rebase --continue回到最新的工作区
- 彩色文字 在一段话中方便插入各种颜色的标签,包括:{% span red, 红色 %}、{% span yellow, 黄色 %}、{% span green, 绿色 %}、{% span cyan, 青色 %}、{% span blue, 蓝色 %}、{% span gray, 灰色 %}。 - 超大号文字 文档「开始」页面中的标题部分就是超大号文字。 {% span center logo large, Volantis %} {% span center small, A Wonderful Theme for Hexo %}
彩色文字 在一段话中方便插入各种颜色的标签,包括:红色、黄色、绿色、青色、蓝色、灰色。
超大号文字 文档「开始」页面中的标题部分就是超大号文字。 Volantis A Wonderful Theme for Hexo
2.3 段落文本 p
1
{% p 样式参数(参数以空格划分), 文本内容 %}
字体: logo, code
颜色: red,yellow,green,cyan,blue,gray
大小: small, h4, h3, h2, h1, large, huge, ultra
对齐方向: left, center, right
1 2 3 4 5 6
- 彩色文字 在一段话中方便插入各种颜色的标签,包括:{% p red, 红色 %}、{% p yellow, 黄色 %}、{% p green, 绿色 %}、{% p cyan, 青色 %}、{% p blue, 蓝色 %}、{% p gray, 灰色 %}。 - 超大号文字 文档「开始」页面中的标题部分就是超大号文字。 {% p center logo large, Volantis %} {% p center small, A Wonderful Theme for Hexo %}
彩色文字 在一段话中方便插入各种颜色的标签,包括:
红色
、
黄色
、
绿色
、
青色
、
蓝色
、
灰色
。
超大号文字 文档「开始」页面中的标题部分就是超大号文字。
Volantis
A Wonderful Theme for Hexo
2.4 引用note
1 2 3 4 5 6 7 8 9 10 11 12
note: # Note tag style values: # - simple bs-callout old alert style. Default. # - modern bs-callout new (v2-v3) alert style. # - flat flat callout style with background, like on Mozilla or StackOverflow. # - disabled disable all CSS styles import of note tag. style: simple icons: false border_radius: 3 # Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6). # Offset also applied to label tag variables. This option can work with disabled note tag. light_bg_offset: 0
{% tip %}default{% endtip %} {% tip info %}info{% endtip %} {% tip success %}success{% endtip %} {% tip error %}error{% endtip %} {% tip warning %}warning{% endtip %} {% tip bolt %}bolt{% endtip %} {% tip ban %}ban{% endtip %} {% tip home %}home{% endtip %} {% tip sync %}sync{% endtip %} {% tip cogs %}cogs{% endtip %} {% tip key %}key{% endtip %} {% tip bell %}bell{% endtip %} {% tip fa-atom %}自定义font awesome图标{% endtip %}
default
info
success
error
warning
bolt
ban
home
sync
cogs
key
bell
自定义font awesome图标
2.6 动态标签 anima
1
{% tip [参数,可选] %}文本内容{% endtip %}
将所需的CSS类添加到图标(或DOM中的任何元素)。
对于父级悬停样式,需要给目标元素添加指定CSS类,同时还要给目标元素的父级元素添加CSS类faa-parent animated-hover。(详情见示例及示例源码) You can regulate the speed of the animation by adding the CSS class or . faa-fastfaa-slow
可以通过给目标元素添加CSS类faa-fast或faa-slow来控制动画快慢。
1.On DOM load(当页面加载时显示动画)
1 2
{% tip warning faa-horizontal animated %}warning{% endtip %} {% tip ban faa-flash animated %}ban{% endtip %}
2.调整动画速度
1 2
{% tip warning faa-horizontal animated faa-fast %}warning{% endtip %} {% tip ban faa-flash animated faa-slow %}ban{% endtip %}
3.On hover(当鼠标悬停时显示动画)
1 2
{% tip warning faa-horizontal animated-hover %}warning{% endtip %} {% tip ban faa-flash animated-hover %}ban{% endtip %}
4.On parent hover(当鼠标悬停在父级元素时显示动画)
1 2
{% tip warning faa-parent animated-hover %}<pclass="faa-horizontal">warning</p>{% endtip %} {% tip ban faa-parent animated-hover %}<pclass="faa-flash">ban</p>{% endtip %}
1.On DOM load(当页面加载时显示动画)
warning
ban
2.调整动画速度
warning
ban
3.On hover(当鼠标悬停时显示动画)
warning
ban
4.On parent hover(当鼠标悬停在父级元素时显示动画)
warning
ban
2.7 复选列表 checkbox
1
{% checkbox 样式参数(可选), 文本(支持简单md) %}
样式: plus, minus, times
颜色: red,yellow,green,cyan,blue,gray
选中状态: checked
1 2 3 4 5 6 7 8 9 10
{% checkbox 纯文本测试 %} {% checkbox checked, 支持简单的 [markdown](https://guides.github.com/features/mastering-markdown/) 语法 %} {% checkbox red, 支持自定义颜色 %} {% checkbox green checked, 绿色 + 默认选中 %} {% checkbox yellow checked, 黄色 + 默认选中 %} {% checkbox cyan checked, 青色 + 默认选中 %} {% checkbox blue checked, 蓝色 + 默认选中 %} {% checkbox plus green checked, 增加 %} {% checkbox minus yellow checked, 减少 %} {% checkbox times red checked, 叉 %}
{% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %}
2.50%宽度
1 2 3 4 5 6
{% videos, 2 %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% endvideos %}
3.25%宽度
1 2 3 4 5 6 7 8 9 10
{% videos, 4 %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% video https://github.com/volantis-x/volantis-docs/releases/download/assets/IMG_0341.mov %} {% endvideos %}
1.100%宽度
2.50%宽度
3.25%宽度
2.19 相册 gallery
1.gallerygroup 相册图库
1 2 3 4 5
<divclass="gallery-group-main"> {% galleryGroup name description link img-url %} {% galleryGroup name description link img-url %} {% galleryGroup name description link img-url %} </div>
// a:%rdi b:%rsi c:%rdx intfunc4(int a, int b, int c){ int return_v = c - b; // %rax int t = ((unsigned)return_v) >> 31; // %rcx return_v = (t + return_v) >> 1; t = return_v + b; if (t - a <= 0){ return_v = 0; if (t - a >= 0){ return return_v; }else{ b = t + 1; int r = func4(a,b,c); return2 * r + 1; } } else { c = t - 1; int r = func4(a, b, c); return2*r; } }
// 修改后的代码 // x为输入的数 // y为0 z为14 intfunc4(int x, int y, int z){ int k = z - y; k = ((int)(((unsigned)k>>31) + k) >> 1) + y; if(k < x) return2*func4(x, k+1, z)+1; elseif(k > x) return2*func4(x, y, k-1); else return0; }
输入:intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3 输出:Reference of the node with value = 8 输入解释:相交节点的值为 8 (注意,如果两个列表相交则不能为 0)。从各自的表头开始算起,链表 A 为 [4,1,8,4,5],链表 B 为 [5,0,1,8,4,5]。在 A 中,相交节点前有 2 个节点;在 B 中,相交节点前有 3 个节点。
示例 2:
1 2 3
输入:intersectVal = 2, listA = [0,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1 输出:Reference of the nodewith value = 2 输入解释:相交节点的值为 2 (注意,如果两个列表相交则不能为 0)。从各自的表头开始算起,链表 A 为 [0,9,1,2,4],链表 B 为 [3,2,4]。在 A 中,相交节点前有 3 个节点;在 B 中,相交节点前有 1 个节点。
classSolution { public: inttranslateNum(int num){ int a = 1, b = 1, x, y = num % 10; while(num != 0) { num /= 10; x = num % 10; int tmp = 10 * x + y; int c = (tmp >= 10 && tmp <= 25) ? a + b : a; b = a; a = c; y = x; } return a;
classSolution { public: intnumWays(int n){ if(n == 0 || n == 1)return1; int a,b,tmp,i,sum; a = 1; b = 1; for(i = 2; i <= n; i++) { sum = (a + b) % 1000000007; tmp = b; b = sum; a = tmp; } return sum; } };