2010年3月22日星期一

Blogger的悲哀

 

因为喜欢WordPress,因为喜欢用MS Live Writer写博客,所以选择了yo2.cn.

可是命运多舛,一段时间后yo2无法访问。偶尔发现翻墙能访问自己的博客,后来终于在yo2官方网站看到了如下的声明:

目前Yo2已恢复免费用户与绑定域名用的博客访问服务,服务器均已迁移香港,确保数据的安全性。但因众所周知的墙存在,目前Yo2的香港服务器IP是被盾状态,用户需要翻墙(代理,最好VPN方式)访问和管理博客,或者备份下载博客内容。国内服务器的恢复还需再观察形势发展,给大家带来的不便深表抱歉!~现在的处境,我们最大的努力是保证数据安全和国外的正常访问,并尽可能快的恢复国内服务。希望大家可以谅解,谢谢!

然而却再也无法发布新的日志。

直到今日,从twitter上得知:

刚才得知国内BSP yo2被撤销备案,意味着完全无法在国内经营.现在不是狼来了,而是狼已经在吃羊了.

顿时感觉十分地悲哀与失望。P民是没有办法的,这个日志主要也是记录一些东西防止遗忘。不管选择yo2还是blogspot,翻墙还是免不了的,所以还是用稳定一点的,至少能发布日志的博客。

后面慢慢把以前的东西搬上来吧,真是不习惯Live writer不支持的博客,因为我写的里边可能有很多图。

再次无语中……

2010年3月15日星期一

Windows 7常用热键

* 窗口快捷键
win+↑ 最大化窗口
win+↓ 还原/最小化窗口
win+← 使窗口占领左侧的一半屏幕
win+→ 使窗口占领右侧的一半屏幕
win+shift+← 使窗口在左边的显示器显示
win+shift+→ 使窗口在右边的显示器显示
win+home 还原/最小化所有的其他窗口

* 任务栏快捷键
win+T 预览第一个任务栏项, 按住win键连续按T从左向右预览
win+shift+T 预览最后一个任务栏项, 按住win+shift键连续按T从右向左预览
松开以后, 也可以按←或→键来按顺序预览.
win+数字键 1~9 启动当前钉在任务栏上的快速启动项, 按win+1启动左起第一个快捷方式, 依次类推.

* 桌面快捷键
win+空格键 预览桌面(不同于显示桌面, 松开以后会恢复原状.)
win+G 按排列次序把桌面小工具送到屏幕最前端
win+P 切换连接到投影仪的方式
win+X 打开windows移动中心

* 辅助工具快捷键
win+加号”+” 按比例放大整个屏幕
win+减号”-” 按比例缩小整个屏幕

* 资源管理器快捷键
Alt+P 快速打开/关闭预览窗格

* 鼠标动作
Shift+左键单击任务栏图标 打开一个新的实例(例如Shift+左键单击”库”图标会打开一个新的资源管理器窗口)
鼠标中键单击任务栏图标 作用同上.
Ctrl+Shift+左键单击任务栏图标 以管理员权限打开一个新的实例
Shift+右键单击任务栏图标 打开像XP/Vista那样的窗口控制菜单(即最大化, 最小化, 关闭等); 对于未打开的快捷方式, 则弹出针对快捷方式的右键菜单.
shift+ 右键单击任务栏分组 打开像XP/Vista那样的窗口控制菜单(即最大化组, 最小化组, 关闭组)
ctrl+在任务栏分组上滚动滚轮 在本组中的不同窗口/标签之间切换.

2009年12月1日星期二

安装Liquid 7.2后导致光驱不可用的解决方法

 

Upgrade the DVD/CD driver to the latest version.

If you have installed any CD/DVD-burning software (Liquid 7.2 Video editing software), please temporarily remove them from Control Panel-> Programs and Features.

Delete Filter Drivers

1.     Click Start, type regedit and press ENTER.

2.     Navigate to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}

3.     Right click the {4D36E965-E325-11CE-BFC1-08002BE10318} entry, choose Export, select Desktop in the Save in box and type backup in File Name. Click Save.

Please Note: The backup file is on the Desktop and named backup.reg. We can simply restore the registry by double-clicking the backup.reg file.

4.     Highlight this key ({4D36E965-E325-11CE-BFC1-08002BE10318}), on the right pane, and then check if Upperfilters and Lowerfilters value are present. If so, please right click on the values and select Delete to remove them.

