分类目录归档:技术文章

关于战地之王AVA、CF的窗口化工具

这几天玩了腾讯的这两个山寨游戏,不过有点不爽的是,都没的窗口化,而且切出屏幕后,然后在回去很不爽,简直就是超级不爽。操作起来太麻烦了,但是有是挂着QQ,想玩下游戏,在随便聊一下。找了好久都没找到好的窗口化工具。

突然想到,用WM装个虚拟机,然后虚拟机装个XP 或者98,然后在里面玩游戏,应该可以。哈哈,估计现在的硬件,98的驱动都找不到了。。。。。。不过可能会卡,下次试试看。这个方法应该可行。

滚动条样式定义 Overflow

1,Overflow内容溢出时的设置

overflow 水平及垂直方向内容溢出时的设置 
overflow-x 水平方向内容溢出时的设置 
overflow-y 垂直方向内容溢出时的设置

以上三个属性设置的值为visible、scroll、hidden、auto

visible 默认值。使用该值时,无论设置的”width”和”height”

的值是多少,其中的内容无论是否超出范围都将被强制显示。 
hidden 效果与visible相反。任何超出”width”和”height”的内

容都会不可见。 
scroll 无论内容是否超越范围,都将显示滚动条。 
auto 当内容超出范围时,显示滚动条,否则不显示。

应用:

没有水平滚动条:
<div style=”overflow-x:hidden”>test</div>

没有垂直滚动条 
<div style=”overflow-y:hidden”>test</div>
没有滚动条 
<div style=”overflow-x:hidden;overflow-y:hidden” 或

style=”overflow:hidden”>test</div>

自动显示滚动条
<div

style=”height:100px;width:100px;overflow:auto;”>test</di

v>

2,自己定义滚动条的颜色

我们一般默认的滚动条样式如下左图,右图是放大了1600倍的样

子,我们可以看到滚动条有几种言责组合的,我给他们标了7个号,

分别注释在下面的css代码的后面了,注意css的注释代码是放在

两个斜杠内的两个星号之间,如:/*这里放注释的代码*/

Body {
scrollbar-arrow-color: #f4ae21; /*三角箭头的颜色*/
scrollbar-face-color: #333; /*立体滚动条的颜色*/
scrollbar-3dlight-color: #666; /*立体滚动条亮边的颜

色*/
scrollbar-highlight-color: #666; /*滚动条空白部分的

颜色*/
scrollbar-shadow-color: #999; /*立体滚动条阴影的颜

色*/
scrollbar-darkshadow-color: #666; /*立体滚动条强阴

影的颜色*/
scrollbar-track-color: #666; /*立体滚动条背景颜色*/

scrollbar-base-color:#f8f8f8; /*滚动条的基本颜色*/
Cursor:url(mouse.cur); /*自定义个性鼠标*/
}

以上2项适用与<body>、<div>、<textarea>、<iframe>
<>
<head>
<meta http-equiv=”Content-Language” content=”zh-cn”>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<title>用CSS控制滚动条样式</title>
<STYLE>
BODY {
}
</STYLE>
</head>
<body>
<p>&nbsp;</p>
</body>
</html>

overflow

定义和用法

overflow 属性规定如何处理如何处理不符合元素框的内容。

语法:

Object.style.overflow=visible|hidden|scroll|auto

可能的值

描述
visible 内容不会被修剪,会呈现在元素框之外。
hidden 内容会被修剪,但是浏览器不会显示供查看内容的滚动条。
scroll 内容会被修剪,但是浏览器会显示滚动条以便查看其余的内容。
auto 由浏览器决定如何显示。如果需要,则显示滚动条。

实例

本例使用 overflow 来显示溢出元素框的内容:

<>
<head>
<style type="text/">
div
{
border:thin solid green;
width:100px;
height:100px;
}
</style>
<script type="text/javascript">
function hideOverflow()
{
document.getElementById("div1").style.overflow="hidden";
}
</script>
</head>
<body>

<div id="div1">
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</div>
<br />
<input type="button" onclick="hideOverflow()"
value="Hide overflow" />

</body>
</html>

表格内也有滚动条 HTML CSS

就是说让内页里面有些内容固定了高度或者宽度 实现滚动条拖动显示。

<>
<head>
<title> Scroll </title>

<style>

