Cheese Is Power

Knowledge is power, to make others feel stupid.

2014年12月8日 #

[Python] Pitfalls: Be Careful with os.chdir

摘要: One thing you need to keep in mind is that when using os.chdir to change the working directory of current programme (script), make sure if we need to ... 阅读全文

posted @ 2014-12-08 14:04 Hjärtat 阅读(388) 评论(0) 推荐(0) 编辑

2014年11月19日 #

Changing the Color of Linux ls Command 改变Linux的ls命令显示的颜色

摘要: Linux command ls basically use the file /etc/DIR_COLORS or /etc/DIR_COLORS.xterm to define the colors used, in terms of different types of terminal wi... 阅读全文

posted @ 2014-11-19 16:55 Hjärtat 阅读(239) 评论(0) 推荐(0) 编辑

2014年10月27日 #

[Django] Setting up Django Development Environment in Ubuntu 14.04

摘要: 1. PythonOf course you will need Python. Still Python 2.7 is preferred, however if you would like to create new projects with Python 3, it is also fin... 阅读全文

posted @ 2014-10-27 13:39 Hjärtat 阅读(219) 评论(0) 推荐(0) 编辑

2014年3月23日 #

[ImportNew] Perforce - Restoring Mistakenly Deleted Files in Workspace

摘要: Shit happens when you accidentally delete some files in your workspace and you have no ideas which one is deleted. One way to find them is to use 'p4 diff' command.p4 diff -sdThis will show only the names of unopened files that are missing from the client workspace, but present in the depot. 阅读全文

posted @ 2014-03-23 16:01 Hjärtat 阅读(290) 评论(0) 推荐(0) 编辑

2013年11月27日 #

[Python] Pitfalls: About Default Parameter Values in Functions

摘要: Today an interesting bug (pitfall) is found when I was trying debug someone's code. There is a function which tries to check if an object exists or not. It has several parameters and some of them have default value. When using this function, the programmer intended to give some values to some ce 阅读全文

posted @ 2013-11-27 19:54 Hjärtat 阅读(690) 评论(0) 推荐(0) 编辑

2013年10月22日 #

[SystemC] Setting Up the Environment

摘要: My operating system is Ubuntu 12.04.0. Checking Your CompilersFirst thing first, you will need the tools beforing making stuffs.Type "g++ --version" to check if you have g++, if not use "sudo apt-get install g++" to install it first. (Fedora users can use command "yum") 阅读全文

posted @ 2013-10-22 02:36 Hjärtat 阅读(720) 评论(0) 推荐(0) 编辑

2013年7月25日 #

SNMP–Simple Network Management Protocol

摘要: I am planning to write an introduction and simple implementation of SNMP in software, when my work with the SNMP agent simulation is done. There is a good brief introduction video on YouTube (too bad... 阅读全文

posted @ 2013-07-25 20:17 Hjärtat 阅读(166) 评论(0) 推荐(0) 编辑

2013年7月23日 #

To Use FTP Command in Linux

摘要: Yesterday I was asked to upload a file in Linux to the corresponding server. I said “oops” because I never used that in Linux shell, we used Filezilla in Windows for such purpose of task. Therefore th... 阅读全文

posted @ 2013-07-23 13:20 Hjärtat 阅读(169) 评论(0) 推荐(0) 编辑

2013年7月17日 #

[Python] Removing a non-empty folder

摘要: Removing a non-empty folderYou will get an ‘access is denied’ error when you attempt to use1 os.remove(“/folder_name”)to delete a folder which is not empty. The most direct and efficient way to remove non-empty folder is like this:1 import shutil2 shutil.rmtree(“/folder_name”)Of course you have othe 阅读全文

posted @ 2013-07-17 19:29 Hjärtat 阅读(472) 评论(0) 推荐(1) 编辑

2013年7月11日 #

Notes for Studying Django

摘要: Once you added a new application to INSTALLED_APPS, the database tables need to be updated, thus you need to run python manage.py syncdb. Normally the server auto-reloads code every time you mod... 阅读全文

posted @ 2013-07-11 23:57 Hjärtat 阅读(130) 评论(0) 推荐(0) 编辑

导航