file_id stringlengths 5 9 | content stringlengths 24 16.1k | repo stringlengths 8 84 | path stringlengths 7 167 | token_length int64 18 3.48k | original_comment stringlengths 5 2.57k | comment_type stringclasses 2
values | detected_lang stringclasses 1
value | masked_comment stringlengths 11 16.1k | excluded bool 1
class | file-tokens-Qwen/Qwen2-7B int64 14 3.27k | comment-tokens-Qwen/Qwen2-7B int64 2 1.74k | file-tokens-bigcode/starcoder2-7b int64 18 3.48k | comment-tokens-bigcode/starcoder2-7b int64 2 2.11k | file-tokens-google/codegemma-7b int64 14 3.57k | comment-tokens-google/codegemma-7b int64 2 1.75k | file-tokens-ibm-granite/granite-8b-code-base int64 18 3.48k | comment-tokens-ibm-granite/granite-8b-code-base int64 2 2.11k | file-tokens-meta-llama/CodeLlama-7b-hf int64 31 3.93k | comment-tokens-meta-llama/CodeLlama-7b-hf int64 4 2.71k | excluded-based-on-tokenizer-Qwen/Qwen2-7B bool 2
classes | excluded-based-on-tokenizer-bigcode/starcoder2-7b bool 2
classes | excluded-based-on-tokenizer-google/codegemma-7b bool 2
classes | excluded-based-on-tokenizer-ibm-granite/granite-8b-code-base bool 2
classes | excluded-based-on-tokenizer-meta-llama/CodeLlama-7b-hf bool 2
classes | include-for-inference bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40303_1 | package CommonAPI;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexDemo {
public static void main(String[] args) {
/* 有如下文本: “当好中国式现代化建设的坚定行动派、实干家”,
这是习近平总书记提出的明确要求。全国两会结束不到一周,习近平总书记赴湖南考察,
并在长沙主持召开新时代推动中部地区崛起座谈会,强调“地方党委和政府要扛起主体责任,
坚决贯彻党中央决策部署,推动重点工作任务、重大改革事项落实... | Alex-hwang/AdvancedPart | src/CommonAPI/RegexDemo.java | 664 | //要统计国字出现的次数 | line_comment | zh-cn | package CommonAPI;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexDemo {
public static void main(String[] args) {
/* 有如下文本: “当好中国式现代化建设的坚定行动派、实干家”,
这是习近平总书记提出的明确要求。全国两会结束不到一周,习近平总书记赴湖南考察,
并在长沙主持召开新时代推动中部地区崛起座谈会,强调“地方党委和政府要扛起主体责任,
坚决贯彻党中央决策部署,推动重点工作任务、重大改革事项落实... | false | 504 | 8 | 662 | 8 | 591 | 7 | 664 | 8 | 924 | 11 | false | false | false | false | false | true |
38876_7 | package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.SplitPane;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import jav... | AlexFanw/HUSTER-CS | Java实验/java实验二/hospital/src/sample/ControllerLoginPatient.java | 878 | //获取登陆时间 | line_comment | zh-cn | package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.SplitPane;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import jav... | false | 724 | 4 | 878 | 5 | 936 | 4 | 878 | 5 | 1,137 | 9 | false | false | false | false | false | true |
21010_3 | package com.swagger.offline.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @version V1.0
* @Title:
* @ClassName: User.java
* @Description:
* @Copyright 2016-2018 - Powered By 研发中心
* @author: 王延飞
* @date: 2018-01-22 16:06
*/
@ApiModel(value = "User", descr... | AlexFly666/SwaggerOfflineDoc | src/main/java/com/swagger/offline/model/User.java | 467 | /**
* 年龄
*/ | block_comment | zh-cn | package com.swagger.offline.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @version V1.0
* @Title:
* @ClassName: User.java
* @Description:
* @Copyright 2016-2018 - Powered By 研发中心
* @author: 王延飞
* @date: 2018-01-22 16:06
*/
@ApiModel(value = "User", descr... | false | 433 | 9 | 467 | 8 | 511 | 9 | 467 | 8 | 612 | 12 | false | false | false | false | false | true |
60226_8 | //创建回形矩阵
/**
* 具体思路:
* 一共三个部分,填充数字、确定方向、打印数字
* 使用switch根据方向填充数字(二维数组)
* 通过判断转弯条件实现控制方向
* 利用循环打印二维数组
*/
public class ch1_8{
static enum Direction{
Right,Down,Left,Up;
}//方向是常量,用枚举
//创建填充数字方法
public static void initialArray() {
int row=0, col=0;//第一个数字
for (int c=0; c<length*length;c++) {
snake[row][... | AlexLee522/100-examples-of-Java-interesting-programming- | ch1_8.java | 724 | //如果向下到尽头则向左 | line_comment | zh-cn | //创建回形矩阵
/**
* 具体思路:
* 一共三个部分,填充数字、确定方向、打印数字
* 使用switch根据方向填充数字(二维数组)
* 通过判断转弯条件实现控制方向
* 利用循环打印二维数组
*/
public class ch1_8{
static enum Direction{
Right,Down,Left,Up;
}//方向是常量,用枚举
//创建填充数字方法
public static void initialArray() {
int row=0, col=0;//第一个数字
for (int c=0; c<length*length;c++) {
snake[row][... | false | 638 | 8 | 724 | 10 | 718 | 9 | 724 | 10 | 1,011 | 13 | false | false | false | false | false | true |
18351_11 | package common.dp;
/**
* @author luoyuntian
* @program: p40-algorithm
* @description: 背包问题
* @date 2022-02-27 14:57:21
*/
public class Knapsack {
public static int maxValue1(int [] weight,int[] value,int bagLimit){
return process1(weight,value,0,bagLimit);
}
// 递归实现
// 在0 .... n-1中0...in... | AlexNOCoder/p40-algorithm | src/main/java/common/dp/Knapsack.java | 773 | // 第二种选择:当前index位置的货,要 | line_comment | zh-cn | package common.dp;
/**
* @author luoyuntian
* @program: p40-algorithm
* @description: 背包问题
* @date 2022-02-27 14:57:21
*/
public class Knapsack {
public static int maxValue1(int [] weight,int[] value,int bagLimit){
return process1(weight,value,0,bagLimit);
}
// 递归实现
// 在0 .... n-1中0...in... | false | 703 | 13 | 773 | 13 | 810 | 12 | 773 | 13 | 964 | 21 | false | false | false | false | false | true |
34774_0 | import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.... | AlexanderChiuluvB/DistrubutedSystemProject | demo/src/main/java/Swagger2.java | 299 | //为当前包路径 | line_comment | zh-cn | import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.... | false | 250 | 5 | 299 | 5 | 306 | 5 | 299 | 5 | 378 | 9 | false | false | false | false | false | true |
16014_4 | package array;
import java.util.*;
/**
* @author Fer
* date 2022/8/22
*/
public class ThreeSum {
/**
* 在给定数组中找出不重复的三个数,使得 a + b + c = 0
* 思想:暴力解法,三次循环 + 去重(会超时)
* 优化:先将数组排序,减少重复枚举的次数,对于每一重循环,相邻两次枚举的元素不能相同
* 双指针(第二重和第三重循环并列)
*/
public List<List<Integer>> threeSum(int[] nums) {
... | AlivinFer/leetcode-Java | src/array/ThreeSum.java | 668 | // 保证 b 的指针在 c 的指针左侧 | line_comment | zh-cn | package array;
import java.util.*;
/**
* @author Fer
* date 2022/8/22
*/
public class ThreeSum {
/**
* 在给定数组中找出不重复的三个数,使得 a + b + c = 0
* 思想:暴力解法,三次循环 + 去重(会超时)
* 优化:先将数组排序,减少重复枚举的次数,对于每一重循环,相邻两次枚举的元素不能相同
* 双指针(第二重和第三重循环并列)
*/
public List<List<Integer>> threeSum(int[] nums) {
... | false | 615 | 13 | 667 | 12 | 718 | 11 | 668 | 12 | 884 | 25 | false | false | false | false | false | true |
31203_2 | import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.clien... | Allenhua/HzauStudy | src/HttpMonitor.java | 1,486 | //在此输入你的密码 | line_comment | zh-cn | import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.clien... | false | 1,263 | 5 | 1,486 | 6 | 1,538 | 5 | 1,486 | 6 | 1,806 | 9 | false | false | false | false | false | true |
60261_15 | package greed_game;
import java.util.Random;
public class PlayerManager {
public void start(Player[] players,int playerNum,Dices dices) {
sortPlayers(players,playerNum);
boolean gameOver = false;
int playerIdx=-1;
/*全部人还没入局*/
do {
playerIdx = (playerIdx+1)%player... | Alnitak-Antares/Greed-Dice-Game | PlayerManager.java | 1,269 | //“宣布胜者,本局游戏结束” | line_comment | zh-cn | package greed_game;
import java.util.Random;
public class PlayerManager {
public void start(Player[] players,int playerNum,Dices dices) {
sortPlayers(players,playerNum);
boolean gameOver = false;
int playerIdx=-1;
/*全部人还没入局*/
do {
playerIdx = (playerIdx+1)%player... | false | 1,105 | 11 | 1,269 | 13 | 1,361 | 11 | 1,269 | 13 | 1,574 | 24 | false | false | false | false | false | true |
47621_2 | package dt08;
import java.net.*;
import java.io.*;
// 建立SocketServer,监听 9001端口
// 客户端连接到SocketServer后,Server显示客户端发送过来的字符串
// 客户端发来 exit 字串,则断开连接
public class ChatServer1 {
public static void main(String[] args) throws IOException, InterruptedException {
final int port = 9001;
ServerSocket ss = new ServerSoc... | AlohaWorld/Lessons4JavaSE | src/dt08/ChatServer1.java | 270 | // 客户端发来 exit 字串,则断开连接 | line_comment | zh-cn | package dt08;
import java.net.*;
import java.io.*;
// 建立SocketServer,监听 9001端口
// 客户端连接到SocketServer后,Server显示客户端发送过来的字符串
// 客户 <SUF>
public class ChatServer1 {
public static void main(String[] args) throws IOException, InterruptedException {
final int port = 9001;
ServerSocket ss = new ServerSocket(port);
... | false | 248 | 14 | 270 | 14 | 285 | 13 | 270 | 14 | 345 | 19 | false | false | false | false | false | true |
28791_17 | import java.io.*;
import java.security.*;
import java.lang.reflect.*;
import javax.crypto.*;
import javax.crypto.spec.*;
public class MyClassLoader extends ClassLoader {
// 这些对象在构造函数中设置,
// 以后loadClass()方法将利用它们解密类
private SecretKey key;
private Cipher cipher;
// 设置解密所需要的对象
public MyClassLoader(SecretKey key) th... | AloneMonkey/JarEncrypt | ClassLoader/MyClassLoader.java | 992 | // 如果类已经在系统缓冲之中,不必再次装入它
| line_comment | zh-cn | import java.io.*;
import java.security.*;
import java.lang.reflect.*;
import javax.crypto.*;
import javax.crypto.spec.*;
public class MyClassLoader extends ClassLoader {
// 这些对象在构造函数中设置,
// 以后loadClass()方法将利用它们解密类
private SecretKey key;
private Cipher cipher;
// 设置解密所需要的对象
public MyClassLoader(SecretKey key) th... | false | 874 | 14 | 987 | 19 | 953 | 14 | 987 | 19 | 1,296 | 29 | false | false | false | false | false | true |
58182_8 | package com.demo.app.hybrid.core;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.Service;
import android.content.Context;
import android.content.SharedPreferences;
import ... | AlpacaNotSheep/hybrid | Android/core/Cookie.java | 1,570 | //超时时间 | line_comment | zh-cn | package com.demo.app.hybrid.core;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.Service;
import android.content.Context;
import android.content.SharedPreferences;
import ... | false | 1,312 | 4 | 1,570 | 3 | 1,568 | 3 | 1,570 | 3 | 1,998 | 5 | false | false | false | false | false | true |
46571_0 | class Member{ //员工
// 两个字段
private String memId;
private String memName;
private Dept dept;
// 构造方法
public Member(){}
public Member(String memId,String memName){
this.memId = memId;
this.memName = memName;
}
public void setDept(Dept dept){
this.dept = dept ;
}
public Dept getDept(){
return this.... | AlvaWymer/-02_final | TestThree.java | 1,801 | // 两个字段 | line_comment | zh-cn | class Member{ //员工
// 两个 <SUF>
private String memId;
private String memName;
private Dept dept;
// 构造方法
public Member(){}
public Member(String memId,String memName){
this.memId = memId;
this.memName = memName;
}
public void setDept(Dept dept){
this.dept = dept ;
}
public Dept getDept(){
return t... | false | 1,492 | 4 | 1,801 | 4 | 1,761 | 4 | 1,801 | 4 | 2,202 | 6 | false | false | false | false | false | true |
52824_14 | package cn.mldn.shiro.realm;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.s... | AlvaWymer/Shiro-Demo | Shiro-Auth/src/main/java/cn/mldn/shiro/realm/MyDefaultRealm.java | 843 | // 随后还需要考虑用户被锁定的问题 | line_comment | zh-cn | package cn.mldn.shiro.realm;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.s... | false | 708 | 11 | 843 | 12 | 804 | 10 | 843 | 12 | 1,164 | 25 | false | false | false | false | false | true |
17317_2 |
/******
* 快速排序
*
* 分治思想
*
*
* 设要排序的数组是A[0]⋯⋯A[N-1],首先任意选取一个数据(通常选用第1个数据)作为关键数据,
* 然后将所有比它小的数都放到它前面,所有比它大的数都放到它后面,
* 这个过程称为一趟快速排序。值得注意的是,快速排序不是一种稳定的排序算法,
* 也就是说,多个相同的值的相对位置也许会在算法结束时产生变动。
一趟快速排序的算法是:
1)设置两个变量i、j,排序开始的时候:i=0,j=N-1;
2)以第一个数组元素作为关键数据,赋值给key,即key=A[0];
3)从j开始向前搜索,即由后开始向前搜索(j -- ),找到第一个小于key的值A... | AlvaWymer/test1 | QuickSort.java | 812 | //分为两部分,一个是左部分,一个是右部分 | line_comment | zh-cn |
/******
* 快速排序
*
* 分治思想
*
*
* 设要排序的数组是A[0]⋯⋯A[N-1],首先任意选取一个数据(通常选用第1个数据)作为关键数据,
* 然后将所有比它小的数都放到它前面,所有比它大的数都放到它后面,
* 这个过程称为一趟快速排序。值得注意的是,快速排序不是一种稳定的排序算法,
* 也就是说,多个相同的值的相对位置也许会在算法结束时产生变动。
一趟快速排序的算法是:
1)设置两个变量i、j,排序开始的时候:i=0,j=N-1;
2)以第一个数组元素作为关键数据,赋值给key,即key=A[0];
3)从j开始向前搜索,即由后开始向前搜索(j -- ),找到第一个小于key的值A... | false | 678 | 12 | 812 | 15 | 785 | 12 | 812 | 15 | 1,066 | 20 | false | false | false | false | false | true |
55801_0 | /**
*
*/
package entity;
import java.awt.Point;
import java.util.Random;
import util.GameMethod;
import config.GameConfig;
/**
* 俄罗斯方块的抽象类,成员:能否旋转,需要几个坐标(方块)组成,初始形态(竖的或横的) 方法:下落、位移、旋转
*
* @author phx
*/
public abstract class Tetriminos {
public static int MIN_X = GameConfig.getSYSTEM().getMinX();
public ... | Alwayswithme/JavaTetris | src/entity/Tetriminos.java | 793 | /**
* 俄罗斯方块的抽象类,成员:能否旋转,需要几个坐标(方块)组成,初始形态(竖的或横的) 方法:下落、位移、旋转
*
* @author phx
*/ | block_comment | zh-cn | /**
*
*/
package entity;
import java.awt.Point;
import java.util.Random;
import util.GameMethod;
import config.GameConfig;
/**
* 俄罗斯 <SUF>*/
public abstract class Tetriminos {
public static int MIN_X = GameConfig.getSYSTEM().getMinX();
public static int MAX_X = GameConfig.getSYSTEM().getMaxX();
protected... | false | 663 | 52 | 793 | 66 | 803 | 54 | 793 | 66 | 938 | 93 | false | false | false | false | false | true |
62045_3 | package com.order.dao;
import java.util.Set;
import com.order.entity.Message;
import com.order.entity.Orders;
import com.order.entity.User;
import com.order.entity.UserInfo;
public interface UserDao extends Dao{
/**
* 通过传入的部分用户信息来找回密码
* @param user
* @return
*/
public User getPasswd(User user);
/**
* 根据... | AmazingT/OrderSystem | src/com/order/dao/UserDao.java | 416 | /**
* 通过邮箱判断用户是否存在
*/ | block_comment | zh-cn | package com.order.dao;
import java.util.Set;
import com.order.entity.Message;
import com.order.entity.Orders;
import com.order.entity.User;
import com.order.entity.UserInfo;
public interface UserDao extends Dao{
/**
* 通过传入的部分用户信息来找回密码
* @param user
* @return
*/
public User getPasswd(User user);
/**
* 根据... | false | 377 | 12 | 416 | 11 | 437 | 12 | 416 | 11 | 554 | 24 | false | false | false | false | false | true |
41951_21 |
//数组的引出
//
public class Array01 {
//编写一个main方法
public static void main(String[] args) {
/*
它们的体重分别是3kg,5kg,1kg,3.4kg,2kg,50kg 。
请问这六只鸡的总体重是多少?平均体重是多少?
思路分析
1. 定义六个变量 double , 求和 得到总体重
2. 平均体重 = 总体重 / 6
3. 分析传统实现的方式问题. 6->600->566
4. 引出新的技术 -> 使用数组来解决.
*/
// double hen1 = 3;
// double hen... | Ambrogram/https---github.com-Ambrogram-INFO6205 | Array01.java | 747 | //1. 我们可以通过 hens[下标] 来访问数组的元素 | line_comment | zh-cn |
//数组的引出
//
public class Array01 {
//编写一个main方法
public static void main(String[] args) {
/*
它们的体重分别是3kg,5kg,1kg,3.4kg,2kg,50kg 。
请问这六只鸡的总体重是多少?平均体重是多少?
思路分析
1. 定义六个变量 double , 求和 得到总体重
2. 平均体重 = 总体重 / 6
3. 分析传统实现的方式问题. 6->600->566
4. 引出新的技术 -> 使用数组来解决.
*/
// double hen1 = 3;
// double hen... | false | 716 | 19 | 747 | 17 | 699 | 16 | 747 | 17 | 989 | 27 | false | false | false | false | false | true |
26557_5 | public class DoubleNode {
DoubleNode prev = this;
DoubleNode next = this;
int data;
public DoubleNode(int data){
this.data = data;
}
//增加节点
public void after(DoubleNode node){
//原来的下一个节点
DoubleNode nextNext = next;
//把新节点作为当前节点的前一个节点
this.next = node;
... | Ameesha15/DSA-ALGORITHMS | DoubleNode.java | 201 | //让原来的下一个节点的上一个节点做新节点 | line_comment | zh-cn | public class DoubleNode {
DoubleNode prev = this;
DoubleNode next = this;
int data;
public DoubleNode(int data){
this.data = data;
}
//增加节点
public void after(DoubleNode node){
//原来的下一个节点
DoubleNode nextNext = next;
//把新节点作为当前节点的前一个节点
this.next = node;
... | false | 188 | 12 | 201 | 14 | 219 | 11 | 201 | 14 | 277 | 24 | false | false | false | false | false | true |
34360_50 | package java_work0202;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class CatApp {
public static void main(String[] args) {
//今回で言えば、猫の種類はランダムに決める必要があるのでRandomインスタンス
//ユーザーからの入力を受け取るのでScannerインスタンスが必要となる
Random rand = new Random();
Scanner sc = new Scanner(System.in)... | AmiOshima0130/java_work | CatApp.java | 2,102 | //%s:文字列、%d:整数。%f:少数、%n:改行 | line_comment | zh-cn | package java_work0202;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class CatApp {
public static void main(String[] args) {
//今回で言えば、猫の種類はランダムに決める必要があるのでRandomインスタンス
//ユーザーからの入力を受け取るのでScannerインスタンスが必要となる
Random rand = new Random();
Scanner sc = new Scanner(System.in)... | false | 1,716 | 23 | 2,110 | 22 | 1,689 | 22 | 2,102 | 22 | 2,862 | 27 | false | false | false | false | false | true |
27852_6 | 前言部分:
1.concurentHashmap在jdk8以前,使用的是分段锁的设计理念来完成并发控制,1.8进行了一次非常大幅度的改版,原因有下:
(1).synchronized关键字 -- 1.8对synchronized的优化已经足够好,以至于不需要用segment来增强并发
(2).类似于hashmap在1.8的增强,concurenthashmap也在出现hash冲突过多的时候采用红黑树的方式来降低query的时间
2.这里为什么分析transfer方法呢:
(1).transfer方法是concurenthashmap里最复杂的方法
(2).transfer方法在1.8的... | Amnesiacs/Dubbo-Code | 顺道分享java源码解析/transfer.java | 2,020 | //构造一个连节点指针 用于标志位 | line_comment | zh-cn | 前言部分:
1.concurentHashmap在jdk8以前,使用的是分段锁的设计理念来完成并发控制,1.8进行了一次非常大幅度的改版,原因有下:
(1).synchronized关键字 -- 1.8对synchronized的优化已经足够好,以至于不需要用segment来增强并发
(2).类似于hashmap在1.8的增强,concurenthashmap也在出现hash冲突过多的时候采用红黑树的方式来降低query的时间
2.这里为什么分析transfer方法呢:
(1).transfer方法是concurenthashmap里最复杂的方法
(2).transfer方法在1.8的... | false | 1,872 | 11 | 2,020 | 11 | 2,048 | 9 | 2,020 | 11 | 2,779 | 18 | false | false | false | false | false | true |
63096_0 | package anmao.mc.ned.mob$skill.b2;
import anmao.mc.amlib.attribute.AttributeHelper;
import anmao.mc.ned.attribute.NEDAttributes;
import anmao.mc.ned.lib.EntityHelper;
import anmao.mc.ned.mob$skill.MobSkill;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world... | An-Mao/NekoDifficulty | src/main/java/anmao/mc/ned/mob$skill/b2/AloneMobSkill.java | 530 | //怪物越少,攻击力,移速,减伤提升越多 | line_comment | zh-cn | package anmao.mc.ned.mob$skill.b2;
import anmao.mc.amlib.attribute.AttributeHelper;
import anmao.mc.ned.attribute.NEDAttributes;
import anmao.mc.ned.lib.EntityHelper;
import anmao.mc.ned.mob$skill.MobSkill;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world... | false | 419 | 14 | 530 | 21 | 520 | 15 | 530 | 21 | 633 | 27 | false | false | false | false | false | true |
50986_2 | package com.cy.tablayoutsimple_;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.viewpager2.widget.ViewPager2;
import com.cy.tablayou... | AnJiaoDe/TabLayoutNiubility | app/src/main/java/com/cy/tablayoutsimple_/TabLayoutVP2Activity.java | 1,085 | //高的像素 | line_comment | zh-cn | package com.cy.tablayoutsimple_;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.viewpager2.widget.ViewPager2;
import com.cy.tablayou... | false | 894 | 3 | 1,085 | 5 | 1,108 | 3 | 1,085 | 5 | 1,344 | 5 | false | false | false | false | false | true |
64141_8 | package _2021_B2;
import java.io.*;
import java.util.*;
/*
* 有 n 台计算机,第 i 台计算机的运算能力为 vi。
有一系列的任务被指派到各个计算机上,第 i 个任务在 ai 时刻分配,指定
计算机编号为 bi ,耗时为 ci 且算力消耗为 di 。如果此任务成功分配,将立刻
开始运行,期间持续占用 bi 号计算机 di 的算力,持续 ci 秒。
对于每次任务分配,如果计算机剩余的运算能力不足则输出 −1,并取消这
次分配,否则输出分配完这个任务后这台计算机的剩余运算能力。
【输入格式】
输入的第一行包含两个整数 n, m,分别表示计算机数目和要分配的任务数。
第二... | Anan121no/LanQiao- | src/_2021_B2/_09负载均衡.java | 1,556 | // 消耗计算机算力 | line_comment | zh-cn | package _2021_B2;
import java.io.*;
import java.util.*;
/*
* 有 n 台计算机,第 i 台计算机的运算能力为 vi。
有一系列的任务被指派到各个计算机上,第 i 个任务在 ai 时刻分配,指定
计算机编号为 bi ,耗时为 ci 且算力消耗为 di 。如果此任务成功分配,将立刻
开始运行,期间持续占用 bi 号计算机 di 的算力,持续 ci 秒。
对于每次任务分配,如果计算机剩余的运算能力不足则输出 −1,并取消这
次分配,否则输出分配完这个任务后这台计算机的剩余运算能力。
【输入格式】
输入的第一行包含两个整数 n, m,分别表示计算机数目和要分配的任务数。
第二... | false | 1,372 | 7 | 1,556 | 8 | 1,535 | 6 | 1,556 | 8 | 2,219 | 11 | false | false | false | false | false | true |
29847_6 | package io;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.util.Set;
public class SelectorExample {
p... | AndiHappy/dayCode | src/main/java/io/SelectorExample.java | 853 | // 将该连接的可读事件 注册到 selector, 到时候他发起请求的时候,我会收到新事件 | line_comment | zh-cn | package io;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.util.Set;
public class SelectorExample {
p... | false | 765 | 26 | 853 | 28 | 908 | 22 | 853 | 28 | 1,193 | 41 | false | false | false | false | false | true |
60187_18 | package com.andrewtse.testdemo.activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.andrewtse.testdemo.R;
import com.andrewtse.testdemo.sound.media.Mu... | AndrewTseZhou/AndroidDayDayUp | app/src/main/java/com/andrewtse/testdemo/activity/MediaPlayerActivity.java | 991 | //设置图标暂停 | line_comment | zh-cn | package com.andrewtse.testdemo.activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.andrewtse.testdemo.R;
import com.andrewtse.testdemo.sound.media.Mu... | false | 798 | 4 | 991 | 6 | 994 | 4 | 991 | 6 | 1,171 | 11 | false | false | false | false | false | true |
39092_2 | package com.le.net_thread;
import com.le.utils.MLog;
import com.le.utils.UtilString;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.ne... | Android-xiaole/LeeDemo | public_jar/src/main/java/com/le/net_thread/UploadFile.java | 1,000 | // 定义最后数据分割线 | line_comment | zh-cn | package com.le.net_thread;
import com.le.utils.MLog;
import com.le.utils.UtilString;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.ne... | false | 816 | 8 | 1,000 | 8 | 1,038 | 6 | 1,000 | 8 | 1,196 | 13 | false | false | false | false | false | true |
54052_2 | package com.songchao.mybilibili.model;
import com.songchao.mybilibili.R;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Author: SongCHao
* Date: 2017/9/30/10:35
* Email: 15704762346@163.com
*/
public class ImageCardUtil {
/**
* 获取具体图片类... | AndroidBoySC/Mybilibili | app/src/main/java/com/songchao/mybilibili/model/ImageCardUtil.java | 2,194 | //获得系统当前时间 | line_comment | zh-cn | package com.songchao.mybilibili.model;
import com.songchao.mybilibili.R;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Author: SongCHao
* Date: 2017/9/30/10:35
* Email: 15704762346@163.com
*/
public class ImageCardUtil {
/**
* 获取具体图片类... | false | 1,517 | 5 | 2,194 | 5 | 1,962 | 5 | 2,194 | 5 | 2,506 | 9 | false | false | false | false | false | true |
48452_11 | package com.xiaxl.demo;
import android.os.Message;
import android.util.Log;
import com.xiaxl.demo.statemachine.State;
import com.xiaxl.demo.statemachine.StateMachine;
public class PersonStateMachine extends StateMachine {
private static final String TAG = "MachineTest";
//设置状态改变标志常量
public static fin... | AndroidHighQualityCodeStudy/Android_-StateMachine | app/src/main/java/com/xiaxl/demo/PersonStateMachine.java | 1,192 | //发送饿了信号... | line_comment | zh-cn | package com.xiaxl.demo;
import android.os.Message;
import android.util.Log;
import com.xiaxl.demo.statemachine.State;
import com.xiaxl.demo.statemachine.StateMachine;
public class PersonStateMachine extends StateMachine {
private static final String TAG = "MachineTest";
//设置状态改变标志常量
public static fin... | false | 1,115 | 6 | 1,192 | 7 | 1,283 | 6 | 1,192 | 7 | 1,560 | 10 | false | false | false | false | false | true |
66471_16 | package io.github.celestialphineas.sanxing.UIStatistics;
import android.os.Build;
import android.os.Bundle;
import android.support.transition.TransitionManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.Toolbar;
import android.... | AndroidNewbies/Sanxing | app/src/main/java/io/github/celestialphineas/sanxing/UIStatistics/StatisticsActivity.java | 2,697 | //切换按钮 | line_comment | zh-cn | package io.github.celestialphineas.sanxing.UIStatistics;
import android.os.Build;
import android.os.Bundle;
import android.support.transition.TransitionManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.Toolbar;
import android.... | false | 2,205 | 3 | 2,697 | 3 | 2,678 | 3 | 2,697 | 3 | 3,226 | 7 | false | false | false | false | false | true |
32715_6 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package translation;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Collection;
import java.u... | AndroidStudioTranslate/Android-Studio-Translate-Tool | src/translation/Post.java | 949 | //尝试发送请求 | line_comment | zh-cn | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package translation;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Collection;
import java.u... | false | 815 | 4 | 949 | 4 | 1,010 | 4 | 949 | 4 | 1,133 | 9 | false | false | false | false | false | true |
61225_1 | package com.pslib.jtool.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import cn.hutool.json.JSONArray;
/**
* @author ******
*
*
* 功能说明:请补充
*/
public class MathUtil {
// 取随机数
/*
* 生成 min-max之间的数字, 包括min,max
*
*/
public static int getRand(int min, int max)... | Andyfoo/pslib-jtool | pslib-jtool-core/src/main/java/com/pslib/jtool/util/MathUtil.java | 2,029 | // 取随机数 | line_comment | zh-cn | package com.pslib.jtool.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import cn.hutool.json.JSONArray;
/**
* @author ******
*
*
* 功能说明:请补充
*/
public class MathUtil {
// 取随 <SUF>
/*
* 生成 min-max之间的数字, 包括min,max
*
*/
public static int getRand(int min, int ... | false | 1,757 | 5 | 2,029 | 5 | 2,028 | 4 | 2,029 | 5 | 2,573 | 8 | false | false | false | false | false | true |
24111_2 | package javaleetcode.sort;
/**
* @authorAdministrator
* @date2024/1/8 0008 10:51
* @description
*/
/**
* 时间复杂度为O(n^2)的排序算法
* TODO
* */
public class Onlogn {
public static void shellSort(int[] arr) {
// 间隔序列,在希尔排序中我们称之为增量序列
for (int gap = arr.length / 2; gap > 0; gap /= 2) {
// 分组... | AngryXZC/LeetCode- | JavaLeetCode/app/src/main/java/javaleetcode/sort/Onlogn.java | 293 | // 间隔序列,在希尔排序中我们称之为增量序列 | line_comment | zh-cn | package javaleetcode.sort;
/**
* @authorAdministrator
* @date2024/1/8 0008 10:51
* @description
*/
/**
* 时间复杂度为O(n^2)的排序算法
* TODO
* */
public class Onlogn {
public static void shellSort(int[] arr) {
// 间隔 <SUF>
for (int gap = arr.length / 2; gap > 0; gap /= 2) {
// 分组
... | false | 283 | 12 | 293 | 18 | 303 | 16 | 293 | 18 | 381 | 28 | false | false | false | false | false | true |
17961_6 | /**
* BCPlan.java
* 订阅计划
* Created by xuanzhui on 2016/7/28.
* Copyright (c) 2016 BeeCloud. All rights reserved.
*/
package cn.beecloud.entity;
import java.util.Map;
public class BCPlan {
/**
* 订阅计划的唯一标识
*/
private String id;
/**
* 扣款单价
*/
private Integer fee;
/**
*... | Anjiefan/flutter_campus_social_app | android/sdk/src/main/java/cn/beecloud/entity/BCPlan.java | 856 | /**
* 扣款周期间隔数,例如interval为month,这边设置为3,
* 那么每3个月扣款,订阅系统默认1
*/ | block_comment | zh-cn | /**
* BCPlan.java
* 订阅计划
* Created by xuanzhui on 2016/7/28.
* Copyright (c) 2016 BeeCloud. All rights reserved.
*/
package cn.beecloud.entity;
import java.util.Map;
public class BCPlan {
/**
* 订阅计划的唯一标识
*/
private String id;
/**
* 扣款单价
*/
private Integer fee;
/**
*... | false | 814 | 40 | 856 | 42 | 938 | 38 | 856 | 42 | 1,187 | 64 | false | false | false | false | false | true |
55517_3 | package day19;
import java.util.Objects;
//Cloneable是一个标记接口 , 规则
public class Student implements Cloneable {
private String name;
private int age;
public Student() {
}
public Student(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
... | AnswerExplanationAll/IDEA_JAVA_Project_Study | src/day19/Student.java | 383 | //1.比较两个对象的地址是否一样,一样直接true | line_comment | zh-cn | package day19;
import java.util.Objects;
//Cloneable是一个标记接口 , 规则
public class Student implements Cloneable {
private String name;
private int age;
public Student() {
}
public Student(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
... | false | 375 | 14 | 383 | 13 | 424 | 13 | 383 | 13 | 525 | 24 | false | false | false | false | false | true |
46516_11 | import java.util.Arrays;
public class ClosestAntennaPair {
private double closestDistance = Double.POSITIVE_INFINITY;
private long counter = 0;
public ClosestAntennaPair(Point2D[] aPoints, Point2D[] bPoints) {
// Insert your solution here.
/**
* aPoints
*/
int an = aPoints.length;
if (an <= 0) retur... | AntiAntonyZhao/Introduction-to-Java | A3/ClosestAntennaPair.java | 1,971 | //悲剧结局,没点 | line_comment | zh-cn | import java.util.Arrays;
public class ClosestAntennaPair {
private double closestDistance = Double.POSITIVE_INFINITY;
private long counter = 0;
public ClosestAntennaPair(Point2D[] aPoints, Point2D[] bPoints) {
// Insert your solution here.
/**
* aPoints
*/
int an = aPoints.length;
if (an <= 0) retur... | false | 1,778 | 6 | 1,971 | 10 | 1,959 | 7 | 1,971 | 10 | 2,383 | 12 | false | false | false | false | false | true |
32600_17 | package ThMod.characters;
import ThMod.ThMod;
import ThMod.cards.Cirno.Chirumiru;
import ThMod.patches.AbstractCardEnum;
import ThMod.patches.ThModClassEnum;
import basemod.abstracts.CustomPlayer;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.... | AntiLeaf/CirnoMod | src/main/java/ThMod/characters/Cirno.java | 2,956 | // 初始卡组 | line_comment | zh-cn | package ThMod.characters;
import ThMod.ThMod;
import ThMod.cards.Cirno.Chirumiru;
import ThMod.patches.AbstractCardEnum;
import ThMod.patches.ThModClassEnum;
import basemod.abstracts.CustomPlayer;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.... | false | 2,494 | 5 | 2,955 | 5 | 2,891 | 5 | 2,956 | 5 | 3,479 | 8 | false | false | false | false | false | true |
7800_3 | package top.sharehome.springbootinittemplate.config.security;
import cn.dev33.satoken.session.SaSession;
import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotat... | AntonyCheng/spring-boot-init-template | src/main/java/top/sharehome/springbootinittemplate/config/security/AuthorizationConfiguration.java | 783 | // 由于此处设计主要针对于接口权限,所以权限通常有多个,上帝权限和个别极端情况除外 | line_comment | zh-cn | package top.sharehome.springbootinittemplate.config.security;
import cn.dev33.satoken.session.SaSession;
import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotat... | false | 662 | 24 | 783 | 30 | 759 | 27 | 783 | 30 | 1,071 | 57 | false | false | false | false | false | true |
44793_20 | package kualian.dc.deal.application.util;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Handler;
import a... | AnyBitIO/anybit-Android | app/src/main/java/kualian/dc/deal/application/util/WalletTool.java | 2,852 | //设置字符过滤 | line_comment | zh-cn | package kualian.dc.deal.application.util;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Handler;
import a... | false | 2,535 | 4 | 2,853 | 4 | 2,945 | 4 | 2,852 | 4 | 3,620 | 9 | false | false | false | false | false | true |
16345_7 | package com.xjtu.bookreader.bean.book;
import android.databinding.BaseObservable;
import com.xjtu.bookreader.http.ParamNames;
import java.io.Serializable;
/**
* Created by jingbin on 2016/12/15.
*/
public class BooksBean extends BaseObservable implements Serializable {
/**
* rating : {"max":10,"numRat... | AotY/BookReader | app/src/main/java/com/xjtu/bookreader/bean/book/BooksBean.java | 1,503 | // 标准书号 | line_comment | zh-cn | package com.xjtu.bookreader.bean.book;
import android.databinding.BaseObservable;
import com.xjtu.bookreader.http.ParamNames;
import java.io.Serializable;
/**
* Created by jingbin on 2016/12/15.
*/
public class BooksBean extends BaseObservable implements Serializable {
/**
* rating : {"max":10,"numRat... | false | 1,269 | 6 | 1,503 | 5 | 1,329 | 5 | 1,503 | 5 | 1,909 | 8 | false | false | false | false | false | true |
27394_1 | /*
* Copyright (C) 2014 The AppCan Open Source Project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | AppCanOpenSource/appcan-android | Engine/src/main/java/org/zywx/wbpalmstar/platform/push/PushDataInfo.java | 779 | //静默方式;透传(静默):1,通知:0 | line_comment | zh-cn | /*
* Copyright (C) 2014 The AppCan Open Source Project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | false | 733 | 17 | 779 | 17 | 854 | 16 | 779 | 17 | 988 | 25 | false | false | false | false | false | true |
26558_9 | package com.testm;
import java.net.URISyntaxException;
import org.fusesource.mqtt.client.BlockingConnection;
import org.fusesource.mqtt.client.Future;
import org.fusesource.mqtt.client.FutureConnection;
import org.fusesource.mqtt.client.MQTT;
import org.fusesource.mqtt.client.Message;
import org.fusesource.mqtt.clien... | AprilBrother/mqtt-client-examples | java/MqttClient.java | 723 | //设置心跳时间
| line_comment | zh-cn | package com.testm;
import java.net.URISyntaxException;
import org.fusesource.mqtt.client.BlockingConnection;
import org.fusesource.mqtt.client.Future;
import org.fusesource.mqtt.client.FutureConnection;
import org.fusesource.mqtt.client.MQTT;
import org.fusesource.mqtt.client.Message;
import org.fusesource.mqtt.clien... | false | 647 | 5 | 687 | 6 | 740 | 6 | 687 | 6 | 944 | 11 | false | false | false | false | false | true |
56221_0 | package priv.linsu.game.life.simulator.model.domain.text;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgn... | ArcherLinsu/life-simulator | server/src/main/java/priv/linsu/game/life/simulator/model/domain/text/ConditionEqual.java | 192 | //时间节点 | line_comment | zh-cn | package priv.linsu.game.life.simulator.model.domain.text;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgn... | false | 155 | 2 | 192 | 3 | 199 | 3 | 192 | 3 | 241 | 5 | false | false | false | false | false | true |
45523_7 | package com.ecust.equsys.domain.vessel.vesselperiodic;
import com.ecust.equsys.domain.vessel.VesselBaseEntity;
public class VesselPeneTest extends VesselBaseEntity {
public static VesselPeneTest vesselPeneTest = null;
public VesselPeneTest() {
super();
this.db_Description = "渗透检测记录";
this.method = "updateVe... | ArexChu/SSEI_KT | equManSysForScan/src/main/java/com/ecust/equsys/domain/vessel/vesselperiodic/VesselPeneTest.java | 683 | //渗透时间 | line_comment | zh-cn | package com.ecust.equsys.domain.vessel.vesselperiodic;
import com.ecust.equsys.domain.vessel.VesselBaseEntity;
public class VesselPeneTest extends VesselBaseEntity {
public static VesselPeneTest vesselPeneTest = null;
public VesselPeneTest() {
super();
this.db_Description = "渗透检测记录";
this.method = "updateVe... | false | 575 | 3 | 683 | 5 | 640 | 4 | 683 | 5 | 846 | 9 | false | false | false | false | false | true |
60828_2 | package cn.argento.askia.entry;
import java.lang.reflect.Array;
import java.net.InetAddress;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
public class UserBean {
// 数字
private int number;
// 字符串
protected String address;
protected String name;
// 不转json的字段
p... | ArgentoAskia/JavaTutorial | Java-Json/src/main/java/cn/argento/askia/entry/UserBean.java | 1,019 | // 逻辑值 | line_comment | zh-cn | package cn.argento.askia.entry;
import java.lang.reflect.Array;
import java.net.InetAddress;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
public class UserBean {
// 数字
private int number;
// 字符串
protected String address;
protected String name;
// 不转json的字段
p... | false | 900 | 4 | 1,019 | 4 | 1,096 | 4 | 1,019 | 4 | 1,229 | 9 | false | false | false | false | false | true |
51312_6 | package lab14;
import java.util.*;
//import junit.framework.Assert;
public class MAx {
int maxdata = Integer.MAX_VALUE;
int[][] capacity;
int[] flow;
int[] pre;
int n;
Queue<Integer> queue;
public MAx(int[][] capacity) {
this.capacity = capacity;
this.n = capacity.length;
... | Aries-Dawn/CS208-Algorithm-Design-and-Analysis | src/lab14/MAx.java | 931 | //残留图中不再存在增广路径
| line_comment | zh-cn | package lab14;
import java.util.*;
//import junit.framework.Assert;
public class MAx {
int maxdata = Integer.MAX_VALUE;
int[][] capacity;
int[] flow;
int[] pre;
int n;
Queue<Integer> queue;
public MAx(int[][] capacity) {
this.capacity = capacity;
this.n = capacity.length;
... | false | 805 | 10 | 909 | 13 | 967 | 11 | 909 | 13 | 1,091 | 22 | false | false | false | false | false | true |
15116_3 | package com.aries.smart.impl;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.Co... | AriesHoo/FastLib | template/src/main/java/com/aries/smart/impl/AppImpl.java | 2,618 | //设置动画是否一直开启 | line_comment | zh-cn | package com.aries.smart.impl;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.Co... | false | 2,237 | 6 | 2,618 | 6 | 2,642 | 6 | 2,618 | 6 | 3,222 | 13 | false | false | false | false | false | true |
29186_8 | /**
* Capability.java
*/
package artiano.core.structure;
import java.util.HashSet;
import java.util.Iterator;
/**
* 表示处理能力的类。
* <p>
* 这种“能力”表示仅限于对数据实例的处理。默认情况下,构造的本类实例 不具备任何实例处理能力,你可能需要手工添加。
* </p>
*
* @author Nano.Michael
* @version 1.0.0
* @date 2013-12-16
* @author (latest modification by Nano.Michael)... | Artiano/Artiano | src/artiano/core/structure/Capability.java | 2,796 | /**
* 构造一个不具备任何“能力”的实例
*/ | block_comment | zh-cn | /**
* Capability.java
*/
package artiano.core.structure;
import java.util.HashSet;
import java.util.Iterator;
/**
* 表示处理能力的类。
* <p>
* 这种“能力”表示仅限于对数据实例的处理。默认情况下,构造的本类实例 不具备任何实例处理能力,你可能需要手工添加。
* </p>
*
* @author Nano.Michael
* @version 1.0.0
* @date 2013-12-16
* @author (latest modification by Nano.Michael)... | false | 2,550 | 16 | 2,792 | 17 | 2,837 | 17 | 2,792 | 17 | 3,714 | 28 | false | false | false | false | false | true |
24191_4 | package Auth.token;
import Auth.api.ApiRequest;
import Auth.utils.SHAUtils;
/**
* @desc: token 有关,负责 token 的生成、解析
* @author: AruNi_Lu
* @date: 2023/3/21
*/
public class AuthToken {
private static final long DEFAULT_EXPIRED_TIME_INTERVAL = 1 * 5 * 1000;
private long createTime;
private String token;
... | AruNi-01/DesignPattern | oop/src/Auth/token/AuthToken.java | 654 | /**
* 判断是否超过失效时间间隔
*/ | block_comment | zh-cn | package Auth.token;
import Auth.api.ApiRequest;
import Auth.utils.SHAUtils;
/**
* @desc: token 有关,负责 token 的生成、解析
* @author: AruNi_Lu
* @date: 2023/3/21
*/
public class AuthToken {
private static final long DEFAULT_EXPIRED_TIME_INTERVAL = 1 * 5 * 1000;
private long createTime;
private String token;
... | false | 606 | 13 | 654 | 13 | 692 | 13 | 654 | 13 | 851 | 22 | false | false | false | false | false | true |
5837_31 | package com.sf.request;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import o... | ArvinZhangX/ssm_bilibili | src/main/java/com/sf/request/LoginRequest.java | 1,962 | //这里是立即发货 | line_comment | zh-cn | package com.sf.request;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import o... | false | 1,663 | 4 | 1,962 | 7 | 2,021 | 4 | 1,962 | 7 | 2,901 | 12 | false | false | false | false | false | true |
24900_80 | package so.asch.sdk;
/**
* Asch UIA接口
* @author eagle
*/
public interface UIA extends AschInterface {
//获取全网所有发行商
//接口地址:/api/uia/issuers
//请求方式:get
//支持格式:urlencoded
//请求参数说明:
//limit integer N 限制结果集个数,最小值:0,最大值:100
//offset integer N 偏移量,最小值0
//返回参数说明:
//success boole 是否成功
... | AschPlatform/asch-java | src/so/asch/sdk/UIA.java | 2,422 | //请求参数说明: | line_comment | zh-cn | package so.asch.sdk;
/**
* Asch UIA接口
* @author eagle
*/
public interface UIA extends AschInterface {
//获取全网所有发行商
//接口地址:/api/uia/issuers
//请求方式:get
//支持格式:urlencoded
//请求参数说明:
//limit integer N 限制结果集个数,最小值:0,最大值:100
//offset integer N 偏移量,最小值0
//返回参数说明:
//success boole 是否成功
... | false | 2,353 | 5 | 2,422 | 5 | 2,397 | 5 | 2,422 | 5 | 3,504 | 8 | false | false | false | false | false | true |
44165_11 | package Game;
import Thing.Square;
import java.awt.*;
import java.util.Timer;
import java.util.TimerTask;
public class Player {
private final double walkSpeed = 16 / (double) (World.FPS);//一秒16格
private final double jumpSpeed = 0.5;//初始跳跃速度
private double verticalSpeed = 0;//实时垂直速度
private int hp = 1... | Asterism12/mineminecraft | src/Game/Player.java | 1,295 | //防止被卡在墙里 | line_comment | zh-cn | package Game;
import Thing.Square;
import java.awt.*;
import java.util.Timer;
import java.util.TimerTask;
public class Player {
private final double walkSpeed = 16 / (double) (World.FPS);//一秒16格
private final double jumpSpeed = 0.5;//初始跳跃速度
private double verticalSpeed = 0;//实时垂直速度
private int hp = 1... | false | 1,225 | 7 | 1,295 | 9 | 1,398 | 7 | 1,295 | 9 | 1,666 | 14 | false | false | false | false | false | true |
56305_2 | package com.jvm;
/**
* 新生代配置
* -Xmn:可以设置新生代的大小,设值一个比较打的新生代会减少老年代的大小,
* 这个参数对系统性能以及GC行为有很大影响,新生代大小一般会设值整
* 个堆空间的 1/3 到 1/4 左右;
*
* -XX:SurvivorRatio:
* 用来设值新生代中 eden 空间和 from/to 空间的比例
* -XX:SurvivorRatio = eden / from = eden / to
*
* -XX:NewRatio:
* 设值新生代和老年代的比例
* -XX:NewRatio ... | Asura7969/JAVA8Demo | src/com/jvm/Jvm2.java | 488 | //连续向系统申请10MB空间 | line_comment | zh-cn | package com.jvm;
/**
* 新生代配置
* -Xmn:可以设置新生代的大小,设值一个比较打的新生代会减少老年代的大小,
* 这个参数对系统性能以及GC行为有很大影响,新生代大小一般会设值整
* 个堆空间的 1/3 到 1/4 左右;
*
* -XX:SurvivorRatio:
* 用来设值新生代中 eden 空间和 from/to 空间的比例
* -XX:SurvivorRatio = eden / from = eden / to
*
* -XX:NewRatio:
* 设值新生代和老年代的比例
* -XX:NewRatio ... | false | 459 | 9 | 486 | 10 | 454 | 9 | 488 | 10 | 584 | 17 | false | false | false | false | false | true |
24304_5 | /**
* @FileName: Main1.java
* @Package asura.framework.algorithm.sort
*
* @author zhangshaobin
* @created 2015年7月3日 上午9:54:18
*
* Copyright 2011-2015 asura
*/
package asura.framework.algorithm.sort;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOEx... | AsuraTeam/asura | asura-algorithm/src/main/java/asura/framework/algorithm/sort/Main1.java | 1,237 | //10M 可以作为参数传过去 | line_comment | zh-cn | /**
* @FileName: Main1.java
* @Package asura.framework.algorithm.sort
*
* @author zhangshaobin
* @created 2015年7月3日 上午9:54:18
*
* Copyright 2011-2015 asura
*/
package asura.framework.algorithm.sort;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOEx... | false | 1,097 | 13 | 1,237 | 12 | 1,284 | 11 | 1,237 | 12 | 1,624 | 15 | false | false | false | false | false | true |
3274_6 | package com.asura.monitor.util;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.asura.common.response.ResponseVo;
import com.asura.monitor.graph.entity.PushEntity;
import com.asura.monitor.graph.util.FileRender;
import com.asura.monitor.graph.util.FileWriter;
import com.asura.util.Che... | AsuraTeam/monitor | server/src/main/java/com/asura/monitor/util/MonitorUtil.java | 1,319 | // 记录每个指标的服务器地址
| line_comment | zh-cn | package com.asura.monitor.util;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.asura.common.response.ResponseVo;
import com.asura.monitor.graph.entity.PushEntity;
import com.asura.monitor.graph.util.FileRender;
import com.asura.monitor.graph.util.FileWriter;
import com.asura.util.Che... | false | 1,151 | 10 | 1,306 | 10 | 1,387 | 8 | 1,306 | 10 | 1,555 | 15 | false | false | false | false | false | true |
26582_5 | package cn.utils;
import cn.domain.Admin;
import cn.domain.Users;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import io.jsonwebtoken.*;
import java.util.Date;
import java.util.UUID;
//需要导入java-jwt / jjwt 两个依赖
public class JwtUtil {
//秘钥, 随便
private static final String sec... | Ataraxia24/cat | src/main/java/cn/utils/JwtUtil.java | 513 | //过期时间为1h | line_comment | zh-cn | package cn.utils;
import cn.domain.Admin;
import cn.domain.Users;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import io.jsonwebtoken.*;
import java.util.Date;
import java.util.UUID;
//需要导入java-jwt / jjwt 两个依赖
public class JwtUtil {
//秘钥, 随便
private static final String sec... | false | 460 | 6 | 513 | 7 | 536 | 6 | 513 | 7 | 673 | 8 | false | false | false | false | false | true |
8430_9 | package com.attilax.util;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyun... | Atlks/bookmarksHtmlEverythingIndexPrj | src/com/attilax/util/AliyunMessageUtil.java | 1,397 | // 必填:短信模板-可在短信控制台中找到
| line_comment | zh-cn | package com.attilax.util;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyun... | false | 1,251 | 15 | 1,387 | 18 | 1,328 | 13 | 1,387 | 18 | 1,809 | 31 | false | false | false | false | false | true |
37447_18 | package testkg;
import com.alibaba.fastjson.JSONObject;
import com.im.action.AbstractAction;
import com.im.action.login.LoginAction;
import com.im.action.sys.GetSmsCodeAction;
import com.im.action.sys.UpdateUserKeyPairAction;
import com.im.filter.SignitureValidFilter;
import com.webkit.web.ActionException;
import com.... | Atlks/sdkprj | nodesrc/testkg/spk.java | 1,373 | //查看服务是否运行 | line_comment | zh-cn | package testkg;
import com.alibaba.fastjson.JSONObject;
import com.im.action.AbstractAction;
import com.im.action.login.LoginAction;
import com.im.action.sys.GetSmsCodeAction;
import com.im.action.sys.UpdateUserKeyPairAction;
import com.im.filter.SignitureValidFilter;
import com.webkit.web.ActionException;
import com.... | false | 1,146 | 5 | 1,373 | 5 | 1,423 | 5 | 1,373 | 5 | 1,606 | 9 | false | false | false | false | false | true |
56775_1 | package com.attilax.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import ch.ethz.ssh2.Connection;
import ch.ethz.ssh2.Session;
import ch.ethz.ssh2.StreamGobbler;
public class terninal_linux {
... | Atlks/sumdocIndexToolPrj | src/com/attilax/util/terninal_linux.java | 548 | // line等于null从来不会发生,导致程序卡在这里 | line_comment | zh-cn | package com.attilax.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import ch.ethz.ssh2.Connection;
import ch.ethz.ssh2.Session;
import ch.ethz.ssh2.StreamGobbler;
public class terninal_linux {
... | false | 473 | 12 | 548 | 14 | 661 | 12 | 548 | 14 | 726 | 24 | false | false | false | false | false | true |
7788_1 | package com.demo01;
/**
* @Author: LFJ
* @Date: 2023-02-02 14:22
*/
// 测试守护线程
// 上帝守护你
public class TestThread5 {
public static void main(String[] args) {
God god = new God();
You you = new You();
Thread thread = new Thread(god);
thread.setDaemon(true); // 设置成守护线程
thread.start();
new Thread(you).st... | Auroraol/BackFront | 2-后端/note01/多线程/code/lesson/src/com/demo01/TestThread5.java | 252 | // 测试守护线程 | line_comment | zh-cn | package com.demo01;
/**
* @Author: LFJ
* @Date: 2023-02-02 14:22
*/
// 测试 <SUF>
// 上帝守护你
public class TestThread5 {
public static void main(String[] args) {
God god = new God();
You you = new You();
Thread thread = new Thread(god);
thread.setDaemon(true); // 设置成守护线程
thread.start();
new Thread(you).... | false | 206 | 6 | 252 | 7 | 235 | 4 | 252 | 7 | 287 | 10 | false | false | false | false | false | true |
55287_3 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import com.sun.org.apache.bcel.internal.generic.RETURN;
public class Arithmetic_baoshu {
//题目:有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);... | AutKevin/JAVA | Arithmetic/Arithmetic_baoshu.java | 457 | //当这个人报数为三时 | line_comment | zh-cn | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import com.sun.org.apache.bcel.internal.generic.RETURN;
public class Arithmetic_baoshu {
//题目:有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);... | false | 391 | 8 | 457 | 9 | 433 | 8 | 457 | 9 | 589 | 12 | false | false | false | false | false | true |
15102_12 | package cn.authing.sdk.java.dto;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TenantUserDto {
/**
* 邮箱,不区分大小写
*/
@JsonProperty("email")
private String email;
/**
* 手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。
*/
@JsonProperty("pho... | Authing/authing-java-sdk | src/main/java/cn/authing/sdk/java/dto/TenantUserDto.java | 2,092 | /**
* 所在省份
*/ | block_comment | zh-cn | package cn.authing.sdk.java.dto;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TenantUserDto {
/**
* 邮箱,不区分大小写
*/
@JsonProperty("email")
private String email;
/**
* 手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。
*/
@JsonProperty("pho... | false | 2,011 | 10 | 2,092 | 9 | 2,356 | 11 | 2,092 | 9 | 2,793 | 14 | false | false | false | false | false | true |
38538_6 | package com.autohome.frostmourne.monitor.dao.mybatis.frostmourne.domain.generate;
import com.autohome.frostmourne.monitor.model.enums.AlertType;
import com.autohome.frostmourne.monitor.model.enums.SendStatus;
import com.autohome.frostmourne.monitor.model.enums.SilenceStatus;
import java.io.Serializable;
import java.ut... | AutohomeCorp/frostmourne | frostmourne-monitor/src/main/java/com/autohome/frostmourne/monitor/dao/mybatis/frostmourne/domain/generate/AlertLog.java | 1,400 | /**
* 是否在静默期(YES,NO)
*/ | block_comment | zh-cn | package com.autohome.frostmourne.monitor.dao.mybatis.frostmourne.domain.generate;
import com.autohome.frostmourne.monitor.model.enums.AlertType;
import com.autohome.frostmourne.monitor.model.enums.SendStatus;
import com.autohome.frostmourne.monitor.model.enums.SilenceStatus;
import java.io.Serializable;
import java.ut... | false | 1,298 | 15 | 1,400 | 15 | 1,499 | 17 | 1,400 | 15 | 1,724 | 21 | false | false | false | false | false | true |
25043_3 | class Solution {
public int[] pondSizes(int[][] land) {
int m = land.length, n = land[0].length;
var ans = new ArrayList<Integer>();
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
if (land[i][j] == 0) // 从没有访问过的 0 出发
ans.add(dfs(land, ... | Autunomy/algothrim-study | leetcode/每日一题/2023/06/22/solution.java | 353 | // 更快的写法 | line_comment | zh-cn | class Solution {
public int[] pondSizes(int[][] land) {
int m = land.length, n = land[0].length;
var ans = new ArrayList<Integer>();
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
if (land[i][j] == 0) // 从没有访问过的 0 出发
ans.add(dfs(land, ... | false | 342 | 6 | 353 | 6 | 374 | 5 | 353 | 6 | 431 | 9 | false | false | false | false | false | true |
48094_1 | package io.nio.chatroom2;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.uti... | AvengerEug/javase | src/main/java/io/nio/chatroom2/NioClient.java | 1,430 | // 连接客户端,可以理解成:客户端执行连接操作时,就会产生连接事件,此时这个事件还在socketChannel中。 | line_comment | zh-cn | package io.nio.chatroom2;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.uti... | false | 1,306 | 29 | 1,430 | 30 | 1,378 | 27 | 1,430 | 30 | 2,204 | 54 | false | false | false | false | false | true |
12684_2 | package com.github.unclecatmyself.core.bean;
/**
* 用户层消息Bean封装
* Created by MySelf on 2018/12/19.
*/
public class InChatMessage {
/** 消息时间 */
private int time;
/** 消息类型 */
private String type;
/** 消息值 */
private String value;
/** 用户标识 */
private String token;
/** 群聊Id */
... | AwakenCN/InChat | src/main/java/com/github/unclecatmyself/core/bean/InChatMessage.java | 510 | /** 消息类型 */ | block_comment | zh-cn | package com.github.unclecatmyself.core.bean;
/**
* 用户层消息Bean封装
* Created by MySelf on 2018/12/19.
*/
public class InChatMessage {
/** 消息时间 */
private int time;
/** 消息类 <SUF>*/
private String type;
/** 消息值 */
private String value;
/** 用户标识 */
private String token;
/** 群聊Id */... | false | 479 | 6 | 510 | 7 | 565 | 4 | 510 | 7 | 673 | 7 | false | false | false | false | false | true |
64213_4 | package com.awaken.leetcode.array;
/**
* @Auther: Noseparte
* @Date: 2020/5/7 7:40 下午
* @Description:
*
* <p>
* 1011. 在 D 天内送达包裹的能力
*
* 传送带上的包裹必须在 D 天内从一个港口运送到另一个港口。
* 传送带上的第 i 个包裹的重量为 weights[i]。每一天,我们都会按给出重量的顺序往传送带上装载包裹。我们装载的重量不会超过船的最大运载重量。
* 返回能... | AwakenCN/Nine-Chapters | src/main/java/com/awaken/leetcode/array/ShipWithinDays.java | 1,182 | /**
* 示例 1:
*
* 输入:weights = [1,2,3,4,5,6,7,8,9,10], D = 5
* 输出:15
* 解释:
* 船舶最低载重 15 就能够在 5 天内送达所有包裹,如下所示:
* 第 1 天:1, 2, 3, 4, 5
* 第 2 天:6, 7
* 第 3 天:8
* 第 4 天:9
* 第 5 天:10
*
* 请注意,货物必须按照给定的顺序装运,因此使用载重能力为 14 的船舶并将包装分成 (2, 3, 4, 5), (1, 6, 7), (8), (9), (1... | block_comment | zh-cn | package com.awaken.leetcode.array;
/**
* @Auther: Noseparte
* @Date: 2020/5/7 7:40 下午
* @Description:
*
* <p>
* 1011. 在 D 天内送达包裹的能力
*
* 传送带上的包裹必须在 D 天内从一个港口运送到另一个港口。
* 传送带上的第 i 个包裹的重量为 weights[i]。每一天,我们都会按给出重量的顺序往传送带上装载包裹。我们装载的重量不会超过船的最大运载重量。
* 返回能... | false | 1,063 | 459 | 1,182 | 483 | 1,135 | 465 | 1,182 | 483 | 1,506 | 592 | true | true | true | true | true | false |
60771_5 | public class Bag {
/*本代码实现了用回溯法实现01背包问题。亮点之一在于右子树的剪枝函数的设计非常之巧妙。
* 在回溯开始之前,首先对于背包中的物品按照单位重量价值进行排序,方便于后面右子树的剪枝操作。
* 在本代码中,省略了该排序过程,在初始化物品的重量和价值时,已经按照单位重量的价值排好了序。
* 该问题是一个典型的子集树问题,对于背包中的每一个物品,可以选择放入(左子树)或者不放入(右子树)。
* 依次对每个节点进行搜索,得到最优解。
*
* 剪枝函数:对于左子树,如果放入物品的重量已经超过了背包的容量,则直接进行剪枝。
* 对于... | AyoungYa/basic_study | src/Bag.java | 968 | //尽力依照单位重量价值次序装剩余的物品 | line_comment | zh-cn | public class Bag {
/*本代码实现了用回溯法实现01背包问题。亮点之一在于右子树的剪枝函数的设计非常之巧妙。
* 在回溯开始之前,首先对于背包中的物品按照单位重量价值进行排序,方便于后面右子树的剪枝操作。
* 在本代码中,省略了该排序过程,在初始化物品的重量和价值时,已经按照单位重量的价值排好了序。
* 该问题是一个典型的子集树问题,对于背包中的每一个物品,可以选择放入(左子树)或者不放入(右子树)。
* 依次对每个节点进行搜索,得到最优解。
*
* 剪枝函数:对于左子树,如果放入物品的重量已经超过了背包的容量,则直接进行剪枝。
* 对于... | false | 816 | 12 | 968 | 19 | 919 | 13 | 968 | 19 | 1,328 | 31 | false | false | false | false | false | true |
33850_0 | package atomic;
import java.util.concurrent.atomic.LongAccumulator;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;
/**
* 并行计算,不在乎执行顺序
*/
public class LongAccumulatorDemo {
public static void main(String[] args) {
LongAccumulator lon... | BBYYSS0917/juc-demo | src/main/java/atomic/LongAccumulatorDemo.java | 202 | /**
* 并行计算,不在乎执行顺序
*/ | block_comment | zh-cn | package atomic;
import java.util.concurrent.atomic.LongAccumulator;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;
/**
* 并行计 <SUF>*/
public class LongAccumulatorDemo {
public static void main(String[] args) {
LongAccumulator longAccu... | false | 182 | 12 | 202 | 15 | 209 | 13 | 202 | 15 | 258 | 24 | false | false | false | false | false | true |
24214_3 | package run;
import domains.*;
//import domains.Pos;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
/**
* Created by Hugh on 2014/12... | BJUT-Agile-Group/Pos-Team3 | src/run/Run.java | 749 | /*
功能:根据产品编码从产品列表中寻找相应的产品,返回该商品属性Item
参数:String bacCord 产品的编码
返回值:Item 若成功,则返回该产品属性,否则,返回空Item
*/ | block_comment | zh-cn | package run;
import domains.*;
//import domains.Pos;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
/**
* Created by Hugh on 2014/12... | false | 645 | 55 | 749 | 59 | 777 | 54 | 749 | 59 | 929 | 95 | false | false | false | false | false | true |
37953_14 | package BOBO.web;
import BOBO.pojo.Page;
import BOBO.pojo.Sct;
import BOBO.pojo.Student;
import BOBO.service.Impl.SctServiceImpl;
import BOBO.service.Impl.StudentServiceImpl;
import BOBO.service.SctService;
import BOBO.service.StudentService;
import BOBO.utils.WebUtils;
import javax.servlet.ServletException;
import j... | BOBO-ZzB/Student_select_class- | src/BOBO/web/StudentServlet.java | 1,346 | /*把获取到的对象注入映射Map中*/ | block_comment | zh-cn | package BOBO.web;
import BOBO.pojo.Page;
import BOBO.pojo.Sct;
import BOBO.pojo.Student;
import BOBO.service.Impl.SctServiceImpl;
import BOBO.service.Impl.StudentServiceImpl;
import BOBO.service.SctService;
import BOBO.service.StudentService;
import BOBO.utils.WebUtils;
import javax.servlet.ServletException;
import j... | false | 1,141 | 11 | 1,346 | 11 | 1,404 | 10 | 1,346 | 11 | 1,705 | 21 | false | false | false | false | false | true |
28273_2 | package ir;
import ir.type.Type;
import ir.User.Use;
import java.util.LinkedList;
/*
* LLVM 中 Value Use User 的关系介绍
* https://buaa-se-compiling.github.io/miniSysY-tutorial/pre/design_hints.html
*/
/*
* Value 类,几乎所有实体都是Value的子类
*
*/
public class Value {
public Value(Type type) {
this.type = type;
... | BUAA-SE-Compiling/miniSysY_example_compiler | src/ir/Value.java | 209 | //将所有对 this 的使用换为对v的使用 | line_comment | zh-cn | package ir;
import ir.type.Type;
import ir.User.Use;
import java.util.LinkedList;
/*
* LLVM 中 Value Use User 的关系介绍
* https://buaa-se-compiling.github.io/miniSysY-tutorial/pre/design_hints.html
*/
/*
* Value 类,几乎所有实体都是Value的子类
*
*/
public class Value {
public Value(Type type) {
this.type = type;
... | false | 173 | 13 | 209 | 13 | 217 | 12 | 209 | 13 | 251 | 17 | false | false | false | false | false | true |
39934_1 | import java.util.ArrayList;
import java.util.Scanner;
public class ClearUp {
private static int[][] arr = new int[9][9];
public static void main(String[] args) {
newGame();
displayRound();
checkAll();
return;
}
private static void checkAll() {
ArrayList<Integer... | BUGyyc/myMd | #.code/ClearUp.java | 813 | // 超过索引 | line_comment | zh-cn | import java.util.ArrayList;
import java.util.Scanner;
public class ClearUp {
private static int[][] arr = new int[9][9];
public static void main(String[] args) {
newGame();
displayRound();
checkAll();
return;
}
private static void checkAll() {
ArrayList<Integer... | false | 741 | 7 | 813 | 4 | 881 | 4 | 813 | 4 | 950 | 6 | false | false | false | false | false | true |
17335_1 | package com.match.springmvc.entities;
import org.springframework.stereotype.Component;
/**
* 教师-比赛-队伍
* @author lenovo
*
*/
@Component
public class TrTeam {
private Integer TrCTid;
private Teacher teacher;
private String Tname;
private String Tdepartment;
private Competition competition;
private Strin... | BYFOR/competition-system-of-hbfu | src/com/match/springmvc/entities/TrTeam.java | 457 | // 教师工作量(个人)
| line_comment | zh-cn | package com.match.springmvc.entities;
import org.springframework.stereotype.Component;
/**
* 教师-比赛-队伍
* @author lenovo
*
*/
@Component
public class TrTeam {
private Integer TrCTid;
private Teacher teacher;
private String Tname;
private String Tdepartment;
private Competition competition;
private Strin... | false | 370 | 9 | 455 | 10 | 482 | 9 | 455 | 10 | 552 | 14 | false | false | false | false | false | true |
40637_36 | public class MiGong {
//编写一个main方法
public static void main(String[] args) {
//思路
//1. 先创建迷宫,用二维数组表示 int[][] map = new int[8][7];
//2. 先规定 map 数组的元素值: 0 表示可以走 1 表示障碍物
int[][] map = new int[8][7];
//3. 将最上面的一行和最下面的一行,全部设置为1
for(int i = 0; i < 7; i++) {
map[0][i] = 1;
map[7][i] = 1;
}
//4.将最... | BabysBreath017/HelloWorld | MiGong.java | 1,372 | //使用找路策略,来确定该位置是否真的可以走通 | line_comment | zh-cn | public class MiGong {
//编写一个main方法
public static void main(String[] args) {
//思路
//1. 先创建迷宫,用二维数组表示 int[][] map = new int[8][7];
//2. 先规定 map 数组的元素值: 0 表示可以走 1 表示障碍物
int[][] map = new int[8][7];
//3. 将最上面的一行和最下面的一行,全部设置为1
for(int i = 0; i < 7; i++) {
map[0][i] = 1;
map[7][i] = 1;
}
//4.将最... | false | 1,246 | 15 | 1,372 | 16 | 1,321 | 15 | 1,372 | 16 | 1,868 | 30 | false | false | false | false | false | true |
20733_1 | package userInterface;
import entity.Department;
import entity.Hospital;
import entity.Patient;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TableColumn;... | BaiWenchao/HISProject2.0 | src/userInterface/PatientSearch.java | 766 | // 创建医院单例 | line_comment | zh-cn | package userInterface;
import entity.Department;
import entity.Hospital;
import entity.Patient;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TableColumn;... | false | 661 | 6 | 766 | 6 | 812 | 5 | 766 | 6 | 974 | 10 | false | false | false | false | false | true |
10771_9 | package com.baidu.speech.restapi.asrdemo;
import com.baidu.speech.restapi.common.ConnUtil;
import com.baidu.speech.restapi.common.DemoException;
import com.baidu.speech.restapi.common.TokenHolder;
import org.json.JSONObject;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.... | Baidu-AIP/speech-demo | rest-api-asr/java/src/main/java/com/baidu/speech/restapi/asrdemo/AsrMain.java | 1,754 | // 1537 表示识别普通话,使用输入法模型。 其它语种参见文档
| line_comment | zh-cn | package com.baidu.speech.restapi.asrdemo;
import com.baidu.speech.restapi.common.ConnUtil;
import com.baidu.speech.restapi.common.DemoException;
import com.baidu.speech.restapi.common.TokenHolder;
import org.json.JSONObject;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.... | false | 1,574 | 27 | 1,746 | 24 | 1,825 | 23 | 1,746 | 24 | 2,268 | 45 | false | false | false | false | false | true |
41255_8 | package me.bakumon.library;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.C... | Bakumon/EclipseLoading | library/src/main/java/me/bakumon/library/EclipseLoadingView.java | 2,353 | /**
* 太阳颜色
*/ | block_comment | zh-cn | package me.bakumon.library;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.C... | false | 2,111 | 10 | 2,354 | 9 | 2,438 | 9 | 2,353 | 9 | 2,894 | 14 | false | false | false | false | false | true |
37098_10 | package leetcode.algorithms;
import java.util.*;
import java.util.stream.Collectors;
/**
* Description: 2115. Find All Possible Recipes from Given Supplies
*
* @author Baltan
* @date 2021/12/26 14:45
*/
public class FindAllRecipes {
public static void main(String[] args) {
String[] recipes1 = {"bread... | Baltan/leetcode | src/leetcode/algorithms/FindAllRecipes.java | 976 | /**
* 如果当前这道菜所需要的所有原材料我们都拥有了,就可以做出这道菜了,同时这道菜也被加入我们拥有的原材料中,用于
* 判断是否能做出其他的才
*/ | block_comment | zh-cn | package leetcode.algorithms;
import java.util.*;
import java.util.stream.Collectors;
/**
* Description: 2115. Find All Possible Recipes from Given Supplies
*
* @author Baltan
* @date 2021/12/26 14:45
*/
public class FindAllRecipes {
public static void main(String[] args) {
String[] recipes1 = {"bread... | false | 866 | 48 | 976 | 56 | 1,001 | 50 | 976 | 56 | 1,304 | 89 | false | false | false | false | false | true |
9838_8 | package com.bamboy.bamboycollected.page.freedom;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com... | Bamboy120315/bamboy | app/src/main/java/com/bamboy/bamboycollected/page/freedom/FreedomListActivity.java | 2,514 | // 获取当前这个条目占几份 | line_comment | zh-cn | package com.bamboy.bamboycollected.page.freedom;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com... | false | 1,892 | 9 | 2,514 | 9 | 2,214 | 8 | 2,514 | 9 | 3,229 | 19 | false | false | false | false | false | true |
14960_17 | package xyz.acproject.danmuji.conf.set;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import xyz.acproject.danmuji.conf.PublicDataConf;
import xyz.acproject.danmuji.conf.base.ThankLi... | BanqiJane/Bilibili_Danmuji | src/main/java/xyz/acproject/danmuji/conf/set/ThankGiftSetConf.java | 1,247 | //没在直播 | line_comment | zh-cn | package xyz.acproject.danmuji.conf.set;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import xyz.acproject.danmuji.conf.PublicDataConf;
import xyz.acproject.danmuji.conf.base.ThankLi... | false | 974 | 4 | 1,247 | 5 | 1,201 | 4 | 1,247 | 5 | 1,582 | 7 | false | false | false | false | false | true |
42988_7 | package com.example.jianqiang.testlistview.imageloader;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.ne... | BaoBaoJianqiang/CustomListView | TestListView/app/src/main/java/com/example/jianqiang/testlistview/imageloader/OkHttpClientUtils.java | 677 | //设置超时 | line_comment | zh-cn | package com.example.jianqiang.testlistview.imageloader;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.ne... | false | 600 | 4 | 677 | 3 | 711 | 3 | 677 | 3 | 848 | 5 | false | false | false | false | false | true |
15927_3 | package com.baron.patterns.state.state;
/**
* 状态之木有钱
*
* @author Baron Zhang (baron[dot]zhanglei[at]gmail[dot]com)
* @version 1.0
* @since 1.0
*/
public class NoQuarterState implements State {
GumballMachine gumballMachine;
public NoQuarterState(GumballMachine gumballMachine) {
this.gumballMach... | BaronZ88/DesignPatterns | src/com/baron/patterns/state/state/NoQuarterState.java | 317 | //这里加入转动曲柄代码 | line_comment | zh-cn | package com.baron.patterns.state.state;
/**
* 状态之木有钱
*
* @author Baron Zhang (baron[dot]zhanglei[at]gmail[dot]com)
* @version 1.0
* @since 1.0
*/
public class NoQuarterState implements State {
GumballMachine gumballMachine;
public NoQuarterState(GumballMachine gumballMachine) {
this.gumballMach... | false | 273 | 7 | 317 | 9 | 304 | 8 | 317 | 9 | 403 | 13 | false | false | false | false | false | true |
9767_10 | package wow.service;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.spri... | BattleCall3/graduatework | code/medical/src/main/java/wow/service/UserServiceImpl.java | 1,331 | // 用户名或密码错误
| line_comment | zh-cn | package wow.service;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.spri... | false | 1,105 | 7 | 1,317 | 7 | 1,278 | 7 | 1,317 | 7 | 1,742 | 13 | false | false | false | false | false | true |
63900_2 | package org.laopopo.monitor;
import static org.laopopo.common.protocal.LaopopoProtocol.MANAGER_SERVICE;
import static org.laopopo.common.protocal.LaopopoProtocol.MERTRICS_SERVICE;
import static org.laopopo.common.serialization.SerializerHolder.serializerImpl;
import io.netty.channel.Channel;
import io.netty.channel.Ch... | BazingaLyn/laopopo-rpc | laopopo-monitor/src/main/java/org/laopopo/monitor/DefaultMonitorProcessor.java | 2,067 | //返回给管理页面的对象 | line_comment | zh-cn | package org.laopopo.monitor;
import static org.laopopo.common.protocal.LaopopoProtocol.MANAGER_SERVICE;
import static org.laopopo.common.protocal.LaopopoProtocol.MERTRICS_SERVICE;
import static org.laopopo.common.serialization.SerializerHolder.serializerImpl;
import io.netty.channel.Channel;
import io.netty.channel.Ch... | false | 1,769 | 6 | 2,067 | 7 | 2,082 | 7 | 2,067 | 7 | 2,748 | 11 | false | false | false | false | false | true |
53371_1 | package com.DI.dao.Impl;
import com.DI.dao.UserDao;
//创建一个业务逻辑接口
public class UserDaoImpl implements UserDao {
public boolean login(String name, String password) {
//如果名字是比尔和密码是123456就返回true
if(name.equals("比尔")&&password.equals("12345")){
return true;
}
return false;... | BeAlrightc/java_pro_note | spring家族/spring/project/ioc/DlLearning/src/main/java/com/DI/dao/Impl/UserDaoImpl.java | 105 | //如果名字是比尔和密码是123456就返回true | line_comment | zh-cn | package com.DI.dao.Impl;
import com.DI.dao.UserDao;
//创建一个业务逻辑接口
public class UserDaoImpl implements UserDao {
public boolean login(String name, String password) {
//如果 <SUF>
if(name.equals("比尔")&&password.equals("12345")){
return true;
}
return false;
}
}
| false | 92 | 18 | 105 | 18 | 107 | 18 | 105 | 18 | 134 | 22 | false | false | false | false | false | true |
37242_3 | public class Operator {
/*
/输入:Student 对象
/输出:无
/功能:往学生数组中添加一个新学生
*/
public static void addStudent(Student stu) {
for (Student s : Students) {
if (s.getName() == NULL) {
s.initStudent(stu.getName(), stu.getAddress(),
stu.getPhoneNumber(), ... | BeiDouQiXing/Classmate-book | Operate.java | 468 | /*
/输入:学生姓名,类型为 String
/输出:Student 对象
/功能:查找该名字的学生的信息
*/ | block_comment | zh-cn | public class Operator {
/*
/输入:Student 对象
/输出:无
/功能:往学生数组中添加一个新学生
*/
public static void addStudent(Student stu) {
for (Student s : Students) {
if (s.getName() == NULL) {
s.initStudent(stu.getName(), stu.getAddress(),
stu.getPhoneNumber(), ... | false | 422 | 32 | 468 | 30 | 497 | 32 | 468 | 30 | 610 | 50 | false | false | false | false | false | true |
27847_4 | package bus.service;
import bus.Vo.CustomerVo;
import bus.domian.Customer;
import sys.utils.DataGridView;
import java.util.List;
public interface CustomerService {
/*查询所有客户*/
DataGridView queryAllCustomer(CustomerVo customerVo);
/*添加客户*/
void addCustomer(CustomerVo customerVo);
/*修改客户*/
voi... | Berlin12034/ssm_gift | src/main/java/bus/service/CustomerService.java | 188 | /*批量删除客户*/ | block_comment | zh-cn | package bus.service;
import bus.Vo.CustomerVo;
import bus.domian.Customer;
import sys.utils.DataGridView;
import java.util.List;
public interface CustomerService {
/*查询所有客户*/
DataGridView queryAllCustomer(CustomerVo customerVo);
/*添加客户*/
void addCustomer(CustomerVo customerVo);
/*修改客户*/
voi... | false | 154 | 5 | 188 | 5 | 192 | 5 | 188 | 5 | 256 | 10 | false | false | false | false | false | true |
28085_0 | package DP;
public class LC70_ClimbingStairs {
public static int climb (int n) {
if (n < 2) return 1;
int ans = 0;
// 状态转移方程
// dp[i] 只与 dp[i - 1] 与 dp[i - 2] 有关
// f(x) = f(x - 1) + f(x - 2)
// 特别的, 有 f(0) = 1, f(1) = 1
int p1 = 1, p2 = 1;
for (int i... | Bi1ack/LeetCode | src/DP/LC70_ClimbingStairs.java | 236 | // 状态转移方程 | line_comment | zh-cn | package DP;
public class LC70_ClimbingStairs {
public static int climb (int n) {
if (n < 2) return 1;
int ans = 0;
// 状态 <SUF>
// dp[i] 只与 dp[i - 1] 与 dp[i - 2] 有关
// f(x) = f(x - 1) + f(x - 2)
// 特别的, 有 f(0) = 1, f(1) = 1
int p1 = 1, p2 = 1;
for (int... | false | 223 | 6 | 236 | 7 | 245 | 5 | 236 | 7 | 268 | 8 | false | false | false | false | false | true |
16472_11 | package models;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import play.db.jpa.GenericModel;
import play.libs.Codec;
import utils.PageBean;
impor... | BiaoPro/community | app/models/House.java | 858 | //楼层
| line_comment | zh-cn | package models;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import play.db.jpa.GenericModel;
import play.libs.Codec;
import utils.PageBean;
impor... | false | 649 | 3 | 845 | 4 | 821 | 4 | 845 | 4 | 985 | 8 | false | false | false | false | false | true |
3583_11 | package com.kit.widget.scrollview;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.TranslateAnimation;
import android.widget.ScrollView;
/**
* 自定义ScrollView 实现弹性回弹功能
*/
public cla... | BigAppOS/BigApp_Discuz_Android | libs/ZUtilsExtWidget/src/com/kit/widget/scrollview/ReboundScrollView2.java | 959 | // 开启移动动画 | line_comment | zh-cn | package com.kit.widget.scrollview;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.TranslateAnimation;
import android.widget.ScrollView;
/**
* 自定义ScrollView 实现弹性回弹功能
*/
public cla... | false | 819 | 5 | 961 | 5 | 924 | 5 | 959 | 5 | 1,291 | 10 | false | false | false | false | false | true |
54057_3 | package com.bill56.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.bill56.carlife.R;
import com.bill56.entity.UserCar;
i... | Bill56/CarLife | app/src/main/java/com/bill56/adapter/CarInfoAdapter.java | 1,247 | // 加载模板,创建视图项——将布局创建成一个View对象 | line_comment | zh-cn | package com.bill56.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.bill56.carlife.R;
import com.bill56.entity.UserCar;
i... | false | 1,020 | 17 | 1,247 | 16 | 1,291 | 15 | 1,247 | 16 | 1,544 | 27 | false | false | false | false | false | true |
51833_2 | import java.util.Random;
public class Main {
private static void testEncodeLong64() {
Random r = new Random();
boolean success = true;
for (int i = 0; i < 100; i++) {
long x = r.nextLong();
long y = LongEncoder.encode64(x);
long z = LongEncoder.decode64(y... | BillyWei01/LongEncrypt | src/Main.java | 1,176 | // 如果又不想引入特殊字符('-','_'), 则x需要需要小于等于47bit,构造一个47bit的x(比较复杂) | line_comment | zh-cn | import java.util.Random;
public class Main {
private static void testEncodeLong64() {
Random r = new Random();
boolean success = true;
for (int i = 0; i < 100; i++) {
long x = r.nextLong();
long y = LongEncoder.encode64(x);
long z = LongEncoder.decode64(y... | false | 1,085 | 33 | 1,176 | 35 | 1,294 | 33 | 1,176 | 35 | 1,393 | 56 | false | false | false | false | false | true |
57071_8 | package cn.com.xiaoyaoji.entity;
/**
* 导入类型
* @author: zhoujingjie
* @Date: 17/4/16
*/
public class ImportType {
//pdf
public static final String IMPORT_PDF = "import.pdf";
//postman
public static final String IMPORT_POSTMAN = "import.postman";
//word
public static final String IMPORT_WOR... | Bin-mario/xiaoyaoji | xiaoyaoji-web/src/main/java/cn/com/xiaoyaoji/entity/ImportType.java | 228 | //印象笔记 | line_comment | zh-cn | package cn.com.xiaoyaoji.entity;
/**
* 导入类型
* @author: zhoujingjie
* @Date: 17/4/16
*/
public class ImportType {
//pdf
public static final String IMPORT_PDF = "import.pdf";
//postman
public static final String IMPORT_POSTMAN = "import.postman";
//word
public static final String IMPORT_WOR... | false | 215 | 3 | 228 | 5 | 237 | 3 | 228 | 5 | 297 | 9 | false | false | false | false | false | true |
18339_18 | import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
/*
日期类(Date,Calendar)
>前面两代日期类的不足分析
JDK1.0中包含了一个java.u... | BinGBanG21/JavaBing | JavaSE/Date01/src/Date01.java | 1,576 | //创建日历类对象//比较简单,自由 | line_comment | zh-cn | import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
/*
日期类(Date,Calendar)
>前面两代日期类的不足分析
JDK1.0中包含了一个java.u... | false | 1,435 | 10 | 1,576 | 11 | 1,570 | 11 | 1,576 | 11 | 2,149 | 22 | false | false | false | false | false | true |
23523_1 | package keyWords;
public class Volatile {
// 防止字分裂
// 字分裂就是:比如long、double都是64位,在32位计算机上,就要分两次更新一个值,可能在中途由于上下文的切换,就导致读值错误
// 可见性
// 阻止变量被编译器优化,也就是不会被缓存。变量值发生改变,就会直接写入主存,读的时候也只从主存里面拿
// 阻止 happens before
// java会对指令进行重排序来优化性能,这种重排序就叫 happens before ,先行发生保证
// volatile操作,也叫 内存栅栏... | BinchaoPeng/JavaLearn | src/main/java/keyWords/Volatile.java | 339 | // 字分裂就是:比如long、double都是64位,在32位计算机上,就要分两次更新一个值,可能在中途由于上下文的切换,就导致读值错误 | line_comment | zh-cn | package keyWords;
public class Volatile {
// 防止字分裂
// 字分 <SUF>
// 可见性
// 阻止变量被编译器优化,也就是不会被缓存。变量值发生改变,就会直接写入主存,读的时候也只从主存里面拿
// 阻止 happens before
// java会对指令进行重排序来优化性能,这种重排序就叫 happens before ,先行发生保证
// volatile操作,也叫 内存栅栏 memory barrier,该操作之前的读写等操作不会被重排序到volatile操作之后,对应其后面的操作也不会... | false | 325 | 42 | 339 | 50 | 331 | 42 | 339 | 50 | 511 | 70 | false | false | false | false | false | true |
45849_5 | package com.hu.dao.impl;
import com.hu.dao.ExpenseDao;
import com.hu.entity.Employee;
import com.hu.entity.ExpImage;
import com.hu.entity.Expense;
import com.hu.entity.ExpenseItem;
import com.hu.util.JdbcUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQ... | BingBuLiang/PersonnelManagement_OA | src/com/hu/dao/impl/ExpenseDaoImpl.java | 2,220 | //去除重复 | line_comment | zh-cn | package com.hu.dao.impl;
import com.hu.dao.ExpenseDao;
import com.hu.entity.Employee;
import com.hu.entity.ExpImage;
import com.hu.entity.Expense;
import com.hu.entity.ExpenseItem;
import com.hu.util.JdbcUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQ... | false | 1,960 | 3 | 2,220 | 4 | 2,352 | 3 | 2,220 | 4 | 2,658 | 5 | false | false | false | false | false | true |
47254_36 | package enumerated;
import java.util.*;
import net.mindview.util.*;
import static enumerated.Input.*;
import static net.mindview.util.Print.*;
enum Category { //使用Category枚举对贩卖机的状态进行了分类
MONEY(NICKEL/*5美分*/, DIME/*10美分*/, QUARTER/*25美分*/, DOLLAR/*100美分,即1美元*/){}, //金额
ITEM_SELECTION(TOOTHPASTE/*牙膏*/, CHIPS/*薯片*... | BingYu-track/Thinking-In-Java-Learning | src/enumerated/VendingMachine.java | 1,556 | //状态变更为"找零钱" | line_comment | zh-cn | package enumerated;
import java.util.*;
import net.mindview.util.*;
import static enumerated.Input.*;
import static net.mindview.util.Print.*;
enum Category { //使用Category枚举对贩卖机的状态进行了分类
MONEY(NICKEL/*5美分*/, DIME/*10美分*/, QUARTER/*25美分*/, DOLLAR/*100美分,即1美元*/){}, //金额
ITEM_SELECTION(TOOTHPASTE/*牙膏*/, CHIPS/*薯片*... | false | 1,407 | 9 | 1,557 | 10 | 1,580 | 9 | 1,556 | 10 | 2,172 | 17 | false | false | false | false | false | true |
58841_4 | package com.hbh.service;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.hbh.entity.Type;
import com.hbh.entity.TypeExample;
/**
* @Author Binvor
* @Date 2019年3月25日下午2:24:36
* @Des 类别管理
*/
public interface ITypeService {
// 删除
int delete(String protypeid);
//插入
int insert(... | BinvorWin/market | market/src/main/java/com/hbh/service/ITypeService.java | 201 | //根据主键查询
| line_comment | zh-cn | package com.hbh.service;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.hbh.entity.Type;
import com.hbh.entity.TypeExample;
/**
* @Author Binvor
* @Date 2019年3月25日下午2:24:36
* @Des 类别管理
*/
public interface ITypeService {
// 删除
int delete(String protypeid);
//插入
int insert(... | false | 157 | 6 | 195 | 5 | 191 | 5 | 195 | 5 | 233 | 12 | false | false | false | false | false | true |
32006_7 | package glorydark.lockershop.items;
import cn.nukkit.Player;
import cn.nukkit.Server;
import cn.nukkit.form.element.ElementButtonImageData;
import cn.nukkit.math.Vector3f;
import cn.nukkit.network.protocol.SpawnParticleEffectPacket;
import cn.nukkit.utils.Config;
import glorydark.lockershop.MainClass;
import lombok.Da... | BirdsStudio/LockerShop | src/main/java/glorydark/lockershop/items/particleItem.java | 1,517 | // 某实体的UUID, 目前无需理会, 默认为 -1 | line_comment | zh-cn | package glorydark.lockershop.items;
import cn.nukkit.Player;
import cn.nukkit.Server;
import cn.nukkit.form.element.ElementButtonImageData;
import cn.nukkit.math.Vector3f;
import cn.nukkit.network.protocol.SpawnParticleEffectPacket;
import cn.nukkit.utils.Config;
import glorydark.lockershop.MainClass;
import lombok.Da... | false | 1,294 | 18 | 1,517 | 19 | 1,555 | 16 | 1,517 | 19 | 1,892 | 25 | false | false | false | false | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.