ESP8266复位后打印ets Jan 8 2013,rst cause:2, boot mode:(1,6)

#( 一)开发环境
* 操作系统:Windows10;
* 集成环境:AiThinkerIDE 0.5(Eclipse + cygin);
* 下载工具:ESP8266 DOWNLOAD TOOL V3.6.5;
* 开 发 板 :NodeMCU Devkit

(二)问题描述

    通过下载工具下载固件到ESP8266上之后打开PC端的串口工具,然后按下开发板上的复位键,紧接着串口就打印出来“ets Jan  8 2013,rst cause:2, boot mode:(1,6)”。

    如果先按下开发板上的复位键,然后再打开串口,则固件可以正常运行。但是接收不到ESP8266复位后启动时打印出来的信息,我需要ESP8266启动时的打印信息。

#(三) 参考资料

3.1 NodeMCU部分原理图

图片说明

3.2 ESP8266 DOWNLOAD TOOL配置

图片说明

3.3 ESP8266启动信息说明

图片说明

3.4 参考过的帖子

3.4.1 参考过“阏男秀-【NodeMCU】关于NodeMCU烧写的坑(load 0x33333333, len 858993459, room 0)”提到的方法,也是通过百度搜索到的唯一一片相关的帖子。按照ta提供的方法进行了测试,但是依然没用。

3.4.2 http://stackoverflow.com/questions/35237458/upgrading-nodemcu-devkit-from-0-9-6-to-1-5,这是上文中参考过的帖子,来自StackOverflow,提供的解决方法和上文如出一辙。

1个回答

