method_id
stringlengths
36
36
cyclomatic_complexity
int32
0
9
method_text
stringlengths
14
410k
3aa6a18a-d02c-4012-9295-89ab3af3ec36
9
public static void cp(String srcPath, String dstPath) { FileChannel in = null; FileChannel out = null; FileInputStream inStream = null; FileOutputStream outStream = null; try { inStream = new FileInputStream(srcPath); outStream = new FileOutputStream(dstPath); in = inStream.getChannel(); out = out...
98b26b1f-e13f-4152-a864-dbf9db0623f9
1
public CtMethod[] getDeclaredMethods() { CtMember.Cache memCache = getMembers(); CtMember mth = memCache.methodHead(); CtMember mthTail = memCache.lastMethod(); int num = CtMember.Cache.count(mth, mthTail); CtMethod[] cms = new CtMethod[num]; int i = 0; while (mth...
4c58f0f9-ba7e-4360-86c8-734cd3bd7ca6
6
@Override protected void paintComponent(Graphics g) { super.paintComponent(g); int currentY = 0; for (AccordionRootItem menu : getMenus()) { menu.setSize(this.getWidth(), this.menusSize); menu.setLocation(0, currentY); if (menu == lastSelectedMenu && !men...
702b1ba3-efa7-4509-ab1a-f91c712ed560
2
private void writebuttonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_writebuttonMouseClicked // TODO add your handling code here: String address=writeaddress.getText(); int addr=dec.NumberParser(address); int val=dec.NumberParser(writevalue.getText()); if(addr !...
c1656b6d-eeaf-4299-a285-813384910a73
5
private GameState carpenterDay(GameState state, Card card) { Color faction = card.getFaction(); if(state.getPlayer(faction).checkCPU()) { HashMap<GameState, String> choiceMap = dayActionWithPhrases(state, card); GameState choice = state.getPlayer(faction) .chooseState(choiceMap.keySet().toArray(ne...
bff7bd27-cd7f-463a-abb9-f1cb5f594c64
8
private void igual() throws Exception{ op2 = pila.pop(); if (op2.getValor().equals("null")) throw new Exception("Una de las variables esta sin inicializar!"); op1 = pila.pop(); if (op1.getValor().equals("null")) throw new Exception("Una de las variables esta sin inicializar!"); Elem resultado = new Ele...
0d9e2e6d-3209-495a-8d05-75a06eab7c6a
9
@Override protected void download() throws Exception { int currPage = 1; boolean hasPrev = true; while(currPage <= this.totalPages && hasPrev) { String url = String.format(Constant.VOA_AS_IT_IS_URL, currPage); Util.print("Fetching info from %s...", url); ...
ea9fb28f-6536-4ddb-9d55-113c018fdbbd
0
@Override public String toString() { return "SkillRating [ skillId=" + skillId + ", ratingId=" + ratingId + ", givenBy=" + givenBy + "]"; }
17b9f2d3-19ab-426d-87ba-f356f21397be
4
public int getMachineIndexByName(String machineFileName){ ArrayList machines = getEnvironment().myObjects; if(machines == null) return -1; for(int k = 0; k < machines.size(); k++){ Object current = machines.get(k); if(current instanceof Grammar){ ...
3c614732-d49c-465e-be43-63fd2794c234
0
public void setModel(String value) { this.model = value; }
3fec51d7-1674-4e35-aee6-3d80570da146
9
public void WorldDone() { gameaction = gameaction_t.ga_worlddone; if (secretexit) players[consoleplayer].didsecret = true; if (isCommercial()) { switch (gamemap) { case 15: case 31: if (!secretexit) ...
75f96435-0f68-42ba-88ee-ecb9ca9e2edf
9
public static QuadTree compressImage (int[][] image) { if (image == null) { throw new IllegalArgumentException(); } else if (image.length != image[0].length) { throw new IllegalArgumentException(); } else if (!((image.length & (image.length - 1)) == 0)) { //checks if power of 2 throw new IllegalArgumentE...
a8be9814-3b34-4212-8bce-df0cc50f8f42
3
* @return continues with simulation */ @Override public boolean goOn(StochasticSimulator process) { if (process.getCurrentTime() >= maxTime) { // if exceed maxTime then stop return false; } else { // stop depending on mo...
5984f52e-6dd5-4a7e-9e0d-73b668f30f24
8
private Component cycle(Component currentComponent, int delta) { int index = -1; loop : for (int i = 0; i < m_Components.length; i++) { Component component = m_Components[i]; for (Component c = currentComponent; c != null; c = c.getParent()) { if (component == c) { index = i; break loop; } ...
90927fd6-fcf2-4d47-8cf3-1331661ce15a
9
public static void findCuts(String branch) { if (branch == null || branch.length() < 2) return; // structure representing each cut, which will be mapped in a hash table with the key "weight center-of-gravity" class WCG { int startIndex; int endIndex; WCG(int s, int e) { startIndex = s; ...
b08ddf22-4a97-4ed5-ae19-1c9721094607
4
void onSpace () { if (focusItem == null) return; if (!focusItem.isSelected ()) { selectItem (focusItem, (getStyle () & SWT.MULTI) != 0); redrawItem (focusItem.index, true); } if ((getStyle () & SWT.CHECK) != 0) { focusItem.setChecked (!focusItem.checked); } showItem (focusItem); Event event = new Event ();...
fa4aa270-a9d3-492f-8a84-84730d20a1a1
0
public List<ModelFiledDesc> getFileds() { return fileds; }
936797be-36df-4546-beb1-f20a2c067b59
3
private void erstelleXml() throws Exception { File file = new File(XMLPATH); if(file.createNewFile()) { BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(file)); writer.write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"); writer.write("<struktur>\n"); writ...
e204dd34-1290-473c-9095-1480a99e4009
4
public Testcase getTestcase(StringSearchAlgorithm alg, int inputNumber, int numberOfExecutions, boolean showResult) { File inputStringFile = new File(inputLocation + "source_string.i" + inputNumber); File searchStringFile = new File(inputLocation + "search_string.i" + inputNumber); BufferedReader reader = ...
e665d62d-fc71-4ae5-a33b-8b274c87c2b8
9
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == d.wall) { d.mode = Mode.ADD_WALL; } if (e.getSource() == d.door) { d.mode = Mode.ADD_DOOR; } if (e.getSource() == d.enemy) { d.mode = Mode.ADD_ENEMY; } if (e.getSource() == d.trigger) { d.mode = Mode.ADD_TRI...
c41c2d51-2e4f-4a80-bd01-71d120e0d63d
4
public static void saveRate(Rate r){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { conn.setAutoCommit(false); PreparedStatement ...
518aa6e8-2e23-4bcc-9f53-1b148ba88566
4
public void firstTraverse(TreeNode tr,String path){ if(tr.left==null && tr.right == null){ path+=tr.val; res.add(path); return; }else{ path= path+tr.val+"->"; } if(tr.left!=null) firstTraverse(tr.left,path); if(tr.right!=null) firstTraverse(tr.right,path); }
3bfe8d4e-6c46-415b-8c7d-525f41492ddc
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...
7324c94e-0806-4d11-8c98-6ca27c4f782b
2
public boolean didTheySwear(String message) { boolean found = false; for (Map.Entry<String, String> entry : wordList.entrySet()) { String thisWord = entry.getKey(); String thisRegex = "\\b"+thisWord+"\\b"; Pattern patt = Pattern.compile(thisRegex, Pattern.CASE_INSENSITIVE); Matcher m = patt.ma...
e3413cb9-5d25-48f0-8599-498f2b534df9
4
@Override public void sendPackage(APacket p, IIOHandler target) { log.log(Level.FINE, "Sending Packet "+p+" to Target "+target); if(side == Side.CLIENT&&target!=LOCAL()) { if(SERVER != null) { SERVER.sendPacket(p); } else { log.log(Level.FINE,"SERVER is equivalent to null when sending Package! Packet...
11bf72fe-449d-4744-bd4e-a022011e3bb9
8
public String getSuffixText(byte[] bytes, int offset) { try { String name= null; String pid= null; String exceptionMessage= null; StringBuffer suffix= new StringBuffer(); try { SystemObject object = getSystemObject(bytes, offset); if(object == null) return "id (null)"; name = object.getName...
dfa098f7-cfcd-4a1b-996a-8965f0f74ec9
9
public String retrieveValidPlateInfo(TableElement element) { String invalidEntries = "\n\n"; String invalidMessage = " contains invalid entry: "; // If everything is valid, then update the table element if (TextField.MJD.hasValidTextEntry() && TextField.PLATE.hasValidTextEntry() && TextField.FIBER.hasValidText...
e4f6ff16-203a-4ac3-80af-51696076387f
3
CultureListDialog(java.awt.Frame parent) { super(parent, "Cultures", false); GenericObject cultureGroups = EUGFileIO.load(Main.filenameResolver.resolveFilename("common/cultures.txt"), ParserSettings.getNoCommentSettings()); ...
46a75a84-96da-4d80-8fc0-c2056bc7861a
8
private static String initialise(Token currentToken, int[][] expectedTokenSequences, String[] tokenImage) { String eol = System.getProperty("line.separator", "\n"); StringBuffer expected = new StringBuffer(); int maxSize = 0; for (int i = 0; i < expe...
18fce301-2e6f-462b-9f01-d1b1116fd5c9
1
public static void setAboutPanel(Class<? extends JPanel> aboutPanelClass) { ABOUT_PANEL_CLASS = aboutPanelClass; }
a7c3d2ea-7777-466f-ac89-e47c5be8bac8
4
private void ufotAlemmasOikeassaReunassa(Ufo ufo, int x) { if (ufo.isVisible()) { if (x >= RuudunLeveys - RuudunOikeaReuna && suunta != -1) { suunta = -1; Iterator i1 = ufot.iterator(); while (i1.hasNext()) { ufo = (Ufo) i1.next(); ...
7d024380-f451-41fe-9a3b-f8e8758a854a
8
public void updateDataBase() { String masterHostName = null; int masterPortNumber = 0; String masterKey = null; for (NodeState server : pool) { try { Registry registry = LocateRegistry.getRegistry(server.getHostname(), server.getPortNumber()); RemoteBullyPassiveNode stub = (RemoteBullyPassiveNod...
6fe80bc0-7d13-4e36-bd26-2ff727065977
7
public void removeOutgoingEdge(Edge out) throws MaltChainedException { super.removeOutgoingEdge(out); if (out.getTarget() != null) { if (out.getType() == Edge.DEPENDENCY_EDGE && out.getTarget() instanceof DependencyNode) { Node dependent = out.getTarget(); if (compareTo(dependent) > 0) { leftDepende...
a7ec7a0c-151f-4c53-9039-157d3bdce9eb
0
public void setList(List<Record> list) { this.list = list; }
b7744f06-9b90-4fbf-9248-d39ae6eac8d9
4
private void createTrayIcon() { if(supported) { URL iconUrl = ClassLoader.getSystemResource(Constants.ICON_FILE); Image icon = new ImageIcon( iconUrl ).getImage(); PopupMenu menu = new PopupMenu(); openGuiMenuItem = new MenuItem(); settingsMenuItem = new MenuItem(); quitMenuItem...
19410b33-50f5-4a82-be90-1bbb9904d5d5
3
private static boolean targetOverLineOnScreen( double sx, double sy, int ex, int ey, int tx, int ty ){ if( sx == ex && sy == ey ){ return true; } if( sx == ex ){ return tx > sx; } double m = (sy - ey) / (double)(sx - ex); m = limitM( m ); double q = sy - m * sx; return m * tx + q > ty; }
0bed5c5c-c373-4265-9431-2c32b8fa9a82
1
public void testConstructorEx1_TypeArray_intArray() throws Throwable { try { new Partial((DateTimeFieldType[]) null, new int[] {1}); fail(); } catch (IllegalArgumentException ex) { assertMessageContains(ex, "must not be null"); } }
4fce71e5-f618-41c0-ba0b-e6481ee2c798
8
@Override public String toString() { return "DCSTrunk {" + (extReferences != null ? " extReferences [" + extReferences + "]" : "") + (cls != null ? " cls [" + cls + "]" : "") + (recommendedValue != null ? " recommendedValue [" + recommendedValue + "]" : "") + (quality != null ? " quality [...
1960b492-1a23-4445-9fac-faff0e2af5b8
4
public static void UperFirstName(){ try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try{ conn.setAutoCommit(false); PreparedStatement st...
e09b29d9-4d3e-4b77-ac34-b2f45be8a5a8
8
public static void main(String[]args) throws Exception{ if(args.length!=1){ System.err.println("Nombre d'arguments incorrect"); return; } LinkedRBinaryTree<?> tree=null; try{ IO.openReader(args[0]); String line; // On parcourt toutes les expressions du fichier une a une while((line = IO.rea...
c6a3fbc8-cea8-4ac0-8aa6-b66e7ce4b530
0
public double getX() { return x; }
e2569dbb-e92c-4e23-8d5c-0d0aa8c7ed22
1
public static void main(String args[]) { int trials = 1000; for (int i = 0; i < trials; i++) { deal(); playWar(); reset(); } System.out.println("Average Battles: " + battles/trials); System.out.println("Average Wars: " + wars/trials); }
c500ad58-c8c8-4b45-969e-454610e14b49
7
final void aa(short i, short i_582_) { if (aShortArray5388 != null) { if (!aBoolean5391 && i_582_ >= 0) { TextureDefinition class12 = ((AbstractToolkit) aHa_Sub1_5353).aD4579.getTexture(i_582_ & 0xffff, -6662); if (((TextureDefinition) class12).aByte198 != 0 || ((TextureDefinition) class1...
73c3a2f7-2c8e-4f00-aba9-ecb25e4f8baa
5
public String getFriend(String IP, String name){ if(!name.toLowerCase().equals(InstantMessenger.user.toLowerCase())){ InstantMessenger.remUser = name; frndName = name; try{ sock = new Socket(); sock.connect(new InetSocketAddress(IP,6789), 1300)...
8f776790-49b6-4a53-ae72-6e0d9d6bb185
1
public void setPWFieldFonttype(Fonttype fonttype) { if (fonttype == null) { this.pWFieldFontType = UIFontInits.PWFIELD.getType(); } else { this.pWFieldFontType = fonttype; } somethingChanged(); }
bf366c56-aeaa-465d-a48f-c4520b53a609
3
public boolean editCounterevidence(Evidence c) { Element evidenceE; Evidence evidence; boolean flag = false; for (Iterator i = root.elementIterator("counterevidence"); i.hasNext();) { evidenceE = (Element)i.next(); if (evidenceE.element("id").getText().equals(c.getId())) { evidenceE.element("title").s...
05f2fb50-d227-46ec-bd08-b2e96c564553
8
protected int readData( char[] chunkData, int pos ) { int state = 0; int start = pos; StringBuilder sb = new StringBuilder(); while ( pos < chunkData.length && state != -1 ) { switch ( state ) { case 0: // reading text if ( chunkData[pos] == '\\' ) state = 1; else if ( chunkDa...
23fe3f7c-086a-4bf3-8f63-34adfabe7b8f
1
private void createDialog(final ArrayList<Boolean> list, final int index) { final JDialog dialog = new JDialog(); Boolean bool = list.get(index); dialog.setSize(360, 150); dialog.setResizable(false); dialog.getContentPane().setLayout(null); dialog.setLocationRelativeTo(this); dialog.setLayout(null); J...
e2483eda-1fe8-4c04-841d-0f27b5e6e29f
5
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Privatstunde)) { return false; } Privatstunde other = (Privatstunde) object; if ((this.privatstundeid == null &...
ed0deaaf-a463-4785-8c86-c28e3332ea0e
2
public boolean overTwoTimes(int[] counts) { for (int i = 0; i < counts.length; i++) { if (counts[i] > 1) return false; } return true; }
0de4c092-1f97-442a-aaa6-11ec94185148
8
@Override public void keyPressed(KeyEvent e) { switch(e.getKeyCode()) { case KeyEvent.VK_UP: this.editor.getCursor().selectLineUp(); break; case KeyEvent.VK_DOWN: this.editor.getCursor().selectLineDown(); break; case KeyEvent.VK_LEFT: this.editor.getCursor().movePositionLeft(); brea...
260e2a05-96e0-4eb1-a02c-96ba08f09b5b
8
public Powerup(String powerUpTyp){ switch (PowerupTyp.valueOf(powerUpTyp)) { case OWN_MOVE_FAST: break; case OWN_MOVE_SLOW: break; case ENEMY_MOVE_FAST: break; case ENEMY_MOVE_SLOW: break; case TABOO: break; case CONTROL_SWITCH: break; case RANDOM: break; case CHAINSAW: brea...
5b99be5b-7606-435b-bc26-e61b87646289
2
protected void done(){ try { startButton.setEnabled( true ); // Enable the start button in the applet. settingsButton.setEnabled( true ); // Enable the settings button in the applet. stopButton.setEnabled( false ); // Disable the stop button in the applet. if( stopButton.getText() == "Resume" ) st...
5b610da9-5b17-402d-ba5f-b2d635716b5c
0
@Override public String toString() { return this.map.toString(); }
f344c1c2-5092-4b9b-8dca-905447615d29
2
private void start_connecting (boolean wait_) { assert (connect); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. IOThread io_thread = choose_io_thread (options.affinity); assert (io_thr...
ecfe3597-a282-4be5-aedf-3836b63352e8
6
private void cargarSetAprendizaje(){ DefaultTableModel temp = (DefaultTableModel) this.tablaSetAprendizaje.getModel(); String csvFile = "dataset/iris_aprendizaje.csv"; BufferedReader br = null; String line = ""; String cvsSplitBy = ","; try { br = new BufferedReader(new FileReader(csvFile)); ...
e030299e-8d8b-469d-875a-4e17b46da886
7
public Enumeration listOptions() { Vector result = new Vector(); Enumeration en = super.listOptions(); while (en.hasMoreElements()) result.addElement(en.nextElement()); result.addElement(new Option( "\tFull name and options of the evaluator analyzed.\n" +"\teg: weka.attri...
76b6a1ce-12f2-4986-81a0-018fd210182e
7
@Override public Step execute(Algebra algebra) { Fraction frac = (Fraction) algebra; //get factors of top and bottom Map<AlgebraicParticle, Integer> factorsTop = factors(frac.getTop()), factorsBottom = factors(frac.getBottom()); //find intersection of set of factors of top and bottom Set<AlgebraicP...
433c9cd7-64ca-43d4-9070-1824c3e38c25
2
public boolean playerCanExit() { Car player = (Car) vehicles.get('A'); ArrayList<Coordinate> coords = this.getCoveredCoordinatesExcludingVehicle(player); for (int i = player.position.x; i < gridSize; i++) { if(coords.contains(new Coordinate(i, player.position.y))){ return false; } } return true; }
64225a54-f0d6-4b65-b4c9-aca887659e44
2
public boolean equals(Object ob) { if (super.equals(ob)) { Candy other = (Candy) ob; if (hardness != other.hardness) return false; } return true; }
8393d628-07bc-4929-8f35-64c88cead231
3
public void update(T t) throws SQLException { Session session = null; try { session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction(); session.update(t); session.getTransaction().commit(); } catch (Exception e) { ...
fd3f99e7-b779-4240-bc23-f1c4be41290a
0
public void setFoo(Boolean foo) { this.foo = foo; }
e27ac16f-0a5c-4ce3-b309-8f6467171418
0
@Column(name = "sale_id") @Id public int getSaleId() { return saleId; }
18d7cde4-4283-4ea2-adcc-80f61f9834bb
1
public String toString() { if(this.b>=0) return String.format("%.3f +%.3fi", this.a, this.b); else return String.format("%.3f %.3fi", this.a, this.b); }
92307469-3d74-46ac-be85-e8f7693030d2
7
private void addClade(DrawableNode root, TreeItem cladeInfo) { //boolean add = false; //We traverse the tree and look for a node that contains this clade, but //that does not have any children that contain this clade if (containsClade(root, cladeInfo.clade)) { boolean found = false; for(Node kid : root...
82f7c45a-77d8-4a01-91b5-cd30916ab8ee
2
public float[][] clone2df(float[][] orig){ int ii = orig.length; int jj = orig[0].length; float[][] temp = new float[ii][jj]; for (int i = 0; i<ii; i++){ for(int j = 0; j < jj; j++){ temp[i][j] = orig[i][j]; } } return temp; }
b948e0d7-f963-461f-9ac2-84a4ad129504
5
public int getPartyHealth(int i) { if (i == 1) { return bm.getHealth(); } else if (i == 2) { return n.getHealth(); } else if (i == 3) { return w.getHealth(); } else if (i == 4) { return d.getHealth(); } else if (i == 5) { return wm.getHealth(); } else { return 50; } }
abf1e795-a66d-424e-b8b8-598587d0f68a
0
public String getCountryCode() { return countryCode.get(); }
34ff6cef-0eb9-4ab6-962b-44a172f7cd76
8
public void loadConfig () { File folder = getDataFolder(); PluginDescriptionFile pdfFile = getDescription(); File configFile = new File(getDataFolder(), "config.yml"); Properties settingsFile = new Properties(); if (! (folder.exists())) { try { folder....
d95c94d3-e1c8-43d5-a555-8d4e32b0b67c
8
public boolean onCommand(CommandSender sender, Command cmd, String commandlabel, String[] args) { final ChatColor red = ChatColor.RED; final ChatColor yellow = ChatColor.YELLOW; final ArrayList<Player> cPearl = CrazyFeet.CrazyPearl; if(args.length < 1) { if(sender instanceof Player) { Player player...
15d4216d-9e9c-4e39-924e-322fdf9d290f
9
public List<String> restoreIpAddresses(String s) { int length = s.length(); if(length < 4 || length > 12) return list; for(int i=1;i<length -2;i++) for (int j = i+1;j<length-1 ;j++ ) for (int k = j+1; k<=length ;k++ ) { String ip1 = s....
ccc4805f-b713-46bb-961b-9f69cfc17508
5
@Override public boolean queueBuffer( byte[] buffer ) { // Stream buffers can only be queued for streaming sources: if( errorCheck( channelType != SoundSystemConfig.TYPE_STREAMING, "Buffers may only be queued for streaming sources." ) ) return false; ...
eb2d55b2-f13e-43b5-9a4e-11f6583edbf0
1
public void setHighThreshold(float threshold) { if (threshold < 0) throw new IllegalArgumentException(); highThreshold = threshold; }
e2be5a3b-8a62-4879-bbc6-7c1f156036dc
2
public void nouveauTour(){ if (!aJoue() && !estMort()){ this.guerir(); } this.aJoue = false; }
8861d540-bbbc-4c1b-b28c-aab3ac6d0110
6
private ArrayList<Integer> determinePagesOfTermInSelectedChapters(ArrayList<Integer> termTotalPages, ArrayList<Integer> totalPagesInSelectedChapters){ if(totalPagesInSelectedChapters.size()!=0){ ArrayList<Integer> termTotalPagesWrapper = new ArrayList<Integer>(termTotalPages); //here to ensure no changes are made ...
e4415d74-59c9-4fb5-9ff9-8c96a16a1e59
7
public void Merge(Portfolio pleft, Portfolio pright, double wgt) { Collections.sort(pleft.pwlist,CINDEX); Collections.sort(pright.pwlist,CINDEX); int i = 0; int j = 0; Vector<PortWeight> newplist = new Vector<PortWeight>(); while (i < pleft.pwlist.size() && j < pright.pwlist.size()) { PortW...
e52327b9-bb72-43e8-a804-2d99a66b008b
0
public int getCheckStart() { return _checkStart; }
66fee0d7-8ce1-4c74-8fe7-ccdbccad79fd
6
public static String wypiszWynik(double[] tablicaWFormieNormalnej, boolean cons) { String postacOgolna = ""; for (int i=tablicaWFormieNormalnej.length-1;i>1;i--){ if(tablicaWFormieNormalnej[i]!=1.0) { Double normalnaSkrocona=new BigDecimal(tablicaWFormieNormalnej[i]).setScale(3, BigDecimal.R...
15578b6c-8e4f-4708-b313-a8250793e683
6
private void detachFrom(Component paramComponent) { if ((paramComponent instanceof ImageComponent)) { ((ImageComponent)paramComponent).removeImageListener(this); } else if ((paramComponent instanceof ImageComposite)) { ((ImageComposite)paramComponent).removeImageListener(this); } else if (((pa...
2555eade-0256-46f5-9b9e-3e6a1dcac4fe
9
public void writestack() { File f=new File(name+".stack.back"); if (f.exists()) if (!f.delete()) { printer.PrintMessage("failed to delete "+name+".stack.back"); return; } f= new File(name+".stack"); if (f.exists()) { if (!f.renameTo(new File(name+".stack.back"))) { printer.PrintMes...
fd5ef772-41b2-4dad-907b-51f4235de7cf
3
@Override public T next() { T current = next; while (iterator.hasNext()) { next = iterator.next(); if (next != skip) { break; } } if (!iterator.hasNext()) { next = n...
a1b3536a-cb31-468f-bab4-56747f5aa1bb
2
public void notify(Object[] objects) { Integer value = (Integer)objects[0]; if (value.equals(DISPLAY_PROJECT_VARIABLES)) { displayProjectVariables(); } else if (value.equals(DISPLAY_DESTINATION_FOLDER)) { displayDestinationFolder(); } }
8e19d5c7-1f6c-4632-9513-641a93b2a9f1
7
public void paint(Graphics g) { //Dibujamos la imagen de fondo for(int i=0; i <= ANCHO_VENTANA/DIAMETRO_IMAGEN; i++) for(int j=0; j <= ALTO_VENTANA/DIAMETRO_IMAGEN; j++) g.drawImage(game.getImagen(), Math.round(i)*DIAMETRO_IMAGEN,Math.round(j)*DIAMETRO_IMAGEN, DIAMETRO_IMAGEN, DIAMETRO_IMAGEN, null ); ...
19853127-715f-4e88-91c3-e93eb5626dc4
0
@Override public void initialize(URL arg0, ResourceBundle arg1) { DateFormat df = new SimpleDateFormat("yyyy/MM"); Date d = new Date(); currentMonth = df.format(d); lblDate.setText(currentMonth); }
7c439a24-8be4-4fff-a5cc-c07b42c5862e
4
public void testFormat_invalid() { try { DateTimeFormat.forPattern(null); fail(); } catch (IllegalArgumentException ex) {} try { DateTimeFormat.forPattern(""); fail(); } catch (IllegalArgumentException ex) {} try { DateT...
44b27495-85d7-4273-a65d-b2f7255dfdb2
8
@Override public boolean visit(IResourceDelta delta) { System.out.println("NEW EVENT"); System.out.println("================================"); System.out.println(delta.toString()); IResource res = delta.getResource(); switch(res.getType()) { case IResource.FILE: System.out.println("file resource"); ...
42ab36b3-3b8c-4bc9-a7e9-0e429c1f3b1f
1
public static int getOnePageRows() { String maxNum = getHttpServletRequest().getParameter("onePageRows"); if (StringUtils.isNull(maxNum)) { return 20; } else { return Integer.parseInt(maxNum); } }
c3a00c09-3e8e-475c-8860-9c6c656be092
1
private void initDisplay() { log.info("Initializing screen subsystem..."); try { Display.setDisplayMode(new DisplayMode(x_res, y_res)); Display.create(); log.info("Screen initialized."); } catch (LWJGLException e) { log.error("Caught exception. Info: " + e.getMessage()); e.printStackTrace(); Sys...
bc5ada8c-35a4-446e-b2c3-806def3216cd
3
public TValue get(TKey key) { if (!enabled) return null; TValue value; value = mainCache.get(key); if (value == null && useBuffer) { value = buffer.get(key); } return value; }
8bb4bb62-6cbd-4bd1-b291-bc0e0609f5fe
3
@Override public void deserialize(Buffer buf) { int limit = buf.readUShort(); finishedQuestsIds = new short[limit]; for (int i = 0; i < limit; i++) { finishedQuestsIds[i] = buf.readShort(); } limit = buf.readUShort(); finishedQuestsCounts = new short[limit...
9cafa5ce-238e-47dc-a422-57dd1c50b1ac
9
final private boolean updateActiveLayer() { assert (update_list.size() == 0); //double total_change = 0; total_change = 0; num_updated = 0; final Iterator<BandElement> it = layers[ZERO_LAYER].iterator(); while (it.hasNext()) { final BandElement elem = ...
7a911921-33e0-46b6-b5d4-46461b1e7a1b
6
public void leftClicked(Location location){ if(!freezed){ if(isUnclickedState(location) || isDoubtedState(location)){ setRevealedState(location); moved++; setChanged(); notifyTimerChange.setMoved(moved); notifyObservers(notifyTimerChange); if(!freezed){ notifyReveal(location); if(...
ba994adb-a72d-4e77-8535-420c02762cd5
5
public Object [][] getDatos(){ Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length]; //realizamos la consulta sql y llenamos los datos en "Object" try{ if (colum_names.length>=0){ r_con.Connection(); String c...
d23c8d2e-fd4f-40a3-ac6e-f858caffc947
0
public void remove() { throw new UnsupportedOperationException(); }
3abf1f20-0a41-4b57-9bac-cfa82f6eab05
4
public void save(){ try { File dir = new File("stage"); if(! dir.exists() || !dir.isDirectory()){ dir.mkdir(); } File stageData = new File(dir,"stage.data"); if(stageData.exists()){ stageData.delete(); } ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(stageData));...
cb0c9263-36bd-4766-b634-b6193796f5b8
7
@Override public void doPost(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{ res.setContentType("text/html"); Connection con = null; String lausend = null; String lausend1 = null; PreparedStatement ps = null; PreparedStatement ps1 = null; String kandidaat=req.getPara...
3844410c-7116-4aac-93ca-88f1292c5700
9
public Card(Rank rank, Suit suit) { this.rank = rank; this.suit = suit; switch(rank) { case Ace: value = 1; break; case Two: value = 2; break; case Three: value = 3; break; case Four: value = 4; break; case Five: value = 5; break; case Six: value = 6; break; case ...
a2d05cd4-c541-4bee-b031-b1419ca39536
4
@Override public MovementAction testAction(Creature c) { Direction action = this.checkForDirt(c); if (action != null){ return Direction.convertDirToAct(action); } Sensor s = c.getSensor(); ArrayList<Direction> possibleDir = new ArrayList<Direction>(); for (Direction d : Direction.values()){ int value...
f54951c3-8070-4f07-9235-7faf9f1faa27
7
@SuppressWarnings("unchecked") @Post public Representation handlePost(Representation entity){ try{ Form responseHeaders = (Form) getResponse().getAttributes().get("org.restlet.http.headers"); if (responseHeaders == null) { responseHeaders = new Form(); getResponse().getAttributes()...
8f25fe02-f097-4b5c-bdde-e0d5c6352a4c
8
public void handleHttpResponse(HttpResponse httpResponse, int expectedStatusCode) throws HttpExpectationException, ContractException, IOException { int statusCode; String body; statusCode = httpResponse.getStatusLine().getStatusCode(); body = StringUtil.convertStreamToString(httpResponse.getEntity().ge...