`
文章列表
1. 通过telnet以命令行的方式访问memcached服务器:     telnet host port.eg:telnet 127.0.0.1 11211 2. 退出memcached命令行: quit 3.查看memcached实例的状态:.stats 4. 查看slab: stats slabs 5. 查看item:stats items 6. 查看slab中存储的items:stats cachedump [slab ID] [number of items, 0 for all items]. eg:stats cachedump 1 0
记录下工作中常用的linux命令。 查询某个进程的运行时间:ps -o %t -p pid 复制所有文件:(cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xpvf -) 按连接数查看客户端IP:netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr 查找特定日志文件中的关键字。例如:查询service.log中的warning日志:find . -name 'service.log' | ...
本周在写ftp数据同步脚本的时候,查找资料,发现一篇写sort的blog写得很赞,收获很大。 地址为:http://roclinux.cn/?p=1472 版权属原作者,也在此表示感谢。
查看linux的发行版(RedHat、ubuntu、suse...)及版本号的方法: lsb_release -a cat /etc/issue uname -a cat /proc/version
  今天在用Junit进行单元测试的时候,遇到一个诡异的问题。测试代码如下: Java类:Calculate.java public class Calculate { public int sum(int var1, int var2) { System.out.println("Adding values " + var1 + " + " + var2); return var1 + var2; } public int subtract(int var1,int va ...
一、Memcache介绍         memcache是一款高性能、分布式的内存对象缓存系统。最初用于通过减轻数据库的负载来提升动态web应用程序的性能。详细介绍可参考官网:http://memcached.org/  目前工作中使用的memcache是公司的memcache集群,通过xmemcached(memcache客户端的java实现之一)和memcache集群交互。今天在自己的机器上试着安装和使用memcache,记录如下。   二、环境         操作系统:Ubuntu 14.04.1    三、步骤         1、因为memcache依赖于lib ...
    First of all,python strings can not be changed,because they are immutable. String escape 'Isn\'t,he said' "Isn\"t,he said"   more readable string     print("Isn\"t,he said")  do not want to escape print(r'C:some\name')    String concatenating ...
Confusion A common error in JavaScript programs is to use an object when an array is required or an array when an object is required. The rule is simple: when the property names are small sequential integers, you should use an array. Otherwise, use an object.   how to distinguish between array ...

Adapter

Adapter Intent   Convert the interface of a class into another interface that clients expect.Adatper let classes work together that couldn't otherwise because of incompatible interfaces. Applicability   Use Adapter pattern when 1)you want to use an existing class,and its interface does not match ...
                        Strategy pattern Definition:    The strategy pattern defines a family of algorithms,encapsulate each one,and makes them interchangeable.Strategy lets the algorithm vary independently from clients that use it.Whereby an algorithm's behaviour can be selected at runtime. Intent ...
Global site tag (gtag.js) - Google Analytics