method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
3ccb49ed-2f20-4891-b5d3-d725cd23a940
9
private void runLive() { TalkerTextWork localTalkerTextWork = this.dd.getTalkerTextWork(); TalkerLineWork localTalkerLineWork = this.dd.getTalkerLineWork(); long l1 = System.currentTimeMillis(); long l2 = l1 + 86400000L; long l3 = l1 + 3600000L; while (this.live) try { Thre...
860fec96-4bce-497c-8dea-62ee52c86130
2
static double normalizeAngle(double a) { while (a < 0) a += 2*Math.PI; while (a >= 2*Math.PI) a -= 2*Math.PI; return a; }
1e8173db-9cac-480a-aa1a-318867d96fa5
9
public void searchAvailableCells(){ int numB1 = 1 ; int numB2 = 1 ; int numB3 = 1 ; int numB4 = 1 ; for (int i = 0; i < 28; i++) { if (i < 7) { if (this.testAvailabe(numB1 * -1, numB1, i)){ numB1++; }else{ this.FilterAvailable(i, 7); i = 7 ; continue; } ...
c3035d05-7d00-4644-b1f8-6bdddb5619df
0
public CheckResultMessage pass(String message) { return new CheckResultMessage(message); }
4f2b798d-83b5-4dc2-a4f2-cff93d311223
4
public void generateInOrderWire() { recursiveTraverse(this.root, new TraverseCallback() { private TreeNode previous; public void action(TreeNode current) { if (current.hasNoLeftSide()) { if (previous != null) { current.leftChild = previous; } current.leftIsWire = true; } ...
3494425e-7237-4503-a61e-da521304e9e9
8
private static String encrypt(final int[] key, final String text) { String encryptedText = ""; logger.log(Level.INFO, "Plain text: {0}", text); logger.log(Level.FINE, "Key: {0}", Arrays.toString(key)); char temp[][] = new char[text.length()][key.length]; int order[] = new int[key...
b71f7406-dd14-4f9b-bfb4-9aac2c976ae7
6
private void checkCollision(){ if(r.intersects(StartingClass.hb.r)){ visible=false; if(StartingClass.hb.health > 0){ StartingClass.hb.health -= 1; } if(StartingClass.hb.health == 0){ StartingClass.hb.setCenterX(-100); StartingClass.score += 5; } } if(r.intersects(StartingClass.hb...
baaa9ba8-c1dd-40a4-9478-6df4a9aaf8fb
3
public YAMLConfig(InputStream configStream, File configFile, int comments, JavaPlugin plugin) { this.comments = comments; this.manager = new YAMLConfigManager(plugin); this.file = configFile; try { this.config = YamlConfiguration.loadConfiguration(new InputStreamReader(confi...
8efcd11f-413f-4dfa-83ae-d847ca289702
0
public AutomatonChecker() { }
266eb7a8-4372-48da-bdc8-3cf9a1693754
0
@Override public void resetSettings() { settings.setDefault(); }
6dd96745-c70d-463c-9774-83e523790ef6
8
private void batchEstimateDataAndMemory(boolean useRuntimeMaxJvmHeap, String outputDir, int reduceBase) throws IOException { //File mDataOutputFile = new File(outputDir, "eDataMappers.txt"); //File rDataOutputFile = new File(outputDir, "eDataReducers.txt"); File mJvmOutputFile = new File(outputDir, "eJvmMapper...
6e718dcb-8bd3-447c-a3ff-a70f10d6d51d
8
public static void main(String[] args) { // TODO Auto-generated method stub int n = Integer.parseInt(args[0]); //n is between 3 and 1000; int k = Integer.parseInt(args[1]); //k is an integer between 0 and n; int v = Integer.parseInt(args[2]); //v is in {0,1,2,3}. N = n; K = k; /...
a7589fa6-d9e7-4c95-8d6c-f767e14a4141
6
public static void Command(CommandSender sender) { if(sender.hasPermission("gm.adventure.all")) { for(Player player : Bukkit.getServer().getOnlinePlayers()) { if (player.getGameMode() != GameMode.ADVENTURE) { player.setGameMode(GameMode.ADVENTURE); if(sender instanceof Player) { ...
e12cd442-8be7-405b-8f78-88f86263ab37
6
private void create(int[] init, Color bg, String fieldTitle) { setPreferredSize(new Dimension(GUIConstants.DEFAULT_FIELD_WIDTH, FIELDHEIGHT)); setBackground(bg); setBorder(BorderFactory.createTitledBorder(fieldTitle)); setLayout(new VerticalLayout(0, VerticalLayout.CENTER)); setT...
6cf0df85-e667-455a-9ffa-e058393c7cc6
2
@Override protected void startServerLoop() { Runnable thread = new Runnable(){ @Override public void run() { while(running){ try { Thread.sleep(GAMEINTERVAL); updateServerGame(); } catch (InterruptedException e) { e.printStackTrace(); } } } }; (new Thread(thread...
6d16ead3-d9f8-4579-b4aa-45a869817dcd
8
@Override MessageExoType getMessageExoType(String arrow) { if (arrow.contains("<")) { return MessageExoType.FROM_RIGHT; } if (arrow.contains(">")) { return MessageExoType.TO_RIGHT; } if (arrow.startsWith("/") || arrow.startsWith("\\")) { return MessageExoType.FROM_RIGHT; } if (arrow.endsWith("\\...
c0abac3c-3ae0-47cc-a8c3-4a30f79e2c27
8
private static ValuePtr readPtr(CompileInfo ci, String p) { if(p.charAt(0)!='['){ makeDiagnostic(ci, Kind.ERROR, "expect.ptr.start");//$NON-NLS-1$ }else if(p.charAt(p.length()-1)!=']'){ makeDiagnostic(ci, Kind.ERROR, "expect.ptr.end");//$NON-NLS-1$ } List<MiniScriptValue> values = new ArrayList<MiniScript...
3fa9a4a5-58a6-460f-88cb-1b2405bf3c08
1
public JPanel getLocaleBtnMenu() { if (!isInitialized()) { IllegalStateException e = new IllegalStateException("Call init first!"); throw e; } return this.localeBtn; }
9993748f-ca0f-40ed-ad8f-4777a5f8493f
4
public static CardStack createFromFile(String fileName) { InputStreamReader inStream; try { inStream = new InputStreamReader(new FileInputStream(fileName), CHARSET); } catch(IOException e) { return null; } BufferedReader bufferedReader = new BufferedReader(inStream); ArrayList<Card> newStack = new ArrayList<...
87bbc1b9-5b4e-428a-8b4d-b958b69c621e
3
public int longestValidParentheses_2(String s) { // Note: The Solution object is instantiated only once and is reused by // each test case. Stack<Integer> stack = new Stack<Integer>(); int max = 0; int count = 0; for(int i = 0; i < s.length(); ++i){ if(s.charA...
846ba8dc-d5c3-46ee-ab8d-41b63c6289c5
0
@Override public boolean evaluate(T2 obj) throws Exception { return true; }
06513cc5-a369-4cae-bb49-57c7e6b1c637
4
private boolean xIntersects(Vec3D var1) { return var1 == null?false:var1.y >= this.y0 && var1.y <= this.y1 && var1.z >= this.z0 && var1.z <= this.z1; }
e7c3fcff-ddd4-437f-81b7-5a1da23744b8
7
public void update(int delta) { if(!entityAddList.isEmpty()) { for(Entity ent : entityAddList) { entityList.add(ent); } entityAddList.clear(); } if(!entityRemoveList.isEmpty()) { for(Entity ent : entityRemoveList) { if(ent instanceof EntityPlayer) this.lose(); entityList...
2a7de2e9-7d1a-49b9-8b5e-2097e6979f6c
0
@BeforeClass public static void setUpClass() { }
bd5e5c0f-b841-48b5-a449-3b15bf1ff39e
8
@Override public String perform(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); String status = "Client not added, did you fill all required field?..."; //** 1. Retrieve the Form Input (Name-Value Pairs) from the HTTP Request *** String fName = request...
871151b1-38e6-4f6b-81a7-4ecde2e2f0b6
1
public boolean ModificarPunto(Punto p){ if (p!=null) { cx.Modificar(p); return true; }else { return false; } }
0960b603-3673-4a40-868f-59acf1c301fd
4
public DungeonFloor() { Random random = new Random(1000); int w = 6; int h = 8; double ws = 1.0 / (w); double hs = 1.0 / (h); for (int x = 0; x < w; x++) { for (int z = 0; z < w; z++) { for (int y = 0; y < h; y++) { double x...
8ccbcae6-0255-4db7-bf2f-1dfc5a594a67
3
public static String getFlightModeName(eMode mode) { if (mode == eMode.NORMAL_MODE) return "NORMAL"; if (mode == eMode.MUHA_MODE) return "MUHA"; if (mode == eMode.TAG_MODE) return "TAG"; return "UNKNOWN"; }
ffa1a72f-850d-4bf8-b973-a2b5cdf8692b
5
public static boolean onSegment(Point2d p1, Point2d p2, Point2d Q){ if(Q.sub(p1).crossProduct(p2.sub(p1))== 0 && Math.min(p1.x, p2.x)<=Q.x && Math.max(p1.x, p2.x)>=Q.x && Math.min(p1.y, p2.y)<=Q.y && Math.max(p1.y, p2.y)>=Q.y) ...
51bae433-897a-47bc-ae09-3739ac0b8a84
4
public void ShowAsBit() { System.out.print("["); for (int i = 0; i < _ListaDeObjetos.size(); i++) { if(_ListaDeObjetos.get(i) != null) { System.out.print("1"); if(i + 1 < _ListaDeObjetos.size()) { Sy...
b9faebbf-7e2b-45b2-8f2a-3c4b90b4729e
7
public static void writeToCSV(String fileName, List<HashMap> dataMaps) { try (FileWriter writer = new FileWriter(fileName)) { System.out.println("Writing to file " + fileName); writer.append("_type,_id,name,type,latitude,longitude\n"); String typeS; String id; ...
fffb8948-f517-4da4-a19d-ff311a05c5ea
4
private int getMaxSizeY(final JComponent[] components) { int max = 0; for (final JComponent component : components) { final Dimension dimension = component.getMaximumSize(); if (dimension != null) { if ((dimension.height > max) && (dimension.height != Integer.MAX_VALUE)) { max = dimension.hei...
a453f603-9e38-4906-b16f-d2075e06c388
2
public boolean isSet(String path) { Configuration root = getRoot(); if (root == null) { return false; } if (root.options().copyDefaults()) { return contains(path); } return get(path, null) != null; }
090e004c-dadd-4036-9e31-d56bab28ae01
7
private Boolean load_last() { // We initialize pointer to root of document try { settings = document.getRootElement(); List listsections = settings.getChildren(); if (listsections != null){ Iterator i = listsections.iterator(); while(i.hasNext()){ Element current = (Element)i.n...
191cda2a-a59a-4974-b866-f41e4ec0fb1a
8
public void crackShotEventListener(WeaponDamageEntityEvent e){ if (e.isCancelled() || (e.getDamage() == 0)){return;} Player dmgr = e.getPlayer(); if(e.getVictim() instanceof Player){ Player tagged = (Player) e.getVictim(); if(plugin.entityListener.disallowedWorld(tagged.getWorld().getName())){...
5d988290-c6c9-48ff-b17c-a5e75f98e850
4
@Override public void update(){ super.update(); if(prevX != this.getX() || prevY != this.getY() || prevZ != this.getZ() || prevAngle != this.getAngle()){ this.updateRenderPosition(); this.syncPreviousPosition(); } }
cdd3713e-76d9-444d-badf-0600f694a4b7
4
private void isiIC() { int count = 0; this.copyPapan[9][2]="C"; this.copyPapan[2][7]="C"; this.copyPapan[3][9]="C"; count=3; for (int i = 0; i < this.banyakIC; i++) { Random randrow = new Random(); Random randcol = new Random(); int row...
df61b75c-1959-46b2-8682-75769ad84f99
1
private static int inputCustomerChoice() { String choice = null; if (scanner.hasNext()) { choice = scanner.nextLine(); } isValidChoice(choice); return Integer.parseInt(choice); }
7f77c185-e0e0-4b09-a56b-c8c169b22c86
7
public void extractFeature(List<Article> artList, boolean isTraining) { final int SENT_LEN_MAX_CUTOFF = 15; final int SENT_LEN_MIN_CUTTOFF = 3; int sentCount = 0; for (Article art : artList) { if (sentCount >= 100) { return; } if (art.getLabel().equals("1")) { continue; } for (String sen...
bfb8a2f5-a890-45fe-92d9-361fba4e8c3e
7
Class323(AbstractToolkit var_ha, int i, boolean bool, Component component) { aBoolean4037 = false; aClass105Array4042 = new RasterToolkit[256]; anIntArray4039 = new int[256]; Font font = new Font("Helvetica", bool ? 1 : 0, i); FontMetrics fontmetrics = component.getFontMetrics(font); for (int i_19_ = 0; i_19_ < a...
3a0af0bc-ced9-4140-b07b-4f122e6c0514
8
public boolean getTalkable(Player other) { if ((other.getCurrentY()+1) == getCurrentY()) { if ((other.getCurrentX()) == getCurrentX()) { return true; } } if ((other.getCurrentY()-1) == getCurrentY()) { if ((other.getCurrentX()) == getCurrentX()) { return true; } ...
b1b02f99-7638-491e-95ee-07a13e137824
4
public String endSection(Marker marker) { StringBuilder sb = new StringBuilder(); // Add header? if (showHeader && (sectionNum == 0)) { String header = toStringHeader(); if (!header.isEmpty()) { sb.append(header); sb.append("\n"); } } // Add current line sb.append(toString()); sectionN...
88ff4e4a-3251-45f4-9047-32d3d3c64563
7
@Override public int print(Graphics pg, PageFormat pageFormat, int pageIndex) throws PrinterException { pg.translate((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY()); int wPage = 0; int hPage = 0; if (pageFormat.getOrientation() == PageFormat.LANDSCAPE) { wPage = (int)pageFormat.get...
4bdac6f7-3dc9-4af9-abc4-d0a2d21dc116
1
private static String generateQuery(String query, Object... parameters) { assertThatParamsCanBeBound(query, parameters); int paramIndex = 0; while (query.contains(TOKEN)) { Object parameter = parameters[paramIndex++]; query = bindParamIntoQuery(query, parameter); } return query; }
8daaa8a0-d28e-4a11-bb27-a7c899682a6f
5
public void dealerWon() { if (dealerHand.getHandRanks().contains("Ace") && (dealerHand.getHandRanks().contains("Ten") || dealerHand .getHandRanks().contains("Jack")) || dealerHand.getHandRanks().contains("Queen") || dealerHand.getHandRanks().contains("King")) { System.out.println("Dealer got...
c8406225-57e2-4ef5-bf61-0a3e654d9771
9
private Token buildWordToken(String word){ TokenType tt = null; switch(word.toUpperCase()) { case "IF": tt = TokenType.IF_DECL; break; case "ELSE": tt = TokenType.ELSE_DECL; break; case "WHILE": tt = TokenType.WHILE_DECL; break; case "INT": tt = TokenType.INT_TYPE; break; case...
9b2c2256-b93a-4f63-a3cf-1487de266429
8
private void putRequiredOption( Collection<String> precedentSynonyms, OptionSpec<?> required, Map<Collection<String>, Set<OptionSpec<?>>> target ) { for ( String each : precedentSynonyms ) { AbstractOptionSpec<?> spec = specFor( each ); if ( spec == null ) throw ...
48fd8e19-7b80-46eb-aaab-4d5ace9433af
4
public boolean inside(MultiColor c) { for (int i = 0; i < min.length; i++) { if (c.data[i] == -1) continue; if (c.data[i] < min[i]) return false; if (c.data[i] > max[i]) return fal...
fd319168-d9cf-4fbb-b455-7c38f71404f0
4
public int calculateLowestCost() { locked = true; // System.out.println(name + " is locked"); int lowestCostStorePrice; int lowestFusionCost; if (storePricesList.size() > 0) { lowestCostStorePrice = getLowestStorePrice(); if (lowestCostStorePrice < lowest...
4b970345-1d71-419e-a669-b461931c7793
7
void draw( ChartGraphics g, int[] xValues, double[] stackValues, int lastPlotType ) throws RrdException { g.setColor( color ); g.setStroke( lineWidth != 1 ? new BasicStroke(lineWidth) : DEF_LINE_STROKE ); Graphics2D gd = g.getGraphics(); int len = values.length; double value; int ax = 0, ay = 0, nx = ...
51f23642-a7c1-40b3-b416-744d3db67754
1
private void setBalance(BigInteger balance) throws IllegalArgumentException { if (! this.canHaveAsBalance(balance)) throw new IllegalArgumentException(); this.balance = balance; }
ade533a6-98e5-4a10-a1f0-94c50a536950
2
public State getStateByValue(String value){ for(State state : states){ if(state.mathByValue(value)) return state; } return null; }
45afe964-0d9a-4ca0-b206-7df7ca7645d6
0
@Override public void documentRemoved(DocumentRepositoryEvent e) {}
605287ca-464e-4428-bbaa-130985f6db41
7
private void processScalar() throws IOException { ScalarEvent ev = (ScalarEvent) event; if (analysis == null) { analysis = analyzeScalar(ev.getValue()); } if (style == null) { style = chooseScalarStyle(); } style = options.calculateScalarStyle(anal...
6c2730bc-03f6-4b9a-9320-67acbe56cade
3
public void stop() { if (this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) { throw new IllegalStateException("Stopwatch is not running. "); } if (this.runningState == STATE_RUNNING) { this.stopTime = System.currentTimeMillis(); } this.runningState = STATE_STOPPED; }
1e4b5f35-63db-46bf-b9f2-edd60f2ed1c5
8
public int get(byte[] data, int offset, int len) { if (len == 0) return 0; int dataLen = 0; synchronized (signal) { // see if we have enough data while (getAvailable() <= 0) { if (eof) return (-1); try { signal.wait(1000); } catch ...
7c66713a-5cff-41a8-bec5-c67ddefee259
1
private void onClear(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onClear if (spawnMenuItem.isEnabled()) { toggler.setState(false); game.reset(); repaint(); } }//GEN-LAST:event_onClear
07146046-9eb7-49a4-a730-3631c9efd86b
9
@SuppressWarnings("unchecked") @Override public void init() throws Exception { endpoint.setName(getName()); endpoint.setHandler(cHandler); // Verify the validity of the configured socket factory try { if (isSSLEnabled()) { sslImplementation = (SSLImplementation<NioChannel>) SSLImplementation .ge...
25f01ac5-d794-4832-9dd2-b595bbb0201f
7
@SuppressWarnings("deprecation") @EventHandler public void onPlayerMove(PlayerMoveEvent event) { Player player = event.getPlayer(); // Player only moved to look around but didn't walk if (event.getFrom().getBlockX() == event.getTo().getBlockX() && event.getFrom().getBlockY() == event.getTo().getBlockY() ...
c9000c8f-532d-4c5b-b0c5-174162743ddc
3
public void toggleEditingMode() { if(!Main.editingMode) { mySea.renderEditingShip = false; theirSea.renderEditingShip = false; } else { if(myTurnEditing) mySea.renderEditingShip = true; else theirSea.renderEditingShip = true; } if(!Main.editingMode) { mySea.reset(); theirSe...
5b031857-8a5e-47e0-8dc5-0ca2e4f3cc92
5
@Override public int hashCode() { int prime = 31; int prime2 = 47; int tId = this.projectId; int tFCount = this.recordCount; int tYCoord = this.firstYCoord; int tFHeight = this.fieldHeight; int tTitle; if (tId == 0) { tId = prime; }...
9cc75126-8acf-4184-930a-935d7c544975
2
public double[] rawPersonVariances(){ if(!this.dataPreprocessed)this.preprocessData(); if(!this.variancesCalculated)this.meansAndVariances(); return this.rawPersonVariances; }
86197b90-24a9-419c-affe-2940057222dd
4
public static double rayleighInverseCDF(double beta, double prob) { if (prob < 0.0 || prob > 1.0) throw new IllegalArgumentException("Entered cdf value, " + prob + ", must lie between 0 and 1 inclusive"); double icdf = 0.0D; if (prob == 0.0) { icdf = 0.0; } else { if (prob == 1.0) { icdf = Double.POS...
1ef695f7-e72d-4f8b-b67b-d1835c90c2d2
2
@Override public boolean isSameElementAs(Element<?> element) { ClassElement other = element.adaptTo(ClassElement.class); if (other == null) { return false; } return getClassName().equals(other.getClassName()); }
51d8f0f3-15c9-47ba-9657-1f3d6b9c4f62
5
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String login = request.getParameter("login"); String password = request.getParameter("password"); String action = request.getParameter("action") == null ? "...
8f3eba31-52ad-46ce-8d5e-fd9c2abd8454
5
private void comparePDFHolder(PDFHolder pdfHolder1, PDFHolder pdfHolder2) { for (PDFPageHolder pdfPageHolder1 : pdfHolder1.getPageHolders()) { // get the same page from the other pdf document PDFPageHolder pdfPageHolder2 = pdfHolder2.getPageHolder(pdfPageHolder1.getPageNumber()); if (pdfPageHolder2 == n...
d4c77b22-644e-45d1-8b2f-ae09794e8bba
8
public int raw_seek(int pos) { if (!seekable) { return (-1); // don't dump machine if we can't seek } if (pos < 0 || pos > offsets[links]) { //goto seek_error; pcm_offset = -1; decode_clear(); return -1; } // clear out ...
96ad70e3-2472-4807-95c7-d2ecbf7bd975
7
private final void nullifyVideoFileTempData() { synchronized (this.videoFileTempLock) { if (this.videoFileTempGenerator != null) { this.videoFileTempGenerator.cancel(); this.videoFileTempIsGenerating = false; } if (this.videoFileTemp != null) { this.videoFileTemp.delete(); this.videoFileTemp ...
b64790b1-8f03-4de2-8359-47294c9cc66d
5
public Behaviour jobFor(Actor actor) { final Repairs b = Repairs.getNextRepairFor(actor, Plan.CASUAL) ; if (b != null) { final float priority = b.priorityFor(actor) ; if (priority * Planet.dayValue(world) >= Plan.ROUTINE) { return b ; } } if ((! structure.intact()) || (! person...
b6469df9-3cce-4e96-a4b1-1c3a35b2bf4d
6
public static Stella_Object accessBinaryValue(Stella_Object self, Surrogate relation) { { MemoizationTable memoTable000 = null; Cons memoizedEntry000 = null; Stella_Object memoizedValue000 = null; if (Stella.$MEMOIZATION_ENABLEDp$) { memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_AC...
5f172541-6119-4640-8891-53e0d4e8e08d
9
public CommandNode parseScript( String script ) { File f = null; FileInputStream fis = null; InputStreamReader isr = null; BufferedReader reader = null; String line = null; int flag = 0; Stack< CommandNode > stack = new Stack< CommandNode >(); CommandNode current = null; CommandNode back = null; ...
588fd056-98c0-42af-8be9-e6448e270779
0
public void setjComboBoxPraticien(JComboBox jComboBoxPraticien) { this.jComboBoxPracticien = jComboBoxPraticien; }
d699a1bd-34fc-4be8-9454-0c5d741bbf6b
4
public void showLoginStats(CommandSender sender, ListType type, String since, int page, int itemsPerPage) { List<LoginEntry> rawList = new ArrayList<LoginEntry>(); ListPage<LoginEntry> pList = new ListPage<LoginEntry>(); int nPages = 0; switch (type) { case NEW: ...
b9c93477-e1cc-4e7b-85e1-e737a6354de2
1
public Tank call(){ Tank tank = null; try { // tank = (Tank)ois.readObject(); String recvBuf = in.readLine(); tank = Oz.getTank(recvBuf); } catch (IOException e) { e.printStackTrace(); } return tank; }
e0d1a456-5847-4beb-b5b2-4c6c7ae276b9
1
public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Experiment start:"); WriteFile wf = new WriteFile(new File("experimentFloydWarshall.txt")); WriteFile wf2 = new WriteFile(new File("experimentFloydWarshall2.txt")); for (int i = 10; i < 800; i++) { int N = i; ...
ddfe7bdc-28f6-4170-ba83-67451c4112f0
9
public static boolean analysisNSMXMJ(AnalysisOutput o, List<AnalysisOutput> candidates) throws MorphException { int idxVbSfix = VerbUtil.endsWithVerbSuffix(o.getStem()); if(idxVbSfix==-1) return false; o.setVsfx(o.getStem().substring(idxVbSfix)); o.setStem(o.getStem().substring(0,idxVbSfix...
4b4c1754-b475-4156-b96e-0f91dbabfe9b
0
public int getCantPerson() { return CantPerson; }
e8a8df1c-0fb0-4f66-b93f-d4d9dff32adb
7
private JSONArray readArray(boolean stringy) throws JSONException { JSONArray jsonarray = new JSONArray(); jsonarray.put(stringy ? read(this.stringhuff, this.stringhuffext, this.stringkeep) : readValue()); while (true) { if (probe) { lo...
8e273e46-482c-4e6f-b79b-5ce150b79ce8
9
@Override @SuppressWarnings("unchecked") public void run() { DBPort connection = null; try { ServerDescription currentServerDescription = getConnectingServerDescription(null); Throwable currentException = null; while (!isClosed) { ...
c75d4b5c-0c47-487b-b34e-afbe25bdc1c4
8
private void method117(Stream stream) { stream.initBitAccess(); int j = stream.readBits(1); if(j == 0) return; int k = stream.readBits(2); if(k == 0) { anIntArray894[anInt893++] = myPlayerIndex; return; } if(k == 1) { int l = stream.readBits(3); myPlayer.moveInDir(false, l); int k1 ...
67218f00-14aa-4c37-b2f9-316bb8ffd4f5
6
public SensorSingleData filter(SensorSingleData sensorSingleData) { if (sensorSingleData.getAccX() < Constants.NOISE_DELTA_ERROR && sensorSingleData.getAccX() > -Constants.NOISE_DELTA_ERROR) { sensorSingleData.setAccX(0); } if (sensorSingleData.getAccY() < Constants.NOISE_DELTA_ERROR && sensorSingleDa...
88312f50-5066-4a6a-90d4-dcaf9087a65b
7
@Override public void actionPerformed(ActionEvent e) { LogLine selected = ((LogTableModel) mListLog.getModel()) .getItem(mListLog.getSelectedRow()); if (selected != null) { switch (e.getActionCommand()) { case Main.COMMAND_FILTER_THISTAG: setFilteredTag(selected.getTags()); break; case Main.C...
96d10376-3e13-4e2f-996d-3a632b271700
8
private ArrayList<Method> getAnnotatedMethodsRecursively(Class<?> klass) { if (klass == null || klass.equals(Class.class)) { annotatedMethodsByClass.put(klass, null); return null; } if (annotatedMethodsByClass.containsKey(klass)) { return annotatedMethodsByClass.get(klass); } ArrayList<Method> result...
017e1d76-64f1-4bd9-9071-bd83541554b9
8
private void outputStats(StateMap stateMap) { System.out.println("LCDC: " + lcdc.getSize()); SpriteStateRange minBefore = null; SpriteStateRange maxInFrame = null; SpriteStateRange minAfter = null; for (SpriteStateRange sprite : sprites) { if (sprite.notBeforeOrAt >= 0 && (minBefore == nu...
2ce74045-3c32-429c-b214-4da6f59e1272
5
static ClassInterfacesType create(ClassInfo clazz, ClassInfo[] ifaces) { /* Make sure that every {java.lang.Object} equals tObject */ if (ifaces.length == 0 && clazz == null) return tObject; if (ifaces.length == 0) return tClass(clazz); if (ifaces.length == 1 && clazz == null) return tClass(ifaces[0]);...
c25a21d5-f6bc-44c4-95dd-5229ff8463b5
8
private void playerMove(Player player, Location location, Reason reason) { // Check if he left the zone he currently is in List<Zone> zones = assignedZones.get(player.getName()); if(zones == null) { zones = new ArrayList<Zone>(3); assignedZones.put(player.getName(), zone...
92b706ab-723e-47c2-bdd3-af2814026367
2
public void winner(int winner) { if (winner == myID) { winnerField.setText(myName + " wins!"); } else if (winner == theirID) { winnerField.setText(theirName + " wins!"); } else { winnerField.setText("Draw!"); } }
502b22eb-cd65-4d0a-9c03-548d1c7b42b9
2
public List<Tuote> haeTuotteet() throws DAOPoikkeus { ArrayList<Tuote> tuotteet = new ArrayList<Tuote>(); // avataan yhteys Connection yhteys = avaaYhteys(); try { // Haetaan tietokannasta tuotteet String sql = "select nimi, numero, hinta, tuoteID from Tuote"; Statement haku = yhteys.creat...
e7694253-b114-4293-9645-a3db0fbbff51
6
protected static void methodChoices() { if(getJRadioButton_FCFS().isSelected()){ choice=1; getJRadioButton_SSTF().setSelected(false); getJRadioButton_SCAN().setSelected(false); getJRadioButton_CSCAN().setSelected(false); getJRadioButton_LOOK().setSelected(false); getJRadioButton_CLOOK().setSelected(...
39a2640d-1c32-40cc-8f3c-67372cd2c970
6
public List<CarrierInfo> findOFDMCarriers (double spectrum[],double sampleRate,int binCount,double multiFactor) { List<CarrierInfo> cList=new ArrayList<CarrierInfo>(); int a; double dPoint=-1.0; for (a=0;a<(spectrum.length-1);a++) { if (spectrum[a]>dPoint) dPoint=spectrum[a]; } dPoint=dPoint*multiFactor;...
526b1eb0-c4f3-405a-a48e-b02b6533af88
2
public String extract(Element element) { return key != null && element.hasAttr(key) ? element.attr(key) : ""; }
919c2d32-76fe-4317-9a31-8bba8af76edf
2
public void loadFromFile() { if (!fileExists()) return; // Exit if file doesn't exist RmiData o = null; try { FileInputStream fileIn = new FileInputStream(FILE); ObjectInputStream in = new ObjectInputStream(fileIn); o = (RmiData) in.readObject(); in.close(); fileIn.close(); } catch (IOExceptio...
cdbbc16f-d134-4af9-b5a0-f2ed5b66616a
3
private int[] calculateExpectedAndStandardDev(int[] platter) { int[] bowl; int total_score = 0; int max_score = -1; int[] samples = new int[SAMPLE_NUM]; for (int i=0; i < SAMPLE_NUM; i++) { bowl = createBowl(platter); int bowl_score = scoreBowl(bowl); ...
4666e0ae-4944-48fa-a81d-30b4ec10c821
8
public void update(GameContainer container, int delta) throws SlickException { if (container.getInput().isKeyDown(Input.KEY_Q)) { zoom += (delta * 0.01f); if (zoom > 10) { zoom = 10; } } if (container.getInput().isKeyDown(Input.KEY_A)) { zoom -= (delta * 0.01f); if (zoom < 0.1f) { zoom = 0....
32dd8092-6051-4444-aa52-be2028f5f575
5
private void buildMetadataElements(JoeTree tree, String line_ending, StringBuffer buf) { Iterator it = tree.getAttributeKeys(); StringBuffer readOnlyAtts = new StringBuffer(); if (it != null) { while (it.hasNext()) { String key = (String) it.next(); Object value = tree.getAttribute(key); if...
9cad22b3-bb40-4ced-85f2-c7352dbd3b6d
2
private void saveModified(){ if(modified){ if(JOptionPane.showConfirmDialog(null, "Scene modified, save it?", "Confirm", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){ saveScene(); } } }
e5497ea3-f465-447b-810c-05f353bf89ac
9
private int gradient_optimize_with_step(double step) throws Exception { double grad[][] = { { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D }, { 0D, 0D, 0D, 0D, 0D, 0D } }; int i, j, l; int result = 0; double minDist = Double.MAX_VALUE; doub...
4d1fc6da-c589-4e93-baf8-f3ce25525d7b
4
private void getParameters(String inputFileName){ /* try{ TextIO.readFile(inputFileName); }catch(IllegalArgumentException ee){ }*/ //GetComments assume to know how comments are written in the file. I use the ! (bang) symbol for them //For the moment, I do not store the comments new GetComment...
8814fde5-2248-4fac-b7df-3a8735424ee1
3
void createToolBar(final Composite parent) { final Display display = parent.getDisplay(); toolBar = new ToolBar(parent, SWT.FLAT); Listener toolBarListener = new Listener() { public void handleEvent(Event event) { switch (event.type) { case SWT.Selection: { if (event.widget == playItem) { ...
d09714cf-dd49-48cf-8ff2-9ae73a4d7351
3
public ArrayList<HashMap<String, String>> getAnafores(){ /* * epistrefei tis anafores ths vashs se mia lista opou pairnei to onoma tou column kai thn timi tou */ ArrayList<HashMap<String, String>> anafores=new ArrayList<HashMap<String, String>>(); try { pS = conn.prepareStatement("SELECT * FROM anafor...