fanfou?

这唱的是哪一出? $ nslookup fanfou.com Server: 124.207.162.136 Address: 124.207.162.136#53 Non-authoritative answer: Name: fanfou.com Address: 127.0.0.1

September 5, 2009 · notsobad

let's face the music and dance

很好听啊 let’s face the music and dance There may be trouble ahead But while there’s moonlight and music And love and romance Let’s face the music and dance Berlin Irving Before the fiddlers have fled Before they ask us to pay the bill And while we still Have the chance Let’s face the music and dance We’ll be without the moon Humming a diff’rent tune And then There may be teardrops to shed So while there’s moonlight and music And love and romance Let’s face the music and dance Dance Let’s face the music and dance

August 27, 2009 · notsobad

sh or bash

我需要对一些字体文件做些处理,字体名里面有些特殊字符,如空格,写了下面的脚本, 然后调用 “sh fonts.sh“, 却总是出问题,研究了好久,才发现是sh和bash的区别,这段代码用bash调用就没问题 #chmod +x fonts.sh #./fonts.sh #bash ./fonts.sh sh 和bash的区别 543 ~/www/fonts>cat fonts.sh #! /bin/bash IFS=$(echo -en “\n\b”) for i in $(find . -name \*.[Tt][Tt][Ff]); do echo “$i” done unset IFS ...

August 26, 2009 · notsobad

字体

几篇很不错的关于字体的文章: 从 Illustrator 到 FontLab 打造你自己的字体(I) 打造你自己的字体(II) 打造你自己的字体(III)实例研究:Joules 还有个小组 http://www.yeeyan.com/groups/show/TYPO 译言是个好网站,比其他的网站更有意义 比如 什么是股票和股票市场及运作原理

August 18, 2009 · notsobad

jQuery的监测事件

如何对一系列dom元素绑定事件? 那些元素在后续操作中还有可能会增加。 prototype.js中可以使用Event.Observe, jQuery中怎么做呢? 参考如下: 使用jquery中的事件检测而不事先绑定。 http://www.beyondstandards.com/archives/jquery-ajax-and-event-handlers/ http://docs.jquery.com/Events/live <http://www.sitepoint.com/blogs/2008/07/23/javascript-event-delegation-is- easier-than-you-think/> function aClick() { $("div").show().fadeOut("slow"); } $("#bind").click(function () { $("#theone").live("click", aClick) .text("Can Click!"); }); $("#unbind").click(function () { $("#theone").die("click", aClick) .text("Does nothing..."); });

August 16, 2009 · notsobad

swfupload 文件上传

浏览器的文件上传有个问题就是不能选择文件类型, 不能拖选文件,不能提供上传进度。 而flash可以提供这些功能,所以很有用。 swfupload 项目主页: http://code.google.com/p/swfupload/ 这里有一些例子可以参考 http://demo.swfupload.org/ 特性: Multiple File Selection File Upload Progress Custom Limits for File Size and Number of Uploads Filter by File Type ie. *.jpg File Queue Customize the Browse Control Flash 10 Support (Starting with Version 2.2.0) 大文件上传,需要提供进度的地方,可以考虑使用。 ...

August 14, 2009 · notsobad

什么是好的命令行程序

最近处理bug,总结一下什么是好的命令行程序: 无参数调用时,显示帮助 记录日志到文件 关键步骤要打印log到标准输出 出错提示信息要写到标准错误里去 要有退出值 python程序不要屏蔽异常,要打印到stderr里去 脚本初始时要明确的检验执行权限、目录是否满足需求 python程序最好不要用PYTHONPATH来设置包含路径,移植和多人合作问题太多,应该直接链接到site-packages下去 ...

August 14, 2009 · notsobad

sed 获取html中链接

sed的tutorials http://sed.sourceforge.net/grabbag/scripts/ http://sed.sourceforge.net/grabbag/tutorials/ 一个获取html中链接的sed脚本 #! /bin/sed -nf # Join lines if we have tags that span multiple lines :join /<[^>]$/ { N; s/[ ]\n[ ]/ /; b join; } # Do some selection to speed the thing up /<[ ]\([aA]|[iI][mM][gG]\)/!b # Remove extra spaces before/after the tag name, change img/area to a s/<[ ]\([aA]|[iI][mM][gG]|[aA][rR][eE][aA]\)[ ]\+/<a /g # To simplify the regexps that follow, change href/alt to lowercase # and replace whitespace before them with a single space s/<a\([^>]\)[ ][hH][rR][eE][fF]=/<a\1 href=/g s/<a\([^>]*\)[ ][aA][lL][tT]=/<a\1 alt=/g # To simplify the regexps that follow, quote the arguments to href and alt s/href=\([^" ...

August 5, 2009 · notsobad

imagemagick制作gif动画

参考这里: http://www.imagemagick.cn/ convert -delay 20 frame*.gif animation.gif convert -delay 20 frame1.gif -delay 10 frame2.gif -delay 5 frame3.gif animation.gif convert frame1.gif -page +50+100 frame2.gif -page +0+100 frame3.gif animation.gif convert -loop 50 frame*.gif animation.gif convert +adjoin images.* frames%d.gif 测试一下,效果很不错 511 ~/desktop/pic>for i in IMG_;do convert -sample 400x300 $i thumb-$i;done 514 ~/desktop/pic>convert -delay 40 thumb-IMG_01 jj.gif 515 ~/desktop/pic>animate jj.gif

August 4, 2009 · notsobad

Jquery的插件开发

Jquery的插件开发,试了一下,还是挺简单的。 http://docs.jquery.com/Plugins/Authoring [How to write jQuery plugin.](http://www.easyjquery.com/jquery-plugins/how-to-write- jquery-plugin) http://mattberseth.com/blog/2008/06/glowbuttons_writing_my_first_j.html 乱写的,没意义代码 (function($){ $.test = { log : function(str){ console.log(str); }, now : function(){ console.log(new Date()); }, demo : function(option){ option = $.extend({ size : 100, width : 40 }, option); this.log(option); } }; $.fn.xx = function(){ return this.each(function(){ console.log(this.className); }); }; })(jQuery); html中: $(function(){ $.test.log('aaaa'); $.test.now(); $.test.demo({size:23}); $('div').xx(); });

August 3, 2009 · notsobad