PHP中session_unset与session_destroy的区别

session是存在服务器东西(通常是文件),当你在页面顶端使用 session_start();的时候,系统就会把session从存的地方取出来,放到$_SESSION数组里。

unset($_session) 只是把$_SESSION数组删除掉

session_unset()

释放当前在内存中已经创建的所有$_SESSION变量,但不删除session文件以及不释放对应的 session id

session_destroy()

删除当前用户对应的session文件以及释放session id,内存中的$_SESSION变量内容依然保留

因此,释放用户的session所有资源,需要顺序执行如下代码:


程序代码

<?php
$_SESSION['user']  = 'lowell';
session_unset();
session_destroy();
?>

PM(04)_Managing Project Change

Why change?

You must SWOT whether the changing is necessary.

Make a list of positive and negative responses of the change.

Change control and change management

What are you going to do when changing happen?

  • Baseline-Measure change against your baseline
  • Value-What is the value of the change
  • Control-Control the change with a process
  • Communicate-Communicate about the changing

Managing change

Time is everything, so schedule projects to not all hit the users at once.

Cost of changing is increasing via the project progress going on.

How do you feel when you have to tell others things are changing?

How do you feel when you are told things are changing?

AABBCC:

Identify audiences and actions you want

Identify barriers audiences have and tell them about the benefits that will result.

Choose communication channels and controls that you will use to check understanding.

PM(03)_Project Management Plan

What is a Plan?

If you have known where you are, and where do you want to arrive. Then you need to decide how to get there. A plan is mainly about how to do.

It includes:

  • What
  • Why
  • Who
  • When
  • How

What need to be done?

Plans are useless, but planning is indispensable.

Benefits for planning:

  • Guide your activities
  • Make you think ahead
  • Work out the timeline and budget
  • Help understand the effects of changes
  • Make sure you are doing the right thing 更多 >

快速跳转到Google SSL 中文版的网址:ggssl.com

Google 最近提供了 SSL(HTTPS) 搜索功能(https://www.google.com),可以保护用户的搜索关键字和 搜索结果不被ISP等第三方机构 拦截、窃取,不被墙连接重置。

国内用户访问 https://www.google.com 默认情况下会跳转到谷歌香港 http://www.google.com.hk, 解决方法为先点击“Google.com in English“访问 http://www.google.com/ncr (仅需要点击一次),该网址会种一个Cookie,防止跳转,再设置搜索语言为中文,再输入 https://www.google.com 即可,比较麻烦。

本人将这一复杂的流程简化为一个域名:ggssl.com, 只需要访问:http://ggssl.com, 即可利用脚本快速跳转到 Google SSL 加密搜索中文版。第一次访问自动设置并跳转,以后访问立即自动跳转。

Google SSL 搜索快速跳转域名:http://ggssl.com

那些相见恨晚的 JavaScript 技巧[转载]

JavaScript 的成功让人津津乐道,为 Web 网页编写 JavaScript 代码已经是所有 Web 设计师的基本功,这门有趣的语言蕴藏着许多不为人熟知的东西,即使多年的 JavaScript 程序员,也未能完全吃透。本文从7个方面讲述 JavaScript 中那些你不很熟知但非常实用的技巧。 更多 >

javaScript 中URL编码转换,escape() encodeURI() encodeURIComponent[转载]

在使用url进行参数传递时,经常会传递一些中文名的参数或URL地址,在后台处理时会发生转换错误。在有些传递页面使用GB2312,而在接收页面使用 UTF8,这样接收到的参数就可能会与原来发生不一致。使用服务器端的urlEncode函数编码的URL,与使用客户端javascript的 encodeURI函数编码的URL,结果就不一样。
javaScript中的编码方法:
escape() 方法:
采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编码的16进制数字)。比如,空格符对应的编码是%20。unescape方法与此相反。 更多 >

PM(02)_Project Selection and Portfolio Management

Organization mission is the most important thing when selecting project. So you should consider strategy plan first.
Steps of select project:
Review organization mission (SWOT)
Set goals(SMART)
Develop strategy
Align strategy to goal
Implement strategy through project
PPPM-Project, Programmer, Portfolio, Management
Project category: Core, Growth, Venture
Benefit of portfolio management:
Build discipline into project selection precess
Link project selection to strategy
Allocate resource
Balance risk
Tactical vs Strategy
How to select a IT project?
–People always choose the projects which are aligned with business strategy!
Items effect to project selection:
Time
Money
Focus

Organization mission is the most important thing when selecting project. So you should consider strategy plan first.

Steps of select project:

  • Review organization mission (SWOT)
  • Set goals(SMART)
  • Develop strategy
  • Align strategy to goal
  • Implement strategy through project

PPPM-Project, Programmer, Portfolio, Management

Project category: Core, Growth, Venture

Benefit of portfolio management:

  • Build discipline into project selection precess
  • Link project selection to strategy
  • Allocate resource
  • Balance risk

Tactical vs Strategy

How to select a IT project?

–People always choose the projects which are aligned with business strategy!

Items effect to project selection:

  • Time
  • Money
  • Focus

VIM查找替换归纳总结

VIM中常用的替换模式总结。

1,简单替换表达式

替换命令可以在全文中用一个单词替换另一个单词:

:%s/four/4/g

“%” 范围前缀表示在所有行中执行替换。最后的 “g” 标记表示替换行中的所有匹配点。如果仅仅对当前行进行操作,那么只要去掉%即可

如果你有一个象 “thirtyfour” 这样的单词,上面的命令会出错。这种情况下,这个单词会被替换成”thirty4″。要解决这个问题,用 “\< ” 来指定匹配单词开头:

:%s/\

显然,这样在处理 “fourty” 的时候还是会出错。用 “\>” 来解决这个问题:

:%s/\/4/g

如果你在编码,你可能只想替换注释中的 “four”,而保留代码中的。由于这很难指定,可以在替换命令中加一个 “c” 标记,这样,Vim 会在每次替换前提示你:

:%s/\/4/gc 更多 >

ie和firefox兼容的方式获取回车事件方法

直接上代码,一看便知

只在IE下能够运行的代码,在firefox下不能运行

     /**
      * 捕获回车事件
      *
      */
      function checkEnter(your_param1, your_param2)
      {
           if (window.event.keyCode == 13)
           {
                yourfunction(your_param1, your_param2)
           }
      }

两者兼容的方式

/**
      * 捕获回车事件
      *
      */
     function checkEnter(your_param1,your_param2, e)
     {
         var msie = (document.all) ? true : false;
         var keycode;
         if(!msie)keycode=e.which;
         else keycode=e.keyCode;
         if (keycode==13)
         {
             yourfunction(your_param1, your_param2);
         }
     }

豆丁,你要是能让我看文档的时候加批注该多好

可能你们就是这么设计的,要想加批注,就花钱下载. 其实我到现在都不知道豆丁你在靠啥挣钱.别人家下载都是虚拟的货币,积分呀,豆呀,钻呀的,你家可是真金白银明码标价呀.