Archive for ‘Default’ Category

25
Dec

http authentication

some information about http authentication :

As for authentication, the HTTP protocol includes the basic access authentication and the digest access authentication protocols, which allow access to a Web page only when the user has provided the correct username and password. If the server requires such credential for granting access to a Web page, the browser [...]

14
Dec

解决Skype在Ubuntu下无声的方法

Ubuntu 用起来一直挺顺手,只是声卡独占也让人很是恶心,貌似8.10后有所改善.之前在8.04中Skype一直没法出声,昨天做了次升级,再加上一点点设置,现在Skype也能正常出声了,感觉不错.设置如下:
系统声音设置:

Skype设置:

15
Nov

隐藏Firefox右键多余菜单

#context-back,
#context-forward,
#context-reload,
#context-stop,
#context-sep-stop,
#context-bookmarkpage,
#context-savepage,
#context-sendpage,
#context-sep-viewbgimage,
#context-openlink,
#context-sep-open,
#context-bookmarklink,
#context-sendlink,
#context-sep-copyimage,
#context-sendimage,
#context-setWallpaper,
#context-printpage,
#context-smartsearch
{ display: none !important; }

09
Nov

change mysql characters to utf8

raecoo@laptop:~$ mysql -uroot -p
mysql> show variables like ‘character%’;
+————————–+—————————-+
| Variable_name | Value |
+————————–+—————————-+
| character_set_client [...]

03
Nov

design elements of next generation web 2.0 application


31
Oct

how to store user picture in the file system

一个好的文件存储结构不但使用、维护方便,关键是调用方便。
废话少说,直接上菜,厨子开始干活 :)
假设用户上传一个头像,系统为其生成大小不同的三种缩略图,并以用户ID做为目录名称,格式如下:
public/images/users/86799/raecoo.gif (原图)
public/images/users/86799/raecoo-big.gif
public/images/users/86799/raecoo-medium.gif
public/images/users/86799/raecoo-thumb.gif
这样的做法在系统规模较小的时候是没什么问题的,但随着用户数量的增加,这样的存储结构肯定是个隐患。下面介绍一种可容纳大规模存储的解决方案,当然这不一定是最好,也不一定适合你 :)

09
Oct

how to use ruby invoke remote url

调用远程URL接口的通用方法,临时封装的,还不完善,仅供参考,相信封装完善后将是一个不错的Libary,其实RESTFul的远程也类似这样,但Rails自己封装的肯定比这个要成熟的多,抽空也Copy一个出来,记录在此

require ‘net/http’
require ‘net/https’
require “singleton”
require “erb”
def invoke_remote
RemoteHttp.instance
end
class RemoteHttp
include Singleton
def call(host,url,request_type,params={})
http = Net::HTTP.new(host)
response, data = http.get(host+url, nil)
puts ‘—————————————————-’
puts response
puts ‘—————————————————-’
puts data
puts ‘—————————————————-’
end
end
invoke_remote.call(’http://www.p1.cn’,'/raecoo’,”,{})

19
Sep

Multiple Attachments in Rails

Download Demo , Reference at here

18
Sep

very interesting describe about Chinese developer

看到一段描述国内开发者特点的言论,感觉比较靠谱,至少我可以算是这类人,看起来要努力改进,在此做个记号.
中国开发者的一个大的特点就是对技术痴迷的同时不食人间烟火,整天津津乐道的就是那些算法、数据结构、设计模式、语言技巧、技术规范,对于普通老百姓关心的东西一概没有兴趣。我们中的大部分人对于时尚、化妆品、小资情调嗤之以鼻,对于电影、音乐、艺术、美食一知半解,对于地产、金融、法律知识一窍不通,对于一个普通老百姓市场生活中所能遇到的困难和问题,所追求的那一点享受和乐趣不闻不问,既不愿意亲身实践,更在主观心态上予以拒斥。
策划产品的时候全凭感觉,结果呢,做出来的东西千篇一律,看上去什么都有,一用起来处处不贴心。究其根源,就在于我们太专业,把太多的时间用来围着电脑转,根本上缺少对于生活和需求的深刻体察,对于人的关怀。

18
Sep

each code for Http status

http各个状态码含义
1**:请求收到,继续处理
2**:操作成功收到,分析、接受
3**:完成此请求必须进一步处理
4**:请求包含一个错误语法或不能完成
5**:服务器执行一个完全有效请求失败
100 Continue 初始的请求已经接受,客户应当继续发送请求的其余部分。(HTTP 1.1新)
101 Switching Protocols 服务器将遵从客户的请求转换到另外一种协议(HTTP 1.1新)
200 OK 一切正常,对GET和POST请求的应答文档跟在后面。
201 Created 服务器已经创建了文档,Location头给出了它的URL。
202 Accepted 已经接受请求,但处理尚未完成。

    About

    Tag Cloud