有点意思,,摘下来
|
Hi, my friend
I will remember this day forever, because this is my first attempt to find a soul mate so far from my native land. It is so difficult for me to realize that I decided to do it. But as you see, I am here, and it is my letter which you hold into your arms now. I hope that it will leave only a good impression into your heart and your reaction will be your reply to me. I wait for your reply very much, I think that it will change all my life at one moment, because you will bring romantic notes into my destiny. You look so smart that no woman can stand still and think logically. Romantic thoughts visit me when I look at you. I leave you my heart here
|
|
作者:
qiuqiu | 分类:
English |
评论: 0
|
引用: 0
| 浏览: 6 |
php+javascript动态显示服务器运行程序的进度条
|
<?php //set_time_limit(0); //注意,如果是安全模式,请不要打开,如果不是安全模式,这个选项可以打开 for ($i = 0; $i < 500; $i++) { $users[] = 'Tom_' . $i; } //end for $width = 500; //显示的进度条长度,单位 px $total = count($users); //总共需要操作的记录数 $pix = $width / $total; //每条记录的操作所占的进度条单位长度 $progress = 0; //当前进度条长度 ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd"> <html> <head> <title>动态显示服务器运行程序的进度条</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style> body, div input { font-family: Tahoma; font-size: 9pt } </style> <script language="JavaScript"> <!-- function updateProgress(sMsg, iWidth) { document.getElementById("status").innerHTML = sMsg; document.getElementById("progress").style.width = iWidth + "px"; document.getElementById("percent").innerHTML = parseInt(iWidth / <?php echo $width; ?> * 100) + "%"; } //--> </script> </head>
<body> <div style="margin: 4px; padding: 8px; border: 1px solid gray; background: #EAEAEA; width: <?php echo $width+8; ?>px"> <div><font color="gray">如下进度条的动态效果由服务器端 PHP 程序结合客户端 JavaScript 程序生成。</font></div> <div style="padding: 0; background-color: white; border: 1px solid navy; width: <?php echo $width; ?>px"> <div id="progress" style="padding: 0; background-color: #FFCC66; border: 0; width: 0px; text-align: center; height: 16px"></div> </div> <div id="status"> </div> <div id="percent" style="position: relative; top: -30px; text-align: center; font-weight: bold; font-size: 8pt">0%</div> </div> <?php flush(); //将输出发送给客户端浏览器 foreach ($users as $user) { // 在此处使用空循环模拟较为耗时的操作,实际应用中需将其替换; // 如果你的操作不耗时,我想你就没必要使用这个脚本了 :) // 请在这里处理你的业务 for ($i = 0; $i < 50; $i++) { ;; } ?> <script language="JavaScript"> updateProgress("正在操作用户<?php echo $user; ?>....", <?php echo min($width, intval($progress)); ?>); </script> <?php flush(); //将输出发送给客户端浏览器,使其可以立即执行服务器端输出的 JavaScript 程序。 $progress += $pix; } //end foreach // 最后将进度条设置成最大值 $width,同时显示操作完成 ?> <script language="JavaScript"> updateProgress("操作完成!", <?php echo $width; ?>); </script> <?php flush(); ?> </body> </html>
|
|
作者:
qiuqiu | 分类:
php |
评论: 0
|
引用: 0
| 浏览: 25 |
更改winxp和server2003的远程桌面端口
|
winxp:
1. 启动注册表编辑器 (Regedt32.exe)。 2. 在注册表中找到下面的项: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber 3. 在编辑菜单上,单击修改,单击十进制,键入新的端口号,然后单击确定。 4. 退出注册表编辑器。 注意:当试图使用远程桌面连接来连接到这台计算机时,必须键入新的端口号,格式为"IP:new-port"。
server2003在相似的注册表项。
|
|
作者:
qiuqiu | 分类:
其它 |
评论: 0
|
引用: 0
| 浏览: 13 |
怎样写一个脚本来判断那些进程已经死去,并KILL掉?
|
用 $username =`whoami`; chomp($username); @aa = `ps -ef|grep $username|grep -v grep |grep -v ps|cut -c8-14`; for(@aa){ chomp; next unless /^\d+$/; unless( kill 0 =>;$_){ kill 9 =>; $_; } }
-c8-14可能隨著系統不同.. 而且上面我修改後的好處是只會刪除自己的process id 不會跟其他人的有關係.. 另外如果是root要做..把grep $username拿掉就可以了..
因為kill -0 $pid只對..自己的process有用..其他人的沒用..
|
|
作者:
qiuqiu | 分类:
其它 |
评论: 0
|
引用: 0
| 浏览: 215 |
利用参数实现Windows Media Encoder启动后自动开始编码
|
很多朋友都在使用
"采集卡 + Windows Media Encoder + Windows Media Serveice"
的方案进行网络实时视频广播,如转播足球直播和精彩电视频道等
在使用WME的过程中,如果机器重新启动
则需要手动打开WME,然后点击"启动编码"按钮开始编码
这样就很不方便,经过一段时间的摸索,我终于找到WME自动启动的方法
以XP为例。
首先,为编码工作站建立一个账户如"Encoder",密码为空
并在账户设置中打开"启用欢迎屏幕选项"
这样是为了系统重新启动时自动进入系统
然后,建立你的视频编码方案并命名保存,如"TEST"
此时会生成一个名字为"TEST"的编码方案配置文件,后缀为"WEM"
然后在桌面上为编码程序wmenc.exe建立一个快捷方式
右键单击该快捷方式并选择"快捷方式"标签,会出现下图所示界面:
在目标一栏的内容的最后添加"TEST.wme -start",点击应用、确定
最后就是把这个快捷方式拖到启动目录中,大功告成
重新启动计算机,你会发现计算机会自动进入系统--->启动解码器--->开始编码
哈哈,实现无人职守了
|
|
作者:
qiuqiu | 分类:
其它 |
评论: 0
|
引用: 0
| 浏览: 162 |