body { overflow: hidden; }
</style>

</head>

<body>
<div style=”overflow:scroll; height:100px; width: 100px;”>
<table >
<tr>
 <td>内容</td>
 <td></td>
 <td>内容</td>
</tr>
</table>

</div>
</body>
</html>

<div style=”overflow:scroll; height:100px; width: 100px;”>根据需要也可以修改参数,比如

可设为<div style=”overflow:auto; height:100px; width: 100px;”>等

HTML网页中插入透明FLASH

最简单的插入Flash的代码,透明,无坐标控制:
  注意wmode=”transparent”是控制Flash是否透明显示的,如果不想让他显示为透明的,直接把wmode=”transparent”去掉即可。

<EMBED height=60 pluginspage=http://www.macromedia.com/go/getflashplayer src=/flash.swf type=application/x-shockwave- width=468 wmode=”transparent” quality=”high”></EMBED>

Swf透明、绝对坐标控制

<EMBED style=”LEFT: 60px; WIDTH: 468px; POSITION: absolute; TOP: 200px; HEIGHT: 1000px” align=right src=flash/flash.swf width=568 height=60 type=application/octet-stream ;; quality=”high” wmode=”transparent”>

Swf透明、相对坐标控制

主要是使用表格作为容器,把Flash“装”到表格里,这样不管浏览者把浏览器拉多大,Flash永远和表格一起动。

<table border=”0″ cellPadding=”0″ cellSpacing=”0″ width=600 height=382 align=center
background=flash/backgroud.jpg>
<TD width=600 height=382><EMBED pluginspage=http://www.macromedia.com/go/getflashplayer
src=flash/flash.swf width=”100%” height=”100%”
type=application/x-shockwave-flash wmode=”transparent”
quality=”high”></EMBED></TD></td></table>

iphone4用iTunes恢复备份出现“未能恢复iphone 发生未知错误1013 ”解决办法

昨天越狱弄的那个cydia不小心被删了,只能重新恢复固件再重新越狱,又出现这个问题,搞的郁闷死。后来网上找到解决办法,恢复备份成功,不过原来的软件游戏什么的肯定都没了。

1.还原操作系统host文件
Windows用户请打开:C:\Windows\System32\drivers\etc\,找到Hosts文件,用记事本打开,找到如下语句,
. 74.208.10.249 gs.apple.com 将其删除即可。

2.关闭itunes,再打开,使用itunes恢复即可。

3.如果还是有1013错误提示,找到itunes下载iphone固件包的文件夹
C:\Documents and Settings\用户名\Application Data\Apple Computer\\iPod Software Updates
然后打开itunes  连上手机,这时候会提示恢复并更新,点取消,按shift+恢复,选择下载的4.2.1固件文件,恢复中

linux DD 硬盘读写速度测试命令

1. 首先用自带的dd命令先测一下, 块大小为8k

dd只能提供一个大概的测试结果,而且是连续IO 而不是随机IO

读测试
# time dd if=/dev/sda2 of=/dev/null bs=8k count=8388608
8388608+0 records in
8388608+0 records out
68719476736 bytes (69 GB) copied, 516.547 seconds, 133 MB/s
real   8m36.926s
user   0m0.117s
sys    0m55.216s
#因为/dev/sda2是一个物理分区,对它的读取会产生IO,/dev/null是伪设备,相当于黑洞,of到该设备不会产生IO,所以,这个命令的IO只发生在/dev/sdb1上,也相当于测试磁盘的读能力。

写测试
# time dd if=/dev/zero f=/opt/iotest bs=8k count=8388608
8388608+0 records in
8388608+0 records out
68719476736 bytes (69 GB) copied, 888.398 seconds, 77.4 MB/s
real   14m48.743s
user   0m3.678s
sys    2m47.158s
#因为/dev/zero是一个伪设备,它只产生空字符流,对它不会产生IO,所以,IO都会集中在of文件中,of文件只用于写,所以这个命令相当于测试磁盘的写能力。

读写测试
# time dd if=/dev/sda2 f=/opt/iotest bs=8k count=8388608
8388608+0 records in
8388608+0 records out
68719476736 bytes (69 GB) copied, 1869.89 seconds, 36.8 MB/s
real   31m10.343s
user   0m2.613s
sys    3m25.548s

PHP天气预报小偷代码

<?

*************************************************************************/

@header(“Content-Type:text/;charset=gb2312”);

 error_reporting(0);

/*******************看weather.txt的修改时间是否为当天,如果是昨天的就要上网抓结果***********/

     $tmp = filemtime(“weather.txt”);

    $tt1=date(“Ymd”,$tmp).”<br>”;

    $tt2=date(“Ymd”);

    if ($tt1<$tt2) {

    //echo “要抓结果”;

    unlink(“weather.txt”);

    $url = “http://php.weather.sina.com.cn/search.php?city=广州” ;

    $content = file_get_contents($url);

    preg_match_all(‘/<div>(.+?)</DIV>/si’,$content,$result);

    for($i=0;$i<2;$i++){

        $x= strip_tags($result[1][$i]).”n”;

        $handle = fopen (“weather.txt”, “a”);

            fwrite($handle, $x);

         fclose($handle);

      }

      listweather();

    } else {

        // echo “直接从weather.txt读结果”;   

        listweather();

    }

    //天气显示函数

    function listweather() {

    $filename=”weather.txt”;

    $handle=fopen($filename,”r”);

    if ($handle) {   

        $contents=fread($handle,filesize($filename));

        fclose($handle);

        $cc=explode(“n”,$contents);

        $today=explode(” “,$cc[0]);

        $tomo=explode(” “,$cc[1]);

?>

<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>

<table width=”200″ height=”85″  cellspacing=”0″ bordercolordark=”#FFFFFF” bordercolorlight=”#000000″ border=”1″ align=”center” cellpadding=”2″>

  <tr bgcolor=”#6b8ba8″ style=”color:FFFFFF”>

    <td height=”22″ colspan=”3″>

      <div align=”center”>未来48小时天气预报</div></td>

  </tr>

  <!–<tr bgcolor=”#0066FF”> –>

  <tr >

    <td width=”54″ height=”21″>

      <div align=”center”><font style=”font-size=14px” color=”#000000″>时间</font></div></td>

    <td width=”88″>

      <div align=”center”><font style=”font-size=14px” color=”#000000″>天气情况</font></div></td>

    <td width=”90″>

      <div align=”center”><font  style=”font-size=14px” color=”#000000″>温度℃</font></div></td>

  </tr>

  <tr >

    <td height=”19″ >

      <div align=”center”> <font style=”font-size=14px”>今天</font></div></td>

    <td>     

      <div align=”center”><font style=”font-size=14px”><?php echo $today[0]?></font></div></td>

    <td>    

      <div align=”center”><font style=”font-size=14px”><?php echo ereg_replace(“℃”,””,$today[1])?>℃</font></div></td>

  </tr>

  <tr>

    <td height=”18″>

      <div align=”center”><font style=”font-size=14px”>明天</font></div></td>

    <td>

      <div align=”center”><font style=”font-size=14px”><?php echo $tomo[0]?></font></div></td>

    <td>     

      <div align=”center”><font style=”font-size=14px”><?php echo ereg_replace(“℃”,””,$tomo[1])?>℃</font></div></td>

  </tr>

</table>

<?php

        } else {

            echo “无法读取天气记录!!n”;

        }

    } 

?>

天气预报小偷PHP代码

