Grey Area 代码实现

Problem Description
Dr. Grey is a data analyst, who visualizes various aspects of data received from all over the world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is a simple self-made histogram generator.

Figure 1: A histogram

Figure 1 is an example of histogram automatically produced by his histogram generator. A histogram is a visual display of frequencies of value occurrences as bars. In this example, values in the interval 0–9 occur five times, those in the interval 10–19 occur three times, and 20–29 and 30–39 once each. Dr. Grey’s histogram generator is a simple tool. First, the height of the histogram is fixed, that is, the height of the highest bar is always the same and those of the others are automatically adjusted proportionately. Second, the widths of bars are also fixed. It can only produce a histogram of uniform intervals, that is, each interval of a histogram should have the same width (10 in the above example). Finally, the bar for each interval is painted in a grey color, where the colors of the leftmost and the rightmost intervals are black and white, respectively, and the darkness of bars monotonically decreases at the same rate from left to right. For instance, in Figure 1, the darkness levels of the four bars are 1, 2/3, 1/3, and 0, respectively. In this problem, you are requested to estimate ink consumption when printing a histogram on paper. The amount of ink necessary to draw a bar is proportional to both its area and darkness.

Input
The input consists of multiple datasets, each of which contains integers and specifies a value table and intervals for the histogram generator, in the following format:
nw
v1
v2
.
.
.
vn
n is the total number of value occurrences for the histogram, and each of the n lines following the first line contains a single value. Note that the same value may possibly occur multiple times. w is the interval width. A value v is in the first (i.e. leftmost) interval if 0 ≤ v<w, the second one if w ≤ v< 2w, and so on. Note that the interval from 0 (inclusive) to w (exclusive) should be regarded as the leftmost even if no values occur in this interval. The last (i.e. rightmost) interval is the one that includes the largest value in the dataset.
You may assume the following:
1 ≤ n ≤ 100
10 ≤ w ≤ 50
0 ≤ vi ≤ 100
for 1 ≤ i ≤ n
You can also assume that the maximum value is no less than w. This means that the histogram has more than one interval. The end of the input is indicated by a line containing two zeros.

Output
For each dataset, output a line containing the amount of ink consumed in printing the histogram. One unit of ink is necessary to paint one highest bar black. Assume that 0.01 units of ink per histogram is consumed for various purposes except for painting bars such as drawing lines and characters (see Figure 1). For instance, the amount of ink consumed in printing the histogram in Figure 1 is:

Each output value should be a 6 decimal fraction.

Sample Input
3 50
100
0
100
3 50
100
100
50
10 10
1
2
3
4
5
16
17
18
29
30
0 0

