0%

emlog_ad字段
id
status
position
title
weight
content

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--找出重复
SELECT a.*
FROM emlog_ad a
WHERE a.id IN
(SELECT b.id id
FROM emlog_ad b
GROUP BY b.title
HAVING count(b.id)>1);

--删除重复留下id最小的
SELECT a.*
FROM emlog_ad a
WHERE a.id IN
(SELECT b.id
FROM emlog_ad b
GROUP BY b.title
HAVING count(b.id)>1)
AND a.id NOT IN
(SELECT min(c.id)
FROM emlog_ad c
GROUP BY c.title
HAVING count(c.id)>1);

--一句sql把所有AA改为BB,CC改为DD
UPDATE emlog_ad a
SET a.`status`=(
CASE
WHEN a.`status` = '1' THEN '11'
WHEN a.`status`='2' THEN '22'
END
);

准备工作

  1. Node.js:点击下载
  2. git:点击下载
  3. MarkdownPad:点击下载

安装好上面三个工具
可能会遇到的问题:

**1、**Git Bash执行node -v提示无效 或者 npm install 报 command not found

解决办法:在环境变量 - 用户变量中 - 新建用户变量 - 添加nodejs安装路径

如:C:\tool\nodejs

**2、**ERROR Deployer not found : github

解决办法:

  1. 配置文件有问题,冒号后面都有一个空格的
  2. 执行:npm install hexo-deployer-git –save (这命令是为了解决hexo新版本的部署问题)

3使用淘宝镜像加快安装速度
安装cnpm,使用命令:

1
npm install cnpm -g --registry=https://registry.npm.taobao.org

安装过程

  1. 打开Git Bash
  2. 进入nodejs安装目录
  3. 开始安装hexo,输入下面代码
  4. npm install -g hexo#等待安装完成,这个过程可能会快也可能很慢,耐心等待
  5. mkdir blog && cd blog #上面这个代码是创建一个博客存放的目录
  6. hexo init#初始化
  7. cnpm install #安装依赖包
  8. 完成之后,本地博客就搭建完成
  9. hexo g #生成静态页面
  10. hexo s #启动服务器,打开http://localhost:4000 就是本地博客

本地博客安装完成,下面介绍发布到github上

  1. 登陆github,没有就注册
  2. 点击右上角加号+
  3. Create a new repository
  4. 名字写:yourgithubname.github.io
  5. 创建完成
  6. 点击Setting
  7. 选择一个主题,然后就好了
  8. 编辑blog文件夹里面的_config.yml配置文件
  9. 最后面添加
1
2
3
4
deploy:
type: git
repository: http://github.com/yourname/yourname.github.io.git
branch: master

最后执行

  1. hexo g#重新生成静态博客
  2. hexo d#将本地静态博客部署到github

现在你在浏览器打开:http://yourname.github.io就可以访问你的博客了
到此为止就搭建完了一个博客

开始写第一篇文章:
执行:hexo new “你的文章标题”
然后你在blog/source/_posts文件夹下面有文件,用markdownpad打开编辑
执行:

  1. hexo g#重新生成
  2. hexo s#本地查看效果
  3. hexo d#上传到github
  4. 或者不预览,直接一步上传到github:hexo d -g

这里我只是贴一段代码测试一下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.hisen.interview;

/**
* 变量不能被重写
*
* @author hisenyuan 2017年1月18日 下午10:33:33
*/
public class AboutExtends {
public static class A {
public int a = 0;

public void fun() {
System.out.println("A");
}

static {
System.out.println("Astatic");
}
{
System.out.println("I'm A class");
}
}

public static class B extends A {
public int a = 1;

public void fun() {
System.out.println("B");
}

static {
System.out.println("Bstatic");
}
{
System.out.println("I'm B class");
}
}

public static void main(String[] args) {
// 里面的static块方法,new了就会执行
// new new B()两个都执行,new new A()执行A的
//static代码块在{}代码块后面执行
A classA = new B();
System.out.println(classA.a);
classA.fun();
// 输出信息
// Astatic
// Bstatic
// I'm A class
// I'm B class
// 1
// B

// 多态记忆口诀
// 变量多态看左边
// 方法多态看右边
// 静态多态看左边
}
}