<?
/***

***/
function readAll($location)
{
 $MAX_RETRY_NUM = 3;
 (preg_match(“/(http://)?([^/|:]+)(:d{1,5})?(/.+)?/”, $location, $url))
 {
  list(,,$host,$port,$path) = $url;
  $port = preg_replace(“/:/”, “”, $port);
  $port = strlen($port) ? $port : 80;
  $path = strlen($path) ? $path : “/”;
  $request  = “GET $path HTTP/1.0rn”;
  $request .= “Host: $hostrn”;
  $request .= “Accept: */*rn”;
  $request .= “Connection: closern”;
  $request .= “User-Agent: superspice’s BOTrnrn”;
  $retry = 0;
  $do = false;
  do
  {
    (!$socket =fsockopen($host, $port, &$errMsg, &$errCode ))
   {
    return false;
   }
   fwrite($socket, $request);
   $flag = true;
   $header = “”;
   $body = “”;
   while(!feof($socket))
   {
    $line = fgets($socket, 128);
    ($flag)
    {
    (trim(chop($line)) == “”)
     {
      $flag = false;
     }
      
     {
      $header .= $line;
     }
    }
    
    {
     $body .= $line;
    }
   }
   (preg_match(“/Content-Length: (d+)/”, $header, $out))
   {
    $header_length = $out[1];
    ($header_length != strlen($body))
    {
     $do = true;
    }
        {
     $do = false;
    }
   }
   (is_resource($socket))
   {
    fclose($socket);
   }
   $retry ++;
  }while($do && $retry<$MAX_RETRY_NUM);
 }
 return $body;
}
function get_weather()
{
 $TqUrl=”http://www.ttqx.com.cn/forecast/area_weather.asp?city_name=合肥&zhou=yz”;
 $VaX1Tem=readAll($TqUrl);
 (!$VaX1Tem)
 {
  return false;
 }
 type($ArrayTq,”array”);
 $ArrayTq=explode(“<!–天气预报开始–>”,$VaX1Tem);
 $ArrayTq=explode(“<!–天气预报结束–>”,$ArrayTq[1]);
 $ = explode(“<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″”,$ArrayTq[0]);
 $flash = “<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″”.$flash[1];
 $flash = explode(“</EMBED></object>”,$flash);
 $flash = $flash[0].”</EMBED></object>”;
 $pattern = array(“/images/weather/i”,”/WIDTH=”65″ HEIGHT=”70″/i”);
 $replace = array(“http://www.ttqx.com.cn/forecast/images/weather”,”WIDTH=”51″ HEIGHT=”55″”);
 $flash = preg_replace($pattern,$replace,$flash);
 //天气
 $ArrayTqTem2=explode(‘<tr><td>’,$ArrayTq[0]);
 $ArrayTqTem2=explode(‘</td></tr>’,$ArrayTqTem2[1]);
 //$ArrayTqTem2=explode(‘<td>’,$ArrayTqTem2[0]);
 $ArrayTqTem2=$ArrayTqTem2[0];
 //风力
 $ArrayTqTem3=explode(‘<tr><td>’,$ArrayTq[0]);
 $ArrayTqTem3=explode(‘</td></tr>’,$ArrayTqTem3[2]);
 //$ArrayTqTem3=explode(‘<td>’,$ArrayTqTem3[0]);
 $ArrayTqTem3=$ArrayTqTem3[0];
 //温度
 $ArrayTqTem4=explode(‘<tr><td>’,$ArrayTq[0]);
 $ArrayTqTem4=explode(‘</td></tr>’,$ArrayTqTem4[3]);
 //$ArrayTqTem4=explode(‘<td>’,$ArrayTqTem4[0]);
 $ArrayTqTem4=$ArrayTqTem4[0];
( !$ArrayTqTem2 or !$ArrayTqTem3 or !$ArrayTqTem4)
 {
  return false;
 }
 //$TqVar=$ArrayTqTem2.”,”.$ArrayTqTem3.”<br>气温:”.$ArrayTqTem4;
 $weather[0]=$flash;
 $weather[1]=$ArrayTqTem2;
 $weather[2]=$ArrayTqTem3;
 $weather[3]=$ArrayTqTem4;
 return $weather;
}
$weather = get_weather();
?>

上面写的是php文件,你没有echo当然不能正常显示啦

<?php
error_reporting(0);
include_once (“../include/weather.php”);
?>
<!DOCTYPE PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<title>天气预报</title>
<style>
html,body {margin:0;padding:0; font-size:12px;}
div {width:178px; height:58px;position:relativ;position:relative}
img {width:178px; height:58px; z-index:1;position:absolute; border:0}
object { margin-top:2px; margin-left:8px;}
span{position:absolute;top:2px;right:12px;}
li{font-family:Verdana,宋体;list-style:none;margin-top:3px; letter-spacing:1px;}
</style>
</head>
<body>
<div>
<a href=”http://www.ttqx.com.cn/tqyb/” target=”_blank”><img src=”http://www.maqie.com/wp-content/uploads/auto_save_image/2011/01/0502051Co.gif” /></a><?php echo $weather[0]; ?><span><li><?php echo $weather[1]; ?></li> <li><?php echo $weather[2]; ?></li> <li><?php echo $weather[3]; ?></li></span>
</div>
</body>
</html>