i云笔记内涵资源: 编程思路笔记,源码分享,思路解答分享,封装函数分享,演示Demo等内容。 上传笔记可长期保存,笔记内容可进行加粗,居中,标记等功能,笔记可 置顶 不同的等级,将重要的笔记内容放前面。笔记内容可进行 加密 ,加密后不展示在首页,内容只能被自己查看! 有问题可联系QQ3399769530 或微信cm1598421 添加时备注来意 网站已运行 {DAY_COUNT} 天 已有笔记 {CONTENT_COUNT} 篇
进制转换器 http://notei.cn/tool/tool_hex.html MD5加密工具 http://notei.cn/tool/tool_md5.html Base64加解密 http://notei.cn/tool/tool_base64.html Aes加解密工具 http://notei.cn/tool/tool_Aes.html 前端学习软件 http://h5.notei.cn
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Custom Font Example</title> <style> /* 使用@font-face规则定义字体 */ @font-face { font-family: 'AkalTun'; /* 定义一个字体名 */ src: url('https://akaltun.cn/1/akaltun.ttf') format('truetype'); /* 指定字体文件和格式 */ } /* 应用自定义字体到body,也可以应用到其他元素 */ body { font-family: 'AkalTun', sans-serif; /* 将字体应用到body,如果字体加载失败则回退到sans-serif */ } </style> </head> <body> <div id="container"> <h1>欢迎来到我的网站ئۇيغۇرچە</h1> <p>这里是使用自定义字体的文本。</p> <!-- 其他内容 --> </div> </body> </html>
Mysql外链约束规则
java的mvc三层架构分别是: View(界面层),Service(业务逻辑层),DAO(数据访问层) V:View 网页视图,为用户提供能够看到并且使用的界面,与用户直接进行交互。 M:Model,业务模型,处理业务 C:Controller,控制器,处理请求,调用模型和视图 dao层负责对数据进行直接操控,最底层 service层负责对传递过来的参数验证,以及其他逻辑验证操作。验证完毕访问dao层进行数据操控 servlet层负责接收参数,然后调用service层进行处理 三个层分工合作,有利于后期的功能维护,那层出了问题就去处理哪层
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> * { padding: 0; margin: 0; } li { list-style-type: none; } a { text-decoration: none; } .nav-box { width: 980px; height: 90px; margin: 20px auto; display: flex; align-items: center; } .right { flex: 1; margin-left: 20px; } .right-top-tag li { display: inline-block; font-size: 12px; border-radius: 3px 3px 0 0; overflow: hidden; } .right-top-tag li a { color: #666; padding: 5px 15px; display: inline-block; } .right-search { margin-top: -4px; display: flex; } .right-search input { border: 3px solid #F37B03; width: 100%; height: 27px; background: url("./images/tb/search.jpg") no-repeat 10px; flex: 1; outline: none; padding-left: 30px; color: #666; } .right-search .button { flex-shrink: 1; width: 133px; height: 33px; background: url("images/tb/button.jpg") no-repeat; border: none; } .right-search .tip { height: 33px; } .right-search .tip p { line-height: 16px; font-size: 12px; margin-left: 10px; color: #666; } .right-title-nav ul li { display: inline-block; margin-top: 6px; } .right-title-nav ul li a { color: #555; font-size: 12px; margin-right: 12px; } </style> </head> <body> <div class="nav-box"> <div class="left"> <img src="./images/tb/logo.jpg" alt=""> </div> <div class="right"> <div class="right-top-tag"> <ul> <li style="background-color: #F37B03;"><a style="color: #fff;" href="#"> 宝贝 </a></li> <li><a href="#"> 天猫<span style="color: #f79a3d;">(淘宝商城)</span> </a></li> <li><a href="#"> 店铺 </a></li> </ul> </div> <div class="right-search"> <input type="text"> <button class="button"></button> <div class="tip"> <p>高级搜索</p> <p>使用帮助</p> </div> </div> <div class="right-title-nav"> <ul> <li> <a href="#">长裙</a> </li> <li> <a href="#">时尚包包</a> </li> <li> <a href="#">新款连衣裙</a> </li> <li> <a href="#">中老年夏服</a> </li> <li> <a href="#">新款连衣裙</a> </li> <li> <a href="#">中老年夏服</a> </li> <li> <a href="#">更多>></a> </li> </ul> </div> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Document</title> <style> * { padding: 0; margin: 0; } div { box-sizing: border-box; color: #DE8786; } .mainbox { width: 980px; margin: 0 auto; } .nav { background-color: #FE9AB5; } .nav .item { display: inline-block; line-height: 46px; padding: 0 30px; color: #fff; } .banner { text-align: center; } .frombox { background: url("./images/content_bg.jpg"); padding: 0 180px; } .step { padding: 10px 0; } .step .tip { font-size: 20px; line-height: 42px; float: left; } .userinfo .title { border-bottom: 1px solid #FE9AB5; line-height: 42px; margin-bottom: 10px; } input { border: 1px solid #FE9AB5; } .tableinput { padding: 5px 30px; } .tableinput tr { margin: 10px 0; } .tableinput .info { width: 220px; height: 22px; } .tableinput tr .titles { text-align: right; } .tableinput select { width: 168px; border-color: #FE9AB5; color: #FE9AB5; } </style> </head> <body> <div class="content"> <div class="logo mainbox"> <img src="./images/logo.jpg" alt=""> </div> <div class="nav"> <ul class="mainbox"> <li class="item">首页</li> <li class="item">会员</li> <li class="item">活动</li> <li class="item">直播</li> <li class="item">视频</li> <li class="item" style="background-color: #FE9AB5;">注册</li> </ul> </div> <div class="banner"> <img src="./images/banner.jpg" alt=""> </div> <div class="frombox mainbox"> <div class="step"> <span class="tip">注册步骤:</span> <img src="./images/step.jpg" alt=""> </div> <div class="userinfo"> <p class="title">您的账号信息:</p> <table class="tableinput"> <tr> <td class="titles">注册方式:</td> <td><input type="radio"> E-main注册 <input type="radio"> 手机号码注册</td> </tr> <tr> <td>注册邮箱:</td> <td><input class="info" type="email"></td> </tr> <tr> <td class="titles">注册手机:</td> <td><input class="info" type="email"></td> </tr> <tr> <td class="titles">登录密码:</td> <td><input class="info" type="email"></td> </tr> <tr> <td class="titles">昵称:</td> <td><input class="info" type="email"></td> </tr> </table> </div> <div class="userinfo"> <p class="title">您的个人信息:</p> <table class="tableinput"> <tr> <td class="titles">性别:</td> <td><input type="radio"> 男 <input type="radio"> 女</td> </tr> <tr> <td class="titles">学历:</td> <td><select> <option value="初中">初中</option> <option value="高中">高中</option> <option value="大专">大专</option> <option value="本科">本科</option> </select></td> </tr> <tr> <td class="titles">所在城市:</td> <td><select> <option value="北京">北京</option> <option value="江西">江西</option> <option value="四川">四川</option> </select></td> </tr> </table> </div> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Document</title> <style> body { background-color: #EBEBEB; } .content { background: url("images/form_bg.jpg"); width: 1430px; height: 717px; margin: 0 auto; position: relative; } .frombox { width: 700px; height: 540px; position: absolute; top: 160px; left: 700px; } .title { text-align: center; font-size: 24px; } .line { padding: 7px 0; font-size: 15px; } .line input { height: 26px; width: 220px; } .line .tip { text-align: right; display: inline-block; width: 90px; } .line.color input { width: 120px; } .line.btn input { background-color: #93B518; color: #fff; width: 120px; height: 36px; border: 0; margin: 15px 28px; } </style> </head> <body> <div class="content"> <div class="frombox"> <h1 class="title">传智学员信息登记表</h1> <form action="" method="GET"> <div class="line"> <label class="tip">用户登录名:</label> <input type="text" name="username" value="mymail@163.com" readonly="readonly" disabled="disabled"> <label>(不能修改,只能查看)</label> </div> <div class="line"> <label class="tip">真实姓名:</label> <input type="text" name="name" placeholder="例如:王鹏" required pattern="^[\u4e00-\u9fa5]+$"> <label>(必须填写,只能输入汉字)</label> </div> <div class="line"> <label class="tip">真实年龄:</label> <input type="number" name="age" min="0" max="100" value="24" required placeholder="16-100"> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">出生日期:</label> <input type="date" name="date" required> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">电子邮箱:</label> <input type="email" name="email" placeholder="123456@qq.com" required> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">身份证号:</label> <input type="text" name="idcard" required pattern="^[0-9]{17}[0-9Xx]$"> <label>(必须填写,能够以数字,字母x结尾的短身份证号)</label> </div> <div class="line"> <label class="tip">手机号码:</label> <input type="tel" name="tel" required> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">个人主页:</label> <input type="url" name="myurl" placeholder="http://bk.notei.cn"> <label>(请选择网址)</label> </div> <div class="line color"> <label class="tip">幸运颜色:</label> <input type="color" name="luckcolor" value="#E2D546"> <label>(请选择你喜欢的颜色)</label> </div> <div class="line btn"> <input type="submit" value="提交"> <input type="reset" value="重置"> </div> </form> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Document</title> <style> * { margin: 0; padding: 0; } div { box-sizing: border-box; } body { background-color: #FFF9ED; } a { text-decoration: none; color: #333; } li { list-style-type: none; } .content { display: flex; flex-direction: column; justify-content: center; align-items: center; } .container { width: 980px; margin: 0 auto; height: 100px; } .nav { background: url("images/head_bg.jpg") repeat-x; height: 128px; width: 100%; } .nav li { float: left; } .nav .item a { display: inline-block; width: 120px; height: 128px; line-height: 64px; text-align: center; color: #fff; margin: 0 5px; font-size: 17px; } .nav .item a:hover { background: url("images/xuanfu.png") no-repeat; } .banner img { width: 100%; } .borbox { background-color: #EC6E47; padding: 10px 30px; height: auto; } .borbox ul { width: 100%; display: flex; padding: 10px; background-color: #fff; } .borbox ul li { flex: 1 0 0; height: 100%; margin: 0 3px; } .borbox ul li .flexbox { display: flex; } .borbox ul li div { background-color: #242424; color: #fff; } .borbox ul li .top { margin-bottom: 8px; } .borbox ul li .name { text-align: center; flex: 1 0 0; } .borbox ul .left .top .name { line-height: 169px; } .borbox ul .left .bottom .name { line-height: 137px; } .borbox ul .center .top { height: 117px; line-height: 117px; } .borbox ul .center .bottom { height: 189px; line-height: 189px; } .borbox ul .right .top { height: 313px; line-height: 313px; } .morebox { margin-top: 50px; text-align: left; height: auto; } .morebox>.title { display: inline-block; background-color: #EC6E47; color: #fff; padding: 10px 20px; font-size: 16px; font-weight: normal; } .morebox .list { display: flex; gap: 8px; background-color: #fff; padding: 10px; border: 1px solid #ccc; } .morebox .list li { flex: 1 0 0; border: 1px solid #ccc; padding-bottom: 15px; } .morebox .list li img { width: 100%; border-bottom: 1px solid #ccc; } .morebox .list li .title { text-align: center; width: 100%; color: #666; padding: 10px 0; font-size: 18px; } .morebox .list li .buybox { width: 80%; margin: 0 auto; background: url("./images/gouwu.jpg") no-repeat; background-color: #EC6E47; color: #fff; padding-left: 56px; height: 36px; line-height: 36px; } .footer { background-color: #111; width: 100%; color: #fff; padding: 50px 0; text-align: center; font-size: 14px; line-height: 29px; } </style> </head> <body> <div class="content"> <div class="nav"> <ul class="container"> <li><img src="./images/logo.png" alt="logo"></li> <li class="item"><a href="#">穿搭速递</a></li> <li class="item"><a href="#">时尚大片</a></li> <li class="item"><a href="#">星着装</a></li> <li class="item"><a href="#">时尚园</a></li> <li class="item"><a href="#">时尚专栏</a></li> <li class="item"><a href="#">会员/登录</a></li> </ul> </div> <div class="banner"> <img src="./images/banner.jpg" alt=""> </div> <div class="borbox container"> <ul> <li class="left"> <div class="top flexbox"> <img src="./images/pic01.jpg" alt=""> <p class="name">明星时尚</p> </div> <div class="bottom flexbox"> <img src="./images/pic02.jpg" alt=""> <p class="name">明星时尚</p> </div> </li> <li class="center"> <div class="top flexbox"> <img src="./images/pic03.jpg" alt=""> <p class="name">明星时尚</p> </div> <div class="bottom flexbox"> <img src="./images/pic04.jpg" alt=""> <p class="name">明星时尚</p> </div> </li> <li class="right"> <div class="top flexbox"> <img src="./images/pic05.jpg" alt=""> <p class="name">明星时尚</p> </div> </li> </ul> </div> <div class="morebox container"> <h2 class="title">潮流前沿/Tadil current</h2> <ul class="list"> <li> <img src="./images/match01.jpg" alt=""> <p class="title">潮流饰品</p> <div class="buybox"> 快速购买通道 </div> </li> <li> <img src="./images/match02.jpg" alt=""> <p class="title">潮流饰品</p> <div class="buybox"> 快速购买通道 </div> </li> <li> <img src="./images/match03.jpg" alt=""> <p class="title">潮流饰品</p> <div class="buybox"> 快速购买通道 </div> </li> <li> <img src="./images/match04.jpg" alt=""> <p class="title">潮流饰品</p> <div class="buybox"> 快速购买通道 </div> </li> </ul> </div> <div class="footer"> <p> All right reseved©2006-2016 CHAOUUFUSHI.com, All right reseved</p> <p>2021-2018, 版权所有 潮流服饰 85CP备案13385453</p> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> * { padding: 0; margin: 0; } li { list-style: none; } div { box-sizing: border-box; } .min-content { width: 980px; margin: 0 auto; } .content { width: 1280px; margin: 0 auto; } .header { height: 120px; line-height: 120px; background: #fff; } .header .logo { float: left; height: 80px; margin-top: 20px; } .header .goto { float: right; color: #666; } .header .goto a { color: #666; text-decoration: none; } .navbox { height: 60px; background: #404042; line-height: 60px; color: #fff; font-size: 18px; } .navbox ul li { padding: 0 42px; float: left; } .navbox ul li:hover { background-color: #DA5454; } .banner img { width: 100%; } .function ul { display: flex; } .function ul li { padding: 34px 0; flex: 1 0 0; border: 1px solid #ddd; border-top: 0; border-spacing: 0; } .function .item img { height: 50px; margin: 0 15px 0 28px; float: left; } .function .item .info .title { font-size: 17px; } .function .item .info .subtitle { font-size: 14px; color: #666; } .demobox,.newsbox { margin-top: 10px; } .demobox ul .item { float: left; margin: 3px 8px; } .demobox .title,.newsbox .title { line-height: 56px; border-bottom: 1px solid #ddd; margin-bottom: 10px; color: #222; font-size: 18px; } .newsbox .itemtitle { font-size: 15px; color: #444; } .newsbox>ul { display: flex; gap: 15px; } .newsbox>ul .listbox { flex: 1 0 0; border: 1px solid #ddd; padding: 25px 20px; } .newsbox>ul .listbox .itemtitle { margin-bottom: 5px; } .newsbox>ul .listbox ul .item { border-bottom: 1px solid #ddd; padding: 20px 0; } .newsbox>ul .listbox ul .item img { float: left; margin-right: 15px; } .newsbox>ul .listbox ul .item .infotitle { font-size: 16px; color: #222; } .newsbox>ul .listbox ul .item .subtitle { font-size: 13px; color: #aaa; } .footer { padding: 46px; margin-top: 20px; background-color: #111; text-align: center; color: #fff; line-height: 36px; font-size: 15px; } </style> </head> <body> <div class="content"> <div class="min-content"> <div class="header"> <img class="logo" src="./images/logo.png" alt="logo"> <div class="goto"> <a href="#">登录</a> | <a href="#">注册</a> </div> </div> </div> <div class="navbox"> <div class="min-content"> <ul> <li class="item">首页</li> <li class="item">设计案例</li> <li class="item">装修图库</li> <li class="item">有问必答</li> <li class="item">逛商品</li> </ul> </div> </div> <div class="banner"> <img src="./images/banner.jpg" alt="banner"> </div> <div class="function min-content"> <ul> <li class="item"> <img src="./images/pic01.jpg" alt=""> <div class="info"> <p class="title">浏览真实设计案例</p> <p class="subtitle">设计师原创作品</p> </div> </li> <li class="item"> <img src="./images/pic02.jpg" alt=""> <div class="info"> <p class="title">浏览真实设计案例</p> <p class="subtitle">设计师原创作品</p> </div> </li> <li class="item"> <img src="./images/pic03.jpg" alt=""> <div class="info"> <p class="title">浏览真实设计案例</p> <p class="subtitle">设计师原创作品</p> </div> </li> <li class="item"> <img src="./images/pic04.jpg" alt=""> <div class="info"> <p class="title">浏览真实设计案例</p> <p class="subtitle">设计师原创作品</p> </div> </li> </ul> </div> <div class="demobox min-content"> <h4 class="title">设计案例</h4> <ul> <li class="item"> <img src="./images/pic05.jpg" alt=""> </li> <li class="item"> <img src="./images/pic06.jpg" alt=""> </li> <li class="item"> <img src="./images/pic07.jpg" alt=""> </li> <li class="item"> <img src="./images/pic08.jpg" alt=""> </li> <li class="item"> <img src="./images/pic09.jpg" alt=""> </li> <li class="item"> <img src="./images/pic10.jpg" alt=""> </li> </ul> </div> <div class="newsbox min-content"> <h4 class="title">最新动态</h4> <ul> <li class="listbox"> <h3 class="itemtitle">有问必答</h3> <ul class=""> <li class="item"> <img src="./images/pic01.png" alt=""> <div class="info"> <p class="infotitle">家具用品哪个品牌好</p> <p class="subtitle">回答:谢美家居用品很多错...</p> </div> </li> <li class="item"> <img src="./images/pic02.png" alt=""> <div class="info"> <p class="infotitle">家具用品哪个品牌好</p> <p class="subtitle">回答:谢美家居用品很多错...</p> </div> </li> <li class="item"> <img src="./images/pic03.png" alt=""> <div class="info"> <p class="infotitle">家具用品哪个品牌好</p> <p class="subtitle">回答:谢美家居用品很多错...</p> </div> </li> </ul> </li> <li class="listbox"> <h3 class="itemtitle">发布需求</h3> <ul class=""> <li class="item"> <img src="./images/pic04.png" alt=""> <div class="info"> <p class="infotitle">家具用品哪个品牌好</p> <p class="subtitle">回答:谢美家居用品很多错...</p> </div> </li> <li class="item"> <img src="./images/pic05.png" alt=""> <div class="info"> <p class="infotitle">家具用品哪个品牌好</p> <p class="subtitle">回答:谢美家居用品很多错...</p> </div> </li> <li class="item"> <img src="./images/pic06.png" alt=""> <div class="info"> <p class="infotitle">家具用品哪个品牌好</p> <p class="subtitle">回答:谢美家居用品很多错...</p> </div> </li> </ul> </li> <li class="listbox"> <h3 class="itemtitle">预约设计师</h3> <ul class=""> <li class="item"> <img src="./images/pic06.png" alt=""> <div class="info"> <p class="infotitle">家具用品哪个品牌好</p> <p class="subtitle">回答:谢美家居用品很多错...</p> </div> </li> <li class="item"> <img src="./images/pic07.png" alt=""> <div class="info"> <p class="infotitle">厨房在哪个方位风水好</p> <p class="subtitle">回答:看风水要结合...</p> </div> </li> <li class="item"> <img src="./images/pic08.png" alt=""> <div class="info"> <p class="infotitle">卧室多大比较合适</p> <p class="subtitle">回答:一般卧室的大小...</p> </div> </li> </ul> </li> </ul> </div> </div> <div class="footer"> <p>关于我们 | 联系我们 | 意见建议 | 帮助中心 | 使用条款</p> <p>免责声明:本网站部分内容由用户自行上传,如权利人发现存在误传其作品情形,请及时与本站联系。</p> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document1</title> <style> * { padding: 0; margin: 0; } li { list-style: none; } a { color: #666; text-decoration: none; } .content { width: 1280px; margin: 0 auto; } .nav { height: 600px; background: url("images/bg.png") center; background-size: cover; } .navlist { padding: 30px 60px; box-sizing: border-box; text-align: center; } .navlist ul li { float: left; line-height: 60px; padding: 0 50px; font-size: 16px; } .seach { position: relative; width: 128px; height: 36px; margin-top: 12px; } .seach img { height: 16px; position: absolute; top: calc(50% - 8px); left: 10px; z-index: 10; } .seach .input { position: absolute; top: 0; left: 0; height: 100%; width: 100%; border: none; border-radius: 18px; font-size: 12px; padding-left: 32px; box-sizing: border-box; outline: none; color: #666 } .hot { text-align: center; margin-top: 20px; } .hotlist { margin-top: 20px; text-align: left; padding: 0 60px; box-sizing: border-box; } .hotlist .item .img img { width: 100%; } .hotlist .item .title { padding: 10px; box-sizing: border-box; font-weight: bold; font-size: 18px; color: #333; border-bottom: 1px solid #ddd; } .hotlist .item .info { padding: 10px; padding-bottom: 30px; color: #bbb; box-sizing: border-box; } .hotlist { display: flex; gap: 80px; } .bottomimage img { width: 100%; } .life { background-color: #E1EBF2; margin-top: 50px; text-align: center; padding: 30px 0; } .life ul { text-align: center; } .life ul li { display: inline-block; margin: 20px 20px; } .footer { height: 80px; background: url("images/footer_bg.jpg"); color: #fff; text-align: center; line-height: 80px; margin-top: 50px; } </style> </head> <body> <div class="content"> <div class="nav"> <div class="navlist"> <ul> <li> <img class="logo" src="./images/logo.png" alt=""> </li> <li><a href="#">网站首页</a></li> <li><a href="#">床和床垫</a></li> <li><a href="#">卧室纺织品</a></li> <li><a href="#">灯具照明</a></li> <li class="seach"> <img src="./images/f.png" alt=""> <input class="input" type="text" placeholder="输入商品名称"> <li> </ul> </div> </div> <div class="hot"> <img src="./images/dongtai.jpg" alt=""> <ul class="hotlist"> <li class="item"> <dt class="box"> <dd class="img"> <img src="./images/news1.jpg" alt=""> </dd> <dd class="title">BEST贝达</dd> <dd class="info">将杂乱无章的物品收纳到视线之外,在我怕门后要展示台的心爱之物!</dd> <dd class="bottomimage"><img src="./images/yinying.jpg" alt=""></dd> </dt> </li> <li class="item"> <dt class="box"> <dd class="img"> <img src="./images/news2.jpg" alt=""> </dd> <dd class="title">BEST贝达</dd> <dd class="info">将杂乱无章的物品收纳到视线之外,在我怕门后要展示台的心爱之物!</dd> <dd class="bottomimage"><img src="./images/yinying.jpg" alt=""></dd> </dt> </li> <li class="item"> <dt class="box"> <dd class="img"> <img src="./images/news3.jpg" alt=""> </dd> <dd class="title">BEST贝达</dd> <dd class="info">将杂乱无章的物品收纳到视线之外,在我怕门后要展示台的心爱之物!</dd> <dd class="bottomimage"><img src="./images/yinying.jpg" alt=""></dd> </dt> </li> </ul> </div> <div class="life"> <img src="./images/shenghuo.png" alt=""> <ul> <li><img src="./images/img1.jpg" alt=""></li> <li><img src="./images/img2.jpg" alt=""></li> <li><img src="./images/img3.jpg" alt=""></li> </ul> </div> </div> <div class="footer"> 爱家居版权所有2016-2026京ICP备222222222号 京公网安备2222222222222 </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document2</title> <style> * { margin: 0; padding: 0; } li { list-style: none; } .main { width: 980px; margin: 0 auto; } .top { background: url("images/logo.jpg") no-repeat; background-position: 50px; height: 56px; line-height: 56px; margin-top: 10px; } .top .user { float: right; margin-right: 50px; } .top .user a { color: #FF9C00; text-decoration: none; } .nav { background-color: #FF9C00; height: 46px; margin-top: 10px; text-align: center; line-height: 46px; font-size: 16px; } .navlist li { display: inline-block; height: 100%; } .navlist li a { height: 100%; padding: 0 25px; color: #B55F23; text-decoration: none; display: inline-block; } .navlist li a:hover { background-color: #fca76a; } .banner { height: 432px; background: url("./images/banner.jpg") no-repeat center; background-size: cover; } .infobox { height: 160px; background-color: #E7BF80; } .infobox ul { text-align: center; } .infobox ul li { width: 120px; height: 120px; border-radius: 50%; display: inline-block; margin: 0 20px; margin-top: 20px; overflow: hidden; position: relative; } .infobox ul li .icon { width: 120px; position: absolute; left: 0; } .infobox ul li .title { color: #A47167; position: absolute; text-align: center; top: 76px; width: 100%; } .shoplist { background-color: #F8F5BC; padding: 50px 80px; padding-bottom: 60px; } .shoplist ul { display: flex; gap: 20px; flex-wrap: wrap; } .shoplist .item { flex: 20%; background-color: #fff; border: 1px solid #ddd; padding: 10px; box-sizing: border-box; } .shoplist .item img { width: 100%; } .shoplist .item .title,.shoplist .item .price { color: #A47167; margin-top: 5px; } .shoplist .item .name,.shoplist .item .price span { color: #FDA6A0; margin-top: 5px; } .footer { height: 120px; line-height: 120px; text-align: center; color: #fff; background: url("./images/footer.png") repeat-x; margin-top: -10px; } </style> </head> <body> <div class="main"> <div class="top"> <div class="user"> <a href="#">登录 |</a> <a href="#">注册</a> </div> </div> <div class="nav"> <ul class="navlist"> <li><a href="#">首页</a></li> <li><a href="#">公司简介</a></li> <li><a href="#">美食甜品</a></li> <li><a href="#">用户留言</a></li> <li><a href="#">联系我们</a></li> </ul> </div> <div class="banner"></div> <div class="infobox"> <ul> <li> <img class="icon" src="./images/list1.png" alt=""> <p class="title">提拉米苏</p> </li> <li> <img class="icon" src="./images/list2.png" alt=""> <p class="title">甜甜圈</p> </li> <li> <img class="icon" src="./images/list3.png" alt=""> <p class="title">芝士蛋糕</p> </li> <li> <img class="icon" src="./images/list4.png" alt=""> <p class="title">马卡龙</p> </li> <li> <img class="icon" src="./images/list5.png" alt=""> <p class="title">西式甜点</p> </li> </ul> </div> <div class="shoplist"> <ul> <li class="item"> <img src="./images/con1.jpg" alt=""> <p class="title">爱的N次方</p> <p class="name">马卡龙</p> <p class="price">价格:<span>30元</span></p> </li> <li class="item"> <img src="./images/con2.jpg" alt=""> <p class="title">果肉果冻</p> <p class="name">双色马卡龙</p> <p class="price">价格:<span>30元</span></p> </li> <li class="item"> <img src="./images/con3.jpg" alt=""> <p class="title">芒果味</p> <p class="name">补丁马卡龙</p> <p class="price">价格:<span>30元</span></p> </li> <li class="item"> <img src="./images/con4.jpg" alt=""> <p class="title">果冻荔枝味</p> <p class="name">多彩马卡龙</p> <p class="price">价格:<span>30元</span></p> </li> <li class="item"> <img src="./images/con5.jpg" alt=""> <p class="title">果冻巧克力</p> <p class="name">西式甜点</p> <p class="price">价格:<span>30元</span></p> </li> <li class="item"> <img src="./images/con6.jpg" alt=""> <p class="title">流动水果</p> <p class="name">提拉米苏</p> <p class="price">价格:<span>30元</span></p> </li> <li class="item"> <img src="./images/con7.jpg" alt=""> <p class="title">玫瑰花型</p> <p class="name">马卡龙</p> <p class="price">价格:<span>30元</span></p> </li> <li class="item"> <img src="./images/con8.jpg" alt=""> <p class="title">木买奶油</p> <p class="name">芝士蛋糕</p> <p class="price">价格:<span>30元</span></p> </li> </ul> </div> <div class="footer"> 西式甜点网版权所有2000-2016京ICP备08001421号 京公网安备110108007702 </div> </div> </body> </html>
作业一列表 user = ["zhangsan","lisi","wangwu"] userTel = ["15258987777","13868998587","13448745698"] print("""********操作目录******** 1.添加会员信息 2.删除会员信息 3.查看所有会员信息 4.退出程序""") while True: option = input("输入操作编号") if option == "1": print("*"*8,"添加会员","*"*8) input_user = input("输入会员账号: ") input_userTel = input("输入会员手机: ") if not input_user in user: user.append(input_user) userTel.append(input_userTel) print("添加完毕") else: print("用户已存在") elif option == "2": print("*"*8,"删除会员","*"*8) input_user = input("输入用户账号: ") if input_user in user: user_index = user.index(input_user) user.pop(user_index) userTel.pop(user_index) print("删除完毕") else: print("用户不存在") elif option == "3": print("*"*8,"全部会员","*"*8) for i in range(len(user)): print("用户账户: ",user[i],"用户手机号: ",userTel[i]) elif option == "4": break else: print("编号无效") 作业二字典 userList = {"zhangsan":"123456","lisi":"12345678"} print("""********操作目录******** 1.添加会员信息 2.删除会员信息 3.查看所有会员信息 4.退出程序""") while True: option = input("输入操作编号") if option == "1": print("*"*8,"添加会员","*"*8) input_user = input("输入会员账号: ") input_userPwd = input("输入会员密码: ") if not input_user in userList.keys(): userList[input_user] = input_userPwd print("添加成功") else: print("用户已存在") elif option == "2": print("*"*8,"删除会员","*"*8) input_user = input("输入用户账号: ") if input_user in userList.keys(): userList.pop(input_user) print("删除完毕") else: print("用户不存在") elif option == "3": print("*"*8,"全部会员","*"*8) for i in userList.keys(): print("用户账户: ",i," 用户密码: ",userList[i]) elif option == "4": print("*"*8,"退出程序","*"*8) break else: print("编号无效")
<?php /** * 功能:PDO连接数据库操作函数封装 */ class PDO_SQL { public function __construct($pdo_config) { $sql_info="{$pdo_config['dbms']}:host={$pdo_config['host']};dbname={$pdo_config['db']}"; try { $this->pdo_connect = new PDO($sql_info, $pdo_config['user'], $pdo_config['pwd']); } catch (PDOException $e) { die ("Error!: " . $e->getMessage()); } #PDO连接数据库 } public function PDO_get_array($sql_code,$parameter=[]){ /* $sql_code - SQL语句 $parameter - 预处理参数 */ $stmt = ($this->pdo_connect)->prepare($sql_code); $stmt->execute($parameter); $row = $stmt->fetch(PDO::FETCH_ASSOC); return $row; } #获取一条数据返回数组 public function PDO_input_prepare($sql_code,$parameter=[],$mod=0){ /* $sql_code - SQL语句 $parameter - 预处理参数 $mod - 处理模式 */ $stmt = ($this->pdo_connect)->prepare($sql_code); $stmt->execute($parameter); if($mod == 1) { #预处理:执行SQL语句 return $stmt->rowCount(); }else{ #预处理:获取数据列表 $list = null; while($row = $stmt->fetch(PDO::FETCH_ASSOC)) $list[] = $row; if(is_array($list)){ return $list; }else{ return "Empty Data"; } } } #sql预处理函数 } ?> PDO_get_array -- 获取一条数据返回数组 PDO_input_prepare -- sql预处理函数:发送命令与获取列表
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document1</title> <style> a { color: #333; text-decoration: none; } .box { width: 360px; border: 1px solid #ddd; position: relative; padding: 15px; box-sizing: border-box; } .box a:hover .title { color: #339999; text-decoration: underline; } .box a:active .title { font-size: 30px; text-decoration: underline; } .box a:focus .title { color: pink; } .top_up { position:absolute; left: 0; top: 0; } .adimg { width: 100%; } .title { color: #3e3e3e; font-size: 15px; } .shopinfo { position: relative; height: 100px; } .price { position: absolute; color: rgb(221, 93, 34); font-size: 36px; font-weight: bold; top: 20px; } .priceold { position: absolute; top: 42px; left: 118px; color: #888; font-size: 14px; } .view { position: absolute; right: 0; top: 20px; } .buycount { position: absolute; right: 0; top: 52px; font-size: 13px; } .buycount i { color: red; font-style: normal; } </style> </head> <body> <div class="box"> <a href="#"> <img class="top_up" src="./images/top_tu.gif" alt=""> <img class="adimg" src="./images/adv.jpg" alt=""> <p class="title">【12店通用】领航冰品哈根达斯:冰淇淋双球,口味任选2种,节假通用 超链接效果设置</p> <div class="shopinfo"> <span class="price">¥20.8</span> <span class="priceold">原价¥38</span> <img class="view" src="./images/see.jpg" alt=""> <span class="buycount"><i>32</i>人已购买</span> </div> </a> </div> </body> </html>
import java.util.Random; import java.util.Scanner; class java20221217 { public static void main(String[] args) { //红球 1-33 中选择6个 / 篮球 1-16 中选择1个 //生成中将号码 int[] arrNumber = create(); //录入用户输入的红蓝球 int[] userInput = getUserInput(); //得到红球中奖个数 int redCount = getRedCount(arrNumber,userInput); //得到篮球中将个数 int blueCount = getBlueCount(arrNumber,userInput); System.out.println("\n红球中奖个数: " + redCount); System.out.println("蓝球中奖个数: " + blueCount); //判断中奖级别 String result = getResult(redCount, blueCount); System.out.println(result); //查看生成的数据 System.out.println("中奖号码为: "); for (int i : arrNumber) { System.out.print(i + " "); } System.out.println(); System.out.println("我输入的号码为: "); for (int j : userInput) { System.out.print(j + " "); } System.out.println(); } public static boolean contains(int[] arr, int number) { for (int i : arr) { if(i == number) { return true; } } return false; } public static int[] create() { Random random = new Random(); int[] createResult = new int[7]; //存放生成的号码 for(int i=0;i<6;){ int redNumber = random.nextInt(33)+1; if(!contains(createResult, redNumber)) { createResult[i] = redNumber; i++; } } int blueNumber = random.nextInt(16)+1; createResult[6] = blueNumber; return createResult; } public static int[] getUserInput() { int[] userInput = new int[7]; //存放用户输入 Scanner sc = new Scanner(System.in); for(int i=0;i<6;) { System.out.print("请输入第" + (i+1) + "个红色球号码: "); int input = sc.nextInt(); if(!contains(userInput,input)){ if(input >= 1 && input <= 33){ userInput[i] = input; i++; }else{ System.out.println("请输入正确的红色球号码"); } }else{ System.out.println("这个号码已经选择过了"); } } for(int j=0;j<1;) { System.out.print("请输入蓝色球号码: "); int input = sc.nextInt(); if(input >= 1 && input <= 16){ userInput[userInput.length-1] = input; j++; }else{ System.out.println("请输入正确的蓝色球号码"); } } return userInput; } public static int getRedCount(int[] arr,int[] userInput) { int count = 0; for(int i=0;i<arr.length-1;i++) { if(arr[i] == userInput[i]) { count++; } } return count; } public static int getBlueCount(int[] arr,int[] userInput) { if(arr[arr.length-1] == userInput[userInput.length-1]) { return 1; }else{ return 0; } } public static String getResult(int redCount, int blueCount) { if(redCount == 6 && blueCount == 1){ return "一等奖,中奖1000万"; }else if(redCount == 6 && blueCount == 0){ return "二等奖,中奖500万"; }else if(redCount == 5 && blueCount == 1){ return "三等奖,中奖3000"; }else if((redCount == 5 && blueCount == 0) || (redCount == 4 && blueCount == 1)){ return "四等奖,中奖200元"; }else if((redCount == 4 && blueCount == 0) || (redCount == 3 && blueCount == 1) || (redCount == 2 && blueCount == 1)){ return "五等奖,中奖10元"; }else if((redCount == 1 && blueCount == 0) || blueCount == 1){ return "六等奖,中奖5元"; } return "未中奖"; } }
<?php /** * 功能:图片压缩 */ class imgcompress { private $src; private $image; private $imageinfo; private $percent = 0.5; /** * 图片压缩 * @param $src 源图 * @param float $percent 压缩比例 */ public function __construct($src, $percent=1) { $this->src = $src; $this->percent = $percent; } /** 高清压缩图片 * @param string $saveName 提供图片名(可不带扩展名,用源图扩展名)用于保存。或不提供文件名直接显示 */ public function compressImg($saveName='') { $this->_openImage(); if(!empty($saveName)) $this->_saveImage($saveName); //保存 else $this->_showImage(); } /** * 内部:打开图片 */ private function _openImage() { list($width, $height, $type, $attr) = getimagesize($this->src); $this->imageinfo = array( 'width'=>$width, 'height'=>$height, 'type'=>image_type_to_extension($type,false), 'attr'=>$attr ); $fun = "imagecreatefrom".$this->imageinfo['type']; $this->image = $fun($this->src); $this->_thumpImage(); } /** * 内部:操作图片 */ private function _thumpImage() { $new_width = $this->imageinfo['width'] * $this->percent; $new_height = $this->imageinfo['height'] * $this->percent; $image_thump = imagecreatetruecolor($new_width,$new_height); //将原图复制带图片载体上面,并且按照一定比例压缩,极大的保持了清晰度 imagecopyresampled($image_thump,$this->image,0,0,0,0,$new_width,$new_height,$this->imageinfo['width'],$this->imageinfo['height']); imagedestroy($this->image); $this->image = $image_thump; } /** * 输出图片:保存图片则用saveImage() */ private function _showImage() { header('Content-Type: image/'.$this->imageinfo['type']); $funcs = "image".$this->imageinfo['type']; $funcs($this->image); } /** * 保存图片到硬盘: * @param string $dstImgName 1、可指定字符串不带后缀的名称,使用源图扩展名 。2、直接指定目标图片名带扩展名。 */ private function _saveImage($dstImgName) { if(empty($dstImgName)) return false; $allowImgs = ['.jpg', '.jpeg', '.png', '.bmp', '.wbmp','.gif']; //如果目标图片名有后缀就用目标图片扩展名 后缀,如果没有,则用源图的扩展名 $dstExt = strrchr($dstImgName ,"."); $sourseExt = strrchr($this->src ,"."); if(!empty($dstExt)) $dstExt =strtolower($dstExt); if(!empty($sourseExt)) $sourseExt =strtolower($sourseExt); //有指定目标名扩展名 if(!empty($dstExt) && in_array($dstExt,$allowImgs)){ $dstName = $dstImgName; }elseif(!empty($sourseExt) && in_array($sourseExt,$allowImgs)){ $dstName = $dstImgName.$sourseExt; }else{ $dstName = $dstImgName.$this->imageinfo['type']; } $funcs = "image".$this->imageinfo['type']; $funcs($this->image,$dstName); } /** * 销毁图片 */ public function __destruct(){ imagedestroy($this->image); } }
基本的逻辑比较运算符在前面笔记说过了 链接:http://notei.cn/note_see/64 这里主要是讲 与运算 或运算 非运算 学过一点电子逻辑门都应该有点概念的 与运算在C语言中用的符号是 "&&" 实际用法就是: if(10>=5 && 6<=5),顾名思义与逻辑就是要让两个逻辑同时为真最后才能返回真条件,反之就是假条件。 最后会返回的结果为0,为什么10>=5明明是真条件为什么会等于0呢?是因为6<=5是假条件导致整个运算结果也为假条件。 也可以多个条件一起进行运算if(1==1&&2==2&&3==3)多个条件一起运算也是可以的,如果三个条件都为真,那么最后会返回一个真条件,反之假条件。 或逻辑运算方式为只要有一个条件为真,那么最后就会返回真条件。反之全部为假条件,最后也只能返回假条件。符号为 "||" 用法为:if(1==1||2==3)。 非逻辑就是在条件的前面加一个 "!" 也就是小写的感叹号,让最后的逻辑取反。如果逻辑为真后加一个"!"条件将会变成假条件,反之为真。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <style> * { margin: 0; padding: 0; } li { list-style: none; } a { text-decoration: none; } .main-box { width: 980px; margin: 0 auto; } .nav { background: url("images/head_bg.jpg") repeat-x; height: 128px; } .nav li { float: left; } .nav .item a { display: inline-block; width: 120px; height: 128px; line-height: 64px; text-align: center; color: #fff; margin: 0 5px; font-size: 17px; } .nav .item a:hover { background: url("images/xuanfu.png") no-repeat; } .banner { margin-top: 10px; } .banner img { width: 100%; } .sortlist { margin-top: 10px; display: flex; box-shadow: 0 0 0 10px rgb(110, 190, 45) inset; padding: 10px; box-sizing: border-box; } .sortlist .leftbox li { display: flex; } .leftbox { width: 333px; } .leftbox li p { display: inline-block; width: 100%; text-align: center; } .leftbox .top p { line-height: 180px; } .leftbox .bottom p { line-height: 150px; } .leftbox .top { height: 180px; background-color: #F2F2F2; } .leftbox .bottom { height: 150px; background-color: #F2F2F2; margin-top: 10px; } .centerbox { width: 280px; margin-left: 10px; } .centerbox .top { display: flex; margin-bottom: 10px; height: 120px; background-color: #F2F2F2; } .centerbox .top p { line-height: 120px; text-align: center; flex: 1; } .centerbox .bottom { background-color: #F2F2F2; display: flex; height: 210px; } .centerbox .bottom p { line-height: 210px; text-align: center; flex: 1; } .rightbox { margin-left: 10px; flex: 1; } .rightbox .top { display: flex; margin-bottom: 10px; height: 100%; background-color: #F2F2F2; } .rightbox .top img { height: 100%; width: 200px; } .rightbox .top p { line-height: 330px; text-align: center; flex: 1; } .hot { margin-top: 50px; } .hot .title { background-color: rgb(110, 190, 45); color: #fff; display: inline-block; padding: 10px 20px; font-weight: normal; } .hot .list { border: 1px solid #ddd; display: flex; padding: 20px; box-sizing: border-box; gap: 10px; } .hot .item { flex: 1; } .hot .item .mainimg { width: 100%; } .hot .item .intitle { text-align: center; font-size: 19px; line-height: 56px; color: #444; } .hot .item .hotinfo { background-color: rgb(110, 190, 45); height: 38px; display: flex; width: calc(100% - 20px); margin-left: 10px; margin-bottom: 10px; } .hot .item { border: 1px solid #ddd; } .hot .item .hotinfo .info { line-height: 38px; color: #fff; text-align: center; flex: 1; font-size: 15px; } .footer { padding: 50px 0; text-align: center; color: #fff; background: #111; margin-top: 20px; } </style> <body> <div class="nav"> <ul class="main-box"> <li><img src="./images/logo.png" alt="logo"></li> <li class="item"><a href="#">首页</a></li> <li class="item"><a href="#">学校介绍</a></li> <li class="item"><a href="#">课程设置</a></li> <li class="item"><a href="#">教资力量</a></li> <li class="item"><a href="#">招生问答</a></li> <li class="item"><a href="#">教学活动</a></li> </ul> </div> <div class="main-box"> <div class="banner"> <img src="./images/banner.jpg" alt="banner"> </div> <div class="sortlist"> <ul class="leftbox"> <li class="top"> <img src="./images/pic01.jpg" alt=""> <p>大学专区</p> </li> <li class="bottom"> <img src="./images/pic02.jpg" alt=""> <p>求职专区</p> </li> </ul> <ul class="centerbox"> <li class="top"> <img src="./images/pic03.jpg" alt=""> <p>高中专区</p> </li> <li class="bottom"> <img src="./images/pic04.jpg" alt=""> <p>考证专区</p> </li> </ul> <ul class="rightbox"> <li class="top"> <img src="./images/pic05.jpg" alt=""> <p>线上精品课专区</p> </li> </ul> </div> <div class="hot"> <h2 class="title">热门课程 / Popular courses</h2> <ul class="list"> <li class="item"> <img class="mainimg" src="./images/match01.jpg" alt=""> <p class="intitle">软件工程师课程</p> <div class="hotinfo"> <img class="hotimg" src="./images/gouwu.jpg" alt=""> <p class="info">高级IT人才的捷径</p> </div> </li> <li class="item"> <img class="mainimg" src="./images/match02.jpg" alt=""> <p class="intitle">Java课程</p> <div class="hotinfo"> <img class="hotimg" src="./images/gouwu.jpg" alt=""> <p class="info">高级IT人才的捷径</p> </div> </li> <li class="item"> <img class="mainimg" src="./images/match03.jpg" alt=""> <p class="intitle">软件工程师课程</p> <div class="hotinfo"> <img class="hotimg" src="./images/gouwu.jpg" alt=""> <p class="info">高级IT人才的捷径</p> </div> </li> <li class="item"> <img class="mainimg" src="./images/match04.jpg" alt=""> <p class="intitle">软件工程师课程</p> <div class="hotinfo"> <img class="hotimg" src="./images/gouwu.jpg" alt=""> <p class="info">高级IT人才的捷径</p> </div> </li> </ul> </div> </div> <div class="footer"> Copyright © 2020-2030 CHAOLIUFUSHIcom, All rights reserved.<br> 2020-2023,版权所有 优课网 00CP备222222222 </div> </body> </html>
<?php /** * 功能:Curl外部资源请求函数封装 */ function postUrl($url,$data=[]){ /* $url - 指向URL连接 $data - 提交POST数据 */ $ch=curl_init(); curl_setopt($ch,CURLOPT_POST, true); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($data)); curl_setopt($ch,CURLOPT_POSTFIELDS,$data); $response=curl_exec($ch); curl_close($ch); $result = json_decode($response,true); return $result; } #发送POST请求
如果我们想通过一个成绩来得到等级: <span>{{ author.chengji >= 85 ? '优' : '良' }}</span> 可以在标签内渲染一个计算结果达到目的,不过这样会导致运算代码和其他标签内容混淆看起来很臃肿,我们可以通过Vue的计算属性computed来达到分开计算的方法: computed: { chengji:function() { return this.chengji >= 85 ? '优' : '良'; } } ><span>{{ chengji }}</span> 计算属性值会基于其响应式依赖被缓存,如果计算的参数没有发生改变,那么就会直接调用缓存中的结果,而不用再次调用函数获取结果 如果使用methods方法来计算的话,每当数据改变时页面会重新渲染,全部函数将全被执行
v-bind主要用于绑定一个或多个属性值,或者向另一个组件传递props值。 <view v-html="html" :style="sty"> data() { return { sty: "background: red;color:#fff" } } 主要写法在上面所示 完整写法是v-bind:style="sty"缩写::style="sty" 一般用于绑定标签属性
Java方法定义格式为: public static void 方法名称(参数){...} 例如: public static void test_fun(){ System.out.println("我的第一个方法"); } 调用方法就是直接 test_fun(); 使用void创建方法是不能使用return来返回结果的 想要返回结果需要使用其他类型例如: public static int 方法名称(参数){... return int} 这样的写法就可以返回一个int参数,其他类型也是一样的例子 -------下面讲讲其他语言的方法定义方式------- 首先就说说PHP的方法定义: function 方法名(参数){...} PHP定义方法时不需要定义方法的数据类型,可直接使用return返回各个类型的数据 另外就是C语言,定义方式: void 方法名(参数){...} C语言也是和Java类似,也是需要再定义时决定数据类型才可以进行返回相应的数据类型,例如int 方法名(参数){...}这样就可以返回一个int类型的
import java.util.Scanner; //统计字符串信息 public class demo2 { public static void main(String[] args) { System.out.println("请输入字符串"); Scanner sc = new Scanner(System.in); String input = sc.next(); int count = input.length(); //字符个数 int numberCount = 0; //数字计算 int smallCount = 0; //字母计算 int elseCount = 0; //其他字符 for (int i=0;i<count;i++) { char s = input.charAt(i); if((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z')) { //char类型的变量在参与计算或判断大小的时候会自动转为int类型,对应的值为ASCII码 smallCount++; }else if(s >= 48 && s <= 57) { //48 - 57 在ASCII码中对应0-9,s在判断大小时会自动转为ASCII码 numberCount++; }else { elseCount++; } } System.out.println("总字符数量:" + count); System.out.println("数字数量:" + numberCount); System.out.println("字幕数量:" + smallCount); System.out.println("其他字符数量:" + elseCount); } }
正则表达式基本的规则图 图片来自黑马程序员课程
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document2</title> <style> * { margin: 0; padding: 0; } .main-box { width: 980px; margin: 50px auto; } .title-box { background-color: #CFE2F0; padding: 0 20px; box-sizing: border-box; border: 1px solid #4188C3; } .title-box .title { color: #333; line-height: 48px; font-size: 18px; font-weight: normal; } .content { border: 1px solid #4188C3; height: 360px; display: flex; background: #F7FBFE; } .content .left { width: 100%; } .content .center { width: 100%; } .content .right { width: 120%; } .left img { width: 80%; height: 42%; margin-top: 5%; margin-left: 10%; border: 1px #ddd solid; } .center ul { padding: 30px 30px; box-sizing: border-box; } .center ul li { height: 180px; } .center .title { font-weight: bold; margin-bottom: 20px; } .center .sub-title { margin-bottom: 20px; font-size: 15px; color: #333; } .right { padding: 20px; box-sizing: border-box; line-height: 34px; font-size: 15px; } </style> </head> <body> <div class="main-box"> <div class="title-box"> <h3 class="title">通讯终端</h3> </div> <div class="content"> <div class="left"> <img src="./images/t2/p1.jpg" alt=""> <img src="./images/t2/p2.jpg" alt=""> </div> <div class="center"> <ul> <li> <p class="title">天价登场 诺基亚N97中文版上市价曝光</p> <p class="sub-title">尽管最夏普三款千万像素手机的隆重发布..</p> </li> <li> <p class="title">诺基亚停止生产WiMAX手机</p> <p class="sub-title">北京时间1月11日消息,据国外媒体报道,..</p> </li> </ul> </div> <div class="right"> <ul> <li>MTK完善3G布局 09年推出人才定制计划</li> <li>山寨机不能成为问题品牌机的替罪羊</li> <li>五大智能手机操作系统大对决</li> <li>短信利器 三星发布独特按键手机T349</li> <li>火拼N97 三星i8910 HD上市售5600元</li> <li>价格不低 索尼爱立信C901中文版将上市</li> <li>天价登场 诺基亚N97中文版上市价曝光</li> <li>轻松进入“街机”档 诺基亚5800现价2360元</li> <li>魔幻键盘音乐手机 摩托罗拉E8仅1478元 </li> </ul> </div> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document1</title> <style> * { padding: 0; margin: 0; } li { list-style: none; } a { color: #666; text-decoration: none; } .content { width: 1280px; margin: 0 auto; } .nav { height: 600px; background: url("images/bg.png") center; background-size: cover; } .navlist { padding: 30px 60px; box-sizing: border-box; text-align: center; } .navlist ul li { float: left; line-height: 60px; padding: 0 50px; font-size: 16px; } .seach { position: relative; width: 128px; height: 36px; margin-top: 12px; } .seach img { height: 16px; position: absolute; top: calc(50% - 8px); left: 10px; z-index: 10; } .seach .input { position: absolute; top: 0; left: 0; height: 100%; width: 100%; border: none; border-radius: 18px; font-size: 12px; padding-left: 32px; box-sizing: border-box; outline: none; color: #666 } .hot { text-align: center; margin-top: 20px; } .hotlist { margin-top: 20px; text-align: left; padding: 0 60px; box-sizing: border-box; } .hotlist .item .img img { width: 100%; } .hotlist .item .title { padding: 10px; box-sizing: border-box; font-weight: bold; font-size: 18px; color: #333; border-bottom: 1px solid #ddd; } .hotlist .item .info { padding: 10px; padding-bottom: 30px; color: #bbb; box-sizing: border-box; } .hotlist { display: flex; gap: 80px; } .bottomimage img { width: 100%; } .life { background-color: #E1EBF2; margin-top: 50px; text-align: center; padding: 30px 0; } .life ul { text-align: center; } .life ul li { display: inline-block; margin: 20px 20px; } .footer { height: 80px; background: url("images/footer_bg.jpg"); color: #fff; text-align: center; line-height: 80px; margin-top: 50px; } </style> </head> <body> <div class="content"> <div class="nav"> <div class="navlist"> <ul> <li> <img class="logo" src="./images/logo.png" alt=""> </li> <li><a href="#">网站首页</a></li> <li><a href="#">床和床垫</a></li> <li><a href="#">卧室纺织品</a></li> <li><a href="#">灯具照明</a></li> <li class="seach"> <img src="./images/f.png" alt=""> <input class="input" type="text" placeholder="输入商品名称"> <li> </ul> </div> </div> <div class="hot"> <img src="./images/dongtai.jpg" alt=""> <ul class="hotlist"> <li class="item"> <dt class="box"> <dd class="img"> <img src="./images/news1.jpg" alt=""> </dd> <dd class="title">BEST贝达</dd> <dd class="info">将杂乱无章的物品收纳到视线之外,在我怕门后要展示台的心爱之物!</dd> <dd class="bottomimage"><img src="./images/yinying.jpg" alt=""></dd> </dt> </li> <li class="item"> <dt class="box"> <dd class="img"> <img src="./images/news2.jpg" alt=""> </dd> <dd class="title">BEST贝达</dd> <dd class="info">将杂乱无章的物品收纳到视线之外,在我怕门后要展示台的心爱之物!</dd> <dd class="bottomimage"><img src="./images/yinying.jpg" alt=""></dd> </dt> </li> <li class="item"> <dt class="box"> <dd class="img"> <img src="./images/news3.jpg" alt=""> </dd> <dd class="title">BEST贝达</dd> <dd class="info">将杂乱无章的物品收纳到视线之外,在我怕门后要展示台的心爱之物!</dd> <dd class="bottomimage"><img src="./images/yinying.jpg" alt=""></dd> </dt> </li> </ul> </div> <div class="life"> <img src="./images/shenghuo.png" alt=""> <ul> <li><img src="./images/img1.jpg" alt=""></li> <li><img src="./images/img2.jpg" alt=""></li> <li><img src="./images/img3.jpg" alt=""></li> </ul> </div> </div> <div class="footer"> 爱家居版权所有2016-2026京ICP备222222222号 京公网安备2222222222222 </div> </body> </html>
用法: methods: { // #ifdef APP-PLUS but:function() { console.log("APP端"); } // #endif #ifdef H5 but:function() { console.log("网页端"); } #endif #ifdef MP-WEIXIN but:function() { console.log("微信端"); } #endif #ifdef H5 || MP-WEIXIN but:function() { console.log("网页或微信端"); } #endif } 更多参数:https://uniapp.dcloud.net.cn/tutorial/platform.html#%E8%B7%A8%E7%AB%AF%E5%85%BC%E5%AE%B9
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>Document1</title> <style> * { margin: 0; padding: 0; } .main-box { width: 980px; margin: 0 auto; } .header { height: 68px; } .header .logo1 { float: left; } .header .logo2 { float: right; } .list-box { height: 320px; } .list-box ul { height: 400px; margin-top: 68px; } .list-box ul li { float: left; width: 20%; list-style: none; text-align: center; } </style> </head> <body> <div class="main-box"> <div class="header"> <img class="logo1" src="./images/t1/logo.jpg" alt="logo1"> <img class="logo2" src="./images/t1/logo2.jpg" alt="logo2"> </div> <div class="list-box"> <ul> <li> <img class="image" src="./images/t1/person1.jpg" alt=""> <p class="text">person1</p> </li> <li> <img class="image" src="./images/t1/person2.jpg" alt=""> <p class="text">person2</p> </li> <li> <img class="image" src="./images/t1/person3.jpg" alt=""> <p class="text">person3</p> </li> <li> <img class="image" src="./images/t1/person4.jpg" alt=""> <p class="text">person4</p> </li> <li> <img class="image" src="./images/t1/person5.jpg" alt=""> <p class="text">person5</p> </li> </ul> </div> </div> </body> </html>
编写程序,从键盘输入列表,输出列表元素的平均值。其中平均值使用函数进行计算。 def get_input(): return input("请输入数据列表: ") def get_average(list): average = 0 for i in list: average += i average /= len(list) return average input_list = eval(get_input()) average = get_average(input_list) print(average)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Custom Font Example</title> <style> /* 使用@font-face规则定义字体 */ @font-face { font-family: 'AkalTun'; /* 定义一个字体名 */ src: url('https://akaltun.cn/1/akaltun.ttf') format('truetype'); /* 指定字体文件和格式 */ } /* 应用自定义字体到body,也可以应用到其他元素 */ body { font-family: 'AkalTun', sans-serif; /* 将字体应用到body,如果字体加载失败则回退到sans-serif */ } </style> </head> <body> <div id="container"> <h1>欢迎来到我的网站ئۇيغۇرچە</h1> <p>这里是使用自定义字体的文本。</p> <!-- 其他内容 --> </div> </body> </html>
void Delay_showNumber(unsigned int ms){ unsigned char i, j; while(--ms){ i = 2; j = 199; do { while (--j); } while (--i); } } void setNumber(unsigned char ledNumber, unsigned char number){ unsigned char ledShow[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x80}; switch(ledNumber){ case 8:P2_4 = 1; P2_3 = 1; P2_2 = 1; break; case 7:P2_4 = 1; P2_3 = 1; P2_2 = 0; break; case 6:P2_4 = 1; P2_3 = 0; P2_2 = 1; break; case 5:P2_4 = 1; P2_3 = 0; P2_2 = 0; break; case 4:P2_4 = 0; P2_3 = 1; P2_2 = 1; break; case 3:P2_4 = 0; P2_3 = 1; P2_2 = 0; break; case 2:P2_4 = 0; P2_3 = 0; P2_2 = 1; break; case 1:P2_4 = 0; P2_3 = 0; P2_2 = 0; break; } P0 = ledShow[number]; Delay_showNumber(2); P0 = 0x00; Delay_showNumber(1); } #注解内部自带一个延迟函数,可以被任意调用,输入值单位延迟ms .h文件在贴图内
ASCII 打印字符 (字符编码: 32-127) 32~126(共95个)是字符:32是空格,其中48~57为0到9十个阿拉伯数字,65~90为26个大写英文字母,97~122号为26个小写英文字母,其余为一些标点符号、运算符号等。第127个字符表示的是键盘上的删除命令。 32-127ASCII码对应值在下方
Mysql外链约束规则
%a 浮点数、十六进制数字和p-记数法(C99) %A 浮点数、十六进制数字和p-记法(C99) %c 一个字符(char) %C 一个ISO宽字符 %d 有符号十进制整数(int)(%e 浮点数、e-记数法 %E 浮点数、E-记数法 %f 单精度浮点数(默认float)、十进制记数法(%.nf 这里n表示精确到小数位后n位.十进制计数) %g 根据数值不同自动选择%f或%e. %G 根据数值不同自动选择%f或%e. %i 有符号十进制数(与%d相同) %o 无符号八进制整数 %p 指针 %s 对应字符串char*(%S 对应宽字符串WCAHR*(%u 无符号十进制整数(unsigned int) %x 使用十六进制数字0f的无符号十六进制整数 %X 使用十六进制数字0f的无符号十六进制整数 %% 打印一个百分号 特殊运用: %3d 要求宽度为3位,如果不足3位,在前方自动补空格 %03d 要求宽度为3位,如果不足3位,在前方自动补0 %-3d 要求宽度为3位,如果不足3位,在后方自动补空格 %.2f 小数点保留两位
""" while 7过 i = 1 while i <= 100: i+=1 if i % 7 == 0 or i % 10 == 7: print("过") else: print(i) """ """ for 过 for i in range(1,101): if i % 7 == 0 or i % 10 == 7: print("过") else: print(i) """ """ while 打印星 i = 0 while i <= 5: j = 0 while j <= i: print("*",end="") j+=1 i+=1 print("\n") """ """ for 打印星 for i in range(6): for j in range(i): print("*",end="") print("\n") """ """ for 计算1-100的和 sum = 0 for i in range(1,101): sum += i print(sum) """ """ for 计算25-100之间偶数结果 sum = 0 for i in range(25,101): if i % 2 == 0: sum += i print(sum) """
C语言逗号运算符: int a = 10,b = 20,c = 0; 设置a变量等于10,b变量等于20,c变量等于0 逗号运算符写法: c = (a++,b+=10,a+=b); 注意:一定要用括号将内容包起来 括号内的表达式会从左往右执行,最后c的值会等于最后一个表达式,也就是a+=b 那么c最后会等于什么呢?有的人以为a+=b不就是a=a+b,最后不就是30吗,最后返回的值却是41,别忘了前面还有两个表达式,分别是a++和a+=b,执行完前面两个表达式后,a将会等于11,b会等于30,那么最后a+b就是11+30=41 当整个都好运算符执行完成后,最后a=41,b=30,c=41 为什么a也会等于41呢?因为最后一个表达式a+=b就是a=a+b也会执行,那么a还是会等于a+b也就是41。 写好的代码参考: #include <stdlib.h> int main() { int a = 10,b = 20,c; c = (a++,b+=10,a+=b); printf("%d,%d,%d",a,b,c); return(0); }
在component目录下新建一个子组件 然后在父界面使用import绑定子界面: import child from "../../component/child.vue" child 是子组件名,from后面连接组件路径 然后使用components绑定组件: components: { child } 父传子参数可以通过标签属性传递: <child :content="content"></child> 子组件接收方法: props: ["content"] 子组件传递参数给父组件: 可以使用this.$emit通过事件的方式传递参数: but:function() { this.$emit("buts",this.putInfo); } buts 父组件接收的事件名, putInfo 是传递的参数 父组件通过标签属性的方式得到传递的参数: <child @buts="buts"></child> 夫组件通过buts事件接收 约束传递的参数: props: { content:{ type: [Number,String], } } 允许Number类型和String类型
import java.util.Scanner; //String字符串练习 public class Main { public static void main(String[] args) { char[] ch = new char[] {97,98,99,100}; String s1 = new String(ch); //ASCII码转为字符 System.out.println(s1); String a1 = new String("abc"); String a2 = new String("abc"); System.out.println(a1 == a2); //false 比较的是在堆里面存储的地址值,new出来的地址值不同 //字符串比较时会进行比较存储的地址值 //new 出来的String记录在堆中,直接赋值的String记录在串池中 String b1 = "abc"; String b2 = "abc"; System.out.println(b1 == b2); //true 不使用new并且指定的数据一直,地址也会相同 String c1 = new String("abc"); String c2 = "abc"; System.out.println(c1 == c2); //false 地址不同 String d1 = new String("abc"); String d2 = "abc"; System.out.println(d1.equals(d2)); //true 使用equals方法强制对字符串内容进行比较 Scanner sc = new Scanner(System.in); //搭配输入信息使用 System.out.printf("输入信息: "); String inp = sc.next(); String e = new String("abc"); System.out.println(inp.equals(e)); } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Document</title> <style> body { background-color: #EBEBEB; } .content { background: url("images/form_bg.jpg"); width: 1430px; height: 717px; margin: 0 auto; position: relative; } .frombox { width: 700px; height: 540px; position: absolute; top: 160px; left: 700px; } .title { text-align: center; font-size: 24px; } .line { padding: 7px 0; font-size: 15px; } .line input { height: 26px; width: 220px; } .line .tip { text-align: right; display: inline-block; width: 90px; } .line.color input { width: 120px; } .line.btn input { background-color: #93B518; color: #fff; width: 120px; height: 36px; border: 0; margin: 15px 28px; } </style> </head> <body> <div class="content"> <div class="frombox"> <h1 class="title">传智学员信息登记表</h1> <form action="" method="GET"> <div class="line"> <label class="tip">用户登录名:</label> <input type="text" name="username" value="mymail@163.com" readonly="readonly" disabled="disabled"> <label>(不能修改,只能查看)</label> </div> <div class="line"> <label class="tip">真实姓名:</label> <input type="text" name="name" placeholder="例如:王鹏" required pattern="^[\u4e00-\u9fa5]+$"> <label>(必须填写,只能输入汉字)</label> </div> <div class="line"> <label class="tip">真实年龄:</label> <input type="number" name="age" min="0" max="100" value="24" required placeholder="16-100"> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">出生日期:</label> <input type="date" name="date" required> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">电子邮箱:</label> <input type="email" name="email" placeholder="123456@qq.com" required> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">身份证号:</label> <input type="text" name="idcard" required pattern="^[0-9]{17}[0-9Xx]$"> <label>(必须填写,能够以数字,字母x结尾的短身份证号)</label> </div> <div class="line"> <label class="tip">手机号码:</label> <input type="tel" name="tel" required> <label>(必须填写)</label> </div> <div class="line"> <label class="tip">个人主页:</label> <input type="url" name="myurl" placeholder="http://bk.notei.cn"> <label>(请选择网址)</label> </div> <div class="line color"> <label class="tip">幸运颜色:</label> <input type="color" name="luckcolor" value="#E2D546"> <label>(请选择你喜欢的颜色)</label> </div> <div class="line btn"> <input type="submit" value="提交"> <input type="reset" value="重置"> </div> </form> </div> </div> </body> </html>