订阅到抓虾 Add to netvibes 添加到Google Reader(阅读器) Hosted by exlast.com

Archive

现实照进梦想

午休,做了个梦。诡异。

梦中的场景就是我现在办公室的场景。大家都在各忙各的,时不时聊几句。

办公室里响起经典的索爱手机铃声… (大家用的都是索爱的机器M608或P1)

我想,原来是Boss回来咯。可是Boss走进房间又出去了,对铃声木有任何反应。我又想,哎,是mosi同学的手机响咯,可这时mosi同学从卫生间走到饮水机出倒水,对响了一遍又一遍的铃声也木有任何反应。我就奇怪了!哪来的铃声,莫非是我的。

没错!是我的手机在响。。抬手摸手机,关掉.。咔嚓,梦醒了,原来是现实中我手机定的闹钟在响。

哎,之前也做过类似的梦。

梦中,听见mm在身后叫我,一扭头,梦醒了,原来是mm在现实中叫我。

这就是所谓的,现实照进梦想? :roll:

Tags:

spam无所不在

spam就是一颗毒瘤。无孔不入,无所不在。
技术日益先进,手段也日益丰富。

今天就收到一份颇有创新精神的spam邮件。咋一看还以为是应聘信息。顺便提一句,本人正在招聘WEB开发工程师(PHP/js/xhtml/css),有意者可邮件联系我。

点击小图看大图。

spam无所不在

spam无所不在

Tags:

秋分!多事之秋!

原来今天是秋分..
所谓多事之秋,在这几天一一应验了!

上火!忙碌!焦躁!困惑!无奈!

USB2.0!

几个结论..

  • 1、非专业人士从事需要专业技术的活动是多么可怕的一件事。
  • 2、很多时候很多事,你都是出力不讨好。
  • 3、与sb共舞,其乐无穷。
  • 4、更多更多…
Tags:

每个web程序员都应该知道的5个正则表达式

1、匹配用户名

规则:

  • 允许字符和数字(a-z,A-Z,0-9)
  • 允许下划线

正则表达式:

/^[a-zA-Z0-9_]{3,16}$/

代码示例:

function validate_username( $username ) {
if(preg_match(’/^[a-zA-Z0-9_]{3,16}$/’, $_GET['username'])) {
return true;
}
return false;
}

2、匹配XHTML或XML标签

正则表达式:

{]*>(.*?)}

代码示例:

function get_tag( $tag, $xml ) {
$tag = preg_quote($tag);
preg_match_all(’{<'.$tag.'[^>]*>(.*?).’}',
$xml,
$matches,
PREG_PATTERN_ORDER);

return $matches[1];
}

3、匹配确定属性值的XHTML或XML标签(例如:class或tag)

正则表达式:

{]*attribute\\s*=\\s*(["'])value\\\\1[^>]*>(.*?)}

代码示例:

function get_tag( $attr, $value, $xml, $tag=null ) {
if( is_null($tag) )
$tag = ‘\\w+’;
else
$tag = preg_quote($tag);

$attr = preg_quote($attr);
$value = preg_quote($value);

$tag_regex = “/<(".$tag.")[^>]*$attr\\s*=\\s*”.
“(['\\"])$value\\\\2[^>]*>(.*?)<\\/\\\\1>/”

preg_match_all($tag_regex,
$xml,
$matches,
PREG_PATTERN_ORDER);

return $matches[3];
}

4、匹配和解析email地址

代码示例(比较复杂些):

function is_valid_email_address($email){
$qtext = ‘[^\\x0d\\x22\\x5c\\x80-\\xff]‘;
$dtext = ‘[^\\x0d\\x5b-\\x5d\\x80-\\xff]‘;
$atom = ‘[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c'.
'\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+’;
$quoted_pair = ‘\\x5c[\\x00-\\x7f]‘;
$domain_literal = “\\x5b($dtext|$quoted_pair)*\\x5d”;
$quoted_string = “\\x22($qtext|$quoted_pair)*\\x22″;
$domain_ref = $atom;
$sub_domain = “($domain_ref|$domain_literal)”;
$word = “($atom|$quoted_string)”;
$domain = “$sub_domain(\\x2e$sub_domain)*”;
$local_part = “$word(\\x2e$word)*”;
$addr_spec = “$local_part\\x40$domain”;

return preg_match(”!^$addr_spec$!”, $email) ? 1 : 0;
}

5、匹配URL

正则表达式:

{
\\b
# Match the leading part (proto://hostname, or just hostname)
(
# http://, or https:// leading part
(https?)://[-\\w]+(\\.\\w[-\\w]*)+
|
# or, try to find a hostname with more specific sub-expression
(?i: [a-z0-9] (?:[-a-z0-9]*[a-z0-9])? \\. )+ # sub domains
# Now ending .com, etc. For these, require lowercase
(?-i: com\\b
| edu\\b
| biz\\b
| gov\\b
| in(?:t|fo)\\b # .int or .info
| mil\\b
| net\\b
| org\\b
| [a-z][a-z]\\.[a-z][a-z]\\b # two-letter country code
)
)

# Allow an optional port number
( : \\d+ )?

# The rest of the URL is optional, and begins with /
(
/
# The rest are heuristics for what seems to work well
[^.!,?;"\\'<>()\[\]\{\}\s\x7F-\\xFF]*
(
[.!,?]+ [^.!,?;"\\'<>()\\[\\]\{\\}\s\\x7F-\\xFF]+
)*
)?
}ix

完整的文章请访问这里阅读(英文)

Tags:

如何设置Google日历中文字体大小

国外的网站在推出中文版本时,大都存在这样一个问题,没有针对中文字体调整字体大小。仍然使用英文字体的10px或者11px。结果导致中文版看起来很不舒服。例如 flickrlast.fmfacebook,等等。

看图

flickr

last.fm

facebook

facebook

我常用的日程管理工具,Google 日历也同样存在这个问题,中文字体在XP下看起来很不舒服。

于是,我自己动手进行了一些修改。

基本上把我看起来感觉不舒服的地方调整了。

先对比下修改前后的效果, 8-)

修改前:

修改后的效果-3

修改后的效果-1

修改后的效果-2

修改后的效果-2

修改后的效果-3

修改后的效果-3

修改后:

修改后的效果-1

修改后的效果-2

修改后的效果-2

修改后的效果-3

修改后的效果-3

————————————————————-

注:只方法只适用于 Firefox。

那么,如何修改呢?按照下面这个步骤来:

1、首先安装 Firefox 扩展 Stylish (点击这里下载),这个扩展允许你为某个或多个指定网站使用自定义的CSS。

2、安装Stylish之后,在管理样式中选择“撰写”,描述信息可以随便写,比如“Google日历”。

3、粘贴下面代码到文本框。

blockquote i{font-style:normal!important;font-size:12px!important;}.noleft nobr,.listv .event-title,.lkh,.cheadToday,.cheadNotToday > span,#expand_all_link,#collapse_all_link,.calListLabel,.newdate,.titlecell div li,.chipbody dd div span,.chipbody dt .timelabel,#eventowner .month_event span.event-title span,#eventowner .moreevents{font-size:12px!important;}

看图:

使用Stylish修改Google 日历样式表

4、保存

5、打开Google日历,在火狐右下角的Stylish图标中选中你刚才添加样式表。

在Firefox右下角设置Stylish

在Firefox右下角设置Stylish

希望这篇文章对你有用。 :lol:

Tags: