大家看到标题后的第一个问题可能是:“我们需要这样做吗?”

如果我们开发的是局域网 Web 应用的话,可能没有必要这样做。但如果我们的 Web 应用面向的是互联网上的成千上万的用户,这样做就很必要了。因为在现实世界中并不是所有的用户都有高数率的网络连接,也许用户使用的是拨号接入,移动设备,3G,或者是 USB 网络加密狗。如果我们没有在低数率的网络环境中测试过我们 Web 应用,极有可能在上线后收到一些意想不到的关于系统性能方面的抱怨。这个时候无论我们的 Web 应用界面多么地 Web 2.0,功能多么地强大,对于用户来说都失去了使用价值。

目前有很多工具能够模拟慢速网络,值得一提的是 Firefox Throttle,这是一个 Firefox 插件,你可以设置上载和下载的数率,并且监控当前带宽的使用情况。另一个非常有用的特性是它可以控制你的 localhost 的连接数率,对本地测试很有用。

另一个工具是 Sloppy,它是一个 Java Web Start application。

 

  本文向大家简单描述一下DIV+CSS相对IE6 IE7和IE8兼容问题整理,重点介绍一下IE6 IE7和IE8等浏览器的区别和联系,相信本文介绍一定会让你有所收获。

  DIV+CSS相对IE6 IE7和IE8兼容问题整理

  1.区别IE和非IE浏览器

以下是代码片段:
#tip{
background:blue;/*非IE背景?色*/
background:red9;/*IE6、IE7、IE8背景?色*/
}

  2.区别IE6,IE7,IE8,FF

  【区别符号】:「9」、「*」、「_」

  【示例】:

以下是代码片段:
#tip{
background:blue;/*Firefox背景变蓝色*/
background:red9;/*IE8背景变红色*/
*background:black;/*IE7背景变黑色*/
_background:orange;/*IE6背景变橘色*/
}

  【说明】:因为IE系列浏览器可读「9」,而IE6和IE7可读「*」(米字号),另外IE6可辨识「_」(底线),因此可以依照顺序写下来,就会让浏览器正确的读取到自己看得懂得CSS语法,所以就可以有效区分IE各版本和非IE浏览器(像是Firefox、Opera、 GoogleChrome、Safari等)。

  3.区别IE6、IE7、Firefox(方法1)

  【区别符号】:「*」、「_」

  【示例】:

以下是代码片段:
#tip{
background:blue;/*Firefox背景变蓝色*/
*background:black;/*IE7背景变黑色*/
_background:orange;/*IE6背景变橘色*/
}

  【说明】:IE7和IE6可读「*」(米字号),IE6又可以读「_」(底线),但是IE7却无法读取「_」,至于Firefox(非IE浏览器)则完全无法辨识「*」和「_」,因此就可以透过这样的差异性来区分IE6、IE7、Firefox

  4.区别IE6、IE7、Firefox(方法2)

  【区别符号】:「*」、「!important」

  【示例】:

以下是代码片段:
#tip{
background:blue;/*Firefox背景变蓝色*/
*background:green!important;/*IE7背景变绿色*/
*background:orange;/*IE6背景变橘色*/
}

  【说明】:IE7可以辨识「*」和「!important」,但是IE6只可以辨识「*」,却无法辨识「!important」,至于Firefox可以读取「!important」但不能辨识「*」因此可以透过这样的差异来有效区隔IE6、IE7、Firefox。

  我们知道,PHP语言的合理运用可以帮助我们实现导出Word文档的功能。今天我们将为大家介绍PHP处理Word转PDF的相关实现方法。

  PHP处理Word转PDF代码示例:

