Avatar_small

rails cache managment

Rails 自身提供四种缓存方式,即 Page Cache, Action Cache,Fragment Cache 和 ActiveRecord Cache 这三种缓存。Page Cache 是最高效的缓存机制,他把整个页面以静态页面 HTML 的形式进行缓存,这对于不会经常发生变化的页面是非常有效的。Action Cache 是对某个 action 进行缓存,与 Page Cach...

Avatar_small

Programming C#

1 课业要求 2 Mono 3 Sqlite 4 ASP.NET 5 C# 6 Learning Resources 1 课业要求 这半年有一门《C#程序设计》的课程,借着这个契机,匆匆学了下C#,并做了一个极其...

Avatar_small

抄录(Verbatim)

对于程序猿而言,如果使用 ConTeXt 进行文档排版,那么它提供的 type 和 typing 机制在程序代码抄录(程序代码排版)方面较为出色。

Avatar_small

python中的陷阱(1)

d = {} 与 d.clear() 的区别 在工作中我想实现一个这样的效果: 在循环中把一个字典的不同状态值加入到list里面去,可是这个结果一致很异常。 看下面的问题代码: In [1]: l = [] In [2]: p = {} In [3]: for i in xrange(5): ...: p.clear() ...

Avatar_small

CentOS下CVS配置

由于实验室的项目需要进行版本控制,正好有台空闲的CentOS,可以拿来作服务器,于是就搞了一下,配置过程如下: 环境: OS:CentOS 5.5 Kernel:Linux hit-centos 2.6.18-194.32.1.el5 #1 SMP CVS Version:Concurrent Versions System (CVS)...

Avatar_small

Windows屏幕飘雪

#include <windows.h> #include <stdlib.h> #define UNICODE //使用UNICODE字符 #define _UNICODE #define ID_TIME 1 #define NUMOFSNOW 214 //雪花数量 typedef struct tagSNOW { POIN...

Avatar_small

Ubuntu下声卡不发声解决方案一例

刚装的ubuntu 10.10没有声音,google了一下,照如下步骤走了一遍,问题解决,现将方法粘贴如下: 去除系统自带声音模块 sudo apt-get –purge remove linux-sound-base alsa-base alsa-utils 重新安装,并安装最新模块: sudo apt-get install linux...

Avatar_small

linux系统管理命令小集

如果想要同步linux的两个目录的内容,当然这两个目录可以是不同机器的,可以使用如下命令: rsync -avz ./fvwm-2.4.20/ ./fvwm 其中:srcdir为./fvwm-2.4.20 和 destDir为./fvwm 查看目录的大小: du -h /software/fvwm/ linux下压缩的文件到windows下解压后,...

Avatar_small

一个查看阴历的小工具

接着上一篇liblunar的日历bug问题,这里写了一个查询月份的工具,代码比较简陋 /* * author:pallover#gmail.com * website: http://pallove.is-programmer.com/ */ #include <lunar/lunar.h> #include <stdio.h> ...

Avatar_small

透明联合类型

一般情况下,在C语言中,函数指针定义时就会说明其指向的函数的参数情况以及返回值类型,比如以下定义: void (*func_p)(int a); 以上代码就声明了一个函数指针func_p,其指向的函数的返回值类型为void类型,即没有返回值,并且该函数有且只有一个int类型的参数。 那有没有方法使得函数指针能够指向参数类型不同的函数呢?事实上,在gc...

Avatar_small

Archlinux Essay Series: sync

Synchronization is made so simple and flexible by archlinux that one can easily be addict to it, like me. It's even more convinent than apt-get which is already trival. Unlike what...

Avatar_small

Archlinux Essay Series: mirrorlist

Mirrorlist is the repository via which the pacman utility helps us keeping software installed in our system synced with the remote maintained server source. I choose 163, which is stable and f...

Avatar_small

Archlinux Essay Series: sudo

Furthermore, it's unsafe to expose root frequently. For another reason, entering and exiting super user mode is a little bit annoyous. That's why sudo comes to make thing smoot...

Avatar_small

Archlinux Essay Series: su

Think like god, while live like citizen. It's true that god has got more power to do thing that common human beings can't do. But also keep in mind the two-edged blade means th...

Avatar_small

Archlinux Essay Series: hostname

Hostname is what we call the body where the spirit of our MATRIX lives. I choose jeffrey-NB in which NB stands for NoteBook~:-) It's in /etc/rc.conf file. The initial setup OS ha...