method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
365ff292-493f-40a2-b6ef-bc07fb7caafe | 5 | public RandomListNode copyRandomList(RandomListNode head) {
if (head == null) return null;
RandomListNode p = head, p1;
while (p != null) {
p1 = new RandomListNode(p.label);
p1.next = p.next;
p.next = p1;
p = p1.next;
}
p = head;
... |
c27be95f-ecca-4c38-9b42-34c62f493856 | 6 | public List<java.util.LinkedList<Integer>> createDepthLinkedLists(TreeNode node){
if(node==null){
return null;
}
List<java.util.LinkedList<Integer>> linkedListList = new ArrayList<java.util.LinkedList<Integer>>();
Queue<TreeNode> nodeQueue = new ArrayDeque<TreeNode>();
... |
8e75045c-5ac9-4922-a2b6-fb1fd5d2d5e0 | 5 | public MatchResult match(EvaluationCtx context) {
MatchResult result = null;
// before matching, see if this target matches any request
if (matchesAny())
return new MatchResult(MatchResult.MATCH);
// first, try matching the Subjects section
result = subjectsSection.... |
25cc50e8-dc15-4769-8311-4392d1f476f7 | 7 | public Object [] getResultTypes() {
int addm = (m_AdditionalMeasures != null)
? m_AdditionalMeasures.length
: 0;
int overall_length = RESULT_SIZE+addm;
overall_length += NUM_IR_STATISTICS;
overall_length += NUM_WEIGHTED_IR_STATISTICS;
overall_length += NUM_UNWEIGHTED_IR_STATISTICS;
... |
d8aad6e0-132d-4c03-b6fb-17f1e8ab1ec2 | 1 | public boolean isFull() {
return mChildren[0] != null && mChildren[1] != null;
} |
2acb7024-0e0d-4ca8-a220-0ba005f8522e | 4 | private static BufferedImage deriveBufferedImageFromTIFFBytes(
InputStream in, Library library, int compressedBytes, int width, int height) {
BufferedImage img = null;
try {
library.memoryManager.checkMemory(compressedBytes);
/*
com.sun.media.jai.codec.Se... |
915bb894-8a9b-427a-8ec8-f58da9b34556 | 6 | public List<Integer> rightSideView(TreeNode root) {
if (root == null)
return new ArrayList<>();
Queue<TreeNode> queue = new LinkedList<>();
queue.add(root);
List<Integer> ret = new ArrayList<>();
while (!queue.isEmpty()) {
int size = queue.size();
... |
58509a3b-6dbc-4d19-886c-7cc9f3ad386f | 2 | public void Start() {
ServerSocket serverSocket = null;
Socket socket = null;
try {
serverSocket = new ServerSocket(7777);
System.out.println(" ۵Ǿϴ.");
ServerSender sender = new ServerSender(); // sender
sender.start();
// ϳ ϱ . (receiver Ŭ̾Ʈ ŭ )
while (true) {
socket = serverSock... |
60f9e09e-ebe4-430b-a994-0c2efc8b2d73 | 0 | public void popReturnAddrs() {
pc = returnAddrs.pop();
} |
ac4a7e64-8ce6-48e9-af95-cff1f0e7fdb5 | 0 | public static void setUsers(Map<String, UserEntity> users) {
Scheduler.users = users;
} |
a1a48dab-0430-4dd2-9117-e25bb167b112 | 9 | private void postPlugin(final boolean isPing) throws IOException {
// The plugin's description file containg all of the plugin data such as name, version, author, etc
final PluginDescriptionFile description = plugin.getDescription();
// Construct the post data
final StringBuilder data =... |
7d125a2c-1edd-486e-9666-4989eead2197 | 5 | public void send(DataOutputStream outputStream)throws Exception{
//send tanks
Tank s;
//outputStream.writeUTF("$tank$");
outputStream.writeInt(tanks.size());
for(Map.Entry<Integer, Tank> entry : tanks.entrySet()){
s = entry.getValue();
outputStream.writeI... |
43246730-9996-4e1c-a32d-98cb5b261227 | 0 | @Override
public void applyTemporaryToCurrent(){cur = new Color(tmp.getRGB());} |
6c2dc72f-ef05-43b7-843c-0930a4bc6438 | 3 | private void btnSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSwitchActionPerformed
AdministradorCRUD adao = new AdministradorCRUD(MyConnection.getConnection());
if(btnSwitch.getText().equals("Actualizar")){
Administrador admin = new Administrador(
... |
6f6e778f-1c55-41fe-8343-4d852556c61d | 9 | public static boolean confirmChanges(List<Path> filesToCopy, List<Path> filesToDelete, int charsToDisplay, Path outputPath) {
if (filesToCopy.isEmpty() && filesToDelete.isEmpty()) {
System.out.println("There are no changes.");
return true;
} else {
System.out.println("There are changes to sync ");
if (f... |
eca759f7-d4cb-4f65-bebe-1ad4696888e8 | 1 | @Override
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
if (cmd.equals("Add Keyword")) {
}
} |
485bcb12-91c6-48ee-b1cc-9c32b760bd82 | 7 | public static int connect(int a[], int al, int ar, int b[], int bl, int br)
{
int max = 0;
for (int i = al; i <= ar; i++)
{
int j = find(b, bl, br, a[i]);
if (j == -1)
continue;
int n = 0;
if (i - 1 >= 0 && j - 1 >= 0)
n += connect(a, al, i - 1, b, bl, j - 1);
if (i + 1 < a.length && j + 1... |
3ee4a833-c0f7-49ef-ae6e-ba4728518e3e | 0 | public void setPersonApplicantions(PersonApplication personApplicantions) {
PersonApplications.add(personApplicantions);
} |
f063e70e-907e-4e72-bb42-7e7d761d1f9c | 4 | @Override
public <T> void deleteObject(Class<T> clazz, Long id) {
Session session = null;
try{
session = sessionFactory.getCurrentSession();
session.beginTransaction();
T obj = (T)session.get(clazz, id);
session.delete(... |
c5aaf454-264e-4a75-936d-0222e5b1606c | 2 | public void filtrarEstrategias(){
for(int i=0;i<contenedorEstrategia.getEstrategias().size();i++){
System.out.println(contenedorEstrategia.getEstrategias().get(i).server+" "+serverTF.getText());
if(!contenedorEstrategia.getEstrategias().get(i).server.equals(serverTF.getText()... |
0965e91f-6513-443d-ba25-2449f8540b8c | 0 | protected int processSortInfo (byte[] sortInfo)
{
// TBD
// if (Outliner.DEBUG) { System.out.println("\tStan_Debug:\tPdbReaderWriter:processSortInfo"); }
return SUCCESS ;
} // end protected method processSortInfo; |
1009828d-72d9-46ca-a4dd-2dff37d77359 | 3 | private BitSet checkArcs( ListIterator<Arc> iter, String type )
throws MVDException
{
BitSet bs = new BitSet();
while ( iter.hasNext() )
{
Arc a = iter.next();
BitSet v = a.versions;
for ( int i=v.nextSetBit(0);i>=0;i=v.nextSetBit(i+1) )
{
if ( bs.nextSetBit(i)==i )
throw new MVDException... |
5b8723f9-09a1-4b57-9d4d-cb2cdb4308e2 | 4 | public void setColumnData(int i, Object value) throws Exception {
if (i == 0)
personID = (String) value;
else if (i == 1)
name = (String) value;
else if (i == 2)
projectID = (String) value;
else if (i == 3)
role = (String) value;
else
throw new Exception("Error: invalid ... |
0827164d-1b70-4353-a24d-9f310b4109a9 | 8 | private Point fisica(float dt, float x, float y, int diametro) {
x += vx;
y += vy;
if (vx < 0 && x <= 0 || vx > 0 && x + diametro >= getWidth())
vx = -vx;
if (vy < 0 && y < 0 || vy > 0 && y + diametro >= getHeight())
vy = -vy;
return new Point(Math.round(x), Math.round(y));
} |
086f7dd9-6838-43ec-b6c3-5e7183edb594 | 7 | public static Field randomReachableField(Field from, HashMap<Field, ArrayList<Object>> conflictingHashMap, ArrayList<Field> shouldGetCleared) {
LinkedList<Field> frontier = new LinkedList<Field>();
frontier.add(from);
ArrayList<Field> closedSet = new ArrayList<Field>();
Field currentField = frontier.p... |
260fe62c-f96f-4a3d-ad00-dce2cd04709d | 8 | public void drawObjects(Graphics g){
g.drawImage(bg, 0, 0);
int x=75;
int y=50;
for(int j=0; j<4; j++){
for(int i=0; i<10; i++){
if((j*10)+i < objectList.size()){
if( objectList.get((j*10)+i) != null){
if(objectList.get((j*10)+i).itemClass==1){
g.drawImage(objectList.get((j*10)+i).getIm... |
89a12466-a609-46ff-bf03-f7e270a22374 | 5 | public void printTopTerms(int n) {
List<String> seen = new ArrayList<String>();
for (int i=0; i<n; i++) {
double highest = 0;
String base = "";
for (Map.Entry<String, Double> e : termScore.entrySet()) {
if (!seen.contains(e.getKey()) && e.getValue(... |
b62c31dd-4309-4a61-ac83-9789881929fb | 0 | public void test(){
System.out.println("HeadCount : "+getH()+" TailCount : "+getT());
} |
25009eaf-f10a-4de2-a2f6-4a5e309a2ba1 | 7 | public List<String> userService(String userName, String userType) {
List<String> serviceList = new Vector<String>();
String currentLine;
StringTokenizer strTk;
BufferedReader br = getFileReader();
if(br == null) {
System.err.println("Error opening file");
System.exit(1);
}
try {
//Read until ... |
240261f0-8ba7-40b3-bbee-f5d9cbf4a8cc | 3 | @Override
public boolean getDebugMode() {
Object[] buttons = {"Debug mode", "Play Normally"};
int userInput = JOptionPane.showOptionDialog(null,
"Would you like to use debug mode? \n (This will display all game-states at every update.)",
"Quantum Werewolves",
JOptionPane.YES_NO_OPTION... |
6efbbc9e-cf92-48e8-ac8a-15524cdd7246 | 0 | @After
public void tearDown() {
} |
22f0b074-25fa-49d7-a5d3-786c9f09e92b | 8 | public void onKeyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case VK_UP:
case VK_W:
directions.add(Direction.UP);
break;
case VK_DOWN:
case VK_S:
directions.add(Direction.DOWN);
break;
case VK_RIGHT:
case VK_D:
directions.add(Direction.RIGHT);
break;
case VK_LEFT:
case VK_A:
... |
ffe10595-7f14-4d95-acbd-6094a132d5d7 | 4 | public static void main(String[] args) {
final int MAX_STUDENTS = 50, MAX_SUBJECTS = 3;
int[][] marks = new int[MAX_STUDENTS][MAX_SUBJECTS];
// generate data into the marks
for (int studentID = 0; studentID < MAX_STUDENTS; studentID++) {
for (int subjectID = 0; subjectID < MAX_SUBJECTS; subjectID++) {
ma... |
91797e76-d9cc-4286-9cc8-acba56122494 | 4 | @Override
public Value evaluate(Value... operands) throws Exception {
// we need two operands
if (operands.length != input())
throw new EvalException("Error: wrong number of operands");
// get operands
Value l = operands[0];
Value r = operands[1];
// if they are identical
if (l.getType().isNumeric()... |
ed104cda-d91b-4ec7-9910-37212aecc0e5 | 5 | static void move(int[][] board, int x, int y, int dx, int dy, int n, int m) {
while (true) {
if (board[x][y] == 0) {
break;
}
int tox = x + dx;
int toy = y + dy;
if (!inside(tox, toy, n, m)) {
break;
}
... |
65882fe1-c920-46ae-a703-3dabacda5422 | 6 | public boolean assignUser(int idUser) {
Action pick = new Action(idUser, true);
Action drop = new Action(idUser, false);
if (size() == 0) { // Agregarse a sí mismo
add(pick);
add(drop);
} else { // Agregar otros usuarios
add(1, pick); //Agregar la recogida del nuevo como primer paso
int carrying =... |
f7f15694-6ef9-49e1-997d-f8ec9d38afb2 | 1 | @Test
public void RussianName() throws Exception {
LoginCheck logCh = new LoginCheck();
name = "Вася585";
if (kesh.containsKey(name)) {
assertFalse(kesh.get(name));
} else {
boolean result = logCh.validate(name);
kesh.put(name, result);
... |
0924b0b7-af67-4684-94ef-82f3ee426253 | 4 | @Override
public void undo() {
if (prevSpeed == CeilingFan.HIGH) {
ceilingFan.high();
}
if (prevSpeed == CeilingFan.MEDIUM) {
ceilingFan.medium();
}
if (prevSpeed == CeilingFan.LOW) {
ceilingFan.low();
}
if (prevSpeed == Cei... |
799601cf-2c6a-4165-9c20-0d725e0df8a2 | 3 | public Command getCommand()
{
String inputLine; // will hold the full input line
String word1 = null;
String word2 = null;
System.out.print("> "); // print prompt
inputLine = reader.nextLine();
// Find up to two words on the line.
Scanner tokenizer =... |
630bdbad-a6af-4ce7-b58d-023d4b05e491 | 4 | @Override
public void keyReleased(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_UP)
{
this.rotation = CharRotation.UP;
Helper.moveIfPossible(this, x, y - 1);
Helper.eatFlowerIfCollided(this);
}
else if (e.getKeyCode() == KeyEvent.VK_DOWN)
{
this.rotation = CharRotation.DOWN;
Helper.moveIfPo... |
e3ca9151-fb55-405c-a293-c31510aafc1f | 3 | public void sortScoreInfo() {
int i = 0, j = 0;
String temp = "";
for(i = 0; i < users.size(); i++) {
for(j = i; j < users.size(); j++) {
if(Double.parseDouble(highScores.get(i)) < Double.parseDouble(highScores.get(j)) ) {
temp = users.get(i);
users.set(i, users.get(j));
users.set(j, temp);
... |
644b9c51-675a-4c7b-8a57-afc4c890e3b6 | 9 | public void testClosedPoolBehavior() throws Exception {
final ObjectPool pool;
try {
pool = makeEmptyPool(new MethodCallPoolableObjectFactory());
} catch (UnsupportedOperationException uoe) {
return; // test not supported
}
Object o1 = pool.borrowObject();... |
a8eddc21-d352-44de-b8ee-3936675a7e29 | 0 | public List<String> getPermissionCommand()
{
return config.getStringList("ArenaOption.PermissionCommands");
} |
66b487c3-6c74-41b5-8f12-0268b6b82827 | 0 | public String getSintoma() {
return sintoma;
} |
c6144a1e-fa60-4129-b7e3-50b399bc11a1 | 1 | @Override
public void run() {
for (i=0; i <= aantal; i++){
System.out.print(letter);
}
} |
30a6b619-6efb-4202-9286-485e5c9edad4 | 3 | @Test
@Ignore
public void testCycles() {
if (jdepend.containsCycles()) {
StringBuilder sb = new StringBuilder(
"The following packages contain cycles which should be removed.");
for (Object element : jdepend.getPackages()) {
JavaPackage pa... |
e6cdf145-3d54-4560-ad2c-6419b686e7aa | 7 | public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof XYSeries)) {
return false;
}
if (!super.equals(obj)) {
return false;
}
XYSeries that = (XYSeries) obj;
if (this.maximumItemCount ... |
f1f08485-d5b0-49cc-904e-40c5f42b8283 | 9 | private ArrayList<ServerMessage> updateConvo(String message) {
ArrayList<ServerMessage> messageList = new ArrayList<ServerMessage>();
//Parse the message data into appropriate fields
boolean convo_id = false;
StringBuilder ci = new StringBuilder();
boolean user = false;
S... |
f41eeb5f-6174-43bf-bf72-d0d848cf07b2 | 2 | public int reduceHealth(int damage)
{
health = health - damage;
if(health <= 0)
{
health = 0;
dead = true;
}
if(health > maxHealth)
{
health = maxHealth;
}
return health;
} |
8576b302-a4d3-4ed2-b7d3-4003e1be231f | 8 | private static int pivot(int[] a, int low, int high) {
int i1 = low, i2 = high - 1, i3 = (low + high) / 2;
int a1 = a[i1], a2 = a[i2], a3 = a[i3];
int n = (a1 > a2) ? a1 : a2;
int m = (a2 > a3) ? a2 : a3;
if (m > n) {
return (a1 > a2) ? i1 : i2;
} else if (n... |
e92f6e09-cbbe-4fdb-bef5-9c059dca0509 | 8 | private Map<String, Element> gatherCCSSResults() {
Map<String, Element> results = new HashMap<>();
String sql = "SELECT "
+ " MSP.projectID "
+ ", MSP.siteID, BS.disname, BS.schname "
+ ", BC.gradeLevel "
+ ", BC.subjectArea "
... |
ebf3a586-20be-4714-aa03-e284a005dda0 | 7 | public void DBUpdateFollowers(MOB mob)
{
if((mob==null)||(mob.Name().length()==0))
return;
final List<DBPreparedBatchEntry> statements=new LinkedList<DBPreparedBatchEntry>();
statements.add(new DBPreparedBatchEntry("DELETE FROM CMCHFO WHERE CMUSERID='"+mob.Name()+"'"));
for(int f=0;f<mob.numFollowers();f++)... |
2b44fe77-82fd-4b1f-8f43-a7e3dd60f804 | 5 | public static String checkBanned(String ip) throws UnknownHostException {
String query = "SELECT * FROM `" + mysql_db +"`.`banlist`";
try (Connection con = getConnection(); PreparedStatement pst = con.prepareStatement(query)) {
ResultSet r = pst.executeQuery();
while (r.next()) {
String decIP = r.getStrin... |
acae2ae9-04f3-496f-9688-e778f2a0cce4 | 7 | @Override
public void doPost( HttpServletRequest req, HttpServletResponse resp )
throws ServletException, IOException {
String gameIdString = req.getParameter( "gameid" );
String playerIdString = req.getParameter( "playerid" );
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreServic... |
04601fb4-9efe-4723-a1c0-0fc29065e259 | 7 | public void SmartIDCardInserted(CardActionEvents ce) {
System.out.println("Inserted SmartID card.");
long timeElapsed = 0;
try {
BasicService service = ce.getService();
service.open();
Reader reader = new Reader();
if (service != null) {
PasswdEnterDialog passwd = new PasswdEnterDialog(reader, "Sm... |
eb9963df-d2f0-45d2-849a-348966b442cb | 0 | public void createNewPizzaProduct() { pizza = new Pizza(); } |
0040de97-9e81-4b49-aa2e-48bc8c4ca7cf | 6 | public void generate(Land[][] world, float heightThreshold, float lakeLevel){
this.lakeLevel = lakeLevel;
this.world = world;
ArrayList<Land> startOptions = new ArrayList<Land>();
ArrayList<Land> riverStarts = new ArrayList<Land>();
for(int i = 0; i < world.length; i++){
for(int j = 0; j < world[0].length;... |
f018466e-b988-47a3-a1cb-5a1e7fdaed41 | 4 | public TableModel Update() {
String columnNames[] = { "Liste Filiere"};
DefaultTableModel defModel = new DefaultTableModel();
defModel.setColumnIdentifiers(columnNames);
SequenceController seq_classe= new SequenceController();
seq_classe.CreateSequence("SEQ_FILIERE");
... |
d6920ff5-0028-452e-86aa-0edaae70e08f | 0 | public int getBlood() {
return blood;
} |
fa89d229-ef29-479f-9672-72ed9e080a6c | 3 | private void updateTrainingBall() {
if (ballY >= 0.95 || ballY <= -0.95) {
ballYSpeed = -ballYSpeed;
}
//Left Paddle (AI)
if (ballX <= -0.9) {
stateList.learnAll((ballY+1)/2, AI);
stateList.reset();
resetRandomBall();
}
stateList.add(ballX, ballY, ballYSpeed);
ballX += ballXSpeed;
ballY +... |
0df894af-5de8-4570-babf-ba624011d965 | 5 | private Graph<TypedVerTex, DefaultEdge> generateGraph(Tuple<double[][], String[][]> params) throws UserError {
double[][] data1=params.getKey();
//String [][]data2=params.getValue();
int noTypes=(int)data1[0][0];
int noNoRels=(int)data1[0][1];
//------------
BuildHeteGraph x=new BuildHeteGraph();
//get... |
a1882883-edba-4d8d-92af-495c88a185b4 | 4 | protected List<Integer> getAllPrimes() {
boolean[] sito = new boolean[N];
for (int i = 1; i < sito.length; i++) {
sito[i] = true;
}
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < sito.length; i++) {
if (sito[i]) {
int i1 = i + 1;
list.add(i1);
int x = 2;
int j ... |
32a982a5-6f51-41a1-8ce2-6e75cf081ddc | 3 | public static void main(String[] args) throws InterruptedException {
PoolingClientConnectionManager pool = new PoolingClientConnectionManager();
final HttpClient httpClient = new DefaultHttpClient();
ForkJoinPool forkJoinPool = new ForkJoinPool();
ArrayList<FutureTask<Object>> futureTask... |
4fd4bd68-e5b9-4a83-a031-b66d94961107 | 3 | public static String getJsonFromData(Data data){
ObjectMapper mapper = new ObjectMapper();
StringWriter writer = new StringWriter() ;
try {
mapper.writeValue(writer, data) ;
} catch (JsonGenerationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JsonMappingException e)... |
df73854b-b64e-489a-8d67-53a66255c660 | 4 | @Override
public void run() {
WordNode current_node;
if((current_node = this.the_words.getHead()) == null)
return;
for(int i=0; i < this.the_words.getSize(); ++i){
if(isFormable(current_node)){
this.formable_words.add(current_node.copy());
// Keep largest words next to each other
if(... |
292900ec-72e3-415a-b3f6-f79b20479410 | 8 | public String toString(){
StringBuffer sb = new StringBuffer();
switch(type){
case TYPE_VALUE:
sb.append("VALUE(").append(value).append(")");
break;
case TYPE_LEFT_BRACE:
sb.append("LEFT BRACE({)");
break;
case TYPE_RIGHT_BRACE:
sb.append("RIGHT BRACE(})");
break;
case TYPE_LEFT_SQUARE:
... |
44b37b2e-9393-49d7-8ce5-78559e9e79d5 | 4 | public HelpFrame() {
this.setTitle("Syntaxilizer Help");
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setSize(Main.WIDTH - 200, Main.HEIGHT - 100);
this.setResizable(true);
this.setLocationRelativeTo(null); //center window on screen
helpPane = new JEditorPane();
... |
dc0bd3d7-4439-4b63-9719-a7dbc5b740a7 | 7 | @Override
public String getJSONString() {
StringBuilder json = new StringBuilder()
.append("{")
.append(super.getJSONBaseString());
if(this.getRepeat() != null) {
json.append("\"repeat\":{");
for(int i=0;i<7;i++) {
json.append("\"").append(Daily.days[i]).append("\": ").append(this.getRepeat()[i]... |
f7ac5a7e-90c8-40ec-9cad-61d2e8b1eeea | 2 | public BufferedImage getImage() {
if (image == null) {
try {
return ImageIO.read(new File("res/default.png"));
} catch (IOException ex) {
return null;
}
} else {
return image;
}
} |
69b88c5d-5249-4c8a-8868-d9af6bc1ab0d | 2 | private void mapRawData(String[] tickers) {
System.out.println("total number of tickers: " + tickers.length);
int counter = 0;
// (" 2 36 44 9 9 9 9 9 9 9 9 9 9 1 1 1");
for (String tk : tickers) {
StringBuilder saveAsText = new StringBuilder();
saveAsText.append(cnnForecast(tk).trim());
saveAsText.ap... |
c3a78aad-e61a-4136-babb-892257a7dfa5 | 0 | public int[] getMessageTimestamps()
{
return messageTimestamps;
} |
b62cce5d-dcd6-41d8-aa28-5e1447766f27 | 3 | public boolean onCommand(CommandSender sender, String[] args) {
// get the groups
PermissionGroup[] groups = plugin.permissions.getGroups();
// create a comparator
Comparator<PermissionGroup> rankComparator = new RankComparator();
// and sort the groups
Arrays.sort(groups, rankComparator);
// print ... |
ead1f11c-1abf-426e-b680-51662c6d0a09 | 0 | public String getAccessToken_secret() {
return accessToken_secret;
} |
cd4c43b1-3d5e-4baf-ad18-1659cfc7f5e4 | 8 | final public void start(BlockStatement node) throws ParseException {
label_1:
while (true) {
assign(node);
jj_consume_token(SEMICOLON);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SEMICOLON:
case STATEMENT:
case PRINT:
case READ:
case TYPE:
case ID:
... |
73bed854-9190-4bd4-9a41-ab48d2f85485 | 0 | public String getGoTo() {
return goTo;
} |
d9039f30-7086-4a59-a132-9b40ed08515f | 2 | private String decodeAuthCookieSafely(Cookie cookie) {
if (cookie == null) {
return null;
}
String decodedCookieValue = null;
try {
decodedCookieValue = Base64Utils.decode(cookie.getValue());
} catch (Base64Exception e) {
LOGGER.log(Level.WARNI... |
47528f42-fcb5-4591-814a-56d4becbabb0 | 4 | public boolean playerHasItem2(int itemID) {
for (int i= 0; i < playerItems.length; i++)
{
if (playerItems[i] == itemID+1)
{
playerAxe = itemID;
return true;
}
}
for (int i2 = 0; i2 < playerEquipment.length; i2++)
{
if (playerEquipment[i2] == itemID)
{
... |
18c24651-ce24-4a52-b157-3eeaa1546f49 | 6 | public void addStateMarker(int state, double time) {
plot.addDomainMarker(new ValueMarker(time, Color.BLUE, new BasicStroke((float) 2.5)));
switch(state) {
case 2:
XYTextAnnotation text = new XYTextAnnotation("Armed", time, 500);
text.setFont(new Font("SansSer... |
46f4667e-057f-489a-8e14-37ca33c1b625 | 6 | private void stop() {
if (isMovingRight() == false && isMovingLeft() == false) {
speedX = 0;
}
if (isMovingRight() == false && isMovingLeft() == true) {
moveLeft();
}
if (isMovingRight() == true && isMovingLeft() == false) {
moveRight();
}
} |
412e7d6f-923b-4c9b-883e-170ace61102d | 8 | public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//¶Ӧı,ĽȷĽ
request.setCharacterEncoding("gbk");
response.setContentType("text/html;charset=gbk");
//ĬϵϢ
String searchPath = "D:\\Bingo_Index";
... |
fc733a09-395a-4ec1-b27f-098070d55a26 | 2 | public static double absDiff(double[] obs, double[] sim, double missingValue) {
sameArrayLen(obs, sim);
double abs = 0;
for (int i = 0; i < obs.length; i++) {
if (obs[i] > missingValue) {
abs += Math.abs(obs[i] - sim[i]);
}
}
return abs;
... |
e35518b0-7244-45b2-a270-68762a832948 | 8 | private static void processToken(String token, Stack<String> operators, Vector<String> postfix)
{
if(token.matches("\\p{Alpha}+")) // If is an ID puts it on the vector
{
postfix.add(token);
}
else if(token.equals(")")) // If ")" pop until find matching "("
{
while(!operators.empty())
{
Stri... |
3e9fcec2-a3a7-4f54-b8f5-ae44e0dba618 | 3 | public List<String>delNickName(String nickName) throws NickNameNotExist {
if(!nickNameAlreadyExist(nickName)) throw new NickNameNotExist();
for (Personne p : listPer) {
if(p.getListNickName().contains(nickName)) {
int rang = p.getListNickName().indexOf(nickName);
p.getListNickName().remove(rang);
bre... |
3ac179b4-b9ee-4f6b-b44b-7a4253d65466 | 4 | private boolean valueSearchNonNull(Entry n, Object value) {
// Check this node for the value
if (value.equals(n.value))
return true;
// Check left and right subtrees for value
return (n.left != null && valueSearchNonNull(n.left, value)) ||
(n.right != null &&... |
fba5addc-acdb-4cc5-9900-1a03cda215cf | 7 | static final void method106() {
IndexLoader.anInt669 = 0;
for (int i = 0; i < Class150.anInt2057; i++) {
Npc class318_sub1_sub3_sub3_sub1
= (((Class348_Sub22) (Class348_Sub22)
Class282.aClass356_3654
.get((long) EntityPacket.anIntArray1233[i]))
.aClass318_Sub1_Sub3_Sub3_Sub1_6859);
if ((((Mo... |
7b81061e-77da-4b29-872d-816a66fe9093 | 7 | public void equipBraves(IndianSettlement is) {
final Specification spec = getSpecification();
List<Unit> units = is.getUnitList();
units.addAll(is.getTile().getUnitList());
roles: for (Role r : new Role[] { Role.DRAGOON, Role.SOLDIER,
Role.SCOUT ... |
3c9dcd78-c0a5-4a9f-9264-a37969f9e8b1 | 9 | public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if (e.getActionCommand() == "Exit") {
this.exitButtonActionPerformed(e);
} else if (e.getActionCommand() == "Sort!") {
startSortButtonActionPerformed(e);
} else if (e.getActionCommand() == "Source Dir") {
sourceDirUpdate()... |
baa25fca-2b0b-4748-bf31-778d1b66d5f0 | 2 | private void programmerAutosaveButton(java.awt.event.ActionEvent evt)
{
try
{
List<String> userInput = Arrays.asList(programmerText.getText().split("\n"));
PrintWriter out;
DateFormat dateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss");
... |
e17e1529-3759-4a4f-9ab6-af082e1a1f47 | 9 | private String httpRequest(Map<String, String> param, String method) {
Log.d("httpRequest", "start to send http request");
// 添加其他默认需要的参数
param.put("method", method);
if (!param.containsKey("v")){
param.put("v", Ver);
}
if (!param.containsKey("appKey")){
... |
fd618a42-338e-464f-80b0-ccb9ddd6f836 | 0 | public static float getYawByF(int f) {
return f * 360.0f / 4.0f;
} |
1c0a42c5-ad2a-4446-9130-ae8c1a3523c7 | 9 | @Override
public void step(PulsatioGame game, float delta) {
stage.act(delta);
stage.draw();
heartbeatTimer += delta;
if (heartbeatTimer >= 12) {
heartbeatTimer = 0;
game.assets.get("sound/GGJ13_Theme.wav", Sound.class).play(adrenalineteam0*3f);
}
if (placementPhase && player0placed && player1p... |
c92dec40-601c-46eb-b879-1e278c08cb35 | 8 | private void handleInput()
{
//Toggle debug screen
if(in.getKeypress(debugButton))
{
debugMenu=!debugMenu;
}
//Toggle music
if(in.getKeypress(music))
{
AudioManager.epic.toggle();
}
//Toggle flying
if(in.getKeypress(fly))
{
this.cam.fly=!this.cam.fly;
this.grounded=false;
}
//Hos... |
5a19b5e5-8251-4421-8c04-a44972720994 | 2 | public List<Planet> NeutralPlanets() {
List<Planet> r = new ArrayList<Planet>();
for (Planet p : planets) {
if (p.Owner() == 0) {
r.add(p);
}
}
return r;
} |
8b053b7d-4347-4950-b553-a093e87d7d97 | 8 | public List<Long> getLongList(String path) {
List<?> list = getList(path);
if (list == null) {
return new ArrayList<Long>(0);
}
List<Long> result = new ArrayList<Long>();
for (Object object : list) {
if (object instanceof Long) {
result.... |
9459c1c1-dfaa-4990-b788-47c897f19bda | 0 | private static ImageProcessor xGradient(ImageProcessor ip){
ImageProcessor result = ip.duplicate();
int[] Gx = {-1, 0, 1, -2, 0, 2, -1, 0, 1};
result.convolve3x3(Gx);
return result;
} |
00f0576b-a5cc-4a0f-8493-ab5af8d7b801 | 9 | public int compareTo(CHRTile tile){
if(tile.tileWidth != tileWidth){
return ((tile.tileWidth < tileWidth) ? 1 : -1);
}
if(tile.tileHeight != tileHeight){
return ((tile.tileHeight < tileHeight) ? 1 : -1);
}
if(IMAGE_SIMILARITY_THRESHO... |
e8823b07-bc8f-46f2-9187-ecd872ba57a6 | 2 | public static int fac(int k) {
if (k < 0)
return 0;
int kfac = 1;
while (k > 1) {
kfac = kfac * k;
k = k - 1;
}
return kfac;
} |
da0313ca-668a-4d3e-986b-9269aed782d1 | 7 | public void saveScoreStats() {
File file = new File("Scores.txt");
boolean flag = false;
FileWriter writer;
ArrayList<String> scoreData = new ArrayList<String>();
ListIterator<String> iterator;
try {
Scanner s = new Scanner(file);
while(s.hasNextLine()) {
scoreData.add(s.nextLine());
}
s.clo... |
1c6b336b-c7aa-4711-a5fd-1caad74e2034 | 1 | public void removePush() {
if (stack != null)
instr = stack.mergeIntoExpression(instr);
} |
45698a6e-00ac-484e-82de-5b6db8b1f998 | 6 | @RequestMapping(value="inserirDisciplina",method = RequestMethod.POST)
public String inserir(@Valid Disciplinas disciplina, BindingResult result, final RedirectAttributes redirectAttributes) {
if(disciplina.getCodDisciplina()==null || disciplina.getCodDisciplina().equals("")) {
System.out.println("Erro");
retu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.