ets Jan 8 2013,rst cause:2, boot mode:(1,6)”。的意思就是:外部复位或苏醒
uart boot

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
esp8266 wifi 连接问题
版本号: OK AT+GMR AT version:0.40.0.0(Aug 8 2015 14:45:58) SDK version:1.3.0 Ai-Thinker Technology Co.,Ltd. Build:1.3.0.2 Sep 11 2015 11:48:04 连线方法:电源与通讯口正常连接,另外CH_PD脚接到3.3V上面。 按照教程执行: AT+CWMODE=3 OK AT+RST OK ets Jan 8 2013,rst cause:4, boot mode3,6) wdt reset load 0x40100000, len 1396, room 16 tail 4 chksum 0x89 load 0x3ffe8000, len 776, room 4 tail 4 chksum 0xe8 load 0x3ffe8308, len 540, room 4 tail 8 chksum 0xc0 csum 0xc0 2nd boot version : 1.4(b1) SPI Speed : 40MHz SPI Mode : DIO SPI Flash Size & Map: 8Mbit(512KB+512KB) jump to run user1 @ 1000 sd巸r$? Ai-Thinker Technology Co.,Ltd. ready WIFI DISCONNECT AT+CWJAP="Xiaomi_44A9_5G","yuantu123" +CWJAP:1 FAIL 注:连接失败!!!!!! 注:发送AT+CWLAP返回: AT+CWLAP +CWLAP4,"enjoyorB#7F-1",-89,"bc:d1:77:40:97:7c",1,-7) +CWLAP3,"WTF",-85,"f0:b4:29:35:ae:d2",1,-14) +CWLAP3,"YK_WIFI",-91,"70:3a:d8:07:a3:6e",3,-14) +CWLAP3,"vYou_DDPai_M6",-90,"20:f4:1b:41:7e:01",4,0) +CWLAP4,"TP-LINK_45AD36",-87,"08:57:00:45:ad:36",6,-14) +CWLAP4,"TP-LINK_6EEDA4",-90,"14:75:90:6e:ed:a4",6,-17) +CWLAP4,"TP-LINK_038C",-85,"fc:d7:33:9e:03:8c",6,5) +CWLAP4,"MERCURY_D5BB28",-87,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP4,"YT-ZhanTing",-73,"f0:eb:d0:9f:ca:88",8,-46) +CWLAP:(3,"mianfei",-86,"ac:d1:b8:8f:d6:a5",10,-27) +CWLAP:(4,"YT-boss",-89,"c0:61:18:e8:e5:7c",11,0) +CWLAP:(4,"UBLISH_WIFI",-73,"ec:26:ca:4a:20:32",11,-11) +CWLAP:(4,"summer-X",-95,"00:36:76:4c:85:1d",11,-34) +CWLAP:(3,"360鍏嶈垂WiFi-JY",-88,"3e:3e:84:53:88:9a",11,-29) OK 电脑上显示的wifi信号如图: ![图片说明](https://img-ask.csdn.net/upload/201603/07/1457331517_425227.png) 想连接xiaomi44a95g的信号,不知道为什么一直搜不到 为什么搜不到xiaomi44a95g的wifi信号问题,另外为什么每次返回的wifi信号都不一致,求高手指教 AT+CWLAP busy p... +CWLAP:(4,"TP-LINK_YiLiaoYJ",-89,"28:2c:b2:aa:b4:9c",1,-2) +CWLAP:(3,"WTF",-84,"f0:b4:29:35:ae:d2",1,-14) +CWLAP:(4,"YJH",-91,"6c:59:40:d1:13:18",2,-17) +CWLAP:(4,"TP-LINK_038C",-86,"fc:d7:33:9e:03:8c",6,5) +CWLAP:(4,"MERCURY_D5BB28",-87,"c8:e7:d8:d5:bb:28",6,-21) +CWLAP:(4,"tp_link007",-85,"50:bd:5f:04:44:38",6,-9) +CWLAP:(3,"okok",-88,"ec:55:f9:55:52:8a",6,-27) OK AT+CWLAP +CWLAP:(4,"TP-LINK_YiLiaoYJ",-92,"28:2c:b2:aa:b4:9c",1,-2) +CWLAP:(4,"enjoyorB#7F-1",-93,"bc:d1:77:40:97:7c",1,-7) +CWLAP:(4,"babaili",-94,"00:36:76:57:81:9c",1,-21) +CWLAP:(4,"YJH",-89,"6c:59:40:d1:13:18",2,-17) +CWLAP:(0,"TP-LINK",-95,"00:19:e0:ac:bb:81",6,-37) +CWLAP:(3,"okok",-88,"ec:55:f9:55:52:8a",6,-27) +CWLAP:(4,"tp_link007",-84,"50:bd:5f:04:44:38",6,-9) +CWLAP:(4,"MERCURY_D5BB28",-90,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP:(4,"YT-ZhanTing",-71,"f0:eb:d0:9f:ca:88",8,-46) +CWLAP:(3,"mianfei",-85,"ac:d1:b8:8f:d6:a5",10,-26) +CWLAP:(3,"360鍏嶈垂WiFi-JY",-87,"3e:3e:84:53:88:9a",11,-29) +CWLAP:(4,"YT-boss",-87,"c0:61:18:e8:e5:7c",11,0) +CWLAP:(4,"UBLISH_WIFI",-75,"ec:26:ca:4a:20:32",11,-11) OK AT+CWLAP +CWLAP:(4,"babaili",-91,"00:36:76:57:81:9c",1,-21) +CWLAP:(4,"TP-LINK_YiLiaoYJ",-89,"28:2c:b2:aa:b4:9c",1,0) +CWLAP:(3,"enjoyorB#4F-1",-90,"50:bd:5f:ea:96:f7",1,-22) +CWLAP:(3,"WTF",-84,"f0:b4:29:35:ae:d2",1,-14) +CWLAP:(4,"enjoyorB#7F-1",-88,"bc:d1:77:40:97:7c",1,-9) +CWLAP:(4,"YJH",-89,"6c:59:40:d1:13:18",2,-17) +CWLAP:(3,"YK_WIFI",-92,"70:3a:d8:07:a3:6e",3,-14) +CWLAP:(4,"TP-LINK_038C",-88,"fc:d7:33:9e:03:8c",6,5) +CWLAP:(4,"tp_link007",-82,"50:bd:5f:04:44:38",6,-9) +CWLAP:(4,"YT-HuiYiShi",-86,"d8:15:0d:db:75:a2",6,-7) +CWLAP:(4,"YT-ZhanTing",-71,"f0:eb:d0:9f:ca:88",8,-46) +CWLAP:(4,"E24568",-88,"a4:56:02:e2:45:68",11,-11) +CWLAP:(4,"YT-boss",-85,"c0:61:18:e8:e5:7c",11,0) +CWLAP:(4,"UBLISH_WIFI",-76,"ec:26:ca:4a:20:32",11,-11) +CWLAP:(2,"IIIIIIIIII",-90,"00:18:4d:4c:bf:9a",11,-21) OK AT+CWLAP +CWLAP:(4,"TP-LINK_YiLiaoYJ",-92,"28:2c:b2:aa:b4:9c",1,-2) +CWLAP:(3,"enjoyorB#4F-1",-90,"50:bd:5f:ea:96:f7",1,-22) +CWLAP:(3,"WTF",-83,"f0:b4:29:35:ae:d2",1,-14) +CWLAP:(4,"YJH",-89,"6c:59:40:d1:13:18",2,-17) +CWLAP:(3,"YK_WIFI",-92,"70:3a:d8:07:a3:6e",3,-14) +CWLAP:(3,"okok",-90,"ec:55:f9:55:52:8a",6,-27) +CWLAP:(4,"TP-LINK_45AD36",-85,"08:57:00:45:ad:36",6,-14) +CWLAP:(4,"MERCURY_D5BB28",-88,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP:(4,"YT-ZhanTing",-70,"f0:eb:d0:9f:ca:88",8,-44) +CWLAP:(4,"UBLISH_WIFI",-75,"ec:26:ca:4a:20:32",11,-11) +CWLAP:(2,"IIIIIIIIII",-88,"00:18:4d:4c:bf:9a",11,-21) +CWLAP:(4,"YT-boss",-87,"c0:61:18:e8:e5:7c",11,-2) OK AT+CWLAP +CWLAP:(4,"TP-LINK_YiLiaoYJ",-92,"28:2c:b2:aa:b4:9c",1,0) +CWLAP:(3,"enjoyorB#4F-1",-90,"50:bd:5f:ea:96:f7",1,-22) +CWLAP:(3,"WTF",-84,"f0:b4:29:35:ae:d2",1,-14) +CWLAP:(3,"wuliang",-93,"8c:be:be:12:0f:5d",1,-37) +CWLAP:(4,"WIFI-hello",-96,"00:87:36:3f:0e:55",1,-34) +CWLAP:(4,"YJH",-91,"6c:59:40:d1:13:18",2,-17) +CWLAP:(3,"YK_WIFI",-95,"70:3a:d8:07:a3:6e",3,-14) +CWLAP:(4,"enjoyorB#7F-3",-92,"6c:e8:73:fd:0e:5f",4,-16) +CWLAP:(3,"vYou_DDPai_M6",-93,"20:f4:1b:41:7e:01",4,0) +CWLAP:(4,"tp_link007",-86,"50:bd:5f:04:44:38",6,-9) +CWLAP:(4,"MERCURY_D5BB28",-85,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP:(4,"TP-LINK_45AD36",-88,"08:57:00:45:ad:36",6,-12) +CWLAP:(3,"okok",-89,"ec:55:f9:55:52:8a",6,-27) +CWLAP:(4,"BioSan",-92,"cc:5d:4e:ed:84:38",6,-31) +CWLAP:(4,"YT-ZhanTing",-73,"f0:eb:d0:9f:ca:88",8,-44) +CWLAP:(4,"YT-boss",-87,"c0:61:18:e8:e5:7c",11,-2) +CWLAP:(4,"360WiFi-D763",-88,"00:36:76:2e:d7:63",11,-24) +CWLAP:(3,"360鍏嶈垂WiFi-JY",-89,"3e:3e:84:53:88:9a",11,-29) OK AT+CWLAP +CWLAP:(4,"TP-LINK_YiLiaoYJ",-92,"28:2c:b2:aa:b4:9c",1,-2) +CWLAP:(3,"enjoyorB#4F-1",-96,"50:bd:5f:ea:96:f7",1,-22) +CWLAP:(4,"YJH",-91,"6c:59:40:d1:13:18",2,-17) +CWLAP:(3,"YK_WIFI",-91,"70:3a:d8:07:a3:6e",3,-14) +CWLAP:(4,"wenhua",-82,"ec:26:ca:97:4e:aa",6,-12) +CWLAP:(4,"tp_link007",-78,"50:bd:5f:04:44:38",6,-9) +CWLAP:(4,"MERCURY_D5BB28",-83,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP:(4,"YT-HuiYiShi",-87,"d8:15:0d:db:75:a2",6,-6) +CWLAP:(4,"TP-LINK_038C",-83,"fc:d7:33:9e:03:8c",6,5) +CWLAP:(4,"E24568",-88,"a4:56:02:e2:45:68",11,-9) +CWLAP:(4,"UBLISH_WIFI",-74,"ec:26:ca:4a:20:32",11,-11) OK AT+CWLAP +CWLAP:(4,"enjoyorB#3F-zhang",-88,"cc:34:29:64:d0:c8",1,-16) +CWLAP:(4,"enjoyorB#7F-1",-91,"bc:d1:77:40:97:7c",1,-7) +CWLAP:(3,"WTF",-84,"f0:b4:29:35:ae:d2",1,-14) +CWLAP:(4,"YJH",-91,"6c:59:40:d1:13:18",2,-17) +CWLAP:(3,"YK_WIFI",-90,"70:3a:d8:07:a3:6e",3,-14) +CWLAP:(4,"jizhi2",-90,"88:25:93:21:a0:80",6,1) +CWLAP:(4,"MERCURY_D5BB28",-86,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP:(4,"TP-LINK_45AD36",-87,"08:57:00:45:ad:36",6,-12) +CWLAP:(4,"YT-HuiYiShi",-90,"d8:15:0d:db:75:a2",6,-6) +CWLAP:(4,"YT-ZhanTing",-72,"f0:eb:d0:9f:ca:88",8,-44) +CWLAP:(3,"mianfei",-87,"ac:d1:b8:8f:d6:a5",10,-26) +CWLAP:(4,"E24568",-89,"a4:56:02:e2:45:68",11,-9) +CWLAP:(2,"IIIIIIIIII",-93,"00:18:4d:4c:bf:9a",11,-21) OK AT+CWLAP +CWLAP:(3,"WTF",-84,"f0:b4:29:35:ae:d2",1,-14) +CWLAP:(4,"babaili",-93,"00:36:76:57:81:9c",1,-19) +CWLAP:(4,"TP-LINK_YiLiaoYJ",-91,"28:2c:b2:aa:b4:9c",1,0) +CWLAP:(4,"YJH",-89,"6c:59:40:d1:13:18",2,-17) +CWLAP:(3,"YK_WIFI",-92,"70:3a:d8:07:a3:6e",3,-14) +CWLAP:(4,"wenhua",-87,"ec:26:ca:97:4e:aa",6,-14) +CWLAP:(4,"tp_link007",-81,"50:bd:5f:04:44:38",6,-9) +CWLAP:(4,"MERCURY_D5BB28",-84,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP:(3,"okok",-84,"ec:55:f9:55:52:8a",6,-27) +CWLAP:(4,"TP-LINK_zhukeqing",-87,"88:25:93:65:95:e1",6,-14) +CWLAP:(4,"YT-ZhanTing",-71,"f0:eb:d0:9f:ca:88",8,-44) +CWLAP:(4,"360WiFi-D763",-89,"00:36:76:2e:d7:63",11,-24) +CWLAP:(4,"YT-boss",-88,"c0:61:18:e8:e5:7c",11,0) +CWLAP:(4,"UBLISH_WIFI",-74,"ec:26:ca:4a:20:32",11,-11) +CWLAP:(4,"summer-X",-94,"00:36:76:4c:85:1d",11,-34) +CWLAP:(4,"yan nan",-89,"c4:a8:1d:5f:5f:fe",11,18) OK AT+CWLAP +CWLAP:(4,"enjoyorB#7F-1",-89,"bc:d1:77:40:97:7c",1,-7) +CWLAP:(3,"WTF",-85,"f0:b4:29:35:ae:d2",1,-14) +CWLAP:(3,"YK_WIFI",-91,"70:3a:d8:07:a3:6e",3,-14) +CWLAP:(3,"vYou_DDPai_M6",-90,"20:f4:1b:41:7e:01",4,0) +CWLAP:(4,"TP-LINK_45AD36",-87,"08:57:00:45:ad:36",6,-14) +CWLAP:(4,"TP-LINK_6EEDA4",-90,"14:75:90:6e:ed:a4",6,-17) +CWLAP:(4,"TP-LINK_038C",-85,"fc:d7:33:9e:03:8c",6,5) +CWLAP:(4,"MERCURY_D5BB28",-87,"c8:e7:d8:d5:bb:28",6,-19) +CWLAP:(4,"YT-ZhanTing",-73,"f0:eb:d0:9f:ca:88",8,-46) +CWLAP:(3,"mianfei",-86,"ac:d1:b8:8f:d6:a5",10,-27) +CWLAP:(4,"YT-boss",-89,"c0:61:18:e8:e5:7c",11,0) +CWLAP:(4,"UBLISH_WIFI",-73,"ec:26:ca:4a:20:32",11,-11) +CWLAP:(4,"summer-X",-95,"00:36:76:4c:85:1d",11,-34) +CWLAP:(3,"360鍏嶈垂WiFi-JY",-88,"3e:3e:84:53:88:9a",11,-29)
base64 +异或加密问题,,如何解密??在线等
eNqlm92P7Fpa3v+VuYi054gJ8ke755TQkdK1q2y3q7y6yx9r2Q5c2Gt5tqu8XOWucrddFleJSGAQEMQEJkS5CAQlICAkFyggBASI+BoCE8j8PXne2owyHJgkKBdb5/TpbXt5rfd9nt+zls8HfapK/YV/8Es//Yf/+od+9Gd/4hd/5fu+49//8bvf+u1f/dZXf/mf/OIP//m7H/jsL7/+l7/wo7/xhz//Zz/5xXf+e/Ph3ZfevTy+fs+5KN+/++RvXvfLP/bD//k3f+LX/uKnfvZz173nD19+TB7Om+TnT6M4fHjxfvfa7p+a8TPc7bQQq9N2yz5/tz/++p/83n/7uW/8/n/8w8/d7cHYPYTdpz+uVnMe+eNndJPLfZ0a/XF5ph8/d6Nv/fY3v/Hnf/JX3/zaz33uRl600w8fdidcfyi9l76wn759/f/+a59911f84vuH9Xt35S6XK3f13v3k+/7RF77rc7/4HXf80j+0rU8+++y7TvkX/w93+X+6v3F7wve+k6VdS8eyzE/vv/LlO3VnWQ7+parUVwxHyfuvvPvS4pNPfvAH1b7+4uem7H986xe++UP/4t98/at/8rkpeyu/Z/1fjbeXh+ZrYWlaHyf/+GUxvize11MQh+aHv70AP/W7//13/ur3v/aT//yP3v3AF/7mO/zpb/7YX/3GT/zMf/n6j737gS/9jd/8s//0a//yq7/0H/7dn/0FLvrCF7733Rfffe93HePf/u2PfOuf/uz//Oo3/vRPv4bL8evvfxceXCHXCz89FG1kFjbvpm05B35hq/3OmmL812Odmiup9Zs09CyO+i4XkSuSKI/WvRkmuld+sVG8n+OOB9KOXvgqYOwQ3Me2fqpSM9zNw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wRnT9lZJwbK9/2CrT6SU+9s/VSjW1vwMh0UcA+gLTzkAiE6dD5HRxVyUf3sg3iOxAC83tKzKLPmuGb7RslN36DKLeJ+uBDtZQusFKdoaZGIrObegrHETZqFAZ7VOjcKz1nPh0sNk4僰BK/bNtrbnMG4iXCSWveW4ntHuiz6FgU4e0rtW7acjOCzyHdWIs+6pwNCvEeUfVVdexbMDIX+qxmrO4Vur4i/eZAzFwgQkNjEW1O8Ji3GrERlbfntG8A96ja昦QsTLRi8TXTpSIcsodBbbhTAXPONTtHQc+HtkGguIjoFq1wFQjEBGNCYVA+1aMoiQdzgipddsAJeNZtbV0BzLTqBHq672ydJ/FDORUb7crjunGs2wwP70A82dasN/PwMDengfdcK/lbNhVUeH+zEcvZYnCv7FB3d9S3u9a965Dvkzr6LPRODca5xp/HwfiIBK/jtu6l7GNSavoeFwO7jTMfIhX?ik2H1Z1ncnbmvN7kwwcGa8g4yWxAwTd++um21KprYcn5rFOuettPfSn85PZXshaVsC6fP44PL8hRLKBb2Pvtgi/UCqtodQ748KN4bcRL8ZKTSt0f62grN60FO?zrrr7FZGJgKJOoCcs8ySjpC/xG7U9Wndp7+uJopR5TWkNT+r/RgSfq4塕w9lev1KZC2uv8fXg6BlMjsOm2oe怸VerUND/XtCCdwLk蒅/DY7rPPvv/dJ5988絬5L7/74V3793/7B/+?/7PnpX/6Zd59?3/8CS蜽vZDw==
修改两台ubuntu14.04的/ets/hosts,为什么不能ping通?
局域网内两台Ubuntu,修改了各自的hosts ![](http://ww3.sinaimg.cn/bmiddle/afc73d0djw1eut70x01m6j21kw16oapl.jpg) 这样两台master 和 slave2 相互可以ping通,但是 改成: ``` 192.168.1.100 master 192.168.1.101 slave2 ``` 就没法相互ping通了,求教
在看韩顺平的java基础视频,坦克大战中在保存记录的时候出现空指针的错误(运行时)现在编不下去了
package test6; import java.io.*; import java.util.*; class Recorder { private static int enNum=20; private static int myLife=3; private static int allShot=0; static FileWriter fw=null; static BufferedWriter bw=null; static FileReader fr=null; static BufferedReader br=null; private static Vector<Enemy> ets=new Vector<Enemy>(); //保存敌人的坐标,方向 数量 public static void keepRecAndEnemy() { try { fw=new FileWriter("d:\\javatank.txt"); bw=new BufferedWriter(fw); bw.write(allShot+"\r\n"); for(int i=0;i<ets.size();i++) { Enemy et=ets.get(i); if(et.isLive) { String record=et.x+" "+et.y+" "+et.direct; bw.write(record+"\r\n"); } } } catch (IOException e) { e.printStackTrace(); }finally{ try { bw.close(); fw.close(); } catch (Exception e) { e.printStackTrace(); } } } //从文件中读取记录 public static void getRecording() { try { fr=new FileReader("d:\\javatank.txt"); br=new BufferedReader(fr); String n=br.readLine(); allShot=Integer.parseInt(n); } catch (Exception e) { // TODO 自动生成的 catch 块 e.printStackTrace(); }finally{ try { br.close(); fr.close(); } catch (Exception e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } } } //玩家击毁敌人坦克数量保存到文件中 public static void keepRecording() { try { fw=new FileWriter("d:\\javatank.txt"); bw=new BufferedWriter(fw); bw.write(allShot+"\r\n"); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); }finally{ try { bw.close(); fw.close(); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } } } public static int getEnNum() { return enNum; } public static void setEnNum(int enNum) { Recorder.enNum = enNum; } public static int getMyLife() { return myLife; } public static void setMyLife(int myLife) { Recorder.myLife = myLife; } public static void reduceEnemy() { enNum--; } public static int getAllShot() { return allShot; } public static void setAllShot(int allShot) { Recorder.allShot = allShot; } public static void addallShot() { allShot++; } public static Vector<Enemy> getEts() { return ets; } public static void setEts(Vector<Enemy> ets1) { System.out.print("whita "); ets = ets1; } } //炸弹类 class Bomb { int x,y; int life=6; boolean isLive=true; public Bomb(int x,int y) { this.x=x; this.y=y; } public void lifeDown() { if(life>0) { life--; }else { this.isLive=false; } } } //定义坦克的类 class Tank { int x=0; int y=0; int direct=0; int color; int speed=1; boolean isLive=true; public int getColor() { return color; } public void setColor(int color) { this.color = color; } public int getDirect() { return direct; } public void setDirect(int direct) { this.direct = direct; } public void moveUp() { y=y-speed; } public void moveRight() { x=x+speed; } public void moveDown() { y=y+speed; } public void moveLeft() { x=x-speed; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public Tank(int x,int y){ this.x=x; this.y=y; } } //定义我的坦克,继承坦克类 class Mytank extends Tank { Vector<Shot> ss=new Vector<Shot>(); Shot s=null; public Mytank(int x,int y) { super(x, y); this.x=x; this.y=y; } public void shotEnemy() { switch(this.direct) { case 0: s=new Shot(x+10,y,0); ss.add(s); break; case 1: s=new Shot(x+30,y+10,1); ss.add(s); break; case 2: s=new Shot(x+10,y+30,2); ss.add(s); break; case 3: s=new Shot(x,y+10,3); ss.add(s); break; } Thread t=new Thread(s); t.start(); } } //敌人的坦克 class Enemy extends Tank implements Runnable { int times=0; Vector<Shot> ss=new Vector<Shot>(); //判断是否重叠 Vector<Enemy> ets=new Vector<Enemy>(); public void setEts(Vector<Enemy> ets) { this.ets=ets; } //判断重叠的函数 public boolean isTouchOther() { switch(this.direct) { case 0://我的(敌人)坦克方向 for(int i=0;i<ets.size();i++) { Enemy et=ets.get(i); if(this!=et) { if(et.direct==0||et.direct==2)//敌人的坦克的方向 { if(this.x>et.x&&this.x<et.x+20&&this.y>et.y&&this.y<et.y+30) { return true; } if(this.x+20>et.x&&this.x+20<et.x+20&&this.y>et.y&&this.y<et.y+30) { return true; } } if(et.direct==1||et.direct==3) { if(this.x>et.x&&this.x<et.x+30&&this.y>et.y&&this.y<et.y+20) { return true; } if(this.x+20>et.x&&this.x+20<et.x+30&&this.y>et.y&&this.y<et.y+20) { return true; } } } } break; case 1: for(int i=0;i<ets.size();i++) { Enemy et=ets.get(i); if(this!=et) { if(et.direct==0||et.direct==2)//敌人的坦克的方向 { if(this.x+30>et.x&&this.x+30<et.x+20&&this.y>et.y&&this.y<et.y+30) { return true; } if(this.x+30>et.x&&this.x+30<et.x+20&&this.y+20>et.y&&this.y+20<et.y+30) { return true; } } if(et.direct==1||et.direct==3) { if(this.x+30>et.x&&this.x+30<et.x+20&&this.y>et.y&&this.y<et.y+20) { return true; } if(this.x+30>et.x&&this.x+30<et.x+30&&this.y+20>et.y&&this.y+20<et.y+20) { return true; } } } } break; case 2: for(int i=0;i<ets.size();i++) { Enemy et=ets.get(i); if(this!=et) { if(et.direct==0||et.direct==2)//敌人的坦克的方向 { if(this.x>et.x&&this.x<et.x+20&&this.y+30>et.y&&this.y+30<et.y+30) { return true; } if(this.x+20>et.x&&this.x+20<et.x+20&&this.y+30>et.y&&this.y+30<et.y+30) { return true; } } if(et.direct==1||et.direct==3) { if(this.x>et.x&&this.x<et.x+30&&this.y+30>et.y&&this.y+30<et.y+20) { return true; } if(this.x+20>et.x&&this.x+20<et.x+30&&this.y+30>et.y&&this.y+30<et.y+20) { return true; } } } } break; case 3: for(int i=0;i<ets.size();i++) { Enemy et=ets.get(i); if(this!=et) { if(et.direct==0||et.direct==2)//敌人的坦克的方向 { if(this.x>et.x&&this.x<et.x+20&&this.y>et.y&&this.y<et.y+30) { return true; } if(this.x>et.x&&this.x<et.x+20&&this.y+20>et.y&&this.y+20<et.y+30) { return true; } } if(et.direct==1||et.direct==3) { if(this.x>et.x&&this.x<et.x+20&&this.y>et.y&&this.y<et.y+20) { return true; } if(this.x>et.x&&this.x<et.x+30&&this.y+20>et.y&&this.y+20<et.y+20) { return true; } } } } break; } return false; } public Enemy(int x,int y) { super(x,y); this.x=x; this.y=y; } public void run() { while (true) { switch(direct) { case 0: for(int i=0;i<30;i++) { if(y>0&&!this.isTouchOther()) { y-=speed; } try{ Thread.sleep(50); }catch(Exception e) { e.printStackTrace(); } } break; case 1: for(int i=0;i<30;i++) { if(x<400&&!this.isTouchOther()){ x+=speed; } try{ Thread.sleep(50); }catch(Exception e) { e.printStackTrace(); } } break; case 2: for(int i=0;i<30;i++) { if(y<300&&!this.isTouchOther()){ y+=speed; } try{ Thread.sleep(50); }catch(Exception e) { e.printStackTrace(); } } break; case 3: for(int i=0;i<30;i++) { if(x>0&&!this.isTouchOther()) { x-=speed; } try{ Thread.sleep(50); }catch(Exception e) { e.printStackTrace(); } } break; } this.direct=(int)(Math.random()*4); if(this.isLive==false) { break; } this.times++; if(times%2==0) { if(isLive) { //判断是否需要加入子弹 if(ss.size()<5) { Shot s=null; //没有子弹,,添加子弹 switch(direct) { case 0: s=new Shot(x+10,y,0); ss.add(s); break; case 1: s=new Shot(x+30,y+10,1); ss.add(s); break; case 2: s=new Shot(x+10,y+30,2); ss.add(s); break; case 3: s=new Shot(x,y+10,3); ss.add(s); break; } Thread t=new Thread(s); t.start(); } } } } } } //定义子弹类 class Shot implements Runnable { int x; int y; int direct; int speed=1; boolean isLive=true; public Shot(int x,int y,int direct) { this.x=x; this.y=y; this.direct=direct; } //子弹的 线程 public void run() { while(true) { try { Thread.sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } switch (direct) { case 0: y=y-speed; break; case 1: x=x+speed; break; case 2: y=y+speed; break; case 3: x=x-speed; break; } if(x<0||x>400||y<0||y>300) { this.isLive=false; break; } } } } 上面是全部代码了,运行的时候按exit的时候就会报错, Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException 里面是报这句有空指针的:Recorder.setEts(mp.ets);
java中panel实现线程接口以后,要调用repaint函数时,不进run函数
具体情况是 mypanel类实现了线程接口,在run函数中定义了sleep(100)后调用repaint函数,做一个小坦克游戏,在repaint之前要判断是否击中坦克,击中后要显示三张图片来体现爆炸效果,可是经过调试发现,每次第一次击中的时候,都是直接好多次repaint,没有休眠,后来发现根本就没有进mypanel的run()方法,好像有另一个其他线程再调用paint。这是怎么回事?感谢大家了 package com.TankGame; import java.awt.*; import java.util.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.*; public class MyTankGame1 extends JFrame{ public static void main(String[] args) { // TODO Auto-generated method stub MyTankGame1 tankgame = new MyTankGame1(); } //构造函数 public MyTankGame1(){ MyPanel mp = new MyPanel(); //启动mp线程 Thread t = new Thread(mp); t.start(); this.add(mp); this.addKeyListener(mp); this.setIconImage(new ImageIcon("TankImage/TANK.jpg").getImage()); this.setTitle("坦克大战"); this.setLocation(350, 100); this.setSize(500, 400); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } } //我的面板类 class MyPanel extends JPanel implements KeyListener,Runnable{ //定义一个玩家的坦克 MyTank mytank = null; Vector<EnemyTank> ets= new Vector<EnemyTank>(); //定义爆炸效果集合 Vector<Boom> boom = new Vector<Boom>(); int enSize = 8; //定义三张图片,三张图片组成一次爆炸 Image image1 = null; Image image2 = null; Image image3 = null; //构造函数 public MyPanel(){ mytank = new MyTank(100,250); mytank.setType(0); for(int i=0;i<enSize;i++){ EnemyTank et = new EnemyTank((i+1)*50,0); et.setType(1); et.setDirect(1); et.setType(1); ets.add(et); } //初始化图片 image1 = Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("/1.jpg")); image2 = Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("/2.jpg")); image3 = Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("/3.jpg")); } public void hittank(Bullet b,EnemyTank et){ //判断该坦克的方向 switch(et.direct){ //方向朝上或者下 case 0: case 1: if(b.x>et.x&&b.x<et.x+20&&b.y>et.y&&b.y<et.y+30){ //击中 //子弹死亡 坦克死亡 b.isAlive=false; et.isLive=false; //创建一个爆炸效果,放入boom Boom bom = new Boom(et.x,et.y); boom.add(bom); } case 2: case 3: if(b.x>et.x-5&&b.x<et.x+25&&b.y>et.y+5&&b.y<et.y+25){ //击中 b.isAlive=false; et.isLive=false; Boom bom = new Boom(et.x,et.y); boom.add(bom); } } } //方向:上下左右,对应0123 public void paint(Graphics g){ super.paint(g); System.out.println("xx"); g.fillRect(0, 0, 500, 500); this.drawTank(this.mytank.getX(), this.mytank.getY(), g, this.mytank.getDirect(), this.mytank.getType() ); //从ss中画出所有子弹 for(int i=0;i<this.mytank.ss.size();i++){ Bullet b = mytank.ss.get(i); if(b!=null&&b.isAlive==true){ g.drawRect(b.x, b.y, 1, 1); } if(b.isAlive==false){ //从ss中删掉该子弹 mytank.ss.remove(b); } } for(int i=0;i<ets.size();i++){ EnemyTank et = ets.get(i); if(et.isLive){ this.drawTank(et.getX(), et.getY(), g, et.getDirect(), et.getType()); } } //画出爆炸 System.out.println(boom.size()); for(int j=0;j<boom.size();j++){ Boom bom = boom.get(j); if(bom.life>6){ g.drawImage(image1, bom.x, bom.y, 30, 30, this); }else if(bom.life>3){ g.drawImage(image2, bom.x, bom.y, 30, 30, this); }else{ g.drawImage(image3, bom.x, bom.y, 30, 30, this); } //让爆炸进行 bom.lifeDown(); if(bom.life==0){ boom.remove(bom); } } } //画出坦克的函数 public void drawTank(int x,int y,Graphics g,int direct,int type){ switch(type){ case 0: g.setColor(Color.cyan); break; case 1: g.setColor(Color.yellow); break; } switch(direct){ case 0://向上走 g.fill3DRect(x, y, 5, 30, false); g.fill3DRect(x+15, y, 5, 30, false); g.fill3DRect(x+5, y+5, 10, 20,false); g.fillOval(x+5, y+10, 10, 10); g.drawLine(x+10, y+15, x+10, y); g.drawOval(x+5, y+10, 10, 10); break; case 3://向右走 g.fill3DRect(x-5, y+5, 30, 5, false); g.fill3DRect(x-5, y+20, 30, 5, false); g.fill3DRect(x, y+10, 20, 10, false); g.fillOval(x+5, y+10, 10, 10); g.drawLine(x+10, y+15, x+25, y+15); g.drawOval(x+5, y+10, 10, 10); break; case 1://向下走 g.fill3DRect(x, y, 5, 30, false); g.fill3DRect(x+15, y, 5, 30, false); g.fill3DRect(x+5, y+5, 10, 20,false); g.fillOval(x+5, y+10, 10, 10); g.drawLine(x+10, y+15, x+10, y+30); g.drawOval(x+5, y+10, 10, 10); break; case 2://向右走 g.fill3DRect(x-5, y+5, 30, 5, false); g.fill3DRect(x-5, y+20, 30, 5, false); g.fill3DRect(x, y+10, 20, 10, false); g.fillOval(x+5, y+10, 10, 10); g.drawLine(x+10, y+15, x-5, y+15); g.drawOval(x+5, y+10, 10, 10); break; } } @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { // TODO Auto-generated method stub if(e.getKeyCode()==KeyEvent.VK_UP){ this.mytank.setDirect(0); this.repaint(); this.mytank.moveUp(); } else if(e.getKeyCode()==KeyEvent.VK_DOWN){ this.mytank.setDirect(1); this.repaint(); this.mytank.moveDown(); } else if(e.getKeyCode()==KeyEvent.VK_LEFT){ this.mytank.setDirect(2); this.repaint(); this.mytank.moveLeft(); } else if(e.getKeyCode()==KeyEvent.VK_RIGHT){ this.mytank.setDirect(3); this.repaint(); this.mytank.moveRight(); } } @Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub if(e.getKeyCode()==KeyEvent.VK_SPACE){ if(this.mytank.ss.size()<=4){ this.mytank.fire(); } } } @Override public void run() { // TODO Auto-generated method stub //每隔100毫秒重绘 while(true){ System.out.println("sleep"); try { Thread.sleep(30); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } //判断是否击中 for(int i=0;i<mytank.ss.size();i++){ Bullet mb = mytank.ss.get(i); //判断子弹是否有效 if(mb.isAlive){ //取出每一个坦克,与子弹判断是否击中 for(int j=0;j<ets.size();j++){ //取出坦克 EnemyTank et = ets.get(j); if(et.isLive){ this.hittank(mb, et); } } } } this.repaint(); } } } //子弹类 class Bullet implements Runnable{ int x; int y; int direct; int speed=1; boolean isAlive = true; public Bullet(int x,int y,int direct){ this.x=x; this.y=y; this.direct = direct; } @Override public void run() { // TODO Auto-generated method stub while(true){ try { Thread.sleep(25); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } switch(direct){ case 0: y-=speed; break; case 1: y+=speed; break; case 2: x-=speed; break; case 3: x+=speed; break; } //子弹何时死亡? //判断子弹到达边界 if(x<-1||x>501||y<-1||y>501){ this.isAlive=false; break; } } } } //坦克类 class Tank{ //坦克的种类 int type; public int getType() { return type; } public void setType(int type) { this.type = type; } //坦克的速度 int speed = 1; public int getSpeed() { return speed; } public void setSpeed(int speed) { this.speed = speed; } public int getDirect() { return direct; } public void setDirect(int direct) { this.direct = direct; } int direct = 0; //坦克的横纵坐标 int x=0; public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } int y=0; public Tank(int x,int y){ this.x=x; this.y=y; } } class MyTank extends Tank{ Bullet mb = null; public MyTank(int x,int y){ super(x,y); } Vector<Bullet> ss = new Vector<Bullet>(); //开火能力 public void fire(){ switch(this.direct){ case 0: mb = new Bullet(this.getX()+10,this.getY(),0); ss.add(mb); break; case 1: mb = new Bullet(this.getX()+10,this.getY()+30,1); ss.add(mb); break; case 2: mb = new Bullet(this.getX()-5,this.getY()+15,2); ss.add(mb); break; case 3: mb = new Bullet(this.getX()+25,this.getY()+15,3); ss.add(mb); break; } Thread t = new Thread(mb); t.start(); } public void moveUp(){ y-=speed; } public void moveRight(){ x+=speed; } public void moveDown(){ y+=speed; } public void moveLeft(){ x-=speed; } } class EnemyTank extends Tank{ boolean isLive = true; public EnemyTank(int x,int y){ super(x, y); } } class Boom{ int x; int y; int life = 9;//爆炸的时间过程 boolean isLive = true; public Boom(int x, int y){ this.x=x; this.y=y; } //过程减少 public void lifeDown(){ if(life>0){ life--; }else{ this.isLive=false; } } } ``` ```
android反编译后回编译
6c9c27ae5dc3dc9, -0, assets/data/d/df90c044799e95e438a487d448aa1a3c, -0, assets/data/e/e1934a3725a7a 04e2fe7a97a3581fa0a, -0, assets/data/e/e627714657574de9bf73c53184c70377, -0, assets/data/e/e9cab0647 805e3011a54e7ee658dc77a, -0, assets/data/e/ea32ebf0f12015f10e74bd7c0539a9b6, -0, assets/data/e/ea804 13c2129d18238b2fc67aef19fb1, -0, assets/data/e/ec26588be2c10602b722fd7570acd7cc, -0, assets/data/e/e d501b7bb82fb4e32df4abb2de080e5e, -0, assets/data/e/edc41953e96b9202e2e4456340302c20, -0, assets/data /e/eef236551f0ea4b5272ffff0da3095ea, -0, assets/data/f/f279bd46cbb7834194426954552330b1, -0, assets/ data/f/f295f37fa298951fd85e66697e898ecf, -0, assets/data/f/f2f40b73055e5df3e4f2435cedca6c30, -0, ass ets/data/f/f6932f98ca9a112c62447519450c5a5d, -0, assets/data/f/f6bc5aaa2609f10a1b7a53916c3f2440, -0, assets/data/f/f82d34a19e76a4ca402c4640c5d824cf, -0, assets/data/f/f9e63c060b1c97d50d73cf89f77e6ad3, -0, assets/data/f/faa16e8fc8e17bcd92eea9d74c54e0d6, -0, assets/data/f/fac8df72375c39224193e0b3931aa 09b, -0, assets/data/f/fc0469e56838e240ef807c9d8431560c, -0, assets/data/f/fee03f9c8ec62275a2c32e3e2 d413e69, -0, arsc, -I, C:\Users\Administrator\apktool\framework\1.apk, -S, F:\Test\output\hhz\apk\re s, -M, F:\Test\output\hhz\apk\AndroidManifest.xml] at brut.androlib.Androlib.buildResourcesFull(Androlib.java:433) at brut.androlib.Androlib.buildResources(Androlib.java:371) at brut.androlib.Androlib.build(Androlib.java:281) at brut.androlib.Androlib.build(Androlib.java:254) at brut.apktool.Main.cmdBuild(Main.java:224) at brut.apktool.Main.main(Main.java:84) Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1 ): [C:\Users\ADMINI~1\AppData\Local\Temp\brut_util_Jar_672872575880592203.tmp, p, --forced-package-i d, 127, --min-sdk-version, 10, --target-sdk-version, 25, --version-code, 10900000, --version-name, 1 .9.0.0, -F, C:\Users\ADMINI~1\AppData\Local\Temp\APKTOOL4598874472322691885.tmp, -0, arsc, -0, asset s/data/0/00b335e3873ba00d7bae26acebdf4e17, -0, assets/data/0/00b378eff4a693958b0ed36c6dffcc0b, -0, a ssets/data/0/01c9c6843e7d1eb45a2ba869b52db27e, -0, assets/data/0/01e534cac677f11cf0d5cf05df23160c, - 0, assets/data/0/025130dc1e6e2fa2fa55fd32b6a78017, -0, assets/data/0/033cdbc283be165d9f429c1bd3e1b87 8, -0, assets/data/0/044746d1d3661e9e643ea424e1045803, -0, assets/data/0/053ae2f30eaa36b3d94364a9e47 ca1c3, -0, assets/data/0/05adc96e5d17203041a2ed8ba89cbee8, -0, assets/data/0/06285f34edff0acb1f0a9c5 53870bbf7, -0, assets/data/0/09a845789635217183a17a483fb25649, -0, assets/data/0/09b804319dc37041e7a a0154fcf87ea6, -0, assets/data/1/100872c273bee4ea61f08b4814ee9708, -0, assets/data/1/113de8d949436b3 68cc3fad0b2bb4f4e, -0, assets/data/1/1199a4fecc510d1b98822300c86430bd, -0, assets/data/1/1309baaf603
求助。为什么我坦克大战刚按J子弹没看到,敌方坦克就消失,子弹的坐标能显示,但看不到子弹。。。
求助。为什么我坦克大战刚按J子弹没看到,敌方坦克就消失,子弹的坐标能显示,但看不到子弹。。。 ``` package com.test3; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.util.*; public class MyTankGame3 extends JFrame{ MyPanel mp=null; public static void main(String[] args) { // TODO Auto-generated method stub MyTankGame3 mtg=new MyTankGame3(); } //构造函数 public MyTankGame3() { mp=new MyPanel(); //启动mp线程 Thread t=new Thread(mp); t.start(); this.add(mp); //注册监听 this.addKeyListener(mp); this.setSize(400,300); this.setResizable(false); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } } //我的面板 class MyPanel extends JPanel implements KeyListener,Runnable { //定义一个我的坦克 Hero hero=null; //定义敌人的坦克组 Vector<EnemyTank> ets=new Vector<EnemyTank>(); int enSize=3; //构造函数 public MyPanel() { //初始化我的坦克 hero=new Hero(100,100); //初始化敌人的坦克 for(int i=0;i<enSize;i++) { //创建坦克 EnemyTank et=new EnemyTank((i+1)*50, 0); et.setDirect(2);//修改方向 et.setColor(0);//修改颜色 //加入到Vector中 ets.add(et); } } //重写paint public void paint(Graphics g) { super.paint(g); g.fillRect(0, 0, 400, 300);//画出跟画板一样大的矩形,当做填充背景。默认为黑色 //调用坦克函数,画出自己的坦克 this.drawTank(hero.getX(), hero.getY(), g, this.hero.direct, 1); //从ss中取出每颗子弹,并画出 for(int i=0;i<hero.ss.size();i++) { Shot myShot=hero.ss.get(i); //画出子弹(不遍历的话,只能画出一颗子弹) if(myShot!=null && myShot.isLive==true) { g.draw3DRect(myShot.x, myShot.y, 1, 1, false); } if(myShot.isLive==false) { //从ss中删除该死亡的子弹 hero.ss.remove(myShot); } } //画出敌人的坦克 for(int i=0;i<ets.size();i++) { EnemyTank et=ets.get(i); if(et.isLive) { this.drawTank(et.getX(), et.getY()+15, g, et.getDirect(), 0); } } } //写一个函数专门判断子弹是否击中敌人坦克 public void hitTank(Shot s,EnemyTank et) { //判断该坦克的方向 switch(et.direct) { //如果此时敌人坦克的方向是上后者下 case 0: case 2: if(s.x>(et.x-10)&&s.x<(et.x+10)&&s.y>(et.y-15)&&s.y<(et.y+15)); { //击中 //子弹死亡 s.isLive=false; //敌人坦克死亡 et.isLive=false; } case 1: case 3: if(s.x>(et.x-15)&&s.x<(et.x+15)&&s.y>(et.y-10)&&s.y<(et.y+10)); { //击中 //子弹死亡 s.isLive=false; //敌人坦克死亡 et.isLive=false; } } } //画出坦克的函数 public void drawTank(int x,int y,Graphics g,int direct,int type) //direct为坦克的方向,type为坦克的类型 { //判断什么类型的坦克 switch(type) { case 0://若为0,则是我的坦克 g.setColor(Color.cyan); break; case 1://为1,则是敌方的坦克 g.setColor(Color.yellow); break; } //判断方向 switch(direct) { case 0://向上 //1.画出左边的填充矩形..用3D矩形使效果更明显 g.fill3DRect(x-10,y-15,5,30,false); //2.画出右边的矩形 g.fill3DRect(x+5,y-15,5,30,false); //3.画出中间矩形 g.fill3DRect(x-5,y-10,10,20,false); //4.画出圆形 g.fillOval(x-5, y-5, 10, 10); //5.画出线 g.drawLine(x, y, x, y-15); break; case 1://方向向右 //1.画出上边的填充矩形..用3D矩形使效果更明显 g.fill3DRect(x-15,y-10,30,5,false); //2.画出下边的矩形 g.fill3DRect(x-15,y+5,30,5,false); //3.画出中间矩形 g.fill3DRect(x-10,y-5,20,10,false); //4.画出圆形 g.fillOval(x-5, y-5, 10, 10); //5.画出线 g.drawLine(x, y, x+15, y); break; case 2://向下 //画出我的坦克 //1.画出左边的填充矩形..用3D矩形使效果更明显 g.fill3DRect(x-10,y-15,5,30,false); //2.画出右边的矩形 g.fill3DRect(x+5,y-15,5,30,false); //3.画出中间矩形 g.fill3DRect(x-5,y-10,10,20,false); //4.画出圆形 g.fillOval(x-5, y-5, 10, 10); //5.画出线 g.drawLine(x, y, x, y+15); break; case 3://方向向左 //1.画出上边的填充矩形..用3D矩形使效果更明显 g.fill3DRect(x-15,y-10,30,5,false); //2.画出下边的矩形 g.fill3DRect(x-15,y+5,30,5,false); //3.画出中间矩形 g.fill3DRect(x-10,y-5,20,10,false); //4.画出圆形 g.fillOval(x-5, y-5, 10, 10); //5.画出线 g.drawLine(x, y, x-15, y); break; } } //键按下处理 a表示向左 s表示向下 d表示向右 w表示向上 public void keyTyped(KeyEvent e) { // TODO Auto-generated method stub } public void keyPressed(KeyEvent e) { // TODO Auto-generated method stub if(e.getKeyCode()==KeyEvent.VK_W) { //设置我的坦克的方向,向上 this.hero.setDirect(0); this.hero.moveUp(); }else if(e.getKeyCode()==KeyEvent.VK_D) { //向右 this.hero.setDirect(1); this.hero.moveRight(); }else if(e.getKeyCode()==KeyEvent.VK_S) { //向下 this.hero.setDirect(2); this.hero.moveDown(); }else if(e.getKeyCode()==KeyEvent.VK_A) { //向左 this.hero.setDirect(3); this.hero.moveLeft(); } //判断玩家是否按下J if(e.getKeyCode()==KeyEvent.VK_J) { //设置子弹可发射的数量 if(this.hero.ss.size()<5) { //开火 this.hero.shotEnemy(); } } //必须重新绘制Panel this.repaint(); } public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub } public void run() { //每个100毫秒去重绘 while(true) { try { Thread.sleep(100); } catch (Exception e) { // TODO: handle exception } //判断是否击中 for(int i=0;i<hero.ss.size();i++) { //取出子弹 Shot myShot=hero.ss.get(i); //判断子弹是否有效 if(myShot.isLive) { //取出每个坦克,与该子弹判断 for(int j=0;j<ets.size();j++) { //取出坦克 EnemyTank et=ets.get(j); if(et.isLive) { this.hitTank(myShot, et); } } } } this.repaint(); } } } //子弹类 class Shot implements Runnable { int x; int y; int direct; int speed=1; boolean isLive=true;//子弹是否还活着 public Shot(int x,int y,int direct) { this.x=x; this.y=y; this.direct=direct; } public void run() { while(true) { try { Thread.sleep(50); } catch (Exception e) { } switch(direct) { case 0://子弹向上 y-=speed; break; case 1://子弹向右 x+=speed; break; case 2://子弹向下 y+=speed; break; case 3://子弹向左 x-=speed; break; } //System.out.println("子弹坐标x="+x+" y="+y); //子弹何时死亡?? //判断该子弹是否碰到边缘 if(x<0||x>400||y<0||y>300) { this.isLive=false; break; } } } } //坦克类 class Tank { //表示坦克的横坐标、纵坐标 int x=0; int y=0; //坦克的方向 0表示上 1表示右 2表示下 3表示左 int direct=0; //坦克的颜色 int color; //设置坦克的速度 int speed=1; //封装颜色、坐标、方向、速度 public int getColor() { return color; } public void setColor(int color) { this.color = color; } public int getSpeed() { return speed; } public void setSpeed(int speed) { this.speed = speed; } public int getDirect() { return direct; } public void setDirect(int direct) { this.direct = direct; } public Tank(int x,int y) { this.x=x; this.y=y; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } } //敌人的坦克 class EnemyTank extends Tank { boolean isLive=true;//判断敌人活着 public EnemyTank(int x,int y) { super(x,y); } } //我的坦克的 class Hero extends Tank { //子弹 Vector<Shot> ss=new Vector<Shot>(); Shot s=null;//该行只能让子弹发射一次 public Hero(int x,int y) { super(x,y); } //开火(设置子弹的初始位置) public void shotEnemy() { switch(this.direct) { case 0: //创建一颗子弹 s=new Shot(x,y-15,0); //把子弹加入向量 ss.add(s); break; case 1: s=new Shot(x+15,y,1); ss.add(s); break; case 2: s=new Shot(x,y+15,2); ss.add(s); break; case 3: s=new Shot(x-15,y,3); ss.add(s); break; } //启动子弹线程 Thread t=new Thread(s); t.start(); } //坦克向上移动 public void moveUp() { y-=speed; } //坦克向右移动 public void moveRight() { x+=speed; }//坦克向下移动 public void moveDown() { y+=speed; } //坦克向左移动 public void moveLeft() { x-=speed; } } ``` 求助~~我查看了好久~就是不知道错在哪
java坦克大战问题,求大神帮忙看下代码
原来自己已经写好了摁J键发射子弹并运行成功,但是想进行下一步子弹打中敌人后敌人消失时,代码写好了后子弹却发射不了了 import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.util.Vector; import javax.swing.*; public class Mytank1 extends JFrame{ Mypanle mp=null; public static void main(String[] args) { // TODO Auto-generated method stub Mytank1 mytank1=new Mytank1(); } public Mytank1() { mp=new Mypanle(); Thread t=new Thread(mp); t.start(); this.addKeyListener(mp); this.add(mp); this.setTitle("6"); this.setSize(400, 500); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } } //面板 class Mypanle extends JPanel implements KeyListener,Runnable { Hero hero=null; Vector<Badtank> ets=new Vector<Badtank>(); int badsize=3; public Mypanle() { //创建自己的tanke hero=new Hero(100,100); //创建敌人坦克 //int badsize=3; for(int i=0;i<badsize;i++) { Badtank et=new Badtank((i+1)*50, 0); et.setColor(0); ets.add(et); } } public void paint(Graphics g) { super.paint(g); g.fillRect(0, 0, 400, 500); this.drawtank(hero.getX(), hero.getY(), g, hero.direction, 1); //画出敌人坦克 for(int i=0;i<ets.size();i++) { Badtank et=ets.get(i); if(et.islive) { this.drawtank(et.getX(), et.getY(), g, et.direction, 0); } } //画出子弹 for(int i=0;i<hero.ss.size();i++) { Shot myshot=hero.ss.get(i); if(myshot!=null&&myshot.islive==true) { g.draw3DRect(myshot.x,myshot.y, 1,1, false); } if(myshot.islive==false) { hero.ss.remove(myshot); } } } //判断子弹是否打中坦克 /*public void hittank(Shot s,Badtank et) { //判断坦克方向 switch(et.direction) { case 0: case 3: //击中坦克 if(s.x>et.x&&s.x<et.x+20&&s.y>et.y&&s.y<et.y+30) { s.islive=false; et.islive=false; } case 1: case 2: if(s.x>et.x&&s.x<et.x+30&&s.y>et.y&&s.y<et.y+20) { s.islive=false; et.islive=false; } } }*/ public void drawtank(int x,int y,Graphics g,int direction,int type) { switch(type) { case 0: g.setColor(Color.YELLOW); break; case 1: g.setColor(Color.CYAN); break; } switch(direction) { //上 case 0: //g.setColor(Color.CYAN); g.fill3DRect(x, y,5,30,false); g.fill3DRect(x+15, y,5,30,false); g.fill3DRect(x+5, y+5,10,20,false); g.fillOval(x+5, y+10, 9, 9); g.drawLine(x+9,y+10,x+9,y); break; //右 case 1: g.fill3DRect(x, y,30,5,false); g.fill3DRect(x, y+15,30,5,false); g.fill3DRect(x+5, y+5,20,10,false); g.fillOval(x+10, y+5, 9, 9); g.drawLine(x+15,y+10,x+30,y+10); break; //左 case 2: g.fill3DRect(x, y,30,5,false); g.fill3DRect(x, y+15,30,5,false); g.fill3DRect(x+5, y+5,20,10,false); g.fillOval(x+10, y+5, 9, 9); g.drawLine(x,y+10,x+13,y+10); break; //下 case 3: //g.setColor(Color.CYAN); g.fill3DRect(x, y,5,30,false); g.fill3DRect(x+15, y,5,30,false); g.fill3DRect(x+5, y+5,10,20,false); g.fillOval(x+5, y+10, 9, 9); g.drawLine(x+9,y+13,x+9,y+30); break; } } @Override public void keyPressed(KeyEvent e){ // TODO Auto-generated method stub if(e.getKeyCode()==KeyEvent.VK_DOWN) { hero.moveDown(); //这两种方法都可; //hero.y+=10; hero.directd(); } else if(e.getKeyCode()==KeyEvent.VK_UP) { hero.moveUp(); hero.directup(); } else if(e.getKeyCode()==KeyEvent.VK_LEFT) { hero.moveLeft(); hero.directl(); } else if(e.getKeyCode()==KeyEvent.VK_RIGHT) { hero.moveRight(); hero.directR(); } if(e.getKeyCode()==KeyEvent.VK_J) { if(this.hero.ss.size()<=4) { this.hero.fireshot(); } } repaint(); } @Override public void keyReleased(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void run() { // TODO Auto-generated method stub while(true) { try { Thread.sleep(100); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } //判断是否被击中 /*for(int i=0;i<hero.ss.size();i++) { //取出子弹 Shot myshot=hero.ss.get(i); if(myshot.islive) { for(int j=0;j<ets.size();i++) { //取出敌人坦克 Badtank et=ets.get(j); if(et.islive) { this.hittank(myshot, et); } } } }*/ this.repaint(); } } } //子弹 class Shot implements Runnable { int x=0; int y=0; int speed=5; int direct; boolean islive=true; public Shot(int x,int y,int direct) { this.x=x; this.y=y; this.direct=direct; } public void run() { while(true) { try { Thread.sleep(50); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } switch(direct) { case 0: y-=speed; break; case 1: x+=speed; break; case 2: x-=speed; break; case 3: y+=speed; break; } if(x<0||x>400||y>500||y<0) { islive=false; break; } } } } //敌人坦克 class Badtank extends Tank { boolean islive=true; public Badtank(int x,int y) { super(x,y); } } //坦克 class Tank { int x=0; int y=0; int color; int direction=3; int speed=10; public int getColor() { return color; } public void setColor(int color) { this.color = color; } public int getDirect() { return direction; } public void setDirect(int direct) { this.direction = direct; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public Tank(int x,int y) { this.x=x; this.y=y; } //移动 /*public void moveUp(){ y-=speed; } public void moveDown(){ y+=speed; } public void moveLeft(){ x-=speed; } public void moveRight(){ x+=speed; } //方向 public void directup() { //向上 this.direction=0; } public void directR() { //向右 this.direction=1; } public void directl() { //向左 this.direction=2; } public void directd() { this.direction=3; }*/ } //我的坦克 class Hero extends Tank { Vector<Shot> ss=new Vector<Shot>(); Shot s=null; public Hero(int x, int y) { super(x, y); // TODO Auto-generated constructor stub } public void fireshot() { switch(this.direction) { case 0: s=new Shot(x+11,y,0); ss.add(s); break; case 1: s=new Shot(x+31,y+11,1); ss.add(s); break; case 2: s=new Shot(x,y+11,2); ss.add(s); break; case 3: s=new Shot(x+10,y+31,3); ss.add(s); break; } Thread t=new Thread(s); t.start(); } //移动 public void moveUp(){ y-=speed; } public void moveDown(){ y+=speed; } public void moveLeft(){ x-=speed; } public void moveRight(){ x+=speed; } //方向 public void directup() { //向上 this.direction=0; } public void directR() { //向右 this.direction=1; } public void directl() { //向左 this.direction=2; } public void directd() { this.direction=3; } }
ssh2应用中统一设置成utf-8之后还会出现乱码问题?
[size=medium]这里我使用的是struts2.0 Hibernate3.2 spring2.0 mysql5.0的配置,容器选择Tomcat6.0; 下面我们使用的是get的方式提交form表单所出现的情况: 前台页面使用: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="../documentTabSideBar.jsp"%> ... 涉及的表单: <%@ include file="../title.jsp" %> 下面我先使用默认的get方式提交进行测试: <form action="addDocumentCatalog.action" id="submitInfo" name="submitInfo" onsubmit="return validate()"> ... <input name="title" type="text" size="40"> <%@ include file="../documentTabSideBar.jsp"%>这个页面的头部设置: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <Meta http-equiv="progma" content="no-cache"> <title></title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <%@ include file="css/css_all.css" %> Action的代码: public class AddDocumentCatalog extends ActionSupport { ... private String title; ... @Override public String execute() throws Exception { //这里我做了打印测试: System.out.println(title); ... this.service.saveDocumentCatalog(bean); DAO层的实现: public class DocumentCatalogDAOImpl extends HibernateDaoSupport implements DocumentCatalogDAO { public void saveDocumentCatalog(DocumentCatalog bean) { { //这里我做了打印测试: System.out.println(bean.getName()); this.getHibernateTemplate().save(bean); } Spring ioc配置: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"></property> <property name="url" value="jdbc:mysql://localhost:3306/langsinoa?useUnicode=true&amp;characterEncoding=UTF-8"></property>... </bean> 到浏览器进行测试:输入“中文”两个字: 得到的请求url信息: http://localhost:8080/oa/DocumentCatalog/addDocumentCatalog.action?type=1&parentId=-1&choice=directory&title=%E4%B8%AD%E6%96%87&title2=&description=&address= 这里的title就是乱码? 得到的Console显示: ?????? ?????? //这里输出的测试结果!就是无法显示的!为什么? firebug截图: [img]http://dl.iteye.com/upload/attachment/0065/3366/f71dcfaf-a3b0-339d-8332-b28bb6c1c1f3.jpg[/img] Hibernate: select max(id) from documentcatalog Hibernate: insert into langsinoa.documentcatalog (name_, date_, flag_, authorId_, authorName_, type_, order_, content_, address_, parentId_, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 之后我将from的Method设置为post: 其他设置不变,出现的状况: [img]http://dl.iteye.com/upload/attachment/0065/3368/1620f803-ce73-398d-b501-360e86bd1249.jpg[/img] Console: 中文 中文 Hibernate: insert into langsinoa.documentcatalog (name_, date_, flag_, authorId_, authorName_, type_, order_, content_, address_, parentId_, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 虽然得到了中文,但是回到db: mysql> select name_ from documentcatalog; +--------------------+ | name_ | +--------------------+ | one | | 盲赂颅忙聳聡 | | into! | | 盲赂颅忙聳聡茂录聛 | | 盲赂颅忙聳聡 | | en | | en | | 涓枃 | | 盲赂颅忙聳聡 | | 盲赂颅忙聳聡 | | 盲赂颅忙聳聡 | | 涓枃 | +--------------------+ 12 rows in set (0.00 sec) 还是乱码: db的编码设置方式: 首先是表: | documentcatalog | CREATE TABLE `documentcatalog` ( `id` bigint(20) NOT NULL, `name_` varchar(50) default NULL, ... PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | 下面是这个sb的default设置: mysql> show variables like '%char%'; +--------------------------+------------- -----+ | Variable_name | Value | +--------------------------+------------- -----+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | C:\Program F ets\ | 统一的是utf-8 我实在是没法了! 请大家帮忙解决一下! 谢谢!谢谢! [/size]
mysql欧洲国家的文字乱码?英语、中文没有乱码是什么原因呢?
【举例】波兰语Śląskie中的Ś和ą字母显示的是? 1.修改配置文件my.ini里的: default-character-set = utf8 character-set-server = utf8 2.命令行设置: mysql> show variables like 'character%'; +--------------------------+---------------------------------------------------- -----+ | Variable_name | Value | +--------------------------+---------------------------------------------------- -----+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\chars ets\ | +--------------------------+---------------------------------------------------- -----+ 8 rows in set (0.05 sec) mysql> show variables like 'collation%'; +----------------------+-----------------+ | Variable_name | Value | +----------------------+-----------------+ | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | +----------------------+-----------------+ 3 rows in set (0.00 sec) mysql> 3.针对我创建的数据库,设置字符集为utf8: alter database 数据库名字 character set utf8; 4.数据库表的字符集也是utf8 mysql> show create table customer_info; +---------------+--------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------------------------+ | Table | Create Table | +---------------+--------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------------------------+ | customer_info | CREATE TABLE `customer_info` ( `CUST_ID` int(11) NOT NULL DEFAULT '0', `CUST_CODE` varchar(32) NOT NULL DEFAULT '', `CUST_NAME` varchar(100) NOT NULL DEFAULT '', `CUST_CATE` char(1) DEFAULT 'N', `CURRENCY` char(3) DEFAULT 'EUR', `CONTINENT` char(1) DEFAULT 'E', `REGION` char(2) NOT NULL DEFAULT '', `PROVINCE` varchar(30) DEFAULT '', `CITY` varchar(30) DEFAULT '', `ADDRESS` varchar(150) DEFAULT '', `ZIP` varchar(10) DEFAULT '', `EMAIL` varchar(100) DEFAULT '', `WEBSITE` varchar(100) DEFAULT '', `LINKMAN` varchar(50) DEFAULT '', `PHONE` varchar(20) DEFAULT '', `FAX` varchar(20) DEFAULT '', `SP_RATE` decimal(12,5) DEFAULT '1.00000', `DATE_FORMAT` varchar(20) DEFAULT 'dd MMM, yy', `STATUS` char(1) DEFAULT 'N', `REMARKS` varchar(200) DEFAULT '', `EDITOR` varchar(32) NOT NULL DEFAULT '', `LAST_UPDATE` datetime DEFAULT NULL, `SHIP_REGION` char(2) NOT NULL DEFAULT '', `SHIP_PROVINCE` varchar(30) DEFAULT '', `SHIP_CITY` varchar(30) DEFAULT '', `SHIP_ADDRESS` varchar(150) DEFAULT '', `SHIP_ZIP` varchar(10) DEFAULT '', `TAX_ID` varchar(50) DEFAULT '', `OTHER_BRANDS` varchar(150) DEFAULT '', `COMP_TYPE` char(1) DEFAULT 'C', `SHOP_TYPE` char(1) DEFAULT 'S', `COMMENTS` text, `STORE_IMAGE` varchar(50) DEFAULT '', PRIMARY KEY (`CUST_ID`), UNIQUE KEY `CUSTOMER_INFO_CODE` (`CUST_CODE`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | +---------------+--------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------------------------+ 1 row in set (0.02 sec) mysql> 5.在.jsp文件里: contentType也设置了字符集为utf8; pageEncoding也设置为utf8 [color=red][size=medium]基本上能设置的都设置了,还有什么需要设置的么?[/size][/color] ---------------- 附: 1.mysql版本是5.5 2. mysql> show character set; +----------+-----------------------------+---------------------+--------+ | Charset | Description | Default collation | Maxlen | +----------+-----------------------------+---------------------+--------+ | big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 | | dec8 | DEC West European | dec8_swedish_ci | 1 | | cp850 | DOS West European | cp850_general_ci | 1 | | hp8 | HP West European | hp8_english_ci | 1 | | koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 | | latin1 | cp1252 West European | latin1_swedish_ci | 1 | | latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 | | swe7 | 7bit Swedish | swe7_swedish_ci | 1 | | ascii | US ASCII | ascii_general_ci | 1 | | ujis | EUC-JP Japanese | ujis_japanese_ci | 3 | | sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 | | hebrew | ISO 8859-8 Hebrew | hebrew_general_ci | 1 | | tis620 | TIS620 Thai | tis620_thai_ci | 1 | | euckr | EUC-KR Korean | euckr_korean_ci | 2 | | koi8u | KOI8-U Ukrainian | koi8u_general_ci | 1 | | gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 | | greek | ISO 8859-7 Greek | greek_general_ci | 1 | | cp1250 | Windows Central European | cp1250_general_ci | 1 | | gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 | | latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 | | armscii8 | ARMSCII-8 Armenian | armscii8_general_ci | 1 | | utf8 | UTF-8 Unicode | utf8_general_ci | 3 | | ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 | | cp866 | DOS Russian | cp866_general_ci | 1 | | keybcs2 | DOS Kamenicky Czech-Slovak | keybcs2_general_ci | 1 | | macce | Mac Central European | macce_general_ci | 1 | | macroman | Mac West European | macroman_general_ci | 1 | | cp852 | DOS Central European | cp852_general_ci | 1 | | latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 | | utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 | | cp1251 | Windows Cyrillic | cp1251_general_ci | 1 | | utf16 | UTF-16 Unicode | utf16_general_ci | 4 | | cp1256 | Windows Arabic | cp1256_general_ci | 1 | | cp1257 | Windows Baltic | cp1257_general_ci | 1 | | utf32 | UTF-32 Unicode | utf32_general_ci | 4 | | binary | Binary pseudo charset | binary | 1 | | geostd8 | GEOSTD8 Georgian | geostd8_general_ci | 1 | | cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 | | eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 | +----------+-----------------------------+---------------------+--------+ 39 rows in set (0.00 sec) mysql> show collation -> ; +--------------------------+----------+-----+---------+----------+---------+ | Collation | Charset | Id | Default | Compiled | Sortlen | +--------------------------+----------+-----+---------+----------+---------+ | big5_chinese_ci | big5 | 1 | Yes | Yes | 1 | | big5_bin | big5 | 84 | | Yes | 1 | | dec8_swedish_ci | dec8 | 3 | Yes | Yes | 1 | | dec8_bin | dec8 | 69 | | Yes | 1 | | cp850_general_ci | cp850 | 4 | Yes | Yes | 1 | | cp850_bin | cp850 | 80 | | Yes | 1 | | hp8_english_ci | hp8 | 6 | Yes | Yes | 1 | | hp8_bin | hp8 | 72 | | Yes | 1 | | koi8r_general_ci | koi8r | 7 | Yes | Yes | 1 | | koi8r_bin | koi8r | 74 | | Yes | 1 | | latin1_german1_ci | latin1 | 5 | | Yes | 1 | | latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 | | latin1_danish_ci | latin1 | 15 | | Yes | 1 | | latin1_german2_ci | latin1 | 31 | | Yes | 2 | | latin1_bin | latin1 | 47 | | Yes | 1 | | latin1_general_ci | latin1 | 48 | | Yes | 1 | | latin1_general_cs | latin1 | 49 | | Yes | 1 | | latin1_spanish_ci | latin1 | 94 | | Yes | 1 | | latin2_czech_cs | latin2 | 2 | | Yes | 4 | | latin2_general_ci | latin2 | 9 | Yes | Yes | 1 | | latin2_hungarian_ci | latin2 | 21 | | Yes | 1 | | latin2_croatian_ci | latin2 | 27 | | Yes | 1 | | latin2_bin | latin2 | 77 | | Yes | 1 | | swe7_swedish_ci | swe7 | 10 | Yes | Yes | 1 | | swe7_bin | swe7 | 82 | | Yes | 1 | | ascii_general_ci | ascii | 11 | Yes | Yes | 1 | | ascii_bin | ascii | 65 | | Yes | 1 | | ujis_japanese_ci | ujis | 12 | Yes | Yes | 1 | | ujis_bin | ujis | 91 | | Yes | 1 | | sjis_japanese_ci | sjis | 13 | Yes | Yes | 1 | | sjis_bin | sjis | 88 | | Yes | 1 | | hebrew_general_ci | hebrew | 16 | Yes | Yes | 1 | | hebrew_bin | hebrew | 71 | | Yes | 1 | | tis620_thai_ci | tis620 | 18 | Yes | Yes | 4 | | tis620_bin | tis620 | 89 | | Yes | 1 | | euckr_korean_ci | euckr | 19 | Yes | Yes | 1 | | euckr_bin | euckr | 85 | | Yes | 1 | | koi8u_general_ci | koi8u | 22 | Yes | Yes | 1 | | koi8u_bin | koi8u | 75 | | Yes | 1 | | gb2312_chinese_ci | gb2312 | 24 | Yes | Yes | 1 | | gb2312_bin | gb2312 | 86 | | Yes | 1 | | greek_general_ci | greek | 25 | Yes | Yes | 1 | | greek_bin | greek | 70 | | Yes | 1 | | cp1250_general_ci | cp1250 | 26 | Yes | Yes | 1 | | cp1250_czech_cs | cp1250 | 34 | | Yes | 2 | | cp1250_croatian_ci | cp1250 | 44 | | Yes | 1 | | cp1250_bin | cp1250 | 66 | | Yes | 1 | | cp1250_polish_ci | cp1250 | 99 | | Yes | 1 | | gbk_chinese_ci | gbk | 28 | Yes | Yes | 1 | | gbk_bin | gbk | 87 | | Yes | 1 | | latin5_turkish_ci | latin5 | 30 | Yes | Yes | 1 | | latin5_bin | latin5 | 78 | | Yes | 1 | | armscii8_general_ci | armscii8 | 32 | Yes | Yes | 1 | | armscii8_bin | armscii8 | 64 | | Yes | 1 | | utf8_general_ci | utf8 | 33 | Yes | Yes | 1 | | utf8_bin | utf8 | 83 | | Yes | 1 | | utf8_unicode_ci | utf8 | 192 | | Yes | 8 | | utf8_icelandic_ci | utf8 | 193 | | Yes | 8 | | utf8_latvian_ci | utf8 | 194 | | Yes | 8 | | utf8_romanian_ci | utf8 | 195 | | Yes | 8 | | utf8_slovenian_ci | utf8 | 196 | | Yes | 8 | | utf8_polish_ci | utf8 | 197 | | Yes | 8 | | utf8_estonian_ci | utf8 | 198 | | Yes | 8 | | utf8_spanish_ci | utf8 | 199 | | Yes | 8 | | utf8_swedish_ci | utf8 | 200 | | Yes | 8 | | utf8_turkish_ci | utf8 | 201 | | Yes | 8 | | utf8_czech_ci | utf8 | 202 | | Yes | 8 | | utf8_danish_ci | utf8 | 203 | | Yes | 8 | | utf8_lithuanian_ci | utf8 | 204 | | Yes | 8 | | utf8_slovak_ci | utf8 | 205 | | Yes | 8 | | utf8_spanish2_ci | utf8 | 206 | | Yes | 8 | | utf8_roman_ci | utf8 | 207 | | Yes | 8 | | utf8_persian_ci | utf8 | 208 | | Yes | 8 | | utf8_esperanto_ci | utf8 | 209 | | Yes | 8 | | utf8_hungarian_ci | utf8 | 210 | | Yes | 8 | | utf8_sinhala_ci | utf8 | 211 | | Yes | 8 | | utf8_general_mysql500_ci | utf8 | 223 | | Yes | 1 | | ucs2_general_ci | ucs2 | 35 | Yes | Yes | 1 | | ucs2_bin | ucs2 | 90 | | Yes | 1 | | ucs2_unicode_ci | ucs2 | 128 | | Yes | 8 | | ucs2_icelandic_ci | ucs2 | 129 | | Yes | 8 | | ucs2_latvian_ci | ucs2 | 130 | | Yes | 8 | | ucs2_romanian_ci | ucs2 | 131 | | Yes | 8 | | ucs2_slovenian_ci | ucs2 | 132 | | Yes | 8 | | ucs2_polish_ci | ucs2 | 133 | | Yes | 8 | | ucs2_estonian_ci | ucs2 | 134 | | Yes | 8 | | ucs2_spanish_ci | ucs2 | 135 | | Yes | 8 | | ucs2_swedish_ci | ucs2 | 136 | | Yes | 8 | | ucs2_turkish_ci | ucs2 | 137 | | Yes | 8 | | ucs2_czech_ci | ucs2 | 138 | | Yes | 8 | | ucs2_danish_ci | ucs2 | 139 | | Yes | 8 | | ucs2_lithuanian_ci | ucs2 | 140 | | Yes | 8 | | ucs2_slovak_ci | ucs2 | 141 | | Yes | 8 | | ucs2_spanish2_ci | ucs2 | 142 | | Yes | 8 | | ucs2_roman_ci | ucs2 | 143 | | Yes | 8 | | ucs2_persian_ci | ucs2 | 144 | | Yes | 8 | | ucs2_esperanto_ci | ucs2 | 145 | | Yes | 8 | | ucs2_hungarian_ci | ucs2 | 146 | | Yes | 8 | | ucs2_sinhala_ci | ucs2 | 147 | | Yes | 8 | | ucs2_general_mysql500_ci | ucs2 | 159 | | Yes | 1 | | cp866_general_ci | cp866 | 36 | Yes | Yes | 1 | | cp866_bin | cp866 | 68 | | Yes | 1 | | keybcs2_general_ci | keybcs2 | 37 | Yes | Yes | 1 | | keybcs2_bin | keybcs2 | 73 | | Yes | 1 | | macce_general_ci | macce | 38 | Yes | Yes | 1 | | macce_bin | macce | 43 | | Yes | 1 | | macroman_general_ci | macroman | 39 | Yes | Yes | 1 | | macroman_bin | macroman | 53 | | Yes | 1 | | cp852_general_ci | cp852 | 40 | Yes | Yes | 1 | | cp852_bin | cp852 | 81 | | Yes | 1 | | latin7_estonian_cs | latin7 | 20 | | Yes | 1 | | latin7_general_ci | latin7 | 41 | Yes | Yes | 1 | | latin7_general_cs | latin7 | 42 | | Yes | 1 | | latin7_bin | latin7 | 79 | | Yes | 1 | | utf8mb4_general_ci | utf8mb4 | 45 | Yes | Yes | 1 | | utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 | | utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 8 | | utf8mb4_icelandic_ci | utf8mb4 | 225 | | Yes | 8 | | utf8mb4_latvian_ci | utf8mb4 | 226 | | Yes | 8 | | utf8mb4_romanian_ci | utf8mb4 | 227 | | Yes | 8 | | utf8mb4_slovenian_ci | utf8mb4 | 228 | | Yes | 8 | | utf8mb4_polish_ci | utf8mb4 | 229 | | Yes | 8 | | utf8mb4_estonian_ci | utf8mb4 | 230 | | Yes | 8 | | utf8mb4_spanish_ci | utf8mb4 | 231 | | Yes | 8 | | utf8mb4_swedish_ci | utf8mb4 | 232 | | Yes | 8 | | utf8mb4_turkish_ci | utf8mb4 | 233 | | Yes | 8 | | utf8mb4_czech_ci | utf8mb4 | 234 | | Yes | 8 | | utf8mb4_danish_ci | utf8mb4 | 235 | | Yes | 8 | | utf8mb4_lithuanian_ci | utf8mb4 | 236 | | Yes | 8 | | utf8mb4_slovak_ci | utf8mb4 | 237 | | Yes | 8 | | utf8mb4_spanish2_ci | utf8mb4 | 238 | | Yes | 8 | | utf8mb4_roman_ci | utf8mb4 | 239 | | Yes | 8 | | utf8mb4_persian_ci | utf8mb4 | 240 | | Yes | 8 | | utf8mb4_esperanto_ci | utf8mb4 | 241 | | Yes | 8 | | utf8mb4_hungarian_ci | utf8mb4 | 242 | | Yes | 8 | | utf8mb4_sinhala_ci | utf8mb4 | 243 | | Yes | 8 | | cp1251_bulgarian_ci | cp1251 | 14 | | Yes | 1 | | cp1251_ukrainian_ci | cp1251 | 23 | | Yes | 1 | | cp1251_bin | cp1251 | 50 | | Yes | 1 | | cp1251_general_ci | cp1251 | 51 | Yes | Yes | 1 | | cp1251_general_cs | cp1251 | 52 | | Yes | 1 | | utf16_general_ci | utf16 | 54 | Yes | Yes | 1 | | utf16_bin | utf16 | 55 | | Yes | 1 | | utf16_unicode_ci | utf16 | 101 | | Yes | 8 | | utf16_icelandic_ci | utf16 | 102 | | Yes | 8 | | utf16_latvian_ci | utf16 | 103 | | Yes | 8 | | utf16_romanian_ci | utf16 | 104 | | Yes | 8 | | utf16_slovenian_ci | utf16 | 105 | | Yes | 8 | | utf16_polish_ci | utf16 | 106 | | Yes | 8 | | utf16_estonian_ci | utf16 | 107 | | Yes | 8 | | utf16_spanish_ci | utf16 | 108 | | Yes | 8 | | utf16_swedish_ci | utf16 | 109 | | Yes | 8 | | utf16_turkish_ci | utf16 | 110 | | Yes | 8 | | utf16_czech_ci | utf16 | 111 | | Yes | 8 | | utf16_danish_ci | utf16 | 112 | | Yes | 8 | | utf16_lithuanian_ci | utf16 | 113 | | Yes | 8 | | utf16_slovak_ci | utf16 | 114 | | Yes | 8 | | utf16_spanish2_ci | utf16 | 115 | | Yes | 8 | | utf16_roman_ci | utf16 | 116 | | Yes | 8 | | utf16_persian_ci | utf16 | 117 | | Yes | 8 | | utf16_esperanto_ci | utf16 | 118 | | Yes | 8 | | utf16_hungarian_ci | utf16 | 119 | | Yes | 8 | | utf16_sinhala_ci | utf16 | 120 | | Yes | 8 | | cp1256_general_ci | cp1256 | 57 | Yes | Yes | 1 | | cp1256_bin | cp1256 | 67 | | Yes | 1 | | cp1257_lithuanian_ci | cp1257 | 29 | | Yes | 1 | | cp1257_bin | cp1257 | 58 | | Yes | 1 | | cp1257_general_ci | cp1257 | 59 | Yes | Yes | 1 | | utf32_general_ci | utf32 | 60 | Yes | Yes | 1 | | utf32_bin | utf32 | 61 | | Yes | 1 | | utf32_unicode_ci | utf32 | 160 | | Yes | 8 | | utf32_icelandic_ci | utf32 | 161 | | Yes | 8 | | utf32_latvian_ci | utf32 | 162 | | Yes | 8 | | utf32_romanian_ci | utf32 | 163 | | Yes | 8 | | utf32_slovenian_ci | utf32 | 164 | | Yes | 8 | | utf32_polish_ci | utf32 | 165 | | Yes | 8 | | utf32_estonian_ci | utf32 | 166 | | Yes | 8 | | utf32_spanish_ci | utf32 | 167 | | Yes | 8 | | utf32_swedish_ci | utf32 | 168 | | Yes | 8 | | utf32_turkish_ci | utf32 | 169 | | Yes | 8 | | utf32_czech_ci | utf32 | 170 | | Yes | 8 | | utf32_danish_ci | utf32 | 171 | | Yes | 8 | | utf32_lithuanian_ci | utf32 | 172 | | Yes | 8 | | utf32_slovak_ci | utf32 | 173 | | Yes | 8 | | utf32_spanish2_ci | utf32 | 174 | | Yes | 8 | | utf32_roman_ci | utf32 | 175 | | Yes | 8 | | utf32_persian_ci | utf32 | 176 | | Yes | 8 | | utf32_esperanto_ci | utf32 | 177 | | Yes | 8 | | utf32_hungarian_ci | utf32 | 178 | | Yes | 8 | | utf32_sinhala_ci | utf32 | 179 | | Yes | 8 | | binary | binary | 63 | Yes | Yes | 1 | | geostd8_general_ci | geostd8 | 92 | Yes | Yes | 1 | | geostd8_bin | geostd8 | 93 | | Yes | 1 | | cp932_japanese_ci | cp932 | 95 | Yes | Yes | 1 | | cp932_bin | cp932 | 96 | | Yes | 1 | | eucjpms_japanese_ci | eucjpms | 97 | Yes | Yes | 1 | | eucjpms_bin | eucjpms | 98 | | Yes | 1 | +--------------------------+----------+-----+---------+----------+---------+ 197 rows in set (0.00 sec)
FF下图片无法显示
[code="html"]<DIV id=demo style="OVERFLOW: hidden; WIDTH: 770px; HEIGHT: 110px"> <TABLE cellPadding=0 align=center border=0 cellspacing="0"> <TR> <TD id=demo11 vAlign=top> <TABLE cellSpacing=5 cellPadding=0 width="100%" align=center border=0> <TR vAlign=top> <TD><img height="83" src="/2010/ETS生物科技.gif" border="0"/></TD> <TD><img height="83" src="/2010/北京奥宇.gif" border="0"/></TD> <!--(还有多个同样的TD) --> </TR> </TABLE> </TD> <TD id=demo12 vAlign=top></TD> </TR> </TABLE> </DIV> <SCRIPT> var speed=30 demo12.innerHTML=demo11.innerHTML function Marquee11(){ if( demo12.offsetWidth-demo.scrollLeft<=0 ) demo.scrollLeft-=demo11.offsetWidth else{ demo.scrollLeft++ } } var MyMar1 = setInterval(Marquee11,speed) demo.onmouseover = function(){ clearInterval(MyMar1) } demo.onmouseout = function(){ MyMar1=setInterval(Marquee11,speed) } </SCRIPT>[/code] 在IE8 谷歌浏览器下正常。但是在FF下id=[b]demo12[/b]的TD中的图片无法显示,发现该TD下图片的路径中的中文为乱码,怎么办?
用java写坦克大战线程中一个关于ConcurrentModificationException异常
Iterator it = this.hero.shs.iterator(); Shot st = null; EnemyTank et = null; Iterator itet = this.ets.iterator(); while (it.hasNext()) { st = (Shot) it.next(); if(st.isLive){ while (itet.hasNext()) { et = (EnemyTank) itet.next(); if(et.isLive){ isStrike(et, st); } } } } 这段代码是判断一个敌人是人坦克是否被我的子弹打中的可是每当我打第三个坦克时它就报这样一异常看截图
终于明白阿里百度这样的大公司,为什么面试经常拿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怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
大学四年自学走来,这些珍藏的「实用工具/学习网站」我全贡献出来了
知乎高赞:文中列举了互联网一线大厂程序员都在用的工具集合,涉及面非常广,小白和老手都可以进来看看,或许有新收获。
《阿里巴巴开发手册》读书笔记-编程规约
Java编程规约命名风格 命名风格 类名使用UpperCamelCase风格 方法名,参数名,成员变量,局部变量都统一使用lowerCamelcase风格 常量命名全部大写,单词间用下划线隔开, 力求语义表达完整清楚,不要嫌名字长 ...
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日,国家统计局发布
听说想当黑客的都玩过这个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的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
如何优雅地打印一个Java对象?
你好呀,我是沉默王二,一个和黄家驹一样身高,和刘德华一样颜值的程序员。虽然已经写了十多年的 Java 代码,但仍然觉得自己是个菜鸟(请允许我惭愧一下)。 在一个月黑风高的夜晚,我思前想后,觉得再也不能这么蹉跎下去了。于是痛下决心,准备通过输出的方式倒逼输入,以此来修炼自己的内功,从而进阶成为一名真正意义上的大神。与此同时,希望这些文章能够帮助到更多的读者,让大家在学习的路上不再寂寞、空虚和冷。 ...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
Linux 命令(122)—— watch 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] watch(1) manual
Linux 命令(121)—— cal 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] cal(1) manual
记jsp+servlet+jdbc实现的新闻管理系统
1.工具:eclipse+SQLyog 2.介绍:实现的内容就是显示新闻的基本信息,然后一个增删改查的操作。 3.数据库表设计 列名 中文名称 数据类型 长度 非空 newsId 文章ID int 11 √ newsTitle 文章标题 varchar 20 √ newsContent 文章内容 text newsStatus 是否审核 varchar 10 news...
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告(本文) 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
新来个技术总监,禁止我们使用Lombok!
我有个学弟,在一家小型互联网公司做Java后端开发,最近他们公司新来了一个技术总监,这位技术总监对技术细节很看重,一来公司之后就推出了很多"政策",比如定义了很多开发规范、日志规范、甚至是要求大家统一使用某一款IDE。 但是这些都不是我这个学弟和我吐槽的点,他真正和我吐槽的是,他很不能理解,这位新来的技术总监竟然禁止公司内部所有开发使用Lombok。但是又没给出十分明确的,可以让人信服的理由。 于...
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
2020金三银四,一篇文章教你如何征服面试官,拿到offer
2020年,跳槽面试就靠它们了,现在每天刷题,看源码文档,最近看的这些题目还是有些难度,有一部分我都要好好想一想才能回答出来,或者回答不出来,总的来说知识宽度够了深度还跟不上。所以要重点突破下底层的东西。这篇文章我总结了很久,希望对正在准备面试的同仁们有点帮助。没错我就是传说中的面霸!! 一. 面试准备 首先,是笔试题,这点是初级程序员绕不过去的坎。 笔试题一般的公司都会出的,除非你是大牛,可以选...
用Python开发实用程序 – 计算器
作者:隋顺意 一段时间前,自己制作了一个库 “sui-math”。这其实是math的翻版。做完后,python既然可以轻易的完成任何的数学计算,何不用python开发一个小程序专门用以计算呢? 现在我们越来越依赖于计算器,很多复杂的计算都离不开它。我们使用过各式各样的计算器,无论是电脑自带的,还是网也上的计算器,却都没有自己动手编写属于自己计算器。今天就让我们走进计算器的世界,用python来编写...
Python学习笔记(语法篇)
本篇博客大部分内容摘自埃里克·马瑟斯所著的《Python编程:从入门到实战》(入门类书籍),采用举例的方式进行知识点提要 关于Python学习书籍推荐文章 《学习Python必备的8本书》 Python语法特点: 通过缩进进行语句组织 不需要变量或参数的声明 冒号 1 变量和简单数据结构 1.1 变量命名 只能包含字母、数字和下划线,且不能以数字打头。 1.2 字符串 在Python中,用引号...
小白也会用的情人节表白神器
鉴于情人节女朋友总说直男,上网找了个模板,改了一下,发现效果还不错。然后又录了一个视频,发现凑合,能用。现在免费分享给程序员,去表白去吧。​​​​​​。当然比较low因为考研没时间优化,懒着优化了。 先看一下效果吧:页面太多了,这里我只放几个页面里面有音乐,还凑合不是太单调。 所有页面最后的合成效果: 接下来教大家如何使用: 新建文件夹:love 然后建立这几个...
相关热词 c# 识别回车 c#生成条形码ean13 c#子控制器调用父控制器 c# 写大文件 c# 浏览pdf c#获取桌面图标的句柄 c# list反射 c# 句柄 进程 c# 倒计时 线程 c# 窗体背景色
立即提问