5.     Restart the computer

Reinstall the DVD ROM

1.     Click Start, type devmgmt.msc and press Enter.

2.     Expand DVD/CD-ROM drives.

3.     Right-click the DVDRAM and click Uninstall.

4.     Restart the computer.

If the issue persists, to get the issue resolved in a timely manner, I suggest contacting DVD manufacturer as soon as possible.

Good luck!

2009年11月9日星期一

“快速启动”里的显示桌面没了!怎么添加?

可以使用记事本等文本编辑器,重新用以下内容建立一个“显示桌面.scf”文件。 

[Shell]
Command=2
IconFile=explorer.exe,3

[Taskbar]
Command=ToggleDesktop

将文件存到文件夹“C:\Document and Settings\Administrator\Application Data\Microsoft\Internet Explorer\Quick Launch”中或创建快捷方式直接拖拽至任务栏中即可。


其中的Administrator是登陆的用户名

2009年10月28日星期三

2009年10月18日星期日

Filter Servlet控制用户权限

//过滤器代码

package cn.cslg.labsys.filter;

import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.naming.NamingException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.cslg.labsys.db.DBPoolException;
import cn.cslg.labsys.db.JndiBean;

/**
* 过滤器,对用户登录情况进行检查,如果用户未登录,则转到登录页面处理
*
* @author jimshen
*
*/
public class SessionChecker implements Filter {

    private String targetURI;

    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException {
        // 取得HTTP request/response/session对象
        HttpServletResponse httpResponse = (HttpServletResponse) response;
        HttpServletRequest httpRequest = (HttpServletRequest) request;
        HttpSession session = httpRequest.getSession(false);

        // 如果用户已登录,按既定流程运行
        try{
        if (session != null) {
            String user = (String) session.getAttribute("TNum");
            if (user != null) {
                String url = httpRequest.getRequestURI();
                if(pright(url,user)){
                    chain.doFilter(request, response);
                    return;
                }else
                    return;
            }
        }
        }catch(DBPoolException e){
            throw new ServletException(e);
        }catch(NamingException e){
            throw new ServletException(e);
        }catch(SQLException e){
            throw new ServletException(e);
        }
        httpResponse.sendRedirect(targetURI);

    }

    private boolean pright(String url, String tnum) throws DBPoolException,
            NamingException, SQLException {
        Connection conn = null;
        try {
            conn = JndiBean.getConnection();
            String sql="select * from priviledge where  locate(module,?)<>0 and Tnum=?";
            PreparedStatement pstmt=conn.prepareStatement(sql);
            pstmt.setString(1,url);
            pstmt.setString(2, tnum);
            ResultSet rs=pstmt.executeQuery();
            if(rs.next())
                return true;
            rs.close();
            pstmt.close();
            sql="select * from priviledge where locate(module,?)<>0";
            pstmt=conn.prepareStatement(sql);
            pstmt.setString(1,url);
            rs=pstmt.executeQuery();
            if(rs.next())
                return false;
            return true;
        } finally {
            if (conn != null)
                conn.close();
        }
    }

    public void init(FilterConfig filterConfig) throws ServletException {
        targetURI = filterConfig.getInitParameter("targetURI");
    }

    public void destroy() {
    }
}

//过滤器配置(web.xml)
<!-- filter to check user privilidge -->
    <filter>
        <filter-name>SessionChecker</filter-name>
        <filter-class>cn.cslg.labsys.filter.SessionChecker</filter-class>
        <init-param>
            <param-name>targetURI</param-name>
            <param-value>/LabSys/index.jsp</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>SessionChecker</filter-name>
        <url-pattern>/outlines/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>SessionChecker</filter-name>
        <url-pattern>/labfile/*</url-pattern>
    </filter-mapping>

//priviledge表结构
TNum(用户名)    module(模块名,即目录名)
s09002        labfile
s09025        labfile

Remove WPF plugin from FireFox

MS released another .NET extension into Firefox. Mozilla is fighting back and disabling the extension.
http://www.ghacks.net/2009/10/17/mic...n-for-firefox/
Your Firefox may have blocked it already, but here's how to remove it.
* Make sure Firefox is closed
* Del "C:\WINDOWS\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\DotNetAssistantExtension\*"
* Run regedit and go to “HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins"
* Delete the microsoft.com/WPF,version=3.5 folder