现在位置: 首页 > hjsh2005发表的所有文章
  • 10月
  • 02日
综合 ⁄ 共 1906字 评论关闭
一、sed命令行语法         sed [-n] [-e] 'command' file(s)         sed -f scriptfile files(s) 二、sed命令语法         [address[, address]] [!] command [arguments] 2.1 模式寻址         1. 地址:                 可以是一个行号;                 或者是由斜杠包含着的一个模式(/pattern/),模式由正则表达式描述。         2. 大括号{},分组命令:                 用于地址的嵌套或者对同一个地址应用多个命令。                 [/pattern/[, /pattern/]]{                   command1                   comman......
阅读全文
  • 06月
  • 10日
综合 ⁄ 共 45字 评论关闭
http://jsonclassgenerator.codeplex.com/ 厉害的不行啦
阅读全文
美国人占世界人口的5%,却使用了世界上20%的资源、食用了15%的肉类、制造出了40%的垃圾            尽管这些数字让人印象深刻,但是却很难让人有一个具体的认识。也许你会这么想:好吧,美国人是会每年吃掉100亿只动物并且扔掉160亿的塑料袋,那又会怎样?     在今天的图表上,作者是博主兼记者Tim De Chant,把这个问题转换成了更有意义的形式,而他使用的方法就是提出并且找出这个问题的答案:“如果所有人都像美国人这样生活世界会变成什么样?”     为了制作图表,De Chant开始时先研究了2011年的全球生态足迹网络从而来估......
阅读全文
  • 04月
  • 02日
综合 ⁄ 共 3128字 评论关闭
From: http://blog.163.com/zhangjie_0303/blog/static/990827062012718316231/   Nagle算法 TCP_NODELAY和TCP_CORK Nagle算法根据创建者John Nagle命名。该算法用于对缓冲区内的一定数量的消息进行自动连接。该处理过程 (称为Nagling),通过减少必须发送的封包的数量,提高了网络应用 程序系统的效率。Nagle算法 ,由Ford Aerospace And Communications Corporation Congestion Control in IP/TCP internetworks(IETF RFC 896)(1984)定义,最初是用于缓冲Ford的私有TCP/IP网络拥塞情况,不 过被广泛传播开来。 Nagle的文档定义了......
阅读全文
  • 01月
  • 20日
综合 ⁄ 共 2314字 评论关闭
Sum It Up Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3984    Accepted Submission(s): 2055 Problem Description Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1], then there are four different sums that equal 4: 4,3+1,2+2, and 2+1+1.(A number can be used within a sum as many times as it appears in the li......
阅读全文
  • 01月
  • 12日
综合 ⁄ 共 1159字 评论关闭
  Parentheses Balance  You are given a string consisting of parentheses () and []. A string of this type is said to be correct: (a) if it is the empty string (b) if A and B are correct, AB is correct, (c) if A is correct, (A) and [A] is correct. Write a program that takes a sequence of strings of this type and check their correctness. Your program can assume that the maximum string length is 128. Input  The file contains a positive integer n and a sequence of n strings of parenthese......
阅读全文
  • 12月
  • 13日
综合 ⁄ 共 1720字 评论关闭
  动态数组也是一个常用的集合类,stl 中的 vector、util 中的 ArrayList 就是动态数组。 一 ArrayList 添加操作的平均复杂度是 O(1)   ArrayList 中使用成员数组 Object[] elementData 存储数据,还有一个成员变量 int size 表示数组中存储的数据的个数,elementData[0..size-1] 存储着 size 个数据。 size <= elementData.length,当有必要扩大数组容量时,就要给 elementData 重新申请空间,并将原来所有的数据拷贝到新数组中。   看起来好像 ArrayList 添加元素的时间复杂度会很挫,但实际上 n 次 add 操作的平均复杂......
阅读全文
  • 12月
  • 11日
综合 ⁄ 共 1580字 评论关闭
先决条件 1.安装apport(automatically generate crash reports for debugging) 2.修改/etc/security/limits.conf文件,使允许core dump,或者用ulimit -c unlimited设置core dump文件的大小为unlimited 3.C/C++的编译开关-g(产生调试符号) ######运行编译好的程序testc(我的程序) kimi@kimi-desktop:~/testc/bin/Debug$ ./testc ######下面一行显示了core dumped表示成功,core文件在/var/crash或者在当前目录 段错误 (core dumped) kimi@kimi-desktop:~/testc/bin/Debug$ ls ######果然在当前目录 core tes......
阅读全文
  • 12月
  • 04日
综合 ⁄ 共 1951字 评论关闭
  关系数据库中的关系必须满足一定的要求。满足不同程度要求的为不同范式。数据库的设计范式是数据库设计所需要满足的规范。只有理解数据库的设计范式,才能设计出高效率、优雅的数据库,否则可能会设计出错误的数据库. 目前,主要有六种范式:第一范式、第二范式、第三范式、BC范式、第四范式和第五范式。满足最低要求的叫第一范式,简称1NF。在第一范式基础上进一步满足一些要求的为第二范式,简称2NF。其余依此类推。 范式可以避免数据冗余,减少数据库的空间,减轻维护数据完整性的麻烦,但是操作困难,因为需要联系多个表才能......
阅读全文
  • 12月
  • 03日
综合 ⁄ 共 4838字 评论关闭
在Oracle中建库,通常有两种方法。一是使用Oracle的建库工且DBCA,这是一个 图形界面工且,使用起来方便且很容易理解,因为它的界面友好、美观,而且提示也比较齐全。在Windows系统中,这个工具可以在Oracle程序组中打 开(”开始”—“程序”—“ Oracle - OraDb10g_home1”—“Configuration and Migration Tools”—“ Database ConfigurationAssistant”),也可以在命令行 (”开始”—“运行”—“cmd”)工具中直接输入dbca来打开。另一种方法就是手工建库,这也就是下面所要讲的内容。 手工建库比起使用DBCA建库来说,是比较麻烦的,但是如果我......
阅读全文
  • 11月
  • 13日
综合 ⁄ 共 5379字 评论关闭
<struts-config>是struts的根元素,它主要有8个子元素,DTD定义如下:<!ELEMENT struts-config (data-sources?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*) > 以上8个元素,下面一一描述:1. date-sources元素  date-sources元素用来配置应用程序所需要的数据源。java语言提供了javax.sql.DateSource接口,所有数据源必须实现该接口。如下配置: <data-sources>   <data-source type="org.apached.commons.dbcp.BasicDataSource"> ......
阅读全文
  • 10月
  • 13日
综合 ⁄ 共 8060字 评论关闭
Android Asynchronous Http Client A Callback-Based Http Client Library for Android   Tweet Downloadversion 1.4.2 (latest) or fork me on github Overview An asynchronous callback-based Http client for Android built on top of Apache’s HttpClient libraries. All requests are made outside of your app’s main UI thread, but any callback logic will be executed on the same thread as the callback was created using Android’s Handler message passing. Features Make asynchronous HTTP requ......
阅读全文