android switch控件第一次被checked的时候没有反应

我的recyclerview里每一个item都包含一个switch控件,switch打开后会跑相应的代码并有toast弹出,而且我switch控件的初始值设定为false了,但是每一个新的item里的switch控件第一次被checked的时候代码并不会跑,但是再关闭再开,就好了,之后也都可以了,这是为什么?谢谢
以下是主程序代码和switch控件布局代码
图片说明
图片说明

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
bootstrap switch控件问题
在js中用.html拼接页面 switch onchange方法无法调用,但是在body中直接写就可以调用,请问大神这是什么原因? 用JS拼接的页面代码: <div class="switch"> <div class="has-switch" tabindex="0"> <div class="switch-on switch-animate"> <span class="switch-left switch-success">ON</span> <label for="switchs0"> </label> <span class="switch-right switch-success">OFF</span> <input id="switchs0" type="checkbox" data-off="success" data-on="success" checked="" name="powerbox" value="1"> </div> </div> </div> 直接在body里面写的switch <div class="switch"> <div class="has-switch" tabindex="0"> <div class="switch-on switch-animate" style=""> <span class="switch-left switch-info">ON</span> <label> </label> <span class="switch-right switch-success">OFF</span> <input type="checkbox" data-off="success" data-on="info" name="powerbox"> </div> </div> </div>
C# 自定义控件实现ChackBox的Checked效果
研究好久,想实现自定义属性变更后图片也随之变更。 由于是组合控件(pictureBox、lable)两个控件组成。 实现效果Checked属性发生变更true(false)显示不同的两个图片。 下面的代码只能实现点击控件发生的变化,实际上更改![图片说明](https://img-ask.csdn.net/upload/201812/06/1544066693_265192.jpg) 这里的属性不会变更图片。目前想实现图中的属性true(false)变更后图片也随之变更 ![图片说明](https://img-ask.csdn.net/upload/201812/06/1544066502_763481.png) ``` public partial class CheckedExChagedEventArgs : UserControl { public delegate void ClickEventHandler(object sender, EventArgs e); public new event ClickEventHandler Click; public CheckedExChagedEventArgs() { InitializeComponent(); } /// <summary> /// 与控件关联的文本 /// </summary> [DefaultValue("")] [DisplayName("文本内容")] [Description("属性:L_Text")] public string L_Text { get { return l_box.Text; } set { l_box.Text = value; } } [Category("重要属性")] [Description("组件是否处于选中状态")] public bool Checked { get; set; } public void ChackBox_MouseDown(object sender, MouseEventArgs e) { if (Checked) { Checked = false; p_chack.BackgroundImage = Properties.Resources.未选中; } else { Checked = true; p_chack.BackgroundImage = Properties.Resources.选中; } } private void ChackBox_Click(object sender, EventArgs e) { this.Refresh(); this.Click?.Invoke(this, e); } } ```
c# 线程间操作无效 从不是创建控件“listView1”的线程访问它
![图片说明](https://img-ask.csdn.net/upload/201912/02/1575253835_918613.jpg) private void button2_Click(object sender, EventArgs e) { Lrcload ld = new Lrcload(); ld.code = Encoding.Default; if (dcgb2312.Checked) ld.code = System.Text.Encoding.GetEncoding("gb2312"); if (dcutf8.Checked) ld.code = System.Text.Encoding.GetEncoding("utf-8"); ld.listview = listView1.Items; ld.reload = checkBox3.Checked; //ld.load(); Thread t = new Thread(new ThreadStart(ld.load)); t.IsBackground = true; t.Start(); } class Lrcload { /// <summary> /// 保存文件编码 /// </summary> public System.Text.Encoding code; /// <summary> /// 列表listview.Items /// </summary> // public ListViewItem[] listview; public ListView.ListViewItemCollection listview; /// <summary> /// 已有歌词重下 /// </summary> public bool reload; /// <summary> /// 下载歌词 /// </summary> public void load() { bu(false); foreach (ListViewItem lvi in listview) { try {
如何使用selenium进行多协程填写表单?
系统: win10 环境:python3.7 浏览器:chrom 小白自学phthon,使用selenium写了一个工具,任务是进入帐号,点掉所有被选中的勾选框,但是假设我需要对1000个帐号进行同样的操作,for i in range(len(work)):将会打开1000个浏览器窗口,有没有一种方法能实现每次打开5个窗口,直至遍历帐号列表? 这是我的帐号列表:(假装有1000个帐号) (https://img-ask.csdn.net/upload/202001/06/1578295823_23416.png) 这是我的代码: ``` #!/usr/bin/env python # -*- coding:utf-8 -*- from gevent import monkey monkey.patch_all() from selenium import webdriver import time, openpyxl, gevent from gevent.queue import Queue work = Queue() def login(): if not work.empty(): user = work.get_nowait() driver = webdriver.Chrome() driver.get('http://safe.shougang.com.cn/srp/#') driver.maximize_window() # 打开浏览器登陆首安云并最大化窗口 username = driver.find_element_by_id('userName') username.send_keys(user) password = driver.find_element_by_id('passWord') password.send_keys(user[0][-6:]) # 传入帐号和密码 button = driver.find_element_by_css_selector('.btn.btn-primary') button.click() try: driver.find_element_by_css_selector('.x-component.x-window-text.x-box-item.x-component-default') print('用户%s 密码错误!\n队列剩余%s个' % (user, len(work))) driver.close() return except Exception: time.sleep(1) # 试登陆 try: url_yhpc = driver.find_element_by_partial_link_text('您有待排查') url_yhpc.click() time.sleep(1) except Exception: print('用户%s 无隐患排查任务\n队列剩余%s个' % (user, len(work))) driver.close() time.sleep(1) return daj_button = driver.find_elements_by_css_selector('.x-grid-checkcolumn.x-grid-checkcolumn-checked') for bt in daj_button: bt.click() time.sleep(0.5) send_button = driver.find_element_by_id('button-1302-btnInnerEl') send_button.click() time.sleep(1) yes_button = driver.find_element_by_id('button-1010-btnWrap') yes_button.click() time.sleep(1) driver.close() print('用户%s 排查成功\n队列剩余%s个' % (user, len(work))) def get_users(): wb = openpyxl.load_workbook(r'C:\users\lz315\Desktop\首安云试验.xlsx') ws = wb.active for row in ws.rows: list_user = [] for cell in row: aa = str(cell.value) list_user.append(aa) work.put_nowait(list_user) wb.close() return work # 读取帐号信息,返回帐号list start = time.time() get_users() task_list = [] for i in range(len(work)): task = gevent.spawn(login) task_list.append(task) gevent.joinall(task_list) end = time.time() print(end-start) ```
本人是初学者看一些代码有些不懂,还请大神指点一下,谢谢
${ 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> ```
layui全选后怎么获取全选的值
//复选框监听事件 table.on('checkbox(language)', function (obj) { tr = obj.tr; if (obj.checked == true) { debugger chechData.push(obj.data); } else { //未选中时移除 for (var i = chechData.length - 1; i >= 0; i--) { if (chechData[i].id == obj.data.id) { chechData.splice(i, 1); } } } }); ``` ```
js全选后遍历取出的值是undefined改怎么解决?
![图片说明](https://img-ask.csdn.net/upload/202001/03/1578038135_799686.jpg) ![图片说明](https://img-ask.csdn.net/upload/202001/03/1578038113_161069.jpg) ``` //复选框监听事件 table.on('checkbox(language)', function (obj) { tr = obj.tr; if (obj.checked == true) { $('input:checkbox').each(function () { chechData.push(JSON.stringify(obj.data)); }); } else { //未选中时移除 for (var i = chechData.length - 1; i >= 0; i--) { if (chechData[i].id == obj.data.id) { chechData.splice(i, 1); } } } }); ``` ``` ``` //选中常用语并赋值 $('#okCom').click('on', function () { debugger var text = parent.document.getElementById("orderContent").value;//获取父页面input框的值 var value = text; for (var i = 0; i < chechData.length; i++) { if( value!== null && value >= 0){ value += chechData[i].text + ""; }else { value = chechData[i].text + "," + value; } } if (text !== null){ window.parent.$('#orderContent').val(value); }else { window.parent.$('#orderContent').val(value).append(text); } window.parent.colseComLanguagePage() }); ``` ``` 该怎么解决呢?
初学者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一点也没反应。。。
ASP.Net System.Data.SqlClient.SqlException:“关键字 'LIKE' 附近有语法错误。
在做课程设计的时候遇到了这个问题,但我本身对asp.net不是特别熟练,求大神指导 protected void Button1_Click(object sender, EventArgs e) { string condstr = "", xb, mysql; if (TextBox1.Text != "") condstr = "sno LIKE '" + TextBox1.Text + "% '"; if (TextBox2.Text != "") if (condstr == "") condstr = "sname LIKE '" + TextBox2.Text + "% '"; else condstr = condstr + "AND sname LIKE '" + TextBox2.Text + "% '"; if (RadioButton1.Checked) xb = "男"; else if (RadioButton2.Checked) xb = "女"; else xb = ""; if (xb != "") if (condstr == "") condstr = "ssex= '" + xb + "'"; else condstr = condstr + "AND ssex= '" + xb + "'"; if (TextBox3.Text != "") if (condstr == "") condstr = "snation LIKE '" + TextBox3.Text + "% '"; else condstr = condstr + "AND snation LIKE '" + TextBox3.Text + "% '"; if (TextBox4.Text != "") if (condstr == "") condstr = "sclass LIKE '" + TextBox4.Text + "% '"; else condstr = condstr + "AND sclass LIKE '" + TextBox4.Text + "% '"; if (condstr == "") mysql = "SELECT*FROM [student] ORDER BY sno"; else mysql = "SELECT*FROM [student] WHERE " + condstr + "ORDER BY sno"; Session["sql"] = mysql; Response.Redirect("editstudent1.aspx"); }
关于WINFORM c# 控件数组问题
我在窗体中创建了一个控件数组CHECKBOX,并添加到了窗体的PANEL中,请问我在程序中怎么去获得窗体上添加的控件数组的CHECKED属性变化, 我在窗体上更改了CHECKBOX的CHECKED的状态,但是在程序中通过循环判断控件的状态,并不能得到CHECKBOX的Checked状态,已经勾选的控件,得到的CHECHED属性却是为FALSE,请问怎么解决。 另外,怎么通过程序,更改控件数组某一个控件的属性,例如颜色,选中状态。
apache Base64源码最后validateCharacter方法为什么会&上补0的个数?
``` /** * <p> * Validates whether the character is possible in the context of the set of possible base 64 values. * </p> * * @param numBits number of least significant bits to check * @param context the context to be used * * @throws IllegalArgumentException if the bits being checked contain any non-zero value */ private long validateCharacter(final int numBitsToDrop, final Context context) { i**f ((context.ibitWorkArea & numBitsToDrop) != 0)** { throw new IllegalArgumentException( "Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value"); } return context.ibitWorkArea >> numBitsToDrop; } ``` 我很疑惑的地方是:验证结尾两个或四个比特为0,不应该是&3 或者 &15吗?详细的代码不再贴了,有能解惑的大神先行拜谢了。 问题解决参见:[问题解决结果](https://github.com/apache/commons-codec/commit/a0447626dcffd6bcd4decd13e4dac1da4661d6f7 "")
PHP数组套对象 怎么转为纯数组 我需要遍历 这样没法遍历
[{"shop_name":"三只松鼠","ru_id":"5","checked":true,"shopName":"三只松鼠","shopId":"5","items":[{"goods_id":"742","goods_name":"猪肉猪肉脯210g 休闲食品小吃零食靖江特产猪肉干 松鼠新风尚 300款零食 低至3折起","goods_number":"1","goods_price":"18.90","integral":"0","goods_thumb":"https://bsy.yongshikj.com/images/201703/thumb_img/0_thumb_G_1490165722464.jpg","checked":true}]}] ![在这里插入图片描述](https://img-blog.csdnimg.cn/20191210172821384.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mjk2MzIzOA==,size_16,color_FFFFFF,t_70)数组套对象 怎么转为纯数组 我需要遍历 这样没法遍历
PHP json数组套json对象 如何转换为json数组
[{"shop_name":"三只松鼠","ru_id":"5","checked":true,"shopName":"三只松鼠","shopId":"5","items":[{"goods_id":"742","goods_name":"猪肉猪肉脯210g 休闲食品小吃零食靖江特产猪肉干 松鼠新风尚 300款零食 低至3折起","goods_number":"1","goods_price":"18.90","integral":"0","goods_thumb":"https://bsy.yongshikj.com/images/201703/thumb_img/0_thumb_G_1490165722464.jpg","checked":true}]}] ![在这里插入图片描述](https://img-blog.csdnimg.cn/20191210172821384.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mjk2MzIzOA==,size_16,color_FFFFFF,t_70)数组套对象 怎么转为纯数组 我需要遍历 这样没法遍历
当点击否的时候默认为不达标,并且不能更改,现在我写的是点击否默认为不达标,但还是可以把不达标改成达标
```![图片说明](https://img-ask.csdn.net/upload/201911/06/1573025434_271438.png) $(function(){ $(".iswrw").on("click",function(){ var wrwValue=$(this).val(); if("0" == wrwValue){ $("#iswpqk").removeAttr("checked"); $("#nowpqk").prop("checked","checked"); }else{ /* $("#nowpqk").removeAttr("checked"); $("#iswpqk").prop("checked","checked"); */ } }); ```
android studio 出现程序包R不存在的问题该怎么解决,求解
android studio 出现程序包R不存在的问题该怎么解决,请各位大佬给我一个能用的解决方案,百度上找的方法发现都不能解决啊 AndroidMainfest.xml ``` <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.R"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="用户登录界面" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> ``` Mainactivity.java ``` package com.example.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity { private boolean checked=false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.btlogin).setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View view) { login(view); } }); CheckBox checkBox=findViewById(R.id.checkBox); checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { checked=b; } }); } public void login(View view){ EditText et_phone=findViewById(R.id.et_phone); String loginName=et_phone.getText().toString(); checked=((CheckBox)findViewById(R.id.checkBox)).isChecked(); Toast.makeText(this,loginName+ "is login...Remmber is"+checked, Toast.LENGTH_SHORT).show(); } } ```
javaweb小项目,写添加功能时出错了检查了几遍sql没找到错误,但从报错信息来看是sql写错了?
在写emp这张表的添加功能时遇到错误了,但是找不到解决的办法。。。。 sql语句检查好几遍了,也找不到是哪里错了。 下面是图和错误信息。 ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894627_921952.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894635_586062.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894640_845708.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894648_593949.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894656_691023.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894666_634817.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894683_320059.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894687_712206.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894695_287559.png)![图片说明](https://img-ask.csdn.net/upload/201912/09/1575894700_310688.png) 错误信息:在表单页面点击立即提交就报错 ``` [2019-12-09 08:10:13,721] Artifact 人事工资管理系统(psms):war exploded: Artifact is being deployed, please wait... 09-Dec-2019 20:10:14.925 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 [2019-12-09 08:10:15,033] Artifact 人事工资管理系统(psms):war exploded: Artifact is deployed successfully [2019-12-09 08:10:15,033] Artifact 人事工资管理系统(psms):war exploded: Deploy took 1,312 milliseconds DEBUG [http-nio-555-exec-5] - Logging initialized using 'class org.apache.ibatis.logging.log4j.Log4jImpl' adapter. DEBUG [http-nio-555-exec-5] - PooledDataSource forcefully closed/removed all connections. DEBUG [http-nio-555-exec-5] - PooledDataSource forcefully closed/removed all connections. DEBUG [http-nio-555-exec-5] - PooledDataSource forcefully closed/removed all connections. DEBUG [http-nio-555-exec-5] - PooledDataSource forcefully closed/removed all connections. DEBUG [http-nio-555-exec-5] - Opening JDBC Connection DEBUG [http-nio-555-exec-5] - Created connection 1428244206. DEBUG [http-nio-555-exec-5] - Setting autocommit to false on JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-5] - ==> Preparing: select * from emp where username=? and password=? DEBUG [http-nio-555-exec-5] - ==> Parameters: root(String), aias(String) DEBUG [http-nio-555-exec-5] - <== Total: 1 DEBUG [http-nio-555-exec-5] - Resetting autocommit to true on JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-5] - Closing JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-5] - Returned connection 1428244206 to pool. 09-Dec-2019 20:10:23.398 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [C:\apache-tomcat-9.0.27-windows-x64\apache-tomcat-9.0.27\webapps\manager] 09-Dec-2019 20:10:23.482 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-9.0.27-windows-x64\apache-tomcat-9.0.27\webapps\manager] has finished in [83] ms DEBUG [http-nio-555-exec-10] - Opening JDBC Connection DEBUG [http-nio-555-exec-10] - Checked out connection 1428244206 from pool. DEBUG [http-nio-555-exec-10] - Setting autocommit to false on JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-10] - ==> Preparing: select max(id) from emp DEBUG [http-nio-555-exec-10] - ==> Parameters: DEBUG [http-nio-555-exec-10] - <== Total: 1 DEBUG [http-nio-555-exec-10] - Resetting autocommit to true on JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-10] - Closing JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-10] - Returned connection 1428244206 to pool. DEBUG [http-nio-555-exec-10] - Opening JDBC Connection DEBUG [http-nio-555-exec-10] - Checked out connection 1428244206 from pool. DEBUG [http-nio-555-exec-10] - Setting autocommit to false on JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-10] - ==> Preparing: insert into emp(id,empno,username,password,ename,sex,birthday,email,call,pname,deptno,state,permissions) values (?,?,?,?,?,?,?,?,?,?,?,?,?) DEBUG [http-nio-555-exec-10] - ==> Parameters: 28(Integer), 028(String), test(String), test(String), 测试(String), 男(String), 2019-12-09(String), 777777777@qq.com(String), 11111111111(String), 接待员(String), 001(String), 在职(String), 普通员工(String) java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) DEBUG [http-nio-555-exec-10] - Rolling back JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] at java.lang.reflect.Method.invoke(Method.java:498) DEBUG [http-nio-555-exec-10] - Resetting autocommit to true on JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] DEBUG [http-nio-555-exec-10] - Closing JDBC Connection [com.mysql.jdbc.JDBC4Connection@552146ee] at com.cdx.psms.utils.TransactionInvocationHandler.invoke(TransactionInvocationHandler.java:30) DEBUG [http-nio-555-exec-10] - Returned connection 1428244206 to pool. at com.sun.proxy.$Proxy5.add(Unknown Source) at com.cdx.psms.controller.Emp_InsertAddServlet.doPost(Emp_InsertAddServlet.java:46) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call,pname,deptno,state,permissions) values (28,'028','test','te' at line 2 ### The error may exist in com/cdx/psms/mapper/EmpMapper.xml ### The error may involve emp.add-Inline ### The error occurred while setting parameters ### SQL: insert into emp(id,empno,username,password,ename,sex,birthday,email,call,pname,deptno,state,permissions) values (?,?,?,?,?,?,?,?,?,?,?,?,?) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call,pname,deptno,state,permissions) values (28,'028','test','te' at line 2 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) at com.cdx.psms.dao.EmpDaoImpl.add(EmpDaoImpl.java:42) at com.cdx.psms.service.EmpServiceImpl.add(EmpServiceImpl.java:26) ... 31 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call,pname,deptno,state,permissions) values (28,'028','test','te' at line 2 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1912) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1251) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy7.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ... 34 more ```
HTTP Status 500 – Internal Server Error(jspmaker生成,tomcat实现)
内容是用Jspmaker把数据库表生成jsp,然后用tomcat,结果出现了以下问题 网站报错代码如下: HTTP Status 500 – Internal Server ErrorType 异常报告 消息 在 [146] 行处理 [/jspmoon/customerlist.jsp] 时发生异常 描述 服务器遇到一个意外的情况,阻止它完成请求。 Exception org.apache.jasper.JasperException: 在 [146] 行处理 [/jspmoon/customerlist.jsp] 时发生异常 143: // Open Connection to the database 144: try{ 145: Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); 146: ResultSet rs = null; 147: // Build SQL 148: String strsql = "SELECT * FROM `customer`"; 149: whereClause = ""; Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:617) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:514) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) Root Cause java.lang.NullPointerException org.apache.jsp.jspmoon.customerlist_jsp._jspService(customerlist_jsp.java:585) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ):注意 主要问题的全部 stack 信息可以在 server logs 里查看 Apache Tomcat/8.5.50 jsp代码: <%@ page session="true" buffer="16kb" import="java.sql.*,java.util.*,java.text.*"%> <%@ page contentType="text/html; charset=UTF-8" %> <% response.setDateHeader("Expires", 0); // date in the past response.addHeader("Cache-Control", "no-store, no-cache, must-revalidate"); // HTTP/1.1 response.addHeader("Cache-Control", "post-check=0, pre-check=0"); response.addHeader("Pragma", "no-cache"); // HTTP/1.0 %> <% Locale locale = Locale.getDefault(); response.setLocale(locale);%> <% session.setMaxInactiveInterval(30*60); %> <%@ include file="db.jsp" %> <%@ include file="jspmkrfn.jsp" %> <% int displayRecs = 20; int recRange = 10; %> <% String tmpfld = null; String escapeString = "\\\\'"; String dbwhere = ""; String masterdetailwhere = ""; String searchwhere = ""; String a_search = ""; String b_search = ""; String whereClause = ""; int startRec = 0, stopRec = 0, totalRecs = 0, recCount = 0; %> <% // Get search criteria for basic search String pSearch = request.getParameter("psearch"); String pSearchType = request.getParameter("psearchtype"); if (pSearch != null && pSearch.length() > 0) { pSearch = pSearch.replaceAll("'",escapeString); if (pSearchType != null && pSearchType.length() > 0) { while (pSearch.indexOf(" ") > 0) { pSearch = pSearch.replaceAll(" ", " "); } String [] arpSearch = pSearch.trim().split(" "); for (int i = 0; i < arpSearch.length; i++){ String kw = arpSearch[i].trim(); b_search = b_search + "("; b_search = b_search + "`C_NAME` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_ADDRESS` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_PHONE` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_MATSEGMENT` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_COMMENT` LIKE '%" + kw + "%' OR "; if (b_search.substring(b_search.length()-4,b_search.length()).equals(" OR ")) { b_search = b_search.substring(0,b_search.length()-4);} b_search = b_search + ") " + pSearchType + " "; } }else{ b_search = b_search + "`C_NAME` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_ADDRESS` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_PHONE` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_MATSEGMENT` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_COMMENT` LIKE '%" + pSearch + "%' OR "; } } if (b_search.length() > 4 && b_search.substring(b_search.length()-4,b_search.length()).equals(" OR ")) {b_search = b_search.substring(0, b_search.length()-4);} if (b_search.length() > 5 && b_search.substring(b_search.length()-5,b_search.length()).equals(" AND ")) {b_search = b_search.substring(0, b_search.length()-5);} %> <% // Build search criteria if (a_search != null && a_search.length() > 0) { searchwhere = a_search; // Advanced search }else if (b_search != null && b_search.length() > 0) { searchwhere = b_search; // Basic search } // Save search criteria if (searchwhere != null && searchwhere.length() > 0) { session.setAttribute("customer_searchwhere", searchwhere); startRec = 1; // Reset start record counter (new search) session.setAttribute("customer_REC", new Integer(startRec)); }else{ if (session.getAttribute("customer_searchwhere") != null) searchwhere = (String) session.getAttribute("customer_searchwhere"); } %> <% // Get clear search cmd startRec = 0; if (request.getParameter("cmd") != null && request.getParameter("cmd").length() > 0) { String cmd = request.getParameter("cmd"); if (cmd.toUpperCase().equals("RESET")) { searchwhere = ""; // Reset search criteria session.setAttribute("customer_searchwhere", searchwhere); }else if (cmd.toUpperCase().equals("RESETALL")) { searchwhere = ""; // Reset search criteria session.setAttribute("customer_searchwhere", searchwhere); } startRec = 1; // Reset start record counter (reset command) session.setAttribute("customer_REC", new Integer(startRec)); } // Build dbwhere if (masterdetailwhere != null && masterdetailwhere.length() > 0) { dbwhere = dbwhere + "(" + masterdetailwhere + ") AND "; } if (searchwhere != null && searchwhere.length() > 0) { dbwhere = dbwhere + "(" + searchwhere + ") AND "; } if (dbwhere != null && dbwhere.length() > 5) { dbwhere = dbwhere.substring(0, dbwhere.length()-5); // Trim rightmost AND } %> <% // Load Default Order String DefaultOrder = ""; String DefaultOrderType = ""; // No Default Filter String DefaultFilter = ""; // Check for an Order parameter String OrderBy = request.getParameter("order"); if (OrderBy != null && OrderBy.length() > 0) { if (session.getAttribute("customer_OB") != null && ((String) session.getAttribute("customer_OB")).equals(OrderBy)) { // Check if an ASC/DESC toggle is required if (((String) session.getAttribute("customer_OT")).equals("ASC")) { session.setAttribute("customer_OT", "DESC"); }else{ session.setAttribute("customer_OT", "ASC"); } }else{ session.setAttribute("customer_OT", "ASC"); } session.setAttribute("customer_OB", OrderBy); session.setAttribute("customer_REC", new Integer(1)); }else{ OrderBy = (String) session.getAttribute("customer_OB"); if (OrderBy == null || OrderBy.length() == 0) { OrderBy = DefaultOrder; session.setAttribute("customer_OB", OrderBy); session.setAttribute("customer_OT", DefaultOrderType); } } // Open Connection to the database try{ Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = null; // Build SQL String strsql = "SELECT * FROM `customer`"; whereClause = ""; if (DefaultFilter.length() > 0) { whereClause = whereClause + "(" + DefaultFilter + ") AND "; } if (dbwhere.length() > 0) { whereClause = whereClause + "(" + dbwhere + ") AND "; } if (whereClause.length() > 5 && whereClause.substring(whereClause.length()-5, whereClause.length()).equals(" AND ")) { whereClause = whereClause.substring(0, whereClause.length()-5); } if (whereClause.length() > 0) { strsql = strsql + " WHERE " + whereClause; } if (OrderBy != null && OrderBy.length() > 0) { strsql = strsql + " ORDER BY `" + OrderBy + "` " + (String) session.getAttribute("customer_OT"); } //out.println(strsql); rs = stmt.executeQuery(strsql); rs.last(); totalRecs = rs.getRow(); rs.beforeFirst(); startRec = 0; int pageno = 0; // Check for a START parameter if (request.getParameter("start") != null && Integer.parseInt(request.getParameter("start")) > 0) { startRec = Integer.parseInt(request.getParameter("start")); session.setAttribute("customer_REC", new Integer(startRec)); }else if (request.getParameter("pageno") != null && Integer.parseInt(request.getParameter("pageno")) > 0) { pageno = Integer.parseInt(request.getParameter("pageno")); if (IsNumeric(request.getParameter("pageno"))) { startRec = (pageno-1)*displayRecs+1; if (startRec <= 0) { startRec = 1; }else if (startRec >= ((totalRecs-1)/displayRecs)*displayRecs+1) { startRec = ((totalRecs-1)/displayRecs)*displayRecs+1; } session.setAttribute("customer_REC", new Integer(startRec)); }else { startRec = ((Integer) session.getAttribute("customer_REC")).intValue(); if (startRec <= 0) { startRec = 1; // Reset start record counter session.setAttribute("customer_REC", new Integer(startRec)); } } }else{ if (session.getAttribute("customer_REC") != null) startRec = ((Integer) session.getAttribute("customer_REC")).intValue(); if (startRec==0) { startRec = 1; //Reset start record counter session.setAttribute("customer_REC", new Integer(startRec)); } } %> <%@ include file="header.jsp" %> <p><span class="jspmaker">TABLE: customer</span></p> <form action="customerlist.jsp"> <table border="0" cellspacing="0" cellpadding="4"> <tr> <td><span class="jspmaker">Quick Search (*)</span></td> <td><span class="jspmaker"> <input type="text" name="psearch" size="20"> <input type="Submit" name="Submit" value="GO"> &nbsp;&nbsp;<a href="customerlist.jsp?cmd=reset">Show all</a> </span></td> </tr> <tr><td>&nbsp;</td><td><span class="jspmaker"><input type="radio" name="psearchtype" value="" checked>Exact phrase&nbsp;&nbsp;<input type="radio" name="psearchtype" value="AND">All words&nbsp;&nbsp;<input type="radio" name="psearchtype" value="OR">Any word</span></td></tr> </table> </form> <form method="post"> <table border="0" cellspacing="1" cellpadding="4" bgcolor="#CCCCCC"> <tr bgcolor="#594FBF"> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_CUSTKEY","UTF-8") %>" style="color: #FFFFFF;">C CUSTKEY&nbsp;<% if (OrderBy != null && OrderBy.equals("C_CUSTKEY")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_NAME","UTF-8") %>" style="color: #FFFFFF;">C NAME&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_NAME")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_ADDRESS","UTF-8") %>" style="color: #FFFFFF;">C ADDRESS&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_ADDRESS")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_NATIONKEY","UTF-8") %>" style="color: #FFFFFF;">C NATIONKEY&nbsp;<% if (OrderBy != null && OrderBy.equals("C_NATIONKEY")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_PHONE","UTF-8") %>" style="color: #FFFFFF;">C PHONE&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_PHONE")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_ACCTBAL","UTF-8") %>" style="color: #FFFFFF;">C ACCTBAL&nbsp;<% if (OrderBy != null && OrderBy.equals("C_ACCTBAL")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_MATSEGMENT","UTF-8") %>" style="color: #FFFFFF;">C MATSEGMENT&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_MATSEGMENT")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_COMMENT","UTF-8") %>" style="color: #FFFFFF;">C COMMENT&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_COMMENT")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <% // Avoid starting record > total records if (startRec > totalRecs) { startRec = totalRecs; } // Set the last record to display stopRec = startRec + displayRecs - 1; // Move to first record directly for performance reason recCount = startRec - 1; if (rs.next()) { rs.first(); rs.relative(startRec - 1); } long recActual = 0; if (startRec == 1) rs.beforeFirst(); else rs.previous(); while (rs.next() && recCount < stopRec) { recCount++; if (recCount >= startRec) { recActual++; %> <% String bgcolor = "#FFFFFF"; // Set row color %> <% if (recCount%2 != 0) { // Display alternate color for rows bgcolor = "#F5F5F5"; } %> <% String x_C_CUSTKEY = ""; String x_C_NAME = ""; String x_C_ADDRESS = ""; String x_C_NATIONKEY = ""; String x_C_PHONE = ""; String x_C_ACCTBAL = ""; String x_C_MATSEGMENT = ""; String x_C_COMMENT = ""; // Load Key for record String key = ""; key = String.valueOf(rs.getLong("C_CUSTKEY")); // C_CUSTKEY x_C_CUSTKEY = String.valueOf(rs.getLong("C_CUSTKEY")); // C_NAME if (rs.getString("C_NAME") != null){ x_C_NAME = rs.getString("C_NAME"); }else{ x_C_NAME = ""; } // C_ADDRESS if (rs.getString("C_ADDRESS") != null){ x_C_ADDRESS = rs.getString("C_ADDRESS"); }else{ x_C_ADDRESS = ""; } // C_NATIONKEY x_C_NATIONKEY = String.valueOf(rs.getLong("C_NATIONKEY")); // C_PHONE if (rs.getString("C_PHONE") != null){ x_C_PHONE = rs.getString("C_PHONE"); }else{ x_C_PHONE = ""; } // C_ACCTBAL x_C_ACCTBAL = String.valueOf(rs.getDouble("C_ACCTBAL")); // C_MATSEGMENT if (rs.getString("C_MATSEGMENT") != null){ x_C_MATSEGMENT = rs.getString("C_MATSEGMENT"); }else{ x_C_MATSEGMENT = ""; } // C_COMMENT if (rs.getString("C_COMMENT") != null){ x_C_COMMENT = rs.getString("C_COMMENT"); }else{ x_C_COMMENT = ""; } %> <tr bgcolor="<%= bgcolor %>"> <td><span class="jspmaker"><% out.print(x_C_CUSTKEY); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_NAME); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_ADDRESS); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_NATIONKEY); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_PHONE); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_ACCTBAL); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_MATSEGMENT); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_COMMENT); %></span>&nbsp;</td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customerview.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">View</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customeredit.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Edit</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customeradd.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Copy</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customerdelete.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Delete</a></span></td> </tr> <% // } } } %> </table> </form> <% // Close recordset and connection rs.close(); rs = null; stmt.close(); stmt = null; conn.close(); conn = null; }catch(SQLException ex){ out.println(ex.toString()); } %> <table border="0" cellspacing="0" cellpadding="10"><tr><td> <% boolean rsEof = false; if (totalRecs > 0) { rsEof = (totalRecs < (startRec + displayRecs)); int PrevStart = startRec - displayRecs; if (PrevStart < 1) { PrevStart = 1;} int NextStart = startRec + displayRecs; if (NextStart > totalRecs) { NextStart = startRec;} int LastStart = ((totalRecs-1)/displayRecs)*displayRecs+1; %> <form> <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="jspmaker">Page</span>&nbsp;</td> <!--first page button--> <% if (startRec==1) { %> <td><img src="images/firstdisab.gif" alt="First" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=1"><img src="images/first.gif" alt="First" width="20" height="15" border="0"></a></td> <% } %> <!--previous page button--> <% if (PrevStart == startRec) { %> <td><img src="images/prevdisab.gif" alt="Previous" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=PrevStart%>"><img src="images/prev.gif" alt="Previous" width="20" height="15" border="0"></a></td> <% } %> <!--current page number--> <td><input type="text" name="pageno" value="<%=(startRec-1)/displayRecs+1%>" size="4"></td> <!--next page button--> <% if (NextStart == startRec) { %> <td><img src="images/nextdisab.gif" alt="Next" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=NextStart%>"><img src="images/next.gif" alt="Next" width="20" height="15" border="0"></a></td> <% } %> <!--last page button--> <% if (LastStart == startRec) { %> <td><img src="images/lastdisab.gif" alt="Last" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=LastStart%>"><img src="images/last.gif" alt="Last" width="20" height="15" border="0"></a></td> <% } %> <td><a href="customeradd.jsp"><img src="images/addnew.gif" alt="Add new" width="20" height="15" border="0"></a></td> <td><span class="jspmaker">&nbsp;of <%=(totalRecs-1)/displayRecs+1%></span></td> </td></tr></table> </form> <% if (startRec > totalRecs) { startRec = totalRecs;} stopRec = startRec + displayRecs - 1; recCount = totalRecs - 1; if (rsEof) { recCount = totalRecs;} if (stopRec > recCount) { stopRec = recCount;} %> <span class="jspmaker">Records <%= startRec %> to <%= stopRec %> of <%= totalRecs %></span> <% }else{ %> <span class="jspmaker">No records found</span> <p> <a href="customeradd.jsp"><img src="images/addnew.gif" alt="Add new" width="20" height="15" border="0"></a> </p> <% } %> </td></tr></table> <%@ include file="footer.jsp" %>
vb.net 提示“应有{”,小白求教。
该代码(部分)是用来识别DMO文件的内容并重新排列有效的数据并导出的小程序,在粗体字部分报错,提示“应有{”。 Private Sub ProcessDmo(dmo As String, dmoName As String) Dim dmoProcessor As DmoProcessor = New DmoProcessor(dmo) Dim value As String = "Measurand;MeasurementPlan;MeasurementTime;ProdNo;X;Y;Z;N" Dim stringBuilder As StringBuilder = New StringBuilder() stringBuilder.AppendLine(value) Dim dateTime As String = dmoProcessor.GetDateTime() Me.WriteDebug(String.Format("DMO DateTime: {0}", dateTime)) Dim prodNumber As String = dmoProcessor.GetProdNumber() Me.WriteDebug(String.Format("DMO Production number: {0}", prodNumber)) Dim array As String() = Regex.Split(dmo, "OUTPUT/FA") Dim num As Integer = 1 Dim array2 As String() = array For i As Integer = 0 To array2.Length - 1 Dim input As String = array2(i) Dim value2 As String = Regex.Match(input, "FA\((\w+)\)", RegexOptions.IgnoreCase).Groups(1).Value Dim value3 As String = Regex.Match(input, "TA.+PROFP,([\-\.\d]+),", RegexOptions.IgnoreCase).Groups(1).Value Dim value4 As String = Regex.Match(input, "TA.+XAXIS,([\-\.\d]+),", RegexOptions.IgnoreCase).Groups(1).Value Dim value5 As String = Regex.Match(input, "TA.+YAXIS,([\-\.\d]+),", RegexOptions.IgnoreCase).Groups(1).Value Dim value6 As String = Regex.Match(input, "TA.+ZAXIS,([\-\.\d]+),", RegexOptions.IgnoreCase).Groups(1).Value Dim flag As Boolean = value2 <> String.Empty If flag Then ** stringBuilder.AppendLine(String.Format("{0};MeasurementPlan;{1};{2};{3};{4};{5};{6}", New Object()() = {value2,dateTime, prodNumber, value4, value5, value6, value3})) ** num += 1 End If Next Me.WriteDebug(String.Format("During processing {0} found {1} point(s)", dmoName, num)) Me.WriteDebug("Finished.") Dim text As String = Path.Combine(Application.StartupPath, String.Format("{0}.csv", Path.GetFileName(dmoName))) Me.WriteData(stringBuilder.ToString(), text) Clipboard.SetText(text) Dim checked As Boolean = Me.uxChkOpenCsv.Checked If checked Then Process.Start(text) End If End Sub
bootstrap table怎么想java传参数
这是js ``` function load1() { var state=parent.$("input[name='state']:checked").val(); alert(state) $('#exampleTable') .bootstrapTable( { method : 'get', // 服务器数据的请求方式 get or post url : prefix + "/list", // 服务器数据的加载地址 queryParams:function(params){//向后台传值 return{ offset:params.offset, limit:params.limit, state:parent.$("input[name='state']:checked").val() } }, // showRefresh : true, // showToggle : true, // showColumns : true, iconSize : 'outline', toolbar : '#exampleToolbar', striped : true, // 设置为true会有隔行变色效果 dataType : "json", // 服务器返回的数据类型 pagination : true, // 设置为true会在底部显示分页条 // queryParamsType : "limit", // //设置为limit则会发送符合RESTFull格式的参数 singleSelect : false, // 设置为true将禁止多选 // contentType : "application/x-www-form-urlencoded", // //发送到服务器的数据编码类型 pageSize : 10, // 如果设置了分页,每页数据条数 pageNumber : 1, // 如果设置了分布,首页页码 //search : true, // 是否显示搜索框 showColumns : false, // 是否显示内容下拉框(选择显示的列) sidePagination : "server", // 设置在哪里进行分页,可选值为"client" 或者 "server" queryParams : function(params) { return { //说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对 limit: params.limit, offset:params.offset, name:$('#searchName').val() // username:$('#searchName').val() }; }, // //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果 // queryParamsType = 'limit' ,返回参数必须包含 // limit, offset, search, sort, order 否则, 需要包含: // pageSize, pageNumber, searchText, sortName, // sortOrder. // 返回false将会终止请求 } ``` 这是java ``` @ResponseBody @RequestMapping("/list") public PageUtils list(@RequestParam Map<String, Object> params,String state){ System.out.println(state); //查询列表数据 Query query = new Query(params); List<WagesDO> wagesList = wagesService.list(query); int total = wagesService.count(query); PageUtils pageUtils = new PageUtils(wagesList, total); return pageUtils; } ``` 这样写在java接受到的是state为null,这是为什么y
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
漫话:什么是平衡(AVL)树?这应该是把AVL树讲的最好的文章了
这篇文章通过对话的形式,由浅入深带你读懂 AVL 树,看完让你保证理解 AVL 树的各种操作,如果觉得不错,别吝啬你的赞哦。 1、若它的左子树不为空,则左子树上所有的节点值都小于它的根节点值。 2、若它的右子树不为空,则右子树上所有的节点值均大于它的根节点值。 3、它的左右子树也分别可以充当为二叉查找树。 例如: 例如,我现在想要查找数值为14的节点。由于二叉查找树的特性,我们可...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
开源并不是你认为的那些事
点击上方蓝字 关注我们开源之道导读所以 ————想要理清开源是什么?先要厘清开源不是什么,名正言顺是句中国的古代成语,概念本身的理解非常之重要。大部分生物多样性的起源,...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
《C++ Primer》学习笔记(六):C++模块设计——函数
专栏C++学习笔记 《C++ Primer》学习笔记/习题答案 总目录 https://blog.csdn.net/TeFuirnever/article/details/100700212 —————————————————————————————————————————————————————— 《C++ Primer》习题参考答案:第6章 - C++模块设计——函数 文章目录专栏C+...
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法不过,当我看了源代码之后这程序不到50
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
相关热词 c# 输入ip c# 乱码 报表 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件
立即提问