method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
56c2ecba-18cf-41f6-ab04-8de480510035 | 5 | @Override public FileBlob getBlob( String urn ) {
Matcher m = SHA1EXTRACTOR.matcher(urn);
if( !m.find() ) return null;
if( !dataDir.exists() ) return null;
String sha1Base32 = m.group(1);
String postSectorPath = sha1Base32.substring(0,2) + "/" + sha1Base32;
File[] sectorFileList = dataDir.listFiles... |
77a983ea-988e-4cab-a990-eec6413a79cc | 0 | public GenericDAOXml(String filename, Class<T> klass) throws DaoException {
super(filename);
this.klass = klass;
} |
7ba0b54a-babb-4766-858c-bef6bb632b14 | 0 | public CmpPoint(int x, int y) {
this.x = x;
this.y = y;
} |
1729f130-5fee-4c3b-afc3-431b0714e562 | 0 | @Basic
@Column(name = "taxable")
public int getTaxable() {
return taxable;
} |
42379742-5ba1-4da0-b87e-a61cf013a1c9 | 1 | public void heapSort() { // decreasing order, since this is maxHeap
for (int i = 0; i < heap.size(); i++) {
BTPosition<T> tmp = remove();
System.out.println("Removed: " + tmp.element());
}
} |
fc798a6c-b69c-4b72-b805-f58a71c8c3ba | 9 | private void searchWordTxtBoxKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_searchWordTxtBoxKeyPressed
// 入力されたキーを取得
int keycode = evt.getKeyCode();
// Enterキーを入力した場合
if (keycode == KeyEvent.VK_ENTER) {
// ファイルオブジェクト
File objFile = new File(POST_COD... |
ea58e59a-403e-44ae-8aa0-6145832f3d65 | 7 | public Component getComponentForDataSection(TaskObserver taskObserver, String dataSectionName) throws InterruptedException
{
if (dataSectionName == DATA_SECTION_UNKNOWN0) { return getGeneralPanel(taskObserver); }
else if (dataSectionName == DATA_SECTION_VISIBLE_MAP_1) { return getVisibleMapPanel1(ta... |
72fbc712-3ea6-4ea7-9e71-d093782f1126 | 3 | public void connect(String host, int port)
{
try
{
if (host.length() > 4) setConnection(new Socket(host, port));
}
catch (UnknownHostException e)
{
chatLogWrite("Impossible to find your mate's host :C. Check twice his Ip :) ");
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrac... |
39ff841c-b715-4e18-bcf7-2c80ce6ef6ce | 1 | @Override
public int attack(double agility, double luck) {
if(random.nextInt(100) < luck)
{
System.out.println("I just created a darkness jupitel!");
return random.nextInt((int) agility) * 2;
}
return 0;
} |
28ee6cf3-af87-471a-ae2b-05339a58b2e4 | 7 | public static String LCS2(String s1, String s2, String[][] LCSArray, int index1, int index2){
if(index1 == -1 || index2 == -1) return "";
if(s1.charAt(index1) == s2.charAt(index2)){
if(LCSArray[index1][index2]=="")
LCSArray[index1][index2] = LCS2(s1, s2, LCSArray, index1-1, index2-1);
LCSArray[index1+1][... |
27ced2e9-44de-4823-9663-d4ed73327222 | 4 | public void refaz(int esq, int dir) {
int j = esq * 2;
int x = this.fp[esq];
while (j <= dir) {
if ((j < dir) && (this.p[fp[j]] > this.p[fp[j + 1]]))
j++;
if (this.p[x] <= this.p[fp[j]])
break;
this.fp[esq] = this.fp[j];
this.pos[fp[j]] = esq;
esq = j;
j = esq * 2;
}
this.fp[esq] = x... |
46422c77-44b2-4a18-aeb6-e6e55c181bed | 5 | public static void main(String[] args) {
int origem = 0;
int destino = 0;
try {
totalVertices = countLines("arquivo.txt");
System.out.println("O vertice de indice mais alto tem valor: " + totalVertices);
Scanner scanner = new Scanner(System.in);
System.out.println("Informe os vertices de ori... |
5abf584f-2020-44f3-a02a-668f48af6049 | 5 | @Override
public void Draw(Graphics2D g2d)
{
switch (gameState)
{
case PLAYING:
game.Draw(g2d, mousePosition());
break;
case GAMEOVER:
game.DrawGameOver(g2d, mousePosition());
break;
case MAIN_MENU:
... |
5d875540-3549-4418-bde8-f4adccd49602 | 0 | public static void addEventInTime(Event e)//adds the passed in event into the date in history
{
Day d = cursor.getDayStored();//the current the c
d.addEvent(e);
CalendarProject.saveEvents(cursor);//saves the file into text
// ArrayList <Day> listOfDays= currentMonth.getDays();
// listOfDays.set(d.getNu... |
235dcf69-3412-4a9b-a4af-a18ab479eb50 | 1 | @Override
public void onEvent(Event event) {
// If this event happens to be a ScannedRobotEvent...
if (event instanceof ScannedRobotEvent) {
onScannedRobot((ScannedRobotEvent) event);
}
} |
5e89525b-ce54-44ee-8a40-edb1df5cf861 | 7 | protected void fileArrestResister(Law laws, Area myArea, LegalWarrant W)
{
if((W.criminal()!=null)
&&(W.arrestingOfficer()!=null)
&&(!W.arrestingOfficer().amDead())
&&(!W.crime().equalsIgnoreCase("pardoned"))
&&(!CMLib.flags().isInTheGame(W.criminal(),true))
&&(isStillACrime(W,false)))
{
if(laws.basic... |
466a5e5c-3635-4f39-983e-1b6b506f6ae6 | 5 | final void setEnabled(final boolean enabled) {
if (isEnabled != enabled) {
isEnabled = enabled;
if (isEnabled) {
onEnable();
} else {
onDisable();
// delete all the locals
if (MiniPythonPlugin.mashUpJython) {
... |
0716abbd-a14f-40f3-9d64-c753997dc4fe | 1 | public static String md5(byte[] data) throws NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance(MD5);
digest.update(data);
byte[] bytes = digest.digest();
int length = bytes.length;
StringBuffer buffer = new StringBuffer(length * 2);
// 把密文转换成十六进制的字符串形式
for (int j = 0; j < length... |
77d1fd35-5d57-408e-849b-4c63672951aa | 0 | @Override
public String toString() {
return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
} |
df284b5c-27d0-427c-ac6d-a6d8bccb7f3e | 4 | public static void main(String[] args) {
final Statistic statistic = new StatisticImpl();
statistic.setStartTime(new Date());
QuestionGenerator generator = makeGenerator();
Formatter<Statistic> formatter = new StatisticFormatter();
final ManifestReader manifest = new ManifestRead... |
5d9aeca8-499c-4cfb-92d9-9a2d9eaeb83c | 0 | public ArrayList<Rectangle> getPanels() {
return panels;
} |
dc72ed0d-a33e-4d01-b94e-0d66d8b9c29c | 0 | public FileRecv( String addr, String name ) {
srcaddr = addr;
srcname = name;
} |
6cd1c04e-fe0e-489a-bd13-85f445221655 | 1 | public int queueLengthIter(){
PatientDL temp = this;
int count = 0;
while (temp != null){
temp = temp.nextPatient;
count++;
}
return count;
} |
fc337e4b-40bd-4aa7-8b62-5123f67b19e0 | 3 | protected void initiateCandidateSolutions() {
int columns = objectiveFunction.getVariables();
position = new double[numberOfParticles][columns];
velocities = new double[numberOfParticles][columns];
for(int i = 0; i < numberOfParticles; i++){
for(int k = 0; k < columns; k++){
velocities[i][k] = 0;
if(... |
480cd20d-02b5-4b0a-89f4-9cef85647068 | 8 | @Override
public void e(float sideMot, float forMot) {
if (this.passenger == null || !(this.passenger instanceof EntityHuman)) {
super.e(sideMot, forMot);
this.W = 0.5F; // Make sure the entity can walk over half slabs,
// instead of jumping
return;
}
EntityHuman human = (EntityHuman) this.passe... |
003afe36-a24a-4945-959f-6e5fcd163beb | 8 | public static boolean isValid(char[] input) {
LinkedList<Character> stack = new LinkedList<>();
for(int i=0; i< input.length; i++) {
if(stack.peek() != null) {
// get the top element
char c = stack.peek();
//switch the top element
... |
619d8c9f-11af-4a3d-8542-7c4d9b88b7f2 | 8 | static void prob8() {
/*
* Find the greatest product of five consecutive digits in the
* 1000-digit number.
*
* 73167176531330624919225119674426574742355349194934
* 96983520312774506326239578318016984801869478851843
* 85861560789112949495459501737958331952853208805511
* 1254069874715852386305071... |
fce51b02-d164-4282-9a43-7db1ac8a81a6 | 6 | static void removeEdge(HashSet<String> subgraph) {
double min_jaccard = 99999;
int max_union = 0;
String min_a = null;
String min_b = null;
for (String from : subgraph) {
for (String to : graph.get(from)) {
if (subgraph.contains(to)) {
double jaccard = jaccard(from, to);
if (jaccard == 0) {
... |
4a1122a7-e59f-4279-8bd2-53dab3fce28b | 1 | private void goBack() {
try {
myCurrentPosition--;
String url = (String) myURLHistory.get(myCurrentPosition);
setDisplay(url);
} catch (Throwable e) {
myCurrentPosition++;
}
} |
40ba76ba-8517-429a-8c88-d0e1441c8de7 | 2 | public Transition<TransitionInput> findFirstValidTransition(TransitionInput input) {
for(Transition<TransitionInput> transition : transitions) {
if(transition.isValid(input)) {
return transition;
}
}
return null;
} |
a75725a8-366c-4dcc-bd37-00fa1c22d8b0 | 5 | public Model createRDF(ArrayList<GeoEvent> geoArray){
Database db = Database.getInstance();
Model model = db.getModel();
for(GeoEvent geoEvent : geoArray){
String venueURL = geoEvent.getVenue().getUrl();
//Resource event and adding it's properties
Resource event = model.createResource(geoEvent.getEve... |
4905bd87-3709-43ab-8c03-e212a24b1bff | 5 | public long[][] loadArrays(String filename) {
long [][] result=null;
try (InputStream input = new FileInputStream(filename)) {
List<String> lines = IOUtils.readLines(input);
int count=0;
for(String line:lines){
String[] numbers = line.split(" ");
if(numbers.length>count){
count=numbers.length;... |
e89c9aed-3a44-44aa-b428-92b559ac16ee | 1 | public void testParseLocalDateTime_simple() {
assertEquals(new LocalDateTime(2004, 6, 9, 10, 20, 30), g.parseLocalDateTime("2004-06-09T10:20:30Z"));
assertEquals(new LocalDateTime(2004, 6, 9, 10, 20, 30), g.parseLocalDateTime("2004-06-09T10:20:30+18:00"));
assertEquals(new LocalDateTime(2004, 6,... |
da085999-8064-403d-aca4-8f90b939bb2f | 8 | public void play(Board board) {
int[] sizes = board.getSizes();
for (int x = 0; x < sizes[0]; x++) {
for (int y = 0; y < sizes[1]; y++) {
for (Board.DIRECT direct : Board.DIRECT.values()) {
Board.BoardIterator iterator = board.iterator(x, y);
... |
1457d717-9f83-4d4e-ad05-0edbf92ca078 | 3 | public static Semester findBestSubjectSemester(Subject thisSubject){
int bestMark = -1;
Semester bestSemester = null;
for(Semester thisSemester:thisSubject.semesters){
if(thisSemester.mark > bestMark &&
thisSemester.usedState == Semester.UsedState.none){
... |
1d86d564-7315-497d-b6b6-95d172da0dd3 | 4 | private List<ColumnConceptMappingDTO> getDicoFromConfiguration(final DataSetApplication datasetApp,
final String dicoToFind) throws SitoolsException {
List<ColumnConceptMappingDTO> colConceptMappingDTOList = null;
// Get the list of dictionnaries related to the datasetApplication
final List<Dicti... |
2922d165-db03-4b16-bf69-4189a60b20a6 | 4 | public void visitCallMethodExpr(final CallMethodExpr expr) {
expr.visitChildren(this);
genPostponed(expr);
int opcode;
if (expr.kind() == CallMethodExpr.VIRTUAL) {
opcode = Opcode.opcx_invokevirtual;
} else if (expr.kind() == CallMethodExpr.NONVIRTUAL) {
opcode = Opcode.opcx_invokespecial;
} else i... |
da33c945-dfc5-4f3d-9c43-ec084ff4f5e9 | 0 | public CheckResultMessage checkG12(int day) {
return checkReport.checkG12(day);
} |
1e0fcd36-b7c3-4f93-8d31-4a9e7c3693b5 | 4 | @Override
synchronized public void adjustClock(Clock receivedTimeStamp) {
if (receivedTimeStamp == null)
System.out.println("---------------------------debug: received group clock null!!");
Hashtable<String, Integer> tmpTimeStamp = (Hashtable<String, Integer>) receivedTimeStamp.getClock();
for (String tmpKey ... |
b4506bcb-fe87-487f-ae86-99d4d8b5b755 | 3 | public void setElement(ZElement elem, String index)
{
super.setElement(elem, index);
if (elem != null) {
MCDObjet obj = (MCDObjet) elem;
obj.addLink(this);
}
if (elem1 instanceof MCDObjet && elem2 instanceof MCDAssociation)
inverseZElements();
... |
2733d021-67cb-4cb8-89dc-b1b01de9e9ed | 9 | public boolean fGuiCheckChildObjectExistence(WebElement objParent, String strDesc){
//Delimiters
String[] delimiters = new String[] {":="};
String[] arrFindByValues = strDesc.split(delimiters[0]);
//Get Findby and Value
String FindBy = arrFindByValues[0];
String val =... |
8e3eccc1-a04b-446f-b6ab-3ba37c037da9 | 8 | public float[] ProjectionHistograms() {
// Horizontal Histogram
float[] featureVector = new float[rows+columns];
int[] m_HorizontalFeatureVector = new int[rows];
int[] m_VerticalFeatureVector = new int[columns];
for (int i = 0; i < rows; i++) {
int count = 0;
for (int j = 0; j < columns; j++) {
i... |
03e0befa-051e-45c4-9205-ed00be064869 | 5 | private boolean isPhoneNumberAdded(PhoneNumber phoneNumber)
{
for(int i=0; i<addedPhoneNumberCount; i++)
{
PhoneNumber addedPhoneNumbers = phoneNumbers[i];
if(addedPhoneNumbers.getCountryCode() == phoneNumber.getCountryCode())
{
if(addedPhoneNumbers.getAreaCode() == phoneNumber.getAreaCode())
... |
567e93ec-6b46-46fb-9f35-84204ab673ff | 1 | public void soundToggle(){
if(soundToggled){
soundToggled = false;
} else {
currentTime = beginTime;
soundToggled = true;
}
} |
979f9a34-156c-4c28-84d0-ee2db06fbe7f | 7 | public void SerializeRoom(ServerMessage Message, Room Room, int UsersNow, int Score)
{
Environment.Append(Room.Id, Message);
if(Room.Event != null)
{
Environment.Append(true, Message); // is event
Environment.Append(Room.Event.Name, Message);
}
else
... |
6ea02c32-045e-4eee-bdd5-d48254f289de | 4 | public void loadFile(String filename) throws Exception {
Map<String, Map<Integer, Double>> userMaps = new HashMap<>();
Map<String, Map<Integer, Double>> resMaps = new HashMap<>();
BookmarkReader reader = new BookmarkReader(0, false);
reader.readFile(filename);
List<Map<Integer, Integer>> userStats = Utilitie... |
04f61465-bfc0-4f21-a893-183872ac01bc | 0 | public void setcoef(float parseFloat) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} |
74b80fda-bde8-4017-af2b-9a3a17bad7ac | 0 | public boolean isAccept()
{
return getUnprocessedInput().length() == 0;
} |
1468e674-555a-4c2b-805f-debc84d11253 | 4 | public void setConnection( CommentConnection connection ) {
if( this.connection != null ) {
if( this.connection.getTargetItem() != null ) {
this.connection.getTargetItem().removeDependent( this );
}
}
this.connection = connection;
if( connection != null ) {
if( connection.getTargetItem() != null ... |
992ae353-829d-49be-ba9d-00aa6a9be2d6 | 6 | @Override
public void keyPressed(KeyEvent e) {
if ((Bildschirm.this.kenntEreignisanwendung != null) && (Bildschirm.this.kenntEreignisanwendung.fuehrtAus()) && (e.getKeyCode() != 17)) {
if ((e.isActionKey()) || (e.getKeyCode() < 32) || (e.getKeyCode() == 127)) {
Bildschirm.this.ke... |
117dc689-a335-4428-8743-8a6b18aab67b | 1 | public boolean hasTeam(String team) {
return TEAM_1.toString().equals(team) || TEAM_2.toString().equals(team);
} |
b54440df-af67-4f38-bfd9-42a8f9b9424f | 4 | @Override
public Settings clone()
{
Settings s = new Settings();
s.action_panel_color = new Color(this.action_panel_color.getRGB());
s.display_word_count = this.display_word_count;
s.editor_path = this.editor_path;
s.editor_use_env = this.editor_use_env;
s.font_smoothing_value ... |
7137ee24-4cca-4bdd-a882-0a1211aeb9c3 | 7 | private void setAptitud(String operacion, ArrayList<ArrayList<Integer>> restricciones) {
int auxAptitud = 0;
boolean bandera = true;
for (int i = 0; i < restricciones.size(); i++) {
int contador = 0;
auxAptitud += restricciones.get(i).size();
for (int j = 0;... |
2448e93b-9b51-45ba-903e-3733d257820c | 3 | public String convert(String s, int nRows) {
int rows = nRows;
Generator indexGenerator = new Generator(rows);
StringBuffer[] buffers = new StringBuffer[rows];
for (int i = 0; i < rows; i++)
buffers[i] = new StringBuffer();
int stringSize = s.length();
for (in... |
4911837c-782f-4333-9a2e-4b65a5ed9694 | 6 | public void addNewCircleData(int origX, int origY, int imgWidth, int imgHeight)
{
sortRequired = true;
double pointsToPlot, angleIncrement;
for(int radius = minR; radius <= maxR; radius++)
{
Circle c = new Circle(new Coordinate2D(origX, origY), radius);
pointsToPlot = c.getPerimeter();
angleIn... |
c42c01b5-f994-484e-8841-3f42b4f936aa | 1 | public boolean setPasswordButtonWidth(int width) {
boolean ret = true;
if (width < 0) {
this.buttonPW_Width = UISizeInits.PW_BTN.getWidth();
ret = false;
} else {
this.buttonPW_Width = width;
}
somethingChanged();
return ret;
} |
633b1203-00dd-4ae8-8dfd-c92f0ab183a1 | 9 | public int compareTo(PolygonNew o) {
if (compareArray(o.xpoints, xpoints)
&& compareArray(ypoints, o.ypoints) && npoints == o.npoints
&& r == o.r && g == o.g && b == o.b
&& transparency == o.transparency && order == o.order) {
return 0;
} else if (this.order > o.order) {
return -1;
} else {
r... |
0d826aab-f425-4221-975b-aefbf60a8810 | 1 | static void db(Object o) { if (true) System.err.println(o); } |
fed7e2b5-d0cd-425c-86b2-5614d1c42962 | 4 | private boolean checkForChildren() throws ParsingException
{
XMLEvent e;
try
{
do
{
e = eventReader.peek();
if (e.isCharacters())
{
Characters c = e.asCharacters();
// Ignore empty content
if (c.isWhiteSpace())
{
eventReader.nextEvent();
}
else
{
... |
c9b00b15-2c73-4ba4-8eae-bf583d4373b4 | 2 | private static void writeItems(
final Collection itemCollection,
final DataOutput dos,
final boolean dotted) throws IOException
{
int size = itemCollection.size();
Item[] items = (Item[]) itemCollection.toArray(new Item[size]);
Arrays.sort(items);
for (int i =... |
f679d85d-3c6d-4e1a-8e2d-01695ecc2c09 | 0 | private Set<Card> nonStraightFiveFlush() {
return convertToCardSet("TS,7S,9S,4S,8S,KC,QC");
} |
6d96e28c-c3bb-4a45-bb8b-e77c8b31f14c | 1 | public void send(String data, int port) {
byte[] byte_data = data.getBytes();
DatagramPacket sendPacket = new DatagramPacket(byte_data, byte_data.length, host, port);
try {sock.send(sendPacket);} catch (Exception e){}
} |
0875b6c2-4347-415f-8e84-72a4344e99cd | 1 | @Override
protected void setReaction(Message message) {
try {
String query = getQuery(message.text);
String response = loadResponse(query);
reaction.add(message.author + ": " + response);
} catch (Exception e) {
setError(e);
}
} |
fcfb4ef2-2208-406c-bd1e-7f004af6259f | 0 | public double getDexterity() {
return dexterity;
} |
8f6262e7-0ac0-4bdf-99c7-0efd1ce3ca75 | 8 | public void update(){
super.update();
if(getPosition()[0] < 0 && getVelocity()[0] < 0){
vel.setX(-vel.getX() * .8);
}
if(getPosition()[0] + sprite.W > Game.WIDTH/Game.scale && getVelocity()[0] > 0){
vel.setX(-vel.getX() * .8);
}
if(getPosition()[1]... |
fc1f7160-1a46-45f7-9199-2a43b354535f | 2 | private int getLineCount(String text) {
int count = 0;
for (String line:text.split("\n")){
if (!line.equals("")){
count++;
}
}
return count;
} |
9c5bec49-3a54-41c2-97ef-6ba85fc18428 | 2 | public void finishReport(int rId, double similarity, String endTime)
{
try
{
String strStatement = "";
connect();
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.GERMAN);
otherSymbols.setDecimalSeparator('.');
DecimalFormat df = new DecimalFormat("###.##", otherSymbols);
strSt... |
77181bd8-13a6-4fbe-8c58-e6857d31aa04 | 3 | public void run() {
if (i <= n) {
g2.clearRect(-150, -150, 300, 300);
for (Line l : lines) {
Complex tmp1 = f.evaluate(l.c1);
double re1 = ((n - i) * l.c1.getRe() / n + i * tmp1.getRe() / n);
double im1 = ((n - i) * l.c1.getIm() / n + i * ... |
9f957253-92ec-4661-92f9-13ff33546018 | 3 | public void upadte() {
time++;
if (time == Integer.MAX_VALUE) time = 0;
if (time % rate == 0) {
if (frame >= legnth - 1) frame = 0;
else frame++;
sprite = sheet.getSprites()[frame];
}
} |
8d5156b7-9f3b-49e1-9b95-a9d8d0b6e1d3 | 2 | public String toString() {
StringBuilder out = new StringBuilder();
if (items != null) {
for (String s : items) {
out.append(s);
out.append("/");
}
}
return out.toString();
} |
52e999fd-4d4f-44be-95db-308c81ca40fa | 3 | private boolean generalDevCardPreconditions(int playerIndex) {
if (serverModel.getTurnTracker().getStatus().equals("Playing") &&
serverModel.getTurnTracker().getCurrentTurn() == playerIndex &&
!serverModel.getPlayers().get(playerIndex).hasPlayedDevCard()) {
return true;
}
else {
return false;
}
} |
d613e58a-9a77-417b-b6c9-208877ced3f5 | 6 | public static boolean arithmeticGreaterTest(NumberWrapper x, NumberWrapper y) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(x);
if (Surrogate.subtypeOfIntegerP(testValue000)) {
{ IntegerWrapper x000 = ((IntegerWrapper)(x));
{ Surrogate testValue001 = Stella_Object.safePrimaryT... |
e30bd923-213e-44e8-8b38-f8d5858c0692 | 1 | public void visitNewArrayExpr(final NewArrayExpr expr) {
if (previous == expr.size()) {
previous = expr;
expr.parent.visit(this);
}
} |
8a6aad6e-60a3-4865-b6ae-96dff3d77f83 | 6 | @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
try {
if (!(sender instanceof Player)) {
return true;
}
Player player = (Player)sender;
if (!HyperPVP.getGameSessions().containsKey(player.getName())) {
sender.sendMessage(ChatColor.RED + ... |
f3420ec7-37d6-4b82-9e85-4e01e989c423 | 9 | public void receivePacket(Cell cell) {
for (Packet packet : cell.getPackets()) {
if (packet.getDestination() == this) {
if (!receiveLengths.containsKey(packet.getSource())) {
receiveLengths.put(packet.getSource(), packet.getLength());
receiveCh... |
0c79b641-baa7-415b-b25d-870104f91ab3 | 7 | @Override
public boolean mayIntersect(S2Cell cell) {
if (numVertices() == 0) {
return false;
}
// We only need to check whether the cell contains vertex 0 for correctness,
// but these tests are cheap compared to edge crossings so we might as well
// check all the vertices.
for (int i =... |
696b2941-98ab-45d7-bc81-4a5c7f8c299e | 1 | public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
try {
sunJSSEX509TrustManager.checkServerTrusted(chain, authType);
} catch (CertificateException excep) {
excep.printStackTrace();
/*
* Pos... |
89b1c551-a367-4396-8ba4-aa5d3dccce4d | 1 | public void setLater(final boolean flag) {
later = flag;
if (SSAPRE.DEBUG) {
System.out.println(this);
}
} |
8cc5b709-924e-4cdb-a5e7-a4eb4a53ecdc | 6 | static public int emptyFolder(File folder, boolean ignoreCannotDel) throws IOException {
int counter = 0 ;
if(folder.exists() && folder.isDirectory()) {
File[] child = folder.listFiles();
for(int i = 0; i < child.length; i++) {
File file = child[i] ;
if(file.isDirectory()) counter += emptyFolder(f... |
c0a51df3-84bc-4cac-8814-bacd5d7a1dad | 5 | /* */ public static boolean ClassListEqual(Class<?>[] l1, Class<?>[] l2) {
/* 189 */ boolean equal = true;
/* */
/* 191 */ if (l1.length != l2.length) return false;
/* 192 */ for (int i = 0; i < l1.length; i++) {
/* 193 */ if (l1[i] != l2[i]) { equal = false; break;
/* */ }
/* ... |
1f4c2186-ba58-4e53-bb9b-f63d23691b57 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Report)) {
return false;
}
Report other = (Report) object;
if ((this.reportId == null && other.reportId != null... |
4acebc10-604a-456c-8aaf-67d486a7a1f4 | 7 | public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
if (par1World.getBlockMaterial(par3, par4, par5) != Material.water)
{
return false;
}
else
{
int var6 = par2Random.nextInt(this.numberOfBlocks - 2) + 2;
... |
58d6855a-ec05-4b52-8391-cf287bfa0e15 | 6 | @EventHandler
public void SnowmanMiningFatigue(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getsnowgolemConfig().getDouble("Snow... |
03fe57cd-27a5-4f48-a615-b51aa6698709 | 2 | @Override
public int compareTo(Schedule sched) {
int result = 0;
if(this.fitness<sched.fitness) result = 1;
else if(this.fitness>sched.fitness) result = -1;
return result;
} |
926e834b-d10c-4523-8258-7a78be3c3460 | 2 | @Override
public int compare(Player a, Player b) {
return a.hand.highCard.value < b.hand.highCard.value ?
-1 : a.hand.highCard.value == b.hand.highCard.value ? 0 : 1;
} |
bd628544-0e73-48ff-8865-adf0fa023188 | 1 | public void testFormatSuffixPlural4() {
try {
builder.appendSuffix(" hour", " hours");
fail();
} catch (IllegalStateException ex) {}
} |
91321a74-68a8-4019-ab02-f61550292da5 | 3 | @Override
public boolean equals(Object pObj)
{
if(pObj != null) {
if(pObj instanceof String) {
return mName.equalsIgnoreCase((String) pObj);
}
if(pObj instanceof Namespace) {
return mName.equals(pObj.toString());
}
}
return false;
} |
0eebb49d-baa1-42df-bb91-e1a29382ceec | 6 | public ListNode mergeKLists(ArrayList<ListNode> lists) {
ListNode superHead = new ListNode(0);
ListNode insert = superHead;
for (int i =0;i<lists.size();i++){
if (lists.get(i)==null){
lists.remove(i);
i--;
}
}
while (lists.s... |
f6ae1b23-9178-440a-a92f-bbd96ce753bd | 7 | @Override
public void repaint(Graphics2D g) {
if (font == null)
font = g.getFont();
if (scheme != null)
g.setColor(scheme.text);
g.setFont(font);
String largestString = "";
int offset = 0;
for (String str : leftColumn) {
if (str == ... |
85e434a3-7d80-4e18-8ca7-aea34817c513 | 7 | public final LDAPConnection getConnection(final LDAPResource resource) throws LDAPException,
InvalidBindPasswordException,
InvalidBindUserException,
... |
ca260ae6-bd14-4960-9ef9-429122e00712 | 3 | public static JsonObjectBuilder rewriteJson(JsonObjectBuilder copyInto,JsonValue tree,String key){
/**
* Helper function used to parse json
*/
switch(tree.getValueType()){
case OBJECT:
JsonObject obj = (JsonObject) tree;
for(String name : obj.keySet()){
copyInto = rewriteJson(copyInto,obj.get(name... |
eb50c211-d7e9-4152-89cc-b52a7d896df8 | 0 | @Override
public Board getBoard() {
return field;
} |
c6406065-76e4-4a24-9fe9-c5a1daeb7c32 | 2 | public double standardError_as_Complex_ConjugateCalcn() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
Complex[] cc = this.getArray_as_Complex();
double standardError = Stat.standardErrorCon... |
485ee411-fc46-499b-aeef-346a641ba9a4 | 4 | private static void uruchomTest(List lista, Integer iloscWatkow, Long czasOpoznienia) {
LinkedList<Thread> testujace = new LinkedList<Thread>();
for (int i = 0; i < iloscWatkow; ++i) {
testujace.add(new WatekTestujacy(lista));
}
long startTime = System.currentTimeMillis();
for (Thread thread : testujace) {... |
8313f36c-6d59-4a9c-b75a-c8da65835edd | 0 | public Piece(int t, boolean w, int x, int y) {
type = t;
white = w;
this.x = x;
this.y = y;
} |
b0b0be42-105b-495c-a2ca-c94198f15771 | 4 | public static ArrayList<Token> buildTokens(String word, int line, int position) {
ArrayList<Token> tokensOut = new ArrayList<>();
while (!"".equals(word)){
Token token;
int wordLen = word.length();
char first = word.charAt(0);
// Try building an identifier
if (Character.isLetter(first))
token = ... |
f5fcff8b-c021-4da0-9dc6-d97a056d8222 | 5 | public void personsSearchAction() {
String search = guicontroller.getPersonSearch();
ArrayList<User> validPersons = new ArrayList<User>();
for(User loopingUser:allUsers) {
boolean valid = true;
for(int i=0;i<loopingUser.getName().length() && i<search.length();i++) {
if(!(search.charAt(i)==loopingUser.ge... |
df8b3518-f5df-48e8-aae2-f8a5d6936491 | 0 | public double getMean(int i){
return getCell(i).getMean();
} |
dc98de77-187c-4544-accb-eeb6387e68e1 | 8 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
HLLWritable other = (HLLWritable) obj;
if (!Arrays.equals(M, other.M)) {
return false;
}
... |
af661d6a-e66e-419c-988b-e1ba347b9474 | 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:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.