方法一
dd if=/dev/zero of=/dev/sdb bs=512 count=2
方法二
parted /dev/sdb mklabel gpt
参考:
http://unix.stackexchange.com/questions/167500/using-dd-to-zero-a-gpt-table-from-disc-how-many-bytes-to-write
方法一
dd if=/dev/zero of=/dev/sdb bs=512 count=2
方法二
parted /dev/sdb mklabel gpt
参考:
http://unix.stackexchange.com/questions/167500/using-dd-to-zero-a-gpt-table-from-disc-how-many-bytes-to-write
“In C++ or C#, when we’re talking about objects, we’re referring to instances of classes or structs. Objects have different properties and methods, depending on which templates (that is, classes) they are instantiated from. That’s not the case with JavaScript objects. In JavaScript, objects are just collections of name/value pairs – think of a JavaScript object as a dictionary with string keys.”
摘录来自: Manuel Kiessling. “The Node Beginner Book”
自己在 node 中尝试
> var handle = {}
undefined
> handle["/"] = 'aaa';
'aaa'
> handle["/start"] = 'aaa/start';
'aaa/start'
> handle["/upload"] = 'aaa/upload';
'aaa/upload'
> handle
{ '/': 'aaa',
'/start': 'aaa/start',
'/upload': 'aaa/upload' }
> typeof(handle)
'object'
Model-View-Controller
CodeIgniter is based on the Model-View-Controller development pattern. MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.
The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your database.
The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of “page”.
The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
about() 的函数。在调试代码的时候要分析 block
可以用 sleep 使程序 block 一段时间
#!/usr/bin/python import time print "Start : %s" % time.ctime() time.sleep( 5 ) print "End : %s" % time.ctime()
写变量到文件
$myfile = fopen("./testfile.txt", "w");
$txt = "Jane Doe\n";
fwrite($myfile, $txt);
fwrite($myfile, $query);
fclose($myfile);
snippet
import datetime
yesterday = datetime.datetime.now() - datetime.timedelta(days=1)
yesterday_formatted = yesterday.strftime("%Y-%m-%d")
python 生成时间戳
import time now = int(time.time())