caoyinghui

2011年9月26日

css+div布局

<!DOCTYPE html 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>2列右侧固定左侧自适应宽度,未知高度且底部平齐+头部+导航+尾部——<a href="http://www.aa25.cn">标准之路www.aa25.cn</a></title>
<link href="layout.css" rel="stylesheet" type="text/css" />
<meta name="Keywords" content="标准之路,www.aa25.cn,网页标准布局,DIV+CSS" />
<meta name="" content="标准之路,www.aa25.cn,网页标准布局,DIV+CSS" />
<meta name="author" content"×××,有问题请到www.68css.cn网站留言" />
<meta name="Description" content="本套网页标准布局模板是由标准之路(www.aa25.cn)制作完成,如果您要转载,请保留版权" />
</head>

<body>
<div id="container">
  <div id="header">This is the Header</div>
  <br class="clearfloat" />
  <div id="menu">This is the Menu</div>
  <br class="clearfloat" />
  <div id="mainContent">
    <div id="sidebar">This is the sidebar<br />
    
    </div>
    <div id="content">2列右侧固定左侧自适应宽度,未知高度且底部平齐+头部+导航+尾部——<a href="http://www.aa25.cn">标准之路www.aa25.cn</a><br />
      <br />
      本例和例21差不多,一个是固定宽度,一个是自适应,同样是未知高度。<br />
      <br />
      此例中需要说明一点的是:当content设定高度后,3像素会跑到content外侧,反之,在content内部。这样,我们用!important修正在ie下向左多浮动2像素,加上3像素的bug正好是5像素,所以在火狐和IE下显示是一样的,这是大家必须注意的一点。而当content设定高度后,如100px,那么在IE6下,当高度超过100px时,它会自动把conent撑高,而火狐去不会。所以用!important修正在IE下设定高度值使它的3像素跑到外侧,火狐下因不存在3像素问题,所以高度自动。<br />
      <br />
      <br />
  总之,实现的方法是多种多样的,这只是本人在学习过程中总结的一点经验,权当抛砖引玉,希望能对您有所帮助,当然您有更好的办法和布局,欢迎一块来学习,交流,让web标准在中国得到更好的发展。同时希望您继续关注标准之路(www.aa25.cn)<br />
<br />
  如果您要实现未知高度底部平齐,请参考23例<br />
  
    </div>
  </div>
  <br class="clearfloat" />
  <div id="footer">This is the footer<span style="display:none"><script language="javascript" type="text/javascript" src="http://js.users.51.la/1967272.js"></script></span></div>
</div>
</body>
</html>

 

css

body { font-family:Verdana; font-size:14px; margin:0;}

#container {margin:0 auto; width:100%;}
#header { height:100px; background:#9c6; margin-bottom:5px;}
#menu { height:30px; background:#693; margin-bottom:5px;}
#mainContent { background:url(bg.gif) right 0 repeat-y; overflow:auto;zoom:1; margin-bottom:5px;}
#sidebar { float:right; width:200px;background:#cf9;}
#content { margin-right:205px !important; margin-right:202px; height:auto !important; height:100px; background:#ffa;}
#footer { height:60px; background:#9c6;}
.clearfloat { clear:both; height:0; font-size: 1px; line-height: 0px;}
 

已有 0 人发表留言,猛击->>这里<<-参与讨论


ITeye推荐



posted @ 2011-09-26 14:10 shine_panda 阅读(171) | 评论 (0)编辑 收藏

2011年9月23日

运行命令大总结

