method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
388de2b7-751f-4500-806e-4d5a675165b0
3
public boolean isErrorStartCodon() { if (!Config.get().isTreatAllAsProteinCoding() && !isProteinCoding()) return false; // Not even one codon in this protein? Error String cds = cds(); if (cds.length() < 3) return true; String codon = cds.substring(0, 3); return !codonTable().isStart(codon); }
7f48a64c-7642-42a5-a89d-607d69e75ebd
3
private Object[] scanBlockScalarIndentation () { StringBuilder chunks = new StringBuilder(); int maxIndent = 0; while (BLANK_OR_LINEBR.indexOf(peek()) != -1) if (peek() != ' ') chunks.append(scanLineBreak()); else { forward(); if (column > maxIndent) maxIndent = column; } return new Object[...
b8d10a6d-ea7f-4783-95a0-55ef0cbf6753
0
public void addManager(ParkManager manager) { this.managerList.add(manager); }
8516d476-ae5c-4573-8839-13fed77b8500
8
@Override public void run() { long next_update = System.currentTimeMillis(); long last_update = System.currentTimeMillis(); int frames_skipped; float interpolation; long sleep_time; try { // Initialize the input devices: ...
cc388367-c504-4901-8080-5d37d83dfb9e
1
public boolean isOver() { return isPlayerOver && theHouse.getScore() > 15; }
0491730e-3dbd-47ba-907a-0bc064f2d42d
5
public static int mst(int[][] nabomatrise){ int currentNode = 0; int counter = 0; int len = nabomatrise.length; int max = Integer.MIN_VALUE; int[] noderSett = new int[len]; noderSett[counter] = currentNode; while (counter < len - 1) { int nextNode = -1; int nextWeight = Integer.MAX_VALUE; for ...
6e84e362-933a-4bb1-8ec7-2471fea6558f
4
public final void grow(int size) { if (locals != null) { size += count; if (size > locals.length) { int nextSize = locals.length * 2; // GlobalOptions.err.println("wanted: "+size+" next: "+nextSize); LocalInfo[] newLocals = new LocalInfo[nextSize > size ? nextSize : size]; System.arraycopy...
a2369f9b-dcf4-41c6-90b2-bf756638ee7c
9
@Override public synchronized Message process(ClientState state, Message request) { System.out.println("Request:"+request); Model model = Model.getInstance(); //get the singleton model Node child = request.contents.getFirstChild(); //first child in message tree //get ID of Decision Line Event, access the...
c5ed9dfc-db80-4b44-9816-183fb69bf95e
0
public void setPartB(PartB partB) { this.partB = partB; }
df146069-9cfd-4a08-8220-960c5ac9e545
6
public void run() { try { serverSocket = new DatagramSocket(53); } catch(Exception e) { System.err.println("5"); } byte[] receiveBuffer = new byte[1024]; byte[] t=null; while(true) { DatagramPacket receiveP...
4a677f1d-fe41-48ed-a1ef-792a83dacc6f
7
private TypeVariable<?> getTypeVariable(final String name, final Class<?> ownerClass, final TypeMap typeMap) { final Set<TypeVariable<?>> keys = typeMap.getKeys(); for (final TypeVariable<?> key : keys) { if (key.getName().equals(name) && key.getGenericDeclaration().equals(ownerClass)) { ...
cc31862c-1353-40ac-bc52-72cddb5470cc
5
public static String getCompressedString(String str) { String compressedString = ""; boolean compressed = false; int i,j,count; for(i=0; i<str.length(); i=j) { count=1; j=i+1; for(; j<str.length() && str.charAt(i) == str.charAt(j); j++) count++; if(count>1) compressed = true; compressedSt...
468d7d46-3789-4ce5-9f64-6d2e7bdca62a
7
public boolean shellCollideCheck(Shell shell) { if (deadTime != 0) return false; float xD = shell.x - x; float yD = shell.y - y; if (xD > -16 && xD < 16) { if (yD > -height && yD < shell.height) { world.sound.play(Art.samples[Art.SAMP...
dca9253d-6c55-441f-8064-e31205b91e2a
3
private void comboCidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboCidadeActionPerformed String item = String.valueOf(comboModelCidade.getSelectedItem()); if(item.equals("Selecionar....") || item == "null"){ if(listaCheia == true){ comboModelBa...
7230cc21-9b90-4a81-bc53-6e7aa0fcd5fe
5
public static MaplePacket sendDuey(byte operation, List<MapleDueyActions> packages) { MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendPacketOpcode.DUEY); mplew.write(operation); if (operation == 8) { mplew.write(0); ...
3c071efd-4975-4789-8b26-a507e8502ae0
6
private static void validerJeu(Jeu jeu) throws ChampInvalideException, ChampVideException { if (jeu.getNom() == null || jeu.getNom().isEmpty()) throw new ChampVideException("Le jeu doit avoir un nom"); if (jeu.getDescription() == null || jeu.getDescription().isEmpty()) throw new...
5869a69b-5dbd-43bd-af2c-4cc4185db5e1
0
@Override public String toString() { return "HostInfo[IP=" + this.address + ",port=" + this.port + "]"; }
b98dc9f0-e510-425d-97b1-c4fdec5783f1
3
public void keyPressed(KeyEvent e) { String dir = e.getKeyText(e.getKeyCode()); //System.out.println(dir); if(Battle.BATTLE_OVER) Battle.TERMINATE=true; if (keyBoolean&&!cursorLock) keyMeasure(dir); }
e8b20476-4e7d-4d8f-8ae7-32358f1c622d
4
public String toXml() { calcMashSchedule(); StringBuffer sb = new StringBuffer(); sb.append(" <MASH>\n"); sb.append(SBStringUtils.xmlElement("NAME", name, 4)); sb.append(SBStringUtils.xmlElement("MASH_VOLUME", SBStringUtils.format(Quantity.convertUnit("qt", volUnits, volQts), 2) , 4)); sb.append(SBString...
8e6ecdd7-df56-4f38-9ae0-e929fd9eaa8f
5
public void edit(Tournament tournament) throws NonexistentEntityException, Exception { EntityManager em = null; try { em = getEntityManager(); em.getTransaction().begin(); tournament = em.merge(tournament); em.getTransaction().commit(); } catch (Ex...
3a033fe8-4ad1-4be8-bd13-70260726cf11
3
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Font theFont = null; Color theForeground = null; Icon theIcon = null; String theText = null; Integer id = null; JLabel renderer = (JLabel) defaul...
84da3770-f916-45b1-88a7-47de317b7e15
5
public void moveSplit() { if (units2.size() == 6) { QMessageBox.warning(this, "Nie można przenieść jednostek", "Bohater może mieć maksymalnie 6 jednostek"); } else if (units1.size() == 0) { QMessageBox.warning(this, "Nie można przenieść jednostek", "Bohater nie ma żadnych jednostek"); } else if (list1.curr...
34da8c57-235a-46c9-bdcf-8db59f77ce68
2
public static void run(Player a){ try { a.init(); } catch (NamingException e) { System.out.println("Errore nell'inserimento del nome del Player"); e.printStackTrace(); } catch (JMSException e) { System.out.println("Errore generico"); e.printStackTrace(); } }
66edeeb1-58a9-434f-86a0-917bb429e419
9
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final User other = (User) obj; if (!Objects.equals(this.userIn, other.userIn)) { return false; ...
8568dba2-af28-4dff-819e-857a4ae469a0
1
public static Provider getProvider(){ if (instance == null){ instance = new ProviderService(); } return provider; }
5de2df68-4421-4c18-bcce-3fb18fcadfb8
8
public void boxBehavior(double x, double y) { if(this.canLeaveBox()) { // If Ghost can leave, guide Ghost towards exit if(coordX > 0) { velX = -1; velY = 0; } else if(coordX < 0) { velX = 1; velY = 0; } else if(coordY > -36) { ...
868bab2e-89f9-4808-8e0a-f6bcebb5b282
1
public ChampionListDto retrieveAllChampions(Region region, boolean freeToPlay) { String addon = (freeToPlay) ? ("?freeToPlay=1&api_key=") : ("?freeToPlay=0&api_key="); String requestURL = Settings.API_BASE_URL + region.toString().toLowerCase() + "/v" + getCategoryVersion() + "/" + getObjectCategory() + addon + Sett...
00b9bbb3-50aa-41f0-89c3-0cd722d99067
0
public CheckResultMessage errorNameFormat() { return new CheckResultMessage("该报表命名不规范:" + fileName, CheckResultMessage.CHECK_ERROR); }
d3ef2dc4-91c4-434b-9593-530b25334617
4
public Integer login(String uname, String pword) throws Throwable { md5 enc = new md5(); SQLite_helper log = new SQLite_helper(); ResultSet user = log.retrieve("users","username", uname); if(!user.next()) { enc.close(); log.destruct(); user.close(); return 0; } else { String username = user.get...
67be1159-87b5-4c86-a04f-3ffa5ccefcde
0
public JTextArea getTextArea() { return textArea; }
c48db579-7f83-484f-8b57-f3f5b82466bd
5
private static ImageProcessor doHysterisis(ImageProcessor edges, ImageProcessor gradient, double low, double high){ ImageProcessor result = new ByteProcessor(edges.getWidth(), edges.getHeight()); ImageProcessor med = result.duplicate(); LinkedList<Integer> candidates = new LinkedList<Integer>(); //seek st...
6a6181f7-5bcd-4a1f-ba87-92f089eedcd8
8
@Override public void mousePressed(MouseEvent e) { if (selectedOC != null) { if (enteredIC != null) { try { selectedOC.addConnected(enteredIC); selectedOC.setSelected(false); selectedOC = null; enteredIC.setSelected(false); enteredIC = null; repaint(); } catch (ConnectExcepti...
42a287a5-241f-4f5e-8dc4-4f3c27c25360
9
public static String entityTo (String raw, String[] tc) { StringBuffer sb = new StringBuffer (); boolean entity = false; raw = raw.replace ('+', ' '); String tokens = tc == charsHtml ? "%<>" : "%"; for (StringTokenizer st = new StringTokenizer (raw, tokens, true); st.hasMoreTokens (); ) { ...
d98e80b3-69fe-4384-b8d2-d4abf1f5f1c0
8
public static PlayerCharacter instance(PlayerCharacter.CharID charId) { switch (charId) { case AGGRESSOR: return Aggressor.instance(); case AMBITIOUSMAN: return Ambitiousman.instance(); case FUNNYMAN: return Funnyman.instance(); case LEADER: return Leader.instance(); case MONEYMAKER: return M...
67c269a9-727f-4161-bc0b-a27227029641
9
public void addModifier(int context, String name) { if (modifiers == null) modifiers = new Hashtable(); Object existing = modifiers.put(name, Void.TYPE/* arbitrary flag */); if (existing != null) throw new IllegalStateException("Duplicate modifier: " + name); int count = 0; if (hasModifier("private"))...
4672e29d-ea0b-4678-a3f1-7aed1eef8f7b
2
public List<PluginCommand> makePluginCommands(List<ACommand.Executor> executors) { try { List<PluginCommand> cmdList = new ArrayList<PluginCommand>(executors.size()); for(ACommand.Executor exec : executors) { PluginCommand pcmd = newPluginCommand(exec.annot.alias()[0]); exec.setAsExecutor(pcmd); cmd...
79c44e0a-5f20-4ab9-a011-e4401bff1bf0
0
@Override void method() { System.out.println("独自処理:" + LoggerUtils.getSig()); }
b61bfa96-f9fa-4a05-bec4-53b1f485342a
0
public static GeneralValidator isNotNull() { return NOT_NULL_VALIDATOR; }
ad705e18-48ac-421f-9c61-abdcfce25f70
0
@Override public void isNull(String str) { }
52b056c4-a778-4928-a0ac-ac9d8c93934a
2
public static Integer getDiscountForOrder(Integer discount, Float finalPrice) { int coef = Math.floorDiv(Math.round(finalPrice), 1000); if (coef <= 0) { coef = 1; } Integer maxDiscount = Integer.decode(ConfigurationManager.getProperty("user.discount.max")); Integer d...
4ee6b25a-6dde-465e-a72b-5f40394d0209
5
public static void calculateLossError(){ //output error for(int outNode = 0; outNode < numOutputs; outNode++){ double sum = 0; for(int weight = 0; weight < hidOut.length; weight++){ sum += (hiddenOutput[weight] * hidOut[weight][outNode]); } outputError[outNode] = derivitiveActivationFunction(sum) * ...
936990ce-d49f-4d52-9377-063dd0671363
9
public static Object[] getPropertyIds(Scriptable obj) { if (obj == null) { return ScriptRuntime.emptyArgs; } Object[] result = obj.getIds(); ObjToIntMap map = null; for (;;) { obj = obj.getPrototype(); if (obj == null) { bre...
a0bd9135-f7bb-488e-b8c6-be9096bc76b6
6
private static long countWays(int length) { if (solutions[length] != NOT_SOLVED) { return solutions[length]; } else if (length==0) { // length 0 handles base cases solutions[length] = 1; return 1; } else if (length==1) { solutions[length] = 1; return 1; } else if (length==2) { solutions[len...
ce9812df-d4ee-4e45-8fa2-c9e11b77ba15
6
private static boolean checkCredentialFormat(String login, String password){ if (login.equals("")||password.equals("")) return false; for(int i=0; i<login.length(); i++) { if (!allowedSymbol(login.charAt(i))){ return false; } } for(int i=0;...
d589bde4-22e6-4c94-b6c1-74a9541c7a4b
1
private void pushTreeConstantElements(List list, Stack stack) { final Iterator iter = list.iterator(); while (iter.hasNext()) { stack.push(iter.next()); } }
a3d50f1d-0074-493e-8df9-2355a420b558
5
private void validateMassBankRecord(MassBankRecord massBankRecord) { if (massBankRecord != null) { if (massBankRecord.getPkPeak() != null && massBankRecord.getPkPeak().getPeakMap() != null) { for (Map<String, String> map : massBankRecord.getPkPeak().getPeakMap()) { if (map.keySet().size() > 3) { LOGGER....
f8668b28-31e5-4549-8d41-2ec2bb02d336
2
private void packLivingEntityToEgg(LivingEntity ent, Player player) { ItemStack spawnerEgg = plugin.getSpawnerEggOfMob(ent, player); if(null != spawnerEgg) { HashMap<Integer, ItemStack> notFit = player.getInventory().addItem(spawnerEgg); if(!notFit.isEmpty()) { ...
7fa11198-b9d8-4eac-b741-df68743da4b2
1
public void prevImage() { if (historyIndex > 0) { historyIndex--; imagePanel.updatePanel(history.get(historyIndex)); imagePanel.update(imagePanel.getGraphics()); } else { textArea.append("No images left!\n"); } }
8004b8c4-21e1-439b-9cbd-4844f0037c33
8
private void changeImage(Event e , String option){ if(e instanceof MouseEvent){ //get the source of event ImageView ev = (ImageView)e.getSource() ; String loc = null ; if(ev.getId().equals("departmentImageView")){ loc = "/images/school7" + option + ".png" ; }else if(ev.getId().equals("teacherI...
a7797a49-c195-4542-a890-daca8202913f
5
@Override public List<Sondage> findAll() { List<Sondage> listS = new ArrayList<Sondage>(); Statement st = null; ResultSet rs = null; try { st = this.connect().createStatement(); rs = st.executeQuery("select * from Sondage"); System.out.println("rec...
b280866f-8928-4cec-a955-f391b9837691
7
public void actionPerformed( ActionEvent e ) { Object sender = e.getSource() ; if (sender == editButton ) { int index = table.getSelectedRow() ; if (index >= 0) { startEdit( index ); } } else if (sender == newButton) { startAdd() ; } else if (sende...
0c97021c-12a2-4721-bafb-7aa1e05adc13
4
public void makeNextMove(MazeMap mazeMap) { //double start; //double stop; // Scan area and update Traversal Map //start = System.nanoTime(); setTraversalMap(curLocX, curLocY, mazeMap); //stop = System.nanoTime(); //System.out.format("Scan: \t\t%f ns\n", stop-sta...
0a77f8d1-0519-45b6-b642-305a3b04a736
5
public void drawHouse(boolean showPlayer, boolean showZombies) { char[][] houseLayout = new char[100][100]; for(int y = 0; y < houseLength; y++) for(int x = 0; x < houseWidth; x++) houseLayout[x][y] = tileLayout[x][y].getChar(); houseLayout[player_X][player_Y] = 'P'; for(int i = 0; i < zombieList....
4a9baf7a-1260-496d-8439-67117e7acb0c
2
@Test public void testGetAllJobsCurrentOnWorkers() throws LuaScriptException { List<String> noKeys = new ArrayList<String>(); List<String> args = Arrays.asList(JQlessClient.getCurrentSeconds()); String json = (String) _luaScript.callScript(this.scriptName(), noKeys, args); json = JsonHelper.fixArrayField(...
89514eae-55f4-4383-838e-51f307ba3b53
0
public void setParticipants(List<Participant> participants) { this.participants = participants; }
367df455-7c27-4271-8f8a-13197fde795e
2
public String getRightName() { if (rightName == null || rightName.equals("")) return "Правый"; else return rightName; }
9e07fadc-4ed7-4a11-b405-8305bee4ae98
1
private byte[] toByteArray(short[] ss, int offs, int len) { byte[] bb = new byte[len * 2]; int idx = 0; short s; while (len-- > 0) { s = ss[offs++]; bb[idx++] = (byte) s; bb[idx++] = (byte) (s >>> 8); } return bb; }
8fff83ce-414f-48c9-b8e2-aab144d5278c
2
public void handlePacket(Packet packet, Server server){ int i = 0; while(i < registered.size()){ if(registered.get(i).isInstance(packet)){ handlers.get(i).handle(packet,server); return; } i++; } throw new RuntimeExceptio...
e0258d93-ae1b-4cf4-b2f8-317144fda1d4
8
private static void drawOnCircleByAutomorphism(int nonAutOption, boolean a) { // draw the nodes usedList = (a) ? autList1 : autList2; if (!a){ int aux = numPairs; numPairs = pairSize; pairSize = aux; } nonAutList = new ArrayList<Integer>(); for (int i = 0; i < numNodes; i++) { if (usedList.conta...
c0d108e7-acca-4478-9b33-8e769e0fadd4
6
static protected void UpdateLineColumn(char c) { column++; if (prevCharIsLF) { prevCharIsLF = false; line += (column = 1); } else if (prevCharIsCR) { prevCharIsCR = false; if (c == '\n') { prevCharIsLF = true; } else line += (column = ...
65d3ec72-9e70-44a9-a531-dcfdf6608fc1
4
@Override public void menu() { out.println(); out.println("[1] Buscar"); out.println("[2] Cadastrar"); out.println("[3] Listar Todos"); out.println("[0] Sair"); switch(sc.nextInt()){ case 1: buscarMedicamento(); break; case 2: cadastraMedicamento(); break; case 3: listarMedicamentos(); break; ...
9d37a3b4-7ba0-4080-bc0c-f65cedd6330c
8
public void preprocess() { StringBuffer readyText = new StringBuffer(text.length()); Pattern startBlock = Pattern.compile("/\\*"); int start = 0; Matcher matcher = startBlock.matcher(text); // Remove block comments while (matcher.find(start)) { for (int i = matcher.end(); i < text.length()-1; i++) { ...
c85a822c-1d2b-416d-b820-0bf6470839d0
5
private boolean kasitteleRivi(float rivi) { for(float x = pelialue.alue().alkupiste().x(); x <= pelialue.alue().paatepiste().x(); x++) { TetrisPalikka palikka = (TetrisPalikka)pelialue.haePalikka(new Sijainti(x, pelialue.alue().paatepiste().y()-rivi)); if(pelialu...
27ada872-4226-48c0-9a76-bf9792fcd551
6
public static Node followLocalXpath (Node start, String localXpath) throws DOMException { String startXpath = localXpath(start); if (startXpath.equals(localXpath)) { return start; } else { StringTokenizer tokenizer = new StringTokenizer(localXpath, "[]"); ...
164307da-30a7-4796-8ae0-2e2de7c65e83
9
TypeTable(String tableFile) throws FileNotFoundException, IOException { BufferedReader br = new BufferedReader(new FileReader(tableFile)); String row; String[] columns = null; String[] currentRow; boolean firstRow = true; boolean secondRow = true; ...
80c4a3e1-b309-40a4-a1eb-ac580d2f4579
2
public ResultSet sqlQuery(String sql) { Statement stat = null; try { stat = (Statement) conn.createStatement(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } ResultSet rs = null; try { rs = stat.executeQuery(sql); } catch (SQLException e) { // TODO Au...
87ff7ee7-83da-4b0a-ad52-1ce470cc5762
5
private ArrayList<Module> populateModules() throws IllegalArgumentException { try{ openDatabase(); }catch(Exception e){} String query = "SELECT * FROM t8005t2 .modules"; ArrayList<Module> modules = new ArrayList<Module>(); try { stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(qu...
610249e9-d548-43a1-b759-6264960cee49
1
public static void print(String s){ if (ruteadorWindow != null) ruteadorWindow.print(s); // System.out.print(s); }
d6948893-fc1e-4cfa-8e34-5eac3bb8be94
1
@Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; }
3e856b33-888f-4f33-a781-22d33a5845e2
4
public int getCommand() throws Exception { int command = 0; switch (this.getType()) { case 0: command = 0x80; break; case 1: command = 0x81; break; case 2: command = 0x82; ...
dbc6555c-149a-45b7-931e-0d2c91d211ce
4
FieldWriter(final ClassWriter cw, final int access, final String name, final String desc, final String signature, final Object value) { if (cw.firstField == null) { cw.firstField = this; } else { cw.lastField.next = this; } cw.lastField = this; this.cw = cw; this.access = access; this.name = cw.n...
b0d34970-d3c6-46c0-835d-204a7526a300
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...
0494c734-cf3c-48ed-a07d-40f37ca999c6
3
@Override public void run() { char[] b = new char[4096]; int n; try { while ((n = r.read(b)) != -1) { w.write(b, 0, n); } } catch (IOException ex) { ex.printStackTrace(System.err); } f...
64b2bb4e-ddc0-4dc6-8d28-12ba38e1b6cf
4
public final Iterator<Path> dirsIterator() { return new Iterator<Path>() { private DirTree currentTree = walkTo(DirTree.this.base); private Iterator<String> iter = this.currentTree.directories .keySet().iterator(); private final ArrayDeque<Iterator<String>> iterStack = new ArrayDeque<>(); @Override ...
0d276b44-32a0-4ee7-910e-6af5a0198042
7
private PageDiffractionInstrument createDiffractionInstrument() { PageDiffractionInstrument i = new PageDiffractionInstrument(); i.setPage(page); i.setModelID(modelIndex); if (uid != null) { i.setUid(uid); uid = null; } if (type != -1) { i.setType(type); type = -1; } if (loadScan...
31e93ccf-020b-4b74-86e2-3d8ddf62c290
0
public RegularStateTool(AutomatonPane view, AutomatonDrawer drawer, FSAToREController controller) { super(view, drawer); this.controller = controller; }
3e8c895d-d536-4877-ad3e-6513f7849d19
7
public CountryRunnerTitleScreen(){ this.repaint(); playGameButton = new JButton("Play Game"); chooseBackground = new JButton("Choose Background"); chooseAvatar = new JButton("Choose Avatar"); chooseDifficulty = new JButton("Choose Difficulty"); helpButton = new JButton("Instructions"); hig...
90025538-8b95-4aec-8d15-a54d6e18bcfb
2
private void fire(String command){ if (listeners != null){ CommandLineEvent event = new CommandLineEvent(this,command); for (CommandLineListener listener: new ArrayList<CommandLineListener>(this.listeners)){ listener.newCommand(event); } } }
434eab49-4b22-4619-b6de-d024a4de4ed8
4
public PrimitiveOperator combineRightNLeft(PrimitiveOperator other) { boolean[] newTruthTable = new boolean[4]; // the other gate is on the left side - on the MSB newTruthTable[0] = truthTable[((other.truthTable[0]) ? 2 : 0) | 0]; //00 -->00 newTruthTable[1] = truthTable[((other.truthTable[2]) ? 2 : 0)...
5d52b874-a533-406c-a6cb-8a78571e69ae
0
public int getDeaths() { return deaths; }
e161158f-ef8e-425d-99e8-10ef28211179
0
public int getNbCouleurs(){ return Integer.parseInt(propriete.getProperty("nb_couleur")); }
f2d41ea1-94e2-4478-994a-4781dccb90e2
0
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String combi = request.getParameter("combi"); String gameid = request.getParameter("gameid"); response.getWriter().write(Server.getInstance().attempt(gameid, combi)); }
86f11a0b-f281-455a-af4b-33ec4b258afb
2
@Test public void testUTF8Bundle(){ ResourceBundle bundle = null; //load UTF-8 bundle with ResourceBundle.getBundle bundle = ResourceBundle.getBundle("bundle/bundleutf8", Locale.FRENCH); //it should not be what we want assertTrue(!"état".equals(bundle.getString("state"))); //try with UTF8ResourceBund...
b7282a6a-0304-424d-b26f-149dc90a03d7
2
public void writeStepHeader() { checkFile(); if (wroteStepHeader == false) { // only write once. if (w != null) { w.println("********************************************"); w.println(" Calibrated Parameter Values"); w.println("**************************************...
479160ea-cdb2-4002-af9a-291d8be8a38b
2
private synchronized void rescan() { files.clear(); words.clear(); int i = 0; for (InputStream is : streams) { files.put(i++, is); } try { doIndex(); } catch (IOException e) { e.printStackTrace(); } }
276b2d4e-441e-4ab8-8d63-34b42233b18c
8
static public ParseException generateParseException() { jj_expentries.clear(); boolean[] la1tokens = new boolean[14]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 7; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { ...
c3e84dcc-ff57-48d2-b1a6-3071d64f3408
7
@onStateBecomesCurrent(state = "expression") public void handleExpression(StateMachineEvent<SyntaxTokensEnum> theEvent, State<SyntaxTokensEnum> prevState) { try { switch (theEvent.getEventType()) { case CLOSING_BRACKET: updateExpressionValue(); ...
e9c360fb-aae6-4ce1-82b0-290356b751ef
2
public AbstractPage(String stringURL, String saveTo, AbstractPage parent) throws IllegalArgumentException { try {url = resolveLink(stringURL);} catch (MalformedURLException e) {throw new IllegalArgumentException(e);} catch (NullPointerException e) {throw new IllegalArgumentException(e);} this.saveTo = saveTo; ...
91d2aee2-3aba-4a10-9d85-607127a5e32d
2
* returns a query properties string for the default query properties */ public String queryPropertiesToString(final InferenceParameters queryProperties) { final InferenceParameters tempQueryProperties = (queryProperties == null) ? getHLQueryProperties() : queryProperties; final CycList parameterList = new ...
e6c79af9-0905-42a7-b51f-ef94135488b3
9
@Override public boolean isTrue(State state, String[] params) { ObjectInstance containerInstance = state.getObject(params[1]); int contentAmount = ContainerFactory.getContentNames(containerInstance).size(); int neededAmount = this.topLevelIngredient.getContents().size() + this.topLevelIngredient.getNece...
a374902d-d997-4fcd-94ea-c21a6918a073
0
public Menu(ProBotGame game) { this.game = game; this.menuWrapper = new JPanel(); this.menuWrapper.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 100)); this.menuWrapper.setFocusable(false); this.menuPanel = new JPanel(); this.menuPanel.setFocusable(false); }
ce19396c-7170-466e-9be9-88d36282dd2b
3
public static IArticle getArticle(UrlWrapper url) { Site site = Site.resolve(url); switch (site) { case HABRAHABR: { return new HabrahabrArticle(url); } case WIKIPEDIA: { return new WikipediaArticle(url); } case ...
7e6f5b86-8eba-407b-b474-f483c1177d8e
5
public void run() { /* * Open a server socket on port 4444. Note that we can't choose a port less * than 1023 if we are not privileged users (root). */ try { echoServer = new ServerSocket(4444); } catch (IOException e) { System.out.println(e); } /* * Create a socket object from the ServerS...
162fe1ca-decc-467e-b2e8-5e477a92097c
9
private void initialize() { log.debug("Initializing new Graph"); // register handler for connection events this.canvas.addEventHandler(ConnectorEvent.CONNECTOR_SELECTED, new EventHandler<ConnectorEvent>() { public void handle(ConnectorEvent e) { // if the line is null, we create a new one at the given ...
299da77d-1775-4455-8520-92495e24dd7a
9
public static double[][] tsne_p(double[][] p, int no_dims) { /* %TSNE_P Performs symmetric t-SNE on affinity matrix P % % mappedX = tsne_p(P, labels, no_dims) % % The function performs symmetric t-SNE on pa...
5d5b769a-f05d-4360-8b42-5fc4b15ee4fb
2
@Override public void actionPerformed(ActionEvent e) { Object src = e.getSource(); if (src == btnOK) { StockCUDialog.this.doOk(); } else if (src == btnCancel) { StockCUDialog.this.doCancel(); } }
7aafe4a0-dd20-426f-a698-197252b59e47
6
public static boolean singularSubject(String subject, String subjectIdentifier) { if (subjectIdentifier.equals("Verb gerund or present participle")) { if (subject.endsWith("s")) { return false; } } for (String s : SINGULAR_SUBJECT_TAGS) { if ...
24ccce98-f982-4696-aae6-ccfb51620a21
0
public void update(Observable arg0, Object arg1) { // TODO Auto-generated method stub }
93d6311d-5940-4e2c-b901-363ae97206d8
9
public void init() { JFrame frame = new JFrame("baseClient"); frame.setContentPane(this.mains); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); // startButton.addActionListener(new ActionListener() { // @Override // public void actionPerformed(ActionEvent e) ...
59b8c721-2cdb-4e9c-be50-8a7839da00c4
7
private int numForName(String nameOfDay) { int dayNum = 0; if (nameOfDay.equals("Sunday")) { dayNum = 1; } else if (nameOfDay.equals("Monday")) { dayNum = 2; } else if (nameOfDay.equals("Tuesday")) { dayNum = 3; } els...