method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
02c8d311-34ec-4703-a393-c3440bca32f3 | 0 | public void setBytesRead(long bytesRead)
{
this.bytesRead = bytesRead;
} |
346c14c6-03dc-4d3d-b51a-7684d5b12b92 | 7 | public static void main(String[] args) {
// list (interface) et ArrayList (implementation)
Collection<Integer> integers1 = new ArrayList<>();
integers1.add(1);
integers1.add(2);
integers1.add(3);
for(Integer i : integers1){
System.out.println(i);
}
logger.info("Taille de integers1 "+... |
32d3b682-dbaa-417a-a00d-d0c790770f2a | 4 | public static int getSelectedIndex() {
if (getSelected() == null) {
return -1;
}
RSInterface parent = getInterface();
if (parent.children == null) {
return -1;
}
for (int index = 0; index < parent.children.size(); index++) {
if (parent.children.get(index) == getSelected().id) {
return index;
... |
c4bbf074-14a8-4beb-95fb-409c64b4a499 | 8 | public final boolean equals(final Object object) {
if (this == object) {
return true;
}
if (!(object instanceof Binding)) {
return false;
}
final Binding binding = (Binding) object;
if (!Util.equals(getParameterizedCommand(), binding
.getParameterizedCommand())) {
return false;
}
if (!Uti... |
b814a9ac-91f2-45ef-8ef9-0251514e60cf | 0 | public String toString(){
return "minus ";
} |
d1f3a6aa-ff34-4f85-8645-7164fcdacb53 | 2 | protected void drawTransitions(Graphics g) {
java.awt.Graphics2D g2 = (java.awt.Graphics2D) g;
super.drawTransitions(g);
Iterator it = selectedTransitions.iterator();
while (it.hasNext()) {
Transition t = (Transition) it.next();
try {
arrowForTransition(t).drawHighlight(g2);
} catch (NullPointerExc... |
8ff1ff3e-048a-4d95-b1df-6618d773b2e3 | 5 | public boolean validateTextboxes() {
boolean error = false;
if (txtAname.getText().isEmpty()) {
error = true;
}
if (txtISBNNo.getText().isEmpty()) {
error = true;
}
if (txtName.getText().isEmpty()) {
error = true;
}
if (txtSname.getText().isEmpty()) {
error = true;
}
if (txtTitle.getTe... |
e1164601-fe7c-428e-bb61-88249974d1c4 | 9 | public static String removeComments(String code) {
String codeWithoutComments = "";
char command = 0;
// copy whole code without comments
for (int i = 0; i < code.length(); i++) {
command = code.charAt(i);
if (command == '/') {
command = code.charAt(i + 1);
switch (command)... |
adaea825-530b-4fd2-86e1-d98dfb6f3e30 | 9 | public ProtobufDecoder(String[] classpath, String rootClass,
FieldDefinition[] fields) throws ProtobufDecoderException {
try {
URL[] url = new URL[classpath.length];
for (int i = 0; i < classpath.length; ++i) {
String file = classpath[i];
if (file.startsWith("file://")) {
file = file.substring(... |
195d8472-a3d6-404a-9d75-695a8f284f2b | 4 | @SuppressWarnings("unchecked")
private void checkPartition(String partitionName, String dn,
HashMap attributes) throws Exception {
LoggerFactory.getLogger(this.getClass()).debug("Adding partition:"+partitionName+dn+attributes.toString());
Partition apachePartition = addPartition(partitionName, dn);
// Index ... |
59470256-f9ab-44ed-93db-5161b216da5a | 4 | public boolean isTranslucencySupported(Translucency translucencyKind, GraphicsDevice gd) {
Object kind = null;
switch(translucencyKind) {
case PERPIXEL_TRANSLUCENT:
kind = PERPIXEL_TRANSLUCENT;
break;
case TRANSLUCENT:
kind = TRANSLUCENT;
break;
case PERPIXEL_TRANSPARENT:
kind = PERPIXE... |
a3951cc9-999b-4914-8ab5-27b324e9843a | 4 | @Override
public void onMoveTick(int x, int y, Game game) {
SinglePlayerGame spg = (SinglePlayerGame) game;
Location loc = spg.getFirstSquareNeighborLocation(x, y, 5, zombie.id);
if (loc == null) {
if (filterByID(spg.getSquareNeighbors(x, y, 2), human.id).isEmpty()) {
... |
147171b8-283b-4323-962c-26d753d44d2e | 3 | @Override
public void run() {
long lastTime = System.nanoTime();
double ns = 1000000000.0 / 60.0;
double delta = 0;
long lastTimer = System.currentTimeMillis();
int ticks = 0, frames = 0;
requestFocus();
while (running) {
long now = System.nanoTime();
delta += (now - lastTime) / ns;
lastTime = n... |
31fa7536-bd18-4f83-9321-058b46337dc5 | 4 | @Override
public void handleEvent() {
LogManager.getLogger(FileAppender.class).info("handle event");
try {
int readed, wrote;
while ((readed = pipe.source().read(dst)) != 0) {
if (readed > 0) {
if (readed < dst.capacity()) {
dst.put(System.lineSeparator().getBytes());
}
dst.flip();
... |
e9a542ad-807d-499f-a1a7-1cbab1ff636a | 7 | public void registerEngine(Engine engine) throws EngineException {
final EngineInfo engDep = engine.getClass().getAnnotation(EngineInfo.class);
if (engDep != null) {
String[] depends = engDep.depends();
for (String s : depends) {
if (!isRegistered(s)) {
if (!engineQueue.contains(engine)) {
engi... |
86e75eaa-f996-4036-9fed-c9f6f2249dbe | 9 | public void processPacket(String received) {
stringParts = received.split(" ");
try {
// auction- ended- notification
if (stringParts[0].equals("!auction-ended")) {
String describtion = "";
// user is the highest bidder
if (username.equals(stringParts[1].trim())) {
for (int i = 3; i < st... |
ec0f0bd9-5ba6-4a70-a438-51830c825dcb | 5 | public QuickSort(List liste, int debut, int fin) {
listeComparable = liste;
int gauche = debut - 1;
int droite = fin + 1;
// reset Pivot
pivot = null;
pivot = listeComparable.get(debut);
/* Si le tableau est de longueur nulle, il n'y a rien à faire. */
if... |
72784fce-085e-41ee-bbcc-82fd6bc00d85 | 5 | public SemanticsAnalyzer(Node tree) {
SymbolTable.resetAll();
output = new StringBuilder();
this.generativeTree = tree;
Scanner fr = null;
try {
fr = new Scanner(new File("produkcije.txt"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
String curr = null;
int index = 0;
productio... |
d4f948cd-b242-46b4-b8aa-5b3a1ee36350 | 0 | public static void main(String[] args) {
{
int x = 12;
// Only x available
{
int q = 96;
// Both x & q available
}
// Only x available
// q is "out of scope"
}
{
String s = new String("a string");
}
// System.out.println(s); // Error
} |
188e7b2f-c186-403e-ab5b-7a90854b5892 | 7 | public static void impt() throws Exception {
File f = new File(System.getenv("APPDATA")
+ "//.pokechrome/player.sav");
FileInputStream fstream = new FileInputStream(f);
BufferedReader br = new BufferedReader(new InputStreamReader(
fstream));
String strLine;
while ((strLine = br.readLine()) != null) ... |
f2453edf-fef3-4791-b17b-90100e27d9bf | 0 | void exportAutomaton() {
Environment e = ((EnvironmentFrame) frame).getEnvironment();
AutomatonPane a = new AutomatonPane(drawer);
e.add(a, "Current FA");
e.setActive(a);
} |
fa785219-9311-45c9-beed-bf4275fec644 | 0 | public static int getCount() {
return phones.size();
} |
43e1500f-54bd-481a-af46-28289d5689ae | 1 | @SuppressWarnings("unchecked")
public static <T extends Object> List<T> addArrayToList(List<T> list, T[] obj) {
for(int i = 0; i < obj.length; ++i) {
list.add(obj[i]);
}
return list;
} |
bdc4029e-8ac7-461d-ab7c-8b4db4a2a010 | 0 | public PadSelection() {} |
c357f1aa-f376-4e83-818f-a8b954be2c19 | 6 | public static BooleanWrapper secondp(Stella_Object number) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(number);
if (Surrogate.subtypeOfIntegerP(testValue000)) {
{ IntegerWrapper number000 = ((IntegerWrapper)(number));
return ((((0 <= number000.wrapperValue) &&
... |
d0b2f558-50ed-4bff-86c1-67eacebfb307 | 9 | private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_scanpos.next;
}
if (jj_... |
22dcadfc-a380-429e-924f-36f7568da54b | 3 | public String genContent(String httpUrl) {
Object response = null;
for (String key : requests.keySet()) {
if (httpUrl.endsWith(key)) {
response = requests.get(key);
break;
}
}
if (response instanceof String) {
return (String) response;
}
throw (RuntimeException)... |
71fc7ce9-868d-45fe-bfa3-3dc1981ffe58 | 9 | public void zeigeRaeumeAn(String input, ArrayList<Raum> raumListe) {
Analyser ana = new Analyser();
String[] data = ana.splitArguments(input);
int sort = ana.analyseSort(data[0]);
if (sort == 0) {
Collections.sort(raumListe);
} else if (sort == 1) {
Co... |
ef8702a9-433b-43ed-9996-a071409c94a5 | 2 | public static void remove ( LinkedListNode head ) {
LinkedListNode nd = head;
LinkedListNode pre = null;
HashMap<Integer, Boolean> hm = new HashMap<>();
// travel through the list
while ( nd != null ) {
// 1. check if the data has aldy existed in the HashTable
if ( hm.containsKey(nd.data) ) {
p... |
2b4a372e-2517-4242-9205-4eb3155f9f45 | 0 | public String getQueryRes() {
return queryRes;
} |
feb861ff-289b-422a-b7bd-0c97bc4515bd | 2 | public boolean isSelected(int index) {
if (index < 0 || index >= mSize) {
return false;
}
return mSelection.get(index);
} |
4d7dc696-b595-4e37-9d8c-ce5cc2e21c62 | 5 | public boolean shouldExitLoop() {
if (isDebug) {
if (KeyInput.wasKeyPressed('r')) {
I.say("RESET MISSION?") ;
resetScenario() ;
return false ;
}
if (KeyInput.wasKeyPressed('f')) {
I.say("Paused? "+PlayLoop.paused()) ;
PlayLoop.setPaused(! PlayLoop.paused()) ... |
dfee6ce6-6fa3-4246-b7dd-a39844bda726 | 7 | public int escribir(String nombre, String rutaArchivo) {
InputStream entrada = null;
PreparedStatement pst = null;
int ingresados = 0;
try {
File archivo;
String insert;
z.con.setAutoCommit(false);
insert = "Insert into docu... |
7e45cd57-995c-4aa6-8985-62ea8a5cd5c3 | 8 | public boolean autorizeRemoval (Block block, Player player){
boolean authorized = true; // By default, let it be removed.
if (player != null && plugin.permit(player, "repairchest.destroy")){
authorized = true;
/*
* Basically "do nothing", but this IF block avoids a lot of work for authorized users.
*... |
f2b9b587-cf8b-40ec-9baa-e13df1960299 | 1 | public void visitReturnStmt(final ReturnStmt stmt) {
if (CodeGenerator.DEBUG) {
System.out.println("code for " + stmt);
}
genPostponed(stmt);
stmt.visitChildren(this);
method.addInstruction(Opcode.opcx_return);
// Stack height is zero after return
stackHeight = 0;
} |
e46cb133-5e0f-40cc-b0a3-f102aa5cf9cb | 3 | private void adjustStat(Actor a, int increment){
if(a instanceof Asteroid){
asteroidCount += increment;
} else if(a instanceof Bandit){
banditCount += increment;
} else if(a instanceof BanditBase){
banditBaseCount += increment;
}
} |
407677fc-ad0e-42ae-8c65-f3f649728572 | 8 | @Override
public String getStat(String code)
{
if (CMLib.coffeeMaker().getGenMobCodeNum(code) >= 0)
return CMLib.coffeeMaker().getGenMobStat(this, code);
switch (getCodeNum(code))
{
case 0:
return "" + getWhatIsSoldMask();
case 1:
return prejudiceFactors();
case 2:
return budget();
case 3:
... |
7c613579-504e-4d5e-bcb0-06fc04691ff6 | 0 | public int getSecondID() {
return second_land.getID();
} |
57ccc94e-89d0-4f8c-b865-8e4da8b8c964 | 1 | public int getNumber()
{
int value=0;
if (q.size() > 0)
{
value = (Integer)q.remove();
}
return value;
} |
1c80441b-470c-44da-81fa-5a108f01e6fc | 1 | private static Stock parseStock(String line) {
String[] parts = line.split(",");
if (parts[2].equals("0.00")) {
System.err.println("Stock " + parts[1] + " does not exist!");
return null;
}
Stock s = new Stock(parts[1].replace("\"", ""),
parts[0].re... |
d69c70c5-cc63-41ed-a093-7685ce4126b2 | 0 | public Integer getSuccessCount() {
return successCount;
} |
4438f235-84e6-4f39-b227-6a355745f307 | 1 | public boolean isReleased() {
if(isDisabled())
return false;
return released;
} |
a6c86ee5-6fc3-40d8-9f93-b650dd2dd79e | 9 | final public SimpleNode Start() throws ParseException {
/*@bgen(jjtree) Start */
SimpleNode jjtn000 = new SimpleNode(JJTSTART);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
expression();
jj_consume_token(21);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
{if (... |
1d6c6589-fefc-46f6-9b52-b8d1651e610b | 1 | private MyConnection() {
try {
connection = DriverManager.getConnection(url,login,pwd);
} catch (SQLException ex) {
Logger.getLogger(MyConnection.class.getName()).log(Level.SEVERE, null, ex);
}
} |
c9fc09da-f5ef-4dc6-864b-c80afb13d161 | 1 | @Override
public String[][] getListOfGames(Member member) {
List<Game> gameList = data.getListOfGames(member);
String [][] gameArray = new String[gameList.size()][3];
for(int i=0;i<gameList.size();i++){
gameArray[i][0]=gameList.get(i).getDate().toString();
gameArray[i][1]=gameList.get(i).getMembe... |
a4c86ade-c422-4f7a-a317-c23096943a9c | 5 | private void loadDataToComboboxHMP(){
this.cmbAulaHMP.removeAllItems();
this.cmbDiaHMP.removeAllItems();
this.cmbMateriaHMP.removeAllItems();
this.cmbHorarioHMP.removeAllItems();
this.cmbGrupoHMP.removeAllItems();
this.cmbUsuarioHMP.removeAllItems();
for(String n: this.hmp.listIdAula){
... |
9c79fcfa-9208-42fd-ac45-f4ea4d52f823 | 8 | protected int getEscapeRoute(int directionToTarget)
{
if(directionToTarget < 0)
return directionToTarget;
Room shipR=CMLib.map().roomLocation(loyalShipItem);
if(shipR!=null)
{
int opDir=Directions.getOpDirectionCode(directionToTarget);
if(isGoodShipDir(shipR,opDir))
return opDir;
final List<Int... |
c4a8a6c5-46ae-4a87-af26-7d2a6cb27a8e | 1 | private String showAnnonce(int i) {
String res = "";
//////
if (voyages.length > 0) {
sb.append("Destination");
sb.append(voyages[i].getDestination());
sb.append("\n");
sb.append("Date_depart");
sb.append(voyages[i].getDate_depart());
... |
c5f1582a-2abc-4252-b508-a51e2a38918b | 5 | public static double FindMax (boolean x, double n, List<Point2D> connection_p)
{
double _n = 0;
for (int i = 0; i < connection_p.size(); i++)
{
if(x)
{
double _x = connection_p.get(i).getX();
if (_x > _n)
{
_n = _x;
}
}
else
{
double _y = connection_p.get(i).getY();
do... |
cc202ad4-094f-439e-88da-b0e07f24a3e0 | 1 | public boolean equals(Object o) {
return (o instanceof TreeElement)
&& fullName.equals(((TreeElement) o).fullName);
} |
66f4eafc-c1b4-4cfa-8117-8ee350891503 | 9 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return super.okMessage(myHost,msg);
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS))
&&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL)
&... |
7cf4f50b-8884-4b53-8883-4cfd3cc526d3 | 3 | public static byte[] getUnsignedBytes(BigInteger number, int length) {
byte[] value = number.toByteArray();
if (value.length > length + 1) {
throw new IllegalArgumentException(
"The given BigInteger does not fit into a byte array with the given length: " + value.length
+ " > " + length);
}
byte... |
a463d6ac-324f-483f-a5f5-88c59e5c3d4d | 4 | private boolean read() {
try {
final URLConnection conn = this.url.openConnection();
conn.setConnectTimeout(5000);
if (this.apiKey != null) {
conn.addRequestProperty("X-API-Key", this.apiKey);
}
conn.addRequestProperty("User-Agent", "U... |
3a9c14d6-15ac-49e3-b64c-3ea7dd41c301 | 4 | public InfoNode dealWithPromote(InfoNode infoNode, Node node) {
if(infoNode == null){return null;}
node.add(infoNode.newKey, infoNode.rightChild);
if(node.getSize() <= maxDegree){return null;}
InternalNode sibling = new InternalNode();
int mid = (node.getSize()/2)+1;
int j = 1;
int loopTo = ((InternalNode... |
28971e01-99cd-454a-9ad6-29540ca86932 | 8 | protected void setOrientation(int orientation) {
Integer bigTextTopMargin = null;
Integer installButtonTopMargin = null;
Integer peopleTopMargin = null;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
bigTextTopMargin = 8;
installButtonTopMargin = 6;
... |
29dd6e5d-3ba8-4928-bb52-719a8888ebe9 | 2 | private void compare() {
// 第一次执行compare()时,preScan.size() == 0
if (preScan.size() == 0) {
return ;
}
if (!preScan.equals(cruScan)) {
onChange();
}
} |
37aa4f26-0482-4b92-b84d-722f72b71261 | 0 | @Override
public void receive(Map myCustomEvent) {
applicationEventPublisher.publishEvent(new MyCustomEventApplicationEvent(this, myCustomEvent));
} |
1ae11efb-679a-48d1-9c1e-9fbda5acae6b | 2 | private void initArrays() {
if (data == null || picsize != data.length) {
data = new int[picsize];
magnitude = new int[picsize];
xConv = new float[picsize];
yConv = new float[picsize];
xGradient = new float[picsize];
yGradient = new float[picsize];
}
} |
16e43a6d-c7d5-48ff-9df1-e2ff68f0b622 | 0 | public static void ClearCheckedHostmasks(){ CheckedHostmasks.clear(); } |
738f24ef-1073-49df-be43-ee80d9b96e10 | 7 | private void playButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playButtonActionPerformed
// TODO add your handling code here:
int song = -1;
if (repr.isVisible()) {
song = reprList.getSelectedRow();
if (song != -1) {
playFromRepr... |
c28e9ee7-345d-4544-b28d-a5bcf70bb5a6 | 9 | public static void main(String[] args) {
System.out.println("Printing only even numbers (multiples of two)");
for(int i=0; i<=20; i++){
System.out.println(i++);
}
System.out.println("Printing all number from 0 to 20");
for(int i=0; i<=20; i++){
System.out.println(i);
}
System.out.println("Prin... |
4202cccd-3103-45bd-abe4-cdc13c727711 | 0 | public Limbs(int upgradeCount, String name) {
super(upgradeCount, UpgradeType.Limbs, name);
} |
78f42967-07cd-4213-baa6-4cc1a8b6c1f2 | 7 | public void runGame(int rolls) {
while (totalRolls < rolls) {
// First, check if the piece is currently on a "Chance Card"
// location...
if (board.getChanceLocations().contains(currentLocation))
drawChanceCard();
else {
// ... or a "Community Chest Card" location
if (board.getComChestLocatio... |
e1fa0b41-8d8f-4fad-a53d-f2ed26cd967a | 9 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession(true);
String op = request.getParameter("op");
String userid = "";
String actionUrl = "";
Member user = (Member) session.getAttribute("user");
... |
c8e4e702-93c5-41fc-9143-b20ac19d6d7a | 2 | private static final double distanceBase(double[] coord1, double[] coord2, int order)
{
if (coord1.length != coord2.length)
throw new IllegalArgumentException ("Number of dimensions is not equal");
final int NUM_DIMENSIONS = coord1.length;
double distance = 0;
for (int d = 0; d < NUM_DIMENSIONS; d++) ... |
15846754-7996-4aea-b1a3-b7f5e3b45e15 | 3 | @Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((classMetadata == null) ? 0 : classMetadata.hashCode());
result = prime * result
+ ((fieldMetadata == null) ? 0 : fieldMetadata.hashCode());
result = prime * result
+ ((qualifiedName ... |
540f0914-9325-4817-bafd-7d1ed440f92f | 6 | @Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
SnakePiece other = (SnakePiece) obj;
if (type != other.type)
{
return false;
}
if (x != other.x)
{
return ... |
7abeae4a-96f1-47ae-875c-57f217bd4536 | 6 | public void actionPerformed(ActionEvent ae) {
//
// Process the action command
//
// "new" - Add a price history element
// "delete" - Delete a price history element
// "done" - All done
//
try {
String action = ae.getActionCommand();
... |
3da51c24-6348-4b5d-b5c6-8e2d388e8618 | 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 fe... |
661c9169-4d79-46e3-a208-696624be65ea | 9 | public void giveBonus(MOB mob, Electronics item)
{
if((mob==null)||(item==null))
return;
if((System.currentTimeMillis()-lastCastHelp)<300000)
return;
String experName;
if(CMLib.dice().rollPercentage()>50)
{
final Manufacturer m=item.getFinalManufacturer();
if(m!=null)
{
experName=m.name(... |
0129960c-8d9e-4cc0-833f-707da6f62715 | 9 | protected boolean[] datasetIntegrity(
boolean nominalPredictor,
boolean numericPredictor,
boolean stringPredictor,
boolean datePredictor,
boolean relationalPredictor,
boolean multiInstance,
int classType,
boolean predictorMissing,
boolean classMissing) {
... |
cd2b291a-8427-4b2e-8faa-c07033134605 | 9 | private int makeRandom() {
int num = random.nextInt(6);
if (num == 1 || num == 2 || num == 3) {
num = random.nextInt(4);
if (num == 1 || num == 2 || num == 3) {
num = random.nextInt(4);
if (num == 1 || num == 2) {
num = random.nextInt(4);
if (num == 2) {
num = random.nextInt(4);
}... |
ce469893-9ccd-4026-8e25-2076b67f8bf1 | 4 | @RequestMapping(method = RequestMethod.POST)
public @ResponseBody
JsonResponse uploadAction(@Valid @ModelAttribute(value = "image") Image image,
@RequestParam(value = "captcha_challenge", required=true) String challenge,
@RequestParam(value = "captcha_response", required=true) String response,
Bindin... |
4115d747-856a-43b2-8752-0fd16685a9ab | 7 | @Override
public long deriveMudHoursAfter(TimeClock C)
{
long numMudHours=0;
if(C.getYear()>getYear())
return -1;
else
if(C.getYear()==getYear())
{
if(C.getMonth()>getMonth())
return -1;
else
if(C.getMonth()==getMonth())
{
if(C.getDayOfMonth()>getDayOfMonth())
return -1;
else... |
e1f0899b-3b43-42e9-910e-604561317fa9 | 0 | public String getAccountName() {
return accountName;
} |
b55bd8d3-95b9-4751-9146-968cb061b0d8 | 3 | public Collection<IrodsFile> listFiles() throws IrodsException {
List<IrodsFile> l = new ArrayList<IrodsFile>();
for (File f : irodsFile.listFiles()) {
if (f instanceof IRODSFile && f.isFile()) {
l.add(new JargonFile(conn, (IRODSFile) f));
}
}
return l;
} |
bbe2c181-4f48-4e90-bea2-15da8ca9ca4c | 9 | @Test
public void testVoterVote()
{
String pollId = null;
Socket socket = null;
try {
socket = connectToServer();
} catch (IOException e) {
e.printStackTrace();
}
// send a connection message indicating email address
this.writer.println(MessageFactory.getConnectMessage("test@email.ca"));
/... |
1f89af3c-221c-4960-b2fa-d06b5d3436fa | 9 | public void actionPerformed(ActionEvent e) {
if (ModelerUtilities.stopFiring(e))
return;
Object src = e.getSource();
if (!(src instanceof ActivityButton))
return;
ActivityButton ab = (ActivityButton) src;
String pageGroup = ab.getPageNameGroup();
if (pageGroup == null)
return;
if (question()) {
... |
20bf9e17-21b7-4483-9166-8a23671634be | 8 | public void run() {
this.running = true;
while (this.alive) {
synchronized (this) {
while (this.alive && (!this.running) && (!this.reload)) {
try {
wait();
} catch (InterruptedException e) {
kill();
}
}
}
synchronized (this) {
if (this.alive && this.reload) {
thi... |
3659a4a6-a617-453c-884e-ff3d6a220ef3 | 8 | void selectpanel() {
if(s.gettype().endsWith("bubble")) {
modulepanel.setVisible(false);
carrowpanel.setVisible(false);
dspanel.setVisible(false);
entitypanel.setVisible(false);
bubblepanel.setVisible(true);
arrowpanel.setVisible(false);
... |
9e13545c-941a-40b7-9b8f-84cc860e5e82 | 4 | @Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof Item) {
Item i = (Item) obj;
if (! this.getCode().equals(i.getCode()))
return false;
}
return true;
} |
d80cb424-bff7-4131-98f7-a554b2e91a08 | 4 | private void setCurrentAction(Action action) {
currAction = action;
timeSpentCompletingCurrentAction = 0;
switch(action) {
case MOVE:
timeNeededToCompleteCurrentAction = timeNeededToCommitMove;
break;
case MOVE_COMMITTED:
timeNeededToCompleteCurrentAction = timeNeededToCompleteMove;
break;
... |
6cac98eb-6b09-430b-b44b-bf1229bb1147 | 2 | private void checkStmt() throws SQLException {
if(this.stmt == null || this.stmt.isClosed())
throw new SQLException("Statement not ready.");
} |
a3277c29-eece-474f-a1c3-46be8f2dd91e | 4 | public JLabel getPlayer2Name() {
boolean test = false;
if (test || m_test) {
System.out.println("Drawing :: getPlayer2Name() BEGIN");
}
if (test || m_test)
System.out.println("Drawing:: getPlayer2Name() - END");
return m_player2Name;
} |
9d22585a-3d35-4387-a66d-13e9e1aa02db | 8 | @Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
if((mob==null)||(mob.playerStats()==null))
return false;
if(commands.size()<2)
{
final String pageBreak=(mob.playerStats().getPageBreak()!=0)?(""+mob.playerStats().getPageBreak()):"Disabled";
... |
32178c75-5c79-4dc5-813c-e6cf0ec7a955 | 3 | @Override
public void updateLong() {
super.updateLong();
if(generationTimerEnd == 0) {
resetGenerationTimer();
}
if(generationTimerEnd <= System.currentTimeMillis() && this.isActivated()) {
placeableManager.playerAddItem("Stone", 1);
... |
b0fa9c9f-1b60-401f-bbec-34dc01d77922 | 6 | @Override
public void insertUpdate(DocumentEvent e) {
boolean haveNotEncounteredInvis = true;
char lastChar;
String fieldText = null;
Document doc = (Document)e.getDocument();
try {
fieldText =doc.getText(0, doc.getLength());
} catch (BadLocationException e1) {
e1.printStackTrace();
}
... |
a2679f0f-e546-4500-845c-9dd8b02dfefc | 8 | public void checkPurchase()
{
if(BackerGS.storeVisible)
{
if(CurrencyCounter.currencyCollected < 150)
{
if(Greenfoot.mouseClicked(this))
{
NotEnoughMoney.fade = 200;
boop.play();
}
... |
4c2f4aa9-3b35-4d12-b922-f65c6988f350 | 1 | public Deck getExpiredDeck()
{
if(crdsToRemove.size() == 0){return null;}
return new Deck(crdsToRemove);
} |
8009cffc-1e39-4b3d-86f8-9c04b2acec99 | 3 | public void initializeDataBase(JList<String> log){
ArrayList<String> alstLog = new ArrayList<>();
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url = "jdbc:derby:" + DBName + ";create=true";
alstLog.add("Connecting...");
log.setListData(alstLog.toArray(new String[0]));
Connectio... |
5d3cbcd1-8e6f-4c60-a666-655971738ab6 | 0 | public boolean isEmpty() {
return heap.isEmpty();
} |
312e1185-3706-4d47-baa3-18366ba2ca2b | 7 | Class163(int i, int i_27_) {
if ((i_27_ ^ 0xffffffff) != (i ^ 0xffffffff)) {
int i_28_ = Class348_Sub1_Sub1.method2726(-21806, i, i_27_);
i /= i_28_;
i_27_ /= i_28_;
anIntArrayArray2163 = new int[i][14];
anInt2159 = i_27_;
anInt2164 = i;
for (int i_29_ = 0; (i ^ 0xffffffff) < (i_29_ ... |
8a47c65c-303f-4785-bd7c-66c4cb8d9563 | 2 | private MouseListener mouseListener(){
return new MouseAdapter(){
@Override
public void mousePressed( MouseEvent e ) {
mousePressedPoint = e.getPoint();
}
@Override
public void mouseReleased( MouseEvent e ) {
if( moving ){
for( MoveableCapability item : items ){
item.endMoveAt( e... |
8f957779-8aa6-465a-8abb-3095373dedbe | 3 | private static boolean isPrime(int n) {
boolean result = true; // assume true and try to prove otherwise
int i=2;
while ((i<n) && (result == true)) {
if ((n%i) == 0) {
result = false;
}
i++;
}
return result;
} |
13bb5227-bc8a-4194-9902-9ae7c1397446 | 5 | private void consumeFutureUninterruptible( Future<?> f ) {
try {
boolean interrupted = false;
while ( true ) {
try {
f.get();
break;
} catch ( InterruptedException e ) {
interrupted = true;
}
}
if( interrupted )
Thread.currentThread().interrupt();
} catch ( ExecutionExcept... |
7b969241-c8ab-4a13-9099-4e434c4ddb83 | 2 | void readCdsFile() {
cdsByTrId = new HashMap<String, String>();
if (cdsFile.endsWith("txt") || cdsFile.endsWith("txt.gz")) readCdsFileTxt();
else readCdsFileFasta();
} |
71a4e3b8-3f82-4f67-8a4d-55e7f6e664d8 | 7 | public Board makeBoard() throws InterruptedException {
int x = -1, y = -1;
topLeft:
for(int h = 50; h < Img.getHeight(); h++){
for(int w= 50; w < Img.getWidth(); w++){
int c = Img.getRGB(w, h);
if(w < 50 || h < 50 || w > Img.getWidth()-50 || h > Img.getHeight()-50) //Ignore Bottom and Top
... |
65ab4308-e475-4f59-bf5c-8fbdfd051dd8 | 8 | public LineScore alphabeta_max(int currentDepth, int alpha, int beta, Tuple lastMove) {
if (currentDepth >= depth || board.legalMoves.isEmpty()) {
System.out.println("Board state before eval return:\n" + board);
int eval = board.eval(weights);
evals++;
System.out.println("Returning eval: " ... |
d1ea0757-8a7e-4bfe-a110-39ef31a8bd0c | 4 | public void writeHops() {
// Name,Alpha,Cost,Stock,Units,Descr,Storage,Date,Modified
Debug.print("Write Hops to DB");
try {
PreparedStatement pStatement = conn.prepareStatement("SELECT COUNT(*) FROM hops WHERE name = ?;");
PreparedStatement rStatement = conn.prepareStatement("SELECT COUNT(*) FROM hops WH... |
342fc1fa-6ca1-4bd4-93d8-9b8f1de2b7d9 | 0 | public CheckResultMessage check16(int day) {
return checkReport.check16(day);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.