Sample Output
0.510000
0.260000
1.476667

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Grey Area
Problem Description Dr. Grey is a data analyst, who visualizes various aspects of data received from all over the world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is a simple self-made histogram generator. ![](http://acm.hdu.edu.cn/data/images/C384-1000-1.jpg) Figure 1: A histogram Figure 1 is an example of histogram automatically produced by his histogram generator. A histogram is a visual display of frequencies of value occurrences as bars. In this example, values in the interval 0–9 occur five times, those in the interval 10–19 occur three times, and 20–29 and 30–39 once each. Dr. Grey’s histogram generator is a simple tool. First, the height of the histogram is fixed, that is, the height of the highest bar is always the same and those of the others are automatically adjusted proportionately. Second, the widths of bars are also fixed. It can only produce a histogram of uniform intervals, that is, each interval of a histogram should have the same width (10 in the above example). Finally, the bar for each interval is painted in a grey color, where the colors of the leftmost and the rightmost intervals are black and white, respectively, and the darkness of bars monotonically decreases at the same rate from left to right. For instance, in Figure 1, the darkness levels of the four bars are 1, 2/3, 1/3, and 0, respectively. In this problem, you are requested to estimate ink consumption when printing a histogram on paper. The amount of ink necessary to draw a bar is proportional to both its area and darkness. Input The input consists of multiple datasets, each of which contains integers and specifies a value table and intervals for the histogram generator, in the following format: nw v1 v2 . . . vn n is the total number of value occurrences for the histogram, and each of the n lines following the first line contains a single value. Note that the same value may possibly occur multiple times. w is the interval width. A value v is in the first (i.e. leftmost) interval if 0 ≤ v<w, the second one if w ≤ v< 2w, and so on. Note that the interval from 0 (inclusive) to w (exclusive) should be regarded as the leftmost even if no values occur in this interval. The last (i.e. rightmost) interval is the one that includes the largest value in the dataset. You may assume the following: 1 ≤ n ≤ 100 10 ≤ w ≤ 50 0 ≤ vi ≤ 100 for 1 ≤ i ≤ n You can also assume that the maximum value is no less than w. This means that the histogram has more than one interval. The end of the input is indicated by a line containing two zeros. Output For each dataset, output a line containing the amount of ink consumed in printing the histogram. One unit of ink is necessary to paint one highest bar black. Assume that 0.01 units of ink per histogram is consumed for various purposes except for painting bars such as drawing lines and characters (see Figure 1). For instance, the amount of ink consumed in printing the histogram in Figure 1 is: ![](http://acm.hdu.edu.cn/data/images/C384-1000-2.jpg) Each output value should be a 6 decimal fraction. Sample Input 3 50 100 0 100 3 50 100 100 50 10 10 1 2 3 4 5 16 17 18 29 30 0 0 Sample Output 0.510000 0.260000 1.476667
Grey Area 直方图的问题
Problem Description Dr. Grey is a data analyst, who visualizes various aspects of data received from all over the world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is a simple self-made histogram generator. Figure 1 is an example of histogram automatically produced by his histogram generator. A histogram is a visual display of frequencies of value occurrences as bars. In this example, values in the interval 0–9 occur five times, those in the interval 10–19 occur three times, and 20–29 and 30–39 once each. Dr. Grey’s histogram generator is a simple tool. First, the height of the histogram is fixed, that is, the height of the highest bar is always the same and those of the others are automatically adjusted proportionately. Second, the widths of bars are also fixed. It can only produce a histogram of uniform intervals, that is, each interval of a histogram should have the same width (10 in the above example). Finally, the bar for each interval is painted in a grey color, where the colors of the leftmost and the rightmost intervals are black and white, respectively, and the darkness of bars monotonically decreases at the same rate from left to right. For instance, in Figure 1, the darkness levels of the four bars are 1, 2/3, 1/3, and 0, respectively. In this problem, you are requested to estimate ink consumption when printing a histogram on paper. The amount of ink necessary to draw a bar is proportional to both its area and darkness. Input The input consists of multiple datasets, each of which contains integers and specifies a value table and intervals for the histogram generator, in the following format. n w v1 v2 ... vn n is the total number of value occurrences for the histogram, and each of the n lines following the first line contains a single value. Note that the same value may possibly occur multiple times. w is the interval width. A value v is in the first (i.e. leftmost) interval if 0 ≤ v < w, the second one if w ≤ v < 2w, and so on. Note that the interval from 0 (inclusive) to w (exclusive) should be regarded as the leftmost even if no values occur in this interval. The last (i.e. rightmost) interval is the one that includes the largest value in the dataset. You may assume the following. 1 ≤ n ≤ 100 10 ≤ w ≤ 50 0 ≤ vi ≤ 100 for 1 ≤ i ≤ n You can also assume that the maximum value is no less than w. This means that the histogram has more than one interval. The end of the input is indicated by a line containing two zeros. Output For each dataset, output a line containing the amount of ink consumed in printing the histogram. One unit of ink is necessary to paint one highest bar black. Assume that 0:01 units of ink per histogram is consumed for various purposes except for painting bars such as drawing lines and characters (see Figure 1). For instance, the amount of ink consumed in printing the histogram in Figure 1 is: 1 × 1 + 2/3× 3/5+1/3× 1/5+ 0 × 15+ 0.01=1 +25+115+ 0.01=1.47666 ..... Each output value should be in a decimal fraction and may have an error less than 10^-6. Sample Input 3 50 100 0 100 3 50 100 100 50 10 10 1 2 3 4 5 16 17 18 29 30 0 0 Sample Output 0.51 0.26 1.476667
统计图的问题,Grey Area
Problem Description Dr. Grey is a data analyst, who visualizes various aspects of data received from all over the world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is a simple self-made histogram generator. Figure 1 is an example of histogram automatically produced by his histogram generator. A histogram is a visual display of frequencies of value occurrences as bars. In this example, values in the interval 0–9 occur five times, those in the interval 10–19 occur three times, and 20–29 and 30–39 once each. Dr. Grey’s histogram generator is a simple tool. First, the height of the histogram is fixed, that is, the height of the highest bar is always the same and those of the others are automatically adjusted proportionately. Second, the widths of bars are also fixed. It can only produce a histogram of uniform intervals, that is, each interval of a histogram should have the same width (10 in the above example). Finally, the bar for each interval is painted in a grey color, where the colors of the leftmost and the rightmost intervals are black and white, respectively, and the darkness of bars monotonically decreases at the same rate from left to right. For instance, in Figure 1, the darkness levels of the four bars are 1, 2/3, 1/3, and 0, respectively. In this problem, you are requested to estimate ink consumption when printing a histogram on paper. The amount of ink necessary to draw a bar is proportional to both its area and darkness. Input The input consists of multiple datasets, each of which contains integers and specifies a value table and intervals for the histogram generator, in the following format. n w v1 v2 ... vn n is the total number of value occurrences for the histogram, and each of the n lines following the first line contains a single value. Note that the same value may possibly occur multiple times. w is the interval width. A value v is in the first (i.e. leftmost) interval if 0 ≤ v < w, the second one if w ≤ v < 2w, and so on. Note that the interval from 0 (inclusive) to w (exclusive) should be regarded as the leftmost even if no values occur in this interval. The last (i.e. rightmost) interval is the one that includes the largest value in the dataset. You may assume the following. 1 ≤ n ≤ 100 10 ≤ w ≤ 50 0 ≤ vi ≤ 100 for 1 ≤ i ≤ n You can also assume that the maximum value is no less than w. This means that the histogram has more than one interval. The end of the input is indicated by a line containing two zeros. Output For each dataset, output a line containing the amount of ink consumed in printing the histogram. One unit of ink is necessary to paint one highest bar black. Assume that 0:01 units of ink per histogram is consumed for various purposes except for painting bars such as drawing lines and characters (see Figure 1). For instance, the amount of ink consumed in printing the histogram in Figure 1 is: 1 × 1 + 2/3× 3/5+1/3× 1/5+ 0 × 15+ 0.01=1 +25+115+ 0.01=1.47666 ..... Each output value should be in a decimal fraction and may have an error less than 10^-6. Sample Input 3 50 100 0 100 3 50 100 100 50 10 10 1 2 3 4 5 16 17 18 29 30 0 0 Sample Output 0.51 0.26 1.476667
Grey Area区域的一个计算
Problem Description Dr. Grey is a data analyst, who visualizes various aspects of data received from all over the world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is a simple self-made histogram generator. Figure 1 is an example of histogram automatically produced by his histogram generator. A histogram is a visual display of frequencies of value occurrences as bars. In this example, values in the interval 0–9 occur five times, those in the interval 10–19 occur three times, and 20–29 and 30–39 once each. Dr. Grey’s histogram generator is a simple tool. First, the height of the histogram is fixed, that is, the height of the highest bar is always the same and those of the others are automatically adjusted proportionately. Second, the widths of bars are also fixed. It can only produce a histogram of uniform intervals, that is, each interval of a histogram should have the same width (10 in the above example). Finally, the bar for each interval is painted in a grey color, where the colors of the leftmost and the rightmost intervals are black and white, respectively, and the darkness of bars monotonically decreases at the same rate from left to right. For instance, in Figure 1, the darkness levels of the four bars are 1, 2/3, 1/3, and 0, respectively. In this problem, you are requested to estimate ink consumption when printing a histogram on paper. The amount of ink necessary to draw a bar is proportional to both its area and darkness. Input The input consists of multiple datasets, each of which contains integers and specifies a value table and intervals for the histogram generator, in the following format. n w v1 v2 ... vn n is the total number of value occurrences for the histogram, and each of the n lines following the first line contains a single value. Note that the same value may possibly occur multiple times. w is the interval width. A value v is in the first (i.e. leftmost) interval if 0 ≤ v < w, the second one if w ≤ v < 2w, and so on. Note that the interval from 0 (inclusive) to w (exclusive) should be regarded as the leftmost even if no values occur in this interval. The last (i.e. rightmost) interval is the one that includes the largest value in the dataset. You may assume the following. 1 ≤ n ≤ 100 10 ≤ w ≤ 50 0 ≤ vi ≤ 100 for 1 ≤ i ≤ n You can also assume that the maximum value is no less than w. This means that the histogram has more than one interval. The end of the input is indicated by a line containing two zeros. Output For each dataset, output a line containing the amount of ink consumed in printing the histogram. One unit of ink is necessary to paint one highest bar black. Assume that 0:01 units of ink per histogram is consumed for various purposes except for painting bars such as drawing lines and characters (see Figure 1). For instance, the amount of ink consumed in printing the histogram in Figure 1 is: 1 × 1 + 2/3× 3/5+1/3× 1/5+ 0 × 15+ 0.01=1 +25+115+ 0.01=1.47666 ..... Each output value should be in a decimal fraction and may have an error less than 10^-6. Sample Input 3 50 100 0 100 3 50 100 100 50 10 10 1 2 3 4 5 16 17 18 29 30 0 0 Sample Output 0.51 0.26 1.476667
本人是初学者看一些代码有些不懂,还请大神指点一下,谢谢
${ msg }表示什么意思呢??? index.jsp怎么跳转到main.jsp呢??? **index.jsp** ``` <html > <title>聊天室</title> <link href="CSS/style.css" rel="stylesheet"> <script type="text/javascript"> function check(){ if(document.getElementById("form1").username.value==""){ alert("请输入用户名!"); document.getElementById("form1").username.focus(); return false; } if(document.getElementById("form1").password.value==""){ alert("请输入密码名!"); document.getElementById("form1").password.focus(); return false; } } </script> <body> <br> <center><h3 style="color:red;">${ msg }</h3></center> <form id="form1" name="form1" method="post" action="${pageContext.request.contextPath }/user" onSubmit="return check()"> <input type="hidden" name="method" value="login"> <table width="371" height="230" border="0" align="center" cellpadding="0" cellspacing="0" background="images/login.jpg"> <tr> <td height="120" colspan="3" class="word_dark">&nbsp;</td> </tr> <tr> <td width="53" align="center" valign="top" class="word_dark">&nbsp;</td> <td width="216" align="center" valign="top" class="word_dark"> <table width="100%" height="100%"> <tr> <td>用户名:</td> <td><input type="text" name="username" class="login"></td> </tr> </table> </td> <td width="94" valign="top" class="word_dark"></td> </tr> <tr> <td width="53" align="center" valign="top" class="word_dark">&nbsp;</td> <td width="216" align="center" valign="top" class="word_dark"> <table width="100%" height="100%"> <tr> <td>密&nbsp;&nbsp;码:</td> <td><input type="password" name="password" class="login"></td> </tr> </table> </td> <td width="94" valign="top" class="word_dark"></td> </tr> <tr> <td width="53" align="center" valign="top" class="word_dark">&nbsp;</td> <td width="216" align="center" valign="top" class="word_dark"> <input name="Submit" type="submit" class="btn_bg" value="进 入"> </td> <td width="94" valign="top" class="word_dark"> </td> </tr> </table> </form> </body> </html> ``` **main** ``` <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ include file="safe.jsp"%> <html> <head> <title>聊天室</title> <link href="CSS/style.css" rel="stylesheet"> <script type="text/javascript" src="${ pageContext.request.contextPath }/js/jquery-1.8.3.js"></script> <script type="text/javascript"> var sysBBS = "<span style='font-size:14px; line-height:30px;'>欢迎光临心之语聊天室,请遵守聊天室规则,不要使用不文明用语。</span><br><span style='line-height:22px;'>";var sysBBS = "<span style='font-size:14px; line-height:30px;'>欢迎光临心之语聊天室,请遵守聊天室规则,不要使用不文明用语。</span><br><span style='line-height:22px;'>"; window.setInterval("showContent();",1000); window.setInterval("showOnLine();",10000); window.setInterval("check();",1000); // Jquery:JS框架. // 相当于window.onload $(function(){ showOnLine(); showContent(); check(); }); function check(){ $.post("${pageContext.request.contextPath}/user?method=check",function(data){ if(data == 1){ // 提示用户下线了 alert("用户已经被踢下线了!"); // 回到登录页面! window.location = "index.jsp"; } }); } // 显示在线人员列表 function showOnLine(){ // 异步发送请求 获取在线人员列表 // Jquery发送异步请求 $.post("${pageContext.request.contextPath}/online.jsp?"+new Date().getTime(),function(data){ // $("#online") == document.getElementById("online"); $("#online").html(data); }); } // 显示聊天的内容 function showContent(){ $.post("${pageContext.request.contextPath}/user?"+new Date().getTime(),{'method':'getMessage'},function(data){ $("#content").html(sysBBS+data); }); } function set(selectPerson){ //自动添加聊天对象 if(selectPerson != "${existUser.username}"){ form1.to.value=selectPerson; }else{ alert("请重新选择聊天对象!"); } } function send(){ if(form1.to.value==""){ alert("请选择聊天对象!"); return false; } if(form1.content.value==""){ alert("发送信息不可以为空!"); form1.content.focus(); return false; } // $("#form1").serialize():让表单中所有的元素都提交. // jquery提交数据.{id:1,name:aa,age:25} $.post("${pageContext.request.contextPath}/user?"+new Date().getTime(),$("#form1").serialize(),function(data){ $("#content").html(sysBBS+data+"</span>"); }); } function exit(){ alert("欢迎您下次光临!"); window.location.href="${pageContext.request.contextPath}/user?method=exit"; } function checkScrollScreen(){ if(!$("#scrollScreen").attr("checked")){ $("#content").css("overflow","scroll"); }else{ $("#content").css("overflow","hidden"); //当聊天信息超过一屏时,设置最先发送的聊天信息不显示 //alert($("#content").height()); $("#content").scrollTop($("#content").height()*2); } setTimeout('checkScrollScreen()',500); } </script> </head> <body> <table width="778" height="150" border="0" align="center" cellpadding="0" cellspacing="0" background="images/top.jpg"> <tr> <td>&nbsp;</td> </tr> </table> <table width="778" height="276" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="165" valign="top" bgcolor="#f6fded" id="online" style="padding:5px">在线人员列表</td> <td width="613" height="200px" valign="top" background="images/main_bj.jpg" bgcolor="#FFFFFF" style="padding:5px; "> <div style="height:290px; overflow:hidden" id="content">聊天内容</div></td> </tr> </table> <table width="778" height="95" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#D6D3CE" background="images/bottom.jpg"> <form action="" id="form1" name="form1" method="post"> <input type="hidden" name="method" value="sendMessage"/> <tr> <td height="30" align="left">&nbsp;</td> <td height="37" align="left"> <input name="from" type="hidden" value="${existUser.username}">[${existUser.username} ]对 <input name="to" type="text" value="" size="35" readonly="readonly"> 表情 <select name="face" class="wenbenkuang"> <option value="无精打采的">无精打采的</option> </select> 说:</td> <td width="189" align="left">&nbsp;&nbsp;字体颜色: <select name="color" size="1" class="wenbenkuang" id="select"> <option selected>默认颜色</option> <option style="color:#999999" value="999999">烟雨蒙蒙</option> </select> </td> <td width="19" align="left"><input name="scrollScreen" type="checkbox" class="noborder" id="scrollScreen" onClick="checkScrollScreen()" value="1" checked> </td> </tr> <tr> <td width="21" height="30" align="left">&nbsp;</td> <td width="549" align="left"> <input name="content" type="text" size="70" onKeyDown="if(event.keyCode==13 && event.ctrlKey){send();}"> <input name="Submit2" type="button" class="btn_grey" value="发送" onClick="send()"> </td> <td align="right"><input name="button_exit" type="button" class="btn_grey" value="退出聊天室" onClick="exit()"> </td> <td align="center">&nbsp;</td> </tr> <tr> <td height="30" align="left">&nbsp;</td> <td align="center">&nbsp;</td> </tr> </form> </table> </body> </html> ```
调用高德地图webapi无法显示'点标记'图标,复制下官网的代码也不行,有时候甚至没有反应,刚学习不太懂怎么回事?
![点击添加无用,多试几次有时候会有无法显示图片的黑框](https://img-ask.csdn.net/upload/201912/24/1577155738_802652.png) 点击添加无用,多试几次有时候会有无法显示图片的黑框 ``` 官方代码如下 <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width"> <title>默认点标记</title> <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"/> <style> html, body, #container { height: 100%; width: 100%; } .amap-icon img, .amap-marker-content img{ width: 25px; height: 34px; } .marker { position: absolute; top: -20px; right: -118px; color: #fff; padding: 4px 10px; box-shadow: 1px 1px 1px rgba(10, 10, 10, .2); white-space: nowrap; font-size: 12px; font-family: ""; background-color: #25A5F7; border-radius: 3px; } .input-card{ width: 18rem; z-index: 170; } .input-card .btn{ margin-right: .8rem; } .input-card .btn:last-child{ margin-right: 0; } </style> </head> <body> <div id="container"></div> <div class="input-card"> <label style="color:grey">点标记操作</label> <div class="input-item"> <input id="addMarker" type="button" class="btn" onclick="addMarker()" value="添加点标记"> <input id="updateMarker" type="button" class="btn" onclick="updateIcon()" value="更新点标记图标"> </div> <div class="input-item"> <input id="clearMarker" type="button" class="btn" onclick="clearMarker()" value="删除点标记"> <input id="updateMarker" type="button" class="btn" onclick="updateContent()" value="更新点标记内容"> </div> </div> <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=此处我用了自己的KEY"></script> <script type="text/javascript"> var marker, map = new AMap.Map("container", { resizeEnable: true, center: [116.397428, 39.90923], zoom: 13 }); // 实例化点标记 function addMarker() { marker = new AMap.Marker({ icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png", position: [116.406315,39.908775], offset: new AMap.Pixel(-13, -30) }); marker.setMap(map); } function updateIcon() { marker.setIcon('//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png') } function updateContent() { if (!marker) { return; } // 自定义点标记内容 var markerContent = document.createElement("div"); // 点标记中的图标 var markerImg = document.createElement("img"); markerImg.className = "markerlnglat"; markerImg.src = "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png"; markerContent.appendChild(markerImg); // 点标记中的文本 var markerSpan = document.createElement("span"); markerSpan.className = 'marker'; markerSpan.innerHTML = "Hi,我被更新啦!"; markerContent.appendChild(markerSpan); marker.setContent(markerContent); //更新点标记内容 marker.setPosition([116.391467, 39.927761]); //更新点标记位置 } // 清除 marker function clearMarker() { if (marker) { marker.setMap(null); marker = null; } } </script> </body> </html> ```
俄罗斯方块在矩阵列中的排列的问题,如何运用 C 语言的程序代码编写的思想的方法来实现这个排列
Problem Description Working in corporation is toilsome and rest is important. In leisure time, WisKey like to play Tetris. The Tetris game in board is N*5, and there are 8 kinds of blocks. Look that, red mean the area can’t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap. Input Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100). N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area. Process cases to end of file. Output If you can full of the Tetris, print “YES”, otherwise, print “NO”. Sample Input 1 1 00000 1 1 00100 1 1 01010 4 1 10000 00101 10010 00000 Sample Output YES YES NO YES
Java WEB 连接数据库的登录界面失败?
使用Eclipse做登陆界面,连接MySQL 8.0,测试过连接数据库应该是成功的,可能是struts配置有问题,新手不知道问题出在哪里,请帮忙看一下代码,我标注几个我可能出问题又不知道怎么改的地方 //login.jsp //此处可能是表单中form的action属性有问题? ``` <%@ page contentType="text/html; charset=gb2312" language="java"%> <html> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <head> <title>图书馆管理系统</title> <link href="CSS/style.css" rel="stylesheet"> <script language="javascript"> function check(form){ if (form.name.value==""){ alert("请输入用户名称");form.name.focus();return false; } if (form.pwd.value==""){ alert("请输入密码");form.pwd.focus();return false; } } </script> </head> <body> <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder"> <tr> <td width="1000" height="545" align="center" background="Images/login.png"> <table width="1000" height="345" aligh="center" ></table> <form name="form1" method="post" action="manager.do?action=login"> <table width="400" height="200" align="left"> <tr> <td height="37" style="width: 128px; "></td> <td height="37" width="50"> 用户名</td> <td height="37" width="150"> <input name="name" type="text" class="logininput" id="name" size="27"> </td> </tr> <tr> <td height="37" style="width: 128px; "></td> <td height="37" width="50"> 密码 </td> <td height="37" width="150"> <input name="pwd" type="text" class="logininput" id="pwd" size="27"> </td> </tr> <tr> <td height="37" style="width: 128px; "></td> <td height="37" width="50"></td> <td height="37" width="200"> <input name="Submit" type="submit" class="btn_grey" value="确定" onClick="return check(form1)"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="Submit3" type="reset" class="btn_grey" value="重置"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="Submit2" type="button" class="btn_grey" value="关闭" onClick="window.close();"> </td> </tr> </table> </form> </td> <tr> <td align="center" height="50" bgcolor="#3A3A3A" class="word_login">CopyRight &copy; 2019版权所有 xx图书馆<br> </td> </tr> </table> </body> </html> ``` //Manager.java ``` package com.action; import org.apache.struts.action.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.actionForm.ManagerForm; import com.dao.ManagerDAO; import javax.servlet.http.HttpSession; public class Manager extends Action { private ManagerDAO managerDAO = null; public Manager() { this.managerDAO = new ManagerDAO(); } public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { String action = request.getParameter("action"); // System.out.println("获取的查询字符串:" + action); if (action == null || "".equals(action)) { return mapping.findForward("error"); } else if ("login".equals(action)) { return managerLogin(mapping, form, request, response); } request.setAttribute("error", "操作失败!"); return mapping.findForward("error"); } // 管理员身份验证 public ActionForward managerLogin(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ManagerForm managerForm = (ManagerForm) form; //将接收到的表单信息强制转换成ActionForm类型 managerForm.setAd_name(managerForm.getAd_name()); managerForm.setAd_pwd(managerForm.getAd_pwd()); int ret = managerDAO.checkManager(managerForm); System.out.print("验证结果ret的值:" + ret); if (ret == 1) { //将登录到系统的管理员名称保存到session HttpSession session = request.getSession(); session.setAttribute("manager", managerForm.getAd_name()); return mapping.findForward("managerLoginok"); } else { request.setAttribute("error", "您输入的管理员名称或密码错误!"); return mapping.findForward("error"); } } } ``` //ManagerForm ``` package com.actionForm; import org.apache.struts.action.ActionForm; public class ManagerForm extends ActionForm { private int ad_id; private String ad_name; private String ad_pwd; public ManagerForm() { } public int getAd_id() { return ad_id; } public void setAd_id(int ad_id) { this.ad_id=ad_id; } public String getAd_name() { return ad_name; } public void setAd_name(String ad_name) { this.ad_name=ad_name; } public String getAd_pwd() { return ad_pwd; } public void setAd_pwd(String ad_pwd) { this.ad_pwd=ad_pwd; } } ``` //ManagerDAO ``` package com.dao; import com.core.ChStr; import com.core.ConnDB; import java.util.*; import com.actionForm.ManagerForm; import java.sql.*; public class ManagerDAO { private ConnDB conn = new ConnDB(); //管理员身份验证 public int checkManager(ManagerForm managerForm) { int flag = 0; ChStr chStr=new ChStr(); String sql = "SELECT * FROM Ad_info where ad_name='" + chStr.filterStr(managerForm.getAd_name()) + "'"; ResultSet rs = conn.executeQuery(sql); try { if (rs.next()) { String pwd = chStr.filterStr(managerForm.getAd_pwd()); //获取输入的密码并过滤输入字符串中的危险字符 if (pwd.equals(rs.getString(3))) { flag = 1; } else { flag = 0; } }else{ flag = 0; } } catch (SQLException ex) { flag = 0; }finally{ conn.close(); } return flag; } } ``` //ConnDB ``` package com.core; import java.io.InputStream; import java.sql.*; import java.util.Properties; public class ConnDB { public Connection conn=null; public Statement stmt=null; public ResultSet rs=null; private static String propFileName="/com/connDB.properties"; private static Properties prop=new Properties(); private static String dbClassName="com.mysql.cj.jdbc.Driver"; private static String dbUrl="jdbc:mysql://223.80.110.29:3306/sys_test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=CONVERT_TO_NULL"; private static String dbUserName="root"; private static String dbPassword=""; //加载资源文件 public ConnDB() { try { InputStream in=getClass().getResourceAsStream(propFileName); prop.load(in); dbClassName=prop.getProperty("DB_CLASS_NAME","com.mysql.cj.jdbc.Driver"); dbUrl=prop.getProperty("DB_URL","jdbc:mysql://localhost:3306/db_librarysys?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=CONVERT_TO_NULL"); dbUserName=prop.getProperty("DB_USERNAME"); dbPassword=prop.getProperty("DB_PASSWORD"); } catch(Exception e){ e.printStackTrace(); } } public static Connection getConnection() { Connection conn=null; try { //加载数据库驱动 Class.forName(dbClassName); conn=DriverManager.getConnection(dbUrl,dbUserName,dbPassword); } catch(Exception ee) { ee.printStackTrace(); } if(conn==null) { System.err.println("警告:DbConnectionManager.getConnection()获得数据库链接失败.\r\n\r\n链接类型:"+dbClassName+"\r\n链接位置:"+dbUrl); } return conn; } //执行查询语句 public ResultSet executeQuery(String sql) { try { conn=getConnection(); stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); /*ResultSet.CONCUR_READ_ONLY 不能用结果集更新数据库中的表 ResultSet.TYPE_SCROLL_INSENSITIVE 结果集的游标可以上下移动,当数据库变化时,当前结果集不变。 */ rs=stmt.executeQuery(sql); } catch(SQLException ex){ System.err.println(ex.getMessage()); } return rs; } //执行更新操作 添加修改删除数据 public int executeUpdate(String sql) { int result=0;//更新的行数 try { conn=getConnection(); stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); result=stmt.executeUpdate(sql); }catch(SQLException ex) { result=0; } return result; } public void close() { try { if(rs!=null) { rs.close(); } if(stmt!=null) { stmt.close(); } if(conn!=null) { conn.close(); } }catch(Exception e) { e.printStackTrace(System.err); } } } ``` //struts-config ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config> <form-beans> <form-bean name="managerForm" type="com.actionForm.ManagerForm" /> <form-bean name="ParameterForm" type="com.actionForm.ParameterForm" /> </form-beans> <action-mappings type="org.apache.struts.action.ActionMapping"> <action name="managerForm" path="/manager" scope="request" type="com.action.Manager" validate="true"> <forward name="managerLoginok" path="/main.jsp" /> <forward name="error" path="/error.jsp" /> </action> <action name="ParameterForm" path="/parameter" scope="request" type="com.action.Parameter" validate="true"> <forward name="error" path="/error.jsp" /> <forward name="parametermodify" path="/parameter_ok.jsp?para=2" /> <forward name="parametermodifyQuery" path="/parameter_modify.jsp" /> </action> </action-mappings> <message-resources parameter="com.wgh.struts.ApplicationResources" /> </struts-config> ```
俄罗斯方块堆放在网格里的做法,怎么使用C语言的程序编写的代码的思想来解决此算法
Problem Description Working in corporation is toilsome and rest is important. In leisure time, WisKey like to play Tetris. The Tetris game in board is N*5, and there are 8 kinds of blocks. Look that, red mean the area can’t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap. Input Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100). N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area. Process cases to end of file. Output If you can full of the Tetris, print “YES”, otherwise, print “NO”. Sample Input 1 1 00000 1 1 00100 1 1 01010 4 1 10000 00101 10010 00000 Sample Output YES YES NO YES
初学者js运行不了,各路神仙来帮帮忙
<html> <head> <title>手机批发业务-商品备选区</title> <meta charset="utf-8"> <style type="text/css"> #body{background: url(11.jpg);background-size: 100% 100%;width: 100%;height: 100%;} .table{display: table;border-collapse: separate;} #table-row{display: table-row;} #table-cell{display: table-cell;border:1px solid #ccc;} #table-header-group{display: table-header-group;} #table-row-group{display: table-row-group;} #table-foot-group{display: table-footer-group;} .table-column-group{display:table-column-group;} .table-column{display: table-column;} .font{font-size: 13px;color: grey;} </style> <script type="text/javascript"> var result= ""; var price = new Array(4988.00,9099.00,6399.00,3699.00,2499.00,2699.00); var product new Array("华为P30 Pro 赤茶菊 8+256GB","苹果Xs 双卡双待 全网通 64G","三星 Galaxy S10 8+128GB 皓玉白","One Pulse 7Pro 星雾蓝8+256G","Reno2 Z 8G+128G 晨雾白","小米9 8+256G 幻彩紫"); var isSelected = new Array(0,0,0,0,0,0); function clearAll() { isSelected = [0,0,0,0,0,0]; myForm.sp0.checked = false; myForm.sp1.checked = false; myForm.sp2.checked = false; myForm.sp3.checked = false; myForm.sp4.checked = false; myForm.sp5.checked = false; } function checkOut() { var total = 0; var count = 0; for(var i = 0;i<isSelected.length;i++) {count += isSelected[i];} for(var i = 0;i<price.length;i++) {total = total + price[i]*isSelected[i];} alert("您所选购的"+count+"件,产品总价"+total+"\n"+"请去支付!"); } function shoppingCart() { var selectList = ""; for(var j = 0;j<product.length;j++) { if(isSelected[j]) {selectList +=(j+1) + "-" + product[j] + ",价值" +price[j] + "\n";} } var info = (selectList == "") ? "您的购物车为空,请选购!":selectList; alert(info); } function checkSelect(number) { var temp; switch(number) { case 0:temp = myForm.sp0.checked;break; case 1:temp = myForm.sp1.checked;break; case 2:temp = myForm.sp2.checked;break; case 3:temp = myForm.sp3.checked;break; case 4:temp = myForm.sp4.checked;break; default:temp = myForm.sp5.checked;break; } isSelected[number] = (temp) ? 1 : 0; } </script> </head> <body id="body"> <div class="table" style="margin-left: 400px;text-align: center;" > <form name="myForm" method="post" action=""> <div class="table-column-group"> <div class="table-column"></div> <div class="table-column"></div> <div class="table-column"></div> </div> <div id="table-row-group"> <ul id="table-row" style="height: 300px;"> <li id="table-cell" style="width: 200px;"> <img src="华为P30 Pro.jpg" style="height: 250px;width: 200px;"> <span class="font" name="h41">华为P30 Pro 赤茶菊 8+256GB </span><br> <input type="checkbox" name="sp0" value="4988.00" onclick="checkSelect(0);"><span id="font" >$&nbsp4988.00</span> </li> <li id="table-cell" style="width: 200px;"> <img src="苹果xs.jpg" style="height: 250px;width: 200px;"> <span class="font" name="h42">苹果Xs 双卡双待 全网通 64G</span><br> <input type="checkbox" name="sp1" value="9099.00" onclick="checkSelect(1);"><span id="font">$ 9099.00</span> </li> <li id="table-cell" style="width: 200px;"> <img src="三星.jpg" style="height: 250px;width: 200px;"> <span class="font" name="h43">三星 Galaxy S10 8+128GB 皓玉白</span><br> <input type="checkbox" name="sp2" value="6399.00" onclick="checkSelect(2);"><span id="font">$ 6399.00</span> </li> </ul> </div> <div id="table-row-group"> <ul id="table-row" style="height: 300px;"> <li id="table-cell" style="width: 200px;"> <img src="1+7Prp.jpg" style="height: 250px;width: 200px;"> <span class="font" name="h44">One Pulse 7Pro 星雾蓝8+256G</span><br> <input type="checkbox" name="sp3" value="3699.00" onclick="checkSelect(3);"><span id="font">$ 3699.00</span> </li> <li id="table-cell" style="width: 200px;"> <img src="oppo.jpg" style="height: 250px;width: 200px;"> <span class="font" name="h45">Reno2 Z 8G+128G 晨雾白</span><br> <input type="checkbox" name="sp4" value="2499.00" onclick="checkSelect(4);"><span id="font">$ 2499.00</span> </li> <li id="table-cell" style="width: 200px;"> <img src="小米.jpg" style="height: 250px;width: 200px;"> <span class="font" name="h46">小米9 8+256G 幻彩紫</span><br> <input type="checkbox" name="sp5" value="2699.00" onclick="selectList(5);"><span id="font">$ 2699.00</span> </li> </ul> </div> <div id="table-row-group"> <ul id="table-row" style="height: 60px;"> <li id="table-cell" style="width: 200;border-right: #ffffff;" > <input type="button" name="" value="查看购物车" style="height: 35px;width: 100px;margin-top: 10px;background: #ff60af;border: none;color: #ffffff;" onclick="shoppingCart();"> </li> <li id="table-cell" style="width: 200;border-right: #ffffff;border-left: #ffffff;" > <input type="button" name="" value="收银台结算" style="height: 35px;width: 100px;margin-top: 10px;background: #9f35ff;border: none;color: #ffffff;" onclick="checkOut();"> </li> <li id="table-cell" style="width: 200;border-left: #ffffff;" > <input type="button" name="" value="初始化参数" style="height: 35px;width: 100px;margin-top: 10px;background: #ff8040;border: none;color: #ffffff;" onclick="clearAll();"> </li> </ul> </div> </form> </div> </body> </html> ![图片说明](https://img-ask.csdn.net/upload/201912/16/1576498717_549440.jpg) js一点也没反应。。。
python报错:__init__() missing 1 required positional argument: 'parent'
在python3的环境下使用wxpython进行程序编写,运行后出现报错: __init__() missing 1 required positional argument: 'parent' 问题:parent值应该赋予什么 程序部分如下: ``` # 构建表格 class GridFrame(wx.grid.Grid): def __init__(self, parent): wx.grid.Grid.__init__(self, parent, -1) # grid = wx.grid.Grid(self, -1) self.CreateGrid(14, 14) n = 0 m = 0 while n <= 13: self.SetColSize(col=n, width=80) n = n + 1 # print(n) else: print('Finished col') while m <= 13: self.SetRowSize(m, 30) m = m + 1 # print(m) else: print('Finished row') self.SetCellValue(0, 0, 'Data') self.SetCellTextColour(0, 0, wx.BLACK) self.SetCellBackgroundColour(0, 0, wx.LIGHT_GREY) a = 1 b = 6 while a <= 7: while b >= 0: self.SetCellValue(a, 0, 'Z' + str(b)) self.SetCellTextColour(a, 0, wx.BLACK) self.SetCellBackgroundColour(a, 0, wx.LIGHT_GREY) b = b - 1 a = a + 1 # print('Z' + str(b)) # print(a) c = 8 d = 1 while c <= 13: while d <= 6: self.SetCellValue(c, 0, '-Z' + str(d)) self.SetCellTextColour(c, 0, wx.RED) self.SetCellBackgroundColour(c, 0, wx.LIGHT_GREY) d = d + 1 c = c + 1 # print('Z' + str(d)) # print(c) e = 1 f = 0 while e <= 12: while f <= 11: self.SetCellValue(0, e, str(30 * f) + '°') self.SetCellTextColour(0, e, wx.BLUE) self.SetCellBackgroundColour(0, e, wx.LIGHT_GREY) e = e + 1 f = f + 1 self.SetCellValue(0, 13, 'B0') self.SetCellTextColour(0, 13, wx.RED) self.SetCellBackgroundColour(0, 13, wx.LIGHT_GREY) # 主窗口部分构建 class TestFrame(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, parent, -1, 'Guass_Measurement', size=(1250, 600),style=wx.DEFAULT_FRAME_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX) panel = wx.Panel(self, -1) ############################################## # 按钮设置 ############################################### v_sizer = wx.BoxSizer(wx.HORIZONTAL) self.outputdatabutton = wx.Button(panel, -1, u'导出Excel') self.Bind(wx.EVT_BUTTON, self.OnoutputdataCH, self.outputdatabutton) ########################################### # 静态文本框及下拉表单设置 ########################################### h_sizer = wx.BoxSizer(wx.HORIZONTAL) …… ######################################## # 加入表格后的整体布局设置 ######################################## grid = GridFrame(panel) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(v_sizer, proportion=0, flag=wx.EXPAND) sizer.Add(h_sizer, proportion=0, flag=wx.EXPAND) sizer.Add(grid, proportion=1, flag=wx.EXPAND, border=5) panel.SetSizer(sizer) #这是一个按钮的响应函数,想要从表格中获取数据并导出成Excel表格 def OnoutputdataCH(self, event): for k in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]: for l in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]: w = GridFrame().GetCellValue(k, l)# 报错语句 class MyApp(wx.App): def OnInit(self): print("MyApp OnInit") self.frame = TestFrame(None) id = self.frame.GetId() self.frame.Show(True) return True def OnExit(self): print("MyApp OnExit") SerialFrame().close() time.sleep(2) if __name__ == "__main__": "Main Start" app = MyApp() "Before MainLoop" # frame = TestFrame(None) # frame.Show(True) app.MainLoop() "After MainLoop" ``` 求问大神应该怎么改?
计算网格中是否可以用指定的方块填充,怎么使用C语言的程序编写思想的方式实现
Problem Description Working in corporation is toilsome and rest is important. In leisure time, WisKey like to play Tetris. The Tetris game in board is N*5, and there are 8 kinds of blocks. Look that, red mean the area can’t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap. Input Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100). N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area. Process cases to end of file. Output If you can full of the Tetris, print “YES”, otherwise, print “NO”. Sample Input 1 1 00000 1 1 00100 1 1 01010 4 1 10000 00101 10010 00000 Sample Output YES YES NO YES
关于point grey相机sdk-FlyCapture2开发
使用本来带的源码进行的修改,相机连接(connect),获取属性(getproperty),开始捕捉(startcapture)函数都可以,但是设置属性和回调图像(RetrieveBuffer)返回的error分别是write register failed 和image consistency fault。所以最后我还是不能获取图像。 想问有没有大佬碰到过这种情况的或者可以解决的。多谢了!
在Python的GUI(tkinter)中,使用for循环添加多给个Entry组件,如何能够对这多个组件在光标离开后(focusout)进行验证?
在Python的GUI(tkinter)中,使用for循环添加多给个Entry组件,如何能够对这多个组件在光标离开后(focusout)进行验证? 代码如下: ``` from tkinter import * from tkinter import messagebox B_number = [] def C(): def row(): obtain_number = row_number.get() if obtain_number.isdigit(): if eval(obtain_number) > 10: messagebox.showinfo("提示","输入行数太多!,最多总计10行") row_number.delete(0,END) row_number.insert(0,"2") else: def judge_B(event): if B.get().isdigit(): print("成功") else: messagebox.showerror("错误","重新输入") a = eval(obtain_number)+1 for i in range(1,a): B = Entry(add) B.bind("<FocusOut>",judge_B) B_number.append(B) B.grid(row = len(B_number)+1,column = 2) else: messagebox.showerror("错误","字符不合法,已修改为2!") row_number_ene.delete(0,END) row_number_ene.insert(0,"2") add = Tk() add.title("行业绿色制造分级判定系数") add.geometry("500x500") Label(add,text = "行数: ").grid(row = 0,column = 0,padx = 5,pady = 10) row_num = StringVar() row_num.set("2") row_number = Entry(add,textvariable = row_num,bg = "grey",width = 7, justify = CENTER) row_number.grid(row =0,column = 1,pady = 10) Button(add,text = "增加多行",command = row).grid(row = 0, column = 2,pady = 10) C() ``` 存在问题,假设我添加两行,然后对每一行输入1,循环输入(即,第一行输入1-第二行输入1-第一行输入1-第二行输入1,第一行输入a,第二行输入a,第一行输入a,第二行 输入a,每次输入后,点上面行数 (避免多次点击)) 输出结果依次为: 报错;(这里应该是成功才对) 成功; 成功; 成功; 成功;(这里应该报错才对) 报错; 报错; 报错 小弟没有C币,还希望大神能帮忙解决下,小弟在此先行感谢
俄罗斯方块是否能够填充的判断的一个算法,怎么采用C语言的程序编程的过程来实现的呢?
Problem Description Working in corporation is toilsome and rest is important. In leisure time, WisKey like to play Tetris. The Tetris game in board is N*5, and there are 8 kinds of blocks. Look that, red mean the area can’t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap. Input Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100). N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area. Process cases to end of file. Output If you can full of the Tetris, print “YES”, otherwise, print “NO”. Sample Input 1 1 00000 1 1 00100 1 1 01010 4 1 10000 00101 10010 00000 Sample Output YES YES NO YES
jquery 实现图片的缓加载功能
目标:实现界面上图片的按需加载——即缓加载; 难点:页面是使用模板生成的; 如下: ``` <script type="text/html" > <div class="entry"> <img src="../js/img/grey.gif" data-original="../js/img/bmw_m1_hood.jpg" width="765" height="574" alt="BMW M1 Hood"><br/> <img src="../js/img/grey.gif" data-original="../js/img/bmw_m1_side.jpg" width="765" height="574" alt="BMW M1 Side"><br/> <img src="../js/img/grey.gif" data-original="../js/img/viper_1.jpg" width="765" height="574" alt="Viper 1"><br/> <img src="../js/img/grey.gif" data-original="../js/img/viper_corner.jpg" width="765" height="574" alt="Viper Corner"><br/> <img src="../js/img/grey.gif" data-original="../js/img/bmw_m3_gt.jpg" width="765" height="574" alt="BMW M3 GT"><br/> <img src="../js/img/grey.gif" data-original="../js/img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop"><br/> </div> </script> <script type="text/javascript" src="../js/jquery.lazyload.min.js"></script> <script type="text/javascript" charset="utf-8"> $$(function(){ var LazyImg=$("#mainListBlock img.lazy"); LazyImg.show().lazyload({container: $("#mainListBlock") }); }); </script> ```
给imageView添加过滤器
使用代码过滤器: imgAnimation=[[UIImageView alloc]initWithFrame:frame]; imgAnimation.animationImages=_arrimg; //animationImages=animationImages; imgAnimation.contentMode=UIViewContentModeScaleAspectFit; imgAnimation.animationDuration = 2.0f; imgAnimation.animationRepeatCount = 0; [imgAnimation startAnimating]; [self.view addSubview:imgAnimation]; 动画实现的很好,还要实现 **sepia, grey scale** 效果。不知道怎么实现?
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了无数
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
MyBatis研习录(01)——MyBatis概述与入门
C语言自学完备手册(33篇) Android多分辨率适配框架 JavaWeb核心技术系列教程 HTML5前端开发实战系列教程 MySQL数据库实操教程(35篇图文版) 推翻自己和过往——自定义View系列教程(10篇) 走出思维困境,踏上精进之路——Android开发进阶精华录 讲给Android程序员看的前端系列教程(40集免费视频教程+源码) 版权声明 本文原创作者:谷哥的小弟 作者博客
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
Python绘图,圣诞树,花,爱心 | Turtle篇
1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle() circle.shape('circle') circle.color('red') circle.speed('fastest') circle.up() square = turtle.Turtle()
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
web前端javascript+jquery知识点总结
Javascript javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ,语法同java类似,是一种解释性语言,边执行边解释。 JavaScript的组成: ECMAScipt 用于描述: 语法,变量和数据类型,运算符,逻辑控制语句,关键字保留字,对象。 浏览器对象模型(Br
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
文章目录1. 前言2. 数据下载3. 数据处理4. 数据可视化 1. 前言 今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。 2月6日追记:本文发布后,腾讯的数据源多次变更u
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
渗透测试-灰鸽子远控木马
木马概述 灰鸽子( Huigezi),原本该软件适用于公司和家庭管理,其功能十分强大,不但能监视摄像头、键盘记录、监控桌面、文件操作等。还提供了黑客专用功能,如:伪装系统图标、随意更换启动项名称和表述、随意更换端口、运行后自删除、毫无提示安装等,并采用反弹链接这种缺陷设计,使得使用者拥有最高权限,一经破解即无法控制。最终导致被黑客恶意使用。原作者的灰鸽子被定义为是一款集多种控制方式于一体的木马程序
Python:爬取疫情每日数据
前言 有部分同学留言说为什么412,这是因为我代码里全国的cookies需要你自己打开浏览器更新好后替换,而且这个cookies大概只能持续20秒左右! 另外全国卫健委的数据格式一直在变,也有可能会导致爬取失败! 我现在已根据2月14日最新通报稿的格式修正了! 目前每天各大平台,如腾讯、今日头条都会更新疫情每日数据,他们的数据源都是一样的,主要都是通过各地的卫健委官网通报。 为什么已经有大量平台做
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告(本文) 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
粒子群算法求解物流配送路线问题(python)
粒子群算法求解物流配送路线问题(python) 1.查找论文文献 找一篇物流配送路径优化+粒子群算法求解的论文 参考文献:基于混沌粒子群算法的物流配送路径优化 2.了解粒子群算法的原理 讲解通俗易懂,有数学实例的博文:https://blog.csdn.net/daaikuaichuan/article/details/81382794 3.确定编码方式和解码策略 3.1编码方式 物流配送路线的
教你如何编写第一个简单的爬虫
很多人知道爬虫,也很想利用爬虫去爬取自己想要的数据,那么爬虫到底怎么用呢?今天就教大家编写一个简单的爬虫。 下面以爬取笔者的个人博客网站为例获取第一篇文章的标题名称,教大家学会一个简单的爬虫。 第一步:获取页面 #!/usr/bin/python # coding: utf-8 import requests #引入包requests link = "http://www.santostang.
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
情人节来了,教你个用 Python 表白的技巧
作者:@明哥 公众号:Python编程时光 2020年,这个看起来如此浪漫的年份,你还是一个人吗? 难不成我还能是一条狗? 18年的时候,写过一篇介绍如何使用 Python 来表白的文章。 虽然创意和使用效果都不错,但有一缺点,这是那个exe文件,女神需要打开电脑,才有可能参与进来,进而被你成功"调戏”。 由于是很早期的文章了,应该有很多人没有看过。 没有看过的,你可以点击这里查看:用Pyt...
用Python开发实用程序 – 计算器
作者:隋顺意 一段时间前,自己制作了一个库 “sui-math”。这其实是math的翻版。做完后,python既然可以轻易的完成任何的数学计算,何不用python开发一个小程序专门用以计算呢? 现在我们越来越依赖于计算器,很多复杂的计算都离不开它。我们使用过各式各样的计算器,无论是电脑自带的,还是网也上的计算器,却都没有自己动手编写属于自己计算器。今天就让我们走进计算器的世界,用python来编写...
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问