method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
c5d0aa93-8204-45ac-b168-14e61e8a4cf6 | 4 | private void addWorker() {
this.days = Main.getDays();
javax.swing.JTabbedPane tempWorkerDays = new javax.swing.JTabbedPane();
javax.swing.JTextField tempWorkerName = new javax.swing.JTextField();
javax.swing.JPanel tempWorkerTab = new javax.swing.JPanel();
// Makes a tab for each day and a check box for eac... |
4a5836bd-d3a4-4129-adce-4ae16faa1ef9 | 1 | public static void room2()
{
EnemyRat enemy = new EnemyRat();
if (combatDone = false) {
System.out.printf("\n > You step in to a large room with high ceilings supported by stone arches.\n");
System.out.printf("\n > You see a rat!\n");
enemy.combatinitialize();
}
else
Room2.afterCombat();
... |
b29fecf0-9f56-4065-b5cc-fca280e4dd9b | 4 | public void listenerPrincipal(final DiabetesPerceptronContainer diabetesPerceptronGui){
diabetesPerceptronGui.btnAgregarSetAprendizaje.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DefaultTableModel temp = (DefaultTableModel) diabetesPerceptronGui.tablaS... |
9c50c0a9-48c9-4f01-9bc5-90053ccb7ebe | 6 | public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par1World.isRemote)
{
return true;
}
else
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
int var7 = var6 & 7;
... |
c79b8df1-dcf4-4871-8cce-fd51994d3c3b | 0 | public Integer save(Step step) {
return (Integer) sessionFactory.getCurrentSession().save(step);
} |
1b5bf01a-06af-49d9-8689-3d328b020e92 | 7 | public int buscar(String str, int pos) {
String nom, cuen;
if (str == null) {
return -1;
}
if (pos < 0) {
pos = 0;
}
for (int i = pos; i < nElementos; i++) {
nom = clientes[i].obtenerNombre();
if (nom == null) {
... |
332e1f18-e396-4f31-ab22-2310e69b7eb6 | 0 | public World()
{
initWorld();
} |
5cd80df9-f635-458a-aec0-3e95048eb187 | 7 | public static int getVerticalDistance(ParserNode node, int childIndex,
int symbolSize) {
List<ParserNode> children = node.getChildren();
int childrenSize = children.size();
// vertikalna udaljenost najnižih sklopova i čvorova sa samo jednim
// djetetom je 0
if (node.getHeight() <= 2 || childrenSize == 1)... |
3d11bae2-f4fe-4501-adf6-52ef632fad06 | 7 | private void createSnapshotImage() throws IOException {
File outputfile = new File(snapshotimage);
System.out.println("Save snapshot of gcode to "+snapshotimage);
long time = System.currentTimeMillis();
gp.setSnapshotMode();
gp.jumptoLayer(10000);
gp.togglePause();
gp.setPainttravel(Travel.NOT_PAINTED);
... |
800efe0e-82c5-4a76-a3a6-17fd21da79b2 | 8 | private String getPatternAsFixedString(Class<?> aTargetClass){
String result = null;
if ( BigDecimal.class == aTargetClass || Decimal.class == aTargetClass ) {
result = "_1_ is not in the expected format/range : '_2_'";
}
else if ( Integer.class == aTargetClass ) {
result = "_1_ is not an in... |
2a3847a3-2b3d-489f-ae59-ab76e54ebfc0 | 3 | protected final void drawCan() {
Graphics pen = null;
final BufferStrategy b = this.getBufferStrategy();
if (b != null) {
pen = b.getDrawGraphics();
}
if (pen != null) {
myPen.simplePen.pen = (Graphics2D) pen;
pen.setColor(background);
pen.fillRect(0, 0, panelWidth, panelHeight);
pen.... |
683f62a6-73ab-4a16-aa88-3a3d6d073591 | 2 | public static final boolean isCPP(String fileName) {
for (String file : CPP) {
if (file.equals(fileName)) {
return true;
}
}
return false;
} |
ea624713-8086-4b2a-a87e-c867ed1c50ff | 8 | public boolean validate(UnitStats unit, PhysicalGameState pgs) {
if (isValidated) {
return true;
}
is_ready = true;
if (unit.id == unitID) {
cooldown = DEFAULT_COOLDOWN;
switch (type) {
case MOVE:
cooldown = unit.definition.move_speed;
isValidated = true;
break;
case ATTACK:
... |
08edfde2-4e52-4dea-a20c-75faf07dcfca | 1 | private void endGame(String message, int points) {
spielfeld.stopGameLoop();
setTitle(message + "! [" + points + " PUNKT" + (points > 1 ? "E" : "") + "]");
} |
287fdf29-ca0c-4e97-a63a-e1b90238ad98 | 3 | private Set<Particle> getSingleChunck(Particle current) {
Set<Particle> impacting = new HashSet<Particle>();
impacting.add(current);
while (true) {
Set<Particle> tmp = new HashSet<Particle>();
for (Particle pi : impacting) {
tmp.addAll(pi.impacting);
}
boolean changed = impacting.addAll(tmp);
i... |
468acb59-d3d1-4799-a7bf-854cbf341cf7 | 6 | public static ResultSet query(Statement stat, String table, long uid, String... field) throws SQLException {
ResultSet rs = null;
StringBuffer sb = new StringBuffer();
sb.append("select ");
boolean bool = false;
if (field == null || field.length == 0 || field[0].equals("")) {
... |
ea506ea8-db05-41ea-882d-3b0b5a3b7b65 | 0 | public void setNovAaaamm(Integer novAaaamm) {
this.novAaaamm = novAaaamm;
} |
d181f8ff-1c81-4cce-817f-2422478365ff | 2 | public void creer_message(ParseXML monFichier) {
for(int i = 0; i< monFichier.getTrame().length;i++){
int id = monFichier.getTrame()[i].getId();
int taille = monFichier.getTrame()[i].getDlc();
int date = 0;
if(filemessages.isEmpty()){
debut = monFichier.getTrame()[i].getDate();
}
else{
... |
1070bb52-0f6e-41c8-b0ac-ee30ffaef0be | 1 | public String getSimpleCode(){
String str = item.getSimpleCode();
if(this.items != null)
str += this.items.getSimpleCode();
return str;
} |
034df972-b8ec-4288-9a5f-39956a881b56 | 0 | public void addSink(Set<AndroidMethod> sinks) {
this.sinkMethods.addAll(sinks);
} |
9a402411-4355-4cb6-bf60-fe98294aecd3 | 6 | public String nextCDATA() throws JSONException {
char c;
int i;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
if (end()) {
throw syntaxError("Unclosed CDATA");
}
sb.append(c);
i = ... |
2c2f3ed8-6fa9-4f42-9937-74ff52d91174 | 1 | public static void main(String args[]) {
// Create a hash map
HashMap hm = new HashMap();
// Put elements to the map
hm.put("Zara", new Double(3434.34));
hm.put("Mahnaz", new Double(123.22));
hm.put("Ayan", new Double(1378.00));
hm.put("Daisy", new Double(99.22))... |
6b8852fc-8817-4457-a305-90c476f490e0 | 2 | public static Sprite getSprite(String filename)
{
// Try to load the sprite from the cache
Sprite rval = (Sprite) resourceByString.get(filename);
// If it's not in the cache, try to load it from disk
if(rval == null)
{
try {
rval = new Sprite(filename);
resourceByString.put(filename, rval);
... |
6e4fb1f0-5d93-45c3-a65a-f95586a9566d | 9 | public static void doSmallSteps(int cases, DataInputStream in, DataOutputStream out) throws IOException {
for (int i = 1; i <= cases; i++) {
String[] input = in.readLine().split("\\ ");
int r = Integer.parseInt(input[0]); // rides
int k = Integer.parseInt(input[1]); // seats
int n = Integer.parseInt(inp... |
9960242a-7e06-4603-80e5-a784deece3b4 | 8 | private static void createTestCase(String name, double bandwidth,
double delay, int totalGridlet, int[] glLength,
int testNum) throws Exception
{
switch(testNum)
{
case 1:
new TestCase1(name, bandwidth, delay, tota... |
487e2622-ac4a-47c4-94a4-a0697bebd685 | 5 | private String escapeHTML(String source) {
String strResult = "";
String sourceText = "";
int k;
Integer srcLen = source.length();
// Cycle through each input character.
if (srcLen > 0) {
for (int i = 0; i < srcLen; i++) {
sourceText = sourc... |
2236338e-9eef-467d-987d-3dd9699f10bc | 2 | @Override
public void huolehdi(){
if (tormaavatko()){
kimmotusehto++;
} else {
kimmotusehto = 0;
}
if (kimmotusehto == 1){
kimmota();
vahentaja.huolehdi();
}
} |
d9c163ce-be6f-4e64-b573-b2c01253159a | 9 | private void processTokenFile(String fileName, boolean reversed) throws IOException {
XMLStreamReader reader = resourceGetter.getXMLStreamReader(fileName);
try {
while (reader.hasNext()) {
if (reader.next() == XMLStreamConstants.START_ELEMENT) {
String tagName = reader.getLocalName();
if (tagName.e... |
bba9bc59-4db2-4e66-a485-feab9f4c6521 | 6 | public Color luoVari(int k1, int k2, int k3){
int a = lueKentta(k1);
int b = lueKentta(k2);
int c = lueKentta(k3);
if(a<0 || b<0 || c<0 || a>255 || b>255 || c>255){
return null;
}
Color co = new Color(a,b,c);
return co;
} |
eca41f75-38f1-4b07-9622-ea5514d0d205 | 8 | private Map<String, String> convertGetAccountActivity(GetAccountActivityRequest request) {
Map<String, String> params = new HashMap<String, String>();
params.put("Action", "GetAccountActivity");
if (request.isSetMaxBatchSize()) {
params.put("MaxBatchSize", request.getMaxBatc... |
636f0545-99a3-4d18-9e53-29f8a18154e4 | 2 | private static String sendHttpPost(String url,
List<NameValuePair> parameters) {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(url);
String output = "";
String line = "";
try {
// sets parameters
List<NameValuePair> nameValuePairs = parameters;
post.setE... |
6fb2ebd8-f406-44af-90ad-a49ebf5dacda | 7 | private int getHeight(TreeNode root)
{
if(root==null) return 0;
if(root.left == null && root.right ==null) return 1;
if(root.left == null && root.right !=null) return getHeight(root.right) + 1;
if(root.left != null && root.right ==null) return getHeight(root.left) + 1;
return Math.max(get... |
ac22e9b1-cf22-4b0e-bb35-e2e9a611b61d | 2 | private void putCardInToStack() {
if(cardStackTo != null && card != null) {
//card.setSeen(true);
cardStackTo.addCard(card);
cardStackToPanel.setCurrentCount(cardStackTo.getCount());
card = null;
modified = true;
}
} |
48b1a626-8a50-4c3c-b2de-df93bdd5827a | 0 | @Override
public void redo() {
node.setCommentState(newState);
} |
28d0d647-64e1-41c9-aa56-cc5466af490f | 8 | public static String typeof(Object value)
{
if (value == null)
return "object";
if (value == Undefined.instance)
return "undefined";
if (value instanceof Scriptable)
{
if (value instanceof XMLObject)
return "xml";
retur... |
4ad4ac67-ab1f-43bc-bb6e-e15811e0d651 | 6 | private void restoreValues() {
for (StorageKey key : StorageKey.values()) {
if (!storageValues.containsKey(key.toString())) {
continue;
}
switch (key) {
case outputPath:
springLenghtsTextField.setText(storageValues.get(key.... |
1bd7074d-f5b6-4695-9bd1-0c05dc61da41 | 3 | private void calcTangents(Vertex[] vertices, int[] indices) {
for (int i = 0; i < indices.length; i += 3) {
int i0 = indices[i];
int i1 = indices[i + 1];
int i2 = indices[i + 2];
Vector3f edge1 = vertices[i1].getPos().sub(vertices[i0].getPos());
Vecto... |
dd091f4f-e57b-4c96-a386-a8ef6423170b | 1 | private void warChecker() {
war.checker(playerData);
if (war.warzone) {
ward.setAttackers(player.team);
ward.update();
// war.checker(playerData);
}
} |
948115ac-0534-498c-9697-814fa3daf96f | 8 | @Override
public void onPacket(SendClientHandshakePacket packet) throws ProtocolException {
log.info("Player[" + packet.nickname + "] tries to login...");
boolean passwordCorrect = ssparams.getHashedServerPassword() == null
|| (packet.hashedPassword != null && Hasher.isEqual(ssparams.getHashedServerPass... |
1e3aa66a-f3d0-43c1-985f-4a2ce62086c9 | 8 | public static HDRExposure scaleTo( HDRExposure exp, int width, int height ) {
if( !aspectRatioPreserved(exp.width, exp.height, width, height) ) {
throw new UnsupportedOperationException("Cannot change aspect ratio");
}
double scale = width / exp.width;
if( scale == 0 ) {
return new HDRExposure(0, 0);
... |
09e689ef-7d77-49be-a099-84979daab840 | 3 | public String getTypeDescription() {
if (this.triggerType==1) return " (START)";
else if (this.triggerType==2) return " (END)";
else if (this.triggerType==3) return " (GRAB)";
else return " (UNKNOWN)";
} |
76727d0d-73ce-4d64-85b2-4103682aefe3 | 3 | public ArrayList<Integer> seach(String str) {
ArrayList<Integer> ends = new ArrayList<Integer>();
int i = 0;
Trie[] trieArray = sons;
while (i < str.length() && trieArray[str.charAt(i) - 'a'] != null) {
if (trieArray[str.charAt(i) - 'a'].finish) {
ends.add(i + 1);
}
trieArray = trieArray[s... |
6b2dabb6-62ac-4289-afa7-2eec23205671 | 4 | public void init(int mode, byte[] key, byte[] iv) throws Exception{
String pad="NoPadding";
byte[] tmp;
if(iv.length>ivsize){
tmp=new byte[ivsize];
System.arraycopy(iv, 0, tmp, 0, tmp.length);
iv=tmp;
}
if(key.length>bsize){
tmp=new byte[bsize];
System.arraycopy(k... |
280fa37e-941f-4e58-af44-f50842763a3b | 3 | public final void premultiply(Matrix matrix) {
entry2[3][0] = entry[3][1] = entry[3][2] = 0.0;
entry2[3][3] = 1.0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++) {
entry2[i][j] = 0.0;
for (int k = 0; k < 4; k++)
entry2[i][j] += matrix.entry[i][k] * entry[k][j];
}
// Swap!
double[]... |
5518aabb-de47-4624-8f2b-94146a15e6fd | 3 | public void fillArr(int x, int y) {
ArrayList<Delta> changes = currentTool.apply(curColor, x, y, currentLayer.colorArr);
ArrayList<Delta> accepted = new ArrayList<>();
for (Delta d : changes) {
if (!d.amUseless()) {
accepted.add(d);
}
}
cu... |
45ee4230-1cd2-4a4f-bcc3-ee772676c1a2 | 4 | @SafeVarargs
public static <T> List<T> concat(T[]... ts)
{
int size = 0;
for (T[] ta : ts)
{
if (ta == null)
{
continue;
}
size += ta.length;
}
List<T> l = new ArrayList<T>(size);
for (T[] ta : ts)
{
for (T t : ta)
{
l.add(t);
}
}
return l;
} |
63a3ad97-1fe9-4bee-8b7a-22532058b544 | 6 | @Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors erros = new ActionErrors();
if(contato.getNome() == null || contato.getNome().isEmpty()) {
erros.add("nome", new ActionMessage("erro.campoNome"));
}
if(contato.getEndereco() == null || contato.getE... |
d7d37dd0-a28b-498f-8633-6632927a49c8 | 4 | @SuppressWarnings("deprecation")
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent event) {
Player p = event.getPlayer();
Action eAction = event.getAction();
if (p.hasPermission("spectacle.create")
&& p.getItemInHand().getTypeId() == Spectacles.toolID) ... |
ea25b3c3-de81-4f2e-802a-cf732bb7aaf0 | 3 | @Override
public boolean updateCustomer(Customer customer) {
if (doc == null)
return false;
Element currRoot = doc.getRootElement();
Element parrentCusto = currRoot.getChild("customers");
List<Element> listCusto = parrentCusto.getChildren();
for (Element currCusto : listCusto) {
int custoID = Integer... |
4ae5b386-a3c8-4906-8143-e32a248ad8d7 | 0 | public void setDefaultPoints(int defaultPoints) {
this.defaultPoints = defaultPoints;
} |
926db10d-7231-48f7-a454-cbca6a401355 | 7 | public void update(){
if(ticksScared >= MAX_TICKS_SCARED)scared = false;
if(scared) {
ticksScared++;
}
super.update();
if(scared)if(!isMoving() && Util.RANDOM.nextInt(1000) < WALK_CHANGE_SCARED) moveRandomLocation(WALK_RANGE);
else if(!isMoving() && Util.RANDOM.nextInt(1000) < WALK_CHANGE_NORMAL) m... |
17a434f1-afc1-4ca5-93d1-8e7d63ea52df | 2 | private boolean pluginFile(String name)
{
for (final File file : new File("plugins").listFiles()) {
if (file.getName().equals(name)) {
return true;
}
}
return false;
} |
c94181b8-b228-4c08-b76d-f491b2c98a90 | 9 | static void plot(int x, int y, int z, int argb, int argbBackground,
String text, Font3D font3d, Graphics3D g3d) {
if (text.length() == 0)
return;
Text3D text3d = getText3D(text, font3d, g3d.platform);
int[] bitmap = text3d.bitmap;
int textWidth = text3d.width;
int textHeight... |
2ef28dac-7d8b-4d3f-984e-269753f99e37 | 3 | public double median_as_double() {
double median = 0.0D;
switch (type) {
case 1:
double[] dd = this.getArray_as_double();
median = Stat.median(dd);
break;
case 12:
BigDecimal[] bd = this.getArray_as_BigDecimal();
median = Stat.median(bd).doubleValue();
bd = null;
break;
case 14:
throw ... |
cc9fad8e-270b-41f0-9e06-9e08859eee9f | 6 | public static List<Integer> intersectSortedArraysThree(int[] a, int[] b) {
ArrayList<Integer> result = new ArrayList<Integer>();
int i = 0;
int j = 0;
while (i < a.length && j < b.length) {
if ((i == 0 || a[i] != a[i - 1]) && (a[i] == b[j])) {
result.add(a[i]);
i++;
j++;
continue;
}
if ... |
076ef867-7289-4694-abd4-41eb74fb58f7 | 5 | private String buildNUM() {
int k = 0;
String str = "";
do {
str += (char) c;
k++;
c = getchar();
} while( myisdigit((char) c) && k < MAXLEN_ID );
putback = true;
if( myisdigit((char) c) && k == MAXLEN_ID ) {
do { c = getcha... |
d981e843-aabf-46ea-9a6e-3694a07c5755 | 5 | static final void method2280(byte i, int i_20_) {
anInt3826++;
if (Class289.aByteArrayArrayArray3700 == null)
Class289.aByteArrayArrayArray3700
= (new byte[4][Class367_Sub4.mapSizeX]
[Class348_Sub40_Sub3.mapSizeY]);
if (i_20_ != 28587)
method2278(35, -47, (byte) 56, -93);
for (int i_21_ = 0; (i_21_... |
73c05477-812f-4f22-b415-74e73ad3e0cf | 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... |
aba372a4-ec27-4c64-b602-4eb36606b054 | 1 | @Override
public Label predict(Instance instance) {
if (linkFunction(this.innerProduct(instance)) >= 0.5) {
return new ClassificationLabel(1);
}
return new ClassificationLabel(0);
} |
ec47739c-c182-41a2-9d15-2db58a3a06a8 | 8 | public void windowDeactivated(WindowEvent arg0) {
areax = game.getColumns()*2;
areay = game.getRows();
ships = game.getBoats();
player1 = game.playerOne();
player2 = game.playerTwo();
placement = game.gameType();
diagonal = game.levelType();
marked = game.gameMode();
grid1 = new TheGrid(areax... |
54fc74c4-0d24-4176-9985-d8508f32e7e8 | 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... |
091537f9-8c50-429c-951f-cdbf3a491b9c | 4 | public void saveGraphFile()
{
//==== Initialize the filechooser, using the user's home dir, or the last working dir
if(this.currentDirectory.equals(""))
{ this.fc = new JFileChooser(); }
else
{ this.fc = new JFileChooser(this.currentDirectory); }
int returnVal = fc.showSave... |
ec026df1-6a64-4ed4-b2ca-78de8f977544 | 9 | public static void main(String[] args) throws Exception {
System.out.println("Please select a folder with your tiled pictures");
System.out.println("Your pictures will be stiched together from left to right \n in alphabetical order.");
File file = new File(FileChooser.pickADirectory());
if(file.listFiles() =... |
a902b819-8429-4c01-a57f-32ba8054ffb9 | 2 | public static StdImage getImage(JComponent component) {
StdImage offscreen = null;
synchronized (component.getTreeLock()) {
Graphics2D gc = null;
try {
Rectangle bounds = component.getVisibleRect();
offscreen = StdImage.createTransparent(component.getGraphicsConfiguration(), bounds.width, bounds.heigh... |
d10f12d2-1c11-45cd-afe1-e53de0f09749 | 6 | private void jBListarIncidentesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBListarIncidentesActionPerformed
// TODO add your handling code here:
int tipo = combo_tipo_reporte.getSelectedIndex();
if (tipo != 0) {
TipoInscidente codigotipo = controlador.buscar... |
377f589e-62d6-4c1f-a0f2-6038e4b1e1b1 | 9 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(myHost instanceof MOB))
return super.okMessage(myHost,msg);
final MOB myChar=(MOB)myHost;
if((msg.tool()==null)||(!(msg.tool() instanceof Ability)))
return super.okMessage(myChar,msg);
if(msg.amISource(myChar)
&&(... |
c6c56932-ae28-4991-8ff6-c86ca6c53bf8 | 8 | @Override
public String intercept(ActionInvocation invocation) throws Exception {
Map<String, Object> session = invocation.getInvocationContext()
.getSession();
// 获取action
String actionNameString = invocation.getInvocationContext().getName();
// System.out.println(actionNameString);
// 获取用户等级
String l... |
4c5b1781-fc1f-45ae-97c8-1cb25c3df25a | 6 | public ShipChassis getShipChassis(String id) {
ShipChassis result = shipChassisMap.get(id);
if ( result == null ) { // Wasn't cached; try parsing it.
InputStream in = null;
try {
in = getDataInputStream("data/"+ id +".xml");
result = dataParser.readChassis(in);
shipChassisMap.put( id, result );
... |
77f9b293-f060-4f43-9146-9528bf7ccb4b | 1 | public static void Eliminar(Object o) {
Transaction t = cx.beginTransaction();
try {
cx.delete(o);
t.commit();
cx.flush();
} catch (Exception e) {
System.out.println("no se inserto");
t.rollback();
}
} |
cc075d35-6109-4765-ac85-b70f33b22a03 | 8 | public void iterativePostOrder(TreeNode root) {
if (root == null) {
return;
}
Stack<TreeNode> stack = new Stack<TreeNode>();
TreeNode currentNode = root;
while (currentNode != null) {
if (currentNode.getLeft() != null) {
stack.push(currentNode);
currentNode = currentNode.getLeft();
} else ... |
856883ca-6b77-4a24-a2a6-2ec83d8ba80a | 2 | public boolean checkShapeDate(long fechaDesde, long fechaHasta){
return (fechaAlta >= fechaDesde && fechaAlta < fechaHasta && fechaBaja >= fechaHasta);
} |
ca63dd68-3b95-4141-a43d-bc3545bf5441 | 0 | public void removeCompleteListener(ActionListener listener){
completeListeners.remove(listener);
} |
6695b56a-e8d8-4bb9-815c-7d42974c130b | 2 | private static int createOldStyleIcon(StdImage image, List<byte[]> imageData, List<Integer> imageType, int type) {
int size = image.getWidth();
byte[] bytes = new byte[size * size * 4];
int i = 0;
for (int y = 0; y < size; y++) {
for (int x = 0; x < size; x++) {
EndianUtils.writeBEInt(image.getRGB(x, y),... |
138d5b40-4cfa-4a4d-a3de-7be81a8c3f07 | 7 | @Override
public V put( K key, V value ) {
Node node = mRoot;
Node newNode = new Node( key, value );
if( node == null ) {
insertNode( newNode, node, false );
return null;
}
while( true ) {
if( mComp.compareMaxes( key, node.mMaxStop.mKey )... |
d9aa4f6f-5188-4e15-8331-c04cbab24545 | 3 | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("POST = ");
FacDAO usuarioDAO = (FacDAO) getServletContext().getAttribute("smsManager");
String login = request.getParameter("login");
// ... |
c77de777-71d0-4263-9303-b085f76e08b6 | 6 | public void update(GameContainer container) {
timeout--;
if(timeout == 0 && current == images.size() - 1) {
Board.menuStack.pop();
Board.menuStack.add(new StartMenu());
} else if(timeout == 0) {
timeout = 150;
current++;
} else if((Mouse.isButtonDown(0) || Keyboard.isKeyDown(Keyboard.KEY_SPACE)) ... |
d15f0ddc-0733-4838-adc6-f99c6cffc74f | 4 | public void setPixel(int x, int y, short red, short green, short blue) {
// Your solution here.
assert (x < height && y < width);
assert (0 <= red && red <= 255);
assert (0 <= blue && blue <= 255);
assert (0 <= green && green <= 255);
pixel[y][x].red = red;
pixel[y][x].blue = blue;
pixel[y][x].green = ... |
9771a1a4-bdd4-492f-a655-f7608d6bd5a8 | 7 | public static void materializePrimitiveDescriptionBody(NamedDescription description) {
{ boolean nativeP = description.nativeRelation() != null;
Symbol name = (nativeP ? Symbol.internSymbolInModule(description.nativeRelation().name(), description.nativeRelation().homeModule(), true) : description.descriptionN... |
cd112ac4-f3e3-4136-9b3e-78d6c47b8fa6 | 7 | public static ArrayList<Electrodomestico> getAllElectrodomestico(int montoMin,int montoMax,char consumo)
{
ArrayList<Electrodomestico> colElectrodomestico=new ArrayList<Electrodomestico>();
String sqlFiltros="";
if(montoMin>0)
sqlFiltros=sqlFiltros.concat(" and preciobase>"+montoMin+" ");
if(montoMax>0)
... |
175d09d6-abb6-46d2-b259-14d49333bf87 | 7 | void menuSave() {
if (image == null) return;
animate = false; // stop any animation in progress
// If the image file type is unknown, we can't 'Save',
// so we have to use 'Save As...'.
if (imageData.type == SWT.IMAGE_UNDEFINED || fileName == null) {
menuSaveAs();
return;
}
Cursor waitCursor = dis... |
46e95dd2-490d-4248-b8df-6b939717be71 | 9 | public void validate() throws XPathException {
checkSortComesFirst(false);
select = typeCheck("select", select);
ExpressionLocation locator = new ExpressionLocation(this);
ExpressionVisitor visitor = makeExpressionVisitor();
if (groupBy != null) {
groupBy = typeCheck... |
4f445b6b-9c41-4478-bdf9-9177d8395682 | 0 | public static String getPassword() {
return password;
} |
28b98d06-1005-4d7c-82a6-5aa115a7fd82 | 1 | public ListenerManager(LogOre plugin) {
this.plugin = plugin;
this.listeners.put("block", new BlockListener(this.plugin));
for (Listener l : this.listeners.values()) {
this.plugin.getServer().getPluginManager().registerEvents(l, this.plugin);
}
... |
0f9526bb-ee30-45eb-97bb-f2591da46d5f | 4 | public void setSlot(int slot, ItemStack item) {
if (item != null && item.getType() == Material.AIR) {
item = null;
}
if (slot < 0 || slot >= this.items.length) {
return;
}
this.items[slot] = item;
} |
b79aeea5-6acf-4a2e-ba2b-1ddc4ed7f9c0 | 1 | public int compareTo(Object o) {
if (o.getClass() == MmsParameter.class) {
return name.compareTo(((MmsParameter)o).getName());
}
return name.compareTo((String)o);
} |
328d8429-3406-4b11-8d52-d48439968126 | 5 | public boolean canDraw() {
ArrayList<int[]> moves = board.getMoves();
if (moves.size() >= 5) {
int[] currentMove = moves.get(moves.size()-1);
int[] prevMove = moves.get(moves.size()-5);
if (
currentMove[0] == prevMove[0] &&
currentMove[1] == prevMove[1] &&
currentMove[2] == prevMove[2]
) {
... |
5573963f-3e67-4dcc-9017-5fbf6ef57a97 | 8 | /* */ public Object getMetaPacket(Object watcher)
/* */ {
/* 108 */ Class<?> DataWatcher = Util.getCraftClass("DataWatcher");
/* */
/* 110 */ Class<?> PacketPlayOutEntityMetadata = Util.getCraftClass("PacketPlayOutEntityMetadata");
/* */
/* 112 */ Object packet = null;
/* */ tr... |
db265736-6018-4dd4-83aa-3e96e053c0ea | 5 | public void setManager(Manager manager) {
if (manager != this.manager) {
Manager vorigeManager = this.manager;
this.manager = manager;
if (vorigeManager != null && vorigeManager.getCampus() == this) {
vorigeManager.setCampus(null);
}
if (manager != null && manager.getCampus() != this) {
this.ma... |
4f9652d7-3f66-4e6a-b72b-065520441020 | 8 | public static int[] quickSort(int[] candidates, int start, int end) {
if(start >= end) {
return candidates;
}
int i = start;
int j =end;
int mid = candidates[start];
while(i < j) {
while(j>=start &&candidates[j] > mid) {
j--;
}
if(i>=j) {
break;
... |
26c963ab-2c9a-49fc-aa62-085bc8412a4d | 3 | public static void main(String[] args) {
//generateData();
//Feat.Save();
Feat.Load();
if(Feat.getFeats().isEmpty()) {
generateData();
}
Collection<Feat> feats = Feat.getFeats().values();
try {
Class.forName("com.mysql.jdbc.Driver"... |
ed8a87e6-cc40-4133-ab28-7de3cb3847a6 | 6 | @EventHandler
public void ZombieSlow(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getZombieConfig().getDouble("Zombie.Slow.Dodge... |
a04a853c-3849-406c-8994-66ae5d697a71 | 3 | public BufferedImage getImage() {
try {
BufferedImage bi = (BufferedImage) imageObj.getCache();
if (bi == null) {
byte[] data = null;
ByteBuffer jpegBytes = null;
final boolean jpegDecode = PDFDecoder.isLastFilter(imageObj, PDFDecoder.DCT_... |
302f0b2a-84a4-41c1-ad89-87af1c682056 | 3 | public Car(int bornTime, int dest){
if (bornTime >= 0 && (dest == 1 || dest == 2)) {
this.bornTime = bornTime;
this.dest = dest;
}
else throw new IllegalArgumentException("bornTime >= 0 and dest [1,2]");
} |
f19b8e3b-6750-4dcb-9f4f-5a45fe534d9f | 2 | public void addRoom(Scanner sc) {
long roomID, typeID;
System.out.println("Add a room");
System.out.println("DO you want to add a new type of room or existing type room?");
System.out.println("Enter n/N for new Type and e/E for existing type");
System.out.print("Enter choice: ")... |
2fffea7a-e192-41c2-902b-34ea6fd49080 | 2 | @Override
public boolean accept(File pathname) {
if (pathname.isDirectory()) {
return true;
}
String nombrearchivo = pathname.getName().toLowerCase();
if (nombrearchivo.endsWith(extencion)) {
return true;
}
r... |
3765b212-71ae-47da-8a8b-56df019fe05c | 4 | @Override
public int compare(Drillable one, Drillable two) {
if (one.getLastEdited() == null && two.getLastEdited() == null) {
return 0;
}
if (one.getLastEdited() == null) {
return -1;
}
if (two.getLastEdited() == null) {
return 1;
}
return one.getLastEdited().compareTo(two.getLastEdited());
} |
b108113f-8f08-4500-a5ea-7aba70a0dce3 | 9 | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Version other = (Version) obj;
if (this == ALL || other == ALL) {
return true;
}
if (major != other.major) {... |
7956f5a0-dd2d-4a44-811c-121d90f46a8b | 2 | @Override
public void execute() {
System.out.println("Production Dialog is off..... Turning on");
Constants.PRODUCTION_WIDGET.interact("Toggle Production Dialog");
final Timer timeout = new Timer(2000);
while(timeout.isRunning() && Settings.get(1173)==1879048192) {
Task.sleep(50);
}
} |
9d673825-6af6-4f74-8f8e-e3dc860598c3 | 7 | private String logginUser() {
try {
parameterPart = stringParts[1];
udpPort = Integer.parseInt(stringParts[2]);
} catch (ArrayIndexOutOfBoundsException e) {
return answer = "Error: Please enter the log in command like this: !login <Username>";
} catch (NumberFormatException e) {
return answer = "Error... |
a8fcec61-3091-4ade-858d-703253566b38 | 5 | public boolean wait_event (long timeout_) {
int rc = 0;
try {
if (timeout_ == 0) {
// wait_event(0) is called every read/send of SocketBase
// instant readiness is not strictly required
// On the other hand, we ca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.