pink时出现错误,求大神指导 20C

我使用以下流程对vcf文件进行格式转换
vcftools --vcf tmp.vcf --plink --out tmp(VCFtools v0.1.13)
plink --noweb --file tmp --make-bed --out tmp(PLINK v1.90b3y 64-bit )
在plink时出现了错误:
Note: --noweb has no effect since no web check is implemented yet.
32059 MB RAM detected; reserving 16029 MB for main workspace.

Error: Invalid chromosome code '27' on line 49849001 of .map file.
(This is disallowed for humans. Check if the problem is with your data, or if
you forgot to define a different chromosome set with e.g. --chr-set.).
这是哪里出了问题呢,我要如何处理呢,求大神指导。

2个回答

你试试在plink操作流程使用 --allow-extra-chr

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
代码能运行,但添加信息时显示错误,不知道哪错了,求大佬帮忙改正正确的?
import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; class Note implements Serializable{ public String name; public String address; public String telephone; public Note(){} } public class AddressListSystem extends JFrame{ JLabel title=new JLabel("我的通讯录管理"); JLabel name=new JLabel("姓名"); JLabel address=new JLabel("地址"); JLabel telephone=new JLabel("电话"); JTextField jtxtname=new JTextField(); JTextField jtxtaddr=new JTextField(); JTextField jtxttel=new JTextField(); Font font=new Font("TimersRoman",Font.BOLD,30); JButton jbtadd=new JButton("添加"); JButton jbtfind=new JButton("查找"); JButton jbtclear=new JButton("清空"); JButton jbtexit=new JButton("退出"); ArrayList al=new ArrayList(); AddressListSystem(String s){ super(s); Container cp=getContentPane(); cp.setBackground(Color.PINK); cp.setLayout(null); title.setFont(font); title.setForeground(Color.BLUE); title.setBounds(130,20,300,60); name.setBounds(50,150,75,25); address.setBounds(50,220,75,25); telephone.setBounds(50,310,75,25); jtxtname.setBounds(150,150,100,25); jtxtaddr.setBounds(150,220,100,25); jtxttel.setBounds(150,310,200,25); jbtadd.setBounds(50,400,75,25); jbtfind.setBounds(150,400,75,25); jbtclear.setBounds(250,400,75,25); jbtexit.setBounds(350,400,75,25); jbtadd.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ if(jtxtname.getText().equalsIgnoreCase("")){ JOptionPane.showMessageDialog(null,"无法添加名字为空的记录","错误提示",JOptionPane.INFORMATION_MESSAGE); jtxtname.setText(""); jtxtaddr.setText(""); jtxttel.setText(""); return; } Note note=new Note(); note.name=jtxtname.getText(); note.address=jtxtaddr.getText(); note.telephone=jtxttel.getText(); try{ ObjectInputStream in=new ObjectInputStream(new FileInputStream("note.dat")); al=(ArrayList)in.readObject(); in.close(); }catch(Exception ex){ System.out.println( "添加信息时文件输入有误哦"); } try{ ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("note.dat",true)); Note temp=new Note(); int i; for(i=0;i<al.size();i++){ temp=(Note)al.get(i); if(temp.name.equalsIgnoreCase(jtxtname.getText())) break; } if(!al.isEmpty()&&i!=al.size()){ JOptionPane.showMessageDialog(null,"已经存在此记录","错误提示",JOptionPane.INFORMATION_MESSAGE); } else{ al.add(note); out.writeObject(al); } out.close(); }catch(Exception ex){ System.out.println("添加信息时文件输出有误哦"); } jtxtname.setText(""); jtxtaddr.setText(""); jtxttel.setText(""); } }); jbtfind.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ try{ ObjectInputStream in=new ObjectInputStream(new FileInputStream("note.dat")); al=(ArrayList)in.readObject(); in.close(); }catch(Exception ex){ System.out.println("查询时文件打开有误哦"); } Note temp=new Note(); int i; for(i=0;i<al.size();i++){ temp=(Note)al.get(i); if(temp.name.equalsIgnoreCase(jtxtname.getText())) break; } if(!al.isEmpty()&&i!=al.size()){ jtxtaddr.setText(temp.address); jtxttel.setText(temp.telephone); } else{ jtxtname.setText(""); jtxtaddr.setText(""); jtxttel.setText(""); JOptionPane.showMessageDialog(null,"无此记录哦","温馨提示",JOptionPane.INFORMATION_MESSAGE); } } }); jbtclear.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ try{ ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("note.dat")); al.clear(); out.close(); }catch(Exception ex){ System.out.println("清除文件时有误哦"); } jtxtname.setText(""); jtxtaddr.setText(""); jtxttel.setText(""); } }); jbtexit.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ try{ System.exit(1); }catch(Exception ex){ System.out.println("退出系统时出错啦"); } } }); cp.add(title); cp.add(name); cp.add(address); cp.add(telephone); cp.add(jtxtname); cp.add(jtxtaddr); cp.add(jtxttel); cp.add(jbtadd); cp.add(jbtfind); cp.add(jbtclear); cp.add(jbtexit); } public static void main(String[] args) { AddressListSystem als=new AddressListSystem("我的通讯录管理系统"); als.addWindowListener(new WindowAdapter(){ @Override public void windowClosing(WindowEvent e){ System.exit(0); } }); als.setSize(500,550); als.setVisible(true); } }
Snooker Referee 裁判的问题
Problem Description Snooker is a cue sport that is played on a large baize-covered table with pockets in each of the four corners and in the middle of each of the long side cushions. It is played using a cue and snooker balls: one white cue ball, 15 red balls worth one point each, and six balls of different colors: yellow (2 points), green (3), brown (4), blue (5), pink (6) and black (7). A player (or team) wins a frame (individual game) of snooker by scoring more points than the opponent(s), using the cue ball to pot the red and colored balls. In this problem, your job is the referee of snooker. You should score both players, ask the correct player to play next, as well as place some of the balls back to the table if necessary. The rules of snooker needed for this problem are following. (We ignore some fouls about incorrectly hitting the cue ball here. We assume that the cue ball is never snookered after a foul, so free ball will never occur. We also assume that both players will make their best attempts to hit the ball on, so you do not need to declare a miss when they do not hit the ball on first.) At the beginning of each frame the balls are set up by the referee as illustrated above. This will be followed by a break-off shot, the white cue ball can be placed anywhere inside the D (it is called in-hand, which also happens when the cue ball is potted). Players take turns in visiting the table. A break is the number of points scored by a player in one single visit to the table. A player's turn and break end when he fails to pot a ball, when he does something against the rules of the game, which is called a foul, or when a frame has ended. The ball or balls that can be hit first by the white are called the ball(s) "on" for that particular stroke. The ball(s) "on" differ from shot to shot: a red ball, if potted, must be followed by a color, and so on until a break ends; if a red is not potted, any red ball remains the ball "on". Only a ball or balls "on" may be potted legally by a player. If a ball not "on" is potted, this is a foul. The game of snooker generally consists of two phases. The first phase is the situation in which there are still red balls on the table. In the first phase, at the beginning of a player's turn, the balls "on" are all remaining red balls. The player must therefore attempt to first hit and pot one or more red balls. For every red ball potted, the player will receive 1 point. When a red has been potted, it will stay off the table and the player can continue his break. If no red has been potted or a foul has been made, the other player will come into play. In case one or more red balls have been potted, the player can continue his break. This time one of the six colors (yellow, green, brown, blue, pink and black) is the ball "on". Only one of these can be the ball "on" and the rules of the game state that a player must nominate his desired color to the referee, although it is often clear which ball the striker is playing and it is not necessary to nominate. When the nominated color is potted, the player will be awarded the correct number of points (yellow, 2; green, 3; brown, 4; blue, 5; pink, 6; black, 7). The color is then taken out of the pocket by the referee and placed on its original spot. Because only one of the colors is the ball "on", it is a foul to first hit multiple colors at the same time, or pot more than one color. If a player fails to pot a ball "on", it being a red or nominated color, the other player will come into play and the balls "on" are always the reds, as long as there are still reds on the table. The alternation between red balls and colors ends when all reds have been potted and a color is potted after the last red, or a failed attempt to do so is made. Then the second phase begins. All six colors have to be potted in ascending order of their points value (yellow, green, brown, blue, pink, black). Each becomes the ball "on" in that order. During this phase, when potted, the colors stay down and are not replaced on the table, unless a foul is made when potting the color, in which case the color is respotted. When only the black is left, the first score or foul ends the frame, and the player who has scored most points has won it. However, if the score is tied after that, the black is respotted, the players draw lots for choice of playing, the next player plays from in-hand, and the next score or foul ends the frame. When a foul is made during a shot, the player's turn is ended and he will receive no points for the foul shot. The other player will receive penalty points. Colors illegally potted are respotted (while reds are not), and if the cue ball is potted, the next player will play from in-hand. Fouls concerned in this problem are: 。failing to hit any other ball with the cue ball 。first hitting a ball "not-on" with the cue ball 。potting a ball "not-on" 。potting the white (in-off) Penalty points are at least 4 points and at most 7 points. The number of penalty points is the value of the ball "on", or any of the "foul" balls, whichever is highest. When more than one foul is made, the penalty is not the added total - only the most highly valued foul is counted. As players usually do not nominate a color explicitly when hitting the colors, please be tolerant and assume that he always nominate the ball with the lowest score when it cannot be deduced from the ball first hit (i.e. when the cue ball does not hit any ball or hit a red first). If a player commits a foul, and his opponent considers that the position left is unattractive, he may request that the offender play again from the resulting position. Input The input file contains multiple test cases. The first line of the input file is a single integer T (T ≤ 200), the number of test cases. For each test case (frame), the first line contains the names of the two players separated by a whitespace. The first player will take the break-off shot. Each name is made up of no more than 20 English letters, and the two names are different. After that, the input mainly consists of lines that describe a stroke each (with two exceptions stated later). A stroke is described by the color of the ball first hit by the cue ball (or "None" if the cue ball does not hit any ball), followed by zero or more colors of the balls potted, all separated by whitespaces. For example, a line "Red Red White Red" means the cue ball first hit a red ball, and 2 reds are potted as well as the cue ball itself; and a line "None" means the cue ball does not hit any ball thus no ball is potted. You can assume that all strokes are legal according to the balls remain on the table, and the cue ball will not hit two or more ball first simultaneously. A line "Play again" may appear if and only if the last stroke is a foul. It means the other player request that the offender play again from the resulting position. If a score or foul occurs when only the black is left, and the score is tied after that, a line with either player's name will follow. That means the player will play next as a result of the lot. The case end when the frame ends. There is a blank line before every test case. Output For each frame, print a line in the format "Frame K" first, where K is the index of this case starts from 1. Then use the output to indicate the referee's behaviors: 。When a frame begins, print a line in the format "PlayerName's turn, in-hand", where PlayerName is the name of the player who take the break-off shot. 。After each stroke, print a line "Foul!" first if it is a foul. Then print a line with current score in the format "ScoreA : ScoreB", where ScoreA is the score of the player who take the break-off shot, and ScoreB is the other player's score. After that, if the frame continue fairly (i.e. not only black is left before the stroke, or it is not a score or foul when only black is left), and some ball(s) should be respotted. Print a line with the word "Respot" following by the color(s) of the ball(s), all separated by whitespace. If more than one ball should be respotted, print their colors in ascending order of their values. Do not print anything if no ball needed to be respotted. At last (when the frame continue fairly and any necessary ball has been respotted), if the last player's break ends, print a line in the format "PlayerName's turn" to ask the other player to play next, where PlayerName is the next player's name. If the next player should play from in-hand, print "PlayerName's turn, in-hand" instead. 。After a foul, if the other player request that the offender play again, just print a line "PlayerName's turn" or "PlayerName's turn, in-hand" according to whether the cue ball is in-hand, where PlayerName is the offender's name. Note that the requester is actually requesting in his turn, after you asked him to play next. 。If a score or foul occurs when only the black is left, and the score is tied after that, print a line "Tie" after the score. Then print two lines "Respot Black" and "PlayerName's turn, in-hand" to respot the black and play from in-hand, where PlayerName is the next player's name (determined by the lot). 。When the frame ends, print a line "PlayerName wins" after the score, where PlayerName is the winner's name. Print a blank line between every two successive cases. Sample Input 1 Zero Maxbreak Red White Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Sample Output Frame 1 Zero's turn, in-hand Foul! 0 : 4 Maxbreak's turn, in-hand 0 : 5 0 : 12 Respot Black 0 : 13 0 : 20 Respot Black 0 : 21 0 : 28 Respot Black 0 : 29 0 : 36 Respot Black 0 : 37 0 : 44 Respot Black 0 : 45 0 : 52 Respot Black 0 : 53 0 : 60 Respot Black 0 : 61 0 : 68
Mod Tree 的具体的实现方法
Problem Description The picture indicates a tree, every node has 2 children. The depth of the nodes whose color is blue is 3; the depth of the node whose color is pink is 0. Now out problem is so easy, give you a tree that every nodes have K children, you are expected to calculate the minimize depth D so that the number of nodes whose depth is D equals to N after mod P. Input The input consists of several test cases. Every cases have only three integers indicating K, P, N. (1<=K, P, N<=10^9) Output The minimize D. If you can’t find such D, just output “Orz,I can’t find D!” Sample Input 3 78992 453 4 1314520 65536 5 1234 67 Sample Output Orz,I can’t find D! 8 20
Mod Tree 树的问题
Problem Description The picture indicates a tree, every node has 2 children. The depth of the nodes whose color is blue is 3; the depth of the node whose color is pink is 0. Now out problem is so easy, give you a tree that every nodes have K children, you are expected to calculate the minimize depth D so that the number of nodes whose depth is D equals to N after mod P. Input The input consists of several test cases. Every cases have only three integers indicating K, P, N. (1<=K, P, N<=10^9) Output The minimize D. If you can’t find such D, just output “Orz,I can’t find D!” Sample Input 3 78992 453 4 1314520 65536 5 1234 67 Sample Output Orz,I can’t find D! 8 20
利用 javascript 无法获取html 中 input 的 value 值
``` html <form> <input class="mdui-textfield-input" id="U-psd" type="password" required/> <button class="mdui-btn mdui-btn-raised mdui-color-pink mdui-ripple" type="submit" onclick="logon()">登陆</button> <form> ``` 在 js 中: ``` javascript const userPassword = document.getElementById("U-psd"); function login() { let loginUser = new User(userEmail.value, userPassword.value); console.log(userEmail.value); } ``` 在 chrome 中设置的断点,命中时报空字符串错误。 > checkForm.js:32 Uncaught TypeError: Cannot read property 'value' of null 求大佬指导。
Snooker Referee 比赛裁判的算法
Problem Description Snooker is a cue sport that is played on a large baize-covered table with pockets in each of the four corners and in the middle of each of the long side cushions. It is played using a cue and snooker balls: one white cue ball, 15 red balls worth one point each, and six balls of different colors: yellow (2 points), green (3), brown (4), blue (5), pink (6) and black (7). A player (or team) wins a frame (individual game) of snooker by scoring more points than the opponent(s), using the cue ball to pot the red and colored balls. In this problem, your job is the referee of snooker. You should score both players, ask the correct player to play next, as well as place some of the balls back to the table if necessary. The rules of snooker needed for this problem are following. (We ignore some fouls about incorrectly hitting the cue ball here. We assume that the cue ball is never snookered after a foul, so free ball will never occur. We also assume that both players will make their best attempts to hit the ball on, so you do not need to declare a miss when they do not hit the ball on first.) At the beginning of each frame the balls are set up by the referee as illustrated above. This will be followed by a break-off shot, the white cue ball can be placed anywhere inside the D (it is called in-hand, which also happens when the cue ball is potted). Players take turns in visiting the table. A break is the number of points scored by a player in one single visit to the table. A player's turn and break end when he fails to pot a ball, when he does something against the rules of the game, which is called a foul, or when a frame has ended. The ball or balls that can be hit first by the white are called the ball(s) "on" for that particular stroke. The ball(s) "on" differ from shot to shot: a red ball, if potted, must be followed by a color, and so on until a break ends; if a red is not potted, any red ball remains the ball "on". Only a ball or balls "on" may be potted legally by a player. If a ball not "on" is potted, this is a foul. The game of snooker generally consists of two phases. The first phase is the situation in which there are still red balls on the table. In the first phase, at the beginning of a player's turn, the balls "on" are all remaining red balls. The player must therefore attempt to first hit and pot one or more red balls. For every red ball potted, the player will receive 1 point. When a red has been potted, it will stay off the table and the player can continue his break. If no red has been potted or a foul has been made, the other player will come into play. In case one or more red balls have been potted, the player can continue his break. This time one of the six colors (yellow, green, brown, blue, pink and black) is the ball "on". Only one of these can be the ball "on" and the rules of the game state that a player must nominate his desired color to the referee, although it is often clear which ball the striker is playing and it is not necessary to nominate. When the nominated color is potted, the player will be awarded the correct number of points (yellow, 2; green, 3; brown, 4; blue, 5; pink, 6; black, 7). The color is then taken out of the pocket by the referee and placed on its original spot. Because only one of the colors is the ball "on", it is a foul to first hit multiple colors at the same time, or pot more than one color. If a player fails to pot a ball "on", it being a red or nominated color, the other player will come into play and the balls "on" are always the reds, as long as there are still reds on the table. The alternation between red balls and colors ends when all reds have been potted and a color is potted after the last red, or a failed attempt to do so is made. Then the second phase begins. All six colors have to be potted in ascending order of their points value (yellow, green, brown, blue, pink, black). Each becomes the ball "on" in that order. During this phase, when potted, the colors stay down and are not replaced on the table, unless a foul is made when potting the color, in which case the color is respotted. When only the black is left, the first score or foul ends the frame, and the player who has scored most points has won it. However, if the score is tied after that, the black is respotted, the players draw lots for choice of playing, the next player plays from in-hand, and the next score or foul ends the frame. When a foul is made during a shot, the player's turn is ended and he will receive no points for the foul shot. The other player will receive penalty points. Colors illegally potted are respotted (while reds are not), and if the cue ball is potted, the next player will play from in-hand. Fouls concerned in this problem are: 。failing to hit any other ball with the cue ball 。first hitting a ball "not-on" with the cue ball 。potting a ball "not-on" 。potting the white (in-off) Penalty points are at least 4 points and at most 7 points. The number of penalty points is the value of the ball "on", or any of the "foul" balls, whichever is highest. When more than one foul is made, the penalty is not the added total - only the most highly valued foul is counted. As players usually do not nominate a color explicitly when hitting the colors, please be tolerant and assume that he always nominate the ball with the lowest score when it cannot be deduced from the ball first hit (i.e. when the cue ball does not hit any ball or hit a red first). If a player commits a foul, and his opponent considers that the position left is unattractive, he may request that the offender play again from the resulting position. Input The input file contains multiple test cases. The first line of the input file is a single integer T (T ≤ 200), the number of test cases. For each test case (frame), the first line contains the names of the two players separated by a whitespace. The first player will take the break-off shot. Each name is made up of no more than 20 English letters, and the two names are different. After that, the input mainly consists of lines that describe a stroke each (with two exceptions stated later). A stroke is described by the color of the ball first hit by the cue ball (or "None" if the cue ball does not hit any ball), followed by zero or more colors of the balls potted, all separated by whitespaces. For example, a line "Red Red White Red" means the cue ball first hit a red ball, and 2 reds are potted as well as the cue ball itself; and a line "None" means the cue ball does not hit any ball thus no ball is potted. You can assume that all strokes are legal according to the balls remain on the table, and the cue ball will not hit two or more ball first simultaneously. A line "Play again" may appear if and only if the last stroke is a foul. It means the other player request that the offender play again from the resulting position. If a score or foul occurs when only the black is left, and the score is tied after that, a line with either player's name will follow. That means the player will play next as a result of the lot. The case end when the frame ends. There is a blank line before every test case. Output For each frame, print a line in the format "Frame K" first, where K is the index of this case starts from 1. Then use the output to indicate the referee's behaviors: 。When a frame begins, print a line in the format "PlayerName's turn, in-hand", where PlayerName is the name of the player who take the break-off shot. 。After each stroke, print a line "Foul!" first if it is a foul. Then print a line with current score in the format "ScoreA : ScoreB", where ScoreA is the score of the player who take the break-off shot, and ScoreB is the other player's score. After that, if the frame continue fairly (i.e. not only black is left before the stroke, or it is not a score or foul when only black is left), and some ball(s) should be respotted. Print a line with the word "Respot" following by the color(s) of the ball(s), all separated by whitespace. If more than one ball should be respotted, print their colors in ascending order of their values. Do not print anything if no ball needed to be respotted. At last (when the frame continue fairly and any necessary ball has been respotted), if the last player's break ends, print a line in the format "PlayerName's turn" to ask the other player to play next, where PlayerName is the next player's name. If the next player should play from in-hand, print "PlayerName's turn, in-hand" instead. 。After a foul, if the other player request that the offender play again, just print a line "PlayerName's turn" or "PlayerName's turn, in-hand" according to whether the cue ball is in-hand, where PlayerName is the offender's name. Note that the requester is actually requesting in his turn, after you asked him to play next. 。If a score or foul occurs when only the black is left, and the score is tied after that, print a line "Tie" after the score. Then print two lines "Respot Black" and "PlayerName's turn, in-hand" to respot the black and play from in-hand, where PlayerName is the next player's name (determined by the lot). 。When the frame ends, print a line "PlayerName wins" after the score, where PlayerName is the winner's name. Print a blank line between every two successive cases. Sample Input 1 Zero Maxbreak Red White Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Sample Output Frame 1 Zero's turn, in-hand Foul! 0 : 4 Maxbreak's turn, in-hand 0 : 5 0 : 12 Respot Black 0 : 13 0 : 20 Respot Black 0 : 21 0 : 28 Respot Black 0 : 29 0 : 36 Respot Black 0 : 37 0 : 44 Respot Black 0 : 45 0 : 52 Respot Black 0 : 53 0 : 60 Respot Black 0 : 61 0 : 68
Let the Balloon Rise II 是怎么来实现的
Problem Description Contest will be end at 17:00! How excited it is to see balloons floating around. I knew you had solved the HDOJ 1004 Let the Balloon Rise already, so please settle the another version quickly. I have a lot of balloons and each has a color and I give each of them a number, same color has the same number. For example, red balloon is No.1, pink is No.2, black is No.3 . etc. I also have many rooms to store all the balloons. There are some rules : 1. Every room stores several balloons but no two have the same color. 2. Collect all the balloons, we can find each color has even number of times of balloons except one. Your task is to find which is the odd color and calculate its number of times. Input Input file consists from multiple data sets separated by one or more empty lines. Each data set represents a sequence of 32-bit (positive) integers (references) which are stored in compressed way. Each line of input set consists from three single space separated 32-bit (positive) integers X Y Z and they represent following sequence of No.X, X+Z, X+2*Z, X+3*Z, …, X+K*Z, …(while (X+K*Z)<=Y). This line represents that in this room there exists (K+1) balloons whose No. is No.X, No.X+Z, No.X+2*Z, No.X+3*Z, …, No.X+K*Z, …etc. Output For each input data set you should print to standard output new line of text with two integers separated by single space (first one is No. that occurs odd number of times and second one is count of that kind of balloon). If all have even number of times output “None.” Sample Input 1 10 1 1 10 1 1 5 1 6 10 1 1 10 1 4 4 1 1 5 1 2 5 1 2 5 1 2 5 1 Sample Output None. 4 3 1 1
Counting Problem 技术问题
Problem Description See the 2 X 2 board above. AekdyCoin gets a N X N chessboard recently. But he think the color of the chessman is too dull (Only White and Black!).So AekdyCoin buys different kind of chessmen with different color, say blue, pink, yellow …Now AekdyCoin buys K kind of chessmen with different color, and the number of each kind is exactly Ai. Now AekdyCoin begins to play with these chessmen. He wants to put all the chessmen he bought on the board, and of course every grid could only contain one single chessman.The Figure 2 shows a valid situation ,in this figure, AekdyCoin bought two kind of chessmen and the number of each is one. As we know, AekdyCoin is very clever. So he think about this question:What is the number of ways he could put all chessmen he bought on the N X N board? After a several seconds , AekdyCoin gets a perfect idea about how to solve this problem. What about you? Two situation are regard the same in Figure 3, but the different in Figure 4. But the ways that you can get by flip or circumrotate is not regard as the same! Input The input consists of several test cases, but no more than 20. There are two integers N, M in the first line of each case indicate the size of the board and M. You should output the remainder of answer after divided by M. (1<=N <=5000, 1<=M<=2*10^9) The next line contain only one integer K indicates the kind of the chessmen AekdyCoin bought. (1<=k<=100) Then the next line has exactly K integer where the i-th integer Ai indicate the number of the i-th kind of chessmen AekdyCoin bought.(1<=Ai<=5000) Output Output a single line indicates the reaminder of answer after divided by M. Sample Input 2 100 1 1 2 100 1 2 Sample Output 4 6
Java题目,求大神帮忙看看怎么修改,一直有两处错误?
package tf1703; import java.awt.Color; import java.awt.Graphics; //import Tank.Direction; public class Tank { public int x,y,w,h; Enum Direction{L,LU,U,RU,R,RD,D,LD,STOP}; public Direction dir=Direction.U; public Tank(int x,int y,int w,int h,Direction dir) { this.x=x; this.y=y; this.w=w; this.h=h; this.dir=dir; } public void draw(Graphics g) { g.setColor(Color.green); g.fillOval(x,y,w,h); switch(this.dir) { case U: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x+w/2, y-10); break; case LU: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x, y); break; case L: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x-10, y+h/2); break; case LD: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x, y+h); break; case D: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x+w/2, y+h+10); break; case RD: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x+w, y+h); break; case R: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x+w+10, y+h/2); break; case RU: g.setColor(Color.black); g.drawLine(x+w/2, y+h/2, x+w, y); break; } } } package tf1703; import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import tf1703.Tank.Direction; public class TFrame extends Frame{ public int frameX=100; public int frameY=100; public int frameH=800; public int frameW=1200; public Tank myTank=null; public TFrame() { this.setBounds(frameX,frameY,frameW,frameH); this.setBackground(Color.pink); this.myTank=new Tank(200,200,100,100,Tank.Direction.RU); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(-1); } }); this.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if(e.getKeyCode()==KeyEvent.VK_A) { System.out.println("你按了A"); myTank.dir=Direction.L; myTank.x=myTank.x-10; }else if(e.getKeyCode()==KeyEvent.VK_S) { System.out.println("你按了S"); myTank.dir=Direction.D; myTank.y=myTank.y+10; } else if(e.getKeyCode()==KeyEvent.VK_D) { System.out.println("你按了D"); myTank.dir=Direction.R; myTank.x=myTank.x+10; } else if(e.getKeyCode()==KeyEvent.VK_W) { System.out.println("你按了W"); myTank.dir=Direction.U; myTank.y=myTank.y-10; } repaint(); } }); this.setVisible(true); } public void paint(Graphics g) { this.myTank.draw(g); } public static void main(String[] args) { new TFrame(); } } Exception in thread "main" java.lang.Error: Unresolved compilation problems: The import tf1703.Tank.Direction cannot be resolved Cannot make a static reference to the non-static field Tank.Direction Direction cannot be resolved to a type Direction cannot be resolved to a variable Direction cannot be resolved to a type Direction cannot be resolved to a variable Direction cannot be resolved to a type Direction cannot be resolved to a variable Direction cannot be resolved to a type Direction cannot be resolved to a variable at tf1703.TFrame.<init>(TFrame.java:9) at tf1703.TFrame.main(TFrame.java:86)
Greed is good 代码的编程实现
Problem Description As we all know Uncle CTW is a very greedy uncle,he likes collecting jewels.One day he gets a necklace with beautiful gems,he has a strange habit,that he only collects the contiguous gems with with same color.That means if he pick a red gem at first,and he will continue to pick only if the next gem is red,or he will stop.(That's why people call him "Uncle.Strange"). As it is a necklace,he must find somewhere to cut the necklace at the very begining,then select an end to pick until meet a different color gem,and do the same for the other end (which might not be of the same color as the gems collected before this). There are only three kinds of gems,red('r'),pink('p'),and white('w'),and NOTICE that,because the white one could be painted,so it can be seen as either color.(See the sample for detail.) Now he just want to know the maximum number of gems he can collect,could you tell him? Input The first line contain an integer T,then T lines,each line with a string only contain r,p or w ,with length no more than 400. Output One integer per line indicating the maximum nunber. Sample Input 1 wwwpprwrprprrprprwrwwrpwrwrrp Sample Output 11
一个用java写的计算器求大神跟我 说说怎么实现除数不能为零 我弄的不对 好难过
public class Calculator { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub MyFrame1 myFrame=new MyFrame1(); } } class MyFrame1 extends JFrame{ public MyFrame1(){ setTitle("Calculator");//设置标题 setLocation(500, 300); //setSize(800, 600); Mypanel mypanel=new Mypanel(); add(mypanel); addWindowListener(new WindowAdapter(){@Override public void windowClosing(WindowEvent e) { // TODO Auto-generated method stub System.exit(0); } }); pack(); setVisible(true);//设置可见 } } class Mypanel extends JPanel{//计算器面板 private static final ActionListener CE_Action = null; JPanel panel_btn; JTextField textField; private String lastcommand;//记录最后一个运算符 private String result;//记录运算的操作数 private boolean start;//记录是否点击了运算符 private boolean flag1;//记录是否重复点击了运算符 private boolean point;//记录是否重复点击了小数点 private boolean operateValidFlag = true; //操作是否合法 private float resultNum = 0;// 中间数是零 private JTextField resultText = new JTextField("0");//计算结果文本框 public Mypanel(){ start=false; result= "0"; flag1=true; point=true; lastcommand ="="; setLayout(new BorderLayout());//四周型布局 textField=new JTextField();//文本框 textField.setHorizontalAlignment(JTextField.RIGHT);//右显示文本 textField.setEditable(false);//文本框不可编辑 add(textField,BorderLayout.NORTH); panel_btn=new JPanel(); //重新定义一个panel 用作按钮的面板 panel_btn.setLayout(new GridLayout(5, 4)); InsertAction insertAction=new InsertAction();//创建数字点击时事件的一个对象 CommandAction commandAction=new CommandAction();//创建运算符点击事件的一个对象 C_Action cAction =new C_Action(); CE_Action ceaAction = new CE_Action(); Back_Action back_Action = new Back_Action(); PressBPN pressBPN = new PressBPN(); addButton("←",back_Action); addButton("CE",ceaAction); addButton("C",cAction); addButton("±",pressBPN); addButton("7",insertAction); addButton("8",insertAction); addButton("9",insertAction); addButton("/",commandAction); addButton("4",insertAction); addButton("5",insertAction); addButton("6",insertAction); addButton("*",commandAction); addButton("1",insertAction); addButton("2",insertAction); addButton("3",insertAction); addButton("-",commandAction); addButton("0",insertAction); addButton(".",insertAction); addButton("=",commandAction); addButton("+",commandAction); add(panel_btn,BorderLayout.CENTER);//按钮面板添加到中间 } private void addButton(String label,ActionListener listener){ //添加计算器按钮到计算器面板上 JButton btn=new JButton(label); btn.addActionListener(listener);//注册事件 panel_btn.add(btn); btn.setForeground(Color.PINK); } private class InsertAction implements ActionListener{// 实现点击计算器键盘按钮的值 @Override public void actionPerformed(ActionEvent e) { if (start){ textField.setText(""); start=(false); } flag1=true; String s=e.getActionCommand();//获取按钮的文本 //textField.setText(textField.getText()+s); if((s.equals("."))&&(textField.getText().indexOf(".")<0)){ textField.setText(textField.getText()+"."); } else if(!s.equals(".")) textField.setText(textField.getText()+s); } } private class CommandAction implements ActionListener{//运算符的点击事件 @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub calute(Float.parseFloat(textField.getText())); lastcommand=e.getActionCommand();//获取运算的符号 result=textField.getText();//获取按钮的内容 //pointAction(textField.getText()); //String xString=e.getActionCommand(); //float a1=Float.parseFloat(result);//第一个操作数 //float a2=Float.parseFloat(textField.getText()); if (lastcommand.equals("/")) { // 除法运算 // 如果除号后面的值是0 if( getNumberFromText()==0){ // 操作不合法 System.out.println("111"); //operateValidFlag=false; textField.setText("除数不能为零"); } else { resultNum /= getNumberFromText(); } } start=true; } } private void calute (Float f){ resultNum = Float.parseFloat(result); ///float a1=Float.parseFloat(result);//第一个操作数 float a3=resultNum;//最终结果 if(flag1){ if(lastcommand.equals("+")) a3=resultNum+f; else if(lastcommand.equals("-")) a3=resultNum-f; else if(lastcommand.equals("*")) a3=resultNum*f; else if(lastcommand.equals("/")) a3=resultNum/f; else if(lastcommand.equals("=")) a3=f; flag1=false; } if(Math.floor(a3)==a3){ textField.setText((int)a3+"");} else { textField.setText(a3+""); } start=true; } private class C_Action implements ActionListener{ @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub start=false; result= "0"; flag1=true; lastcommand ="="; textField.setText(""); } } private class CE_Action implements ActionListener{ @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub textField.setText(""); } } private class Back_Action implements ActionListener{ @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub String s1 = textField.getText(); String s2 = s1.substring(0,s1.length()-1); textField.setText(s2); } } private float getNumberFromText() { // 获取当前文本框内的数值 float result = 0; try { result = Float.valueOf(resultText.getText()).floatValue(); } catch (NumberFormatException e) { } return result; } class PressBPN implements ActionListener { //正负号的实现 public void actionPerformed(ActionEvent e) { String text = textField.getText(); if (text != "") { if(text.charAt(0)=='-') textField.setText(text.substring(1)); else if(text.charAt(0) >= '0' && text.charAt(0) <= '9') textField.setText("-"+text.substring(0)); else if(text.charAt(0) == '.') textField.setText("-0"+text.substring(0)); } start=true; } } private class EqualsAction implements ActionListener{//等号运算的点击事件 public void actionPerformed (ActionEvent e){ } } }
为什么我做的登录页面的验证码,第一次总是加载不出来,要点击刷新才行?
![图片说明](https://img-ask.csdn.net/upload/201912/16/1576481218_121713.png) ![图片说明](https://img-ask.csdn.net/upload/201912/16/1576481226_828744.png) ![图片说明](https://img-ask.csdn.net/upload/201912/16/1576481234_406433.png) ++++++++++++++++++++++++++++++++++++++++++++++ <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Title</title> </head> <body> <script> <%-- 当窗口加载完毕 --%> window.onload = function (ev) { document.getElementById("img").onclick = function (ev1) { this.src = "./checkCodeServlet?time="+new Date().getTime(); } } </script> <form action="./loginServlet"> <table> <tr> <td>账号</td> <td><input type="text" name="username"></td> </tr> <tr> <td>密码</td> <td><input type="password" name="password"></td> </tr> <tr> <td>验证码</td> <td><input type="text" name="checkCode"></td> </tr> <tr> <td colspan="2"><img id="img" src="com.test.pro.CheckCodeServlet"></td> </tr> <tr> <td>提交</td> <td colspan="2"><input type="submit" value="登录"></td> </tr> <tr> <td></td> <td></td> </tr> </table> </form> <div><%=request.getAttribute("cc_error") == null ? "" : request.getAttribute("cc_error") %></div> <div><%=request.getAttribute("login_error") == null ? "" : request.getAttribute("login_error")%></div> </body> </html> ++++++++++++++++++++++++++++++++++++++++++++++ @WebServlet("/checkCodeServlet") public class CheckCodeServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int width = 100; int height = 50; //1.创建一对象,在内存中图片(验证码图片对象) BufferedImage image = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); //2.美化图片 //2.1 填充背景色 Graphics g = image.getGraphics();//画笔对象 g.setColor(Color.PINK);//设置画笔颜色 g.fillRect(0,0,width,height); //2.2画边框 g.setColor(Color.BLUE); g.drawRect(0,0,width - 1,height - 1); String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz0123456789"; //生成随机角标 Random ran = new Random(); StringBuilder sb = new StringBuilder(); for (int i = 1; i <= 4; i++) { int index = ran.nextInt(str.length()); //获取字符 char ch = str.charAt(index);//随机字符 // 把生成的验证码存进sb sb.append(ch); //2.3写验证码 g.drawString(ch+"",width/5*i,height/2); } // 转换sb的格式? String checkCode_session = sb.toString(); //将验证码存入session request.getSession().setAttribute("checkCode_session",checkCode_session); //2.4画干扰线 g.setColor(Color.GREEN); //随机生成坐标点 for (int i = 0; i < 10; i++) { int x1 = ran.nextInt(width); int x2 = ran.nextInt(width); int y1 = ran.nextInt(height); int y2 = ran.nextInt(height); g.drawLine(x1,y1,x2,y2); } //3.将图片输出到页面展示 ImageIO.write(image,"jpg",response.getOutputStream()); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request,response); } }
Let the Balloon Rise
Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result. This year, they decide to leave this lovely job to you. Input Input contains multiple test cases. Each test case starts with a number N (0 < N <= 1000) -- the total number of balloons distributed. The next N lines contain one color each. The color of a balloon is a string of up to 15 lower-case letters. A test case with N = 0 terminates the input and this test case is not to be processed. Output For each case, print the color of balloon for the most popular problem on a single line. It is guaranteed that there is a unique solution for each test case. Sample Input 5 green red blue red red 3 pink orange pink 0 Sample Output red pink
Greed is good 怎么写的
Problem Description As we all know Uncle CTW is a very greedy uncle,he likes collecting jewels.One day he gets a necklace with beautiful gems,he has a strange habit,that he only collects the contiguous gems with with same color.That means if he pick a red gem at first,and he will continue to pick only if the next gem is red,or he will stop.(That's why people call him "Uncle.Strange"). As it is a necklace,he must find somewhere to cut the necklace at the very begining,then select an end to pick until meet a different color gem,and do the same for the other end (which might not be of the same color as the gems collected before this). There are only three kinds of gems,red('r'),pink('p'),and white('w'),and NOTICE that,because the white one could be painted,so it can be seen as either color.(See the sample for detail.) Now he just want to know the maximum number of gems he can collect,could you tell him? Input The first line contain an integer T,then T lines,each line with a string only contain r,p or w ,with length no more than 400. Output One integer per line indicating the maximum nunber. Sample Input 1 wwwpprwrprprrprprwrwwrpwrwrrp Sample Output 11
Snooker Referee 请问是如何来实现的
Problem Description Snooker is a cue sport that is played on a large baize-covered table with pockets in each of the four corners and in the middle of each of the long side cushions. It is played using a cue and snooker balls: one white cue ball, 15 red balls worth one point each, and six balls of different colors: yellow (2 points), green (3), brown (4), blue (5), pink (6) and black (7). A player (or team) wins a frame (individual game) of snooker by scoring more points than the opponent(s), using the cue ball to pot the red and colored balls. In this problem, your job is the referee of snooker. You should score both players, ask the correct player to play next, as well as place some of the balls back to the table if necessary. The rules of snooker needed for this problem are following. (We ignore some fouls about incorrectly hitting the cue ball here. We assume that the cue ball is never snookered after a foul, so free ball will never occur. We also assume that both players will make their best attempts to hit the ball on, so you do not need to declare a miss when they do not hit the ball on first.) At the beginning of each frame the balls are set up by the referee as illustrated above. This will be followed by a break-off shot, the white cue ball can be placed anywhere inside the D (it is called in-hand, which also happens when the cue ball is potted). Players take turns in visiting the table. A break is the number of points scored by a player in one single visit to the table. A player's turn and break end when he fails to pot a ball, when he does something against the rules of the game, which is called a foul, or when a frame has ended. The ball or balls that can be hit first by the white are called the ball(s) "on" for that particular stroke. The ball(s) "on" differ from shot to shot: a red ball, if potted, must be followed by a color, and so on until a break ends; if a red is not potted, any red ball remains the ball "on". Only a ball or balls "on" may be potted legally by a player. If a ball not "on" is potted, this is a foul. The game of snooker generally consists of two phases. The first phase is the situation in which there are still red balls on the table. In the first phase, at the beginning of a player's turn, the balls "on" are all remaining red balls. The player must therefore attempt to first hit and pot one or more red balls. For every red ball potted, the player will receive 1 point. When a red has been potted, it will stay off the table and the player can continue his break. If no red has been potted or a foul has been made, the other player will come into play. In case one or more red balls have been potted, the player can continue his break. This time one of the six colors (yellow, green, brown, blue, pink and black) is the ball "on". Only one of these can be the ball "on" and the rules of the game state that a player must nominate his desired color to the referee, although it is often clear which ball the striker is playing and it is not necessary to nominate. When the nominated color is potted, the player will be awarded the correct number of points (yellow, 2; green, 3; brown, 4; blue, 5; pink, 6; black, 7). The color is then taken out of the pocket by the referee and placed on its original spot. Because only one of the colors is the ball "on", it is a foul to first hit multiple colors at the same time, or pot more than one color. If a player fails to pot a ball "on", it being a red or nominated color, the other player will come into play and the balls "on" are always the reds, as long as there are still reds on the table. The alternation between red balls and colors ends when all reds have been potted and a color is potted after the last red, or a failed attempt to do so is made. Then the second phase begins. All six colors have to be potted in ascending order of their points value (yellow, green, brown, blue, pink, black). Each becomes the ball "on" in that order. During this phase, when potted, the colors stay down and are not replaced on the table, unless a foul is made when potting the color, in which case the color is respotted. When only the black is left, the first score or foul ends the frame, and the player who has scored most points has won it. However, if the score is tied after that, the black is respotted, the players draw lots for choice of playing, the next player plays from in-hand, and the next score or foul ends the frame. When a foul is made during a shot, the player's turn is ended and he will receive no points for the foul shot. The other player will receive penalty points. Colors illegally potted are respotted (while reds are not), and if the cue ball is potted, the next player will play from in-hand. Fouls concerned in this problem are: 。failing to hit any other ball with the cue ball 。first hitting a ball "not-on" with the cue ball 。potting a ball "not-on" 。potting the white (in-off) Penalty points are at least 4 points and at most 7 points. The number of penalty points is the value of the ball "on", or any of the "foul" balls, whichever is highest. When more than one foul is made, the penalty is not the added total - only the most highly valued foul is counted. As players usually do not nominate a color explicitly when hitting the colors, please be tolerant and assume that he always nominate the ball with the lowest score when it cannot be deduced from the ball first hit (i.e. when the cue ball does not hit any ball or hit a red first). If a player commits a foul, and his opponent considers that the position left is unattractive, he may request that the offender play again from the resulting position. Input The input file contains multiple test cases. The first line of the input file is a single integer T (T ≤ 200), the number of test cases. For each test case (frame), the first line contains the names of the two players separated by a whitespace. The first player will take the break-off shot. Each name is made up of no more than 20 English letters, and the two names are different. After that, the input mainly consists of lines that describe a stroke each (with two exceptions stated later). A stroke is described by the color of the ball first hit by the cue ball (or "None" if the cue ball does not hit any ball), followed by zero or more colors of the balls potted, all separated by whitespaces. For example, a line "Red Red White Red" means the cue ball first hit a red ball, and 2 reds are potted as well as the cue ball itself; and a line "None" means the cue ball does not hit any ball thus no ball is potted. You can assume that all strokes are legal according to the balls remain on the table, and the cue ball will not hit two or more ball first simultaneously. A line "Play again" may appear if and only if the last stroke is a foul. It means the other player request that the offender play again from the resulting position. If a score or foul occurs when only the black is left, and the score is tied after that, a line with either player's name will follow. That means the player will play next as a result of the lot. The case end when the frame ends. There is a blank line before every test case. Output For each frame, print a line in the format "Frame K" first, where K is the index of this case starts from 1. Then use the output to indicate the referee's behaviors: 。When a frame begins, print a line in the format "PlayerName's turn, in-hand", where PlayerName is the name of the player who take the break-off shot. 。After each stroke, print a line "Foul!" first if it is a foul. Then print a line with current score in the format "ScoreA : ScoreB", where ScoreA is the score of the player who take the break-off shot, and ScoreB is the other player's score. After that, if the frame continue fairly (i.e. not only black is left before the stroke, or it is not a score or foul when only black is left), and some ball(s) should be respotted. Print a line with the word "Respot" following by the color(s) of the ball(s), all separated by whitespace. If more than one ball should be respotted, print their colors in ascending order of their values. Do not print anything if no ball needed to be respotted. At last (when the frame continue fairly and any necessary ball has been respotted), if the last player's break ends, print a line in the format "PlayerName's turn" to ask the other player to play next, where PlayerName is the next player's name. If the next player should play from in-hand, print "PlayerName's turn, in-hand" instead. 。After a foul, if the other player request that the offender play again, just print a line "PlayerName's turn" or "PlayerName's turn, in-hand" according to whether the cue ball is in-hand, where PlayerName is the offender's name. Note that the requester is actually requesting in his turn, after you asked him to play next. 。If a score or foul occurs when only the black is left, and the score is tied after that, print a line "Tie" after the score. Then print two lines "Respot Black" and "PlayerName's turn, in-hand" to respot the black and play from in-hand, where PlayerName is the next player's name (determined by the lot). 。When the frame ends, print a line "PlayerName wins" after the score, where PlayerName is the winner's name. Print a blank line between every two successive cases. Sample Input 1 Zero Maxbreak Red White Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Sample Output Frame 1 Zero's turn, in-hand Foul! 0 : 4 Maxbreak's turn, in-hand 0 : 5 0 : 12 Respot Black 0 : 13 0 : 20 Respot Black 0 : 21 0 : 28 Respot Black 0 : 29 0 : 36 Respot Black 0 : 37 0 : 44 Respot Black 0 : 45 0 : 52 Respot Black 0 : 53 0 : 60 Respot Black 0 : 61 0 : 68
JAVA风景日历,运行时,日历是有了,但风景没有,这是为什么?
运行是这样 ![图片说明](https://img-ask.csdn.net/upload/201911/14/1573703884_780623.jpg) 但是想要这样![图片说明](https://img-ask.csdn.net/upload/201911/14/1573708341_322515.jpg) ``` import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.*; import java.util.Timer; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; //这是一个用JList和JTable完成的简单日历 public class calender { public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { JFrame frame = new CalendarFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }); } } class CalendarFrame extends JFrame { private static final long serialVersionUID = 8067844586793608064L; JPanel listPanel; // 显示月份的列表面板 JPanel tablePanel; // 显示日期的表格面板 JPanel textPanel; // 文本面板 JMenuBar menuBar; // JMenuBar,JMenu定义的变量都没有实现功能 JMenu fileMenu; JMenu editMenu; JMenu formatMenu; JMenu lookMenu; JMenu helpMenu; JEditorPane text; // 自带复制,剪切和删除快捷键功能的面板 JScrollPane textscrollpane; JScrollPane tablescrollpane; @SuppressWarnings("rawtypes") JList list; // 显示月份的列表 JTable table; // 显示日期的表格 JPanel yearPanel; // 显示年份的面板 JSpinner spinner; // JSpinner空间 JLabel label = new JLabel(); public static boolean flag = true; @SuppressWarnings({ "unchecked", "rawtypes" }) public CalendarFrame() { table = new JTable(new MyTableModel()); tablescrollpane = new JScrollPane(table); for (int i = 0; i < 7; i++) { TableColumn column = table.getColumnModel().getColumn(i);// 获取表格每一列 column.setResizable(false);// 不允许改变列的大小 } table.setBackground(Color.GREEN); table.setRowHeight(72); // 设定每列的大小 table.setRowSelectionAllowed(false);// 设定行的选择模式 table.setDefaultRenderer(String.class, new MyTableRenderer()); list = new JList(new AbstractListModel() // 匿名的list模型类,提供list显示的月份数据 { private static final long serialVersionUID = -3703164069291737586L; public Object getElementAt(int index) { String obj = null; switch (index) { case 0: obj = "Jan"; break; case 1: obj = "Feb"; break; case 2: obj = "Mar"; break; case 3: obj = "Apr"; break; case 4: obj = "May"; break; case 5: obj = "Jun"; break; case 6: obj = "Jul"; break; case 7: obj = "Aug"; break; case 8: obj = "Sep"; break; case 9: obj = "Oct"; break; case 10: obj = "Nov"; break; case 11: obj = "Dec"; break; } return obj; } @Override public int getSize() { return 12; } }); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // 设定列表的选择模式 list.setCellRenderer(new MyListCellRenderer()); // 列表元素的绘制类MyListCellRenderer list.setSelectedIndex(Calendar.getInstance().get(Calendar.MONTH));// JList默认的月份为现实的月份 list.addListSelectionListener(new ListSelectionListener()// 当某个列表被选中时,更新日期table控件 { public void valueChanged(ListSelectionEvent e) { flag = true; table.updateUI(); } }); list.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 2) { String s = (String) list.getSelectedValue(); JOptionPane.showMessageDialog(list, s); } } }); listPanel = new JPanel(); listPanel.setLayout(new BorderLayout()); listPanel.add(list); tablePanel = new JPanel(); tablePanel.setBackground(Color.white); tablePanel.setLayout(new BorderLayout()); tablePanel.add(tablescrollpane); // table.setBackground(Color.green); yearPanel = new JPanel();// 将label控件和JSpinner控件加入年份面板上 yearPanel.setLayout(new GridLayout(0, 4)); JLabel gongyuan = new JLabel("公元", JLabel.RIGHT); JLabel year = new JLabel("年"); spinner = new JSpinner(new SpinnerNumberModel(Calendar.getInstance() .get(Calendar.YEAR), null, null, 1)); spinner.addChangeListener(new ChangeListener() // 为JSpinner空间添加事件监听器 { @Override public void stateChanged(ChangeEvent e) { flag = true; table.updateUI(); } }); yearPanel.add(gongyuan); yearPanel.add(spinner); yearPanel.add(year); yearPanel.add(label); showTime(); new Timer().schedule(new TimerTask() { @Override public void run() { while (true) { showTime(); } } }, 1000); tablePanel.add(yearPanel, BorderLayout.NORTH);// 将年份面板加入到表格面板的北部 textPanel = new JPanel(); textPanel.setLayout(new BorderLayout()); text = new JEditorPane(); textscrollpane = new JScrollPane(text); textPanel.add(textscrollpane); text.setFont(new Font("SansSerif", Font.PLAIN, 40)); tablePanel.add(textPanel, BorderLayout.SOUTH); menuBar = new JMenuBar();// JMenu定义的空间都没实现功能 fileMenu = new JMenu("文件"); editMenu = new JMenu("编辑"); formatMenu = new JMenu("格式"); lookMenu = new JMenu("查看"); helpMenu = new JMenu("帮助"); menuBar.add(fileMenu); menuBar.add(editMenu); menuBar.add(formatMenu); menuBar.add(lookMenu); menuBar.add(helpMenu); GridBagLayout layout = new GridBagLayout(); // 设成GridBagLayout布局 GridBagConstraints constraints = new GridBagConstraints(); this.setFont(new Font("SansSerif", Font.PLAIN, 14)); this.setLayout(layout); this.setTitle("风景日历"); // 设定标题 this.setIconImage(new ImageIcon("res\\title.jpg").getImage()); // 设定图标 constraints.fill = GridBagConstraints.BOTH; constraints.weightx = 0.5; constraints.weighty = 0.5; layout.setConstraints(listPanel, constraints); constraints.weightx = 8.0; constraints.weighty = 0.5; layout.setConstraints(tablePanel, constraints); this.setJMenuBar(menuBar); this.add(listPanel); this.add(tablePanel); this.setSize(this.getToolkit().getScreenSize().width * 3 / 4, this .getToolkit().getScreenSize().height * 3 / 4); // 设定窗体的大小 } private void showTime() { int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); int minute = Calendar.getInstance().get(Calendar.MINUTE); int second = Calendar.getInstance().get(Calendar.SECOND); StringBuilder sb = new StringBuilder(); if (hour < 10) { sb.append("0" + hour); } else { sb.append(hour); } if (minute < 10) { sb.append(":0" + minute); } else { sb.append(":" + minute); } if (second < 10) { sb.append(":0" + second); } else sb.append(":" + second); label.setFont(new Font("SansSerif", Font.BOLD, 12)); label.setForeground(Color.BLACK); label.setText(sb.toString()); } class MyTableModel extends AbstractTableModel // 表格模型类,提供表格数据 { private static final long serialVersionUID = 1L; String[] columnName = new String[] // 表格列名 { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; @Override public int getColumnCount() // 返回表格列数 { return columnName.length; } public int getRowCount() // 返回表格行数 { return 6; } public String getColumnName(int col) // 获得表格列名 { return columnName[col]; } public Class<? extends Object> getColumnClass(int c) { return getValueAt(0, c).getClass(); } public Object getValueAt(int rowIndex, int columnIndex) { int month = list.getSelectedIndex();// 获得列表的月份 int year = (Integer) spinner.getValue();// 获得spinner显示的年份 GregorianCalendar gc = new GregorianCalendar(year, month, 1); int dayOfWeek = gc.get(Calendar.DAY_OF_WEEK) - 1; // 获得这个月的第一天是星期几 int countDayInMonth = 0;// 某月的总天数,这里的月是从0-11,表示1-12月 if (month == 0 || month == 2 || month == 4 || month == 6 || month == 7 || month == 9 || month == 11) { countDayInMonth = 31; // 是31天的月份 } else if (month == 3 || month == 5 || month == 8 || month == 10) { countDayInMonth = 30; // 是30天的月份 } else if (gc.isLeapYear(year) && month == 1) { countDayInMonth = 29; // 闰年2月 } else if (!gc.isLeapYear(year) && month == 1) { countDayInMonth = 28; // 非闰年2月 } String value = ""; // 因为返回值是Object类型,所以不能直接返回int类型的数据,所以转换成String类型 if (rowIndex == 0) // 第一列的数据 { if (columnIndex < dayOfWeek) { value = ""; } else { value = "" + (columnIndex - dayOfWeek + 1); } } else // 其余列的数据 { if (((rowIndex - 1) * 7) + (columnIndex + 1 + 7 - dayOfWeek) <= countDayInMonth) value = (((rowIndex - 1) * 7) + (columnIndex + 1 + 7 - dayOfWeek)) + ""; } return value; } } @SuppressWarnings("rawtypes") class MyListCellRenderer extends JLabel implements ListCellRenderer // 列表元素绘制类继承自JLabel,实现ListCellRenderer接口 { private static final long serialVersionUID = 1L; public Component getListCellRendererComponent(JList list, // the list Object value, // value to display int index, // cell index boolean isSelected, // is the cell selected boolean cellHasFocus) // does the cell have focus { String s = value.toString().trim(); // 获取选中元素的字符内容 setText(s); // 显示这个字符 Dimension dimension = list.getSize(); // 设定这个每个元素的大小 int height = dimension.height / 12; int width = dimension.width; setSize(width, height); if (isSelected) // 如果该元素被选中,则背景色为红色 { setBackground(Color.red); setForeground(list.getSelectionBackground()); } else // 未被选中的元素背景色显示为灰色,前景色为粉红色 { setBackground(Color.gray); setForeground(Color.pink); } setIcon(new ImageIcon("res\\mon.jpg")); // 设定该元素的图标 setEnabled(list.isEnabled()); setFont(new Font("SansSerif", Font.PLAIN, 20)); // 设定字体大小 setOpaque(true); return this; } } class MyTableRenderer extends JLabel implements TableCellRenderer { private static final long serialVersionUID = 1L; public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if ((Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "") // 如果这个标签上的值等于该天的值 .equals(value) && flag == true // 标记为true && list.getSelectedIndex() == Calendar.getInstance().get( Calendar.MONTH) // 列表显示的月份是该月的值 && (Integer) spinner.getValue() == Calendar.getInstance() .get(Calendar.YEAR))// spinner显示的年份是该年 { setFont(new Font("SansSerif", Font.PLAIN, 40)); // 设定字体大小 setText((String) value); // 显示日期字符串 setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); setForeground(Color.RED); // 设定字符串颜色 flag = false; } else // 如果不是改日的标签上的值 { setFont(new Font("SansSerif", Font.PLAIN, 40)); // 设定字体大小 setText((String) value); // 显示标签上的日期字符串 if (hasFocus) // 如果是被点中的表格的单元格 { setBorder(UIManager .getBorder("Table.focusCellHighlightBorder")); // 设定边框 setForeground(Color.RED);// 设定日期字符串颜色 } else { setForeground(null); setBorder(null); } } return this; } } } ```
Recyclerview嵌套recyclerview的深坑,我坐在Recyclerview这个坑里很久了,仰望天空希望能把我拉上去。
Recyclerview嵌套recyclerview的深坑,对于一个新手来说怎么也上不去,特来邀请键盘中的高手高高手,拉拉我; ## 第一个Recyclerview布局: ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/area_LinearLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="true" android:focusableInTouchMode="true" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:background="@drawable/drawable_black_one" android:orientation="horizontal" android:layout_margin="3dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:layout_gravity="center" android:text="" android:textColor="@drawable/drawable_white_pure" android:lines="1" android:layout_weight="1"/> <TextView android:layout_width="1dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_margin="5dp" android:background="@color/whiteness" /> <TextView android:id="@+id/peers_location_TextView" android:layout_width="70dp" android:layout_height="40dp" android:layout_marginLeft="5sp" android:layout_marginRight="10dp" android:ellipsize="end" android:gravity="center" android:text="" android:textColor="@color/whiteness" android:textSize="14sp" android:lines="1" android:textStyle="bold" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="3dp" > <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:layout_width="20dp" android:layout_height="20dp" android:layout_alignParentTop="true" android:layout_alignParentEnd="true" android:layout_marginTop="0dp" android:layout_marginEnd="10dp" android:scaleType="fitStart" android:src="@drawable/location" /> </RelativeLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:background="@drawable/drawable_black_one" android:layout_gravity="center" android:focusable="true" android:focusableInTouchMode="true" android:layout_margin="3dp"> <EditText android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_margin="1dp" android:background="@color/text_white" android:hint="行业人员" android:textSize="13dp" android:gravity="center" android:lines="1" android:layout_weight="1"/> <TextView android:layout_width="50dp" android:layout_height="wrap_content" android:text="搜索" android:textSize="14dp" android:layout_marginLeft="14dp" android:layout_gravity="center" android:textColor="@color/whiteness" android:layout_margin="5dp" android:gravity="center"/> </LinearLayout> <android.support.v7.widget.RecyclerView android:id="@+id/user_info_layout" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> ``` ## 在第一个Recycleview的item里面嵌套了第二个Recyclerview不知道这样对不对? ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:id="@+id/portrait" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:id="@+id/user_portrait" android:layout_width="50dp" android:layout_height="50dp" android:layout_margin="5dp" android:src="@drawable/em_default_avatar" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="20dp" android:layout_marginTop="5dp" android:gravity="clip_horizontal"> <TextView android:id="@+id/user_industry" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/dialog_circular_whiteness" android:ellipsize="end" android:gravity="center" android:text="建筑" android:textColor="@color/colorPrimary" android:textSize="14sp" android:textStyle="bold" /> <TextView android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginLeft="5dp" android:background="@drawable/dialog_circular_whiteness" android:ellipsize="end" android:gravity="center" android:text="努力改变自己" android:textColor="#323232" android:textSize="10sp" android:textStyle="bold" /> <TextView android:id="@+id/name_voip" android:layout_width="20dp" android:layout_height="wrap_content" android:layout_gravity="center" android:ellipsize="end" android:gravity="center" android:text="voip" android:textColor="@color/text_pink" android:textSize="7sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="35dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="努力改变自己" android:textSize="12dp" /> </LinearLayout> </LinearLayout> <RelativeLayout android:layout_width="60dp" android:layout_height="match_parent" android:gravity="center"> <TextView android:id="@+id/user_location" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:background="@drawable/dialog_circular_whiteness" android:text="" android:textSize="12dp" android:textStyle="bold" /> </RelativeLayout> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1"> **<!-- 导入RecyclerView-->** <android.support.v7.widget.RecyclerView android:id="@+id/user_peesr_info" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="10dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="right" android:text="访问:10000人" android:textSize="8dp" /> </LinearLayout> </LinearLayout> </LinearLayout> ``` ## 第一个Recyclerview的适配器: ``` public class Home_RecyclerView_Adapter extends RecyclerView.Adapter<Home_RecyclerView_Adapter.myViewHodler> { private Context context; private LinkedList<Home_list_get_set> LinkedList; public LinkedList<User_Recruitment_get_set> mLinkedList; public Home_list_get_set mHome_list_get_set; //创建构造函数 public Home_RecyclerView_Adapter(Context context, LinkedList<Home_list_get_set> industrytitlegetsetList) { //将传递过来的数据,赋值给本地变量 this.context = context;//上下文 this.LinkedList = industrytitlegetsetList;//实体类数据ArrayList } /** * 创建viewhodler,相当于listview中getview中的创建view和viewhodler * * @param parent * @param viewType * @return */ @Override public myViewHodler onCreateViewHolder(ViewGroup parent, int viewType) { RecyclerView user_peesr_info;//自定义recyclerveiw的适配器 //创建自定义布局 // View itemView = View.inflate(context, R.layout.peers_list_item, null);//用这个布局item宽高无效 // myViewHodler itemView = new myViewHodler(LayoutInflater.from(context).inflate(R.layout.peers_list_item, parent, false)); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.peers_list_item, parent, false); user_peesr_info = view.findViewById (R.id.user_peesr_info); //给嵌套的RecyclerView设置适配器 User_Recruitment_Adapter user_recruitment_adapter = new User_Recruitment_Adapter (context,mLinkedList); user_peesr_info.setAdapter (user_recruitment_adapter); user_peesr_info.setLayoutManager (new LinearLayoutManager (context, LinearLayoutManager.HORIZONTAL, false)); //给嵌套的RecyclerView设置item的分割线 user_peesr_info.addItemDecoration (new DividerItemDecoration (context, DividerItemDecoration.HORIZONTAL)); return new myViewHodler(view); // return itemView; } /** * 绑定数据,数据与view绑定 * * @param holder * @param position */ @SuppressLint("ClickableViewAccessibility") @Override public void onBindViewHolder(myViewHodler holder, int position) { //根据点击位置绑定数据 mHome_list_get_set = LinkedList.get(position); // holder.mItemGoodsImg; holder.user_name.setText(mHome_list_get_set.getUser_name()); holder.user_industry.setText(mHome_list_get_set.getUser_work()); // holder.user_portrait.setImageDrawable (data.getHead_portait ());//改为下面Glide获取图上 Glide.with(context) .load(mHome_list_get_set.getHead_portait ())//图片信息 .apply(RequestOptions.bitmapTransform(new CircleCrop ()))//设置圆形 .into(holder.user_portrait);//设置到那个部位 holder.name_voip.setText(mHome_list_get_set.getUser_Vip()); holder.user_location.setText(mHome_list_get_set.getUser_location()); } /** * 得到总条数 * * @return */ @Override public int getItemCount() { // return LinkedList.size(); return LinkedList == null ? 0 : LinkedList.size(); } //自定义viewhodler class myViewHodler extends RecyclerView.ViewHolder { private ImageView user_portrait; private TextView user_name; private TextView user_industry; private TextView name_voip; private TextView user_location; public RecyclerView user_peesr_info;//自定义recyclerveiw的适配器 public myViewHodler(View itemView) { super(itemView); user_peesr_info = itemView.findViewById (R.id.user_peesr_info); user_portrait = itemView.findViewById(R.id.user_portrait); user_name = itemView.findViewById(R.id.user_name); user_industry = itemView.findViewById(R.id.user_industry); name_voip = itemView.findViewById(R.id.name_voip); user_location = itemView.findViewById(R.id.user_location); user_portrait.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //可以选择直接在本位置直接写业务处理 //Toast.makeText(context,"点击了xxx",Toast.LENGTH_SHORT).show(); //此处回传点击监听事件 if (onItemClickListener != null) { onItemClickListener.OnItemClick(v, LinkedList.get(getLayoutPosition())); } } }); } public View getItemView() { return itemView; } } /** * 设置item的监听事件的接口 */ public interface OnItemClickListener { /** * 接口中的点击每一项的实现方法 * * @param view 点击的item的视图 * @param data 点击的item的数据 */ public void OnItemClick(View view, Home_list_get_set data); } //需要外部访问,所以需要设置set方法,方便调用 private OnItemClickListener onItemClickListener; public void setOnItemClickListener(OnItemClickListener onItemClickListener) { this.onItemClickListener = onItemClickListener; } ``` ## 第二个Recyclerview的适配器: ``` public class User_Recruitment_Adapter extends RecyclerView.Adapter<User_Recruitment_Adapter.myViewHodler> { public LinkedList<User_Recruitment_get_set> m_LinkedList; private Context context; public User_Recruitment_get_set mUser_Recruitment_get_set; //创建构造函数 public User_Recruitment_Adapter(Context context, LinkedList<User_Recruitment_get_set> mLinkedList) { //将传递过来的数据,赋值给本地变量 this.context = context;//上下文 this.m_LinkedList = mLinkedList; } @NonNull @Override public myViewHodler onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.user_peers_recruitment_item, viewGroup, false); return new myViewHodler(view); } @Override public void onBindViewHolder(@NonNull myViewHodler myViewHodler, int i) { mUser_Recruitment_get_set = m_LinkedList.get(i); myViewHodler.recruitment.setText (mUser_Recruitment_get_set.getRecruitment ()); } @Override public int getItemCount() { return m_LinkedList == null ? 0 : m_LinkedList.size(); } public class myViewHodler extends RecyclerView.ViewHolder { private TextView recruitment; public myViewHodler(@NonNull View itemView) { super (itemView); recruitment = itemView.findViewById(R.id.recruitment); } } } ``` ## 现问题是嵌套里面的Recyclerview无显示内容?我该如何写?
关于java的聊天程序,分服务端和客户端,请java大神帮我调试一下,我检查没编写错误
//服务端 package chatApp; import java.net.*; import java.io.*; import java.util.*; public class chatserverthree implements Runnable { public static final int PORT=1234; protected ServerSocket listen; static Vector connections; Thread connect; public chatserverthree() { try { listen=new ServerSocket(PORT); } catch(UnknownHostException e2) { System.err.println("erro:"+e2); } catch(IOException e) { System.err.println("erro:"+e); System.exit(1); } connections=new Vector(1000); connect=new Thread(this); connect.start(); } public static void main(String args[]) { new chatserverthree(); System.out.println("Chat Server is starting!......"); } public void run() { try { while(true) { Socket client=listen.accept(); firstthread f=new firstthread(this,client); f.setPriority(Thread.MIN_PRIORITY); f.start(); connections.addElement(f); } } catch(IOException e) { System.err.println("Erro:"+e); System.exit(1); } } public void broadcast(String msg) { int i; firstthread you; for(i=0;i<connections.size();i++) { you=(firstthread)connections.elementAt(i); try { you.out.writeUTF(msg); } catch(IOException e){} } } public void broadcast1(String msg) { int i; String s1,s2,s3; firstthread you; s1=new String("PEOPLE"); s2=new String(msg.substring(4)); s3=s1.concat(s2); for(i=0;i<connections.size();i++) { you=(firstthread)connections.elementAt(i); if(s3.startsWith(you.name)) { try { you.out.writeUTF(msg); } catch(IOException e){} } } } } class firstthread extends Thread { protected Socket client; String line,name; protected DataOutputStream firstout,out; protected chatserverthree server; protected DataInputStream in; public firstthread(chatserverthree server,Socket client) { this.server=server; this.client=client; try { in=new DataInputStream(client.getInputStream()); out=new DataOutputStream(client.getOutputStream()); firstout=new DataOutputStream(client.getOutputStream()); } catch(IOException e) { try { server.connections.removeElement(this); client.close(); } catch(IOException e2) { System.err.println("有问题哦:"+e); return; } } if(this.client==null) { server.broadcast("QUIT"+this.name); this.name=null; } } public void run() { try { for(int i=0;i<server.connections.size();i++) { firstthread c=(firstthread)(server.connections.elementAt(i)); if(c.name!=null) { try { firstout.writeUTF(c.name+"*"); } catch(IOException e){} } } } catch(ArrayIndexOutOfBoundsException e){} catch(NullPointerException e){} try { while(true) { line=in.readUTF(); if(line.startsWith("PEOPLE")) { try { firstthread d=(firstthread)(server.connections.elementAt (server.connections.indexOf(this))); if(d.name==null) { d.name=line; } else if(d.name!=null) { server.broadcast("QUIT"+this.name); d.name=line; } } catch(ArrayIndexOutOfBoundsException e){} catch(NullPointerException e){} finally { server.broadcast(line); } } else if(line.startsWith("QUIT")) { server.broadcast("QUIT"+this.name); server.connections.removeElement(this); this.in.close(); this.out.close(); this.firstout.close(); this.client.close(); this.yield(); } else if(line.startsWith("MSG")) { server.broadcast(line); } else if(line.startsWith("悄悄地对")) { this.out.writeUTF(line); server.broadcast1(line); } else if(line.startsWith("newlist")) { try { for(int i=0;i<server.connections.size();i++) { firstthread c=(firstthread)(server.connections.elementAt(i)); if(c.name!=null) { try { firstout.writeUTF(c.name+"*"); } catch(IOException e){} } } } catch(ArrayIndexOutOfBoundsException e){} catch(NullPointerException e){} } } } catch(IOException e) {server.connections.removeElement(this);} catch(NullPointerException e) {server.connections.removeElement(this);} } } //客户端 package chatApp; import java.net.*; import java.io.*; import java.awt.*; import java.awt.event.*; import java.applet.*; class Mywindow extends Frame implements ActionListener { TextField text1; TextField text2; Button button1; Button button2; Mywindow() { super("发悄悄话窗口"); setLayout(new GridLayout(3,2)); text1=new TextField(12); text2=new TextField(8); button1=new Button("送出悄悄话"); button2=new Button("关闭此窗口"); add(new Label("送悄悄话到:")); add(text1); add(new Label("输入您的悄悄话:")); add(text2); add(button2); add(button1); setSize(400,190); text1.setEditable(false); setVisible(false); button1.addActionListener(this); button2.addActionListener(this); setBackground(Color.pink); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { setVisible(false); System.exit(0); } } ); } public void actionPerformed(ActionEvent e) { if(e.getSource()==button1) { try{chatappletthree.out.writeUTF("悄悄地对"+text1.getText() +"说:"+text2.getText()+"(我是"+chatappletthree.name+")"); } catch(IOException e1){} } else if(e.getSource()==button2) { this.setVisible(false); } } } class Apanel extends Panel { TextField name_txt; Button button1,button2; Checkbox box1,box2,box3; CheckboxGroup sex; Apanel() { name_txt=new TextField(10); button1=new Button("进入聊天室"); button2=new Button("退出聊天室"); setLayout(new FlowLayout()); sex=new CheckboxGroup(); box1=new Checkbox("男 M",false,sex); box2=new Checkbox("女 F",false,sex); box3=new Checkbox("蘑菇",true,sex); add(new Label("输入昵称")); add(name_txt); add(box1); add(box2); add(box3); add(button1); add(button2); add(new Label("")); } } class Bpanel extends Panel { TextArea chat_txt; B2panel b2; Bpanel() { chat_txt=new TextArea(25,75); b2=new B2panel(); chat_txt.setVisible(false); setLayout(new FlowLayout()); add(chat_txt); add(b2); } } class B2panel extends Panel { java.awt.List list; B2panel() { try { list=new java.awt.List(25,false); } catch(NullPointerException e){} setLayout(new BorderLayout()); add("Center",list); add("North",new Label("聊天者列表:")); add("East",new Label()); add("South",new Label("双击某昵称可悄悄话")); } } class Cpanel extends Panel { TextField msg_txt; Button button1,button2,button3; Cpanel() { msg_txt=new TextField(44); button1=new Button("送出"); button2=new Button("刷新谈话区"); button2=new Button("刷新聊天者列表"); setLayout(new FlowLayout()); add(new Label("您要说的话:")); add(msg_txt); add(button1); add(button2); add(button3); } } public class chatappletthree extends Applet implements Runnable, ActionListener,ItemListener { public static final int PORT=1234; static String name,xingbie; Socket socket; int jilu,enter=0; DataInputStream in; static DataOutputStream out; Thread thread; String line; static Apanel a; static Bpanel b; static Cpanel c; static Mywindow mywindow; public void init() { mywindow=new Mywindow(); setBackground(new Color(113,163,139)); setLayout(new BorderLayout()); a=new Apanel(); b=new Bpanel(); c=new Cpanel(); add("North",a); add("Center",b); add("South",c); a.button1.addActionListener(this); a.button2.addActionListener(this); c.button1.addActionListener(this); c.button2.addActionListener(this); c.button3.addActionListener(this); a.box1.addItemListener(this); a.box2.addItemListener(this); a.box3.addItemListener(this); b.b2.list.addActionListener(this); add("East",new Label()); add("West",new Label()); jilu=0; this.setForeground(Color.black); c.msg_txt.setBackground(Color.white); b.chat_txt.setBackground(new Color(200,185,220)); b.chat_txt.setFont(new Font("TimeRoman",Font.PLAIN,12)); } public void start() { this.getCodeBase().getHost(); try { socket=new Socket(this.getCodeBase().getHost(),PORT); in=new DataInputStream(socket.getInputStream()); out=new DataOutputStream(socket.getOutputStream()); } catch(IOException e) { this.showStatus(e.toString()); say("欢迎来这里!"); System.exit(1); } say(" 欢迎来到红蜘蛛聊天室 "); if(thread==null) { thread=new Thread(this); thread.setPriority(Thread.MIN_PRIORITY); thread.start(); } } public void stop() { try { out.writeUTF("QUIT"); } catch(IOException e){} } public void destroy() { try { socket.close(); } catch(IOException e) { this.showStatus(e.toString()); } if((thread!=null)&&thread.isAlive()) { thread.yield(); thread=null; } } public void run() { String line; try { while(true) { line=in.readUTF(); if(line.startsWith("PEOPLE")) { String listString=line; if(line.endsWith("*")) { listString=line.substring(0, (line.length()-1)); } b.b2.list.add(listString.substring(6)); if(!line.endsWith("*")) { b.chat_txt.append(line.substring(6)+"爬上了红蜘蛛网-"+'\n'); } } else if(line.startsWith("QUIT")) { String str=line.substring(10); try { for(int i=0,k=0;i<=120;i++) { String s=b.b2.list.getItem(i); if(s.equals(str)) { k=i; b.b2.list.remove(k); b.chat_txt.append(line.substring(10)+"-高兴地离开了红蜘蛛网"+'\n'); } } } catch(ArrayIndexOutOfBoundsException e){} } else if(line.startsWith("MSG")) { b.chat_txt.append(line.substring(3)+'\n'); } else if(line.startsWith("悄悄地对")) { b.chat_txt.append(line+'\n'); } } } catch(IOException e) { say("再见!欢迎再来红蜘蛛聊天室,如果想重新进入本聊天室,单击浏览器的刷新选项"); } catch(NullPointerException e){} } public void actionPerformed(ActionEvent e) { if(e.getSource()==a.button1) { name=new String(a.name_txt.getText()); try { for(int i=0;i<=120;i++) { if((a.name_txt.getText()!=null)&&((a.name_txt.getText()+ "["+xingbie+"]").equals(b.b2.list.getItem(i))|| a.name_txt.getText().equals("该名已被使用"))) { jilu=1; name=null; break; } } } catch(ArrayIndexOutOfBoundsException e3){} if(jilu==0) { try { out.writeUTF("PEOPLE"+a.name_txt.getText()+"["+xingbie+"]"); enter=1; } catch(IOException e1){} } else if(jilu==1) { a.name_txt.setText("该名已被使用"); } jilu=0; } else if(e.getSource()==a.button2) { try { out.writeUTF("QUIT"); enter=0; } catch(IOException e1){} b.b2.list.removeAll(); } else if(e.getSource()==c.button1&&enter==1) { if((name!=null)) { try { out.writeUTF("MSG"+name+"["+xingbie+"]"+"说-"+":"+ c.msg_txt.getText()); c.msg_txt.setText(null); } catch(IOException e1){} } } else if(e.getSource()==b.b2.list&&enter==1) { mywindow.setVisible(true); mywindow.text1.setText(((List)e.getSource()).getSelectedItem()); } else if (e.getSource()==c.button2) { b.chat_txt.setText(null); } else if(e.getSource()==c.button3) { try { b.b2.list.removeAll(); out.writeUTF("newlist"); } catch(IOException e1){} } } public void itemStateChanged(ItemEvent e1) { if(e1.getItemSelectable()==a.box1) { xingbie=new String("男"); } else if(e1.getItemSelectable()==a.box2) { xingbie=new String("女"); } else if(e1.getItemSelectable()==a.box3) { xingbie=new String("蘑菇"); } } public void say(String msg) { b.chat_txt.append("*****"+msg+"*****\n"); } }
for循环添加li到ul,同时绑定事件,为什么只有最后一个li绑定到事件(超级感谢大佬)
``` <body> <ul></ul> <script> var list = document.getElementsByTagName('ul')[0] var aLi = document.getElementsByTagName('li') for(var i=0;i<9;i++){ list.innerHTML +=`<li></li>`//循环生成li if(0 == i%3){ aLi[i].style.backgroundColor = 'pink' }else if(1 == i%3){ aLi[i].style.backgroundColor = 'orange' }else if(2 == i%3){ aLi[i].style.backgroundColor = 'skyblue' } aLi[i].onmouseover = function() { this.style.backgroundColor = 'green'//只有最后一个li绑定成功 } } </script> </body> ```
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
8年经验面试官详解 Java 面试秘诀
作者 |胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。 Java程序员准备和投递简历的实...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
MyBatis研习录(01)——MyBatis概述与入门
MyBatis 是一款优秀的持久层框架,它支持定制化 SQL、存储过程以及高级映射。MyBatis原本是apache的一个开源项目iBatis, 2010年该项目由apache software foundation 迁移到了google code并改名为MyBatis 。2013年11月MyBatis又迁移到Github。
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip installselenium -ihttps://pypi.tuna.tsinghua.edu.cn/simple/ ...
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
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 获取数据
爬虫,从本质上来说,就是利用程序在网上拿到对我们有价值的数据。 爬虫能做很多事,能做商业分析,也能做生活助手,比如:分析北京近两年二手房成交均价是多少?广州的Python工程师平均薪资是多少?北京哪家餐厅粤菜最好吃?等等。 这是个人利用爬虫所做到的事情,而公司,同样可以利用爬虫来实现巨大的商业价值。比如你所熟悉的搜索引擎——百度和谷歌,它们的核心技术之一也是爬虫,而且是超级爬虫。 从搜索巨头到人工...
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,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、列名...
web前端javascript+jquery知识点总结
1.Javascript 语法.用途 javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ...
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ...... ...
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!...
渗透测试-灰鸽子远控木马
木马概述 灰鸽子( Huigezi),原本该软件适用于公司和家庭管理,其功能十分强大,不但能监视摄像头、键盘记录、监控桌面、文件操作等。还提供了黑客专用功能,如:伪装系统图标、随意更换启动项名称和表述、随意更换端口、运行后自删除、毫无提示安装等,并采用反弹链接这种缺陷设计,使得使用者拥有最高权限,一经破解即无法控制。最终导致被黑客恶意使用。原作者的灰鸽子被定义为是一款集多种控制方式于一体的木马程序...
Python:爬取疫情每日数据
前言 目前每天各大平台,如腾讯、今日头条都会更新疫情每日数据,他们的数据源都是一样的,主要都是通过各地的卫健委官网通报。 以全国、湖北和上海为例,分别为以下三个网站: 国家卫健委官网:http://www.nhc.gov.cn/xcs/yqtb/list_gzbd.shtml 湖北卫健委官网:http://wjw.hubei.gov.cn/bmdt/ztzl/fkxxgzbdgrfyyq/xxfb...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名...
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计...
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允许使用这...
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧???? 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升自...
粒子群算法求解物流配送路线问题(python)
1.Matlab实现粒子群算法的程序代码:https://www.cnblogs.com/kexinxin/p/9858664.html matlab代码求解函数最优值:https://blog.csdn.net/zyqblog/article/details/80829043 讲解通俗易懂,有数学实例的博文:https://blog.csdn.net/daaikuaichuan/article/...
教你如何编写第一个简单的爬虫
很多人知道爬虫,也很想利用爬虫去爬取自己想要的数据,那么爬虫到底怎么用呢?今天就教大家编写一个简单的爬虫。 下面以爬取笔者的个人博客网站为例获取第一篇文章的标题名称,教大家学会一个简单的爬虫。 第一步:获取页面 #!/usr/bin/python # coding: utf-8 import requests #引入包requests link = "http://www.santostang....
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
相关热词 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数 c#日期精确到分钟 c#自定义异常必须继承 c#查表并返回值 c# 动态 表达式树 c# 监控方法耗时 c# listbox c#chart显示滚动条
立即提问

相似问题

1
js如何监听css的属性?
3
每次都自动执行到master数据库,能默认执行到我创建的数据库吗,
3
Java题目,求大神帮忙看看怎么修改,一直有两处错误?
0
thinkphp3.2视图判断r_debt字段是否大于0,分别输出不同样式,但是没有效果,请问是什么原因?
1
python gui编程设了两个滚动条为什么只出现一个?
2
排序,输出出现次数最多的颜色,用C语言怎么实现?
0
vue 中引入 mnt-ui 可是在页面中并不显示,而且vue是通过 render的方式添加到页面中的
0
在此题中,气球的颜色的值通过运算获得的方式?采用C语言实现
2
javaweb 用户可以自由选择出现的行列数(每页要显示多少);
0
echarts箭头错位,并未设置箭头格式
0
谈心算法贪婪匹配的一个实现,具体怎么表示最大数字用C语言的代码去实现
0
颜色字符的匹配的问题的解决,怎么采用C程序的语言代码编写程序去实现的呢?
0
TypeError: in method 'new_gp_Pnt', argument 1 of type 'Standard_Real'试了几次 还是这出现这种情况
0
输出气球的颜色的唯一的解,用C语言的程序设计的代码的编写的形式来回答怎么做
0
pythonOCC_array.SetValue(1,1,gp_Pnt(numpy_array[0,0],numpy_array[0,1],numpy_array[0,2]))?
0
为什么PyQt5的QSS的QPushBotton的background-color设置无效?
1
为什么PyQt5 Qss中QPushButton按钮background-color效果无效?
2
为什么这里的imgList.style.left = 0 +"px"; 不生效?
0
根据构建的树进行查找和修改的一个问题,怎么用C语言的程序编写的技术来实现的呢
2
为什么我的程序的for循环只执行了一次 然后就不会接着执行下面的程序了 (程序里只有一个for)