method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
93422d51-57e5-41ba-b992-6651619d7eb0
1
public void info(Object... objs) { if (LoggingLevel.INFO.value >= currentGlobalLoggingLevel.value) { logger.info(Helpers.concat(objs)); } }
4362fddb-7b40-4398-8dfe-cc93ed2be73c
8
@Override public void finishSpringing(MOB target) { if((!invoker().mayIFight(target))||(target.phyStats().weight()<5)) target.location().show(target,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> float(s) gently into the pit!")); else { target.location().show(target,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> hit(s) the p...
f70a5346-0ca5-488d-bed7-afb56acc0dbf
3
@Override public void run() { startTime = System.currentTimeMillis(); while(isMatch){ if(!isPaused){ invokeTricks(); spawnEnemies(); checkPoints(); moveAll(); fireMissiles(); fireEnemiesLasers(); collisionCheck(); cheatCheck(); set...
9d762e95-18ed-4664-be21-2d2169759c16
8
static int f(int i,int j){ if(i==j)return 0; if(mem[i][j]>0)return mem[i][j]; int min=MAX_VALUE-1000000; for(int k=(i+1)%N;k!=(j+1)%N;k=(k+1)%N){ int val1,val2; if(k-1>=i)val1=sums[k-1]-(i>0?sums[i-1]:0); else val1=sums[N-1]-sums[i-1]+(k>0?sums[k-1]:0); if(j>=k)val2=sums[j]-(k>0?sums[k-1]:0); els...
1698909a-ed3d-4441-a0ae-80619c673447
4
public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new FileReader(args[0])); BufferedWriter bw = new BufferedWriter(new FileWriter("corpus.txt")); String temp; StringBuffer sb = new StringBuffer(); while(...
99a4fdda-2052-4fa7-aff8-b713497b53f7
0
public static int[] getChuk(int x,int z){ int[] res = new int[2]; res[0] = (int)(x / 16.0); res[1] = (int)(z / 16.0); return res; }
e003127d-d98f-42d5-ad4d-c2b454876d3f
3
public boolean hasStance(String playerName, String targetName) { boolean stance = false; if (playerName.equalsIgnoreCase(targetName)) return true; String SQL = "SELECT *" + " FROM " + tblStances + " WHERE `player` LIKE ?" + " AND `target` LIKE ?"; // boolean found = false; try { Connection con = getS...
8e6c5548-cf39-4247-94c9-b11eeba91e3f
5
@Override public boolean equals(Object o ) { if(o == null) return false; if(!(o instanceof Bauteil)) return false; Bauteil b = (Bauteil)o; if(b.getNr() != this.getNr()) return false; if(!b.getName().equals(this.getName())) r...
0bfcc1d7-ac2b-4b3c-ace9-81992f3530b4
3
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel l = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (hasFocus && table.isCellEditable(row, column)) return l; i...
4e9b6d73-50c4-4d3c-a305-cc2c2479f4eb
7
@Override public void move (Fleet fleet) { Field playField = null; board.setQuality(fleet); Collections.sort(remainingFields); if (preferableFields.isEmpty() || statusChanged) { if (statusChanged) { statusChanged = false; preferableFields.clear(); } //System.out.println("random zet"); playF...
7158f819-3a05-4975-b11c-bceb5a2aab18
7
public String getGoogleMapsXMLQuery(GeoAdresse pAdresse) throws UnsupportedEncodingException { // http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true // Removes whitespace between a word character and . or , String pattern = "(\\s+)";...
028c1cdd-b8fd-44a0-8dbe-69443330f135
5
private void asetaVKuva() { if (noppa == 2 || noppa == 3){ ImageIcon skelly = new ImageIcon(new ImageIcon(getClass().getResource("/skellyface.jpg")).getImage()); setIcon(skelly); } else if (noppa == 4 || noppa == 5){ ImageIcon orkki = new ImageIcon(new ImageIcon(getCl...
aef40abc-db9e-43e6-92fe-4a535534942b
0
public SwingWorker getTask() { return task; }
e786ef0b-c95c-4699-91c1-7fdd36c02991
2
public final synchronized double readDouble(){ this.inputType = true; String word=""; double dd=0.0D; if(!this.testFullLineT) this.enterLine(); word = nextWord(); if(!eof)dd = Double.parseDouble(word.trim()); ...
64d9728b-b3ed-4526-b161-fd9ba17107bf
6
public Vec3D getSkyColor(Entity par1Entity, float par2) { float var3 = this.getCelestialAngle(par2); float var4 = MathHelper.cos(var3 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; if (var4 < 0.0F) { var4 = 0.0F; } if (var4 > 1.0F) { var4 = ...
1bbf1eaf-ee5c-4ff3-a2dc-aac434600881
7
private int countConfs(int numMutable, int numRes, /*boolean ligPresent,*/ int strandMut[][], int numRotForRes[], int numRotForResNonPruned[]){ int numTotalRotRed = 0; numConfsTotal = BigInteger.valueOf(1); numConfsAboveLevel = new BigInteger[numRes]; int curNumRot; //Store the number of rotamers f...
e94cb844-a9a5-4da4-be42-35c4871feb6b
8
private boolean findNewCombinations(Combination combination) { boolean somethingChanged = false; Combination newCombination = null; for (int i = 0; i < combination.pitchers.size(); i++) { // ***** leerkippen if (combination.pitchers.get(i).isNotEmpty()) { newCombination = combination.clone(); newCo...
508dcff1-ed19-4fbd-8fbd-d27ba6c0e86a
8
public void updateBookText(Player p, ItemStack item) { ItemStack i = item == null ? p.getItemInHand() : item; if(!i.getType().equals(Material.WRITTEN_BOOK)) return; if(!i.getItemMeta().hasDisplayName()) return; if(!i.getItemMeta().getDisplayName().equals(ConfigHandler.prayItemName)) return; if(!(i.getItem...
bb74c2ca-29de-4eb8-85dd-73b76a473787
3
private static void chiSquareTestOnFile(Path path, HashFunction func) { Vector<Double> values = new Vector<Double>(); for (String w : new WordReader(path)) values.add((double) func.hashString(w) ); // Convert the Vector<Double> into an array of doubles int i = 0; double[] tab = new double[values.size()]; ...
7b861815-8c10-4e92-9ea2-a896f12c6487
1
private void loadPreviousFonts() { this.previousFonts = new ArrayList<Font>(); for (int i = this.startFrom; i <= this.endAt; i++) { this.previousFonts .add(this.document.getChildren().get(i).getFont()); } }
f9b44baf-e66e-4bd2-b928-8c3c7d0ac2ff
7
private void saveResults() throws ClusterException { ObjectFactory obf= new ObjectFactory(); ClusterDataType cdt= obf.createClusterDataType(); //set the creation date try { cdt.setXMLFileCreation(DateConverter.CurrentDateToXMLGregorianCalendar()); } catch (DateConverterException e) { throw new...
4841a59e-7a85-4915-b296-860afe29845f
2
@Override public CuentaBancaria findByCodigo(String CodigoCuentaCliente) { Session session = sessionFactory.openSession(); session.beginTransaction(); Query query = session.createQuery("SELECT cuentaBancaria FROM CuentaBancaria cuentaBancaria WHERE cuentaBancaria.sucursalBancaria.codigoSucu...
10e86318-906f-4496-9f8f-da05e46e1869
5
public Direction getOpposite() { switch (this) { case BOTTOM: return TOP; case LEFT: return RIGHT; case RIGHT: return LEFT; case TOP: return BOTTOM; case CENTER: default: return null; } }
fbf49a84-6de6-40f3-9be8-e36e15ef0a35
9
@Override public void modifyGenAbility(MOB mob, Ability me, int showFlag) throws IOException { if(mob.isMonster()) return; boolean ok=false; if((showFlag == -1) && (CMProps.getIntVar(CMProps.Int.EDITORTYPE)>0)) showFlag=-999; while((mob.session()!=null)&&(!mob.session().isStopped())&&(!ok)) { int s...
4c243d99-b8ff-4eba-a3b2-99a64d924370
6
public static boolean fileprocess(String downloadpath, String filepath, String []paras, String sn){ int errorcode=0;// print error code in the final output file; int errornum=17; // feature number String result=""; File downloadfile_r = new File(downloadpath+"\\emmc_test.txt"); File outputfile = new Fi...
e4a2f42e-536a-4c87-a3c8-99555d90f7cb
4
private static boolean handleTrue(String string) { switch (string.toLowerCase()) { case "on": case "true": case "yes": case "enable": return true; } // Otherwise if something is wrong, just assume we need it return false; }
090f1866-26cb-40f3-8e74-d3fbe93936df
8
public boolean ColliderWithPodiumUp(){ if((x>=0 && x<=Podium.WIDTH - WIDTH/2) && (y<=GameMain.GAME_HEIGHT_ASSUM - GameMain.DistanceBottomAndPodiumUp- HEIGHT/1.2 && y>= GameMain.GAME_HEIGHT_ASSUM - GameMain.DistanceBottomAndPodiumUp- HEIGHT)){ return true; } if((x>=GameMain.GAME_WIDTH + WIDTH/2 - Podium.WI...
f1ad1e09-8294-4da2-a31b-3c0153cfd527
8
@Override public void insertNext(T i, T j) { if (j.getParent() != null) throw new PromiscuousItemException(j, i.getParent()); if ((j.getNext() != null) || (j.getPrev() != null)) throw new PromiscuousItemException(j); if (i == null) { // insert as head j.setPrev(null); j.setNext(_firstItem); j....
94deb7b8-610b-42f5-9af7-de365c85036c
2
public ClueGame(String layout, String legend) { layoutFile = layout; legendFile = legend; try { board = new Board(layoutFile); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (BadConfigFormatException e) { // TODO Auto-generated catch block e....
e311729d-c427-44b4-8773-0e561eea638b
4
public void makeThreeSamplesRandomized() { samples.clear(); samples.add(new ArrayList<Integer>()); samples.add(new ArrayList<Integer>()); samples.add(new ArrayList<Integer>()); int countInitialSample = datas.size(); int countTrainingSample = (int) (countInitialSample * p...
5e099b02-c989-4861-9e9c-0be313532e0d
2
@Override public void onTurnStarted(TurnStartedEvent e) { if(missile != null && !missile.isActive()) { missile = null; } }
ecdfe851-3439-4541-822e-7612a5eb8794
6
private void configFindExtension(Method method) throws DaoGenerateException { MongoLimit mongoLimit = method.getAnnotation(MongoLimit.class); if (mongoLimit != null && mongoLimit.value() != -1) { limit = mongoLimit.value(); } MongoSkip mongoSkip = method.getAnnotation(MongoSkip.class); if (mongoSkip != nu...
9dd5061d-9c74-4d85-9074-6a21a67df302
1
private String replaceDate(final String log) { String formattedLog = new String(log); String regex = "(.*)(%d\\{)([^\\}]*)(\\})(.*)"; Date date = new Date(); while (formattedLog.matches(regex)) { String pattern = formattedLog.replaceFirst(regex, "$3"); SimpleDateFormat format = new SimpleDateFormat(patter...
da4d45be-d11f-4ce5-9f84-b3361f3f924a
3
@Override public void update(Observable o, Object arg) { if (presenter.getState().getStatus().equals("Rolling") && presenter.isPlayersTurn() && !timerStarted) { rollView.showModal(); rollView.startTimer(); timerStarted = true; } }
906d3ba5-f022-47d2-95ab-95834ab3c267
9
@EventHandler public void onSignDestroy(BlockBreakEvent e) { if(e.isCancelled()) return; Player p = e.getPlayer(); for(ServerSign rs : ServerSigns.getInstance().getSigns()) { if(rs.getSignLocation().getBlockX() == e.getBlock().getLocation().getBlockX()) { if(rs.getSignLocation().getBlockY() == e.getBlo...
c1fe5a71-c4f5-4c0d-8221-b88e3d16669a
6
@Override protected void setzeZustand(Graphics2D g) { if ((this.zMuster == 2) && (this.zFarbe.getTransparency() != 3)) { this.zFarbe = new Color(this.zFarbe.getRed(), this.zFarbe.getGreen(), this.zFarbe.getBlue(), 128); } else if ((this.zMuster != 2) && (this.zFarbe.getTransparency() !=...
7a139d27-4c24-4792-8486-29a63b976dae
3
@Override public String execute() throws Exception { try { Map session = ActionContext.getContext().getSession(); Campaign camp = (Campaign) session.get("campa"); CampaignDevice campdev = new CampaignDevice(camp, getPlatform()); getMyDao().getDbsession().sa...
88eb4da5-42b2-4364-a887-95b5faaa62bf
7
public static int guessAWTFontStyle(String name) { name = name.toLowerCase(); int decorations = 0; if (name.indexOf(AWT_STYLE_BOLD_ITAL) > 0 || name.indexOf(AWT_STYLE_DEMI_ITAL) > 0) { decorations |= java.awt.Font.BOLD | java.awt.Font.ITALIC; } else if (name.i...
b8a879a2-2665-4c59-a7ea-9ace42e39b0c
2
public void saveProjectAs(LayeredPanelList panelListIn){ fc = new JFileChooser(strProjectsDir); fc.showSaveDialog(compParent); try{ if(fc.getSelectedFile() != null){ this.strCurrentProject = fc.getSelectedFile().toString(); FileOutputStream fos = new ...
1265dbb6-af10-4202-bb42-5f15e638c607
4
public List<String> getBestViterbiPath() { Iterator<String> myIt=ViterbiEndpoint.keySet().iterator(); String myStr, bestStr=""; double bestVal=0; boolean entered=false; while (myIt.hasNext()) { myStr=myIt.next(); if (!entered || bestVal< ViterbiEndpoint.get(myStr)) {bestVal=ViterbiEndpoint.get(myS...
a6f158e5-3604-40c1-84e8-6af6835f7641
7
public boolean isSurroundClicked(int x, int y) { //first check the square is actually non-mine if (board[x][y].isMine()) return false; //the square must also have at least 1 adjacent mine for (int i = x - 1; i <= x + 1; i++) { for (int j = y - 1; j <= y + 1; j++) { //position must exist, and we don't co...
acd710a8-1b07-4186-901d-077cfb949ff3
4
private boolean delete(int i) { checkInvariants(); final E[] elements = this.elements; final int mask = elements.length - 1; final int h = head; final int t = tail; final int front = (i - h) & mask; final int back = (t - i) & mask; // Invariant: head <= i < tail mod circularity if (front >= ((t - h) & mask)...
6dc9dd67-d281-4598-a0ab-ca6ef916110f
8
public void addAbsenta(SituatieMaterieBaza sit, Node node) { TipAbsenta tip = null; Date data = null; NodeList childNodes = node.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node cNode = childNodes.item(i); if (cNode instanceof Element) { String content = cNode.getLastChild().ge...
8197def0-30fd-4247-b026-0713eaf0c3c3
4
private static Collection<Word> readWords(File file) throws IOException{ String ruWord = ""; String engWord = ""; String line; BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); Collection<Word> lWord = new ArrayList<Word>(); ...
f0b6f6cd-2300-491e-a9c7-0d61ca40a0f2
2
protected void forkJavaVM(String[] args) throws MojoExecutionException { try { final Commandline commandLine = new Commandline(); commandLine.setExecutable(getJavaExecutable().getAbsolutePath()); commandLine.setWorkingDirectory(workingDirectory.getAbsolutePath());...
b84d2ef9-8664-410c-b30f-84a73f6bc8da
6
public static int dehexchar(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - ('A' - 10); } if (c >= 'a' && c <= 'f') { return c - ('a' - 10); } return -1; }
aae1f3dd-5bb6-4042-be94-58eb0591f595
1
protected void awaitTermination() { try { this.completionLatch.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
7d8fae17-2acb-4ba2-9c4a-5b9e551f7627
9
@Override public String toString() { StringBuilder sb = new StringBuilder(); // Top line sb.append('+'); for (int x = 0; x < width; ++x) { sb.append("-+"); } sb.append('\n'); // Other lines for (int y = 0; y < height; ++y) { sb.append('|'); // Row content for (int x = 0; x < width; ++x) ...
d56b615a-42b4-4471-9fae-4a2e3ff6b99b
7
public boolean collectCourseInfo() { courseInfo.clear(); for (int i = 0; i < typeInfo.size(); i++) { int rowPoint = 0; while (true) { String line = ""; for (int j = 0; j < 5; j++) { String cell = null; if (couTable[i].getValueAt(rowPoint, j) == null || couTable[i].getValueAt(rowPoint,...
12a7aa4f-e2c3-4c70-9e72-fd08268b7b31
3
public void tick() { if (inputDelay > 0) inputDelay--; else if (input.attack.clicked || input.menu.clicked) { game.setMenu(new TitleMenu()); } }
19fbac25-dc58-4237-b534-e86db47b6136
5
@Override public V put(K key, V value) { V oldValue = null; int index = Math.abs(key.hashCode()) % SIZE; if(buckets[index] == null) { buckets[index] = new LinkedList<MapEntry<K, V>>(); } LinkedList<MapEntry<K, V>> bucket = buckets[index]; MapEntry<K, V> ...
2dfa205d-c6c2-4670-8590-93339b6d4962
7
@Override public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel) { final Item I=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_UNWORNONLY); if(I==null) return false; if(((I.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_VEGETATIO...
6d3d4e48-9f07-4a9d-af5c-c7df86adcb8d
4
public static LvalExpression addTempLocalVar(String name, Type type) { LvalExpression lvalExp = vars.getVar(name); if (lvalExp == null) { Lvalue lvalue = new VarLvalue(new Variable(name, type), false); vars.add(lvalue, false); lvalExp = vars.getVar(name); // add only the bit variables Vector<Lvalue...
d580ad95-2058-43d0-a8c7-f5d40d6944a7
6
public static ArrayList<ArrayList<Integer>> levelOrder(TreeNode root) { ArrayList<ArrayList<Integer>> resultLists = new ArrayList<ArrayList<Integer>>(); if (root == null) { return resultLists; } Stack<TreeNode> currentLevel = new Stack<TreeNode>(); currentLevel.push(root); while (!currentLevel.isEmpty())...
163d3aee-ac07-4181-97b1-92a85b72f14d
9
public ArrayList<RentTransaction> getAllRentTransaction(){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } ArrayList<RentTransaction> rentTran...
21d3b6c6-2c83-4f8f-9260-490643acaf67
8
private HashMap<String, Integer> NGramTiling(ArrayList<String> parsedSnippets) { HashMap<String, Integer> term_Freq_Map = new HashMap<String, Integer>(); String split[] = null; String complete = ""; //split into individual words for(String list_item: parsedSnippets){ complete = complete + " " + list_item...
e4aa36cf-f783-4d1b-8fc3-7fbf4b217401
4
public double square() throws TypeOverflowException { double p = perimeter(); p /= 2; double s = p; try { Iterator<Line> it = lineIterator(); while(it.hasNext()) { s *= p - it.next().distance(); } } catch (OverflowException e) { throw new TypeOverflowException(); } if (Double.isInfi...
681d06c1-1081-4751-b667-6c2ed3d3ab95
0
public CommandHandler getCommandHandler() { return commands; }
2b5b12a7-cf82-4358-9972-f894e6b9de50
1
public static void main(String[] args) { // TODO code application logic here long NOK = 2; for (int i = 3; i < 21; i++) { NOK = Evclid(NOK, i); } System.out.println(NOK); }
0faff2ac-9f81-494f-b2f3-ae52ac3406f7
0
@Override public String toString() { return "LABEL " + label; }
fb099dc0-db51-40aa-910c-e680220a32d1
3
public int popAt(int i) { if (stacks.size() == 0) return Integer.MIN_VALUE; if (stacks.get(i).isEmpty()) { stacks.remove(i); current--; return Integer.MAX_VALUE; } int elem = stacks.get(i).pop(); if (stacks.get(i).isEmpty()) { stacks.remove(i); current--; } return elem; }
39305ab2-b952-4bcf-bbc1-9ffe72f75bbf
6
public void setCHST(int nr, boolean value) { switch(nr){ case(1): if (value) CHST1.setBackground(Color.red); else CHST1.setBackground(Color.green); break; case(2): if (value) ...
84a50336-83cd-4525-ac3a-0e55917a30bc
0
@Id @Column(name = "name") public String getName() { return name; }
c46cfb0e-5b1c-4e73-bc17-d66774703966
9
@Override public Clip getSoundClip(ActionResult actionResult) { if (moveClip == null) { moveClip = openClip(WavPlayer.SOUND_MOVE); } if (treasureClip == null) { treasureClip = openClip(WavPlayer.SOUND_TREASURE); } if (winClip == null) { ...
b858b4ad-cdf9-42ad-a690-14b922398d29
9
private void checkStatementMap() throws DataException { for (final Map.Entry<Statement, Statement> statementEntry: statementMap.entrySet()) { final Statement parameterStatement = statementEntry.getKey(); final Statement statement = statementEntry.getValue(); final Matcher matcher = expressionFactory.createMa...
dc3398f6-8af5-469f-b5e3-b43b1d6ef299
6
private void contactServer(InetAddress server, Transition transition) { Socket socket = null; try { socket = new Socket(server, Statics.INTER_SERVER_COM_PORT); ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); out.flush(); ObjectInputStream in = new ObjectInputStream(socket.getI...
fa4e48a2-2ce2-497f-a501-48f49897d2b5
4
protected void notifyReceivedHandlers(Message message, IMessageReceivedHandler caller) { if (receivedHandlers.size() > 0) for(IMessageReceivedHandler imrh: receivedHandlers) if (imrh != caller){ try{ imrh.onMessageReceived(message); } catch(Exception e){ } } }
03b80fec-25cb-41b5-979e-674a1bbe8bd4
5
@Override public String getToolTipText(MouseEvent e) { String tip = getSelectionCellsHandler().getToolTipText(e); if (tip == null) { Object cell = getCellAt(e.getX(), e.getY()); if (cell != null) { if (hitFoldingIcon(cell, e.getX(), e.getY())) { tip = mxResources.get("collapse...
4f36eb6e-93e3-479f-a915-180252a829fa
6
private static void growSeedAdd(Cluster cluster, Map<String, ArrayList<String>> adjList, Set<String> seedsToProcess) { List<String> borderMembList = ClusterServices.getBordMemb(adjList, cluster); Queue<String> nodesToTryBorder = new LinkedList<>(); nodesToTryBorder.addAll(borderMembList); while (!nodesT...
72d7c97e-ece4-45aa-b50d-dce49485db36
4
public void remove(int i, int j) throws BadLocationException { int k = getSelectionStart(); if (k > 0) k--; String s = getMatch(getText(0, k)); if (!isStrict && s == null) { super.remove(i, j); } else { super.remove(0, getLength()); super.insertString(0, s, null); } try { setSel...
f9f7b27b-ea34-485c-b474-dd7ffc300a55
2
private void showMatchingBodyparts(UpgradeType type){ this.bodypartPanel.removeAll(); ArrayList<BodyPart> bodyparts = this.game.getUpgradeManager().getBodypartsByType(type); for(BodyPart b : bodyparts){ BodypartIconPanel bpip = new BodypartIconPanel(b); bpip.addMouseListener(this); if(b.isUsed()){ ...
96721000-a036-469f-9c3e-cdc3964f3b04
7
public static final void populateConfigData (AnalyticsConfigData data) { data.setEncoding(System.getProperty("file.encoding")); String region = System.getProperty("user.region"); if (region == null) { region = System.getProperty("user.country"); } data.setUserLanguage...
97700743-54ac-4f63-95d3-d9900af67760
9
public void validate(Property terminologyProperty) { if (this.type != null && !this.type.isEmpty()) { if (!this.type.equalsIgnoreCase(terminologyProperty.getType())) { logger.warn("Value type (" + this.type + ") does not match the one given in the terminology(" ...
bfce9190-6442-4356-8782-c745ac351986
7
private void toggleRemoveSelection(TreePath path){ Stack<TreePath> stack = new Stack<TreePath>(); TreePath parent = path.getParentPath(); while(parent!=null && !isPathSelected(parent)){ stack.push(parent); parent = parent.getParentPath(); } if(parent!=null...
e2112ed6-63c5-4a60-9fee-f4f47dbc3d2b
8
public void setCam(int xCam, int yCam) { xCam /= distance; yCam /= distance; int xCamD = this.xCam - xCam; int yCamD = this.yCam - yCam; this.xCam = xCam; this.yCam = yCam; g.setComposite(AlphaComposite.Src); g.copyArea(0, 0, width, height, xCamD, yCamD); if (xCamD < 0) { if (xCamD < -width) x...
f06b6a28-bc1d-46d4-ac42-545ca9453d2f
3
@Override public GameState[] allActions(GameState state, Card card, int time) { GameState[] states = new GameState[1]; states[0] = state; if(time == Time.DAY) { //Do nothing } else if(time == Time.DUSK) { PickTreasure temp = new PickTreasure(); states = temp.allActions(state, card, time); }...
1d389a7e-8f7b-4668-a42a-9d205b5e55c5
1
private void volgendeOnderdeel() throws IOException { spel.volgendeOnderdeel(); huidigeOnderdeel = spel.getHuidigeOnderdeel(); if (huidigeOnderdeel != null) { middenvlak.removeAll(); ImagePanel plaatje = new ImagePanel(huidigeOnderdeel.getPlaatje()); plaatje.setBorder(new EtchedBorder(EtchedBorder.RAISE...
e7c1fb2f-c79d-48fe-aa07-cfee692bebd8
2
public WeaponList() { setTitle("Weapon List"); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setBounds(100, 100, 325, 500); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLa...
6084e526-77ec-40d3-9211-79f1889d9572
7
public synchronized DataInputStream getChunkDataInputStream(int var1, int var2) { if(this.outOfBounds(var1, var2)) { this.debugln("READ", var1, var2, "out of bounds"); return null; } else { try { int var3 = this.getOffset(var1, var2); if(var3 == 0) { ...
80e00959-79f0-480d-8d46-490bc22bfaf5
3
public ArrayList<String> getBannedAltAccounts( String player ) throws SQLException { ArrayList<String> accounts = getAltAccounts( player ); boolean check = false; for ( String p : getAltAccounts( player ) ) { if ( isPlayerBanned( p ) ) { check = true; ...
7898a106-3ba3-47f3-8725-a7095a682561
4
private boolean noMoreTableCards() { /* * Stage 8 (6 Marks) */ // TODO: i suck at this game, so no chance to test if this methos works // or not. maybe some other day for (int i = 0; i < cards.length; i++) for (int j = 0; j < cards[i].length; j++) if (cards[i][j] != null && !cards[i][j].getHasBeenR...
ce1e3bc4-0bf7-47b6-b047-3445f0de507f
4
private void fillInTaskOnAssetList(Asset asset) { listOfTasks.clear(); listTasksList.repaint(); ResultSet tasksOnAssetListResultSet = null; Statement statement; try { statement = connection.createStatement(); tasksOnAssetListResultSet = stat...
439a4879-56ad-4319-a6c0-720c5b1b44e1
5
public void checkSign(String file, String encrypted_file) throws Exception { RandomAccessFile PGP_file = new RandomAccessFile(encrypted_file, "r"); int len = -1; byte[] arr = new byte[2]; while ((len = PGP_file.read(arr)) != -1 && (arr[0] & 0xff) != SP_TAG) { //System.out.pr...
b7724b91-d9ed-4de4-a58f-dab81d91435f
1
public boolean isClicked() { return !wasDown && isDown; }
4a5353eb-7d77-4b8a-a7cd-f30d1514ce1b
1
public int sincronizaTodo(){ try { // logger.info(" ======== ITEM ACTUALIZADO =========================== "); System.out.println(" =============== CLIENTES ========================================== "); logger.info(" ======================================================= "); ...
c124083f-0f00-46ed-8855-e88b067c9a6c
3
private String getBinaryFromCell(int row, int column) { String binary = ""; int newValue; for (int r = -1; r < 2; r++) { for (int c = -1; c < 2; c++) { newValue = cellsValue[row + r][column + c] < 0 ? 1 : 0; binary = binary + newValue; ...
edf7b73e-7250-46fc-8021-6f589f8d6b96
2
@Override public boolean match(PathInput input) { if (input.end()) { return isOptional(); } else { if (input.isBind()) { bind(input, input.value()); } input.next(); return true; } }
007d6e6e-95ae-4410-a8e2-bb87963af5f0
5
public VertexSet getVertexSetNeighbourhood(VertexSet S){ VertexSet vertexSetNeighbourhood = new VertexSet(); VertexSet vertexSetTemp = null; Iterator<City> cityIterator = S.iterator(); while (cityIterator.hasNext()){ vertexSetTemp = getNeighbourhood(cityIterator.next())...
25115b03-cd57-42a7-bc91-903283fdc6d1
9
protected Element invokeWriteToXML(Element parent, Object o, String name) throws Exception { Method method; Class[] methodClasses; Object[] methodArgs; boolean array; Element node; boolean useDefault; node = null; met...
b78d4cdc-20a5-4224-916b-0411599be7a1
2
public void checkCollisions(){ // loop all pickables for (Iterator<Pickable> iterator = meds.iterator(); iterator.hasNext(); ) { Pickable p = iterator.next(); if(Character.getBounds().intersects(p.getBounds())){ // pickup med Sounds.pickPill.play(); iterator.remove(); timer = 10000; alpha =...
206d5bc2-f92c-4185-ac7f-a4736029282c
9
public Entity getEntityAt(int dir, int x, int y) { for(Entity e : entities) { if(e.x == x && e.y == y && ((e instanceof NPC) || (e instanceof Door))) return e; } for(Entity e : entities) { if(e.x == x && e.y == y && !(e instanceof Player)) return e; } return null; }
c0eff60b-ad7b-43e3-ab16-48c3d2112eb1
7
public U1A7_PowersView(SingleFrameApplication app) { super(app); initComponents(); // status bar initialization - message timeout, idle icon and busy animation, etc ResourceMap resourceMap = getResourceMap(); int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout...
60f3a7d1-1139-4654-a026-144014094910
7
@Override public void paintComponent(Graphics g) { if (point != null) { if (tool == Tool.COLORWHEEL && colorWheel != null) { if (icon) { g.drawImage(colorWheel, point.x - 10, point.y - 10, 20, 20, null); } else { g.drawImage(colorWheel, point.x - 100, point.y ...
83407c47-3390-49a4-bd02-d6a62a2b7444
2
public void pastCrowl2(){ DatastoreService datastore = DatastoreServiceFactory .getDatastoreService(); Entity past_string = null; try { Key key = KeyFactory.createKey("past_string", "onlyOne"); past_string = datastore.get(key); } catch (Throwable t) { } past_string.setProperty("text",new Text(new ...
19d5a47e-9d8c-4082-bbdf-488a0d16ca33
7
static int kmpSearch(String pat, String text) { int n = text.length(); int m = pat.length(); int[] trans = new int[m + 1]; // オートマトンの遷移テーブルを作る trans[0] = -1; for (int i = 2; i <= m; i++) { char c = pat.charAt(i - 1); int fall = trans[i - 1]; w...
aed83b21-aab8-4ce3-8f96-522a9b693de6
4
public static void runServer() throws IOException { ServerSocket chatServer = null; try { System.out.println("Waiting for clients on port: " + local_port); chatServer = new ServerSocket(local_port); } catch (IOException e) { System.err.println("Could not listen on port: " + local_port); Syste...
a0d15a96-cf39-4a15-b7b9-bff9c3070fb0
9
public void close() { boolean isUnderlyingConnectionClosed; try { isUnderlyingConnectionClosed = !conn.isConnected(); } catch (Exception e) { try { pool.invalidateObject(this); // XXX should be guarded to happen at most once } catch (IllegalSta...
2de7aed0-c01c-4f1f-8dc5-d18650670841
7
public void SortPlayerPoints() { Collections.sort(playerVector, (Player p1, Player p2) -> { if (p1.getPosition().getPosID() == Position.PosID.GOALIE) { if (p2.getPosition().getPosID() == Position.PosID.GOALIE) { int shots = p1.getAssists() + p1.getGoals(); float perc1 = (shots == 0 ? 0 : (100 - (...
7ca036e5-d4a7-4f00-ae01-58d93f4e5d28
6
public void actionPerformed(ActionEvent arg0) { if(arg0.getSource() == cancel) { setVisible(false); clear(); } else if(arg0.getSource() == save) { if(parent == util.quest.sp) { if(loaded == null) { util.quest.slist.getSelectedValue().addAction(create()); util.quest.sp.delete.set...
1c5c6aa8-59e0-4e9e-8d38-6736f0db78cb
3
protected boolean setTerrain(int cellId, TerrainTypes terrain) { if ((cellId >= 0) && (cellId < countCells())) { if (this.terrain[cellId] != terrain) { this.terrain[cellId] = terrain; return true; } } return false; }