3521 views | 2009/11/24
我在CSDN上分享了很多东西,一直想把那个列表也在博客上罗列一个,一直就没有付诸于行动,昨天一发狠,终于弄了。
等于昨天几个小时,今天几个小时,搞出了一个小插件。就是右侧的一个小挂件。点上去就会链到CSDN的下载页面。
算是我把一年前的债还了。真开心。
插件里面没什么技术含量,就是小小调用了一下Google Feed API。
做这个插件,也引发了我一个思考。
能否在页面的head部分,就知道这个页面会装载哪些Widget呢?昨天折腾了半天,也没有解决这个问题。
解决的好处是显而易见的,现在的Widget,大多数都需要js来辅助了。但是很多高端的主题有数个sidebar,每页不同,如果Widget开发者,为了符合Web标准,把js放在head部分,就不得不无差别地在所有页面插入代码了。那样的话,添加一个Widget就会带来浪费的流量,页面速度也会被不断拖慢。
当然有个替代方案是把代码放到页面的footer部分,不过,个人以为,只要脚本出现在了Html body里面,那么直接嵌入到Widget中和hook到footer上,其实没什么本质区别,都破坏了行为和数据分离的原则。
这也是无奈之举了。谁叫WP设计成了sidebar.php执行前,无法知道页面会载入哪个sidebar这种结构呢?
当然,不排除还有更好方法的可能,如果知道的网友还望不吝告知。
Posted in Plugins, WordPress | Tagged DIY, plugins, WordPress |
3067 views | 2009/11/10
初次安装vim编辑器时,我们必须要配置~/·vimrc文件才能让vim变得更加好用。最少最少,你要配置下面一些内容:
" 不再与老旧的Vi兼容
set nocompatible
" 开启filetype支持
filetype on
filetype plugin on
filetype indent on
" 语法高亮
syntax on
" 这个选项为什么不是默认的?
set hidden
" 执行宏的时候不要更新显示set lazyredraw
" 至少让你知道当前是在什么状态下
set showmode
" 启用增强的命令行自动补全。必须再编译时开启 +wildmenu 选项
set wildmenu
" 更容易的编辑此文件,即vimrc文件。用ev命令表示edit vimrc。
nmap <silent> ,ev :e $MYVIMRC<cr>
" 并且令配置立刻生效,用sv命令表示source .vimrc
nmap <silent> ,sv :so $MYVIMRC<cr>
==========
上面一些选项还有很多我不懂的,以后研究明白了再添加解释。此文就作为我学习使用vim编辑器的起点吧~~
Posted in 工作相关 | Tagged vim |
3245 views | 2009/09/04
The Web Standards Project Acid Tests
http://www.acidtests.org/
“An acid test is a test used to confirm that a material such as jewellery is gold.” --- Wikipedia
Continue reading "折磨一下浏览器们,哈哈"
Posted in 工作相关 | Tagged test, Web Browsers, web design |
3028 views | 2009/08/15
Previously, WPdesigner.com is a blog where the owner of it distributes WordPress themes and helps others with code and design tweaks. In last year, potato, the original owner of the site sold out his site. Now let's have a look, what's new in this site.
On the home page of this site, what you can see is a list of “Best 10 Web Hosting Sites”. These items in this list are picked out according to the credibility and the reputation of these hosting companies, and they are order by Price, Server Up-Time, Reliability, Easy-of-Use, Control Panel and Customer Support. In the end of every item in this list, you can find a link of the review of the specified hosting site. Each review article gives detail of that web hosting site, include its description, plan, ratings and so on.
Although the articles on this site now are not related with WordPress themes or techniques directly, web host information is still very important for our bloggers. If you are a new blogger, and want create your own blog site, I think the web host service provided by the companies on the list are all good choices, especially when you want to create a self hosted WordPress blog.
Posted in Business | Tagged blog, Business |
8212 views | 2009/07/21
Posted in 工作相关 | Tagged server, subversion, usage |
5265 views | 2009/07/14
在网上搜出了很多给Hibernate配置连接池的文章,不过基本上都是同一篇文章,介绍了3种连接池的配置方法,我先试验了c3p0,感觉不出有什么快的,只是觉得在并发测试中,减少了出错的概率。那篇帖子最底下,说道社区普遍认为c3p0不够优秀,大家更倾向使用proxool,于是乎,我决定也试试,当然,我自己完全是没任何经验的,纯粹是为了试试。
去proxool下载了最新版本,0.9.1(我用的Hibernate是3.2.5版本,实际上0.9.1配置好后,跑步起来,最后还是用了0.8.3,后面会说的),按照网上普遍能搜到的帖子里的那个方法配置。
Continue reading "在Hibernate里配置Proxool连接池"
Posted in 工作相关 | Tagged java, programming |
Most Commented Posts