`
iunknown
  • 浏览: 404442 次
社区版块
存档分类
最新评论
文章列表
在 spdatapickle 项目中,实现了在 C 的 structure 和 xml/json 之间自动转换的功能。需要选择一种 xml/json 的格式。在查看了一些其他语言的实现之后,json 的格式比较一致,xml 的格式就五法八门。不过从这里也可以看出,xml 能用的方法实在太多,太灵活了。json 的定义更接近于编程语言,格式就比较一致。xml 用于序列化数据的格式,比较著名的有 xmlrpc 。xmlrpc 的格式,冗余实在太大,并且还丢失了很多的信息。在 spdatapickle 中,仿照 json 设计了一套格式,比起 xmlrpc 少一些冗余。json 的格式倒是不用怎么设计 ...
把之前发表过的一篇文章贴到自己 blog 中,便于查看。 在 SPServer 中实现了 HSHA 和 LF 两种线程池。 目前的实现还是比较可读的,这两种线程池最主要的处理逻辑各自都被集中到了一个函数中。 先来看看 HSHA 的核心实现代码 htt ...
http://woolzey.bokee.com/6749370.html 前Unicode时代 在Unicode出来,我们最熟悉的编码是ASCII。ASCII严格的说是一个7位的英语 编码标准,定义了33个控制字符和95个可显示字符。第8位留作奇偶校验,但是 通常都置为0。 ASCII只适用于英语 ...
把 spdatapickle 移植到 win32 平台,使用 vc6 进行编译。在编译示范例子的时候,第一步需要调用代码生成工具根据 xml 生成一些代码。这个步骤在 makefile 中很容易实现,但是在 vc6 中,试了好久才终于试验成功。记录一下步骤
memcached 没有官方的 windows 发布版本,只有一些第三方的开发人员在发布 windows 的版本。在 windows 平台编译 memcached 也比较麻烦。 之前为了测试的目地,基于 spserver 和 spdict 实现了一个 memcached 的克隆版本 -- spcached。 http://iunknown.iteye.com/blog/80095 最近有人建议把这个项目完善一下,主要是增加 vc6 的项目文件,使得这个项目能够在 windows 平台上顺利地编译。 经过整理之后,现在发布出来,里面带了 vc6 的项目文件,在 vc6 下面能够顺利地编译。 ...
socat 类似 telnet ,但是支持多种协议。 比如要 debug unix domain socket 的 server ,用下面的命令就可以得到和 telnet 一样的效果。 bash$ ./socat unix-connect:/tmp/my.sock stdin
http://acronyms.thefreedictionary.com/SP SP Speed SP Spanish SP Service Pack SP State Police SP Security Police SP Standard Play(ing) SP Shore Patrol (US Navy equivalent to MP) SP Slave Present (hard disk) SP Shore Police SP Spelling Unsure SP Support SP Space SP Specific SP Spain (Including Baleari ...
google 的 protobuf 项目,底层的二进制格式设计很精简,格式的详细描述参考下面的链接: http://code.google.com/apis/protocolbuffers/docs/encoding.html 下载链接 http://spjson.googlecode.com/files/spjson-0.3.src.tar.gz 暂时是作为 spjson 的一部分。 这个格式被 google 才称为 wire format ,实质是一个用于保存 key/value 对的二进制格式。 key 被称为 fieldNumber 。 value 分为几种类型:varint,64b ...
这个 macro 是这样的 #define return for( printf("return %s %d\n",__FILE__,__LINE__); ; ) return 对于 C/C++ 程序来说,使用上面的 macro ,可以把函数的返回位置输出到屏幕。 使用的场景:需要调试具有多出口的 C/C++ 函数,并且原有的代码在返回的位置都没有任何日志或者特殊的标志值。这个 macro 的特点在于可以同时应付 return value 和 return 的情况。
之前一直使用 cprof 来分析 c/c++ 程序的性能瓶颈,可惜在 2.6 内核 + 多线程的情况下, cprof 貌似不工作了。无奈之下,使用 gettimeofday 来人肉分析。为了方便,写了这样一个类 class SP_NKClock { struct timeval mBornTime; struct timeva ...
Sounds impressive and cool. I wonder about Table engine performance though. My experiences with Berkeley DB (using the native C API) were positive, from a performance point of view, largely because BDB has no built-in query support. When I wanted to look something up, and I had no index on the desire ...
http://ayende.com/Blog/archive/2008/08/07/Multi-Tenancy--The-Physical-Data-Model.aspx Continuing on the multi tenancy theme, let us talk about the actual physical structure of the data store. In general, you have two basic options. The TenantId column and separated data stores. The TenantId is simp ...
http://kered.org/blog/2006-05-24/summer-of-code/ Additionally, it supports the following: automatic downgrades are supported (in addition to upgrades) the application can automatically identify a schema without a ’schema version’ table the application can verify the accuracy of a schema multiple sc ...
用 google 查了一下 sqlite server ,查到了一个有趣的项目。 http://planet.mysql.com/entry/?id=17507 引用 There, now you make any SQLite database look like a Drizzle or MySQL server. The sqlite_server program is about 400 lines and only uses libsqlite3 and libdrizzle. 看来,以后要做一个 mysql 兼容的 server 也很容易了。
在 share nothing 的架构中,如果数据规模很大,为了提高可用性,通常采用数据库分片(database sharding)的策略。常见的分片策略是按主键把数据分散到不同的数据库中。在使用常规的 RDBMS 的场景中,分片策略中使用的数据库个数通常在100以下。在某些特殊的场景中,可能希望采用更极端的分片方法,比如在类似地址本这种应用中,可以为每个用户创建一个数据库。 SPHiveDB 就是为这种极端的分片方法而实现的一个数据库服务器。SPHiveDB 基于 sqlite ,用 JSONRPC over HTTP 为 sqlite 提供了网络访问接口。为了能够支持大量的数据库实例,SP ...
Global site tag (gtag.js) - Google Analytics