⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# This is a start up list for python | |
# It will be used to quickly review the basic syntaxes and operations of python | |
# Code summerized from "简明 Python 教程" : http://woodpecker.org.cn/abyteofpython_cn/chinese/index.html | |
# Usually, python command options begin with two -- , e.g. --version --help | |
# Python Use True & False for boolean values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
import java.text.SimpleDateFormat; | |
import java.sql.Timestamp; | |
import java.lang.StringBuffer; | |
public class DateOperation{ | |
private Date date; | |
public DateOperation(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# To convert a Unicode string into an 8-bit string using a specific encoding, Unicode objects provide an encode() method that takes one argument, the name of the encoding. Lowercase names for encodings are preferred. | |
u"äöü".encode('utf-8') | |
# '\xc3\xa4\xc3\xb6\xc3\xbc' | |
# If you have data in a specific encoding and want to produce a corresponding Unicode string from it, you can use the unicode() function with the encoding name as the second argument. | |
unicode('\xc3\xa4\xc3\xb6\xc3\xbc', 'utf-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> # Replace some items: | |
... a[0:2] = [1, 12] | |
>>> a | |
[1, 12, 123, 1234] | |
>>> # Remove some: | |
... a[0:2] = [] | |
>>> a | |
[123, 1234] | |
>>> # Insert some: | |
... a[1:1] = ['bletch', 'xyzzy'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> a, b = 0, 1 | |
>>> while b < 1000: | |
... print b, | |
... a, b = b, a+b | |
... | |
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set ai | |
:set hlsearch | |
:set nu | |
:set ts=4 | |
:set expandtab | |
:%retab! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -u root -p ENTER | |
CREATE DATABASE django CHARACTER SET utf8; |
OlderNewer