PHP代码
  1. <?php       
  2. set_time_limit(0);       
  3. function MakePropertyValue($name,$value,$osm){       
  4. $oStruct = $osm->Bridge_GetStruct       
  5. ("com.sun.star.beans.PropertyValue");       
  6. $oStruct->Name = $name;       
  7. $oStruct->Value = $value;       
  8. return $oStruct;       
  9. }       
  10. function word2pdf($doc_url$output_url){       
  11. $osm = new COM("com.sun.star.ServiceManager")       
  12. or die ("Please be sure that OpenOffice.org     
  13. is installed.
    "
    );       
  14. $args = array(MakePropertyValue("Hidden",true,$osm));       
  15. $oDesktop = $osm->createInstance("com.sun.star     
  16. .frame.Desktop");       
  17. $oWriterDoc = $oDesktop->loadComponentFromURL       
  18. ($doc_url,"_blank", 0, $args);       
  19. $export_args = array(MakePropertyValue       
  20. ("FilterName","writer_pdf_Export",$osm));       
  21. $oWriterDoc->storeToURL($output_url,$export_args);       
  22. $oWriterDoc->close(true);       
  23. }       
  24. $output_dir = "D:/LightTPD/htdocs/";       
  25. $doc_file = "D:/LightTPD/htdocs/2.doc";       
  26. $pdf_file = "2.pdf";       
  27. $output_file = $output_dir . $pdf_file;       
  28. $doc_file = "file:///" . $doc_file;       
  29. $output_file = "file:///" . $output_file;       
  30. word2pdf($doc_file,$output_file);       
  31. ?>  

    * 在支持position:fixed的浏览器上使用position:fixed,这样当拖动共同条的时候弹窗位置是固定的。
    * 优化了IE6下onscroll 事件绑定的函数

还需改进的地方(过段事件等项目应用的时候会修改):

    * 30秒后自动关闭
    * 方便的插入弹出内容

 

JavaScript代码
  1. var RBMessage={      
  2.     boxW:200,      
  3.     boxH:101,      
  4.     init:function(){      
  5.         var that = this;      
  6.         this.createBox();      
  7.         document.getElementById("msg_close").onclick = function() {      
  8.             that.BoxWin.style.display="none";      
  9.         }      
  10.     },      
  11.     bind: function() { //绑定窗口滚动条与大小变化事件      
  12.         var that = this,      
  13.         st, rt;      
  14.         window.onscroll = function() {      
  15.             if( !!window.ActiveXObject &amp;&amp; !window.XMLHttpRequest ){      
  16.                 clearTimeout(st);      
  17.                 clearTimeout(that.timer2);      
  18.                 that.setOpacity(0);      
  19.                 st = setTimeout(function() {      
  20.                     that.BoxWin.style.top = that.getY().top;      
  21.                     that.show();      
  22.                 },500);      
  23.             }      
  24.         };      
  25.         window.onresize = function(){      
  26.             if (!!window.ActiveXObject &amp;&amp; !window.XMLHttpRequest) {      
  27.                 clearTimeout(rt);      
  28.                 rt = setTimeout(function(){      
  29.                     that.BoxWin.style.top = that.getY().top      
  30.                 }, 100);      
  31.             }      
  32.         }      
  33.     },      
  34.     show: function() { //渐显      
  35.         clearInterval(this.timer2);      
  36.         var that = this,      
  37.         fx = this.fx(0, 100, 0.1),      
  38.         t = 0;      
  39.         this.timer2 = setInterval(function() {      
  40.             t = fx();      
  41.             that.setOpacity(t[0]);      
  42.             if (t[1] == 0) {      
  43.                 clearInterval(that.timer2)      
  44.             }      
  45.         },      
  46.         10);      
  47.     },      
  48.     fx: function(a, b, c) { //缓冲计算      
  49.         var cMath = Math[(a – b) > 0 ? "floor""ceil"],      
  50.         c = c || 0.1;      
  51.         return function() {      
  52.             return [a += cMath((b – a) * c), a – b]      
  53.         }      
  54.     },      
  55.     setOpacity: function(x) { //设置透明度      
  56.         var v = x >= 100 ? ‘‘‘Alpha(opacity=‘ + x + ‘)‘;      
  57.         this.BoxWin.style.visibility = x < = 0 ? ‘hidden‘‘visible‘//IE有绝对或相对定位内容不随父透明度变化的bug      
  58.         this.BoxWin.style.filter = v;      
  59.         this.BoxWin.style.opacity = x / 100;      
  60.     },      
  61.     getY: function() { //计算移动坐标      
  62.         var d = document,      
  63.         b = document.body,      
  64.         e = document.documentElement;      
  65.         var s = Math.max(b.scrollTop, e.scrollTop);      
  66.         var h = /BackCompat/i.test(document.compatMode) ? b.clientHeight: e.clientHeight;      
  67.         var h2 = this.BoxWin.offsetHeight;      
  68.         return {      
  69.             foot: s + h + h2 + 2 + ‘px‘,      
  70.             top: s + h – h2 – 2 + ‘px‘     
  71.         }      
  72.     },      
  73.     moveTo: function(y) { //移动动画      
  74.         clearInterval(this.timer);      
  75.         var that = this;      
  76.         var moveTopNum=-that.boxH;      
  77.         this.timer = setInterval(function() {      
  78.             moveTopNum+=5;      
  79.             that.BoxWin.style.bottom =  moveTopNum +‘px‘;      
  80.             if (moveTopNum >= 0) {      
  81.                 clearInterval(that.timer);      
  82.                 that.bind();      
  83.             }      
  84.         },50);      
  85.         return this;      
  86.     },      
  87.     createBox:function(){      
  88.         this.BoxWin=document.createElement(‘div‘);      
  89.         this.BoxWin.style.width = this.boxW+"px";      
  90.         this.BoxWin.style.height =  this.boxH+"px";      
  91.         this.BoxWin.style.bottom = – this.boxH+"px";      
  92.         this.BoxWin.id = "msg_win";      
  93.         this.BoxWin.innerHTML = ‘<div class="icos"><a href="javascript:void 0" title="关闭" id="msg_close">X</a></div><div id="msg_title">温馨提示(标题)</div><div id="msg_content"></div>‘;      
  94.         document.body.appendChild(this.BoxWin);      
  95.         var that = this;      
  96.         setTimeout(function() { //初始化最先位置      
  97.             that.BoxWin.style.display = ‘block‘;      
  98.             that.moveTo();      
  99.         },1000);      
  100.         return this;      
  101.     }      
  102. };      
  103. RBMessage.init();    

手工法:

Click Start, click Run, type regedit, and then click OK.

  1. In the left pane, locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsNTCurrent VersionWPAEvents
  2. In the right pane, right-click OOBETimer, and then click Modify.
  3. Change at least one digit of the OOBETimer value to deactivate Windows.
  4. Click Start, click Run, type the following command, and then click OK:
    %systemroot%system32oobemsoobe.exe /a
  5. Click Yes, I want to telephone a customer service representative to activate Windows, and then click Next.
  6. Click Change Product key, type the new product key in the New key boxes, and then click Update. 



    Note If the previous Activation Wizard screen appears again, click Remind me later, and then restart the computer.
  7. Repeat steps 6 and 7 to verify that Windows is started. Click OK when you receive the following message:
    Windows is already activated. Click OK to exit.
  8. Install any Windows service packs that you want to install. 



    Note If you cannot restart Windows after you install a service pack, press F8 when you restart the computer, click Last Known Good Configuration, and then repeat this procedure.

 

脚本法:

ChangeVLKeySP1.vbs

ASP/Visual Basic代码
  1. ‘    
  2. ‘ WMI Script – ChangeVLKey.vbs   
  3.   
  4. ‘ This script changes the product key on the computer.   
  5.   
  6. ‘***************************************************************************   
  7.   
  8. ON ERROR RESUME NEXT   
  9.   
  10.   
  11. if Wscript.arguments.count<1 then   
  12.    Wscript.echo "Script can‘t run without VolumeProductKey argument"  
  13.    Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX"  
  14.    Wscript.quit   
  15. end if   
  16.   
  17. Dim VOL_PROD_KEY   
  18. VOL_PROD_KEY = Wscript.arguments.Item(0)   
  19. VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-",""‘remove hyphens if any   
  20.   
  21. for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")   
  22.   
  23.    result = Obj.SetProductKey (VOL_PROD_KEY)   
  24.   
  25.    if err <> 0 then   
  26.       WScript.Echo Err.Description, "0x" & Hex(Err.Number)   
  27.       Err.Clear   
  28.    end if   
  29.   
  30. Next  

 

 

 

ChangeVLKey2600.vbs

 

ASP/Visual Basic代码
  1. ‘    
  2. ‘ WMI Script – ChangeVLKey.vbs   
  3.   
  4. ‘ This script changes the product key on the computer.   
  5.   
  6. ‘***************************************************************************   
  7.   
  8. ON ERROR RESUME NEXT   
  9.   
  10. if Wscript.arguments.count<1 then   
  11.    Wscript.echo "Script can‘t run without VolumeProductKey argument"  
  12.    Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX"  
  13.    Wscript.quit   
  14. end if   
  15.   
  16. Dim VOL_PROD_KEY   
  17. VOL_PROD_KEY = Wscript.arguments.Item(0)   
  18. VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-",""‘remove hyphens if any   
  19. Dim WshShell   
  20. Set WshShell = WScript.CreateObject("WScript.Shell")   
  21. WshShell.RegDelete "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWPAEventsOOBETimer" ‘delete OOBETimer registry value   
  22. for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")   
  23.   
  24.    result = Obj.SetProductKey (VOL_PROD_KEY)   
  25.   
  26.    if err <> 0 then   
  27.       WScript.Echo Err.Description, "0x" & Hex(Err.Number)   
  28.       Err.Clear   
  29.    end if   
  30.   
  31. Next   

    我们知道使用 Gmail 给美国和加拿大拨打电话是完全免费的,现在 Google 则再一次震撼到了我们!只要使用 Gmail 拨打国内电话,通话双方均全部免费!

    操作的步骤如下:

    1、确保登录 Gmail 后可以看到在 Chat 列表中看到 "Call phone"按钮。这有2个方法:

    其一、使用美国或加拿大 IP 地址登录 Gmail 肯定能看到该按钮;
    其二、把 Gmail 语言设置成 US English ,也是有可能使用到呼叫功能的。

    2、安装 Gmail voice and video chat 浏览器插件。

    3、点击"Chat"列表中的"Call phone"按钮,拨打你自己的 Google Voice 手机号,如:(111) 222-333

    4、听到 Google Voice 语音提示:“您当前没有新的消息,按“2”健拨打电话,按“4”健更改设置”。我们按“2”健。

    5、再次听到 Google Voice 语音提示:“请按键输入您要拨打的电话号码,按“#”号健确认。如果是国际长途,则请先按键“011”,再输入国家号,最后输入电话号码”。

    举2个例子:

    如果我要拨打的中国移动手机号为:13866667777,则我应按键输入:0118613866667777#
    如果我要拨打的国内固定电话号码为:021-77778888,则我应按键输入:011862177778888#(注:21为上海区号,大家不要输入021,这是错误的。)

    6、再次听到 Google Vocie 语音提示:“这是一个免费电话!”,接下来电话就直接接通了呢。

    这么大的好事,大家赶紧自己动手试试吧!

常用路由器默认密码集合

  艾玛 701g

  用户名:admin 密码:admin

  用户名:SZIM 密码:SZIM

  艾玛701H

  用户名:admin 密码:epicrouter

  Adsl Router

  用户名:anonymous 密码:12345

  华为 MT800

  用户名:admin 密码:admin

  Home Gateway

  用户名:user 密码:password

  Viking:

  用户名:root 密码:root

  TP-link

  用户名:admin 密码:admin

  实达2110EH ROUTER

  用户名:user 密码:password

  用户名:root 密码:grouter

  神州数码/华硕:

  用户名:adsl 密码:adsl1234

  全向:

  用户名:root 密码:root

  普天/大亚:

  用户名:admin 密码:dare

  UT斯达康

  用户名:admin 密码:dare

  e-tek

  用户名:admin 密码:12345

  zyxel

  用户名:anonymous 密码:1234

  北电

  用户名:anonymous 密码:12345

  大恒

  用户名:admin 密码:admin

  大唐

  用户名:admin 密码:1234

  斯威特

  用户名:root 密码:root

  用户名:user 密码:user

  中兴

  用户名:adsl 密码:adsl831 (中兴的adsl的密码前面为adsl,后面为型号,比如中兴831,密码就是adsl831)

  成都天逸 用户名:admin 密码:epicrouter

  上海中达 用户名:(随意) 密码:12345

  品牌:ViKing

  用户名:adsl 密码:adsl1234

  品牌:实达

  版本:2110ehr v3.20、 2110ehr v3.21、 2110ehr v3.51

  用户名:admin 密码:conexant

  版本:2110ehr v4.5

  用户名:root 密码:grouter

  版本:2110eh v3.51(中文web界面)

  用户名:admin 密码:starnetadsl

  品牌:艾玛

  用户名:admin 密码:admin

  品牌:神州数码/华硕

  用户名:adsl 密码:adsl1234

  品牌:全向

  用户名:root 密码:root

  品牌:普天

  用户名:putian 密码:123456

  品牌:e-tek

  用户名:admin 密码:12345

  品牌:zyxel

  用户名:anonymous密码:1234

  品牌:北电

  用户名:anonymous 密码:12345

  品牌:大恒

  用户名:admin 密码:admin

  品牌:大唐

  用户名:admin 密码:1234

  品牌:斯威特

  用户名:root 密码:root

  用户名:user 密码:user

  品牌:中兴

  用户名:adsl 密码:adsl831

  品牌:BENQ

  用户名:user 密码:benq1234

  品牌:华硕

  用户名:ADSL 密码:adsl1234

  艾玛 701g

  192.168.101.1 192.168.0.1

  用户名:admin 密码:admin

  用户名:SZIM 密码:SZIM

  艾玛701H

  用户名:admin 密码:epicrouter

 

1. 将服务器类型更改为 NTP。为此,请按照下列步骤操作:
a.  单击“开始”,单击“运行”,键入 regedit,然后单击“确定”。
b.  找到并单击下面的注册表子项:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeParametersType
c.  在右窗格中,右键单击“Type”,然后单击“修改”。
d.  在“编辑值”的“数值数据”框中键入 NTP,然后单击“确定”。

2. 将 AnnounceFlags 设置为 5。为此,请按照下列步骤操作:
a.  找到并单击下面的注册表子项:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfigAnnounceFlags
b.  在右窗格中,右键单击“AnnounceFlags”,然后单击“修改”。
c.  在“编辑 DWORD 值”的“数值数据”框中键入 5,然后单击“确定”。

3. 启用 NTPServer。为此,请按照下列步骤操作:
a.  找到并单击下面的注册表子项:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer
b.  在右窗格中,右键单击“Enabled”,然后单击“修改”。
c.  在“编辑 DWORD 值”的“数值数据”框中键入 1,然后单击“确定”。

进服务-停止windows time 服务, 再启动windows time  服务。 这样时间服务器就配置完毕
客户机设置:
册表项 MaxPosPhaseCorrection
路径 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig
十进制修改为999999999
注册表项 MaxNegPhaseCorrection
路径 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig
十进制修改为999999999
上面2项修改意思为:可以同步时间超过31年的时间差。因为XP默认为15小时, 超过15小时差就不给自动更新时间。
注册表项 NtpServer
路径 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeParameters
十进制修改为192.168.*.* (服务器地址)
注册表项 SpecialPollInterval
路径HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpClient
修改为600  意思为10分钟自动更新时间一次  默认为7天更新一次
进服务-停止windows time 服务, 再启动windows time  服务。客户机设置完毕!

数据库的使用过程中由于程序方面的问题有时候会碰到重复数据,重复数据导致了数据库部分设置不能正确设置……

方法一

declare @max integer,@id integer
declare cur_rows cursor local for select 主字段,count(*) from 表名 group by 主字段 having count(*) > 1
open cur_rows
fetch cur_rows into @id,@max
while @@fetch_status=0
begin
select @max = @max -1
set rowcount @max
delete from 表名 where 主字段 = @id
fetch cur_rows into @id,@max
end
close cur_rows
set rowcount 0

方法二

有两个意义上的重复记录,一是完全重复的记录,也即所有字段均重复的记录,二是部分关键字段重复的记录,比如Name字段重复,而其他字段不一定重 复或都重复可以忽略。

1、对于第一种重复,比较容易解决,使用

select distinct * from tableName

就可以得到无重复记录的结果集。

如果该表需要删除重复的记录(重复记录保留1条),可以按以下方法删除

select distinct * into #Tmp from tableName
drop table tableName
select * into tableName from #Tmp
drop table #Tmp

发生这种重复的原因是表设计不周产生的,增加唯一索引列即可解决。

2、这类重复问题通常要求保留重复记录中的第一条记录,操作方法如下

假设有重复的字段为Name,Address,要求得到这两个字段唯一的结果集

select identity(int,1,1) as autoID, * into #Tmp from tableName
select min(autoID) as autoID into #Tmp2 from #Tmp group by Name,autoID
select * from #Tmp where autoID in(select autoID from #tmp2)

最后一个select即得到了Name,Address不重复的结果集(但多了一个autoID字段,实际写时可以写在select子句中省去此 列)