winver-检查Windows版本

 

  wmimgmt.msc打开windows管理体系结构(WMI)

 

  wupdmgrwindows更新程序

 

  wscriptwindows脚本宿主设置

 

  write写字板

 

  winmsd-系统信息

 

  wiaacmgr-扫描仪和照相机向导

 

  winchatXP自带局域网聊天

 

  mem.exe显示内存使用情况

 

  Msconfig.exe-系统配置实用程序

 

  mplayer2-简易widnows media player

 

  mspaint画图板

 

  mstsc远程桌面连接

 

  mplayer2-媒体播放机

 

  magnify放大镜实用程序

 

  mmc打开控制台

 

  mobsync同步命令

 

  dxdiag-检查DirectX信息

 

  drwtsn32 系统医生

 

  devmgmt.msc- 设备管理器

 

  dfrg.msc-磁盘碎片整理程序

 

  diskmgmt.msc-磁盘管理实用程序

 

  dcomcnfg-打开系统组件服务

 

  ddeshare-打开DDE共享设置

 

  dvdplayDVD播放器

 

  net stop messenger-停止信使服务

 

  net start messenger开始信使服务

 

  notepad打开记事本

 

  nslookup-网络管理的工具向导

 

  ntbackup-系统备份和还原

 

  narrator-屏幕“讲述人”

 

  ntmsmgr.msc移动存储管理器

 

  ntmsoprq.msc-移动存储管理员操作请求

 

  netstat -an(TC)命令检查接口

 

  syncapp创建一个公文包

 

  sysedit系统配置编辑器

 

  sigverif-文件签名验证程序

 

  sndrec32-录音机

 

  shrpubw创建共享文件夹

 

  secpol.msc-本地安全策略

 

  syskey-系统加密,一旦加密就不能解开,保护windows xp系统的双重密码

 

  services.msc-本地服务设置

 

  Sndvol32-音量控制程序

 

  sfc.exe系统文件检查器

 

  sfc /scannow-windows文件保护

 

  tsshutdn-60秒倒计时关机命令

 

  tourstartxp简介(安装完成后出现的漫游xp程序)

 

  taskmgr任务管理器

 

  eventvwr-事件查看器

 

  eudcedit-造字程序

 

  explorer-打开资源管理器

 

  packager-对象包装程序

 

  perfmon.msc计算机性能监测程序

 

  progman程序管理器

 

  regedit.exe注册表

 

  rsop.msc-组策略结果集

 

  regedt32-注册表编辑器

 

  rononce -p 15秒关机

 

  regsvr32 /u *.dll停止dll文件运行

 

  regsvr32 /u zipfldr.dll取消ZIP支持

 

  cmd.exeCMD命令提示符

 

  chkdsk.exe-Chkdsk磁盘检查

 

  certmgr.msc证书管理实用程序

 

  calc-启动计算器

 

  charmap启动字符映射表

 

  cliconfg-SQL SERVER 客户端网络实用程序

 

  Clipbrd剪贴板查看器

 

  conf-启动netmeeting

 

  compmgmt.msc-计算机管理

 

  cleanmgr-垃圾整理

 

  ciadv.msc索引服务程序

 

  osk打开屏幕键盘

 

  odbcad32-ODBC数据源管理器

 

  oobe/msoobe /a检查XP是否激活

 

  lusrmgr.msc本机用户和组

 

  logoff-注销命令

 

  iexpress-木马捆绑工具,系统自带

 

  Nslookup-IP地址侦测器

 

  fsmgmt.msc-共享文件夹管理器

 

  utilman辅助工具管理器

 

  gpedit.msc-组策略

 



已有 0 人发表留言,猛击->>这里<<-参与讨论


ITeye推荐



posted @ 2011-09-23 09:56 shine_panda 阅读(165) | 评论 (0)编辑 收藏

2011年9月8日

java版俄罗斯方块

package com.shine;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.*;
import javax.swing.Timer;

public class Tetris extends JFrame {
    public Tetris() {
        Tetrisblok a = new Tetrisblok();
        addKeyListener(a);
        add(a);
    }

    public static void main(String[] args) {
        Tetris frame = new Tetris();
        JMenuBar menu = new JMenuBar();
        frame.setJMenuBar(menu);
        JMenu game = new JMenu("游戏");
        JMenuItem newgame = game.add("新游戏");
        JMenuItem pause = game.add("暂停");
        JMenuItem goon = game.add("继续");
        JMenuItem exit = game.add("退出");
        JMenu help = new JMenu("帮助");
        JMenuItem about = help.add("关于");
        menu.add(game);
        menu.add(help);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(220, 275);
        frame.setTitle("Tetris内测版");
        // frame.setUndecorated(true);
        frame.setVisible(true);
        frame.setResizable(false);

    }
}

