小编kar*_*dia的帖子

多对多表加入Pivot

我现在有类似的两个表users,并programs正在通过一个的方式很多一对多关系链接link表.

mysql> select * from users;
+----+----------+
| id | name     |
+----+----------+
|  1 | Jonathan |
|  2 | Little   |
|  3 | Annie    |
|  4 | Bob      |
+----+----------+
4 rows in set (0.00 sec)

mysql> select * from programs;
+----+----------------------+
| id | name                 |
+----+----------------------+
|  1 | Microsoft Word       |
|  2 | Microsoft Excel      |
|  3 | Microsoft PowerPoint |
+----+----------------------+
3 rows in …
Run Code Online (Sandbox Code Playgroud)

mysql pivot many-to-many

9
推荐指数
1
解决办法
6788
查看次数

Python多行字符串打破了Vim的缩进折叠

Python的字符串文字并置使得多行字符串更容易编写更漂亮,但是当我深入四或五个缩进并想要使用整行时(前导空格无关紧要),Vim foldmethod=indent会崩溃.

例如:

def getQuotation():
    print "Fetching quotation from the absolutely useless function."
    return ("Four score and seven years ago our fathers brought forth, "
"upon this continent, a new nation, conceived in liberty, and dedicated "
"to the proposition that \"all men are created equal\"")
Run Code Online (Sandbox Code Playgroud)

应折叠如下:

def getQuotation():
+--  4 lines: print "Fetching quotation from the absolutely useless function."--
Run Code Online (Sandbox Code Playgroud)

但相反,我得到了这个:

def getQuotation():
+--  2 lines: print "Fetching quotation from the absolutely useless function."--
"upon this continent, a new …
Run Code Online (Sandbox Code Playgroud)

python ide vim multiline folding

3
推荐指数
1
解决办法
2070
查看次数

标签 统计

folding ×1

ide ×1

many-to-many ×1

multiline ×1

mysql ×1

pivot ×1

python ×1

vim ×1