1、格式化字符串操作String.prototype.format = function(args)
{ if (arguments.length>0) { var result = this; if (arguments.length == 1
&& typeof (args) == "objec...
分类:
编程语言 时间:
2014-05-12 04:17:43
阅读次数:
314
把对象当参数传递给方法,在方法里改过对象后,影响到外面的对象
因为对象是引用传递过去的class Book { public $name; public function __construct($name) {
$this->name = (string)$n...
分类:
Web程序 时间:
2014-05-12 03:34:37
阅读次数:
386
工作中有时需要对DNS数据包进行解析,抽取出其中的Qurey
Name和Answer中的IP地址,今天写了一个简单的脚本分析PCAP包中的DNS,用到了dpkt模块。我只抽取了关键的Query
Name和Answer中的IP地址,没有解析授权和额外信息。如果不想写脚本,可以使用tshark工具(wi...
分类:
编程语言 时间:
2014-05-12 03:21:23
阅读次数:
939
SimpleDateFormate sdf = new
SimpleDateFormate("yyyy-MM-dd HH:MM:ss");String s =
sdf.format(Date)然后这个s输出时的月份老是不对后来看了一下API"yyyy-MM-dd HH:MM:ss"这段室友讲究的M代...
分类:
编程语言 时间:
2014-05-12 03:05:56
阅读次数:
249
简单的一个curl小例子:#include #include #include #include
#include #define BUF_SIZE 1024 * 100using namespace std;string
DownloadString(char* url);int main(int...
分类:
Web程序 时间:
2014-05-12 02:55:46
阅读次数:
394
我们经常为用到Integer.valueOf(String
str)这个方法,如果字符串格式不对,这个方法会抛出一个系统异常NumberFormatException
这里我们就要分析一下这个方法,其中Byte,Short也是调用了Ingeter中的方法. 在Integer类中的定义如下: publ...
分类:
编程语言 时间:
2014-05-12 01:59:15
阅读次数:
395
原题地址:http://oj.leetcode.com/problems/sum-root-to-leaf-numbers/题意:Given
a binary tree containing digits from0-9only, each root-to-leaf path could
repre...
分类:
编程语言 时间:
2014-05-12 01:28:30
阅读次数:
440
最近实现了一个string类,添加了一些c++11元素。除了基本的构造析构函数,拷贝构造和赋值函数,另外添加移动拷贝和赋值函数。default是一个很方便的特性有木有。
//default constructorKianString()=default;KianString(const char *...
分类:
其他好文 时间:
2014-05-12 01:14:09
阅读次数:
347
上传图片,将图片名称插入到数据表中 protected void
btnSend_Click(object sender, EventArgs e) { string Name = txtName.Text; string
pictureName = fupP...
分类:
数据库 时间:
2014-05-12 01:04:51
阅读次数:
293
1.安装 PythonPython 的版本很多,本例中选择 Python 2.7,安装这个版本的
Python 可以直接使用自带的数据库 SQLite(没听过,在这就不使用了)。你可以从Python 官网下载 Python,但你要知道在景德镇访问不了
Python 官网是很正常的(GFW赢了),所以...
分类:
编程语言 时间:
2014-05-12 01:03:53
阅读次数:
396