// 创建一个俄罗斯方块类
class Tetrisblok extends JPanel implements KeyListener {

    // blockType 代表方块类型
    // turnState代表方块状态
    private int blockType;
    private int score = 0;

    private int turnState;

    private int x;

    private int y;

    private int i = 0;

    int j = 0;
    int flag = 0;
    // 定义已经放下的方块x=0-11,y=0-21;
    int[][] map = new int[13][23];

    // 方块的形状 第一组代表方块类型有S、Z、L、J、I、O、T 7种 第二组 代表旋转几次 第三四组为 方块矩阵
    private final int shapes[][][] = new int[][][] {
    // i
            { { 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 },
                    { 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 } },
            // s
            { { 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
                    { 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 } },
            // z
            { { 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } },
            // j
            { { 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 },
                    { 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
            // o
            { { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
            // l
            { { 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
                    { 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
            // t
            { { 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
                    { 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                    { 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0 } } };

    // 生成新方块的方法
    public void newblock() {
        blockType = (int) (Math.random() * 1000) % 7;
        turnState = (int) (Math.random() * 1000) % 4;
        x = 4;
        y = 0;
        if (gameover(x, y) == 1) {

            newmap();
            drawwall();
            score = 0;
            JOptionPane.showMessageDialog(null, "GAME OVER");
        }
    }

    // 画围墙
    public void drawwall() {
        for (i = 0; i < 12; i++) {
            map[i][21] = 2;
        }
        for (j = 0; j < 22; j++) {
            map[11][j] = 2;
            map[0][j] = 2;
        }
    }

    // 初始化地图
    public void newmap() {
        for (i = 0; i < 12; i++) {
            for (j = 0; j < 22; j++) {
                map[i][j] = 0;
            }
        }
    }

    // 初始化构造方法
    Tetrisblok() {
        newblock();
        newmap();
        drawwall();
        Timer timer = new Timer(1000, new TimerListener());
        timer.start();
    }

    // 旋转的方法
    public void turn() {
        int tempturnState = turnState;
        turnState = (turnState + 1) % 4;
        if (blow(x, y, blockType, turnState) == 1) {
        }
        if (blow(x, y, blockType, turnState) == 0) {
            turnState = tempturnState;
        }
        repaint();
    }

    // 左移的方法
    public void left() {
        if (blow(x - 1, y, blockType, turnState) == 1) {
            x = x - 1;
        }
        ;
        repaint();
    }

    // 右移的方法
    public void right() {
        if (blow(x + 1, y, blockType, turnState) == 1) {
            x = x + 1;
        }
        ;
        repaint();
    }

    // 下落的方法
    public void down() {
        if (blow(x, y + 1, blockType, turnState) == 1) {
            y = y + 1;
            delline();
        }
        ;
        if (blow(x, y + 1, blockType, turnState) == 0) {
            add(x, y, blockType, turnState);
            newblock();
            delline();
        }
        ;
        repaint();
    }

    // 是否合法的方法
    public int blow(int x, int y, int blockType, int turnState) {
        for (int a = 0; a < 4; a++) {
            for (int b = 0; b < 4; b++) {
                if (((shapes[blockType][turnState][a * 4 + b] == 1) && (map[x
                        + b + 1][y + a] == 1))
                        || ((shapes[blockType][turnState][a * 4 + b] == 1) && (map[x
                                + b + 1][y + a] == 2))) {

                    return 0;
                }
            }
        }
        return 1;
    }

    // 消行的方法
    public void delline() {
        int c = 0;
        for (int b = 0; b < 22; b++) {
            for (int a = 0; a < 12; a++) {
                if (map[a][b] == 1) {

                    c = c + 1;
                    if (c == 10) {
                        score += 10;
                        for (int d = b; d > 0; d--) {
                            for (int e = 0; e < 11; e++) {
                                map[e][d] = map[e][d - 1];

                            }
                        }
                    }
                }
            }
            c = 0;
        }
    }

    // 判断你挂的方法
    public int gameover(int x, int y) {
        if (blow(x, y, blockType, turnState) == 0) {
            return 1;
        }
        return 0;
    }

    // 把当前添加map
    public void add(int x, int y, int blockType, int turnState) {
        int j = 0;
        for (int a = 0; a < 4; a++) {
            for (int b = 0; b < 4; b++) {
                if (map[x + b + 1][y + a] == 0) {
                    map[x + b + 1][y + a] = shapes[blockType][turnState][j];
                }
                ;
                j++;
            }
        }
    }

    // 画方块的的方法
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        // 画当前方块
        for (j = 0; j < 16; j++) {
            if (shapes[blockType][turnState][j] == 1) {
                g.fillRect((j % 4 + x + 1) * 10, (j / 4 + y) * 10, 10, 10);
            }
        }
        // 画已经固定的方块
        for (j = 0; j < 22; j++) {
            for (i = 0; i < 12; i++) {
                if (map[i][j] == 1) {
                    g.fillRect(i * 10, j * 10, 10, 10);

                }
                if (map[i][j] == 2) {
                    g.drawRect(i * 10, j * 10, 10, 10);

                }
            }
        }
        g.drawString("score=" + score, 125, 10);
        g.drawString("抵制不良游戏,", 125, 50);
        g.drawString("拒绝盗版游戏。", 125, 70);
        g.drawString("注意自我保护,", 125, 90);
        g.drawString("谨防受骗上当。", 125, 110);
        g.drawString("适度游戏益脑,", 125, 130);
        g.drawString("沉迷游戏伤身。", 125, 150);
        g.drawString("合理安排时间,", 125, 170);
        g.drawString("享受健康生活。", 125, 190);
    }

    // 键盘监听
    public void keyPressed(KeyEvent e) {
        switch (e.getKeyCode()) {
        case KeyEvent.VK_DOWN:
            down();
            break;
        case KeyEvent.VK_UP:
            turn();
            break;
        case KeyEvent.VK_RIGHT:
            right();
            break;
        case KeyEvent.VK_LEFT:
            left();
            break;
        }

    }

    // 无用
    public void keyReleased(KeyEvent e) {
    }

    // 无用
    public void keyTyped(KeyEvent e) {
    }

    // 定时器监听
    class TimerListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {

            repaint();
            if (blow(x, y + 1, blockType, turnState) == 1) {
                y = y + 1;
                delline();
            }
            ;
            if (blow(x, y + 1, blockType, turnState) == 0) {

                if (flag == 1) {
                    add(x, y, blockType, turnState);
                    delline();
                    newblock();
                    flag = 0;
                }
                flag = 1;
            }
            ;
        }
    }
}
 转自CSDN

已有 0 人发表留言,猛击->>这里<<-参与讨论


ITeye推荐



posted @ 2011-09-08 17:30 shine_panda 阅读(164) | 评论 (0)编辑 收藏

2011年8月31日

UBB转HTML和HTML转UBB

function htmlToubb(h,u){
	str = pattern(document.getElementById(h).value);
	document.getElementById(u).value=str;
}

function ubbTohtml(u,h){
	str = up(document.getElementById(u).value);
	document.getElementById(h).value=str;
}

function pattern(str){
	str = str.replace(/<br[^>]*>/ig,'\n');
	str = str.replace(/<p[^>\/]*\/>/ig,'\n');
	str = str.replace(/\son[\w]{3,16}\s?=\s*([\'\"]).+?\1/ig,'');
	str = str.replace(/<hr[^>]*>/ig,'[hr]');
	str = str.replace(/<(sub|sup|u|strike|b|i|pre)>/ig,'[$1]');
	str = str.replace(/<\/(sub|sup|u|strike|b|i|pre)>/ig,'[/$1]');
	str = str.replace(/<(\/)?strong>/ig,'[$1b]');
	str = str.replace(/<(\/)?em>/ig,'[$1i]');
	str = str.replace(/<(\/)?blockquote([^>]*)>/ig,'[$1blockquote]');
	str = str.replace(/<img[^>]*smile=\"(\d+)\"[^>]*>/ig,'[s:$1]');
	str = str.replace(/<img[^>]*src=[\'\"\s]*([^\s\'\"]+)[^>]*>/ig,'[img]'+'$1'+'[/img]');
	str = str.replace(/<a[^>]*href=[\'\"\s]*([^\s\'\"]*)[^>]*>(.+?)<\/a>/ig,'[url=$1]'+'$2'+'[/url]');
	str = str.replace(/<[^>]*?>/ig, '');
	str = str.replace(/&amp;/ig, '&');
	str = str.replace(/&lt;/ig, '<');
	str = str.replace(/&gt;/ig, '>');
	return str;
}

function up(str){
	str = str.replace(/</ig,'&lt;');
	str = str.replace(/>/ig,'&gt;');
	str = str.replace(/\n/ig,'<br />');
	str = str.replace(/\[code\](.+?)\[\/code\]/ig, function($1, $2) {return phpcode($2);});
	str = str.replace(/\[hr\]/ig,'<hr />');
	str = str.replace(/\[\/(size|color|font|backcolor)\]/ig,'</font>');
	str = str.replace(/\[(sub|sup|u|i|strike|b|blockquote|li)\]/ig,'<$1>');
	str = str.replace(/\[\/(sub|sup|u|i|strike|b|blockquote|li)\]/ig,'</$1>');
	str = str.replace(/\[\/align\]/ig,'</p>');
	str = str.replace(/\[(\/)?h([1-6])\]/ig,'<$1h$2>');
	str = str.replace(/\[align=(left|center|right|justify)\]/ig,'<p align="$1">');
	str = str.replace(/\[size=(\d+?)\]/ig,'<font size="$1">');
	str = str.replace(/\[color=([^\[\<]+?)\]/ig, '<font color="$1">');
	str = str.replace(/\[backcolor=([^\[\<]+?)\]/ig, '<font style="background-color:$1">');
	str = str.replace(/\[font=([^\[\<]+?)\]/ig, '<font face="$1">');
	str = str.replace(/\[list=(a|A|1)\](.+?)\[\/list\]/ig,'<ol type="$1">$2</ol>');
	str = str.replace(/\[(\/)?list\]/ig,'<$1ul>');
	str = str.replace(/\[s:(\d+)\]/ig,function($1,$2){ return smilepath($2);});
	str = str.replace(/\[img\]([^\[]*)\[\/img\]/ig,'<img src="$1" border="0" />');
	str = str.replace(/\[url=([^\]]+)\]([^\[]+)\[\/url\]/ig, '<a href="$1">'+'$2'+'</a>');
	str = str.replace(/\[url\]([^\[]+)\[\/url\]/ig, '<a href="$1">'+'$1'+'</a>');
	return str;
}
 

已有 0 人发表留言,猛击->>这里<<-参与讨论


ITeye推荐



posted @ 2011-08-31 14:09 shine_panda 阅读(671) | 评论 (0)编辑 收藏

2011年8月5日

Win7下无法显示Courier New字体

PL/SQL 或UE中进行设置时发现,找不到Courier New

字体。重装也没作用。

根本原因是没有将 Courier New 设置为“显示”




已有 0 人发表留言,猛击->>这里<<-参与讨论


ITeye推荐



posted @ 2011-08-05 19:30 shine_panda 阅读(281) | 评论 (0)编辑 收藏

2011年7月30日

UE在Win7下添加右键菜单

Windows Registry Editor Version 5.00

 

[HKEY_CLASSES_ROOT\*\shell]

[HKEY_CLASSES_ROOT\*\shell\UltraEdit]

@="UltraEdit-32"

[HKEY_CLASSES_ROOT\*\shell\UltraEdit\Command]

@="C:\\Program Files (x86)\\IDM Computer Solutions\\UltraEdit\\Uedit32.exe %1"



C:\\Program Files (x86)\\IDM Computer Solutions\\UltraEdit\\Uedit32.exe这个改为实际路径



已有 0 人发表留言,猛击->>这里<<-参与讨论


ITeye推荐



posted @ 2011-07-30 10:39 shine_panda 阅读(3960) | 评论 (0)编辑 收藏

仅列出标题  下一页
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