07 2017 档案
摘要:可以批量把 p1.jpeg p2.jpeg ... p100.jpeg ... 重命名为 p0001.jpeg p0002.jpeg ... p0100.jpeg ... 如果在命令前加入 会先打印出重命名后的结果, 不会实际执行
阅读全文
摘要:rename 's/\d+/sprintf("%04d", $&)/e' *.jpg 可以批量把 p1.jpeg p2.jpeg ... p100.jpeg ... 重命名为 p0001.jpeg p0002.jpeg ... p0100.jpeg...
阅读全文
摘要:以下有效: #!/bin/sh# Uncomment the following two lines for normal desktop:unset SESSION_MANAGER#exec /etc/X11/xinit/xinitrcgnome-se...
阅读全文
摘要:``` include int main() { const int foo[3][4] = { {11,12,13,14}, {21,22,23,24}, {31,32,33,34}, }; for(int i=0; i
阅读全文
摘要:#include int main(){ const int foo[3][4] = { {11,12,13,14}, {21,22,23,24}, ...
阅读全文
摘要:1 double rates[5] = {1, 2, 3, 4, 5};const double * pd = rates; 被pd指向的值不可改变,比如,不允许*pd = 20但是pd的指向改变,比如,允许pd++ 2 double rates[...
阅读全文
摘要:1 被 指向的值不可改变,比如,不允许 但是 的指向改变,比如,允许 2 此时 的指向也不能改变了
阅读全文
摘要:开启C99支持 gcc -std=c99 forc99.c 开启C11支持 gcc -std=c1x forc11.c 或 gcc -std=c11 forc11.c
阅读全文
摘要:int sum (int *arg, int n);int sum*int *, int);int sum(int ar[], int n);int sum(int [], int);
阅读全文
摘要:```
int sum (int *arg, int n);
int sum*int *, int);
int sum(int ar[], int n);
int sum(int [], int);
```
阅读全文
摘要:Mute Breakpoints: 保留所有断点,但是不执行(程序一次性执行)。 Condition: 条件触发 即当执行到i的值变为5的时候,在断点处暂停。
阅读全文
摘要:Mute Breakpoints : 保留所有断点,但是不执行(程序一次性执行)。 Condition : 条件触发 即当执行到 i 的值变为 5 的时候,在断点处暂停。
阅读全文
摘要:把下载的 登陆文件用文本编辑器打开,修改端口 用管理员权限打开 才能绑定端口 使用 命令登陆账号的时候,也要添加 ,否则会使用默认的端口号(22)
阅读全文
摘要:把下载的.cgi登陆文件用文本编辑器打开,修改端口 用管理员权限打开.cgi才能绑定端口 $ gksu nautilus # browse files as root$ gksu gedit /etc/fstab # edi...
阅读全文
摘要:!clear for Unix-like systems !CLS for Windows
阅读全文
摘要:`!clear` for Unix like systems for Windows
阅读全文
摘要:`sorted(A LIST)`会返回一个新的 object ,不改变 A LIST 本身。 会直接改变 A List ,不产生新的 object 。
阅读全文
摘要:sorted(A-LIST)会返回一个新的object,不改变A-LIST*本身。 A-LIST.sort()会直接改变A-List,不产生新的object**。
阅读全文
摘要:DataFrame.sample(n=None, frac=None, replace=False, weights=None, random_state=None, axis=None)[source] n : int, optional Numb...
阅读全文
摘要:`DataFrame.sample(n=None, frac=None, replace=False, weights=None, random_state=None, axis=None)[source]` n : int, optional Number of items from axis t
阅读全文
摘要:

阅读全文
摘要:print ('%10s'%('test'))print ('{:10}'.format('test'))#left-alignedprint ('{:10}'.format('test'))# defaut(right-aligned)print ('{...
阅读全文
摘要:``` print ('%10s'%('test')) print ('{:10}'.format('test')) left aligned print ('{:10}'.format('test')) defaut(right aligned) print ('{:_
阅读全文
摘要:安装 sudo apt-get install vnc4server 修改配置文件 sudo vim ~/.vnc/xstartup #!/bin/sh# Uncomment the following two lines for normal d...
阅读全文
摘要:全程在root下进行 安装x11vnc sudo apt-get install vino vinagre x11vnc 设置密码 sudo x11vnc -storepasswd sudo x11vnc -storepasswd in /e...
阅读全文
摘要:全程在root下进行 安装x11vnc 设置密码 配置开机自启动 输入以下内容: 其中端口号 5900 可以改成别的。 重启计算机 远程访问 安装 VNC Viewer ,输入IP地址::5900,再输入密码,可以了。
阅读全文
摘要:`a = [1,2,3,4,5,6,7,8,9,10]` = = 包含开头, 不包含 结尾。 : 从头一直到最后一个元素 , 但不包含最后一个元素 。 Python这样做的原因是: `word[2:] 除了前两个,其他全部选取`
阅读全文
摘要:a = [1,2,3,4,5,6,7,8,9,10] a[0:1] = [1] a[0:2] = [1,2] 包含开头,不包含结尾。 a [:-1]: 从头一直到最后一个元素a[-1],但不包含最后一个元素。 Python这样做的原因是: wor...
阅读全文
摘要:subplot(arg1, arg2, arg3) arg1: 在垂直方向同时画几张图 arg2: 在水平方向同时画几张图 arg3: 当前命令修改的是第几张图 t = np.arange(0,5,0.1)y1 = np.sin(2*np.pi*t)y...
阅读全文
摘要:`subplot(arg1, arg2, arg3)` : 在垂直方向同时画几张图 : 在水平方向同时画几张图 : 当前命令修改的是第几张图
阅读全文
摘要:Pylab combines the functionality of pyplot with the capabilities of NumPy in a single namespace, and therefore you do not need to import NumPy separat
阅读全文
摘要:Pylab combines the functionality of pyplot with the capabilities of NumPy in a single namespace, and therefore you do not nee...
阅读全文
摘要:Figure is the object with the highest level in the hierarchy. It corresponds to the entire graphical representation and gen...
阅读全文
摘要:Figure is the object with the highest level in the hierarchy. It corresponds to the entire graphical representation and generally can contain many Axe
阅读全文
摘要:随机产生0~7之间的 整数 , 不包含7 。 随机从 中产生5个数,放入一个 list 。 从 中随便挑选一个元素。 对 中的元素进行重新洗牌。洗牌之后 中元素的排列顺序随机发生变化 。
阅读全文
摘要:random.randrange(1,10) 随机产生0~7之间的整数,不包含7。 random.sample(range(100), 5) 随机从range(100)中产生5个数,放入一个list。 random.choice() possib...
阅读全文
摘要:Pythonsorted()函数中可以加入key=参数。作用是每个元素在排序之前,先作为key=中FUNCTION的参数,用FUNCTION的输出结果作为依据来排序。 print (sorted("This is a test string from D...
阅读全文
摘要:Python 函数中可以加入 参数。作用是每个元素在排序之前,先作为 中 FUNCTION 的参数,用 FUNCTION 的输出结果作为依据来排序。 输出结果: 这里定义了一个 的函数。把一个 list 作为输入参数 student ,返回list中的第1个元素 。
阅读全文
摘要:拆开Tuple 交换位置 使用 Tuple 可以方便的交换两个数的位置,不用设临时变量。
阅读全文
摘要:拆开Tuple lax_coordinates = (33.9425, -118.408056)latitude, longitude = lax_coordinates # tuple unpacking 交换位置 variable = (10,2...
阅读全文
摘要:class aTest: def __repr__(self): return "This is an aTest class."a = aTest()print (a)class bTest: passb = bTest()pr...
阅读全文
摘要:The first thing to know about special methods is that they are meant to be called by the Python interpreter, and not by you. You don’t write my_object
阅读全文
摘要:The first thing to know about special methods is that they are meant to be called by the Python interpreter, and not by you. Yo...
阅读全文
摘要:a class with an abstract method cannot be instantiated (that is, we cannot create an instance by calling it) unless all of it...
阅读全文
摘要:a class with an abstract method cannot be instantiated (that is, we cannot create an instance by calling it) unless all of its abstract methods have b
阅读全文