method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
2eb69223-2844-4314-9e71-3648b66d0d88
2
public static Dip getDipByName(String name) { for (int i = 0; i < dips.length; i++) { if (dips[i].getName().equals(name)) { return dips[i]; } } return null; }
5e644e20-478d-49f6-b915-f4c1c179b2e1
3
public URL getURL() { if (this.url == null) { // Check if the file is online or inside the JAR: if (this.filename.matches(SoundSystemConfig.PREFIX_URL)) { // Online try { this.url = new URL(this.filename); } catch (Exception e) { this.logger.err("FilenameURL", "Unable to access online URL"...
43e21709-a028-4b42-8c82-fbc0de709ba6
4
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; InaccurateTime inaccurateTime = (InaccurateTime) o; return hour == inaccurateTime.hour && minute == inaccurateTime.minute; }
7a00a145-9cb7-4388-911d-24bc375f1167
2
public static void main(String[] args) throws InterruptedException { final Processor processor = new Processor(); Thread t1 = new Thread(new Runnable() { @Override public void run() { try { processor.produce(); } catch (Interrup...
170e8ede-eaaf-4a32-b628-d49640086346
6
public void parseMsg(String msg){ String delims = "[,]"; String[] tokens = msg.split(delims); if (tokens[0].equals("EXIT")){ try { close(); } catch (IOException ex) { Logger.getLogger(ServeurSVG.class.getName()).log(Level.SEVERE, null, ex); } } else if (tokens[0].equals("REAL")){ dessin...
61d220a5-15be-4cdb-9d33-0b7e750949c4
2
public Vector<Doctor> getDoctorList(ResultSet rs) { Vector<Doctor> doctors = new Vector<Doctor>(); try { while (rs.next()) { Doctor doctor = new Doctor(); doctor.setHealth_care_no(rs.getInt("health_care_no")); doctor.setClinic_address(rs.getString("clinic_address")); doctor.setEmergency_phone(rs....
2e11263b-8c59-46e5-8706-2d732932e709
4
@Override public void run() { while (true) { int id = 0; for (final SingeErratique singe : this.getSingesErratiques()) { singe.deplacerSinge(); for (final BandeDeSingesErratiquesEcouteur bandeEcouteur : this.bandeSingesEcouteurs .getListeners(BandeDeSingesErratiquesEcouteur.class)) { bandeE...
0637f720-f6b6-403e-82f6-b344d12ba1f9
2
protected int fetchUnmatchedWorker() { int w; for (w = 0; w < dim; w++) { if (matchJobByWorker[w] == -1) { break; } } return w; }
2fba90f7-5bbc-417d-bc96-0c61144d907c
1
private static String reverseStringAdditionalSpace(String input) { StringBuilder output = new StringBuilder(); char [] inputStrArray = input.toCharArray(); for (int count = inputStrArray.length - 1; count >= 0; count--) { output.append(inputStrArray[count]); } ...
71020972-92f8-4ccc-8945-c1534774afe5
3
@Override public void screenStarted() { MainMenuOption option = select(); switch (option) { case Play: startGame(false); break; case PlayDebug: startGame(true); break; case Exit: getGUI().exit(); } }
7d8721af-31eb-45af-88b0-25d9b110009a
8
public boolean isWin() { if(isThreeInARow(rowOne) || isThreeInARow(rowTwo) || isThreeInARow(rowThree)){ return true; } else if(isThreeInARow(columnOne) || isThreeInARow(columnTwo) || isThreeInARow(columnThree)){ return true; } else if(isThreeInARow(diagona...
c6b7e610-542e-406c-83b7-1923c0680bcd
4
public synchronized void applyUpdates() { //apply all new updates in the buffer while (nextSlotToDisplay != nextSlotAvailable){ Font lFont; //if the label pointer is not null, then that label needs to be updated if (updateInfos[nextSlotToDisplay].label != null){ //only u...
166f3649-8b5a-47f2-aebb-92fba424c543
5
public boolean actionPlant(Actor actor, Tile t) { final Flora f = new Flora(t.habitat()) ; f.setPosition(t.x, t.y, t.world) ; if (! f.canPlace()) { stage = STAGE_RETURN ; return false ; } float growStage = -0.5f ; for (Item seed : actor.gear.matches(seedMatch())) { growSta...
1d2568ee-9758-481c-9513-df1d1a594073
7
public MethodAccessBenchmark () throws Exception { int count = 100000; Object[] dontCompileMeAway = new Object[count]; Object[] args = new Object[0]; MethodAccess access = MethodAccess.get(SomeClass.class); SomeClass someObject = new SomeClass(); int index = access.getIndex("getName"); Method method = S...
c105191b-7aed-435d-9117-33a41f10d08e
0
public void setComments(String comments) { this.comments = comments; }
526878ea-f952-4479-bbe5-d868ebb9978d
6
public void buildTree( double[][] matrix, String[] taxa ) { set slooper; numSpecies = matrix.length; D = matrix; for ( int i=0;i<taxa.length;i++ ) { node v = new node( taxa[i], null, -1 ); v.index2 = i; if ( species == null ) species = new set( v ); else species.addToSet( v ); } initD...
721e3ad7-1c72-463d-83f8-97ac6a392d36
9
final void aa(short s, short s_633_) { anInt5901++; d var_d = anAbstractToolkit5916.aD1543; for (int i = 0; i < anInt5813; i++) { if ((aShortArray5862[i] ^ 0xffffffff) == (s ^ 0xffffffff)) { aShortArray5862[i] = s_633_; } } byte b = 0; byte b_634_ = 0; if (s != -1) { Class91 class91 = var_d.m...
8d04005d-613e-46cf-bf6e-dde79dcb2a91
6
public boolean check_dates(Date date1) { // Bouml preserved body begin 0001F582 if (this.year < date1.year) return true; else if(this.year > date1.year) return false; else if(this.month < date1.month) return true; else if (this.month > date1.month) return false; else if(this.day ...
f11a4173-f176-48a2-aaef-2ac09953d81f
6
public void incCount(E data) { if (overallRoot == null) { overallRoot = new BSTNode(data); return; } BSTNode currentNode = overallRoot; while (true) { // compare the new data with the data at the current node int cmp = comparator.compare...
93e28f47-9546-4b6e-8a37-46d8cf63d08b
5
public static void SaveFile(String fileName, byte[][] map) { try { file = new File("" + fileName + ".jps"); writer = new BufferedWriter(new FileWriter(file)); writer.write("javapowder-save\n"); // writer.write("version:" + var.versionID + "\n"); write...
4e81a4b5-267d-48f2-a275-604d906bd94c
6
private void btnCalculateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalculateActionPerformed // TODO add your handling code here: //test if input is a float //validation for number entry; resets form if entry is not a numerical value boolean numberTest...
cd086dc4-3ac3-4265-b329-3eb7b791fb7b
9
@Override public boolean equals( Object other ) { if( this == other ) return true; if( other instanceof EntityType ) { EntityType otherType = (EntityType)other; if( otherType.entityKind == entityKind && otherType.domain == domain && otherType.country == country && otherType.category == c...
e5d60500-c7df-4e71-8956-9f73fc33b117
2
@Override public T next() { if(!hasNext()){ return null; }else{ if(!isFirst){ current =current.getNext(); }else{ current=this.linkedList.getHead(); isFirst=false; } return current.getData(); } }
87fcf95c-ef7e-4173-878d-bd19c9a26d30
1
protected int[] strToArray(String str) { //return str.split(",")*.toInteger() String[] splits = str.split(","); int[] numbers = new int[splits.length]; for (int n=0; n<splits.length; n++) { numbers[n] = Integer.parseInt(splits[n]); } return n...
f3319933-c608-482a-ba48-2f765a2977be
6
public boolean initGame() { boolean init = true; if(getBoardSize().getHeight() == 0 || getBoardSize().getWidth() == 0) { System.out.println("ERROR: Board not defined"); init = false; } else { if(!checkStart()) { init = false; System.out.println("ERROR: Start not defined"); } if(!c...
4d4d259a-98e7-46c9-a819-b3953364ba89
5
public void addQuest() throws Exception { List<FormID> achrFormList = new ArrayList<>(); List<ModListing> ModList; FormID[] form; SPProgressBarPlug.setStatus("Getting ACHRs"); FLST formList = new FLST("form1"); Set<FormID> formSetACHR = new HashSet<>(); S...
be62cfe7-87e6-4054-836b-d0c5799d90a5
4
public static Image substract(Image img1, Image img2) { if (img1 == null || img2 == null) { return null; } Image img = img1.shallowClone(); double min = 0, max = 255; for (int x = 0; x < img1.getWidth(); x++) { for (int y = 0; y < img1.getHeight(); y++) { double red = img1.getPixel(x, y, RED) ...
c840976c-b48c-454a-b473-b31912a45352
1
private void makeFrame() { //frame = new JFrame("Map of Denmark"); try { myPicture = ImageIO.read(new File("assets/Icon48.png")); krakLogo = ImageIO.read(new File ("assets/krak.gif")); osmLogo = ImageIO.read(new File ("assets/osm.png")); ...
0cbc2a15-be9c-4540-b2b9-8791f2d93a80
5
private void drawCrag(int[][] currentBlockArray, String group, int paintRadius, int x, int z, int minX, int maxX, int minZ, int maxZ) { if(x > minX && x < maxX) { if(gound[x] <= z + paintRadius + 10) { z -= paintRadius * 2; } if(gound[x] > z + paintRadius + 10...
28fef6da-a036-4715-9085-2151271e8e12
9
private void ushortLoop(RasterAccessor src, RasterAccessor dst) { int dwidth = dst.getWidth(); int dheight = dst.getHeight(); int dnumBands = dst.getNumBands(); int dstBandOffsets[] = dst.getBandOffsets(); int dstPixelStride = dst.getPixelStride(); int dstSca...
e8fa9421-d395-4ee6-adee-213c2642f729
3
private Chunk func_542_c(int var1, int var2) { if(this.chunkLoader == null) { return this.blankChunk; } else { try { Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, var1, var2); if(var3 != null) { var3.lastSaveTime = this.worldObj.getWorldTime(...
3cf6a731-d347-4312-bf44-e63b9f3a0528
2
public double[][] getWaveFunction(double energy) { // Number of dots in the whole MatterStack int numberOfDots = (int) (getWidth() * X_POINTS_DENSITY * 1000000000L); // TODO try-catch or think on long-or-int problem double[] waveFunction = new double[numberOfDots]; double[] xAx...
43c4c084-3b1a-4a2e-90b6-747d06216cd6
7
static Drawable getDraw(){ switch(currentState){ case CreateGameScreen: return myCreateGameScreen; case ExitGameDialog: return myExitGameDialog; case JoinGameScreen: return myJoinGameScreen; case MainMenu: return myMainMenu; case NetworkGameMenu: return myNetworkMenu; case NewGameMenu: r...
da7f5760-8877-4672-91aa-a95363a31a20
5
private void removeRowsAndDrop(List<Integer> rowsToRemove) { // NB: iterating from bottom to top for (int y = TANK_HEIGHT - 1; y >= 0; y--) { if (rowsToRemove.contains(y)) { for (int x = 0; x < TANK_WIDTH; x++) { tank[x][y] = null; } ...
bbbdd78a-b433-48e8-8df5-1c5e54f443d0
0
public static void main(String[] args) { int[] test={2,2,3,3,3,2}; System.out.println(new OJ335().isSelfCrossing(test)); }
0e0f9323-abf1-490e-b61c-21af8c0311b3
7
@Test public void mapperTest(){ String[] ext = {"ttl", "rdf", "as", "nt", "n3"}; String[] format = {"TURTLE", "RDF/XML", "as", "N-TRIPLE", "N3"}; String[] cot = {"application/x-turtle", "application/rdf+xml", "as", "text/plain", "text/rdf+n3"}; String ct, ex1, ex2, fo, fo2; for(int i=0; i<ext.length;i+...
a53c28ab-dcae-4156-b0ff-8c87d373903c
6
public void loadMap(int parts){ int whichMap; String tempLine = ""; try{ File newMap = new File("some.txt"); BufferedWriter bw = new BufferedWriter(new FileWriter(newMap)); BufferedReader br; for(int i = 1; i < parts + 1; i++){ Random r = new Random(); whichMap = r.nextInt(PIECES_AMOUNT) + 1;...
cd2b37f5-b47d-495b-b09e-3ab00f878f94
6
@Override public Animation getAnimation() { Animation animation = super.getAnimation(0); for (int i=0; i<animation.getFrameCount(); ++i) { if(animation.getImage(i) == null) continue; if (getFacing() == UP) { animation.getImage(i).setRotation(180); } else if (getFacing() == DOWN) { anima...
83efccad-2617-4c3b-ab46-c40de0ad9fcf
1
public Array<String> parse(LanguageController languageController) { Array<String> words = new Array<String>(); FileHandle file = Gdx.files.internal(languageController.getLanguage().getDictionaryPath()); String stringa = file.readString();// read the string String[] splits = stringa.split("\n"); for (int i = 0...
14dcb6b8-dc0a-411f-95c0-d0b4f86a8ee4
8
public synchronized boolean setItem(FieldItem I, Position pos) { if (pos.getX() >= rows || pos.getX() < 0 || pos.getY() <= columns || pos.getY() < 0) { return false; } if (hunt[pos.getX()][pos.getY()] != null) { return false; } int i = 0; int j = 0...
54f45bbb-9c54-4fb0-a47b-417593bf7f63
0
public CheckResultMessage checkJ03(int day) { return checkReport.checkJ03(day); }
dfb76697-b5c6-4bba-9b91-e1ab90df5dd8
0
public double getScore() { return result.Score; }
382dd06c-dbc9-4c3b-8afd-cc77bf4d1813
2
private int getIdentityDiscCoverage() { int nrSquaresDisc = 0; for (Element e : grid.getElementsOnGrid()) { if (e instanceof IdentityDisc) nrSquaresDisc++; } return (nrSquaresDisc * 100 / grid.gridSize()); }
2e51d7f6-9ecd-4a11-bffd-52b95c9c9dcc
1
public static void updateMetadonnees(String oldnom, String nom, String auteur, int note) { try { Connection connexion; java.sql.Statement requete; Class.forName("org.sqlite.JDBC"); connexion = DriverManager.getConnection("jdbc:sqlite:dbged"); requete = connexion.createStatement(); requete.exec...
e05bbf42-6f2d-4ffc-b9ae-b3f38781f4e4
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
f33d13a1-386f-4038-8da6-04bee9d30eb8
8
public static int calcQueueTurnsInt(City citySelected, String name) { int[] t = citySelected.quickEval(); float[] cost = EntityData.getCost(name); //Division by zero errors if ((t[0] == 0 && cost[0] > 0) || (t[2] == 0 && cost[2] > 0) || (t[0] == 0 && t[2] == 0)) return -1; else { //System.out.println...
07ca9c28-2072-4c2d-a6c9-3f684cda7271
4
public ChunkyCommand(String name, ChunkyCommandExecutor executor, ChunkyCommand parentCommand) { this.name = name.toLowerCase(); this.executor = executor; this.parent = parentCommand; this.fullName = name; ChunkyCommand currentParent = parentCommand; while (true) { ...
f04fd35b-4bc7-4aa4-a7c5-a82991046c5a
7
@Override public boolean equals(Object other) { if ( (this == other ) ) return true; if ( (other == null ) ) return false; if ( !(other instanceof HabitacioId) ) return false; HabitacioId castOther = ( HabitacioId ) other; return ( (this.getNomHotel()==castOther.getNomHotel()) || ( t...
b91ee7f0-f8b7-46a7-977a-2e2ed172c319
1
public static final void add(Outline outline) { synchronized (OUTLINES) { OUTLINES.add(outline); if (!PENDING) { PENDING = true; EventQueue.invokeLater(INSTANCE); } } }
da3dfca0-23fa-4a32-86cb-95cf776b0fd0
8
private Object paseExpression() { Object result = null; outer: while (true) { switch (args.charAt(currentIndex)) { case ' ': break; case '{': currentIndex++; result = parseList();...
8d7e7fef-2ee9-4123-ae9d-555198d28b35
1
public static void main(String[] args) throws IOException { StaticDynamicUncertaintyULHSolver solverWithoutADI = new StaticDynamicUncertaintyULHSolver(); StaticDynamicUncertaintyWithADIULHSolver solverWithADI = new StaticDynamicUncertaintyWithADIULHSolver(); ConstantNormalDistributedProblemGenerator problemGenera...
4fc6484f-2ff5-4833-b70d-147b76b87a50
0
public void buildPartB() { System.out.println("build partB"); partB = new PartB(); }
f2bd541d-a618-4d04-bf0a-ba20bb65b7cb
3
private void setThePieces(){ for(int i = 0; i<HEIGHT;i++){ for(int j = 0; j<WIDTH;j++){ if(piecesToSwap[i][j]==null){ }else{ m_Pieces[i][j]=piecesToSwap[i][j]; } ...
f6805856-09a2-4130-bce0-11ce52278b2f
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
67c97a56-d848-42fd-93a5-59fc34dca034
4
public void cadastrar(Paciente paciente) throws Exception{ if(paciente.getNome().isEmpty()){ throw new Exception("Nome inválido!"); }else{ this.verificaNome(paciente.getNome()); } if(paciente.getCpf().equals(" . . - ")){ throw new Exception("CPF...
60f167ce-7b7e-417f-9724-d66b5e3bac19
8
@Override public TIPO_OBJETO set(TIPO_OBJETO oBean) throws Exception { Class<TIPO_OBJETO> tipo = (Class<TIPO_OBJETO>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; Method metodo_getId = tipo.getMethod("getId"); Method metodo_setId = tipo.getMethod("setI...
e270e642-796d-4213-88a7-374bf317fcf5
7
private void hitEnemy(Player player, Enemy[][] enemys){ for(int i = 0; i < enemys.length; i++) { for(int j = 0; j < enemys[i].length; j++) { for(int k = 0; k < player.getProjectiles().length; k++) { if(player.getProjectiles()[k].getCollider() != null) { if(enemys[i][j].getCollider().overlaps(player....
e2a952a4-dbaf-4214-975a-ee636c021357
5
public void markMine(int x, int y) { final Cell cell = cells[x][y]; final Cell.Type type = cell.getType(); // dont allow opened tiles to be flagged if (cell.getState() == Cell.State.OPEN) return; // unflag the cell if its already marked if (type == Cell.Type...
8660e37e-a7f2-4b97-8378-aa027f4e2ea6
6
private void setDefaultLead() { DefaultComboBoxModel<Anstalld> dcbm = (DefaultComboBoxModel<Anstalld>) cbLead.getModel(); Anstalld lead = null; try { String query = "select projektledare.aid from projektledare" + " join spelprojekt on spelprojekt.aid=projektledare...
9fe3f228-b74c-482b-a9fc-803e96dd14a0
1
public Integer getTotalShifts() { if (listOfShifts == null) return 0; return listOfShifts.size(); }
25defa65-c8a4-479a-935f-6bb8f5ac6089
2
public void put(int index, int value) { if (index < 0 || index >= size) throw new IndexOutOfBoundsException(); $.putInt(address + index * SIZE_OF_INT, value); }
f9e24bb1-164c-4c87-9849-91b33c5697bd
2
private void increaseScore() { //тут в зависимости от сложности начисляются очки if (state.getDifficulty().equals("Легко")) { state.setScore(Integer.parseInt(state.getScore()) + 400); } else if (state.getDifficulty().equals("Средне")) { state.setScore(Integer.parseInt(sta...
40b0baea-26de-4258-baba-833e5bf900f6
2
public static void main(String[] args) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } new Game(); Game.currentFrame.init("Village Defense"); Game.currentFrame.setFullscreen(); Game.currentFrame.updater = new UpdateThr...
3e069a8b-f843-4259-b171-0d076219514e
8
public void maxSkills(boolean shit) { if (GMSMode > 0 && !isJounin()) { maxJobSkills(shit); return; } if (job < 911 || isJounin()) { maxAdventurerSkills(shit); } if (job > 910 || isJounin()) { maxKOCSkills(shit); } i...
556bea0d-d1f4-4e20-aeef-73d791569cc8
6
private void initLoadingstatusMenu(Color bg) { this.loadingstatusMenu = new JPanel(); this.loadingstatusMenu.setBackground(bg); this.loadingstatusMenu.setLayout(new VerticalLayout(5, VerticalLayout.LEFT)); this.loadingstatusMenu.add(new ImageField(this.skin.getImgPathLoadingStatusBg(), ...
09df8ef9-4a58-46d2-9333-17db0fe6e712
5
public int getHandValue(Hand hand) { // return 0 if hand is null if (hand == null) { return 0; } // value of hand and number of aces int value = 0; int aces = 0; // go through all cards, add the values and count the aces for (Card c : hand) { ...
58d3e1af-a8fb-44ef-93ee-cf0005cb6b34
8
public void sendAllStreamData() throws InterruptedException { // In welchem Modus werden die Pakete versandt (jeder Stream verschickt nr ein Paket und reiht sich dann erneut ein, oder // jeder Stream verschickt soviele Pakete wie er darf). boolean singlePacketMode; // Solange es Streams gibt, die Senden dürfe...
93813703-3ec1-42b0-91bd-36baa56a8447
4
protected int getKnownAttributeCount() { int count = 0; if (sourceFile != null) count++; if (innerClasses != null || outerClasses != null || extraClasses != null) count++; return count; }
bdb5bd41-5a6b-494b-8d55-331178a37769
3
@Override public void incrementKillCount(String player_name) { PreparedStatement pst = null; int player_id = getPlayerId(player_name); int killcount = getKillCount(player_id); try { pst = conn.prepareStatement("UPDATE ffa_leaderboards SET killcount=? WHERE player_id=?"); pst.setInt(1, killcount + 1); ...
8fe24e51-26cd-4ee0-86f7-04d4958fe97e
5
private String randomItemName(){ int random = (int) Math.floor(Math.random()*3); switch (random){ case 0 : return "heart"; case 1 : return "sword"; case 2 : {random = (int) Math.floor(Math.random()*6); //To lower the odds of having boots, if(random==0){return "boots";} //and increasing the odds to get a...
ad0a2854-7fad-40a6-a8ba-c63ebb3cb92a
4
public JButton getOthelloButton() { boolean test = false; if (test || m_test) { System.out.println("GameSelecter :: getOthelloButton() BEGIN"); } if (test || m_test) { System.out.println("GameSelecter :: getOthelloButton() END"); } return m_othello...
a797dc7e-ccf7-48e6-8e10-de138e120476
4
private void ApplySinglePayloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ApplySinglePayloadButtonActionPerformed String HTTPRequest = "", output = ""; Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; int VULNERABILITY_INJECTION_RESULTS_ID; ...
7e641ef3-662a-4c91-82b7-806663585ef1
2
private Map<Variable, Term> substituteResult( List<UnificationPair> mgu, Map<Variable, Term> substitutions) { for (UnificationPair termPair : mgu) { for (Map.Entry<Variable, Term> substitution : substitutions.entrySet()) { substitution.setValue(substitution.getValue().sub...
6499e61b-c7ab-4244-bf6a-464fbe1a9bc1
3
private static List<Cards> choose3(Cards cards) { // Given a list of cards, give me back a list of the // complete list of subsets of size num int size = cards.size(); List<Cards> subsets = new ArrayList<Cards>(); for (int i1 = 0; i1 < size - 2; i1++) { Cards subset1 ...
5f70b3b9-bceb-4a4e-ac67-bc666f8ed087
9
protected XYDataset createDataset() { // System.out.println("Create Dataset of" + textX); final XYSeries seriesR = new XYSeries(title[1]); final XYSeries seriesG = new XYSeries(title[2]); final XYSeries seriesB = new XYSeries(title[3]); Integer countPixel[] = new Integer[256]; ...
5f9c9320-5f8f-4f3e-b7d7-1882d52258c7
0
public SqlUpdater(Connection connetion) { this.connetion = connetion; }
595ea3b5-2e2e-4842-aadc-11cb1805de0e
1
public static MatchingQuestion getQuestionByQuestionID(int questionID) { try { String statement = new String("SELECT * FROM " + DBTable + " WHERE questionid = ?"); PreparedStatement stmt = DBConnection.con.prepareStatement(statement); stmt.setInt(1, questionID); ResultSet rs = stmt.executeQuery(); rs.n...
c5a3dc8d-26c0-4e9c-ac7f-c981c9c7bb9a
6
@Override public synchronized ResultMessage addGoods(GoodsPO goodsPO) { if(goodsPO.getName().equals("") || goodsPO.getModel().equals("")) return ResultMessage.add_failure; gIter = goodsList.iterator(); GoodsPO g = null; while(gIter.hasNext()) { g = gIter.next(); if(g.getName().equals(goodsPO.getName()) &...
c74fd13e-f149-4454-89c3-2522a871dc88
3
public boolean HasAirStaff() { if (playerEquipment[playerWeapon] == 1381) return true;//Staff_of_air if (playerEquipment[playerWeapon] == 1397) return true;//Air_battlestaff if (playerEquipment[playerWeapon] == 1405) return true;//Mystic_air_staff return false; }
50ee5c15-a8c2-4d49-a99b-bb976ed7bd39
5
@Override public void clearCache() { if (!clearLocalCacheOnly) { for (Painter<T> p : painters) { if (p instanceof AbstractPainter) { AbstractPainter<?> ap = (AbstractPainter<?>) p; ap.clearCache(); } } } super.clearCache(); }
d30038d0-88ed-406e-b537-4bacad096508
6
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://downl...
1c2461ec-8933-448a-9825-38daf99930d3
1
public boolean moveToNext(){ System.out.println("Increasing waypoint number"); System.out.println("Total waypoints: " + points.size()); if(points.size() -1 > nextWaypointNumber){ nextWaypointNumber++; System.out.println("WP number now: " + nextWaypointNumber); return true; }else{ //System.out.printl...
4afa5af1-ec06-4b88-9823-9a856e13d4b7
1
public void setLogFileName(String logFileName) throws FileNotFoundException { if (logFileName != null) { logFileName = logFileName.replace("logTime", "" + new SimpleDateFormat("yyyyMMdd_hhmmssSSS").format(new Date())); setOutputStream(new FileOutputStream(logFileName)); } }
5ca7376e-912d-4807-8bb8-78f9220b085a
1
public void flushBits() throws IOException { // // If the buffer has fewer than 8 bits, need to shift the bits // left to align them with the left end of the byte before // writing out. // NOTE: when you read in the bits, there may be some // extra 0 bits dangling at ...
72899d80-07fc-46e9-84f3-6f70915404a7
6
public void tableChanged( TableModelEvent e ) { // If we're not sorting by anything, just pass the event along. if ( !isSorting() ) { clearSortingState() ; fireTableChanged( e ) ; return ; } // If the table structure has changed, cancel the sorting; the /...
e7b7f95f-9074-4b01-80e9-d009efa64765
2
@Override public void receiveAlert(AIAlert alert, float urgency, Hostility hostility) { switch(alert) { case THREATENED: case ATTACKED: priority = 1f; break; } }
3367e76c-c0e1-4bc6-a700-ed2837473e00
9
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final User other = (User) obj; if ((this.uid == null) ? (other.uid != null) : !this.uid.equals(other.uid)) { ...
e3106764-09ba-4d30-912e-bab114c3f8d0
6
private void updateStateAskPreference(List<Keyword> keywords, List<String> terms, List<String> approval) { if (keywords.isEmpty()) { //Didn't get any keyword for preference DialogManager.giveDialogManager().setInErrorState(true); } else { LocalDate date = LocalDate.now(); int dateShift = 0; //0 for to...
564d73a8-aaf0-4720-8c9f-c5b4fdf95bb6
4
public static void Seed(SudokuBoard board) { switch (board.size) { case 2: Seedby2(board); break; case 3: Seedby3(board); break; case 4: Seedby4(board); break; case 5: Seedby5(board); break; default: System.out.println("Improper program path"); System.exit(0); break; } ...
7b7f2bef-1837-48c1-9c11-15d4dbf17d52
8
@Override public void run() { plugin.debug("Beginning Custom data sending"); mt.addCustomData(plugin, new Metrics.Plotter() { @Override public int getValue() { try { return cm.getCoupons().size(); } catch (SQLException e) { e.printStackTrace(); } return 0; } @Override ...
dad9c2fe-b578-4782-bff8-842b91dd4988
3
public void sendUnicast(Serializable content, Address to) throws IOException { ObjectOutputStream out = unicastStreams.get(to); // create output stream if necessary if (out == null) { // create socket Socket tcpClientSocket = new Socket(to.getIpAddress(), to.getTcpPort()); // build a stream to write obje...
29ad64bb-d9d6-46df-a8fa-dbe119d7dc26
6
@SuppressWarnings("unchecked") public Provider createProvider(String token, HashMap<String, Object> provider){ this.ID = "1000"+token; if(provider.containsKey("contact")) this.setContact((String)provider.get("contact")); if(provider.containsKey("name")) this.setName((String)provider.get("name")); if(provide...
d5565c47-7aac-4313-8355-7aa67a9b9efe
4
public Vector4i abs() { if(x < 0) x = -x; if(y < 0) y = -y; if(z < 0) z = -z; if(w < 0) w = -w; return this; }
a9e637ed-74f9-4505-a13a-a5ed06faf8aa
8
protected void checkReg(int reg_code, int val) { for (int i = 0; i < 8; i++) { switch (reg_code) { case 7: assertTrue(cu.getRegAValue(i)==((val & 1<<i) == 1<<i)); break; case 0: assertTrue(cu.getRegBValue(i)==((val & 1<<i) == 1<<i)); break; case 1: assertTrue(cu.getRegCValue(i)...
f5493184-df8b-4fd2-89eb-8bae95755788
2
@Override public void run() { while(!Thread.currentThread().isInterrupted()) { int i = new Random().nextInt(10); String s = robj.call(i); System.out.println("res=" + s + ", i=" + i); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.print...
93255e58-633c-4b9b-b75c-c2f54349c551
6
public void run() { boolean stop = false; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(!stop) { this.printMenu(); System.out.print("command> "); String command = ""; try { command = br.readLine(); } catch (IOException e) { // TODO Auto-generat...
f45f2553-98c0-44ce-8a1c-d587097b49f9
6
public void setPoints() { super.setPoints(); // 0-15 = top curve, 16 = right, 17-32=bottom curve, // 33-37 = left curve Point triPoints[] = newPointArray(38); if (this instanceof XorGateElm) { linePoints = new Point[5]; } int i; for (i = 0; i != ...
61699a20-618a-42dc-85bf-6ee87f17d3e5
8
private void moveCurrentlySelectedPiece(ChessSpaceButton clickedButton) { assert pieceIsSelected; final int selectedRow = currentlySelectedButton.getRow(); final int selectedColumn = currentlySelectedButton.getColumn(); final int clickedRow = clickedButton.getRow(); final int...
fe3b38ea-4360-49fa-9c55-ccf376e6afdd
3
private static void calcNoOfNodes(Node node) { if (node instanceof Parent) { if (((Parent) node).getChildrenUnmodifiable().size() != 0) { ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable(); noOfNodes += tempChildren.size(); f...
a4d87d68-cc9c-4ac7-b946-7b187bc7e0a0
9
public int findNearestTBondIndex(int x, int y) { TBonds tbonds = ((ExtendedFrameRenderer) repaintManager.frameRenderer).tbonds; if (tbonds == null || tbonds.isEmpty()) return -1; initHighlightTBond(); tbonds.removeTBond(highlightTBond); int zmin = Integer.MAX_VALUE; TBond tbond = null; TBond tbondFound...