ubuntu:依赖: uno-libs3 (= 5.1.6~rc2-0ubuntu1~xenial3) 但是 5.1.6~rc2-0ubuntu1~xenial7 正要被安装

正在读取软件包列表... 完成
正在分析软件包的依赖关系树

正在读取状态信息... 完成

libstdc++6 已经是最新版 (5.4.0-6ubuntu1~16.04.11)。
您可能需要运行“apt-get -f install”来纠正下列错误:
下列软件包有未满足的依赖关系:
ure : 依赖: uno-libs3 (= 5.1.6~rc2-0ubuntu1~xenial3) 但是 5.1.6~rc2-0ubuntu1~xenial7 正要被安装

小白看不懂啊 心里苦啊 百度谷歌了……求教大神

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
温控风扇中电机对温度显示的干扰?
想用DS18B20,arduino uno板,LCD1602,ULN2003,普通直流电机做一个温控风扇,测试的时候发现如果不接电机,用手触摸18B20,在串口和LCD上显示的温度值都是连续变化的;但是如果接上电机,再用手触摸18B20,刚开始串口和LCD都显示正常,随着温度升高,串口上瞬间显示84℃,LCD直接不显示数值。请问各位大佬怎么解决呢?下面是正常和异常的温度曲线及程序: ![图片说明](https://img-ask.csdn.net/upload/202002/07/1581068319_123602.png) ![图片说明](https://img-ask.csdn.net/upload/202002/07/1581068345_193378.png) ``` #include <DallasTemperature.h> #include <LiquidCrystal.h> #define GREEN_LED 5 #define YELLOW_LED 6 #define RED_LED 7 #define ULN2003 3 #define ONE_WIRE_BUS 4 //1-wire数据总线连接在IO4 OneWire oneWire(ONE_WIRE_BUS); //创建对象 DallasTemperature sensors(&oneWire); //创建对象 LiquidCrystal lcd(13,12,11,10,9,8); //必须按RS,E,D4,D5,D6,D7顺序显示 float tempMin = 18; float tempMax = 25; int fanSpeed; void setup() { pinMode(GREEN_LED, OUTPUT); pinMode(YELLOW_LED, OUTPUT); pinMode(RED_LED, OUTPUT); pinMode(ULN2003, OUTPUT); //不要忘记 sensors.begin(); //初始化ds18b20总线 Serial.begin(115200);// 设置串口波特率 lcd_init(); } void loop() { float temp = get_temperature(); //获取温度 control_motor(temp); //控制电机 lcd_main(temp); //显示温度 Serial.println(temp); } void lcd_init() { lcd.begin(16,2); //设置LCD显示的数目。16 X 2:16列2行。 lcd.print("Welcome to use!"); delay(1000); lcd.clear(); } void lcd_main(float temp) { lcd.setCursor(0,0); //设置LCD开始位置 lcd.print("TEMP("); lcd.print(char(223)); //o符号 lcd.print("C) :"); lcd.setCursor(10,0); display_temperature(temp); } void control_motor(float temp) { if (temp < tempMin) { fanSpeed = 0; digitalWrite(ULN2003, fanSpeed); // digitalWrite(YELLOW_LED, HIGH); // digitalWrite(GREEN_LED, LOW); // digitalWrite(RED_LED, LOW); } else if ((temp >= tempMin) && (temp < tempMax)) { fanSpeed = map(temp, tempMin, tempMax, 60, 170); analogWrite(ULN2003, fanSpeed); // digitalWrite(YELLOW_LED, LOW); // digitalWrite(GREEN_LED, HIGH); // digitalWrite(RED_LED, LOW); } else if (temp >= tempMax) { fanSpeed = map(temp, tempMax, tempMax+5, 170, 255); analogWrite(ULN2003, fanSpeed); // digitalWrite(YELLOW_LED, LOW); // digitalWrite(GREEN_LED, LOW); // digitalWrite(RED_LED, HIGH); } } float get_temperature() { sensors.requestTemperatures(); //向总线上所有设备发送温度转换请求,默认情况下该方法会阻塞 float temp = sensors.getTempCByIndex(0); //获取索引号0的传感器摄氏温度数据 delay(500); //温度检测间隔 if (temp != DEVICE_DISCONNECTED_C) //如果设备连接正常 { return temp; } } void display_temperature(float temp) { lcd.print(int(temp)); //tempC=23.52-->> 23 lcd.print("."); lcd.print(int(temp * 10) % 10); //tempC=23.52-->> 235.2-->>235-->>5 lcd.print(int(temp * 100) % 10); //取小数点后第二位 } ```
新人求解:Ardunio蓝牙模块:为什么我的得到的结果是这样子??
我用的Arduino UNO,蓝牙模块HC-06。 Arduino TX接蓝牙RX, Arduino RX接蓝牙TX。 Arduino 3.3v接蓝牙VCC, Arduino GND接蓝牙GND。 我的代码: void setup() { Serial.begin(9600); } void loop() { while(Serial.available()) { char message=Serial.read(); Serial.print(message); delay(2); } } 我在手机上输入的分别是:hello world、we are champion、I Love You、WDNMD、 hello world、we are champion、I Love You、WDNMD. 在串口看到的就是这样的(图),想问一下大神为什么会这样,要如何解决呢???![图片说明](https://img-ask.csdn.net/upload/201911/13/1573657816_273913.png)
Let's play UNO
Problem Description Uno is a famous card game played with a specially printed deck. It's very popular as a funny game in a party. A so-called "official rules" is presented at the Wikipedia, but there are a lot of different extended rules all over the world according to their specific needs. In this problem, you are required to obey our rules introduced below: The Uno deck consists of cards of 4 colors: red(R), green(G), blue(B), and yellow(Y). Each color has two kinds of cards, number cards and action cards. The ranks in number cards are 0-9. There are 3 "action" cards in each color, labeled "skip"(S), "draw two"(D), and "reverse"(R). The functions of the actions will be described afterwards. For each color, there are two copies of each positive number card and action card, but only one zero card, producing 25 cards in total. Besides, there are also special black action cards called "wild cards", "wild"(WC) and "wild draw four"(WF). There are four "wild" and "wild draw four" cards each. Hence, there are 108 cards in total. In this problem, a card is marked with an ID of two characters length, the first is the color (R, G, B, Y, W) while the second is the rank (0-9, S, D, R, C, F). For example, the ID of red 2 is R2, the yellow reverse is YR, the wild cards are WC and WF. Supposed there are n players numbered from 1 to n clockwise. Before playing, players take turns(in the order of 1, 2, ... n) to pick seven successive cards from the stock. The top card of the remaining stock is exposed to start the game, treated as if player 1 dropped that card. The exposed card will never be WC or WF in this problem. Then the game begins clockwise (next player is 2), or counter-clockwise (next player is n) if the top exposed card is a reverse. At each turn, a player may drop a card from their hand that matches the color or rank of the top exposed card (e.g., if the top card is R3, you can drop R5 or G3; if the top card is RD, you can drop R3 or GD) or play a WC. What's more, if the player has a WF and no other legal cards to drop, he can drop the WF. Then the card dropped just now becomes the top exposed card. If a player has no legal cards, he must draw the top card of the stock and place it in his hand. After dropping a single card or drawing, the next player clockwise takes a turn, or counter-clockwise when the reverse is in effect. When a player drops down to only one card, that player is required to say "uno" to warn other players. The game ends when a player drops all his/her cards, or the stock is emptied but the current player has to draw a card. If the last card is an action card, the special effect still occurs. When the game ends, all players count the number of points pertaining to the values of the cards in their hands. Number cards worth the face value on them, colored special cards worth twenty, and wilds worth fifty, e.g., R2 worth 2, G0 worth 0, BD and YS worth 20, WC and WF worth 50. The descriptions of the action cards: Now here comes the problem. There are N people playing Uno under the rules mentioned above. Given the sequence of the 108 cards of the stock, you are asked to simulate a Uno game. At each turn, the player will always drop a card if permitted. If there are more than one choices, the player will drop the card with the largest point. If still a tie, he will choose the one whose ID is the smallest alphabetical order. When a player drops WC or WF, he has to name a color. The first time he will name red, the second time he will name green, the third time blue, the fourth time yellow, the fifth time red again, and so on. When the game ends, you should output the final score of each player, and we also want to know how many times each player calls "Uno". Input The first line of the input file contains a single number: the number of test cases to follow. Each test case has two lines: The first line contains the number of players N , with 2<=N<=10. The second line contains 108 IDs of the Uno cards, separated by one space. Each ID is two characters long as introduced in the description above. Output For each test case, output two lines: The first line are N integers, the ith integer is the final score of player i. The second lines are also N integers, the ith integer shows how many times player i calls "Uno". Sample Input 1 2 R9 RD RD RS RS RR RR B0 B1 B1 B2 B2 B3 B3 G0 GD GD GS GS GR GR G9 G9 G8 G8 G7 G7 G6 G6 G5 G5 G4 G4 G3 G3 G2 G2 G1 G1 Y0 Y9 Y9 Y8 Y8 Y7 Y7 Y6 Y6 Y5 Y5 Y4 Y4 Y3 Y3 Y2 Y2 Y1 Y1 YD YD YS YS YR YR R9 R8 R8 R7 R7 R6 R6 R5 R5 R4 R4 R3 R3 R2 R2 R1 R1 R0 B4 B4 B5 B5 B6 B6 B7 B7 B8 B8 B9 B9 BD BD BS BS BR BR WC WC WC WC WF WF WF WF Sample Output 249 0 0 1
利用jodconverter+openoffice转换docx、xlsx不成功!求大神帮忙!跪谢啦!
用的是jodconverter-core-3.0-beta-4-dist里的jar包; OpenOffice 用的4.1.1的版本; 调用代码书写如下: public static boolean startService(String wordFile,String pdfFile,String fileswf){ boolean flag = false; DefaultOfficeManagerConfiguration config = new DefaultOfficeManagerConfiguration(); try{ File inputFile = new File(wordFile); if (inputFile.exists()){ int ports[] = {Integer.parseInt(CommUtil.getPort_Str())}; config.setOfficeHome( new File(CommUtil.getOpenOffice_HOME())); config.setPortNumbers(ports); config.setTaskExecutionTimeout(1000 * 60 * 5L);// 设置任务执行超时为5分钟 config.setTaskQueueTimeout(1000 * 60 * 60 * 24L);// 设置任务队列超时为24小时 officeManager = config.buildOfficeManager(); officeManager.start();// 启动服务 OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager); // 如果目标路径不存在, 则新建该路径 File outputFile = new File(pdfFile); if (!outputFile.getParentFile().exists()) outputFile.getParentFile().mkdirs(); File fileswfo = new File(fileswf); if (!fileswfo.exists()) fileswfo.mkdirs(); converter.convert(inputFile, outputFile); if(officeManager != null) officeManager.stop(); flag = true; } else flag = false; }catch (Exception ce) { System.out.println("office转换服务启动失败!详细信息:" + ce); ce.printStackTrace(); } return flag; } 转换doc、xls、ppt、pptx都没有问题,可唯独docx、xlsx转换不了,看网上有人说能转换,是不是代码写的有问题呢,望有大神能帮忙解决问题啊,小弟不胜感激! 后台报错如下: office转换服务启动失败!详细信息:org.artofsolving.jodconverter.office.OfficeException: could not load document: 1433490929760工作安排.xlsx org.artofsolving.jodconverter.office.OfficeException: could not load document: 1433490929760工作安排.xlsx at org.artofsolving.jodconverter.AbstractConversionTask.loadDocument(AbstractConversionTask.java:92) at org.artofsolving.jodconverter.AbstractConversionTask.execute(AbstractConversionTask.java:59) at org.artofsolving.jodconverter.office.PooledOfficeManager$2.run(PooledOfficeManager.java:80) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one. at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:177) at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:143) at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:335) at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:304) at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:91) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:639) at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:151) at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:133) at com.sun.proxy.$Proxy35.loadComponentFromURL(Unknown Source) at org.artofsolving.jodconverter.AbstractConversionTask.loadDocument(AbstractConversionTask.java:90) ... 8 more
Let's play UNO 怎么实现的
Problem Description Uno is a famous card game played with a specially printed deck. It's very popular as a funny game in a party. A so-called "official rules" is presented at the Wikipedia, but there are a lot of different extended rules all over the world according to their specific needs. In this problem, you are required to obey our rules introduced below: The Uno deck consists of cards of 4 colors: red(R), green(G), blue(B), and yellow(Y). Each color has two kinds of cards, number cards and action cards. The ranks in number cards are 0-9. There are 3 "action" cards in each color, labeled "skip"(S), "draw two"(D), and "reverse"(R). The functions of the actions will be described afterwards. For each color, there are two copies of each positive number card and action card, but only one zero card, producing 25 cards in total. Besides, there are also special black action cards called "wild cards", "wild"(WC) and "wild draw four"(WF). There are four "wild" and "wild draw four" cards each. Hence, there are 108 cards in total. In this problem, a card is marked with an ID of two characters length, the first is the color (R, G, B, Y, W) while the second is the rank (0-9, S, D, R, C, F). For example, the ID of red 2 is R2, the yellow reverse is YR, the wild cards are WC and WF. Supposed there are n players numbered from 1 to n clockwise. Before playing, players take turns(in the order of 1, 2, ... n) to pick seven successive cards from the stock. The top card of the remaining stock is exposed to start the game, treated as if player 1 dropped that card. The exposed card will never be WC or WF in this problem. Then the game begins clockwise (next player is 2), or counter-clockwise (next player is n) if the top exposed card is a reverse. At each turn, a player may drop a card from their hand that matches the color or rank of the top exposed card (e.g., if the top card is R3, you can drop R5 or G3; if the top card is RD, you can drop R3 or GD) or play a WC. What's more, if the player has a WF and no other legal cards to drop, he can drop the WF. Then the card dropped just now becomes the top exposed card. If a player has no legal cards, he must draw the top card of the stock and place it in his hand. After dropping a single card or drawing, the next player clockwise takes a turn, or counter-clockwise when the reverse is in effect. When a player drops down to only one card, that player is required to say "uno" to warn other players. The game ends when a player drops all his/her cards, or the stock is emptied but the current player has to draw a card. If the last card is an action card, the special effect still occurs. When the game ends, all players count the number of points pertaining to the values of the cards in their hands. Number cards worth the face value on them, colored special cards worth twenty, and wilds worth fifty, e.g., R2 worth 2, G0 worth 0, BD and YS worth 20, WC and WF worth 50. The descriptions of the action cards: Now here comes the problem. There are N people playing Uno under the rules mentioned above. Given the sequence of the 108 cards of the stock, you are asked to simulate a Uno game. At each turn, the player will always drop a card if permitted. If there are more than one choices, the player will drop the card with the largest point. If still a tie, he will choose the one whose ID is the smallest alphabetical order. When a player drops WC or WF, he has to name a color. The first time he will name red, the second time he will name green, the third time blue, the fourth time yellow, the fifth time red again, and so on. When the game ends, you should output the final score of each player, and we also want to know how many times each player calls "Uno". Input The first line of the input file contains a single number: the number of test cases to follow. Each test case has two lines: The first line contains the number of players N , with 2<=N<=10. The second line contains 108 IDs of the Uno cards, separated by one space. Each ID is two characters long as introduced in the description above. Output For each test case, output two lines: The first line are N integers, the ith integer is the final score of player i. The second lines are also N integers, the ith integer shows how many times player i calls "Uno". Sample Input 1 2 R9 RD RD RS RS RR RR B0 B1 B1 B2 B2 B3 B3 G0 GD GD GS GS GR GR G9 G9 G8 G8 G7 G7 G6 G6 G5 G5 G4 G4 G3 G3 G2 G2 G1 G1 Y0 Y9 Y9 Y8 Y8 Y7 Y7 Y6 Y6 Y5 Y5 Y4 Y4 Y3 Y3 Y2 Y2 Y1 Y1 YD YD YS YS YR YR R9 R8 R8 R7 R7 R6 R6 R5 R5 R4 R4 R3 R3 R2 R2 R1 R1 R0 B4 B4 B5 B5 B6 B6 B7 B7 B8 B8 B9 B9 BD BD BS BS BR BR WC WC WC WC WF WF WF WF Sample Output 249 0 0 1
cannot increment value-initialized list iterator怎么解决?
C++中 VS报错 Debug Assertion Failed! Program: D:\Source\repos\uno\Debug\uno.exe File: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\list Line: 171 Expression: cannot increment value-initialized list iterator 怎么解决?
Let's play UNO 怎么实现呢
Problem Description Uno is a famous card game played with a specially printed deck. It's very popular as a funny game in a party. A so-called "official rules" is presented at the Wikipedia, but there are a lot of different extended rules all over the world according to their specific needs. In this problem, you are required to obey our rules introduced below: The Uno deck consists of cards of 4 colors: red(R), green(G), blue(B), and yellow(Y). Each color has two kinds of cards, number cards and action cards. The ranks in number cards are 0-9. There are 3 "action" cards in each color, labeled "skip"(S), "draw two"(D), and "reverse"(R). The functions of the actions will be described afterwards. For each color, there are two copies of each positive number card and action card, but only one zero card, producing 25 cards in total. Besides, there are also special black action cards called "wild cards", "wild"(WC) and "wild draw four"(WF). There are four "wild" and "wild draw four" cards each. Hence, there are 108 cards in total. In this problem, a card is marked with an ID of two characters length, the first is the color (R, G, B, Y, W) while the second is the rank (0-9, S, D, R, C, F). For example, the ID of red 2 is R2, the yellow reverse is YR, the wild cards are WC and WF. Supposed there are n players numbered from 1 to n clockwise. Before playing, players take turns(in the order of 1, 2, ... n) to pick seven successive cards from the stock. The top card of the remaining stock is exposed to start the game, treated as if player 1 dropped that card. The exposed card will never be WC or WF in this problem. Then the game begins clockwise (next player is 2), or counter-clockwise (next player is n) if the top exposed card is a reverse. At each turn, a player may drop a card from their hand that matches the color or rank of the top exposed card (e.g., if the top card is R3, you can drop R5 or G3; if the top card is RD, you can drop R3 or GD) or play a WC. What's more, if the player has a WF and no other legal cards to drop, he can drop the WF. Then the card dropped just now becomes the top exposed card. If a player has no legal cards, he must draw the top card of the stock and place it in his hand. After dropping a single card or drawing, the next player clockwise takes a turn, or counter-clockwise when the reverse is in effect. When a player drops down to only one card, that player is required to say "uno" to warn other players. The game ends when a player drops all his/her cards, or the stock is emptied but the current player has to draw a card. If the last card is an action card, the special effect still occurs. When the game ends, all players count the number of points pertaining to the values of the cards in their hands. Number cards worth the face value on them, colored special cards worth twenty, and wilds worth fifty, e.g., R2 worth 2, G0 worth 0, BD and YS worth 20, WC and WF worth 50. The descriptions of the action cards: Now here comes the problem. There are N people playing Uno under the rules mentioned above. Given the sequence of the 108 cards of the stock, you are asked to simulate a Uno game. At each turn, the player will always drop a card if permitted. If there are more than one choices, the player will drop the card with the largest point. If still a tie, he will choose the one whose ID is the smallest alphabetical order. When a player drops WC or WF, he has to name a color. The first time he will name red, the second time he will name green, the third time blue, the fourth time yellow, the fifth time red again, and so on. When the game ends, you should output the final score of each player, and we also want to know how many times each player calls "Uno". Input The first line of the input file contains a single number: the number of test cases to follow. Each test case has two lines: The first line contains the number of players N , with 2<=N<=10. The second line contains 108 IDs of the Uno cards, separated by one space. Each ID is two characters long as introduced in the description above. Output For each test case, output two lines: The first line are N integers, the ith integer is the final score of player i. The second lines are also N integers, the ith integer shows how many times player i calls "Uno". Sample Input 1 2 R9 RD RD RS RS RR RR B0 B1 B1 B2 B2 B3 B3 G0 GD GD GS GS GR GR G9 G9 G8 G8 G7 G7 G6 G6 G5 G5 G4 G4 G3 G3 G2 G2 G1 G1 Y0 Y9 Y9 Y8 Y8 Y7 Y7 Y6 Y6 Y5 Y5 Y4 Y4 Y3 Y3 Y2 Y2 Y1 Y1 YD YD YS YS YR YR R9 R8 R8 R7 R7 R6 R6 R5 R5 R4 R4 R3 R3 R2 R2 R1 R1 R0 B4 B4 B5 B5 B6 B6 B7 B7 B8 B8 B9 B9 BD BD BS BS BR BR WC WC WC WC WF WF WF WF Sample Output 249 0 0 1
Let's play UNO 的编程法
Problem Description Uno is a famous card game played with a specially printed deck. It's very popular as a funny game in a party. A so-called "official rules" is presented at the Wikipedia, but there are a lot of different extended rules all over the world according to their specific needs. In this problem, you are required to obey our rules introduced below: The Uno deck consists of cards of 4 colors: red(R), green(G), blue(B), and yellow(Y). Each color has two kinds of cards, number cards and action cards. The ranks in number cards are 0-9. There are 3 "action" cards in each color, labeled "skip"(S), "draw two"(D), and "reverse"(R). The functions of the actions will be described afterwards. For each color, there are two copies of each positive number card and action card, but only one zero card, producing 25 cards in total. Besides, there are also special black action cards called "wild cards", "wild"(WC) and "wild draw four"(WF). There are four "wild" and "wild draw four" cards each. Hence, there are 108 cards in total. In this problem, a card is marked with an ID of two characters length, the first is the color (R, G, B, Y, W) while the second is the rank (0-9, S, D, R, C, F). For example, the ID of red 2 is R2, the yellow reverse is YR, the wild cards are WC and WF. Supposed there are n players numbered from 1 to n clockwise. Before playing, players take turns(in the order of 1, 2, ... n) to pick seven successive cards from the stock. The top card of the remaining stock is exposed to start the game, treated as if player 1 dropped that card. The exposed card will never be WC or WF in this problem. Then the game begins clockwise (next player is 2), or counter-clockwise (next player is n) if the top exposed card is a reverse. At each turn, a player may drop a card from their hand that matches the color or rank of the top exposed card (e.g., if the top card is R3, you can drop R5 or G3; if the top card is RD, you can drop R3 or GD) or play a WC. What's more, if the player has a WF and no other legal cards to drop, he can drop the WF. Then the card dropped just now becomes the top exposed card. If a player has no legal cards, he must draw the top card of the stock and place it in his hand. After dropping a single card or drawing, the next player clockwise takes a turn, or counter-clockwise when the reverse is in effect. When a player drops down to only one card, that player is required to say "uno" to warn other players. The game ends when a player drops all his/her cards, or the stock is emptied but the current player has to draw a card. If the last card is an action card, the special effect still occurs. When the game ends, all players count the number of points pertaining to the values of the cards in their hands. Number cards worth the face value on them, colored special cards worth twenty, and wilds worth fifty, e.g., R2 worth 2, G0 worth 0, BD and YS worth 20, WC and WF worth 50. The descriptions of the action cards: Now here comes the problem. There are N people playing Uno under the rules mentioned above. Given the sequence of the 108 cards of the stock, you are asked to simulate a Uno game. At each turn, the player will always drop a card if permitted. If there are more than one choices, the player will drop the card with the largest point. If still a tie, he will choose the one whose ID is the smallest alphabetical order. When a player drops WC or WF, he has to name a color. The first time he will name red, the second time he will name green, the third time blue, the fourth time yellow, the fifth time red again, and so on. When the game ends, you should output the final score of each player, and we also want to know how many times each player calls "Uno". Input The first line of the input file contains a single number: the number of test cases to follow. Each test case has two lines: The first line contains the number of players N , with 2<=N<=10. The second line contains 108 IDs of the Uno cards, separated by one space. Each ID is two characters long as introduced in the description above. Output For each test case, output two lines: The first line are N integers, the ith integer is the final score of player i. The second lines are also N integers, the ith integer shows how many times player i calls "Uno". Sample Input 1 2 R9 RD RD RS RS RR RR B0 B1 B1 B2 B2 B3 B3 G0 GD GD GS GS GR GR G9 G9 G8 G8 G7 G7 G6 G6 G5 G5 G4 G4 G3 G3 G2 G2 G1 G1 Y0 Y9 Y9 Y8 Y8 Y7 Y7 Y6 Y6 Y5 Y5 Y4 Y4 Y3 Y3 Y2 Y2 Y1 Y1 YD YD YS YS YR YR R9 R8 R8 R7 R7 R6 R6 R5 R5 R4 R4 R3 R3 R2 R2 R1 R1 R0 B4 B4 B5 B5 B6 B6 B7 B7 B8 B8 B9 B9 BD BD BS BS BR BR WC WC WC WC WF WF WF WF Sample Output 249 0 0 1
C语言求解Let's play UNO的做法
Problem Description Uno is a famous card game played with a specially printed deck. It's very popular as a funny game in a party. A so-called "official rules" is presented at the Wikipedia, but there are a lot of different extended rules all over the world according to their specific needs. In this problem, you are required to obey our rules introduced below: The Uno deck consists of cards of 4 colors: red(R), green(G), blue(B), and yellow(Y). Each color has two kinds of cards, number cards and action cards. The ranks in number cards are 0-9. There are 3 "action" cards in each color, labeled "skip"(S), "draw two"(D), and "reverse"(R). The functions of the actions will be described afterwards. For each color, there are two copies of each positive number card and action card, but only one zero card, producing 25 cards in total. Besides, there are also special black action cards called "wild cards", "wild"(WC) and "wild draw four"(WF). There are four "wild" and "wild draw four" cards each. Hence, there are 108 cards in total. In this problem, a card is marked with an ID of two characters length, the first is the color (R, G, B, Y, W) while the second is the rank (0-9, S, D, R, C, F). For example, the ID of red 2 is R2, the yellow reverse is YR, the wild cards are WC and WF. Supposed there are n players numbered from 1 to n clockwise. Before playing, players take turns(in the order of 1, 2, ... n) to pick seven successive cards from the stock. The top card of the remaining stock is exposed to start the game, treated as if player 1 dropped that card. The exposed card will never be WC or WF in this problem. Then the game begins clockwise (next player is 2), or counter-clockwise (next player is n) if the top exposed card is a reverse. At each turn, a player may drop a card from their hand that matches the color or rank of the top exposed card (e.g., if the top card is R3, you can drop R5 or G3; if the top card is RD, you can drop R3 or GD) or play a WC. What's more, if the player has a WF and no other legal cards to drop, he can drop the WF. Then the card dropped just now becomes the top exposed card. If a player has no legal cards, he must draw the top card of the stock and place it in his hand. After dropping a single card or drawing, the next player clockwise takes a turn, or counter-clockwise when the reverse is in effect. When a player drops down to only one card, that player is required to say "uno" to warn other players. The game ends when a player drops all his/her cards, or the stock is emptied but the current player has to draw a card. If the last card is an action card, the special effect still occurs. When the game ends, all players count the number of points pertaining to the values of the cards in their hands. Number cards worth the face value on them, colored special cards worth twenty, and wilds worth fifty, e.g., R2 worth 2, G0 worth 0, BD and YS worth 20, WC and WF worth 50. The descriptions of the action cards: Now here comes the problem. There are N people playing Uno under the rules mentioned above. Given the sequence of the 108 cards of the stock, you are asked to simulate a Uno game. At each turn, the player will always drop a card if permitted. If there are more than one choices, the player will drop the card with the largest point. If still a tie, he will choose the one whose ID is the smallest alphabetical order. When a player drops WC or WF, he has to name a color. The first time he will name red, the second time he will name green, the third time blue, the fourth time yellow, the fifth time red again, and so on. When the game ends, you should output the final score of each player, and we also want to know how many times each player calls "Uno". Input The first line of the input file contains a single number: the number of test cases to follow. Each test case has two lines: The first line contains the number of players N , with 2<=N<=10. The second line contains 108 IDs of the Uno cards, separated by one space. Each ID is two characters long as introduced in the description above. Output For each test case, output two lines: The first line are N integers, the ith integer is the final score of player i. The second lines are also N integers, the ith integer shows how many times player i calls "Uno". Sample Input 1 2 R9 RD RD RS RS RR RR B0 B1 B1 B2 B2 B3 B3 G0 GD GD GS GS GR GR G9 G9 G8 G8 G7 G7 G6 G6 G5 G5 G4 G4 G3 G3 G2 G2 G1 G1 Y0 Y9 Y9 Y8 Y8 Y7 Y7 Y6 Y6 Y5 Y5 Y4 Y4 Y3 Y3 Y2 Y2 Y1 Y1 YD YD YS YS YR YR R9 R8 R8 R7 R7 R6 R6 R5 R5 R4 R4 R3 R3 R2 R2 R1 R1 R0 B4 B4 B5 B5 B6 B6 B7 B7 B8 B8 B9 B9 BD BD BS BS BR BR WC WC WC WC WF WF WF WF Sample Output 249 0 0 1
Let's play UNO
Problem Description Uno is a famous card game played with a specially printed deck. It's very popular as a funny game in a party. A so-called "official rules" is presented at the Wikipedia, but there are a lot of different extended rules all over the world according to their specific needs. In this problem, you are required to obey our rules introduced below: The Uno deck consists of cards of 4 colors: red(R), green(G), blue(B), and yellow(Y). Each color has two kinds of cards, number cards and action cards. The ranks in number cards are 0-9. There are 3 "action" cards in each color, labeled "skip"(S), "draw two"(D), and "reverse"(R). The functions of the actions will be described afterwards. For each color, there are two copies of each positive number card and action card, but only one zero card, producing 25 cards in total. Besides, there are also special black action cards called "wild cards", "wild"(WC) and "wild draw four"(WF). There are four "wild" and "wild draw four" cards each. Hence, there are 108 cards in total. In this problem, a card is marked with an ID of two characters length, the first is the color (R, G, B, Y, W) while the second is the rank (0-9, S, D, R, C, F). For example, the ID of red 2 is R2, the yellow reverse is YR, the wild cards are WC and WF. Supposed there are n players numbered from 1 to n clockwise. Before playing, players take turns(in the order of 1, 2, ... n) to pick seven successive cards from the stock. The top card of the remaining stock is exposed to start the game, treated as if player 1 dropped that card. The exposed card will never be WC or WF in this problem. Then the game begins clockwise (next player is 2), or counter-clockwise (next player is n) if the top exposed card is a reverse. At each turn, a player may drop a card from their hand that matches the color or rank of the top exposed card (e.g., if the top card is R3, you can drop R5 or G3; if the top card is RD, you can drop R3 or GD) or play a WC. What's more, if the player has a WF and no other legal cards to drop, he can drop the WF. Then the card dropped just now becomes the top exposed card. If a player has no legal cards, he must draw the top card of the stock and place it in his hand. After dropping a single card or drawing, the next player clockwise takes a turn, or counter-clockwise when the reverse is in effect. When a player drops down to only one card, that player is required to say "uno" to warn other players. The game ends when a player drops all his/her cards, or the stock is emptied but the current player has to draw a card. If the last card is an action card, the special effect still occurs. When the game ends, all players count the number of points pertaining to the values of the cards in their hands. Number cards worth the face value on them, colored special cards worth twenty, and wilds worth fifty, e.g., R2 worth 2, G0 worth 0, BD and YS worth 20, WC and WF worth 50. The descriptions of the action cards: Now here comes the problem. There are N people playing Uno under the rules mentioned above. Given the sequence of the 108 cards of the stock, you are asked to simulate a Uno game. At each turn, the player will always drop a card if permitted. If there are more than one choices, the player will drop the card with the largest point. If still a tie, he will choose the one whose ID is the smallest alphabetical order. When a player drops WC or WF, he has to name a color. The first time he will name red, the second time he will name green, the third time blue, the fourth time yellow, the fifth time red again, and so on. When the game ends, you should output the final score of each player, and we also want to know how many times each player calls "Uno". Input The first line of the input file contains a single number: the number of test cases to follow. Each test case has two lines: The first line contains the number of players N , with 2<=N<=10. The second line contains 108 IDs of the Uno cards, separated by one space. Each ID is two characters long as introduced in the description above. Output For each test case, output two lines: The first line are N integers, the ith integer is the final score of player i. The second lines are also N integers, the ith integer shows how many times player i calls "Uno". Sample Input 1 2 R9 RD RD RS RS RR RR B0 B1 B1 B2 B2 B3 B3 G0 GD GD GS GS GR GR G9 G9 G8 G8 G7 G7 G6 G6 G5 G5 G4 G4 G3 G3 G2 G2 G1 G1 Y0 Y9 Y9 Y8 Y8 Y7 Y7 Y6 Y6 Y5 Y5 Y4 Y4 Y3 Y3 Y2 Y2 Y1 Y1 YD YD YS YS YR YR R9 R8 R8 R7 R7 R6 R6 R5 R5 R4 R4 R3 R3 R2 R2 R1 R1 R0 B4 B4 B5 B5 B6 B6 B7 B7 B8 B8 B9 B9 BD BD BS BS BR BR WC WC WC WC WF WF WF WF Sample Output 249 0 0 1 Hint The process of this game is: G0(exposed) -> B0(Player 2) -> Draw GD(Player 1) -> B3(Player 2) ->Draw GD(Player 1) -> B3(Player 2) -> Draw GS(Player 1) -> B2(Player 2) -> Draw GS(Player 1) -> B2(Player 2) -> Draw GR(Player 1) -> B1, call “Uno”(Player 2) -> Draw GR(Player 1) -> B1(Player 2), end. Score of player 1: 20*12(6 red action cards and 6 green action cards)+9(R9)
POST请求返回的错误,在下菜鸟求助大牛帮忙
![不知道我PHP和mysql哪里错了](https://img-ask.csdn.net/upload/201606/27/1466988753_372533.png) //一下是mysql代码: SET NAMES UTF8; DROP DATABASE IF EXISTS lblist; CREATE DATABASE lblist CHARSET=UTF8; USE lblist; CREATE TABLE lbuser( uno INT PRIMARY KEY, uname VARCHAR(32), passwd VARCHAR(32) ); INSERT INTO lbuser VALUES(1,'154494562','123456'); //下面是PHP <?php header('Content-Type: application/json'); $output = ['status'=>0, 'msg'=>'']; $uname = $_REQUEST['uname']; $passwd = $_REQUEST['upwd']; $conn = mysqli_connect('127.0.0.1','root','','lblist', 3306); $sql="SELECT uno FROM lbuse WHERE uname='$uname' AND passwd='$passwd"; $result = mysqli_query($conn, $sql); $row = mysqli_fetch_assoc($result); if($row){ $output['status'] = intval($row['uno']); //把字符串转化为整数 $output['msg'] = $uname; }else { $output['status'] = -404; $output['msg'] = '用户名或密码错误'; } echo json_encode($output); ?>
LinkIT One使用paho mqtt连接服务器失败
背景描述: 使用LinkIT One基于paho的mqtt客户端,当代码执行到rc=client.connect(data);,超时然后返回rc=-1。 测试连接的服务端包括IBM Watson、中移OneNet还有自己搭建的mosquitto,都是一样的错误。查了一下paho的实现代码,把MQTTClient.h中的connect实现改了一下就connect成功了,但subscribe又超时并返回错误了(如下所示)。 在网上查到了和我类似的错误,貌似LinkIT One并不能使用paho的mqtt。但将mqtt客户端换成pubsub后却能够正常工作。 下面是我的测试代码(mqtt服务器是本地局域网的mosquitto) ``` #include <LWiFi.h> #include <LWiFiClient.h> #include <IPStack.h> #include <Countdown.h> #include <MQTTClient.h> #define WIFI_AP "SSID" #define WIFI_PASSWORD "PASSWD" #define WIFI_AUTH LWIFI_WPA int port = 1883; char servername[]="10.214.149.119"; char clientName[] = "myaccount"; char topicName[] = "@tp"; char userName[] = "myaccount"; char password[] = "12345"; LWiFiClient tcpClient; IPStack ipstack(tcpClient); MQTT::Client<IPStack, Countdown, 200> client = MQTT::Client<IPStack, Countdown, 200>(ipstack); void messageArrived(MQTT::MessageData& md){ MQTT::Message &message = md.message; char res[100]; int len = message.payloadlen; strncpy(res, (char*)message.payload, len); res[len] = '\0'; Serial.println(res); } void setup(){ Serial.begin(9600); while(!Serial.available()); InitWiFi(); if (!client.isConnected()) reconnect(); int rc = client.subscribe(topicName, MQTT::QOS0, messageArrived); if (rc != 0) Serial.println(String("rc from MQTT subscribe is ")+rc); else Serial.println(String("rc from MQTT subscribe is ")+rc); } void loop(){ Serial.println("loop"); client.yield(100); delay(2000); } void InitWiFi(){ LWiFi.begin(); // Keep retrying until connected to AP Serial.println("Connecting to AP"); while (0 == LWiFi.connect(WIFI_AP, LWiFiLoginInfo(WIFI_AUTH, WIFI_PASSWORD))) { Serial.println("Retry connect AP ... "); delay(1000); } Serial.println("Connected to AP"); } void reconnect() { // Loop until we're reconnected if(!client.isConnected()) { int rc = ipstack.connect(servername, port); if (rc == 1){ Serial.println("IPStack Success"); }else{ Serial.println("IPStack Failed"); } Serial.print("Connecting to IOT platform ..."); MQTTPacket_connectData data = MQTTPacket_connectData_initializer; data.MQTTVersion = 4; data.clientID.cstring = clientName; data.username.cstring = userName; data.password.cstring = password; rc = client.connect(data); if (rc == 0) { Serial.println( "[DONE]" ); } else { Serial.println( "[FAILED]"); delay(5000); } } } ``` 我的问题是: 有没有大神使用LinkIT One基于paho的mqtt实现了客户端,可以正常pub/sub话题,测试的mqtt代理可以是mosquitto或IBM Watson或中移OneNet?允许修改paho或LWiFiClient的源码?(我只要基于paho的实现) 提示: 1.通过之前在Arduino UNO、BeagleBone Black、树莓派2的实验感觉各种mqtt的代理基本都一样的,能在mosquitto上测试通过的基本都能在IBM Watson或OneNet上测试通过; 2.LinkIt One用pubsub测试没有问题,这说明LWiFiClient很大概率是没问题的,估计要修改paho的实现代码
form表单发送请求路径问题
我的页面路径:WebRoot/page/userManage/userUpdate.jsp 我的action路径:工程名/src/com/action/userAction 我在userUpadate.jsp里的表单请求路径: <form id="userUpdateForm" method="post" action="../../userUpdateR.do?uno=${user.uno }&oldUname=${user.uname }"> </form> 用的注解编程的方式,可是一提交表单,页面就会显示404错误 错误路径显示_/userUpdateR.do 也就意味着请求没有发送成功 有大神知道form表单里的action路径 怎么写才能将请求发送出去吗
Arduino UNO WiFi开发板问题
现有Arduino UNO WiFi开发版,已经连上了Wi-Fi,但是写的程序却无法连接Wi-Fi,一直返回连接错误。 代码如下: #include <SPI.h> #include <WiFi.h> int pin = 8; //0~13 //wifi密码及ssid char ssid[] = "Abc"; char password[] = "12345678"; //目标服务器ip即端口号 const IPAddress server(192,168,0,103); const int tcpPort = 25000; int status = WL_IDLE_STATUS; WiFiClient client; //client端 void setup() { Serial.begin(9600); Serial.println("Attempting to connect to WPA network..."); Serial.print("SSID: "); Serial.println(ssid); int status = WiFi.begin(ssid, password); while(status != WL_CONNECTED) { Serial.println(WL_CONNECT_FAILED); } while(!client.connect(server, tcpPort)) { Serial.println("Couldn't connect server"); } } void loop() { client.println("1"); }
arduino已上传就出错,帮帮忙看看是哪里的问题吧
这个问题在网上很多地方都有人问,但是我对照了下都不符合自己的情况,请大家帮忙分析下吧,错误如下: Arduino:1.8.5 (Windows 7), 开发板:"Arduino/Genuino Uno" 项目使用了 1480 字节,占用了 (4%) 程序存储空间。最大为 32256 字节。 全局变量使用了202字节,(9%)的动态内存,余留1846字节局部变量。最大为2048字节。 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe7~~ 我所写的代码如下:编译显示是成功的,但是上传失败,也不涉及到其他模板 ``` void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println("上传成功 "); } void loop() { // put your main code here, to run repeatedly: } ``` 网上有关这个错误的解释主要有两个: 1.接口出现了错误。 2.arduino板子和IDE不一致。 我仔细检查发现,因为arduino只有一个和电脑连得线,很明显不会是接错线了,另一个问题,我的板子上写的是uno R3,我设定的是Arduino/Genuino Uno,这应该是对应的,唯一感觉不太对劲的是教程上写的串口是COM3。我连得是COM1,但是我在串口管理那里只找到了COM1.请问下回事这里的问题吗,如果是的话该怎么改。还有一个就是我尝试运行了好几次,但是发现resp=0xe7后面这个数发生了变化,这又是怎么回事,刚刚学习,很多问题都不明白,请指导下吧
用UNO驱动步进电机,用c++做上位机控制,下位机接收数据包有问题
各位大神看看,我用arduino驱动步进电机,上位机和下位机的程序,现在就是上位机发送数据包到下位机,下位机接收执行,text之后OK出现好多,应该每动一次返回一个OK才对,求指导 //下面是main.cpp #include <stdio.h> #include <tchar.h> #include "SerialClass.h" // Library described above #include <string> #include "package.h" #include <sstream> #include <string> // application reads from the specified serial port and reports the collected data int main(int argc, _TCHAR* argv[]) { printf("Welcome to the serial test app!\n\n"); Serial* SP = new Serial("COM3"); // adjust as needed if (SP->IsConnected()) printf("We're connected"); char incomingData[256] = ""; // don't forget to pre-allocate memory //printf("%s\n",incomingData); int dataLength = 255; int readResult = 0; for(int i=0;i<45;i++){ package a; trans(a, 90, 1); std::cout << a; /*std::stringstream ss; ss << a; char *outBuf; ss >> outBuf;*/ //SP->WriteData(outBuf,sizeof(outBuf)); //char *out = "123456"; SP->WriteData(a.toChar(),strlen(a.toChar())); /*readResult = */ /*printf("Bytes read: (0 means no data available) %i\n",readResult); package b(0, 0, 0, 2, 0); SP->WriteData(b.toChar(), strlen(b.toChar()));*/ //incomingData[readResult] = 0; while (!SP->ReadData(incomingData, dataLength)) { } Sleep(1500); std::cout << "test"; std::cout<<std::endl << incomingData; } //Sleep(500); return 0; } ``` //下面是package.cpp #include "package.h" #include <sstream> std::ostream & operator<<(std::ostream & os, const package & o) { std::cout << " a: " << o.a << " b: " << o.b << " c: " << o.c << " d: "<< o.d<<" direction: "<<o.direction; return os; // TODO: 在此处插入 return 语句 } char * package::toChar() { char *out1=new char[1]; itoa(a, out1, 10); char *out2 = new char[1]; itoa(b, out2, 10); char *out3 = new char[1]; itoa(c, out3, 10); char *out4 = new char[1]; itoa(d, out4, 10); char *out5 = new char[1]; itoa(direction, out5, 10); char *out = new char[strlen(out1) + strlen(out2) + strlen(out3) + strlen(out4) + strlen(out5) + 1]; strcpy(out, out1); strcat(out, out2); strcat(out, out3); strcat(out, out4); strcat(out, out5); return out; } void trans(package & output, int degree,bool direction) { int n = 360 / degree; output.a = n / 512; n =n % 512; output.b = n / 64; n =n % 64; output.c = n / 8; output.d = n % 8; output.direction = direction; } ``` //下面是serial.cpp #include "SerialClass.h" #include <string> Serial::Serial(std::string portName) { //We're not yet connected this->connected = false; //Try to connect to the given port throuh CreateFile this->hSerial = CreateFile(TEXT("COM3"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); //Check if the connection was successfull if (this->hSerial == INVALID_HANDLE_VALUE) { //If not success full display an Error if (GetLastError() == ERROR_FILE_NOT_FOUND) { //Print Error if neccessary printf("ERROR: Handle was not attached. Reason: %s not available.\n", portName); } else { printf("ERROR!!!"); } } else { //If connected we try to set the comm parameters DCB dcbSerialParams = { 0 }; //Try to get the current if (!GetCommState(this->hSerial, &dcbSerialParams)) { //If impossible, show an error printf("failed to get current serial parameters!"); } else { //Define serial connection parameters for the arduino board dcbSerialParams.BaudRate = CBR_9600; dcbSerialParams.ByteSize = 8; dcbSerialParams.StopBits = ONESTOPBIT; dcbSerialParams.Parity = NOPARITY; //Setting the DTR to Control_Enable ensures that the Arduino is properly //reset upon establishing a connection dcbSerialParams.fDtrControl = DTR_CONTROL_ENABLE; //Set the parameters and check for their proper application if (!SetCommState(hSerial, &dcbSerialParams)) { printf("ALERT: Could not set Serial Port parameters"); } else { //If everything went fine we're connected this->connected = true; //Flush any remaining characters in the buffers PurgeComm(this->hSerial, PURGE_RXCLEAR | PURGE_TXCLEAR); //We wait 2s as the arduino board will be reseting Sleep(ARDUINO_WAIT_TIME); } } } } Serial::~Serial() { //Check if we are connected before trying to disconnect if (this->connected) { //We're no longer connected this->connected = false; //Close the serial handler CloseHandle(this->hSerial); } } int Serial::ReadData(char *buffer, unsigned int nbChar) { //Number of bytes we'll have read DWORD bytesRead; //Number of bytes we'll really ask to read unsigned int toRead; //Use the ClearCommError function to get status info on the Serial port ClearCommError(this->hSerial, &this->errors, &this->status); //Check if there is something to read if (this->status.cbInQue>0) { //If there is we check if there is enough data to read the required number //of characters, if not we'll read only the available characters to prevent //locking of the application. if (this->status.cbInQue>nbChar) { toRead = nbChar; } else { toRead = this->status.cbInQue; } //Try to read the require number of chars, and return the number of read bytes on success if (ReadFile(this->hSerial, buffer, toRead, &bytesRead, NULL)) { return bytesRead; } } //If nothing has been read, or that an error was detected return 0 return 0; } bool Serial::WriteData(char *buffer, unsigned int nbChar) { DWORD bytesSend; //Try to write the buffer on the Serial port if (!WriteFile(this->hSerial, (void *)buffer, nbChar, &bytesSend, 0)) { //In case it don't work get comm error and return false ClearCommError(this->hSerial, &this->errors, &this->status); return false; } else return true; } bool Serial::IsConnected() { //Simply return the connection status return this->connected; } //下面是package.h #pragma once #include <iostream> class package { public: int a; int b; int c; int d; int direction; package(int a_=1, int b_=2, int c_=3,int d_=8,int direction_=1) : a(a_), b(b_), c(c_),d(d_) ,direction(direction_){} char *toChar(); friend std::ostream & operator<<(std::ostream & os, const package & o); }; std::ostream & operator<<(std::ostream & os, const package & o); void trans(package &, int,bool); //下面是SerialClass.h #ifndef SERIALCLASS_H_INCLUDED #define SERIALCLASS_H_INCLUDED #define ARDUINO_WAIT_TIME 2000 #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <string> class Serial { private: //Serial comm handler HANDLE hSerial; //Connection status bool connected; //Get various information about the connection COMSTAT status; //Keep track of last error DWORD errors; public: //Initialize Serial communication with the given COM port Serial(std::string portName); //Close the connection ~Serial(); //Read data in a buffer, if nbChar is greater than the //maximum number of bytes available, it will return only the //bytes available. The function return -1 when nothing could //be read, the number of bytes actually read. int ReadData(char *buffer, unsigned int nbChar); //Writes data from a buffer through the Serial connection //return true on success. bool WriteData(char *buffer, unsigned int nbChar); //Check if we are actually connected bool IsConnected(); }; #endif // SERIALCLASS_H_INCLUDED //下面是下位机Arduino中的程序 int x; int i=9; class package { public: int count=0; int a[5]; void push_back(int u){ a[count]=u; count++; } }; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(5,OUTPUT); // Step pinMode(4,OUTPUT); // Dir } void loop() { package a; while(true){ i=Serial.read(); if(i!=9){ a.push_back(i-48); i=9; } if (a.count==5){ break; } } int degree=a.a[0]*512+a.a[1]*64+a.a[2]*8+a.a[3]; int step=3200/degree; // put your main code here, to run repeatedly: if(a.a[4]==1){ digitalWrite(4,HIGH); // Set Dir high } else{ digitalWrite(4,LOW); } for(x = 0; x < step; x++) // Loop 3200 times { digitalWrite(5,HIGH); // Output high delayMicroseconds(400); digitalWrite(5,LOW); // Output low delayMicroseconds(400); } Serial.println("ok"); // pause one second delay(1000);
Arduino C编程中free()函数挂机
最近我在尝试写一个描述机器人比赛场地的代码时,在内存分配上遇到了挂机的问题。代码在Arduino提供的编译平台上全部通过,但是在实际运行时,往往无法跑完测试程序。经过测试发现代码在obstacle对象的构造函数中调用的segajouter(segment tmp)的free(void*ptr)函数中挂机。Arduino使用的是Uno 主题测试程序如下: #include "ensemble.h" #include "segment.h" #include "jonction.h" #include "obstacle.h" ensemble set,set2;//结点集合类对象 long x=10,y=45,g=3,h=0;//设置参数 void setup() { Serial.begin(115200); Serial.println(F("Please input a digit:")); } void loop() { //===================================================== //Teste de la classe obstacle障碍物类测试 jonction test; if(Serial.available()>0) { Serial.print(F("Free Ram: "));//显示可用内存 Serial.println(freeRam());//显示可用内存 Serial.read(); Serial.print(set2.length()); for(int i=0;i<4;i++) { test.set_point(x,y); test.set_g(g); test.set_h(h); x=y-x; y=g+x; g=x*g; h=g-y; set2.ajouter(test); Serial.print(F("Free Ram: ")); Serial.println(freeRam()); output(set2.jonc()[i]);//输出读取内容(可能有出入) //因为添加结点时已经对集合中元素依据f()的大小 //排序 } Serial.print(F("Free Ram:"));//显示可用内存 Serial.println(freeRam());//显示可用内存 obstacle obs(set2); Serial.print(F("Free Ram:"));//显示可用内存 Serial.println(freeRam());//显示可用内存 Serial.print(F("NumJonc:"));//输出结点数 Serial.println(obs.NumJonc()); Serial.print(F("NumEdge:"));//输出边数 Serial.println(obs.NumEdge()); set=obs.jonc(); Serial.println(F("Set2:")); for(int i=0;i<set2.length();i++)//查看set2对象记录的结点 output(set2.jonc()[i]); Serial.println(F("Set:"));//查看set对象记录的结点 for(int i=0;i<set.length();i++) output(set.jonc()[i]); set.vide();//清空set对象 Serial.print(F("Length de set:"));//查看set对象元素个数 Serial.println(set.length()); x=h;//重新设置测试值 y=g; g=y-x; h=g/2; for(int i=0;i<2;i++) { test.set_point(x,y); test.set_g(g); test.set_h(h); x=y-x; y=g+x; g=y%x; h=g*x; set.ajouter(test);//更新set集合 } Serial.println(F("Set:"));//查看set元素 for(int i=0;i<set.length();i++) output(set.jonc()[i]); obstacle ob(set);//创建障碍物对象 if(ob==obs)//检测重载算符== Serial.println(F("True")); else { Serial.println(F("False")); ob.reset(set2);//重置ob,使得ob与obs相同 if(ob==obs)//检测重载算符== Serial.println(F("True")); else Serial.println(F("Err")); } } } //功能函数 void output(jonction test1)//输出结点参数 { Serial.print(F("(x,y,F,G,H)")); Serial.print('('); Serial.print(test1.getx()); Serial.print(','); Serial.print(test1.gety()); Serial.print(','); Serial.print(test1.f()); Serial.print(','); Serial.print(test1.g()); Serial.print(','); Serial.print(test1.h()); Serial.println(')'); } long input()//读取输入 { long n=0; boolean flag=false; char ch; if(Serial.available()>0) { ch=Serial.read(); if(ch=='-') { flag=true; delay(2); ch=Serial.read(); } n=long(ch-'0'); delay(2); } while(Serial.available()>0) { ch=Serial.read(); if((ch-'0')<10&&(ch-'0')>=0) n=10*n+long(ch-'0'); else break; delay(2); } if(flag) n*=-1; return n; } int freeRam ()//检测可用内存 { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); } 类里头是这样定义的: #include "obstacle.h" #include "ensemble.h" #include "segment.h" #include "stdlib.h" #include "Arduino.h" int freeRam1 () { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); } void obstacle::segajouter(segment tmp) //Generer une liste de segment dynamiquement //n indique le nombre des éléments de *s { segment *ss; n+=1; Serial.print(F("Hello ")); ss=(segment*)malloc(sizeof(tmp)*n); if (ss == NULL) Serial.println(F("malloc failed!")); for(int i=0;i<n-1;i++) ss[i]=edge[i]; ss[n-1]=tmp; // s=(segment*)realloc(edge,n*sizeof(tmp)); Serial.print(F("brave ")); // if(s!=NULL) // edge=s; // edge[n-1]=tmp; free(edge); Serial.println(F("world!")); edge=ss; ss=NULL; } obstacle::obstacle(ensemble set) { vertex=set; Serial.print(F("Free Ram: ")); Serial.println(freeRam1()); N=set.length(); n=0; Serial.println(F("Loop")); for(int i=0;i<N-1;i++) for(int j=i+1;j<N;j++) { segment tmp(vertex.jonc()[i],vertex.jonc()[j]); segajouter(tmp); Serial.print(F("i=")); Serial.print(i); Serial.print(F(" j=")); Serial.println(j); Serial.print(F("Free Ram: ")); Serial.println(freeRam1()); } } int obstacle::NumJonc() { return N; } int obstacle::NumEdge() { return n; } void obstacle::reset(ensemble set) { vertex=set; free(edge); N=set.length(); n=0; for(int i=0;i<N-1;i++) for(int j=i+1;j<N;j++) { segment tmp(vertex.jonc()[i],vertex.jonc()[j]); segajouter(tmp); } } ensemble obstacle::jonc() { return vertex; } segment* obstacle::Edge() { return edge; } boolean obstacle::operator ==(obstacle ob) { if(ob.jonc().length()==vertex.length()&&ob.jonc().jonc()==vertex.jonc()) return true; return false; } 以下是第一次在单片机上跑程序的反馈(由于原注释是部分使用法语的,可能与前面的程序的显示内容有点出入): Veuillez entrer huit nombres en les séparant par ' ': Free Ram: 1737 0Free Ram: 1713 (x,y,F,G,H)(10,45,3,3,0) Free Ram: 1667 (x,y,F,G,H)(35,38,172,105,67) Free Ram: 1599 (x,y,F,G,H)(3,108,522,315,207) Free Ram: 1509 (x,y,F,G,H)(105,420,65730,33075,32655) Free Ram:1509 Free Ram: 1435 Loop Hello brave world! i=0 j=1 Free Ram: 1435 Hello brave world! i=0 j=2 Free Ram: 1435 Hello brave world! i=0 j=3 Free Ram: 1301 Hello brave world! i=1 j=2 Free Ram: 1123 Hello brave world! i=1 j=3 Free Ram: 901 Hello brave world! i=2 j=3 Free Ram: 901 Free Ram:975 NumJonc:4 NumEdge:6 Set2: (x,y,F,G,H)(10,45,3,3,0) (x,y,F,G,H)(35,38,172,105,67) (x,y,F,G,H)(3,108,522,315,207) (x,y,F,G,H)(105,420,65730,33075,32655) Set: (x,y,F,G,H)(10,45,3,3,0) (x,y,F,G,H)(35,38,172,105,67) (x,y,F,G,H)(3,108,522,315,207) (x,y,F,G,H)(105,420,65730,33075,32655) Length de set:0 Set: (x,y,F,G,H)(33390,66780,0,0,0) (x,y,F,G,H)(0,33390,115621,33390,16695) Free Ram: 901 Loop Hello brave world! i=0 j=1 Free Ram: 901 False Hello brave world! He
用Zxing读条形码,但是onActivityResult调用失败
条形码是一维的时候: public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void test(View view){ Intent intent = new Intent("com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_MODE", "1D_CODE_MODE"); startActivityForResult(intent, 0); } public void onActivityResult(int requestCode, int resultCode, Intent intent) { switch (requestCode) { case IntentIntegrator.REQUEST_CODE: if (resultCode == Activity.RESULT_OK) { IntentResult intentResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent); if (intentResult != null) { String contents = intentResult.getContents(); String format = intentResult.getFormatName(); TextView uno = (TextView) findViewById(R.id.textView1); uno.setText(contents); Toast.makeText(this, "Numero: " + contents, Toast.LENGTH_LONG).show(); Log.d("SEARCH_EAN", "OK, EAN: " + contents + ", FORMAT: " + format); } else { Log.e("SEARCH_EAN", "IntentResult je NULL!"); } } else if (resultCode == Activity.RESULT_CANCELED) { Log.e("SEARCH_EAN", "CANCEL"); } } } } 在工程中已经添加了IntentResult和IntentIntegrator。 点击按钮之后扫描器调用成功了,但是onActivityResult没调用,因为TextView没更新,Toast 也没出现。 不知道哪出错了?请各位高手帮忙
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
阿里P8数据架构师:顶级开发者都在用什么数据库?
其实从去年已经隐隐约约感觉到数据库的有变化,只是没有想到变得这么快。今年的一些事情实实在在地给了某些数据库重击,如果以前去某数据库还是喊喊,然后该用还用,今年从传统领域刮起的去某数据库的风,已经开始了,并且后面的乌云密布也看得见。 最近看一篇国外的开源产品提供厂商的一篇文字,主要是在询问了他的几百位客户后得出了下图中的2019年数据库的使用趋势。 从图中可以看出,MySQL以38.9...
面试官:关于Java性能优化,你有什么技巧
通过使用一些辅助性工具来找到程序中的瓶颈,然后就可以对瓶颈部分的代码进行优化。 一般有两种方案:即优化代码或更改设计方法。我们一般会选择后者,因为不去调用以下代码要比调用一些优化的代码更能提高程序的性能。而一个设计良好的程序能够精简代码,从而提高性能。 下面将提供一些在JAVA程序的设计和编码中,为了能够提高JAVA程序的性能,而经常采用的一些方法和技巧。 1.对象的生成和大小的调整。 J...
互联网公司分布式系统架构演进之路
介绍 分布式和集群的概念经常被搞混,现在一句话让你明白两者的区别。 分布式:一个业务拆分成多个子业务,部署在不同的服务器上 集群:同一个业务,部署在多个服务器上 例如:电商系统可以拆分成商品,订单,用户等子系统。这就是分布式,而为了应对并发,同时部署好几个用户系统,这就是集群 1 单应用架构 2 应用服务器和数据库服务器分离 单机负载越来越来,所以要将应用服务器和数据库服务器分离 3 应用服务...
【图解算法面试】记一次面试:说说游戏中的敏感词过滤是如何实现的?
版权声明:本文为苦逼的码农原创。未经同意禁止任何形式转载,特别是那些复制粘贴到别的平台的,否则,必定追究。欢迎大家多多转发,谢谢。 小秋今天去面试了,面试官问了一个与敏感词过滤算法相关的问题,然而小秋对敏感词过滤算法一点也没听说过。于是,有了下下事情的发生… 面试官开怼 面试官:玩过王者荣耀吧?了解过敏感词过滤吗?,例如在游戏里,如果我们发送“你在干嘛?麻痹演员啊你?”,由于“麻痹”是一个敏感词,...
程序员需要了解的硬核知识之汇编语言(一)
之前的系列文章从 CPU 和内存方面简单介绍了一下汇编语言,但是还没有系统的了解一下汇编语言,汇编语言作为第二代计算机语言,会用一些容易理解和记忆的字母,单词来代替一个特定的指令,作为高级编程语言的基础,有必要系统的了解一下汇编语言,那么本篇文章希望大家跟我一起来了解一下汇编语言。 汇编语言和本地代码 我们在之前的文章中探讨过,计算机 CPU 只能运行本地代码(机器语言)程序,用 C 语言等高级语...
OpenCV-Python 绘图功能 | 七
目标 学习使用OpenCV绘制不同的几何形状 您将学习以下功能:cv.line(),cv.circle(),cv.rectangle(),cv.ellipse(),cv.putText()等。 代码 在上述所有功能中,您将看到一些常见的参数,如下所示: img:您要绘制形状的图像 color:形状的颜色。对于BGR,将其作为元组传递,例如:(255,0,0)对于蓝色。对于灰度,只需传递...
GitHub 标星 1.6w+,我发现了一个宝藏项目,作为编程新手有福了!
大家好,我是 Rocky0429,一个最近老在 GitHub 上闲逛的蒟蒻… 特别惭愧的是,虽然我很早就知道 GitHub,但是学会逛 GitHub 的时间特别晚。当时一方面是因为菜,看着这种全是英文的东西难受,不知道该怎么去玩,另一方面是一直在搞 ACM,没有做一些工程类的项目,所以想当然的以为和 GitHub 也没什么关系(当然这种想法是错误的)。 后来自己花了一个星期看完了 Pyt...
Java知识体系最强总结(2020版)
更新于2019-12-15 10:38:00 本人从事Java开发已多年,平时有记录问题解决方案和总结知识点的习惯,整理了一些有关Java的知识体系,这不是最终版,会不定期的更新。也算是记录自己在从事编程工作的成长足迹,通过博客可以促进博主与阅读者的共同进步,结交更多志同道合的朋友。特此分享给大家,本人见识有限,写的博客难免有错误或者疏忽的地方,还望各位大佬指点,在此表示感激不尽。 文章目录...
计算机专业的书普遍都这么贵,你们都是怎么获取资源的?
介绍几个可以下载编程电子书籍的网站。 1.Github Github上编程书资源很多,你可以根据类型和语言去搜索。推荐几个热门的: free-programming-books-zh_CN:58K 星的GitHub,编程语言、WEB、函数、大数据、操作系统、在线课程、数据库相关书籍应有尽有,共有几百本。 Go语言高级编程:涵盖CGO,Go汇编语言,RPC实现,Protobuf插件实现,Web框架实...
卸载 x 雷某度!GitHub 标星 1.5w+,从此我只用这款全能高速下载工具!
作者 | Rocky0429 来源 | Python空间 大家好,我是 Rocky0429,一个喜欢在网上收集各种资源的蒟蒻… 网上资源眼花缭乱,下载的方式也同样千奇百怪,比如 BT 下载,磁力链接,网盘资源等等等等,下个资源可真不容易,不一样的方式要用不同的下载软件,因此某比较有名的 x 雷和某度网盘成了我经常使用的工具。 作为一个没有钱的穷鬼,某度网盘几十 kb 的下载速度让我...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Fiddler+夜神模拟器进行APP抓包
Fiddler+夜神模拟器进行APP抓包 作者:霞落满天 需求:对公司APP进行抓包获取详细的接口信息,这是现在开发必备的。 工具:Fiddler抓包,夜神模拟器 模拟手机 安装APP 1.下载Fiddler https://www.telerik.com/download/fiddler Fiddler正是在这里帮助您记录计算机和Internet之间传递的所有HTTP和HTTPS通信...
小白学 Python 爬虫(42):春节去哪里玩(系列终篇)
人生苦短,我用 Python 前文传送门: 小白学 Python 爬虫(1):开篇 小白学 Python 爬虫(2):前置准备(一)基本类库的安装 小白学 Python 爬虫(3):前置准备(二)Linux基础入门 小白学 Python 爬虫(4):前置准备(三)Docker基础入门 小白学 Python 爬虫(5):前置准备(四)数据库基础 小白学 Python 爬虫(6):前置准备(...
一文带你看清 HTTP 所有概念
上一篇文章我们大致讲解了一下 HTTP 的基本特征和使用,大家反响很不错,那么本篇文章我们就来深究一下 HTTP 的特性。我们接着上篇文章没有说完的 HTTP 标头继续来介绍(此篇文章会介绍所有标头的概念,但没有深入底层) HTTP 标头 先来回顾一下 HTTP1.1 标头都有哪几种 HTTP 1.1 的标头主要分为四种,通用标头、实体标头、请求标头、响应标头,现在我们来对这几种标头进行介绍 通用...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ...... ...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
[数据结构与算法] 排序算法之归并排序与基数排序
归并排序 归并排序(MERGE-SORT)是利用归并的思想实现的排序方法,该算法采用经典的分治(divide-and-conquer)策略(分治法将问题分(divide)成一些小的问题然后递归求解,而治(conquer)的阶段则将分的阶段得到的各答案"修补"在一起,即分而治之)。 基本思想 可以看到这种结构很像一棵完全二叉树,本文的归并排序我们采用递归去实现(也可采用迭代的方式去实现)。分阶段可以...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
史上最牛逼的 Eclipse 快捷键,提高开发效率!
如果你在使用IDEA,请参考博主另外的一篇idea快捷键的博客。
如何快速打好Java基础?
二哥,我是一名大学生,专业是电力工程,但想自学 Java,如何快速打好基础呢? 微信上 tison 向我提出了这个问题。我想我是有资格来回答的,从北京奥运会那年开始学 Java,到现在已经有 10 多个年头了,真的是从一名编程白痴一步步走到现在的。 我在各大技术网站上分享了不少 Java 方面的原创文章,不知道影响了多少初学者,反正文章的留言中经常能看到他们由衷的感谢。现在每天仍然有不少同学(...
相关热词 c#怎么获得线程名 c# usb 采集器 c# csv 读取 c# sort() c# 关闭io流 c# 响应函数 插入 c#面对对象的三大特性 c# 打印 等比缩放 c#弹出右键菜单 c#1如何搞成01
立即提问