易栈网-膘叔

浏览模式: 标准 | 列表 | 图文
2008年6月20日上午11时48分,儿子出世了

2008年6月20日上午11时48分,儿子出世了

2008年6月20日凌晨1点58分,发现羊水破了,立马打车去医院,2点半左右,在医院挂上了急诊,进行待产房。

上午5点多,开始肚子疼,7点左右检查时,宫口开了两指,此时疼痛间隔大约在7分钟和10分钟之间,9点疼痛加剧,9点半检查,开了三指,大约在10点半时再检查,已经开了四指左右,此时接生人员建议进入产房。

2008年6月20日上午11时48分,儿子出世了(顺产)。身高51CM,目前母子平安。

下午3点多,儿子喝上了出世后第一口奶,不过这是医院配制的。

3点多时,被医院的护士长进行了简单培训,比如喂奶、给婴儿洗澡、换尿片啥的。

将近5点,妻子终于尿出来了,听说顺产后一定的时间内,要小便,否则可能会引起内出血。现在几乎排除这个问题了

乘着回家给老婆拿一些日常用品的机会,把经历贴出来。等拍了照片,我会继续上传

PS:忘了说明体重了,7斤7两,同时,小BABY还有一个小耳朵。依他外婆的意思,现在就用激光切掉,但被我以存在的就是合理的先搪塞过去。名字准备叫肖佑阳,母亲属羊,希望他长大后能够以男子汉的身体佑护他妈妈,毕竟怀胎10月以及生产都是一件很痛苦的事情

为自己添加协议

为自己添加协议

原文地址:http://kb.mozillazine.org/Register_protocol

A protocol is a method that is used to send, receive, and handle information over a connection. Common protocols viewed from the browser include http, https, ftp, and mailto. In order for you to view information sent over a specific protocol, it must be registered. If you enter a URL for an unknown protocol (foo) in the Location Bar, you will receive a message such as, Firefox doesn't know how to open this address, because the protocol (foo) isn't associated with any program or, in Mozilla Suite/SeaMonkey, foo not a registered protocol.

