method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
290f7521-24fe-4661-80dd-2a499a4f52f5 | 0 | public void setHistorialClinicoidHistorialClinico(Historialclinico historialClinicoidHistorialClinico) {
this.historialClinicoidHistorialClinico = historialClinicoidHistorialClinico;
} |
7c6d6106-ea37-4e89-b2dd-12858fae6752 | 7 | private void checkTransitionObject(Object[] action) {
if (action.length != 3 || action[0] == null || action[1] == null || action[2] == null
|| !(action[STATE_POS] instanceof State) || !(action[CHAR_POS] instanceof Character) || !(action[DIR_POS] instanceof Direction)) {
throw new InvalidTransitionException("Ac... |
ebc281d6-929d-4783-a0a7-5a9de8b40919 | 1 | public void evaluate_void(Object[] dl) throws Throwable {
if (Debug.enabled)
Debug.println("Wrong evaluateXXXX() method called,"+
" check value of getType().");
return;
}; |
9541e77c-f45a-40eb-9c8d-0df360c53a9a | 3 | public void postCollide()
{
if (cam.collideY)
{
speedY = 0;
}
else
{
speedY -= gravity;
}
if (cam.speedY <= 0 && cam.collideY)
{
jumpDelay = 0;
}
} |
80d9001f-7988-4fcb-83c5-a29d51009a25 | 6 | static final byte[] method878(String string, int i) {
anInt1571++;
int i_2_ = string.length();
if ((i_2_ ^ 0xffffffff) == -1)
return new byte[0];
int i_3_ = ~0x3 & 3 + i_2_;
int i_4_ = i_3_ / 4 * 3;
if (i_3_ + -2 >= i_2_
|| Class186_Sub1.method1399(7, string.charAt(i_3_ + -2)) == -1)
i_4_ -= 2;
el... |
8116b2ab-75ab-4b2b-baca-67f204a060fe | 5 | public boolean validMovement(int myXCoor, int myYCoor, int targXCoor, int targYCoor, Board board){
double slope = Math.abs(super.getSlope(myXCoor,myYCoor,targXCoor,targYCoor));
if ((slope == 0.0 || slope == 1.0 || slope == 10.0) && (Math.abs(myXCoor - targXCoor) == 1 || Math.abs(myYCoor - targYCoor) == 1))
retur... |
55b69e2f-8449-44db-80a5-fa073b410c32 | 0 | public void setRemarks(String remarks) {
this.remarks = remarks;
} |
5fb2c899-f451-4122-b4ba-4bd8631a5aa9 | 3 | private void buildQueue(GeneralTreeNode<T> cur) {
if (cur != null)
queue.add(cur);
while (!queue.isEmpty()) {
GeneralTreeNode<T> tmp = queue.poll();
OutputQueue.add(tmp);
Iterator<GeneralTreeNode<T>> it = tmp.getChildren();
while (it.hasNext()) {
queue.add(it.next());
}
}
} |
d0a6d76a-3cc1-41d6-925d-262b79095b5a | 4 | public Tile getTile(int x, int y) {
if (0 > x || x >= width || 0 > y || y >= height)
return Tile.VOID;
return Tile.tiles[tiles[x + y * width]];
} |
13050f11-ba12-47ec-b59f-e5d46accb953 | 9 | public void execute(String path) {
IndexWriter writer = null;
IndexSearcher searcher = null;
try {
File indexDir = new File(System.getProperty("java.io.tmpdir"), "akka-index");
writer = openWriter(indexDir);
StopWatch stopWatch = new LoggingStopWa... |
464832f4-6180-4385-8ba2-3b90b4a9a89e | 0 | public void setOption(int a){
option = a;
} |
e0db055d-d039-4f4f-b20f-ccc80495ff13 | 7 | public static int[][] houseWalls(Direction side,int xLoc, int yLoc, int size)
{
int yOffSet = 0;
int xOffSet = 0;
switch (side) {
case UP:
yOffSet = -(size * 20);
break;
case LEFT:
xOffSet = -(size * 20);
bre... |
8e1c7303-90ef-4c6c-a9f9-12f35a5983d7 | 5 | public void testForID_String() {
assertEquals(DateTimeZone.getDefault(), DateTimeZone.forID((String) null));
DateTimeZone zone = DateTimeZone.forID("Europe/London");
assertEquals("Europe/London", zone.getID());
zone = DateTimeZone.forID("UTC");
assertSame(DateTi... |
fffbfadd-7c34-481b-97d9-b3ade3f46992 | 5 | @Override
protected void doAction() {
Point3D pos = this.attackingBody.getPosition();
for (WorldObject wo : Environment.getInstance().getMap()[pos.x+this.direction.dx][pos.y+this.direction.dy][pos.z].getObjects()) {
if (wo instanceof InsectBody) {
InsectB... |
08446a9d-154f-404e-ac80-e2a5649e4f2b | 7 | public void testTree1() {
Map refCounts = synchronizeTree(new HashMap());
TreeNode key = new TreeNode("leaf");
TreeNode[] value = new TreeNode[]{};
refCounts.put(key, value);
setTree(new TreeNode("dummy"));
try {
Map result = synchronizeTree(((Question2)answer... |
7d5f8f3a-b5ef-4c06-8913-0be81555b194 | 9 | private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
// Read serialized form from the stream.
ColorSpace cs = null;
// Switch on first int which is a flag indicating the class.
switch((int)in.readInt()) {
case COLORMODEL_NULL:
... |
71afde5d-8e9e-422f-a64b-4d47da40c671 | 0 | @Basic
@Column(name = "PRP_FECMOD")
public Date getPrpFecmod() {
return prpFecmod;
} |
2fc349ba-65f0-4ad1-94b6-5e65d2d3b79f | 9 | private void parseSqlFindKeywords(boolean allKeywords) {
selectPos = textParser.findWordLower("select");
if (selectPos == -1) {
String msg = "Error parsing sql, can not find SELECT keyword in:";
throw new RuntimeException(msg + sql);
}
String possibleDistinct = textParser.nextWord();
i... |
9293cd6b-b592-4ed4-a9ad-c91f0c50c79a | 5 | public static void initialDisplay()
{
System.out.print("Would you like to do: Add Sale (Add), Remove Sale (Remove), Finish Sale (Finish), " +
"Management Functions (Management) or Exit?: ");
String salesDisplayChoice = sc.next();
switch (salesDisplayChoice.toUpperCase())
{
case "ADD":... |
78ea06e5-5c3d-474c-96ed-703ad49f5969 | 9 | public int[][] generateMatrix(int n) {
int[][] array= new int[n][n];
int index = 1;
for (int i=0;index <=n*n ;i++ ){
//up
for (int j=0;j < n ;j++ ) {
if(array[i][j] == 0)
array[i][j] = index ++;
}
//right
... |
7bef256c-f2b3-4148-a16d-34938b22b4cf | 7 | public static void main(String[] args) {
// [max p, max # solutions]
int[] max = new int[2];
for(int p = 5; p < 1001; p++) {
int numSols = 0;
for(int c = 1; c < p/2; c++)
for(int a = 1; a < c; a++) {
double b = Math.sqrt(c*c - a*a);
if( Math.abs(b - (int)b) < .001 && a < (int)b && a+((i... |
86efd30b-4889-447b-9c1c-1b5721ed8c0a | 0 | @Test
public void thirtyTwoFIsEqualToZeroC(){
ScaledQuantity fahrenheit = new ScaledQuantity(32, Temperature.Fahrenheit);
ScaledQuantity celsius = new ScaledQuantity(0, Temperature.Celsius);
assertEquals(fahrenheit, celsius);
assertEquals(celsius, fahrenheit);
assertEquals(f... |
53298780-0238-4371-9d04-aa87fea3b90a | 9 | @Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
if (instrument != this.instrument || period != this.period) {
// 対象の通貨ではない、かつ、対象の時間間隔でない場合は何もしない
return;
}
// 既に注文があるときは何もしない
if (this.aliveOrder != null && this.aliveOrder.getState() != Stat... |
33ce13e3-18fd-485e-829f-6b7f00820e10 | 0 | public void addText(String text)
{
class temp implements Runnable
{
public temp (String text)
{
this.text = text;
}
private String text;
@Override
public void run()
{
try ... |
5f2a064e-9e06-47c5-b877-50441ae80f0c | 1 | private void moveDown() {
int[] rows = table.getSelectedRows();
DefaultTableModel model = (DefaultTableModel) table.getModel();
if (model.getRowCount() >= 2) {
model.moveRow(rows[0], rows[rows.length - 1], rows[0] + 1);
table.setRowSelectionInterval(rows[0] + 1,
rows[rows.length - 1] + 1);
}
} |
6a4f0028-d482-4e1a-b98f-0367d8956d22 | 2 | public static Item get(int index){
if(index >= 0 && index < 90) return inventory[index];
return null;
} |
504067d9-6be8-49a6-9c75-c4de481e202b | 7 | private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
Categoria c = new Categoria();
if (!(txCodigo.getText().equals("")) || (txCodigo.getText().equals(null))){
c.setId_tipo(Integer.parseInt(txCodigo.getText()));
}
... |
b00094c7-66e8-4cdb-aedb-ba42555a070b | 1 | public static void setTextures(boolean enabled)
{
if(enabled)
glEnable(GL_TEXTURE_2D);
else
glDisable(GL_TEXTURE_2D);
} |
6c863d82-2155-4876-956a-07c5c17efae0 | 5 | @Override
public boolean equals(
Object obj )
{
if( this == obj ) return true;
if( obj == null ) return false;
if( getClass() != obj.getClass() ) return false;
Range other = (Range) obj;
if( end != other.end ) return false;
if( start != other.start ) retur... |
538d8a52-ca74-437c-8cee-72115497c30b | 2 | public static Type getObjectType(final String internalName) {
if (isPrimitiveType(internalName)) {
return getType(internalName);
}
char[] buf = internalName.toCharArray();
return new Type(buf[0] == '[' ? ARRAY : OBJECT, buf, 0, buf.length);
} |
e17118a3-ca89-4768-9798-a6b080b00a31 | 2 | public static void main(String[] args) {
Domino d = new Domino();
d.crearDomino();
d.barajarFicha();
d.imprimirLista(Domino.listaFicha);
d.repartirFichas();
System.out.println("Humano");
d.imprimirLista(Domino.listaFichaHumano);
System.out.println... |
6762ddc4-a218-4875-9541-4691b1aa9544 | 2 | public static void main(String[] args) {
try {
SQLHelper sQLHelper = new SQLHelper();
sQLHelper.sqlConnect();
//sQLHelper.runUpdate("insert into teacher values('10060120','haha','zheng','jjhsjl')");
ResultSet rs = sQLHelper.runQuery("select * from teacher");
... |
949c55f8-f5d4-4161-9adb-b9731186d4cf | 8 | protected void makeSinCosTables()
{
// First determine max k.
int pmax = -Integer.MAX_VALUE;
int localnu1 = nu1;
int localn2 = n2;
int k = 0;
for (int l = 1; l <= nu; l++)
{
while (k ... |
9ec95189-08a3-4d49-8f37-efba4462101a | 4 | public static Complex[] convolve(Complex[] x, Complex[] y) {
Complex ZERO = new Complex(0, 0);
Complex[] a = new Complex[2*x.length];
for (int i = 0; i < x.length; i++) a[i] = x[i];
for (int i = x.length; i < 2*x.length; i++) a[i] = ZERO;
Complex[] b = new Complex[2*y.... |
acac4e1c-2b5b-4b6a-8464-75f1040bf7c5 | 7 | public void run() {
try {
PrintWriter out = null;
BufferedReader in = null;
out = new PrintWriter(socket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String clientMsg = null;
while ((clientMsg = in.readLine()) != null) {
int type = -1;
... |
b455729a-e591-470e-97d7-26472ec347e8 | 5 | public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if(command.getName().equalsIgnoreCase("vanish")){
if(enabled){
if(sender instanceof Player){
Player p = (Player) sender;
if(p.hasPermission("tcl.vanish")){
for(Player pl : Bukkit.getOnlinePlayers()... |
040e75f9-2dcc-420d-bf44-a258cd18c731 | 2 | public HashMap<String,Warp> loadWarps() throws SQLException {
HashMap<String,Warp> warps = new HashMap<String,Warp>();
sql.initialise();
if(!sql.doesTableExist("BungeeWarps")){
System.out.println("Table 'BungeeWarps' does not exist! Creating table...");
sql.standardQuery("CREATE TABLE BungeeWarps (W_I... |
e594b7a2-c83c-474e-bbb6-7a6a8e3a8a15 | 5 | public static Image trimTextImage(Image im, int width, int height)
{
/*
Due to the slight inaccuracy of the font sizes, a text image may
not need all the height allocated to it. This method will crop and
image so that all rows that are totally transparent are eliminated.... |
6283ea5e-da47-4e9a-bb86-8a28fe634738 | 5 | private void drawShape(Graphics g,Boolean pack) {
if (currentshape == shape.LINE)
{
//packet
if(pack)
{
Packet p=new Packet(diffrentShapes.LINE, currentColor, startX, startY, currentX, currentY);
try {
oos.writ... |
c68d2691-ac18-46e5-be26-e9ca609926dc | 0 | public Item genItem(int i,int items) {
int val2=rand.nextInt(100000000);
String val3 = items + " / " + i;
Item item = new Item(i,val2,val3);
return item;
} |
f9532851-3434-4c06-a7ae-3d106a5bcb97 | 7 | public int compareTo(Object o) {
int result;
int major;
int minor;
int revision;
int [] maj = new int [1];
int [] min = new int [1];
int [] rev = new int [1];
// do we have a string?
if (o instanceof String) {
parseVersion((Str... |
94c97850-fe3a-4c8d-89c3-6b3b5f9ddbaa | 3 | @Override
public boolean equals(Object o) {
if (o == this)
return true;
if (o == null)
return false;
if (!getClass().equals(o.getClass()))
return false;
final Virus v = (Virus) o;
return getName().equalsIgnoreCase(v.getName());
} |
8c13d9ae-6df2-401b-b0f7-dd8f52bc05c9 | 6 | public static Object[] toObjectArray(Object source) {
if (source instanceof Object[]) {
return (Object[]) source;
}
if (source == null) {
return new Object[0];
}
if (!source.getClass().isArray()) {
throw new IllegalArgumentException("Source is not an array: "
+ source);
}
int length = Array.... |
ed47db47-b856-412e-ae3b-e2567d855a79 | 2 | public boolean containsCard(Card card) {
for(int i = 0; i < this.getNumCards(); i++)
if(this.getCard(i).equals(card))
return true;
return false;
} |
de43a97d-0bae-498a-a9e0-51302e4551c0 | 0 | private void setSplitPaneBounds(){
splitPane.setBounds(5, menuBar.getHeight() + menuBarWithButtons.getHeight(),
getWidth() - 15, getHeight() - menuBar.getHeight() - menuBarWithButtons.getHeight()-55 );
upperSplit.setDividerSize(5);
splitPane.setDividerSize(5);
upperSplit.... |
159d6a9b-b47e-44ba-bb08-93efdd0becdd | 6 | public BlockOrientation getOrientation() {
IntBuffer orientationBuf = IntBuffer.allocate(1);
IntBuffer writingDirectionBuf = IntBuffer.allocate(1);
IntBuffer textlineOrderBuf = IntBuffer.allocate(1);
FloatBuffer deskewAngleBuf = FloatBuffer.allocate(1);
iterator.getOrien... |
62f01c49-0af9-4831-a249-f920adf7c037 | 2 | @Override
public boolean equals(Object obj) {
Horario h = (Horario)obj;
return dia.equals(h.getDia())&&de.equals(h.getDe())&&hasta.equals(h.getHasta());
} |
3430f7ae-f6f4-4dcb-a37c-e35c74ed8da6 | 7 | public void run() {
while(true) {
int com = readOneCommand(is);
System.out.println("Read : " + com + " from player " + p.getId());
switch (com) {
case Protocol.SEND_CARD: { // 1
int suit = readOneCommand(is);
int value = readOneCommand(is);
monitor.sendPlayedCard(new Card(suit, value, p));
... |
b2cab31a-8c0d-4cf2-bc8f-2553f8d59cc4 | 8 | private void createOr(String in1, String in2, String out)
{
OrGate or = new OrGate();
// Connect the first input
// Check if the in wire is an input
if (stringToInput.containsKey(in1))
{
Wire inWire = new Wire();
stringToInput.get(in1).connectOutput(inWire);
or.connectInput(inWire);
}
// Check ... |
b23b5f2c-d8da-4f6a-afb9-f96fdd10297e | 5 | public boolean estCleValable(String k) {
String[] keys=k.split(" ");
if(keys.length==2 && keys[0]!="" && keys[1]!="") {
if(this.estClePubliqueValable(keys[0]) && this.estClePriveValable(keys[1])) {
return true;
}
else {
return false;
}
}
else {
return false;
}
} |
56fb8cb8-1d15-45c8-ab07-aaaa7305800a | 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... |
8451b92e-8b05-4fe2-a849-7d37aa785f5e | 0 | public MainPage(String title) {
super(title);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
Toolkit tk = Toolkit.getDefaultToolkit();
this.setSize(tk.getScreenSize());
this.setVisible(true);
} |
2238535a-0f07-47d4-a9c7-e34191dfddee | 4 | public boolean mouseup(Coord c, int button) {
c = new Coord((int) (c.x / getScale()), (int) (c.y / getScale()));
Coord mc = s2m(c.add(viewoffset(sz, this.mc).inv()));
if (grab != null) {
try {
grab.mmouseup(mc, button);
return (true);
} catch (GrabberException e) {
}
}
if ((cam != null) && ca... |
531c0073-55cd-42b0-aaa8-d86cebda63cd | 5 | protected void creerCommunication() throws IOException {
this.communication = new Socket(this.nomServeur, this.portServeur);
this.fluxEntree = new BufferedReader(new InputStreamReader(communication.getInputStream()));
this.fluxSortie = new PrintStream(communication.getOutputStream());
// Crée un fil d'exécut... |
ac7ffd4f-f416-4101-b32d-17bac1b066ca | 2 | private void setHH(Household houseHold) {
// txtAcc1.setEnabled(false);
txtAcc1.setEditable(false);
// txtAcc2.setEnabled(false);
txtAcc2.setEditable(false);
// txtAcc3.setEnabled(false);
txtAcc3.setEditable(false);
// txtAcc4.setEnabled(false);
txtAcc4.setEditable(false);
// txtTutor1.setEnabled(fal... |
d6e3d1e8-c1f1-428c-9268-6d83599a865d | 0 | @Override
public Position getStart() {
return start;
} |
c2a4d880-7901-41c4-ac08-ba9f6d7bda4b | 7 | private void updateGrid(boolean cheat)
{
char[][] grid = wordSearch.getGrid();
for (Word word : wordPositions)
{
Point[] points = word.getPoints(wordSearch);
if (points == null) continue;
for (int i = 0; i < points.length; i++)
{
Point point = points[i];
grid[point.x][point.y] = word.getWor... |
790e0b7e-59b0-4507-a91b-3d87ef0bb18a | 7 | public String getCommand(int x) {
String y;
if (x == 1) {
y = "attack";
}
else if (x == 2) {
y = "defend";
}
else if (x == 3) {
y = "fire";
}
else if (x == 4) {
y = "blizzard";
}
else if (x == 5) {
y = "thunder";
}
else if (x == 6) {
y = "flood";
}
else if (x == 7) {
y =... |
62a78705-404c-4ac9-ae5c-e3161f9c2beb | 0 | public Layer getLayer() {
return layer;
} |
0625c299-d810-45f8-9d2d-850b61a5c3d9 | 4 | public Method findIsMethod(Field field) {
if(field == null)
return null;
if(getFieldDetailStore().isSetMethodPresentFor(field)) {
return getFieldDetailStore().setMethodOf(field);
}
String getterName = createMethodName("is", field.getName());
... |
014b3793-a408-429d-ab18-b865fc21e3d5 | 4 | private static String maxComSubStr(int i, int j, String strA, int[][] intA) {
if (i == 0 || j == 0) {
return "";
}
if (intA[i][j] == 1) {
return maxComSubStr(i - 1, j - 1, strA, intA) + strA.charAt(i-1);
} else if (intA[i][j] == 2) {
return maxComSubSt... |
a0194cf4-2d88-4958-9767-04110364651c | 1 | @Override
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface.isInstance(this)) {
return (T) this;
}
throw new SQLException("DataSource of type [" + getClass().getName() +
"] cannot be unwrapped as [" + iface.getName() + "]");
} |
cb7d126d-4b3e-4e27-9902-1e0423d47de4 | 3 | public String subPath(int start, int end) {
if (start < 0 || end < start || end > path_.length()) {
throw new IndexOutOfBoundsException();
}
return path_.substring(start, end);
} |
fa7c3a3f-12ec-4ee4-a0a6-f8b5c1a5faa5 | 4 | @Override
public int hashCode() {
int result = stock != null ? stock.hashCode() : 0;
result = 31 * result + (int) (price ^ (price >>> 32));
result = 31 * result + (seller != null ? seller.hashCode() : 0);
result = 31 * result + (buyer != null ? buyer.hashCode() : 0);
result =... |
9df85f8d-e9a8-4540-8a02-705e2d0120e4 | 8 | protected void readAttributes(XMLStreamReader in) throws XMLStreamException {
super.readAttributes(in);
name = in.getAttributeValue(null, "username");
nationID = in.getAttributeValue(null, "nationID");
if (!isUnknownEnemy()) {
nationType = getSpecification().getNationType(in.... |
5ecba7c8-0a55-44b5-8a29-b59bcb96c447 | 2 | public int[] plusOne(int[] digits) {
int[] array = new int[digits.length + 1];
int val = 1;
for(int i =digits.length-1 ; i>=0 ;i--){
val = digits[i]+val;
array[i+1] = val % 10;
val = val /10;
}
array[0] = val;
return (val == 0)? Arrays.... |
3b501f9f-57eb-46ec-a9c2-b016401d6c81 | 4 | public static int getCharacterID() {
String value = properties.getProperty(CHARACTER_ID);
if (value == null) {
return GameCharacter.LordLard.ordinal();
}
int id = GameCharacter.LordLard.ordinal();
try {
id = Integer.parseInt(value);
} catch (NumberFormatException e) {}
if (id < 0 || id >= GameCharac... |
f586206e-9a33-4ce2-a68b-715bac5e9ee7 | 6 | public void keyReleased(KeyEvent e)
{
switch(e.getKeyCode())
{
case KeyEvent.VK_LEFT: Kontroller.left = false;
break;
case KeyEvent.VK_RIGHT: Kontroller.right = false;
break;
case KeyEvent.VK... |
d80c208a-11a6-4370-83eb-e7aa112d9bef | 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... |
7c20e6f6-1cae-4e17-873c-c5e3f301d1a8 | 6 | @Override
public boolean click(MainView parent, int x, int y, int camx, int camy) {
if (x >= this.x && x <= this.x + 200 && y >= this.y && y <= this.y + 300) {
handleClick(parent, x - this.x, y - this.y);
return true;
}
else if (coaster == null) {
int[] po... |
4ab8d674-31c3-4e95-8e37-f5b5e55ab6c7 | 8 | tuple<node,Long> findInLB(int[] k, node cnode) throws valid_not_checked, pval_error, make_key_error
{
if (cnode.lfilledB==0)
return new tuple<node,Long>(null,(long)0);
long dist,min,dist1,dist2,dist3;
int in;
node minnode,tnode;
minnode=null;
min=0;
if (min<0) min+=(long)Math.pow(2,common.bkeyLength)... |
116d2edb-43eb-4040-ab6f-88c0946c41a6 | 2 | public ArrayList<Double> IDWT(ArrayList<Double> _dwt) {
ArrayList<Double> _temp = new ArrayList<Double>(_dwt.size());
//Initialize _temp
_temp = (ArrayList<Double>) _dwt.clone();
for (int j = 2; j <= _dwt.size(); j = j * 2) {
for (int i = 0; i < j / 2; i += 1) {
... |
46999c21-f350-469e-bec2-8884fdbde25b | 1 | public void testFactory_standardSecondsIn_RPeriod() {
assertEquals(0, Seconds.standardSecondsIn((ReadablePeriod) null).getSeconds());
assertEquals(0, Seconds.standardSecondsIn(Period.ZERO).getSeconds());
assertEquals(1, Seconds.standardSecondsIn(new Period(0, 0, 0, 0, 0, 0, 1, 0)).getSeconds());... |
bd985dcc-3c8a-4c6b-9217-fadf201a9d3d | 9 | public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
rd = new BufferedReader(new FileReader("d:\\programDATA\\Minimum Scalar Product\\A-large-practice.in"));
wr = new PrintWriter(new FileWriter("d:\\programDATA\\Minimum Scalar Product\\A-large-practice.out"));
int num;
... |
e5e3a0ab-f0c0-4834-859f-c19fec97006d | 5 | @Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
calcCellSize();
if (antSim == null) {
return;
}
for (int x = 0; x < antSim.getWidth(); x++) {
for (int y = 0; y < antSim.getHeight(); y++) {
if (map[x][y] ==... |
0de34e1d-eb47-4a7b-b2ee-67d41d51c37d | 7 | public void onEnable() {
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new JPBungee());
this.getConfig().options().copyDefaults(true);
this.saveConfig();
Jum... |
4d26c16f-8fc8-47eb-996b-fa943fd47c00 | 4 | public void save()
{
DataOutputStream fos;
try {
if (!bufferedStrokes.isEmpty())
{
JOptionPane.showMessageDialog(rootPane, "Please wait for the file to buffer!");
return;
}
File lll = new File("maps");
... |
15321c60-4058-49eb-bf8e-8a939f27f623 | 5 | private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... |
855fe1df-9480-4866-a95f-9e2a091804da | 8 | public static final Instances stratify(Instances data, int folds, Random rand){
if(!data.classAttribute().isNominal())
return data;
Instances result = new Instances(data, 0);
Instances[] bagsByClasses = new Instances[data.numClasses()];
for(int i=0; i < bagsByClasses.length; i++)
bagsByC... |
4d5244e3-db6e-42a4-bf19-3d0490ff07fa | 3 | private void processGetReplica(Sim_event ev)
{
if (ev == null) {
return;
}
Object[] data = (Object[]) ev.get_data();
if (data == null) {
return;
}
String filename = (String) data[0]; // get file name
Integer sender = (Integer)... |
4edf650e-c638-4157-92d9-6ba5d18b941e | 7 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if(!jTextArea1.getText().trim().startsWith("-----BEGIN SIGNED CHEQUE-----") && !jTextArea1.getText().trim().startsWith("-----BEGIN SIGNED VOUCHER-----")){
JOptionPane.showMessageDialog(th... |
d7d599a1-194e-43b6-8df3-f9763625362c | 2 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final WildcardString other = (WildcardString) obj;
return (0==compareTo(other));
} |
ab61884b-d573-4fc5-b9a3-0d940fee3024 | 6 | public static boolean checkIssue(Status status, int assignee)
throws DAOException {
boolean emptyAssignee;
if (assignee == 0) {
emptyAssignee = true;
} else {
emptyAssignee = false;
}
boolean statusNew;
if (status.getId() == 1) {
statusNew = true;
} else {
statusNew = false;
}
if (st... |
f3437d52-7714-46fe-a614-bf4725049a66 | 5 | @Override
public TreeRow next() {
if (hasNext()) {
if (mIterator == null) {
TreeRow row = mRows.get(mIndex++);
if (row instanceof TreeContainerRow) {
TreeContainerRow containerRow = (TreeContainerRow) row;
if (containerRow.getChildCount() > 0 && mPanel.isOpen(containerRow)) {
mIterator = n... |
1de8ce75-8977-4fd2-be07-7c0a045e6670 | 7 | public void read(InputStream is)
throws IOException {
//Given the small size of MIDI files read all
//data into a ByteArrayStream for further processing
byte[] fileData = new byte[is.available()];
is.read(fileData);
ByteArrayInputStream bais =
new Byte... |
d2e96d11-0f79-46b6-8273-24ed2776fc15 | 4 | private String nodeHtmlString(TeaNode parent) {
String line = "<br/>|";
for (int i = 0; i < parent.level; i++) {
line += "-";
}
if (!parent.label.equals("")) {
line += "[" + parent.label + "]";
}
if (parent.classValue == null) {
line += parent.attribute;
} else {
line += " -> " + parent.classV... |
468f406c-b915-4a1e-bb6c-31a64b68ea03 | 6 | private int getAmount(Location location, GoodsType goodsType) {
if (goodsType != null) {
if (location instanceof Building) {
Building building = (Building) location;
ProductionInfo info = building.getProductionInfo();
return (info == null || info.getPr... |
c520b2a3-f83f-4426-a2d4-79ebb80a97fc | 1 | @Override
public List<Position> getPositions() {
List<Position> positions = new ArrayList<Position>();
if (getPosition() != null)
positions.add(getPosition());
positions.addAll(otherPositions);
return positions;
} |
8e65e606-82b9-4770-9fb4-e743c6a554d2 | 6 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ReportScoreMessage that = (ReportScoreMessage) o;
if (score != that.score) return false;
if (!level.equals(that.level)) return false;
i... |
4a539581-3069-4934-ba80-7dc857e0bbca | 7 | public String[] getOptions() {
Vector<String> result;
result = new Vector<String>();
result.add("-mean-prec");
result.add("" + getMeanPrec());
result.add("-stddev-prec");
result.add("" + getStdDevPrec());
result.add("-col-name-width");
result.add("" + getColNameWidth(... |
c0062f45-0395-4336-a1d6-cc41443ce3d8 | 2 | @Override
public synchronized void sendNow() {
packageDTO.setPacketNr(packageDTO.getPacketNr() + 1);
packageDTO.setTimestamp(TimeUtil.getSynchroTimestamp());
logger.trace("sending Paket #" + packageDTO.getPacketNr());
for (Connection c : kryoServer.getConnections()) {
if (c.isIdle())
c.sendUDP(package... |
5991b1e6-0e42-4b4b-9999-a24aef4c19d9 | 2 | public void draw(Graphics g) {
g.setColor(Color.BLUE);
g.drawRect(bounds.left(),bounds.top(),bounds.width()-1,bounds.height()-1);
if (nodes.get(0) != null) {
for (int i = 0; i < 4; i++) {
nodes.get(i).draw(g);
}
}
} |
e94b12f1-169a-4c78-9d7c-ccd2b9966c80 | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Room target=mob.location();
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(L("The aura of harm is already here."));
return false;
}
final Ability ... |
fd3025fc-a938-44a6-afe0-e125eddf1f66 | 4 | public File getTransactionFile(File file) throws IOException {
if (mStarted == 0) {
throw new IllegalStateException(NO_TRANSACTION_IN_PROGRESS);
} else if (file == null) {
throw new IllegalArgumentException(MAY_NOT_BE_NULL);
} else if (file.isDirectory()) {
throw new IllegalArgumentException(MAY_NOT_BE_D... |
c4ab6994-1959-4137-ad52-f5fcaaa08ab8 | 1 | @Override
public void addInheritence(String inher) {
if (!inheritence.contains(inher)) {
inheritence.add(inher);
}
} |
fe5df808-5c73-4db6-b64e-363dd1d9e18d | 1 | public void testPlus_Seconds() {
Seconds test2 = Seconds.seconds(2);
Seconds test3 = Seconds.seconds(3);
Seconds result = test2.plus(test3);
assertEquals(2, test2.getSeconds());
assertEquals(3, test3.getSeconds());
assertEquals(5, result.getSeconds());
as... |
209f82c2-6106-4c77-bcc8-2040220ef5f6 | 6 | public static char[][] AbrirTablaTrancicion(){
try{
File archivo = new File("src/txts/Tebla.txt");
BufferedReader txt = new BufferedReader(new FileReader(archivo));
String s = "";
String aux;
int largo = 0, alto = 0;
do {
au... |
b671061a-cb81-4172-bd52-359aa4da7d70 | 1 | public static synchronized ResourceBundle getResourceBundle() {
if (bundle == null) {
bundle = ResourceBundle.getBundle("messages");
}
return bundle;
} |
80e77d82-6f1f-4d2f-b57f-4b431c4a2c43 | 2 | public static void openURL(final String link) {
try {
Desktop.getDesktop().browse(new URI(link));
} catch (IOException e) {
e.printStackTrace();
} catch (URISyntaxException e) {
e.printStackTrace();
}
} |
2afaedba-03ae-4d78-957d-abbfd2b615b9 | 0 | public UserOperator restart() {
stop();
run();
return this;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.