method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
e623db32-d581-4107-af3b-62b273618152
4
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { servingFromCache = false; HttpRequest req = (HttpRequest) msg; ReferenceCountUtil.retain(req); requestsQueue.add(req); ...
8f035759-dc1e-4ead-96ef-7192e2908e94
7
@Override public void update(final Observable the_arg0, final Object the_arg1) { if (my_level > my_last_speed_up) { final int time = my_timer.getDelay(); my_timer.setDelay((int) (time * SPEED_RATIO)); my_last_speed_up = my_level; } if (the_arg1 instanceof Integer) { final...
329a8eea-6ff8-48cc-807c-c509656dddf2
1
public static void falsepositive(DMatrix[] pointset){ for(int i = 0; i < pointset.length; i++){ System.out.println("NN法" + i + "番目クラス偽陽性"); } }
5acd362f-92c0-4fd9-9639-7377b54028ca
6
public void unloadLinked(Game game) { ready = false; if (!droppable) { onUse(game); return; } Pickup pick; try { pick = (Pickup) link.newInstance(); } catch (InstantiationException | IllegalAccessException ex) { return; ...
ce334cd9-b7a1-4c8d-b587-ec97ceb92ec9
2
public static String noSpaces(String str) { String lines[] = str.split("\n"); StringBuilder sb = new StringBuilder(); for (String line : lines) sb.append(line.trim().replaceAll("\\s", "") + "\n"); if (lines.length == 1) sb.deleteCharAt(sb.length() - 1); return sb.toString(); }
4ad29ff2-0319-4fdd-9057-33d08225b77a
3
@Override public void keyPressed(int key, char character, GUIComponent component) { switch (key) { case (Keyboard.KEY_ESCAPE) : this.deactivate(); break; case (Keyboard.KEY_RIGHT) : nextSlide(); break; case (Keyboard.KEY_LEFT) : previousSlide(); break; } }
6512bda3-e212-4a32-a4c4-bec43ef47c9c
5
public static double computeAP(int[] positions, int R){ int d = positions.length; double sum1 = 0; int sum2; for(int i = 0; i < d; i++){ if(positions[i] == 1){ sum2 = 0; for(int j = 0; j < i+1; j++){ if(positions[j] == 1){ ...
516cb16d-9350-4964-8c04-a5830a242293
4
private static Camera restorecam() { Class<? extends Camera> ct = camtypes.get(Utils.getpref("defcam", "border")); if (ct == null) return (new BorderCam()); String[] args = (String[]) Utils.deserialize(Utils.getprefb("camargs", null)); if (args == null) args = new String[0]; try { return (mak...
9e599c36-5f41-4a6d-9b43-d8a9c929903f
4
static void decodeHorizontal(BitStream in, BitStream out, G4State s, Code code) throws IOException { int rl = 0; do { rl = s.white ? findWhite(in, code) : findBlack(in, code); if (rl >= 0) { if (rl < 64) { addRun(rl + s.longrun, s, out); ...
49806d56-a6f3-4749-813e-c53e6075dc1d
7
public void setup(MasterFrame parent, int myNum){ this.parent = parent; this.myNum = myNum; try { Field field = Color.class.getField(color); myColor = (Color) field.get(null); } catch (Exception e) { e.printStackTrace(); } if(myColor == null) System.out.println("color: " + color); ...
2dd35dcb-e360-4db8-b884-6d2b096f758e
7
public static void main(String[] args) { File testFile = new File(System.getProperty("user.home") + File.separator + "Desktop" + File.separator + "newFile.txt"); if (!testFile.exists()) { try { testFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } PrintWriter writer = ...
56e0c2d7-fca7-46e8-95e6-6f900fb92a45
3
public boolean waitEncryptedDeck(RSAService rsaService, final PublicKey pubKey) throws IOException, InterruptedException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchAlgorithmException { Notification not = new Notification(); encryptedDeck = null; final Subscription encS...
e0689735-589d-463e-8e61-44c82f6b3451
4
static void dedupProcess() throws IOException{ int memoryPolicy = 5; resultRecord.println("Total " + storageLoad() + " entries added into the index"); File[] incomingFile = null; incomingFile = new File(outputpath).listFiles(); int cacheSizeControl = 0; // int sampleNum = (int) ((Math.log(2)+Math.log(10000)...
237de322-0162-4073-b88d-03cdf39375d3
8
public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = new StringBuilder(); while ((line = in.readLine()) != null && line.length() != 0) { int times = Integer.parseInt(line); for (int i = 0...
4ffe569e-80cc-4b60-8c64-0c1815ad7476
6
public static String escape(String string) { StringBuilder sb = new StringBuilder(string.length()); for (int i = 0, length = string.length(); i < length; i++) { char c = string.charAt(i); switch (c) { case '&': sb.append("&amp;"); break...
8885d075-694a-4c9d-84c0-6bd2ca9e5aa9
5
private static void method342(int color, int x, int alpha, int y, int height) { if (x < Graphics2D.topX || x >= Graphics2D.bottomX) { return; } if (y < Graphics2D.topY) { height -= Graphics2D.topY - y; y = Graphics2D.topY; } if (y + height > Graphics2D.bottomY) { height = Graphics2D.bottomY - y; ...
54b2a33d-40cf-4859-aba0-529fbc5dfb6d
9
@Override public boolean okMessage(final Environmental myHost, final CMMsg msg) { if(!(affected instanceof MOB)) return super.okMessage(myHost,msg); final MOB mob=(MOB)affected; if((msg.amITarget(mob)) &&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS)) &&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL) &...
0db82805-d6c9-4d1d-99ed-a0f60bc5aa5c
9
/** @see org.lateralgm.joshedit.FindDialog.FindNavigator#findNext() */ @Override public void findNext() { if (FindDialog.wrap.isSelected() && joshText.caret.row == joshText.getLineCount() - 1) { joshText.caret.col = 0; joshText.caret.row = 0; } // TODO: I have no idea how multiline regexp se...
62346f0b-8351-4147-8e2f-29d56bf2207d
0
public CheckResultMessage check32(int day) { return checkReport.check32(day); }
e9945803-2ba6-45ff-871d-231dc58c87b5
3
private void initValidColors(){ String colors = "123456789"; validColors = new ArrayList<Character>(); //initialize with all colors available for(int i = 0; i < colors.length(); i++) validColors.add(colors.charAt(i)); //check to make sure no other Cell in the Clique already has this color for(Clique cli...
4004e5a6-d0de-4233-997b-62cc11e51901
7
public boolean addFrame(BufferedImage im) { if ((im == null) || !started) { return false; } boolean ok = true; try { if (!sizeSet) { // use first frame's size setSize(im.getWid...
be8120f6-5dc5-48d4-87ab-c2b3790b02c4
0
public String getName() { return Name; }
45b9843f-4d1b-449f-aa5d-4f71d04a5ef7
3
public void render(Graphics g) { // Graphics2D makes it look pretty Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // fill in a green background g.setColor(new Color(140, 230, 0)); g.fillRect(xMin-20, yMin-20, xMax+40, yMax+125); ...
5a0e8feb-1df4-49d4-9604-7a91f5e9d89e
8
private void untidy(double di, double wa){ for (int i=0;i<w;i++) for (int j=0;j<h;j++){ double d = r.nextDouble(); if (d<di){ net[i][j]=DIRTY; anet[i][j]=CLEAN; }else if (d<di+wa){ net[i][j]=WALL; anet[i][j]=CLEAN; } if (i==0 || j==0 || i==w-1 || j==h-1){ net[i][j]...
539936fe-77ed-4dfe-99c3-5b136e94fd05
3
public String findSavedGameSize() { File file; file = new File("Saved_Games.txt"); Scanner scanner; String line; try { scanner = new Scanner(file); while(scanner.hasNextLine()) { line = scanner.nextLine(); if(line.equals(user.getUsername())) { scanner.nextLine(); return scanner.nextLin...
70476d03-c933-4c16-b0dd-1cdc373e3166
1
private static ArrayList<String> loadLines(String fileName) throws IOException { System.out.println("Reading file"); BufferedReader br = new BufferedReader(new FileReader(fileName)); ArrayList<String> ret = new ArrayList<String>(); String line; while ((line = br.readLine()) != nu...
a2ada55c-f1f2-439f-9aa3-5d48f73fb65e
6
public void updateUser() throws SQLException { String query = "" + "UPDATE user " + "SET Email = ?, Name = ?, Surname = ?, Type = ? "; if (u.getPassword() != null && !u.getPassword().equals("")) { query += ", Password = ? "; } query += "WHERE ...
64d1ebfa-a1c2-4a28-ac84-84af1bfa889f
6
public void atualizar() { jComboBoxEstadoUF.removeAllItems(); jComboBoxCidade.removeAllItems(); jComboBairro.removeAllItems(); jComboBoxDDD.removeAllItems(); jComboBoxTelefone.removeAllItems(); jComboBoxCelular.removeAllItems(); jComboBoxEstadoUF.addItem("Todos"...
ec1d235e-7b21-4060-b631-378764686fba
6
public void tryToGetData(){ try { byte[] receiveData = new byte[1024]; DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); serverSocket.receive(receivePacket); boolean allreadyingame = false; ...
930310bc-861d-4b54-b387-14ad77ed7eb2
5
private boolean checkQualifier(QualifiedValue<?> value, Enum<?>... qualifiers) { boolean contained = true; for (Enum<?> qualifier : qualifiers) { if (!value.getQualifiers().contains(qualifier)) { contained = false; break; } } return...
be70851b-11eb-469f-ad38-a7d0cd61eff7
7
public ArrayList<DuplicateMusicObject> getDuplicatesOnContent() { ArrayList<MusicObject> allMusic = getAllSongs(); ArrayList<MusicObject> temp = null; HashMap <String,ArrayList<MusicObject>> byteDuplicates = new HashMap<String,ArrayList<MusicObject>>(); for (MusicObject song : allMusic) { if ...
f3b4aacc-d264-4e90-bbd1-5da07f40922a
1
public Vector3f getVector3f( String name ) { Vector3f result = vector3fHashMap.get( name.toLowerCase() ); if ( result != null ) return result; return new Vector3f( 0, 0, 0 ); }
2712fdb1-2940-4ced-a9fe-81ad2662b6f6
3
private void playUser(Scanner sc){ System.out.println("There are "+m.count()+" marbles in the pile."); System.out.println("How many marbles do you want to remove?"); try{ m.remove(sc.nextInt()); player = false; } catch(Marbles.NotValid e){ System.err.println(e.getMessage()); } ...
1ac527a7-9f6c-4fb7-8bfc-741c0c2237a2
9
public RequeteRaster() throws SQLException { srids=RequeteUnion.getSrids(); tableaux=FenetreRaster.getTableauTailles(); for(int fg=0;fg<tableaux.size();fg++){ String test34[][]=tableaux.get(fg); String taillePixels=test34[fg][1]; taillePixel.add(taillePixels); String nomCouche=test34[fg][0]; no...
6be5b536-c3ae-40f5-a174-51ba3e28377c
5
public static Set<RepairedCell> readTruth(String fileRoute) { File file = new File(fileRoute); Set<RepairedCell> truth = new HashSet<RepairedCell>(); if(!file.exists()){ System.out.println(fileRoute+"文件不存在,无法测试!"); return truth; } try { FileReader fr = new FileReader(file); BufferedReader br = ...
6187b10d-8664-433f-a4ef-d6df010e54d8
3
public boolean setType(int n) { if ((n != NetworkSimulator.TIMER_INTERRUPT) && (n != NetworkSimulator.FROM_LAYER_5) && (n != NetworkSimulator.FROM_LAYER_3)) { type = -1; return false; } type = n; return true; }
6053fdb3-3e7b-4fc9-beb9-c2dde441b9c1
8
public String getInitialFilePath() { StringBuilder initialFilePath = new StringBuilder(); String userHome = System.getProperty("user.home"); if(userHome != null) { initialFilePath.append(userHome); } String osName = System.getProperty("os.name").toUpperCase(); String fileSeparator = System.getProper...
98538a97-af03-4309-ae87-c204de9ccaf3
9
public void handleConf(CSTAEvent event) { if ((event == null) || (event.getEventHeader().getEventClass() != 5) || (event.getEventHeader().getEventType() != this.pdu)) { return; } if (this.pdu == 30) { this.enable = ((CSTAQueryDndConfEvent) event.getEvent()) .isDoNotDisturb(); } this.device.re...
efade2cc-604b-42ac-878c-ebcccd30090b
3
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TabelOutletSize other = (TabelOutletSize) obj; if (!Objects.equals(this.kodeSize, other.kodeSize)) { ...
956bf31b-1c11-4e59-982a-a0df42eb8af3
0
public String getSeqID() { return seqID; }
d9bfe8bf-7380-4d36-908d-080f556fd3cf
4
public void generationControlee(){ int nbP; int nbA; Date date = new Date(); TachePeriodique tacheP; Tache tacheA; //Tache apériodique Scanner sc = new Scanner(System.in); //Stockage du nombre de tache a générer System.out.println("Nombre de taches périodiques controlées à générer : "); nbP = sc.nextI...
58ff7723-e87d-413d-acae-21c5ef52b2cc
0
public VueListe getVueListe() { return panelListe; }
f7a7c0d9-f3a0-4616-9e04-820d64476952
4
private static boolean isBSTHelper(TreeNode<Integer> t, int max, int min) { if (t == null) { return true; } if (t.data > max || t.data < min) { return false; } /* * current data is the max value of left subtree and min value of right * subtree */ return isBSTHelper(t.left, t.data, min) ...
940cd3cd-948d-433b-b2f9-3d9c1f0da2f2
8
protected static void processRoomRelinks(List<String> reLinkTable, String areaName, Map<String, Room> areaHashedRoomSet, Map<String, Room> hashedRoomSet) { // try to re-link olde room links if(reLinkTable!=null) { for(int r=0;r<reLinkTable.size();r++) { final String link=reLinkTable.get(r); String ...
4e7dd3ad-80f0-4180-9349-6f00aecd8a55
3
public Vec3D getIntermediateWithYValue(Vec3D var1, double var2) { double var4 = var1.xCoord - this.xCoord; double var6 = var1.yCoord - this.yCoord; double var8 = var1.zCoord - this.zCoord; if(var6 * var6 < 1.0000000116860974E-7D) { return null; } else { double var10 = (va...
adfae6a6-4416-4a3f-87e6-6b473ecab386
4
private void switchInputStream() throws IOException { if(getInputStream() != null) getInputStream().close(); if(filenames.isEmpty()) throw new IOException("All files in the playlist were marked as bad"); if(random) current = (int)(Math.random() * filenames.size()); else current = (current + 1) % fil...
51e10b13-cf40-4cc2-8caa-37d12bcd651e
1
public void shrink() { if (c.length == length) { return; } char[] newc = new char[length]; System.arraycopy(c, 0, newc, 0, length); c = newc; }
33937dc9-3107-4187-a702-bfe6c718d1b3
9
private void updatePatch(final MeshPatch old, final float time) { if (! (old.updateMesh || old.updateRoads || old.updateDirt)) return ; final int x = old.x, y = old.y ; final boolean init = old.inceptTime == TIME_INIT ; final MeshPatch patch = init ? old : new MeshPatch() ; if (init) { ol...
84142186-06f0-4866-bf6c-24f6b815ac0f
3
public void test_04() { System.out.println("\n\nSuffixIndexerNmer: Add & overlap test"); String fastqFileName = "tests/short.fastq"; // Create indexer SuffixIndexerNmer<DnaAndQualitySequence> seqIndexNmer = new SuffixIndexerNmer<DnaAndQualitySequence>(new DnaQualSubsequenceComparator(true), 15); // Add & ov...
70707f67-4381-4135-af89-841f4af318a4
8
@Override public AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState) { // if the axis is no...
85d7a22d-3f78-42d4-b17b-80ce86a93614
2
public static String getUrlFileType(String url){ if(url.endsWith(FileType.jpg.getType())){ return FileType.jpg.getType(); } else if(url.endsWith(FileType.jpg.getType())){ return FileType.png.getType(); } log.warn("System could not analyze this url's file type: " + url); return null; }
5718b067-0e8d-4cff-9b27-a772d718a6ea
9
public static void main(String[] args) { //System.setProperty("webdriver.chrome.driver", "/L/tmp/chromedriver"); Options options = new Options(); options.addOption("c", "config", true, "Path ot config to use"); options.addOption("d", "driver", true, "Driver to use"); options.addO...
1cdda6d6-31e5-4088-8aa6-ce3f90518315
7
public static void main(String[]args){ String Train = args[0]; //String Test = args[1]; //Naive naive = new Naive(); topwords naive = new topwords(); try { naive.train(Train); } catch (IOException e) { e.printStackTrace(); } //naiv...
9635b809-26b2-4c6c-969b-942fe7e2cf4a
5
public static void main(String[] args) { //Please input the value of "String[] args" from the settings of Java application. Class<?> c; ArrayList classList = null; try { c = Class.forName(args[0]); TypeDesc desc = new TypeDesc(); for(String name : args){ desc.printType(c, 0, TypeDesc.basic); cl...
db175825-dd6e-48d0-9331-da1e4849ca74
8
@Override public double calculateFractalWithoutPeriodicity(Complex pixel) { iterations = 0; double temp = 0; Complex tempz = new Complex(pertur_val.getPixel(init_val.getPixel(pixel))); Complex tempz2 = new Complex(init_val2.getPixel(pixel)); Complex[] complex = new Complex[...
ca601f69-82f5-4b72-b342-583f7517f014
0
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOKActionPerformed ctrlP.chercher(); }//GEN-LAST:event_jButtonOKActionPerformed
89cdeeb2-04ca-4872-814a-c00aa2b02f7c
9
@Override public void run() { if(workflow.getContext() == null) { workflow.setContext(new Context()); } if (AzotConfig.GLOBAL.DEBUG) { System.out.println("Reading " + workflowFile + "..."); } final List<Variable> contextVariables = workflow.getContext().getVariables(); for (final Variable ...
51b19196-b2b3-4a85-a1b7-730619936202
9
public void render(int bufp, float[][] buf, long nsamples, float buf2, boolean add) { //public void render(ByteBuffer buf, long nsamples, float buf2, boolean add) { //System.out.println("Rendering " + nsamples + " samples..."); long todo = nsamples; int bufpp = 0; while (todo != 0) { if (tickd == 0) { t...
ede62c49-7b55-4ad5-b0ee-e725310ad9dc
3
private final static Map<String, InstrumentType> buildMap() { final Map<String, InstrumentType> map_ = new HashMap<>(); try { for (final Field f : InstrumentType.class.getFields()) { final InstrumentType t = (InstrumentType) f.get(null); for (final String key : t.keys) { map_.put(key, t); } ...
01f31a21-985c-4db9-a93f-3d2d2602ac72
8
@Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { final Room R=mob.location(); if(R!=null) { if((R.domainType()&Room.INDOORS)>0) return Ability.QUALITY_INDIFFERENT; if((R.domainType()==Room.DOMAIN_OUTDOORS_CITY) ||(R.domainType()==Room.DOMAIN_OUTDOORS_SPACEP...
e734acab-9f25-4fb0-91e7-bf7c5e80636c
5
public void remove() { Connection conn = null; PreparedStatement ps = null; try { conn = iConomy.getiCoDatabase().getConnection(); ps = conn.prepareStatement("DELETE FROM " + Constants.SQLTable + "_BankRelations WHERE bank_id = ? AND account_name = ?"); ps.setInt(1, this.BankId); ...
9542a5a2-5515-4c55-a827-0b3a060d35a4
7
public int minPathSum(int[][] grid) { // Start typing your Java solution below // DO NOT write main() function int m = grid.length; if (m == 0) return 0; int n = grid[0].length; if (n == 0) return 0; int[][] res = new int[m][]; int i = 0, j = 0; for (i = 0; i < m; i++) res[i] = new int[n]; ...
a536a381-7a7e-458b-a049-f06697ca5ddc
8
private boolean processAsCommand(String input) { input = input.trim(); if (!input.startsWith(":")) return false; input = input.substring(1).trim(); String[] parts = input.split("\\s+"); if (parts.length == 0) System.out.println("missing command!"); else if ("context".startsWith(parts[0])) cmdConte...
4d27435b-c009-471c-b924-082e24bb0c11
4
public List<List<Point>> mutation(List<List<Point>> nextGen) { Random random = new Random(); for (int i = 0; i < nextGen.size(); i++) { int minInCircles = getMinInCircles(nextGen.get(i)); for (int j = 0; j < nextGen.get(i).size(); j++) { if (circleContainMin(n...
38c741b0-2d73-498a-b566-108346326edb
5
public synchronized ArrayList<Intron> introns() { if (introns == null) { introns = new ArrayList<Intron>(); Exon exBefore = null; for (Exon ex : sortedStrand()) { if (exBefore != null) { // Create intron Intron intron; int rank = introns.size() + 1; // Find intron start and end ...
5e1d379d-14a4-4936-9f6c-5cf9ccb90b2c
1
public Object display(int size) { // TODO Auto-generated method stub if(size==0) return this.head.getElement(); else return this.head.getNext().getElement(); }
302e735a-981a-4a9f-8da7-7b2c9561ba50
2
private static int readn(InputStream in, byte buf[], int c) throws IOException { int i = 0; while (i < c) { int n = in.read(buf, i, c - i); if (n == -1) return i; i += n; } return c; }
03d1a3fd-8085-4f74-a9ce-50f0b961274d
6
@SuppressWarnings("rawtypes") private void configRowMapper(Method method) { MongoMapper mapper = method.getAnnotation(MongoMapper.class); Class<? extends BeanMapper> mapperType = AutoDetectBeanMapper.class; if (mapper != null) { mapperType = mapper.value(); } if (AutoDetectBeanMapper.class.equals(mapperT...
2cb6195d-b33d-464d-9a07-5b734f0dfa8a
1
public final double getTotalAfterDiscount() { double total = 0.0; for (LineItem item : lineItems) { total += item.getDiscount(); } return total; }
e84e87ef-63d3-4fac-8660-4e8ed82ccbfe
6
public static void ex7() throws NumberFormatException, IOException{ System.out.print("Dimensió del array => "); int dim=Integer.parseInt(stdin.readLine()); int[] array=new int[dim]; for(int i=0; i<dim; i++){ array[i]=(int)(Math.random()*10); System.out.print(array[i]+" , "); } boolean creixent=true; boolean ...
b0c6b2c6-c02d-44b0-9329-efbb6504d796
3
public void setup(Main p) { con = new File(p.getDataFolder(), "config.yml"); config = p.getConfig(); if (!p.getDataFolder().exists()) { p.getDataFolder().mkdir(); } loc = new File(p.getDataFolder(), ".yml"); ...
da4b4a5a-1f7b-4c88-a34f-91dda8f36a18
4
public void testConstructor_int_int() throws Throwable { YearMonth test = new YearMonth(1970, 6); assertEquals(ISO_UTC, test.getChronology()); assertEquals(1970, test.getYear()); assertEquals(6, test.getMonthOfYear()); try { new YearMonth(Integer.MIN_VALUE, 6); ...
f96df67f-514b-4e84-8d76-d8842e048650
3
@SuppressWarnings("unchecked") @Override public T mapper(DBObject o) { T result = (T) ReflectUtils.newInstance(clazz); if (result == null) { return result; } Map<String, Object> resultMap = o.toMap(); for (Entry<String, Object> entry : resultMap.entrySet()) { String key = entry.getKey(); Objec...
5b962bbf-fb21-45d5-9582-288e99ff9e81
5
private void createD(String in1, String out) { DFlipFlop d = new DFlipFlop(); // Connect the first input // Check if the in wire is an input if (stringToInput.containsKey(in1)) { Wire inWire = new Wire(); stringToInput.get(in1).connectOutput(inWire); d.connectInput(inWire); } // Check if the in...
95dc5ef2-0503-4350-8825-2141d48299d5
0
@Override public void endAddSubContainer(Container c) { containerStack.remove(containerStack.size() - 1); AbstractPreferencesPanel.addSingleItemCentered((JComponent) c, getCurrentContainer()); }
7e1f407d-4187-4644-9766-a05270fd827a
2
private static void printTerrainTable(ArrayList<ParkerPaulTaxable> taxables) { double totalTaxes = 0.00; // total taxes for items double minTaxes = -1.00; // min taxes for items double maxTaxes = 0.00; // max taxes for items int count = 0; // count of items printTerrainHeader()...
0ff257a2-84f9-4270-a88c-22bb1b936ba9
2
public static void main(String [] args) { String[] paths = new String[]{ "samples/testseq100000.gif", "samples/testseq100007.gif", "samples/testseq100136.gif", "samples/testseq100192.gif", }; try { for (String path : paths)...
6735a291-3d38-42c7-b6d8-971890cfb62c
9
public void readCommand() throws InvalidComException, IncorrectNumException{ if (command[0].equals("addplayer")) { comAddplayer(true); } else if (command[0].equals("removeplayer")) { comRemoveplayer(); } else if (command[0].equals("editplayer")) { comEditplayer(); } else if (command[0].equals("rese...
1b11116c-9474-468b-8867-12a90faf1b1d
8
public void finishLoadingGeography() { Vector<VTD> features = featureCollection.features; System.out.println(features.size()+" precincts loaded."); getMinMaxXY(); System.out.println("Initializing wards..."); featureCollection.initFeatures(); dlbl.setText("Setting min and max coordinates..."); ...
015e40b2-6b1b-4cca-957c-2261612601f4
8
public static Stella_Object lookupDeferredQueryOption(Stella_Object queryoroptions, Keyword key, Surrogate coercetotype) { { PropertyList options = null; PropertyList deferredoptions = null; Stella_Object value = null; Stella_Object coercedvalue = null; boolean processeddeferredoptionP = fal...
4ae00955-13d4-4be5-9c13-b46016906843
7
public void stateChanged(String s) { if (s.equals(VisibleTimer.START)) { enableEdits(false); String answerList[] = new String[answers.length]; for (int i = 0; i < answerList.length; i++) answerList[i] = answers[i].getAnswer(); model.broadcastQuestion(question.getText(), answerList); if (!time...
c04684cd-c285-4e42-b672-26d9980d0809
0
public MealyNondeterminismDetector() { }
6b4e534d-572b-4a41-88fc-e3c7bd3cfa37
9
public void update(Graphics g) { Dimension dim = getSize(); Insets insets = getInsets(); g.setColor(getBackground()); int x = insets.left; int y = insets.top; int w = dim.width - insets.left - insets.right; int h = dim.height - insets.top - insets.bottom; g.fillRect(x, y, w, h); float scale = w / (...
bbf7512f-14dc-478d-8b30-054089ac82a3
2
public int promptRemoveDirectoryFromPath(String directory,Exception e) { if (e instanceof NullPointerException) { return jopDependency.showConfirmDialog(null, String.format("Couldn't match the following path with any environment variables. Do you wish to remove it?\n%s", directory), "Remove invalid ...
15645ff0-fd66-457a-8350-02c3bfa03314
1
public void test_append_Printer_nullParser() { DateTimeFormatterBuilder bld = new DateTimeFormatterBuilder(); bld.appendLiteral('Y'); DateTimePrinter p = bld.toPrinter(); try { DateTimeFormatterBuilder bld2 = new DateTimeFormatterBuilder(); bld2.append(p,...
a12f4e6c-b85c-4730-aa38-2e82bac5f756
2
@Override public void Execute(Session mSession, String[] Arguments) { if (Arguments.length == 0) { mSession.SendAlert("You didn't specify a plugin to destroy!", null); return; } if (Grizzly.GrabPluginHandler().DestructPlugin(mSession, Arguments[0])) { mSession.GrabActor().Speak("*Disables the pl...
335044e4-2d9b-44e3-a967-405c774d8ad1
5
private static void processClientChoice(int choice) { String testName; String studentName; String studentSurname; switch (choice) { case 1: listTests(); break; case 2: System.out.println("Enter test name:"); ...
2c8710c1-cdea-437c-aad7-35b4b0c0fb0e
6
public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); ...
a6c5e35e-df67-4f47-993b-4d0a821d59c7
9
public boolean findPath(int X, int Y, ArrayList<Point> path, Hashtable<Point, Boolean> cache) { Point p = new Point(X, Y); if (cache.containsKey(p)) return cache.get(p); // already visit the cell if (X == 0 && Y == 0) return true; // already find a path boolean success = false; if (X >= 1 && isFree...
71d2b450-662f-4b8f-96e4-25f9aa650bc0
5
@Override public void actionPerformed(final ActionEvent e) { if (e.getSource() == bHint) { ArrayList<Integer> moves = client.getAIMove(); int pcx = moves.get(0); int pcy = moves.get(1); int pct = moves.get(2); String pcc = "any"; if (moves.get(3) == 0) { pcc = "RED"; } else if (moves.get(3) ...
b7a2e326-3608-4854-b333-9caa2a5af01a
8
private void favorite(HttpServletRequest request, HttpServletResponse response,UserBean user) throws ServletException, IOException { List<String> errors = new ArrayList<String>(); FavoriteForm form = new FavoriteForm(request); if (!form.isPresent() && form.getFavoriteId() == null) { outputLi...
84e6db74-a317-40ca-a5b0-5270a0a36849
5
private void rotateRight(Node u) { int hookType; if (root == u) hookType = 0; else if (u == u.parent.left) hookType = -1; else hookType = 1; Node nodesLeft = u.left; Node leftsRight = nodesLeft.right; nodesLeft.right = u; if (hookType == 0) ro...
15d35887-e2d4-4417-af98-2809c6e016a0
3
public int getTotalBlocksPlaced(String playerName) { int totalBlocksPlaced = 0; try { ResultSet rs = _sqLite.query("SELECT total(blocks_placed) " + "AS total_blocks_placed " + "FROM player, login " + "WHERE player.playername = '" + playerName + "' " + "AND player.i...
35c1de83-b0af-44cb-9859-ddb8ef76e1d8
1
public static void main(String args[]){ Deal deal=new Deal(); PrestataireDeService p = new PrestataireDeService(); p.setIdUser(2); deal.setDescriptif("un descriptif test"); deal.setCategorie("mm"); deal.setTypeDeal("Produit"); deal.setDateDebut("27/02/2013"); ...
03bf9589-13f9-4d04-898e-3aa65373c263
3
public void fromJSONObject(JSONObject o) { try { setFirstName((String) o.remove(KEY_FIRST_NAME)); setLastName((String) o.remove(KEY_LAST_NAME)); setID((String) o.remove(KEY_ID)); setPoints(Utils.numToInt(o.remove(KEY_POINTS))); String id = (String) o.remove(KEY_WEEKLY_PICK_ID); Contestant c = null;...
94e8e40d-b604-48bd-a9c5-ab117c618f4b
0
protected void _setConfigFile(File config_file) { this.config_file = config_file; }
eef5d401-af03-48b3-9dbc-95f5ede71794
6
protected boolean ist_angrenzendes_Land_verschieben(Land frage_Land, Spieler aktuellerSpieler, List<Land> gepruefte_laender){ for (int i=0;i<angrenzendeLaender.length; i++){ if (angrenzendeLaender[i]==frage_Land) return true; } gepruefte_laender.add(this); boolean ist_angrenzend=false; for (int i=0;i<an...
5856b4d4-e923-451c-a64b-a61eb4a546fa
0
public void setTotal(double total) { this.total = total; }
b9af7bfb-2e12-42ce-aef6-8b8639008737
0
public Location(int row, int col) { this.row = row; this.col = col; }
6466f794-e748-47b2-b6f6-681ecbef2653
6
public void reserveRoundTripTicket() { try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.out.println("Where is your MySQL JDBC Driver?"); e.printStackTrace(); } PreparedStatement ps = null; Connection co...