Once registered, the protocol can then be handled by the program you specify, such as your browser or a third party viewer. This means that a hyperlink ( e.g. foo://fred) can use the handler for protocol foo to open the file named fred.

Windows

On Windows, protocol registration is done by the operating system (OS). For example, when you set a web browser as the default browser, the OS will register the http, https and ftp protocols and associate them with that web browser; when you open an http https or ftp link in a mail message or from an Internet Shortcut, the URL will open in your default browser. Similarly, when you set a default mail client, the OS registers the mailto protocol so that mailto links in the browser open in the associated mail application.

Note: Mozilla Suite/SeaMonkey integrates mail and browser functions so that web links in an email message (e.g., http:// links) will open in a SeaMonkey browser window and "mailto:" links in a web page will open in SeaMonkey Mail, regardless of the OS protocol handlers.

Other protocols can be registered and associated with an external application by configuring an installed program to handle the content. For example, you can set RealPlayer as the registered protocol handler for RTSP URLs (Real-Time Streaming Protocol) by using RealPlayer's preference settings under "Content -> Media Types". When you next open an rtsp:// link, Firefox or Mozilla Suite/SeaMonkey will ask you to confirm the external protocol request before it will launch the application [1] [2].

It is also possible to register a protocol by creating a .reg file such as the following, and placing this in the file:

REGEDIT4

[HKEY_CLASSES_ROOT\foo]
@="URL:foo Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\foo\shell]

[HKEY_CLASSES_ROOT\foo\shell\open]

[HKEY_CLASSES_ROOT\foo\shell\open\command]
@="\"C:\\Program Files\\Application\\program.exe\" \"%1\""

Replace foo with the protocol you're specifying and C:\\Program Files\\Application\\program.exe with the program you want to run. [3] Note that backslashes must be doubled and the additional slashes and quotes before the path must not be removed. Save the file, then double-click it to insert into the Windows registry. See Registering an Application to a URL Protocol for additional information.

Linux and Mac

  • Type about:config into the address bar and press Enter.
  • Right-click -> New -> Boolean -> Name: network.protocol-handler.external.foo -> Value -> true (Replacing foo with the protocol you're specifying)
  • Right-click -> New -> String -> Name: network.protocol-handler.app.foo -> Value -> /path/to/app (Replacing foo with the protocol you're specifying and /path/to/app with the path to the application you want to run.
  • Ensure network.protocol-handler.expose-all is set to true.

Troubleshooting

  • (Linux and Mac) If the path or name is incorrect when setting the network.protocol-handler.app.(protocol) preference , Firefox will display an error saying "protocol (foo) isn't associated with any program". (bug 312953)
  • If you receive a message in Firefox that the mailto protocol is not associated with any program, reset your default mail client. [4]
  • Certain unsafe protocols are ignored by default (bug 173010).

See also

External links

The protocol is not associated with any program (Firefox Support)

为JQuery的cycle插件作图片自动缩放

为JQuery的cycle插件作图片自动缩放

function showImg(){
pw = parseInt( $(this).parent().css('width') );
ph = parseInt( $(this).parent().css('height') );
showImage = new Image();
showImage.src = $(this).children('a').children('img').attr('src');
sw = showImage.width;
sh = showImage.height;
//原先这些sw是直接用 $(this).width()来判断,但实际上很多时间都取回的是pager里面的图片大小属性,或者取回来有不正常的时候,这是cycle的BUG,没有时间却验证了,因此,只有用Image类来进行处理,这样取回来的就是图片真正的大小
idx = $('#bigPic li').index( $(this) );
alert(showImage.src+' - '+sw+' - '+sh);
if (sw > pw || sh > ph){
if (sw > sh ){
sh = Math.floor(sh * ( pw / sw ));
sw = pw-10;
}else {
sw = Math.floor(sw * ( ph / sh ));
sh = ph-10;
}
//实在不知道这里为什么会多出16px,如果不减6,就会每次缩小
//这里的长宽比例会不正确。。。
$(this).children('a').children('img').css({'width': sw,'height':sh,'paddingTop':3});
}
if (sh <= ph){
$(this).css('marginTop',(ph - sh)/2).css('verticalAlign','middle');
}
if (sw <= pw){
$(this).css('marginLeft' , (pw - sw)/2).css('textAlign','center');
}
if( idx == 0 ){
$('#thumbnail a').trigger('click');
}
}

Mark it ,and update it on work time...

长时间不更新,送上点JS

长时间没有更新了,一是因为单位比较忙二来是老婆快生了。。

但一直不更新也不太好,这里送上一小段JS,FOR jQuery。

很多时候,我们需要在一堆图片列表里进行左移右移,比如我现在有10个IMG,我放到DIV里面默认显示5个,这时候我会在页面上留下两个按钮进行左移,右移,以前的移动可能会很复杂,自从有了jquery,一切变得这么简单。

<div id="pic_list">
<span id="p_left"> << </span>
<ul>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
<li><img src="aa.jpg" /><li>
</ul>
<span id="p_right"> >> </span>
</div>
<script language="JavaScript">
<!--
$('#p_left').click(function(){
var list_length = $('#pic_list ul li').length;
$('#pic_list ul li:eq(0)').before( $('#pic_list ul li:eq('+(list_length-1)+')').remove() );
});
$('#p_right').click(function(){
$('#pic_list ul').append( $('#pic_list ul li:eq(0)').remove() );
});
//-->
</script>

具体样式我就不提供了,黑黑,这样的方法应该算是最简单的了。。毕竟你在做页面的时候,肯定会都把li的宽度设的一样

Smarty的一些常用方法

Smarty的一些常用方法

网上流传的大师兄教程确实给了我们很多方便,只是大师兄教程却不是很全面。或许他给很多设计师们带来了福音,但对程序开发人员来说,并没有什么特别的高深之处。

不过,我还是挺佩服他的,毕竟,他将自己的思想和实现方法提供出来,如果每个人都这样,或许,我们能够再进步一些。呵呵

在工作,仍然是在使用着smarty,也在开发中积累了一点点的心得,逐步写出来,与大家共同分享,当然应该会存有错误,与大家一起改进。

smarty在使用时是需要配置的,最简单的配置方法就是将基本的变量写成一个数组,然后new Smarty之后,foreach一下,由$smarty自行加载,如:

---------------------------------------------

辛苦写了半天,结果超时了。下次补上,今天没时间了。

onDblClick?onDoubleClick?ondblclick?

onDblClick?onDoubleClick?ondblclick?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<script language="JavaScript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js"> </script>
</head>

<body>
<table>
<tr>
<td><span class="forupdate" name="price" id="price">1234.56</span></td>
</tr>
<tr>
<td><span class="forupdate" name="number" id="number">55</span></td>
</tr>
</table>

<script language="JavaScript">
<!--
$(document).ready(function(){
$('.forupdate').dblclick(function(){
var Input = "<input type='text' >";
var InputValue = $(this).text();
$(this).html( Input );
$(this).children('input').attr('name', $(this).attr('name')+'_update')
.attr('id', $(this).attr('id')+'_update')
.val( InputValue );
$('#'+$(this).attr('id')+'_update').focus()
.blur( function(){
//这里用ajax如果成功,再返回。否则。。
//....现在不处理。
$ajaxReturn = true;
if( $ajaxReturn == true){
$(this).parent().html( $(this).val() ) ;
}
});
});
});
//-->
</script>
</body>
</html>

可以拷贝到编辑器里,双击数字进行测试……

后记:虽然知道这种控件网上会很多,但是没料到会这么多……

贴一个地址吧,也是jQuery的插件:http://www.appelsiini.net/projects/jeditable,NND啥时候一生气,也搞成插件出来……

转一朋友的离职信

转一朋友的离职信

顺便排了下版,哈哈……

尊敬的公司领导:
  自从我2月份加盟××公司这个大家庭后,感受到了公司的温暖,也感受到了公司各位领导对我的关心,在工作过程中,各位同事对我的帮助很大,他们不仅对我的工作给予配合,也在我遇到困难的时候,给予了我大量的帮助,使我在这短短的时间内,在技术上,有了长足的进步,也对公司更加忠心,更加相信公司会在今后步入一个更加高速的发展轨道中。
  但是,遗憾的是,我不得不离开这个给予了我关怀、温暖的大家庭。公司是一个复杂的团体,各项工作需要各个部门、员工有机的配合,同时,在工作中,还要给予必要同事必要的信任和尊重,遗憾的是,在这个充满了温暖的大集体中,我与某些同事相处不是很愉快,也许这是我们自身的原因,也许是这几位同事的处事风格我不太适应,不过,这将会影响我为公司高效、投入的工作,这将是公司的损失,也是我的损失;再有,虽然我技术水平有限,但是我对公司工作的投入热情不应该受到某些人的怀疑和磨灭,虽然我不知道这么做对他有什么好处,但是,我知道,这将是公司的又一大损失;每个人在公司中都是有相应的责任的,并且,每个人都是应该有责任感的,在我负责的工作中,与一些同事的权限有重叠,但是这不是我推卸责任的借口,因为我是有责任感的正常人,当然,我也不希望这成为别人推卸责任的借口,因为我不希望公司的有形及无形资产受到破坏。
  综上所述,为了避免公司因为某些人的原因,损失更大的利益,我决定离职,我会尽到一个员工的义务,遵守职业道德标准,与相关人员在×××日之前做好交接工作,请领导安排相关事宜
  人是区别于“成本”、“资源”,“资本”的,如果成本的动词是“节约”,资源的动词是“利用”,资本的动词是“增值”,那么,对于有感情的人,又应该用什么动词去形容呢??
  祝公司发展顺利,各位领导及同事工作愉快
以后谁要离职可以抄抄用用哦。哇哈哈哈

比武招亲征友帖的含义

890e3d15af4fd6cc42b58e43857a6690

(2008-05-24 17:34:48) yhustc

标 题: 比武招亲征友帖的涵义
发信站: 水木社区 (Fri May 23 18:30:41 2008), 站内

看看发帖mm的深意吧
第一步根本不用看,必然帅五平四,以下黑炮4平2必然
红车一进二必然,黑炮2平9必然,红后兵平五必然
黑车1进9必然,红帅五进一 黑卒4平5,红帅四平五
以下黑方退车于何路好像有点讲究
后面是相互牵制的棋,还比较复杂,是和棋
我想说的是
mm这个帖子的意思就是:
1.不要着急打炮
2.要动用自己的帅
3.要送车
4.对方也会送你一些小东西,比如卒
5.之后双方互缠,虽有些争斗,但最终和为贵

观察者模式(感谢mpeg提供源码)

观察者模式(感谢mpeg提供源码)

<?php
interface IObserver {
function onChanged( $sender, $args );
}

interface IObservable {
function addObserver( $observer );
}

class UserList implements IObservable {
private $_observers = array();
public function addCustomer( $name ) {
foreach( $this->_observers as $obs )
$obs->onChanged( $this, $name );
}
public function addObserver( $observer ) {
$this->_observers []= $observer;
}
}
class UserListLogger implements IObserver {
public function onChanged( $sender, $args ) {
echo( "'$args' added to user list\n" );
}
}
$ul = new UserList();
$ul->addObserver( new UserListLogger() );
$ul->addCustomer( "Jack" );
?>

mpeg的网站地址为:www.phpubb.com

更多介绍,请参考MSDN网站:http://msdn.microsoft.com/zh-cn/library/ms954621.aspx

以下是部分内容:

观察者模式

面向对象的开发的一个主导原则是,在给定的应用程序中正确地分配任务。 系统中的每个对象应该将重点放在问题域中的离散抽象上,而不是放在任何其它方面。 简而言之,一个对象只应做一件事,而且要将它做好。 这种方法可确保在对象之间划定清晰的界限,因而可提供更高的重用性和系统可维护性。

一个正确划分任务特别重要的领域就是,用户界面和基础业务逻辑之间的交互。 在应用程序的开发过程中,需要快速更改用户界面要求,并且不会对应用程序的其他部分产生连带影响,这是司空见惯的事。 此外,业务要求也可能会发生变化,而这一切与用户界面无关。 具有丰富开发经验的人都知道,在很多情况下,这两组要求都会发生变化。 如果没有划分 UI 和应用程序其他部分,修改任一部分都会对整体造成不利的影响。

很多应用程序都会遇到以下常见问题:需要在用户界面和业务逻辑之间划分清晰的界限。 因此,自 GUI 出现以后开发的很多面向对象的框架均支持将用户界面从应用程序的其他部分中划分出来。 不要惊讶(可能有一点),其中的大部分应用程序采用类似的设计模式来提供此功能。 这种模式通常称为观察者,它在系统中的各种对象之间划分清晰的界限方面非常有利。 此外,还会经常看到在框架或应用程序中与 UI 无关的部分中使用这种解决方案。 正如大多数其他模式一样,观察者模式的作用远远超过了其最初的想法。

逻辑模型

虽然观察者模式有很多变体,但该模式的基本前提包含两个角色:观察者和主体(熟悉 Smalltalk MVC 的人将这些术语分别称为视图和模型)。 在用户界面的环境中,观察者是负责向用户显示数据的对象。 另一方面,主体表示从问题域中模拟的业务抽象。 正如图 1 中所描述的一样, 在观察者和主体之间存在逻辑关联。 当主体对象中发生更改时,(例如,修改实例变量),观察者就会观察 这种更改,并相应地更新其显示。
策略模式(感谢mpeg提供代码)

策略模式(感谢mpeg提供代码)

<?php
interface IStrategy {
function filter( $record );
}
class FindAfterStrategy implements IStrategy {
private $_name;

public function __construct( $name ) {
$this->_name = $name;
}

public function filter( $record ) {
return strcmp( $this->_name, $record ) <= 0;
}
}
class RandomStrategy implements IStrategy {

public function filter( $record ) {
return rand( 0, 1 ) >= 0.5;
}
}
class UserList {
private $_list = array();

public function __construct( $names ) {

if ( $names != null ) {
foreach( $names as $name ) {
$this->_list []= $name;
}
}
}
public function add( $name ) {
$this->_list []= $name;
}
public function find( $filter ) {
$recs = array();
foreach( $this->_list as $user ) {
if ( $filter->filter( $user ) )
$recs []= $user;
}
return $recs;
}
}
$ul = new UserList( array( "Andzy", "Jack", "Lori", "Megan" ) );
$f1 = $ul->find( new FindAfterStrategy( "J" ) );
print_r( $f1 );
$f2 = $ul->find( new RandomStrategy() );
print_r( $f2 );
?>

mpeg的网站是:www.phpubb.com