默认分类

改变系统hosts的软件(PYTHON写的)

Posted in 默认分类 on 一月 7th, 2010 by admin – Be the first to comment

做前端,测试,程序开发需要不停的转换系统hosts文件。
用批处理与EDIT在集成测试时比较麻烦,所以写下这个软件

FOR XP
改变系统hosts工具-XP
FOR WIN7
改变系统hosts工具-windows7

其他平台没有试过。
使用 python2.5 + wxpython2.8 + py2exe
功能比较简单。

回车关闭弹出层

Posted in 默认分类 on 十二月 3rd, 2009 by admin – Be the first to comment

//按回车关闭按钮事件
//需要在页面的body加个事件


  function key_layer_close_v31(e){
        var isie = (document.all) ? true : false;
        var key = isie ? window.event.keyCode : e.which ;
        if(key==13){
	    if(document.getElementById('phishing').style.display=='block' && document.getElementById('read_complete').disabled == false ){
		UED.layer31.close();
	    }
	}
	return false;
  }

清除IE6在HTTPS安全提示问题

Posted in 默认分类 on 十一月 24th, 2009 by admin – Be the first to comment

1. 检查所有的iframe中是否有为空的或者引用其他地方(如果有为空的,需要设计为 JAVASCRIPT:FALSE)
2. 不能引用外部的HTTP相关内容(可以使用HTTPS引用,图片样式与脚本)

访问GOOGLE相册

Posted in 默认分类 on 十月 10th, 2009 by admin – Be the first to comment

1. win+r
notepad.exe C:\WINDOWS\system32\drivers\etc\hosts
2. 增加
203.208.39.99 lh1.ggpht.com lh2.ggpht.com lh3.ggpht.com lh4.ggpht.com lh5.ggpht.com lh6.ggpht.com lh7.ggpht.com
203.208.39.99 lh8.ggpht.com

重启浏览器

同事提供的题目(Taobao)

Posted in 默认分类 on 十月 10th, 2009 by admin – Be the first to comment
alert(toRGB("#0000FF"));     //返回rgb(0,0,255)
alert(toRGB("#00F"));     //返回rgb(0,0,255)
alert(toRGB("#FF0000"));     //返回rgb(255,0,0)
alert(toRGB("taobao"));     //返回rgb(taobao)
alert(toRGB("#G00"));     //返回rgb(#G00)

function toRGB(color){

    //第有一字符有#号
    if(color.indexOf('#')==0){

        //判断长度
        if(color.length==4){
            //取出字母
            r = color.match(/([\da-z])/ig);
        }else{
            //取出字母
            r = color.match(/([\da-z]{2})/ig);
        }
        //返回
        return 'rgb('+formatHEX(r) +')';
    }else{
        return 'rgb('+color+')';
    }
}
//转化色彩数组转为10进制
function formatHEX(x){

    var html=[];
    for(i in x){
        html[i] = parseInt(x[i], 16);
        if(isNaN(html[i])){
            return '#'+x.join('');
        }
    }
    return html.join(',');
}

window server2008 开启无线支持

Posted in 默认分类 on 九月 28th, 2009 by admin – Be the first to comment

1. start -> administrarot tools -> server manager
2. 选中左边中的 features -> 右边增加 ad features
3. wireless lan service -> installl

sqliteadmin非常好的sqlite3客户端

Posted in 默认分类 on 九月 21st, 2009 by admin – Be the first to comment

开源免费, 还很好用, 最重要的还有中文!
http://download.orbmu2k.de/files/sqliteadmin.zip
没有理由不用啊.

80 端口被占用,启动apache失败的解决方法

Posted in 默认分类 on 九月 8th, 2009 by admin – Be the first to comment

首先用netstat -ano 看是得到占用80端口的进程的PID,然后打开任务管理器,
选择  查看->选择列,勾上PID(进程标识符),结束这个进程,再启动APACHE就成功了

可以使用 netstat -ano ->1.txt 产生比较多的内容

完美的表格(CSS与HTML)

Posted in 默认分类 on 八月 26th, 2009 by admin – Be the first to comment

理论上兼容所有浏览器(FF,GG,IE)其他未测试

table{ border-collapse:collapse;border:1px solid #CCC;background:#efefef;width:100%}
table th{ font-weight:bold; padding:.5em 2em .5em .75em; line-height:1.6em; font-size:12px; border:1px solid #CCC;}
table td{ padding:.5em .75em; line-height:1.6em; font-size:12px; border:1px solid #CCC;}
1
1

编码问题导致Javascript报错.

Posted in 默认分类 on 八月 20th, 2009 by admin – Be the first to comment

问题: 报JS标签没有关闭.
原因: JS没有修改过且线上版本也是正常的,但在测试环境下.

解决: 跟踪了很久, 变量, 常量, 数组是正常了. 后来看到页面上JS输出的内容乱码.
这里想到可能是 页面编码 与 JS编码不同导致的问题.


程序的页面是GB2312的, 但我们写的JS都是UTF8的…