! [remote rejected] master -> master (permission denied)

图片说明
我先fork了一个别人的仓库,然后从自己的仓库clone到本地来,本地添加了一个文件,git push的时候出现了permission denied的错误,请问怎么修改

1个回答

在自己的账号看下公钥是否添加

waq127520
waq127520 公钥添加了,找到解决办法了,config里面加一个credential项
3 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
git向远程提交一个工程后,再提交另外一个工程,就会出现[rejected] master -> master (non-fast-forward)
上网查看,一说法是原本有代码,再提交会导致覆盖原代码。所以报错 想问:一个目录下只能放一个工程吗?我两次选择的目录都是taotao.git
新浪SAE git push sae master出错
$ git push sae master Username for 'https://git.sinacloud.com': 947363237@qq.com Counting objects: 19, done. Delta compression using up to 4 threads. Compressing objects: 100% (12/12), done. Writing objects: 100% (19/19), 2.74 KiB | 0 bytes/s, done. Total 19 (delta 1), reused 0 (delta 0) remote: Exporting git code... remote: Uploading... -----> Unable to select a buildpack remote: {"Code":1,"Error":"build image failed: exit status 1."} remote: 错误:构建镜像失败 remote: error: hook declined to update refs/heads/master To https://git.sinacloud.com/liswx1 ! [remote rejected] master -> master (hook declined) error: failed to push some refs to 'https://git.sinacloud.com/liswx1' ![图片说明](https://img-ask.csdn.net/upload/201609/27/1474906771_877892.png)
在同一台电脑上运行服务器和客户端 git push 一直出错
我在公司服务器上搭建了一个git服务器,然后在自己电脑上装了一个客户端,测试一切正常,由于公司需要,我就在公司服务器上另一个用户下面安装客户端进行测试,一直出现这个错误,我看着好像和权限有关系,但是我把权限也改了(在服务器上一个用户git管理服务器,一个用户alnex 上安装客户端) hyg@u-server:~/workspace$ git push hjg master hyg@gitserver's password: Counting objects: 21, done. Delta compression using up to 8 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (19/19), 1.58 KiB | 0 bytes/s, done. Total 19 (delta 5), reused 0 (delta 0) remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To gitServer:/home/git/hjg.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'gitServer:/home/git/hjg.git'
gitolite git push (testing 测试)
你好,我自己搭建的git服务器,刚开始没用gitolite这个工具,现在我按照你说的步骤把这个装上了,但是测试的时候一直出问题,执行git push出问题(测试时用的 repositories文件夹下的testing.git): hyg@u-server:~/workspace$ git push origin master git@gitserver's password: Counting objects: 152, done. Delta compression using up to 8 threads. Compressing objects: 100% (111/111), done. Writing objects: 100% (152/152), 13.82 KiB | 0 bytes/s, done. Total 152 (delta 36), reused 0 (delta 0) remote: Empty compile time value given to use lib at hooks/update line 6. remote: Use of uninitialized value in require at hooks/update line 7. remote: Can't locate Gitolite/Hooks/Update.pm in @INC (you may need to install the Gitolite::Hooks::Update module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at hooks/update line 7. remote: BEGIN failed--compilation aborted at hooks/update line 7. remote: error: hook declined to update refs/heads/master To git@gitServer:/home/git/repositories/testing ! [remote rejected] master -> master (hook declined) error: failed to push some refs to 'git@gitServer:/home/git/repositories/testing' hyg@u-server:~/workspace$ 请问这是什么问题呀?
使用kali的hashcat工具破解office2007密码,总是不成功,终端显示如下
通过虚拟机做的实验,1.txt存储hash值,/usr/share/wordlists/password.txt 是字典,一共才3位,字典没有问题,执行完毕没有生成2.txt,弄了半天,不知道什么原因,求各位大佬给把脉 下面是执行时终端的显示 root@wsw:~/john-1.8.0-jumbo-1/run# hashcat -m 9400 1.txt /usr/share/wordlists/password.txt -o 2.txt --force hashcat (v5.1.0) starting... OpenCL Platform #1: The pocl project ==================================== * Device #1: pthread-Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz, 1024/2943 MB allocatable, 1MCU Hashes: 1 digests; 1 unique digests, 1 unique salts Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates Rules: 1 Applicable optimizers: * Zero-Byte * Single-Hash * Single-Salt * Slow-Hash-SIMD-LOOP Minimum password length supported by kernel: 0 Maximum password length supported by kernel: 256 Watchdog: Hardware monitoring interface not found on your system. Watchdog: Temperature abort trigger disabled. * Device #1: build_opts '-cl-std=CL1.2 -I OpenCL -I /usr/share/hashcat/OpenCL -D LOCAL_MEM_TYPE=2 -D VENDOR_ID=64 -D CUDA_ARCH=0 -D AMD_ROCM=0 -D VECT_SIZE=8 -D DEVICE_TYPE=2 -D DGST_R0=0 -D DGST_R1=1 -D DGST_R2=2 -D DGST_R3=3 -D DGST_ELEM=4 -D KERN_TYPE=9400 -D _unroll' Dictionary cache hit: * Filename..: /usr/share/wordlists/password.txt * Passwords.: 1000 * Bytes.....: 4000 * Keyspace..: 1000 Approaching final keyspace - workload adjusted. Session..........: hashcat Status...........: Exhausted Hash.Type........: MS Office 2007 Hash.Target......: $office$*2007*20*128*16*702f915f20215bfe6cd028bd9e8...ad0dc3 Time.Started.....: Tue Feb 11 12:00:50 2020 (3 secs) Time.Estimated...: Tue Feb 11 12:00:53 2020 (0 secs) Guess.Base.......: File (/usr/share/wordlists/password.txt) Guess.Queue......: 1/1 (100.00%) Speed.#1.........: 330 H/s (3.71ms) @ Accel:512 Loops:128 Thr:1 Vec:8 Recovered........: 0/1 (0.00%) Digests, 0/1 (0.00%) Salts Progress.........: 1000/1000 (100.00%) Rejected.........: 0/1000 (0.00%) Restore.Point....: 1000/1000 (100.00%) Restore.Sub.#1...: Salt:0 Amplifier:0-1 Iteration:49920-50000 Candidates.#1....: 512 -> 999 Started: Tue Feb 11 12:00:48 2020 Stopped: Tue Feb 11 12:00:55 2020
vue ajax上传文件时Java后端报错
我正在做一个上传头像功能,前端使用vue.js,后端是springboot构建的项目,但是每次vue请求传到后端时,都会报格式错误。代码如下: 后端接口: @PostMapping("/userinfo/uploadHeadImg") public AjaxResult<?> uploadHeadImg(@RequestParam MultipartFile file, @RequestParam Integer userInfoId) throws Exception{ return tbUserinfoService.uploadHeadImg(file,userInfoId); } html部分: <div class="setting-head"> <!--个人头像--> <div class="user-head-img" > <div class="use-click" @click="uploadHeadImg"> <el-avatar :size="60" :src="userHeadImg" > </el-avatar> <input type="file" accept="image/*" class="hiddenInput" @change="handleFile"/> </div> </div> </div> js部分: handleFile: function (e) { let $target = e.target || e.srcElement; let file = $target.files[0]; var reader = new FileReader(); reader.onload = (data) => { let res = data.target || data.srcElement; this.$store.dispatch("uploadHeadImg",file); }; reader.readAsDataURL(file) }, store.js 文件部分: ``` actions:{ uploadHeadImg({commit,state},file){ Vue.http.post('/userinfo/uploadHeadImg',{file:file,userInfoId:state.userInfoId}, {headers: { 'Content-Type': 'multipart/form-data' }}, ).then(function(res){ var result = res.data; if(result.code=="200"){ this.userHeadImg = res.result; commit("setUserHeadImgFile",file); } }) } ``` 报错现象分两种情况: 当store.js部分添加了 {headers: { 'Content-Type': 'multipart/form-data' }}, 后,后端报错如下: Resolved [org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found] 我在网上找了大部分的解决方式是说去掉 header请求中的 Content-Type就行了。 <br> 但是当我去掉这部分后报错又变成了: Resolved [org.springframework.web.multipart.MultipartException: Current request is not a multipart request] 网上搜索解决方式:说请求头添加 <br> 'Content-Type': 'multipart/form-data' 陷入死循环中.... 希望有熟悉这部分的老哥可以帮忙请求看看,谢谢!!! 通过postman测试,后端接口成功,但就是通过vue访问就会报错
Gitlab: no user or key was provided
今天尝试从客户端向安装了gitlab的服务器推送一个分支,结果得到以下的错误信息: [root@warehouse git-sample]# git push origin master git@192.168.7.82's password: Counting objects: 3, done. Writing objects: 100% (3/3), 224 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: GitLab: No user or key was provided. To git@192.168.7.82:ite-pon/git-sample.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git@192.168.7.82:ite-pon/git-sample.git' 看上去是说gitlab往这个项目里塞了一个pre-receive的hook,这个hook检查报错,结果阻塞了push。 请问大家有没有见到过类似问题,有没有啥主意呀?谢了~ 本人git还有点小白~望稍稍给予解释~ 此外,如果是删hook的话我觉得可能不是一个好的解决方法,毕竟hook里有可能挂着gitlab所需要的东西,并且安全验证其实也是有必要的吧? ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 下面是详细信息: **服务器: GitLab & Git & Repository Info** [root@warehouse git-sample.git]# pwd /opt/gitlab/apps/gitlab/repositories/ite-pon/git-sample.git ![图片说明](https://img-ask.csdn.net/upload/201507/01/1435757072_962994.jpg) ![图片说明](https://img-ask.csdn.net/upload/201507/01/1435757100_120853.jpg) **服务器: Configuration** [root@warehouse repositories]# grep git /etc/passwd git:x:502:502:Git:/opt/gitlab/apps/gitlab/repositories:/opt/gitlab/git/bin/git-shell **客户端: Workspace Info** [root@warehouse git-sample]# pwd /root/workspaces/git-sample/git-sample [root@warehouse git-sample]# ls readme.txt [root@warehouse git-sample]# git branch dev * master [root@warehouse git-sample]# git remote -v origin git@192.168.7.82:ite-pon/git-sample.git (fetch) origin git@192.168.7.82:ite-pon/git-sample.git (push) **客户端: SSH & Git Info** [root@warehouse git-sample]# git config --global user.name Administrator [root@warehouse git-sample]# git config --global user.email admin@gitlab.xxxxxxxxxxx.com [root@warehouse git-sample.git]# ls -l ~/.ssh/id_rsa.pub -rw-r--r-- 1 root root 413 7月 1 15:51 /root/.ssh/id_rsa.pub
Judges's Final Problem C语言怎么做
Problem Description For any ACM/ICPC participant, it is always discouraging to discover that the real problems they face in the programming world are seldom as interesting as the tasks they face in the algorithm-related contests. While the efficiency of your algorithm is certainly vital to the overall system, still it is seldom valued so much as other factors such as readability, and the ability of coding accurately often takes precedence in many projects. Still, we judges believe that a balance between these two can be achieved - a good programmer should be able to come up with code that is fast, reliable and readable in a reasonable amount of time - and that is why you, the contestant, is asked to solve the problem of building a ranking system for us. You're probably familiar with the following paragraph taken from Rules of ACM/ICPC: A problem is solved when it is accepted by the judges. Teams are ranked according to the most problems solved. Teams who solve the same number of problems are ranked by least total time. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the accepted run plus 20 penalty minutes for every rejected run for that problem regardless of submittal time. There is no time consumed for a problem that is not solved. During a contest, the following kinds of requests might be submitted by participants: Submission (Format: S [minute]:[Team No]:[Problem ID]:[Result]) If a team submits a problem which they have already solved, then this submission should be considered invalid and ignored by your system; otherwise, the submission is valid and saved for further processing - if the result is 1 (Correct), then this submission should be considered accepted by the system. Query a team's place on the rank list. (Format: R [Team No]) Sort the teams according to the contest rules mentioned above. A tie may occur between two teams who solved equal number of problems and same penalty. Two teams who solved same number of problems and have same penalty should always have same rank; however, when querying the Kth team on the rank list, even if many teams share the same rank, only one team should be printed (please refer to the rule given below). Query the Kth team on the rank list. (Format: T [k]) If a tie occurs, return the team with the minimum last accepted submission time. Note that the submission time of two teams might be different (i.e., in seconds) even though it may appear otherwise in the input. Initially every team has no submissions, and the contest will last no more than 5 hours. Input There are multiple test cases in the input. Each test case starts with two integers, N and M, (1 <= N <= 10000, 1 <= M <= 10), the number of teams participating in the competition, and the total number of problems in the contest. Teams are numbered from 0 to N - 1. Each of the following lines is either in one of the three formats listed above, or a single line "Contest Ends" followed by an empty line indicating the end of current test case. It is guaranteed that there are no more than 100000 requests in each test case. Input ends with End-of-File. Output For every submission request, if the submitted program is accepted, you need to output a line whose format is [Team No] [Problem ID]; for every query about team's place on the rank list, output the result in one single line; for every query about the team with the Kth highest score, if a team is found, output a line with one integer, the number of the team, or -1 if you are unable to find such a team. Please print a blank line after each test case. Sample Input 5 8 T 1 T 2 S 5:0:A:0 S 8:0:A:1 S 9:1:B:1 S 15:0:A:1 T 1 T 2 T 3 R 0 R 1 R 2 R 3 Contest Ends Sample Output 0 -1 [0][A] [1][B] 1 0 2 1 0 2 2
db2导入时报SQL3319N 创建表时发生 SQL 错误 "-286"
E:\kelan\zjnsWebSite\zjbank1227>db2move zjnsWeb import Application code page not determined, using ANSI codepage 1386 ***** DB2MOVE ***** Action: IMPORT Start time: Thu Aug 29 17:29:29 2013 Connecting to database ZJNSWEB ... successful! Server : DB2 Common Server V9.7. 5 Binding package automatically ... D:\IBM\SQLLIB\BND\DB2COMMON.BND ... successful ! Binding package automatically ... D:\IBM\SQLLIB\BND\DB2MOVE.BND ... successful! * IMPORT: table "DB2INST1"."CMS_ATTACHMENT" -Rows read: 109 -Inserted: 109 -Rejected: 0 -Committed: 109 * IMPORT: table "DB2INST1"."CMS_CHANNEL" -Rows read: 73 -Inserted: 73 -Rejected: 0 -Committed: 73 * IMPORT: table "DB2INST1"."CMS_CHANNEL_ONLINE" -Rows read: 73 -Inserted: 73 -Rejected: 0 -Committed: 73 * IMPORT: table "DB2INST1"."CMS_DOCUMENT" ***ERROR -3319. Check message file tab4.msg! *** SQLCODE: -3319 - SQLSTATE: *** SQL3319N 创建表时发生 SQL 错误 "-286"。 * IMPORT: table "DB2INST1"."CMS_DOCUMENT_ONLINE" ***ERROR -3319. Check message file tab5.msg! *** SQLCODE: -3319 - SQLSTATE: *** SQL3319N 创建表时发生 SQL 错误 "-286"。 * IMPORT: table "DB2INST1"."CMS_EXTENDFIELD" -Rows read: 114 -Inserted: 114 -Rejected: 0 -Committed: 114 * IMPORT: table "DB2INST1"."CMS_GROUP" -Rows read: 8 -Inserted: 8 -Rejected: 0 -Committed: 8 Disconnecting from database ... successful! End time: Thu Aug 29 17:29:45 2013 E:\kelan\zjnsWebSite\zjbank1227>
Essay Scoring System 不太会实现了
Problem Description Professor Binns has finally got tired of scoring essays himself and implemented an automatic essay scoring system to help him screen the numerous essays. Strongly against such an idea, you decided to generate a meaningless essay which can get high mark in his system to prove that his system does not work at all. You've obtained the rules used by Binns's system to score the essay, they're as follows: a) The word in the essay must be from a particular set of words. If not, the essay will receive a score zero and is automatically rejected. b) Every word in the specified set has a positive integer associated with it, indicating the score the submitter will get for using that word once. c) A word can be used in several different ways; for example, in English, the word “word” can be used as both a noun and a verb. Every occurrence of specific patterns (like verb – adjective – noun) will earn the submitter a particular score. In particular, it is allowed for a word to be interpreted in different ways in different patterns. You're interested in generating an essay of a specified length with maximum possible score. Input There are multiple test cases in the input file. Each test case starts with three integers N, M and K, (1 <= N <= 100, 0 <= M <= 8, 0 <= K <= 6), the length of the essay to generate, the number of words in the dictionary and the number of patterns, respectively. The following M lines describe the words in the dictionary; each line consists of two integers, Wi, and Ti, (0 <= Wi <= 2000, 1 <= Ti <= 5), representing the score submitter gets every time he/she uses the word, and the number of ways the word can be used. The next part of the input describes the patterns. Each of the K lines describes one pattern, beginning with two integers, Wi, and Ci, (0 <= Wi <= 2000, 1 <= Ci <= 6), indicating the score one can get every time the pattern is used, and the number of consecutive parts in the pattern; followed by Ci integers describing the language parts in the pattern. It is guaranteed that the total number of ways to use a word does not exceed 5; furthermore, the total number of parts contained in all patterns (sum of all Cis) will not exceed 25. There is a blank line after each test case. Input ends with End-of-File. Output For every test case, you should output one integer on a separate line, the maximum score one can get, in the format as indicated in the sample output. Sample Input 2 3 2 4 3 0 1 2 5 2 2 3 1 2 0 4 1 2 1 3 10 2 4 2 2 3 2 4 3 0 1 2 5 2 2 3 1 2 0 4 1 2 1 3 2 2 4 2 Sample Output Case 1: 16 Case 2: 10
Game Simulator 模拟器的问题
Problem Description “Tractor” is a very popular poker game in China. There are four players in the game. Suppose their names are Alice, Bob, Charles and David, in clockwise order. A judge is needed for this game. The players are divided into two teams, Alice and Charles are in team 1, and the other two are in team 2. The prop they use to play the game are two decks of pokers, including 108 cards in total. A simplified rule of the game is described below. The whole game contains a number of rounds. In each round, one team is called “Declarers” (CT); the other team is called “Defenders” (FT). Each team has a current rank (CR). The goal of the player is to increase his own team's CR as much as possible. A certain round has a Main Suit (Heart - H, Spade - S, Club - C, Diamond - D, or None - no main suit in this round) and its CR. The CR in this round is the CR of the CT, and Main Suit will be given. The Main Suit and CR will be used to determine the order of the cards. Cards ranked 5, 10, King value 5, 10, 10 pts (points) respectively, all other cards value 0 pts. In one round, we only consider the FT's pts. The rules of getting pts for FT will be discussed later. If the FT gets less than 80 pts in one round, they will hold be FT in the next round. This situation is called “make”. Otherwise, they become CT in the next round and the original CT become FT instead. This situation is called “down”. If the FT gets 0 pts, the CR of the current CT will be increased by 3, for example, if the CR of the CT is 9, it will become Queen (12). Otherwise, if the FT gets less than 40 pts, the CR of the CT will be increased by 2. Otherwise, if the FT gets less than 80 pts, the CR of the CT will be increased by 1. Otherwise, if the FT gets not less than 80 + k * 40 pts and less than 120 + k * 40 pts, the CR of the current FT will be increased by k. For example, if the FT gets 255 pts in a round, the CR of the current FT will be increased by 4; and if the FT gets 80 pts, both teams' CR remain unchanged. If a team's CR becomes beyond Ace, this team is considered the WINNER of the whole game. During a round, one of the players in CT is called the dealer. If “make”, the pard (teammate) of the dealer becomes the next round’s dealer. Otherwise (“down”), the player on dealer's right-hand side becomes the dealer of the next round. For example, if the dealer of the current round is Alice and her team (CT) is “down”, the dealer of the next round should be Bob (on Alice's right-hand side). At the start of a round, each of the players except the dealer gets exactly 25 cards; the dealer gets all the remaining 33 cards. After that, the dealer chooses 8 of his cards and gives them to the judge, and these cards are called “hidden cards”. Now each player has exactly 25 cards. A round consists of several tricks. In the first trick, the dealer plays one or more cards (called “lead”), then, in clockwise order, players play the same number of cards as the first player one by one (called “follow”). The winner of the current trick leads cards during the next trick, and so on. If the winner of the current trick is a member of FT, then the FT gets the sum of the cards' pts played in this trick. Now we start to describe how to determine the winner of a trick. After the main suit and the CR of the current round are fixed, we can determine the “trumps” which are cards with main suit or CR (Current Rank), and the Jokers. All other cards are “not-trumps”. We can have an order among all the cards according the following rules: (1) “Trumps” are ordered higher than “not-trumps”. (2) For the trumps, the order are listed below: Red Joker Black Joker card with main suit and CR (if exists) other card with CR other trumps ordered by their ranks(i.e., A, K, Q, J, T, 9, 8, 7, ..., 3, 2) (3) For the “not-trumps”, they are ordered by their ranks. Assume in all the description below, in the current round, the CR of the CT is 7. Suppose the main suit is H, the cards can be arranged in this order (as an example): S2 , C2 , D2 < S3 , C3 , D3 < S4 , C4 , D4 < S5 , C5 , D5 < S6 , C6 , D6 < S8 , C8 , D8 < S9 , C9 , D9 < ST , FT , CT (T - 10) < SJ , CJ , DJ (J - Jack) < SQ , CQ , DQ (Q - Queen) < SK , CK , DK (K - King) < SA , CA , DA (A - Ace) < H2 < H3 < H4 < H5 < H6 < H8 < H9 < HT < HJ < HQ < HK < HA < S7 = C7 = D7 < H7 < BJ (the Black Joker) < RJ (the Red Joker) If “None” during this round, then the pokers can be arranged in this order: H2 , S2 , C2 , D2 < H3 , S3 , C3 , D3 < H4 , S4 , C4 , D4 < H5 , S5 , C5 , D5 < H6 , S6 , C6 , D6 < H8 , S8 , C8 , D8 < H9 , S9 , C9 , D9 < HT , ST , FT , CT < HJ , SJ , CJ , DJ < HQ , SQ , CQ , DQ < HK , SK , CK , DK < HA , SA , CA , DA < H7 = S7 = C7 = D7 < BJ < RJ In these two tables, cards written in italic are “trumps”, and cards written in boldface are “not-trumps”. In each trick, the lead cards (played by the player leading this trick) must be either all “trumps”, or all “not-trumps” with same suit. The possible structures of the cards are listed below (assume the main suit is H and main rank is 7 for the example): Single. A single card, such as D9. Pair. Two same cards, such as D9D9. But D7S7 is not a pair although their orders are the same. Tractor. Two or more consecutive-ordered pairs, satisfying the condition that they are all “trumps”, or all “not-trumps” with same suit, such as SJSJSQSQSKSKSASA, H7H7S7S7HAHA or RJRJBJBJ. But, these are not tractors: S7S7C7C7 (their orders are the same), C7C7C6C6 (they are not consecutive-ordered), DADAD2D2 (Ace is not “one”, so they are not consecutive-ordered), H2H2H4H4, or D2D2D3. Be careful: if “None” in this round, H7H7S7S7HAHA is not a tractor (H7 and S7 are same-ordered because of “None”). Throw. The combination of the structures above, satisfying the condition that they are all “trumps”, or all “not-trumps” with same suit. Each of the Single, Pair or Tractor in a Throw is one of the Throw’s component. In the original tractor game, in some situation, the throw will be rejected. But, to keep the rule simple, we assume in this problem all the throws are accepted. For example, RJRJBJBJH7H7HQHQHJHJH9H9H6H6HAH2 contains six components: two tractors, two pairs and two single cards (RJRJBJBJH7H7-HQHQHJHJ-H9H9-H6H6-HA-H2); CACAC8C8CK contains three components: two pairs and one single card(CACA-C8C8-CK). A throw can be treated as different list of components, for example, H2H2H3H3H4H4H5H5H6H6 can also be treated as H2H2H3H3-H4H4H5H5H6H6, or H2H2-H3H3H4H4H4H5H5-H6H6, and so on. For the lead cards, each time we choose the longest component (choose the one with the highest order to break the tie) to construct a list of components, this list is the structure of the lead cards, also the structure of the trick. So that the structure of the trick is unique. After the first player lead his or her cards, other players follow cards one by one in clockwise order, as mentioned above. An important part of the game is to determine the winner of a trick: If one’s follow cards contain both “trumps” and “not-trumps”, or all “not-trumps” but with different suits, this player can't be winner of this trick. Otherwise, if the lead cards are all “not-trumps” and one’s follow cards contain “not-trumps” with different suit from the lead cards, this follow player can’t be the winner of this trick. Else, if one’s follow cards can't be constructed as the same structure of lead cards, this player can't be the winner of this trick either. Otherwise, if the structure of this trick is not “throw”, the one who played the highest-ordered card wins this trick. If more than one player played the same highest-ordered card, the winner of this trick will be the one who plays the highest-ordered card first. Now let's consider the “throw” situation. We construct the follow cards into the structure of the lead cards, so that the order of the highest-ordered card in all the longest components of the “throw” is as high as possible (this card is called “honor card”). Note that tractor can be treated as several pairs or shorter tractors, and pair can be treated as two single cards. The winner of this trick is the one who plays the highest-ordered “honor card”. Similarly, if more than one player played the same highest-ordered “honor card” the winner of this trick will be the one who plays the highest-ordered “honor card” first. There are many hair-raising rules about lead and follow cards; fortunately, they're not related to this problem, the only thing we care about is: when someone leads a “not-trump” “throw” the only possible way to beat it is to “throw” the same structure of “trumps”. And it’s impossible to beat a leading “trump” “throw”. Special attention on the examples below. In these examples, Alice always leads cards. And assume in all the following examples, the CR is 7, and the main suit is H. There is a special rule about “hidden cards”: if the winner of the last trick of a certain round is a member of FT, then, in addition, the FT gets the sum of the hidden cards' pts, multiplied by 2w (2 to the power of w). When the structure of the final trick is not “throw”, then w is the number of lead cards of the last trick of this round. If the structure is “throw” instead, w is the length of the longest components, in the example RJRJBJBJH7H7HQHQHJHJH6H6HA, the w is 6 because the length of RJRJBJBJH7H7 (the longest components of the “throw”) is 6. To make the problem easier, you are only to write a single-round tractor game simulator. Input Multiple test cases, the number of them T is given in the very first line. For each test case: The first line contains the main suit of this round (H, S, C, D, O; O denotes “None” in this round), the dealer of this round, the CR of team 1, the CR of team 2, separated by single spaces. Each of the rest lines contains 4 strings: the lead cards and the cards played by the second, third and last player. In one string, the cards can be given in any order. Each player will play exactly 25 cards in one round. You may assume the input is always valid. There is a blank line between consecutive test cases, and a blank line also appears between T and the first test case. Output For each test case: The first line contains the case number. The second line contains the pts get by the FT in this round. If a team wins the whole game after this round, output “Winner: Team X”(without quotes, X should be either 1 or 2) in the second line. If no team wins, output the new CR of team 1, the new CR of team 2 after this round, followed by the name of the dealer of the next round, separated by single spaces. See the example for further details. Sample Input 1 O Charles 2 2 S6S6S7S7 SASKSJST STS8S4S4 S3S5SJSQ S9S9 H3D3 S3DT SAD3 DA DQ DK D4 SKS8S5S3 RJC2D2H2 C6C8CJD9 H3CKDTD5 H7H7 H6H4 HJHQ H9H9 DJDJ DKH5 D5D4 D6D6 D8D8 C4C3 HTH5 D9D7 C5C5 C6CT H8HQ C7C4 H8 C7 HA HA H2 RJ BJ CK DA BJ C8 HK S2S2C2 CQCAD2 HTHJHK C9CQCA Sample Output Case #1: 50 3 2 Alice
使用npm下载任何文件都报错,报错如下
D:\cumputer\Node_js\day_3_3>npm install --save jquery npm WARN tarball tarball data for jquery@latest (sha1-lYzinoHJeQ8xvneS311NlfxX+8o=) seems to be corrupted. Trying one more time. npm WARN cumputer@1.0.0 No description npm WARN cumputer@1.0.0 No repository field. npm ERR! path D:\cumputer\node_modules\.staging\jquery-9ce1137a\dist\jquery.js npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'D:\cumputer\node_modules\.staging\jquery-9ce1137a\dist\jquery.js' npm ERR! { [Error: EPERM: operation not permitted, unlink 'D:\cumputer\node_modules\.staging\jquery-9ce1137a\dist\jquery.js'] npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, unlink 'D:\cumputer\node_modules\.staging\jquery-9ce1137a\dist\jquery.js' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: npm ERR! 'D:\\cumputer\\node_modules\\.staging\\jquery-9ce1137a\\dist\\jquery.js' }, npm ERR! stack: npm ERR! 'Error: EPERM: operation not permitted, unlink \'D:\\cumputer\\node_modules\\.staging\\jquery-9ce1137a\\dist\\jquery.js \'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: npm ERR! 'D:\\cumputer\\node_modules\\.staging\\jquery-9ce1137a\\dist\\jquery.js', npm ERR! parent: 'cumputer' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\22938\AppData\Roaming\npm-cache\_logs\2019-03-03T12_51_08_378Z-debug.log
node 安装http-server报错,这是啥情况
C:\Users\DELL\Desktop\member\member> npm install http-server -g npm ERR! path C:\Program Files\nodejs\node_modules\.staging npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall mkdir npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging' npm ERR! { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging' npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\.staging' }, npm ERR! stack: 'Error: EPERM: operation not permitted, mkdir \'C:\\Program Files\\nodejs\\node_modules\\.staging\'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\.staging', npm ERR! parent: 'http-server' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2018-10-16T07_10_25_840Z-debug.log PS C:\Users\DELL\Desktop\member\member>
卡夫卡kafka消费问题,消费一段时间就会超时 求助原因
``` 80 DEBUG [YyjkStorageKafkaConsumerThread] YyjkStorageKafkaConsumerThread.value:{"tableName":"sw_segment","operateType":"INSERT","operateId":"4921.43.15759673490360004","indexType":"type","storageType":"elasticsearch","date":1575967330707,"tableData":{"trace_id":"4921.43.15759673490360005","endpoint_name":"/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat","latency":3,"end_time":1575967349039,"endpoint_id":189076,"service_instance_id":4921,"version":2,"start_time":1575967349036,"data_binary":"Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm","service_id":13,"time_bucket":20191210164229,"is_error":0,"segment_id":"4921.43.15759673490360004"}} 16:40:05,480 DEBUG [YyjkStorageKafkaConsumerThread] YyjkStorageKafkaConsumerThread.FormatData,tableName:sw_segment|operateId:4921.43.15759673490360004|tableMap:{trace_id=4921.43.15759673490360005, endpoint_name=/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat, latency=3, end_time=1575967349039, endpoint_id=189076, service_instance_id=4921, version=2, start_time=1575967349036, data_binary=Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm, service_id=13, time_bucket=20191210164229, is_error=0, segment_id=4921.43.15759673490360004} 16:40:05,480 DEBUG [ElasticSearchClient] Executing bulk [32] with 8 requests 16:40:05,481 DEBUG [MainClientExec] [exchange: 44] start execution 16:40:05,481 DEBUG [RequestAddCookies] CookieSpec selected: default 16:40:05,481 DEBUG [RequestAuthCache] Re-using cached 'basic' auth scheme for http://10.23.11.224:9200 16:40:05,481 DEBUG [RequestAuthCache] No credentials for preemptive authentication 16:40:05,481 DEBUG [InternalHttpAsyncClient] [exchange: 44] Request connection for {}->http://10.23.11.224:9200 16:40:05,481 DEBUG [PoolingNHttpClientConnectionManager] Connection request: [route: {}->http://10.23.11.224:9200][total kept alive: 1; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set timeout 0 16:40:05,482 DEBUG [PoolingNHttpClientConnectionManager] Connection leased: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 0; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:05,482 DEBUG [InternalHttpAsyncClient] [exchange: 44] Connection allocated: CPoolProxy{http-outgoing-0 [ACTIVE]} 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set attribute http.nio.exchange-handler 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:r]: Event set [w] 16:40:05,482 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Request ready 16:40:05,482 DEBUG [InternalHttpAsyncClient] Connection route already established 16:40:05,482 DEBUG [MainClientExec] [exchange: 44] Attempt 1 to execute request 16:40:05,482 DEBUG [MainClientExec] Target auth state: UNCHALLENGED 16:40:05,482 DEBUG [MainClientExec] Proxy auth state: UNCHALLENGED 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: Set timeout 30000 16:40:05,482 DEBUG [headers] http-outgoing-0 >> POST /_bulk?timeout=1m HTTP/1.1 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Content-Length: 6657 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Content-Type: application/json 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Host: 10.23.11.224:9200 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Connection: Keep-Alive 16:40:05,482 DEBUG [headers] http-outgoing-0 >> User-Agent: Apache-HttpAsyncClient/4.1.2 (Java/1.8.0_221) 16:40:05,483 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: Event set [w] 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Output ready 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] produce content 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 6657; pos: 4096; completed: false] 16:40:05,483 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: 4293 bytes written 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "POST /_bulk?timeout=1m HTTP/1.1[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Content-Length: 6657[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Content-Type: application/json[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Host: 10.23.11.224:9200[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "User-Agent: Apache-HttpAsyncClient/4.1.2 (Java/1.8.0_221)[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.88.15759673496781142"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.88.15759673496781143","endpoint_name":"/authentication","latency":71,"end_time":1575967349749,"endpoint_id":150,"service_instance_id":11,"version":2,"start_time":1575967349678,"data_binary":"CgwKCgtY1oK15O6q/xsS3gEIARivt+X37i0gurfl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6kwEKDGRiLnN0YXRlbWVudBKCAXNlbGVjdCB0LmNoZWNrX3RpbWUsdC5leHRlbmRfaW5mbyx0LnVzZXJfbmFtZSx0LmxvZ2luX2NoYW5uZWwgZnJvbSBzc29fdXNlcl9zZXNzaW9uIHQgd2hlcmUgdC50aWNrZXQgPSA/IGFuZCB0LmxvZ291dF90aW1lIGlzIG51bGwSnAEIAhjGt+X37i0g2Lfl9+4tMJUBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6UgoMZGIuc3RhdGVtZW50EkJ1cGRhdGUgc3NvX3VzZXJfc2Vzc2lvbiB0IHNldCB0LmV4dGVuZF9pbmZvID0gPyB3aGVyZSB0LnRpY2tldCA9ID8SWAgDGNm35ffuLSDrt+X37i0wlAFABVABWAFgIXoOCgdkYi50eXBlEgNzcWx6GwoLZGIuaW5zdGFuY2USDHR5Z3pwdF9kenN3anoOCgxkYi5zdGF0ZW1lbnQSZhD///////////8BGK635ffuLSD1t+X37i0wlgFYA2ABejAKA3VybBIpaHR0cDovL25zc28uZHpzd2pqYy50YXguY24vYXV0aGVudGljYXRpb256EgoLaHR0cC5tZXRob2QSA0dFVBgMIAs=","service_id":12,"time_bucket":20191210164229,"is_error":0,"segment_id":"11.88.15759673496781142"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673457660020"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.36.15759673457660021","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":377,"end_time":1575967346143,"endpoint_id":162,"service_instance_id":4921,"version":2,"start_time":1575967345766,"data_binary":"Cg0KC7kmJPSg4dHuqv8bErYBEP///////////wEY5pjl9+4tIN+b5ffuLTCiAUADUAFYAWAheg4KB2RiLnR5cGUSA3NxbHohCgtkYi5pbnN0YW5jZRISdHlnenB0X2R6c3dqX3d3X2tmel0KDGRiLnN0YXRlbWVudBJNc2VsZWN0ICogZnJvbSBxel9kbWIgd2hlcmUgeHlieiA9ICdZJyBBTkQgeXhieiA9ICdZJyBhbmQgbG93ZXIoY29kZSk9bG93ZXIoPykYDSC5Jg==","service_id":13,"time_bucket":20191210164225,"is_error":0,"segment_id":"4921.36.15759673457660020"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673461450022"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.36.15759673461450023","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":69,"end_time":1575967346214,"endpoint_id":162,"service_instance_id":4921,"version":2,"start_time":1575967346145,"data_binary":"Cg0KC7kmJKbKyNPuqv8bErYBEP///////////wEY4Zvl9+4tIKac5ffuLTCiAUADUAFYAWAheg4KB2RiLnR5cGUSA3NxbHohCgtkYi5pbnN0YW5jZRISdHlnenB0X2R6c3dqX3d3X2tmel0KDGRiLnN0YXRlbWVudBJNc2VsZWN0ICogZnJvbSBxel9kbWIgd2hlcmUgeHlieiA9ICdZJyBBTkQgeXhieiA9ICdZJyBhbmQgbG93ZXIoY29kZSk9bG93ZXIoPykYDSC5Jg==","service_id":13,"time_bucket":20191210164226,"is_error":0,"segment_id":"4921.36.15759673461450022"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673529984298"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.37.15759673529984299","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":14,"end_time":1575967353012,"endpoint_id":137,"service_instance_id":11,"version":2,"start_time":1575967352998,"data_binary":"CgwKCgslqsqf9O6q/xsSsAEQ////////////ARim0eX37i0gtNHl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6XQoMZGIuc3RhdGVtZW50Ek1zZWxlY3QgKiBmcm9tIHF6X2RtYiB3aGVyZSB4eWJ6ID0gJ1knIEFORCB5eGJ6ID0gJ1knIGFuZCBsb3dlcihjb2RlKT1sb3dlcig/KRgMIAs=","service_id":12,"time_bucket":20191210164232,"is_error":0,"segment_id":"11.37.15759673529984298"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673530124300"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.37.15759673530124301","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":12,"end_time":1575967353024,"endpoint_id":137,"service_instance_id":11,"version":2,"start_time":1575967353012,"data_binary":"CgwKCgsljJCo9O6q/xsSsAEQ////////////ARi00eX37i0gwNHl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6XQoMZGIuc3RhdGVtZW50Ek1zZWxlY3QgKiBmcm9tIHF6X2RtYiB3aGVyZSB4eWJ6ID0gJ1knIEFORCB5eGJ6ID0gJ1knIGFuZCBsb3dlcihjb2RlKT1sb3dlcig/KRgMIAs=","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.37.15759673530124300"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539631576"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.47.15759673539631577","endpoint_name":"/v4/default/registry/mi" 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Output ready 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] produce content 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] Request completed 16:40:05,484 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 6657; pos: 6657; completed: true] 16:40:05,484 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: 2561 bytes written 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "croservices/62af8840312c4750370c3ea64fd68203bf02d518/instances/1563e3d11a5f11eabd58005056b67cc4/heartbeat","latency":2,"end_time":1575967353965,"endpoint_id":146,"service_instance_id":11,"version":2,"start_time":1575967353963,"data_binary":"CgwKCgsv2LPs+O6q/xsSwwEQ////////////ARjr2OX37i0g7djl9+4tMJIBQAdQAVgDYDt6EgoLaHR0cC5tZXRob2QSA1BVVHqIAQoDdXJsEoABL3Y0L2RlZmF1bHQvcmVnaXN0cnkvbWljcm9zZXJ2aWNlcy82MmFmODg0MDMxMmM0NzUwMzcwYzNlYTY0ZmQ2ODIwM2JmMDJkNTE4L2luc3RhbmNlcy8xNTYzZTNkMTFhNWYxMWVhYmQ1ODAwNTA1NmI2N2NjNC9oZWFydGJlYXQYDCAL","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.47.15759673539631576"}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539651578"}}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.47.15759673539631577","endpoint_name":"#/v4/default/registry/microservices/62af8840312c4750370c3ea64fd68203bf02d518/instances/1563e3d11a5f11eabd58005056b67cc4/heartbeat","latency":0,"end_time":1575967353965,"endpoint_id":147,"service_instance_id":11,"version":2,"start_time":1575967353965,"data_binary":"CgwKCgsv+s/t+O6q/xsSwAMQ////////////ARjt2OX37i0g7djl9+4tKpoCCAESDAoKCy/Ys+z47qr/GyALOAtCgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzLzYyYWY4ODQwMzEyYzQ3NTAzNzBjM2VhNjRmZDY4MjAzYmYwMmQ1MTgvaW5zdGFuY2VzLzE1NjNlM2QxMWE1ZjExZWFiZDU4MDA1MDU2YjY3Y2M0L2hlYXJ0YmVhdFKAAS92NC9kZWZhdWx0L3JlZ2lzdHJ5L21pY3Jvc2VydmljZXMvNjJhZjg4NDAzMTJjNDc1MDM3MGMzZWE2NGZkNjgyMDNiZjAyZDUxOC9pbnN0YW5jZXMvMTU2M2UzZDExYTVmMTFlYWJkNTgwMDUwNTZiNjdjYzQvaGVhcnRiZWF0OoEBIy92NC9kZWZhdWx0L3JlZ2lzdHJ5L21pY3Jvc2VydmljZXMvNjJhZjg4NDAzMTJjNDc1MDM3MGMzZWE2NGZkNjgyMDNiZjAyZDUxOC9pbnN0YW5jZXMvMTU2M2UzZDExYTVmMTFlYWJkNTgwMDUwNTZiNjdjYzQvaGVhcnRiZWF0UAJYA2A7GAwgCw==","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.47.15759673539651578"}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.43.15759673490360004"}}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.43.15759673490360005","endpoint_name":"/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat","latency":3,"end_time":1575967349039,"endpoint_id":189076,"service_instance_id":4921,"version":2,"start_time":1575967349036,"data_binary":"Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm","service_id":13,"time_bucket":20191210164229,"is_error":0,"segment_id":"4921.43.15759673490360004"}[\n]" 16:40:05,484 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Request ready 16:40:05,484 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:w]: Event cleared [w] 16:40:06,073 DEBUG [FetchSessionHandler] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Node 0 sent an incremental fetch response for session 520315326 with 0 response partition(s), 1 implied partition(s) 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: 1460 bytes read 16:40:07,365 DEBUG [wire] http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "content-type: application/json; charset=UTF-8[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "content-length: 3697[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "{"took":1872,"errors":true,"items":[{"index":{"_index":"sw_segment","_type":"type","_id":"11.88.15759673496781142","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673457660020","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673461450022","_version":1,"result":"created","_shards"" 16:40:07,365 DEBUG [headers] http-outgoing-0 << HTTP/1.1 200 OK 16:40:07,365 DEBUG [headers] http-outgoing-0 << content-type: application/json; charset=UTF-8 16:40:07,365 DEBUG [headers] http-outgoing-0 << content-length: 3697 16:40:07,365 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE(1372)] Response received 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Response received HTTP/1.1 200 OK 16:40:07,365 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE(1372)] Input ready 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Consume content 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: 2325 bytes read 16:40:07,365 DEBUG [wire] http-outgoing-0 << ":{"total":1,"successful":1,"failed":0},"_seq_no":24332,"_primary_term":1,"status":201}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673529984298","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673530124300","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":24333,"_primary_term":1,"status":201}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539631576","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539651578","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.43.15759673490360004","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":24334,"_primary_term":1,"status":201}}]}" 16:40:07,365 DEBUG [InternalHttpAsyncClient] [exchange: 44] Connection can be kept alive indefinitely 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Response processed 16:40:07,365 DEBUG [InternalHttpAsyncClient] [exchange: 44] releasing connection 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Remove attribute http.nio.exchange-handler 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Releasing connection: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 0; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Connection [id: http-outgoing-0][route: {}->http://10.23.11.224:9200] can be kept alive indefinitely 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set timeout 0 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Connection released: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 1; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:07,367 DEBUG [RestClient] request [POST http://10.23.11.224:9200/_bulk?timeout=1m] returned [HTTP/1.1 200 OK] 16:40:07,367 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 3697; pos: 3697; completed: true] 16:40:08,187 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:40:08,389 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:40:11,203 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:40:11,404 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:40:14,221 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:20,774 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:41:23,589 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:23,790 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response actCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:41:38,665 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:38,867 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:13:13,402 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:13:13,605 DEBUG [NetworkClient] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Node -1 disconnected. 17:13:13,606 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:13:13,707 DEBUG [NetworkClient] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending metadata request (type=MetadataRequest, topics=compute_traceStorage, allowAutoCreate=true) to node 10.23.11.235:9092 (id: 0 rack: null) 17:13:13,907 DEBUG [Metadata] Updating last seen epoch from 0 to 0 for partition compute_traceStorage-0 17:13:13,907 DEBUG [Metadata] Updated cluster metadata version 4 to MetadataCache{cluster=Cluster(id = yQ_sRlMlSui8hlVtaPl4wg, nodes = [10.23.11.235:9092 (id: 0 rack: null)], partitions = [Partition(topic = compute_traceStorage, partition = 0, leader = 0, replicas = [0], isr = [0], offlineReplicas = [])], controller = 10.23.11.235:9092 (id: 0 rack: null))} 17:13:16,420 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:13:16, 17:15:02,170 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:15:04,683 WARN [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] This member will leave the group because consumer poll timeout has expired. This means the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time processing messages. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records. 17:15:04,683 INFO [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Member consumer-1-f8b4d0da-f83c-4849-8cfd-74e748aad3c7 sending LeaveGroup request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:15:04,683 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Disabling heartbeat thread ```
springboot绑定数据错误,希望大牛帮帮小白
### 在使用springboot从前端绑定数据的时候,出现如下错误 **图片如下** ![图片说明](https://img-ask.csdn.net/upload/201912/22/1577012041_526179.png) **内容如下:** ``` There was an unexpected error (type=Bad Request, status=400). Validation failed for object='mainCategory'. Error count: 1 org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'mainCategory' on field 'subCategories': rejected value [[SubCategory{id=1, name='课后作业'}, SubCategory{id=2, name='实验报告'}, SubCategory{id=3, name='课堂课件'}]]; codes [typeMismatch.mainCategory.subCategories,typeMismatch.subCategories,typeMismatch.java.util.List,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [mainCategory.subCategories,subCategories]; arguments []; default message [subCategories]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.List' for property 'subCategories'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'com.zjq.hbut.csdn.entity.SubCategory' for property 'subCategories[0]': no matching editors or conversion strategy found] ``` ## **前端代码如下** ``` <form action="" class="ui form" th:object="${mainCategory}" th:action="*{id}==null ? @{/admin/type/add}:@{/admin/type/add/{id}(id=*{id})}" method="post"> <input type="hidden" name="id" th:value="*{id}"> <input type="hidden" name="subCategories" th:value="*{subCategories}"> <div class="required field"> <div class="ui left labeled input"> <label class="ui teal basic label">名称</label> <input type="text" name="name" placeholder="名称..." th:value="*{name}"> </div> </div> <div class="ui right aligned container"> <!--onclick事件返回上一个页面--> <button type="button" class="ui button" onclick="window.history.go(-1)">返回</button> <button class="ui teal submit button">提交</button> </div> </form> ``` ## **后端Controller代码如下** ``` @PostMapping({"/type/add","/type/add/{id}"}) public String add(@Valid MainCategory mainCategory, BindingResult result, @PathVariable(name = "id",required = false)Long id, @RequestParam(name = "subCategories") String subCategories, RedirectAttributes attributes) { if(imainCategoryService.getByName(mainCategory.getName())!=null) { result.rejectValue("name","nameError","该标签已存在"); } if(result.hasErrors()) { System.out.println(result.getAllErrors()); return "admin/type-input"; } if(id!=null&&id>0) {//修改 MainCategory update = imainCategoryService.update(mainCategory); if(update==null) { attributes.addFlashAttribute("message","更新成功"); }else { attributes.addFlashAttribute("message","更新失败"); } return "redirect:/admin/type"; }else { //新增 MainCategory save = imainCategoryService.save(mainCategory); if(save==null) { attributes.addFlashAttribute("message","保存成功"); }else { attributes.addFlashAttribute("message","保存失败"); } return "redirect:/admin/type"; } } ``` ## **实体类代码如下** ``` package com.zjq.hbut.csdn.entity; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "t_maincategory") public class MainCategory { @Id @GeneratedValue private Long id; private String name; @ManyToMany private List<SubCategory> subCategories=new ArrayList<>(); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<SubCategory> getSubCategories() { return subCategories; } public void setSubCategories(List<SubCategory> subCategories) { this.subCategories = subCategories; } @Override public String toString() { return "MainCategory{" + "id=" + id + ", name='" + name + '\'' + ", subCategories=" + subCategories + '}'; } } ```
Judges's Final Problem 怎么编写呢
Problem Description For any ACM/ICPC participant, it is always discouraging to discover that the real problems they face in the programming world are seldom as interesting as the tasks they face in the algorithm-related contests. While the efficiency of your algorithm is certainly vital to the overall system, still it is seldom valued so much as other factors such as readability, and the ability of coding accurately often takes precedence in many projects. Still, we judges believe that a balance between these two can be achieved - a good programmer should be able to come up with code that is fast, reliable and readable in a reasonable amount of time - and that is why you, the contestant, is asked to solve the problem of building a ranking system for us. You're probably familiar with the following paragraph taken from Rules of ACM/ICPC: A problem is solved when it is accepted by the judges. Teams are ranked according to the most problems solved. Teams who solve the same number of problems are ranked by least total time. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the accepted run plus 20 penalty minutes for every rejected run for that problem regardless of submittal time. There is no time consumed for a problem that is not solved. During a contest, the following kinds of requests might be submitted by participants: Submission (Format: S [minute]:[Team No]:[Problem ID]:[Result]) If a team submits a problem which they have already solved, then this submission should be considered invalid and ignored by your system; otherwise, the submission is valid and saved for further processing - if the result is 1 (Correct), then this submission should be considered accepted by the system. Query a team's place on the rank list. (Format: R [Team No]) Sort the teams according to the contest rules mentioned above. A tie may occur between two teams who solved equal number of problems and same penalty. Two teams who solved same number of problems and have same penalty should always have same rank; however, when querying the Kth team on the rank list, even if many teams share the same rank, only one team should be printed (please refer to the rule given below). Query the Kth team on the rank list. (Format: T [k]) If a tie occurs, return the team with the minimum last accepted submission time. Note that the submission time of two teams might be different (i.e., in seconds) even though it may appear otherwise in the input. Initially every team has no submissions, and the contest will last no more than 5 hours. Input There are multiple test cases in the input. Each test case starts with two integers, N and M, (1 <= N <= 10000, 1 <= M <= 10), the number of teams participating in the competition, and the total number of problems in the contest. Teams are numbered from 0 to N - 1. Each of the following lines is either in one of the three formats listed above, or a single line "Contest Ends" followed by an empty line indicating the end of current test case. It is guaranteed that there are no more than 100000 requests in each test case. Input ends with End-of-File. Output For every submission request, if the submitted program is accepted, you need to output a line whose format is [Team No] [Problem ID]; for every query about team's place on the rank list, output the result in one single line; for every query about the team with the Kth highest score, if a team is found, output a line with one integer, the number of the team, or -1 if you are unable to find such a team. Please print a blank line after each test case. Sample Input 5 8 T 1 T 2 S 5:0:A:0 S 8:0:A:1 S 9:1:B:1 S 15:0:A:1 T 1 T 2 T 3 R 0 R 1 R 2 R 3 Contest Ends Sample Output 0 -1 [0][A] [1][B] 1 0 2 1 0 2 2
Judges's Final Problem 怎么写啊
Problem Description For any ACM/ICPC participant, it is always discouraging to discover that the real problems they face in the programming world are seldom as interesting as the tasks they face in the algorithm-related contests. While the efficiency of your algorithm is certainly vital to the overall system, still it is seldom valued so much as other factors such as readability, and the ability of coding accurately often takes precedence in many projects. Still, we judges believe that a balance between these two can be achieved - a good programmer should be able to come up with code that is fast, reliable and readable in a reasonable amount of time - and that is why you, the contestant, is asked to solve the problem of building a ranking system for us. You're probably familiar with the following paragraph taken from Rules of ACM/ICPC: A problem is solved when it is accepted by the judges. Teams are ranked according to the most problems solved. Teams who solve the same number of problems are ranked by least total time. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the accepted run plus 20 penalty minutes for every rejected run for that problem regardless of submittal time. There is no time consumed for a problem that is not solved. During a contest, the following kinds of requests might be submitted by participants: Submission (Format: S [minute]:[Team No]:[Problem ID]:[Result]) If a team submits a problem which they have already solved, then this submission should be considered invalid and ignored by your system; otherwise, the submission is valid and saved for further processing - if the result is 1 (Correct), then this submission should be considered accepted by the system. Query a team's place on the rank list. (Format: R [Team No]) Sort the teams according to the contest rules mentioned above. A tie may occur between two teams who solved equal number of problems and same penalty. Two teams who solved same number of problems and have same penalty should always have same rank; however, when querying the Kth team on the rank list, even if many teams share the same rank, only one team should be printed (please refer to the rule given below). Query the Kth team on the rank list. (Format: T [k]) If a tie occurs, return the team with the minimum last accepted submission time. Note that the submission time of two teams might be different (i.e., in seconds) even though it may appear otherwise in the input. Initially every team has no submissions, and the contest will last no more than 5 hours. Input There are multiple test cases in the input. Each test case starts with two integers, N and M, (1 <= N <= 10000, 1 <= M <= 10), the number of teams participating in the competition, and the total number of problems in the contest. Teams are numbered from 0 to N - 1. Each of the following lines is either in one of the three formats listed above, or a single line "Contest Ends" followed by an empty line indicating the end of current test case. It is guaranteed that there are no more than 100000 requests in each test case. Input ends with End-of-File. Output For every submission request, if the submitted program is accepted, you need to output a line whose format is [Team No] [Problem ID]; for every query about team's place on the rank list, output the result in one single line; for every query about the team with the Kth highest score, if a team is found, output a line with one integer, the number of the team, or -1 if you are unable to find such a team. Please print a blank line after each test case. Sample Input 5 8 T 1 T 2 S 5:0:A:0 S 8:0:A:1 S 9:1:B:1 S 15:0:A:1 T 1 T 2 T 3 R 0 R 1 R 2 R 3 Contest Ends Sample Output 0 -1 [0][A] [1][B] 1 0 2 1 0 2 2
Essay Scoring System 程序代码
Problem Description Professor Binns has finally got tired of scoring essays himself and implemented an automatic essay scoring system to help him screen the numerous essays. Strongly against such an idea, you decided to generate a meaningless essay which can get high mark in his system to prove that his system does not work at all. You've obtained the rules used by Binns's system to score the essay, they're as follows: a) The word in the essay must be from a particular set of words. If not, the essay will receive a score zero and is automatically rejected. b) Every word in the specified set has a positive integer associated with it, indicating the score the submitter will get for using that word once. c) A word can be used in several different ways; for example, in English, the word “word” can be used as both a noun and a verb. Every occurrence of specific patterns (like verb – adjective – noun) will earn the submitter a particular score. In particular, it is allowed for a word to be interpreted in different ways in different patterns. You're interested in generating an essay of a specified length with maximum possible score. Input There are multiple test cases in the input file. Each test case starts with three integers N, M and K, (1 <= N <= 100, 0 <= M <= 8, 0 <= K <= 6), the length of the essay to generate, the number of words in the dictionary and the number of patterns, respectively. The following M lines describe the words in the dictionary; each line consists of two integers, Wi, and Ti, (0 <= Wi <= 2000, 1 <= Ti <= 5), representing the score submitter gets every time he/she uses the word, and the number of ways the word can be used. The next part of the input describes the patterns. Each of the K lines describes one pattern, beginning with two integers, Wi, and Ci, (0 <= Wi <= 2000, 1 <= Ci <= 6), indicating the score one can get every time the pattern is used, and the number of consecutive parts in the pattern; followed by Ci integers describing the language parts in the pattern. It is guaranteed that the total number of ways to use a word does not exceed 5; furthermore, the total number of parts contained in all patterns (sum of all Cis) will not exceed 25. There is a blank line after each test case. Input ends with End-of-File. Output For every test case, you should output one integer on a separate line, the maximum score one can get, in the format as indicated in the sample output. Sample Input 2 3 2 4 3 0 1 2 5 2 2 3 1 2 0 4 1 2 1 3 10 2 4 2 2 3 2 4 3 0 1 2 5 2 2 3 1 2 0 4 1 2 1 3 2 2 4 2 Sample Output Case 1: 16 Case 2: 10
Model Rocket Height 代码
Problem Description Just when you thought we had run out of model rocket height problems… Yet another method used to determine the height achieved by a model rocket is the vertical line method. Two observers A and B are spaced D feet apart along a base line along one edge of the flat test field. The launch latform is equidistant from observers A and B and L feet from the base line. Each observer has a theodolite or some other device for measuring angle above the horizontal (elevation angle) of a distant object and the azimuth angle (the angle the vertical plane of the sight line makes with the line from A through B measured counter-clockwise). Each measuring device is on a stand. A’s device is HA feet above the level of the launch platform and B’s device is HB feet above the level of the launch platform. When a rocket is fired, near the top of its flight, it deploys a parachute and emits a puff of smoke. Each observer measures the elevation angle and azimuth angle of the puff of smoke from their location. If the peak location is on the wrong side of the baseline or outside the lines determined by A and B perpendicular to the base line, it is out of bounds and disqualified. From this information, the height of the rocket may be determined as follows: Each sight line determines a vertical plane. These two planes intersect in a vertical line (thus the name of the method). Each sight line intersects this vertical line in a point. If these points are more than ERRDIST feet apart, an error is assumed and the flight is rejected. Otherwise, the point halfway between the two points where a sight line intersects the vertical line is computed. The rocket height is the distance of this midpoint above the launch platform. You must write a program which, given the parameters D (the distance in feet between observers A and B), L (the distance in feet from the base line to the launch platform), HA (the distance of the measuring device A above the launch platform in feet), HB (the distance of the measuring device B above the launch platform in feet), ERRDIST (the maximum distance between the intersection points of a sight line with the vertical line), α (the elevation angle of the rocket in degrees measured by the left observer A), β (the elevation angle of the rocket in degrees observed by the right observer B), γ (the azimuth angle in degrees measured by the left observer A) and δ (the azimuth angle in degrees measured by the right observer B), computes the height of the rocket above the launch platform in feet to the nearest foot. Input The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of datasets that follow. The second line contains the parameters D, L, HA, HB and ERRDIST in that order as (floating point) decimal values. These values would be measured once at the beginning of the day and remain fixed through all rocket shots. Each succeeding line of input represents a single dataset. Each dataset will contain the angles α, β, γ and δ in that order (measured in degrees) as (floating point) decimal values for a rocket shot. Output For each dataset of four angles, the output consists of a single line . If angles α, β and γ are not strictly between 0 and 90 degrees or δ is not strictly between 90 degrees and 180 degrees, the line should contain the dataset number, a space and the word “DISQUALIFIED” (without the quotes). Otherwise, if the distance between the intersection points of a sight line with the vertical line is more that ERRDIST feet, the line should contain the dataset number, a space and the word “ERROR” (without the quotes). Otherwise, the line should contain the dataset number, a space and the height above the launch platform in feet to the nearest foot. Sample Input 4 100.0 300.0 5.25 2.92 5.00 40.1 36.2 35.3 151.6 64.9 71.1 15.7 160.1 44.9 41.2 33.1 152.5 44.9 41.2 33.1 52.5 Sample Output 1 50 2 ERROR 3 58 4 DISQUALIFIED
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了无数
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
MyBatis研习录(01)——MyBatis概述与入门
C语言自学完备手册(33篇) Android多分辨率适配框架 JavaWeb核心技术系列教程 HTML5前端开发实战系列教程 MySQL数据库实操教程(35篇图文版) 推翻自己和过往——自定义View系列教程(10篇) 走出思维困境,踏上精进之路——Android开发进阶精华录 讲给Android程序员看的前端系列教程(40集免费视频教程+源码) 版权声明 本文原创作者:谷哥的小弟 作者博客
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
Python绘图,圣诞树,花,爱心 | Turtle篇
1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle() circle.shape('circle') circle.color('red') circle.speed('fastest') circle.up() square = turtle.Turtle()
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
web前端javascript+jquery知识点总结
Javascript javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ,语法同java类似,是一种解释性语言,边执行边解释。 JavaScript的组成: ECMAScipt 用于描述: 语法,变量和数据类型,运算符,逻辑控制语句,关键字保留字,对象。 浏览器对象模型(Br
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
文章目录1. 前言2. 数据下载3. 数据处理4. 数据可视化 1. 前言 今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。 2月6日追记:本文发布后,腾讯的数据源多次变更u
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
渗透测试-灰鸽子远控木马
木马概述 灰鸽子( Huigezi),原本该软件适用于公司和家庭管理,其功能十分强大,不但能监视摄像头、键盘记录、监控桌面、文件操作等。还提供了黑客专用功能,如:伪装系统图标、随意更换启动项名称和表述、随意更换端口、运行后自删除、毫无提示安装等,并采用反弹链接这种缺陷设计,使得使用者拥有最高权限,一经破解即无法控制。最终导致被黑客恶意使用。原作者的灰鸽子被定义为是一款集多种控制方式于一体的木马程序
Python:爬取疫情每日数据
前言 有部分同学留言说为什么412,这是因为我代码里全国的cookies需要你自己打开浏览器更新好后替换,而且这个cookies大概只能持续20秒左右! 另外全国卫健委的数据格式一直在变,也有可能会导致爬取失败! 我现在已根据2月14日最新通报稿的格式修正了! 目前每天各大平台,如腾讯、今日头条都会更新疫情每日数据,他们的数据源都是一样的,主要都是通过各地的卫健委官网通报。 为什么已经有大量平台做
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告(本文) 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
粒子群算法求解物流配送路线问题(python)
粒子群算法求解物流配送路线问题(python) 1.查找论文文献 找一篇物流配送路径优化+粒子群算法求解的论文 参考文献:基于混沌粒子群算法的物流配送路径优化 2.了解粒子群算法的原理 讲解通俗易懂,有数学实例的博文:https://blog.csdn.net/daaikuaichuan/article/details/81382794 3.确定编码方式和解码策略 3.1编码方式 物流配送路线的
教你如何编写第一个简单的爬虫
很多人知道爬虫,也很想利用爬虫去爬取自己想要的数据,那么爬虫到底怎么用呢?今天就教大家编写一个简单的爬虫。 下面以爬取笔者的个人博客网站为例获取第一篇文章的标题名称,教大家学会一个简单的爬虫。 第一步:获取页面 #!/usr/bin/python # coding: utf-8 import requests #引入包requests link = "http://www.santostang.
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
相关热词 c#怎么获得线程名 c# usb 采集器 c# csv 读取 c# sort() c# 关闭io流 c# 响应函数 插入 c#面对对象的三大特性 c# 打印 等比缩放 c#弹出右键菜单 c#1如何搞成01
立即提问