text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Ball)) return false;
return (super.equals(obj)) && (this.xSpeed == ((Ball) obj).xSpeed) && (this.ySpeed == ((Ball)obj).ySpeed);
} | 3 |
public void updateRanks(DB_Timers timer, Boolean all) {
if (all) {
List<DB_Timers> timers = this.plugin.database.getDatabase().find(DB_Timers.class).findList();
if (timers != null && timers.size() > 0) {
for (DB_Timers timerdata : timers) {
Integer TimerID = timerdata.getId();
HashMap<String, Stri... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
BoundingBox other = (BoundingBox) obj;
if (Double.doubleToLongBits(bottom) != Double
.doubleToLongBits(other.bottom))
return false;
if (... | 7 |
private void testRead(){
String f_name = this.path + Params.nTests + ".txt";
long startTime = 0;
long endTime = 0;
File f = new File(f_name);
FileInputStream fin = null;
try{
fin = new FileInputStream(f);
byte[] buf = new byte[Params.packSize * Params.nPacks];
for(int i = 0 ; i... | 2 |
private void computeUidlCommand(String message) {
String[] cmd = message.split(" ");
// Auf Argument ueberpruefen
if (cmd.length > 1) {
// Es wurde ein Argument gefunden
int n = Integer.parseInt(cmd[1]);
// -ERR Antwort, wenn Mail geloescht wurde
if (mailIsDeleted(n)) {
try {
writeToClient("-... | 7 |
public OSCPacket() {
} | 0 |
public boolean inBorders(Crossing c) { //Don't know if commenting out this makes it work. huh
double tolerance = 0.00001;
if (c.atInf()) {
if (c.atNegInf() && leftborder) {
return false;
}
if (!c.atNegInf() && rightborder) {
return false;
}
}
if (leftborder && c.crAt() < leftb-tolerance) { r... | 9 |
public Personaje(InterfazPersonaje tipo, Juego g, Ventana window, int x, int y) throws IOException{
this.posX = x;
this.posY = y;
this.game = g;
this.tipoPersonaje = tipo;
this.tipoPersonaje.cambiarPoder(this);
this.tipoPersonaje.cambiarImagenes(this);
this.escudo = this.espada = this.gema = false;
if... | 6 |
public void openConnection() {
System.out.println("-------- Oracle JDBC Connection Testing ------");
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your Oracle JDBC Driver?");
... | 3 |
public void run() {
/* if (Frame.clickButton.isVisible())
{
}
else
{
}
if (buttonHaveBeenClicked)
{
buttonHaveBeenClicked = false;
if (timer.get_ticks() == 1000 - (score * 100))
{
buttonHaveBeenClicked = false;
}
if((score >= 10) && (buttonSize >= 20)) {
buttonSi... | 6 |
protected void calcIntegValue() {
double a = 0.0, b = 0.0;
double eps = 1e-4;
double result = 0.0;
try {
a = Double.parseDouble(lowTextField.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "积分下限输入错误,请检查重输。");
lowTextField.requestFocus();
lowTextField.selectAll(... | 9 |
public void hideAll() {
defaultVisible = false;
visibleNodes.clear();
} | 0 |
public SimpleStringProperty cityCodeProperty() {
return cityCode;
} | 0 |
private void shutdownOpenGL() throws Exception
{
log("Shutting down OpenGL");
if (Keyboard.isCreated())
{
log("Destroying keyboard");
Keyboard.destroy();
}
if (Mouse.isCreated())
{
log("Destroying mouse");
Mouse.destroy();
}
if (Display.isCreated())
{
log("Destroying d... | 3 |
public UnboundGrammar() {
setStartVariable("S");
} | 0 |
public void run() {
while (!generator.isCanceled()) {
int val = generator.next();
if (val % 2 != 0) {
System.out.println(val + " not even!");
generator.cancel(); // Cancels all EvenCheckers
}
}
} | 2 |
public void makeMove(int position, int player){
if (validMove(position,player)){
updateGameField(position,player);
this.changeTurn();
}
} | 1 |
public static Color biomeToColor(byte b) {
switch (b) {
case DESERT:
return DESERT_COLOR;
case SAVANNAH:
return SAVANNAH_COLOR;
case SWAMP_RAIN_FOREST:
return SWAMP_RAIN_FOREST_COLOR;
case MODERATE:
return MODERATE_COLOR;
case TUNDRA:
return TUNDRA_COLOR;
default:
return MODE... | 5 |
public static int[] contains(String position) {
int[] v = new int[2];
for (int i = 2; i < 10; i++) {
for (int j = 2; j < 10; j++) {
for (int k = 2; k < 10; k++) {
for (int l = 2; l < 10; l++) {
if (position.equals(boardOfMoves[i][j... | 5 |
public void insertTag(Tag tag, int index) {
if (type != Type.TAG_List && type != Type.TAG_Compound)
throw new RuntimeException();
Tag[] subtags = (Tag[]) value;
if (subtags.length > 0)
if (type == Type.TAG_List && tag.getType() != getListType())
throw new ... | 6 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS-... | 9 |
private void updatePhysicalEntityList() {
allPhysicalEntities = new ArrayList<Mob>();
for (Mob m : dots)
allPhysicalEntities.add(m);
for (Mob m : polygons)
allPhysicalEntities.add(m);
} | 2 |
public String runMacro(HTTPRequest httpReq, String parm)
{
final String last=httpReq.getUrlParameter("COMPONENT");
if(last==null)
return " @break@";
if(last.length()>0)
{
final String fixedCompID=last.replace(' ','_').toUpperCase();
final List<AbilityComponent> set=new Vector<AbilityComponent>();
i... | 9 |
@Override
public Key select(int rank)
{
if (rank < 0 || rank >= N)
return null;
return keys[rank];
} | 2 |
@Override
public void keyPressed(KeyEvent arg0) {
inputEvents.addLast(arg0);
} | 0 |
public static String getTime() {
Calendar cal = Calendar.getInstance();
String hour = String.valueOf(cal.get(Calendar.HOUR_OF_DAY));
if (hour.length() == 1) {
hour = "0" + hour; //pad with zero for 0..9
}
String min = String.valueOf(cal.get(Calendar.MINUTE));
if (min.length() == 1) {
min = "0" ... | 3 |
public static boolean isPrime(long num)
{
if (num<2)
return false;
if (num==2)
return true;
if (num%2==0)
return false;
for (long i = 3; (i*i)<=(num); i+=2)
{
if (num%i == 0)
return false;
}
return true;
} | 5 |
public void drawSprite(int i, int k)
{
i += anInt1442;
k += anInt1443;
int l = i + k * DrawingArea.width;
int i1 = 0;
int j1 = myHeight;
int k1 = myWidth;
int l1 = DrawingArea.width - k1;
int i2 = 0;
if(k < DrawingArea.topY)
{
int j2 = DrawingArea.topY - k;
j1 -= j2;
k = DrawingArea.topY;
... | 6 |
public static void main(String[] args) throws Exception {
if (args != null && args.length > 0) {
ResourceBundleUtil.init(args[0].substring(0, args[0].lastIndexOf(".")));
}
TestRunner.rowCounter = new AtomicCounter(Integer.parseInt(get("base.row")));
rowCounter.getPrevousValu... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DateDTO other = (DateDTO) obj;
if (!Objects.equals(this.year, other.year)) {
return false;
... | 8 |
private void fillTileArrays() {
for (int i = 0; i < pixels.length; i++) {
for (int j = 0; j < pixels[0].length; j++) {
int value = mapImage.getRGB(i, j);
value = value & 255;
pixels[i][j] = value > 0 ? 3 : 0;
if (value == 0) {
... | 6 |
private void encode(Object value)
{
this.value = value;
if (value==null)
{
type = 1;
return;
}
if (value instanceof Dubble) encodeDouble();
if (value instanceof Bool) encodeBool();
if (value instanceof VLQ) encodeVLQ();
if (value instanceof VLQString) encodeVLQString();
... | 5 |
@Override
public void actionPerformed(ActionEvent arg0)
{
if (colorGain)
colorN += 3;
else
colorN -= 5;
if (colorN >= 200)
colorGain = false;
else if (colorN <= 30)
colorGain = true;
if (!seen)
{
if(frame.getTutorial() <= 4)
{
tutorial = true;
hero.setPaused(true);
if (tutori... | 9 |
@Override
public void mouseClicked(MouseEvent event) {
if (frame.getCurrentPlayer().getPlaysLeft() != 0 && !frame.isGameOver()) {
int row = (int) Math.round(4.0 / 3.0 * (event.getY() - 40.0)
/ HEX_HEIGHT);
int col = (int) Math.round((event.getX() - 40 - 0.5 * HEX_WIDTH
* (5 - row))
/ HEX_WIDTH);... | 6 |
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
for(int x = 0; x < maxFields; x++){
for(int y = 0; y < maxFields; y++) {
this.field = map.get(x).get(y); ... | 5 |
public ColorResource(int a, int r, int g, int b) {
this.a = a;
this.r = r;
this.g = g;
this.b = b;
} | 0 |
public boolean sLeft(){
boolean change = false;
//i -> y | j -> x
for (int i = 0 ; i < 4 ; i ++){
for (int j = 0; j < 4 ; j++) {
if(mLeft(j, i))
change = true;
}
if (aLeft(i))
change = true;
}
if (change){
//System.out.println(change); //debug
genTile();
}
return change;
... | 5 |
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
if (event.getFrom().getWorld() == event.getTo().getWorld() &&
event.getFrom().getBlockX() == event.getTo().getBlockX() &&
event.getFrom().getBlockY() == event.getTo().getBlockY() &&
event.getFrom().getBlockZ() == event.getTo().getBlockZ())
... | 8 |
@Override public SimOrgNode update( SimNode rootNode, long timestamp, Message m, List<Message> messageDest ) {
if( timestamp < nextAutoUpdateTime && !BitAddressUtil.rangesIntersect(m, minId, maxId) ) return this;
for( int i=0; i<childs.length; ++i ) {
SimNode newChild = childs[i].update( rootNode, timestamp, ... | 8 |
public void actionPerformed(ActionEvent arg0) {
if (arg0.getSource() == internalView.getNextMonthButton()) {
internalModel.getModel().addMonth(1);
}
else if (arg0.getSource() == internalView.getPreviousMonthButton()) {
internalModel.getModel().addMonth(-1);
}
else if (arg0.getSource() == intern... | 6 |
public void setEscapes(String escapes, String replacements){
int length = escapes.length();
if (replacements.length() < length){
length = replacements.length();
}
this.escapes = escapes.substring(0, length);
this.replacements = replacements.substring(0, length);
} | 1 |
private void JBEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBEditarActionPerformed
this.zerarModelo();
int crm;
try{
int linha = JTListaMedico.getSelectedRow();
if( linha >= 0){
crm = (int) JTListaMedico.getValueAt(linha,0);
... | 4 |
public ArrayList<Employee> AllEmployeesInFranchise(int FranID)
throws UnauthorizedUserException, BadConnectionException
{
PreparedStatement pStmnt = null;
ArrayList<Employee> BPList = new ArrayList<Employee>();
// Get the employee type through JClIO instance
lio = JC... | 8 |
public static void main(String[] args) {
System.out.println("Which kind of connection should be established?");
System.out.println("typ 1 for a anonymous session");
System.out.println("typ 2 for a user+password session");
Scanner scanner = new Scanner(System.in);
int input;
input = scanner.nextInt();
... | 2 |
public void setContactName(String contactName) {
this.contactName = contactName;
} | 0 |
public int getRowDividerHeight() {
return mShowRowDivider ? 1 : 0;
} | 1 |
public void mouseReleased(MouseEvent evt) {
if (mousein == 1 && evt.getSource()==buy){
settle();
calcStats();
refresh();
}
if (mousein == 2 && evt.getSource()==ok){
settle();
setVisible(false); //you can't see me!
dispose(); //Destroy the JFrame object
}
if (mousein == 3 && evt.ge... | 6 |
public float getHeight(float x, float y, float z)
{
if(x < 0 || y < 0 || z < 0 || x >= xyz[0] || y >= xyz[1] || z >= xyz[2])
{
return 1;
}
int tile = tiles[(int)x][(int)y][(int)z].type;
switch (tile)
{
case 0: //empty
return -1;... | 8 |
private boolean formatFilePaths(){
//If the inputFilePath is empty turn result false
boolean result = true;
if(inputFilePath.equals("")){
result = false;
} else {
String findExtension = "(.*)\\.txt$";
//String findSRC ="src\\/";
//String findFile = "(src\\/)?(.*)\\.txt$";
Pattern ... | 6 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
setEnabled(false);
addActionListener(this);
Outliner.documents.addDocumentRepositoryListener(this);
} | 0 |
public boolean add(String key, int ttlSec, Object value, long timeoutMiliSec)
throws TimeoutException {
try {
StringBuilder sb = new StringBuilder();
byte valueBytes[] = null;
int flag = -1;
if (value instanceof String) {
String arg = (String) value;
valueBytes = arg.getBytes(charset);
fla... | 5 |
public JFrame getFrame() {
return frame;
} | 0 |
private static void loadLibraries() throws Exception {
/* load all software libraries */
int lwjgl = 0;
for(File file : new File("libs").listFiles()) {
String name = file.getName();
if(!name.endsWith(".jar")) {
continue;
}
if(name.contains("lwjgl")) {
++lwjgl;
}
addSoftwareLibrary(file);... | 6 |
public static double estimateGoalCost(Proposition goal) {
{ Keyword testValue000 = goal.kind;
if ((testValue000 == Logic.KWD_ISA) ||
((testValue000 == Logic.KWD_FUNCTION) ||
(testValue000 == Logic.KWD_PREDICATE))) {
{ NamedDescription description = Logic.getDescription(((Surrogat... | 6 |
public ChatPanel(User user){
Dimension channelListSize = new Dimension(190, 450);
this.dbCon = DatabaseConnection.getInstance();
this.user = user;
this.updater = new ChannelListUpdater();
this.imgLdr = new GUIImageLoader();
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
setBorder(BorderFactory.creat... | 1 |
public static void SenderOTs(Circuit c, Formatter f, OT ot,
ObjectOutputStream oos, ObjectInputStream ois)
{
Vector<OTTASK> OTs = new Vector<OTTASK>(10, 10);
IO io = null;
// Construct vector of all OTs to be executed
for (int i = 0; i < f.FMT.size(); i++) {
io =... | 4 |
public void onEnable() {
PluginDescriptionFile pdf = getDescription();
// Load configuration
FileConfiguration config = this.getConfig();
boolean configChanged = false;
if (config.get("build.message") == null) {
config.set("build.message", config.getString("message", "You don't have permission to build!")... | 9 |
@Override
protected boolean isDirty()
{
boolean dirty = super.isDirty();
if (dirty)
{
return true;
}
else if (isCheckingDirtyChildPainters())
{
for (Painter<T> p : painters)
{
if (p instanceof AbstractPainter)
{
AbstractPainter<?> ap = (AbstractPainter<?>) p;
if (ap.isDirty())
... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Book other = (Book) obj;
if (available != other.available)
return false;
if (readingCounter != other.readingCounter)
return false;
if (... | 9 |
private List<PTM> remapParentPtms(PTM currentPTM) {
List<PTM> resultPTMs = new ArrayList<PTM>();
for(Comparable parent: ((PSIModPTM)currentPTM).getParentPTMList()){
PSIModPTM psiModPTM = (PSIModPTM) psiModController.getPTMbyAccession((String) parent);
if(psiModPTM.getUnimodId() !... | 5 |
@Override
public void run() {
while (!isExit)
{
lock.lock();
for(Map.Entry<Integer, PlayerConnection> entry : clients.entrySet())
{
PlayerConnection connection = entry.getValue();
connection.listenSocket();
}
try
{
await.awaitNanos(20);
} catch (InterruptedException e)
{
e... | 3 |
private void findOpeningBracket(String str, boolean sign) throws ParseException
{
Matcher matcher = Pattern.compile(sign ? "\\s*([+-]?)\\(" : "\\s*\\(").matcher(str);
if (!matcher.lookingAt())
{
throw new ParseException("(", offset);
}
if (sign)
{
... | 3 |
public Collision checkCollision(Game g)
{
int snakeX = g.getSnake().getX();
int snakeY = g.getSnake().getY();
GameBoard gb = g.getGameBoard();
String coordKey = g.getObjectRegister().createCoordinateKey(new Coordination(snakeX, snakeY));
// Koli... | 8 |
public Configuration loadEmbeddedConfig(final String resource) {
final YamlConfiguration config = new YamlConfiguration();
final InputStream defaults = this.getResource(resource);
if (defaults == null) return config;
final InputStreamReader reader = new InputStreamReader(defaults, Custo... | 3 |
@Override
public String toString()
{
String result = "[";
Queue<MapNode> q = new Queue<>();
if (!isEmpty()) q.enqueue((MapNode)root);
while (!q.isEmpty())
{
MapNode n = q.dequeue();
if (n.left != null) q.enqueue((MapNode)n.left);
if (... | 4 |
private void onStartFlush(Address flushStarter, Message msg, FlushHeader fh) {
if (stats) {
startFlushTime = System.currentTimeMillis();
numberOfFlushes += 1;
}
boolean proceed = false;
boolean amIFlushInitiator = false;
Tuple<Collection<? extends Address>... | 7 |
@Override
public boolean processBuffer()
{
// Stream buffers can only be queued for streaming sources:
if( errorCheck( channelType != SoundSystemConfig.TYPE_STREAMING,
"Buffers are only processed for streaming sources." ) )
return false;
// Ma... | 5 |
@Override
public void run() {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
System.out.println("Cant load JDBC driver.");
}
DataInputStream in;
DataOutputStream out;
String message;
Con... | 9 |
public boolean isChanged()
{
if (name != nameSave || sizeInformation() != sizeSave) {
nameSave = name;
sizeSave = sizeInformation();
return true;
}
return false;
} | 2 |
public static byte[] gzip(String input) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream gzos = null;
try {
gzos = new GZIPOutputStream(baos);
gzos.write(input.getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace... | 3 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
out = new StringBuilder();
ring = new int[16];
int times = 1;
while ((line = in.readLine()) != null && line.length() != 0) {
if (times != 1)
out.appe... | 3 |
public void closeSession(){
try{
bf.close();
pf.close();
s.close();
}catch(IOException io){
System.out.println("echec de fermeture");
io.printStackTrace();
}
} | 1 |
public void doInsert_jdbc6(ParamHolder myParamHolder) {
try {
PreparedStatement pstmt = myParamHolder.conn.prepareStatement("insert into "+myParamHolder.table.toUpperCase()+"( file_name, "+myParamHolder.clobFieldName.toUpperCase()+", file_tag) values ( ? ,? , ?)");
pstmt.setString(1, my... | 7 |
public VueVisiteur(CtrlAbstrait ctrl) {
super(ctrl);
initComponents();
modeleJComboBoxVisiteur = new DefaultComboBoxModel();
modeleJComboBoxLabo = new DefaultComboBoxModel();
modeleJComboBoxSecteur = new DefaultComboBoxModel();
jComboBoxVisiteur.setModel(modeleJComboB... | 0 |
public java.io.Serializable fromDOM(Document document) {
Map e2t = elementsToText(document.getDocumentElement());
String expression = (String) e2t.get(EXPRESSION_NAME);
if (expression == null)
if (e2t.containsKey(EXPRESSION_NAME))
throw new ParseException("Regular expression structure has no "
+ EXPR... | 2 |
public static void changeMemberSurname(String surname, int memberID){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
PreparedStatemen... | 4 |
public List<PersonasDTO> getDataPersonas() throws Exception {
try {
List<Personas> personas = XMLHibernateDaoFactory.getInstance()
.getPersonasDAO()
.findAll();
List<P... | 8 |
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... | 6 |
private void alustaTaso(int i) {
/**
* Tason lukeminen ja parsiminen tiedostosta, ja sen asettaminen
* pelaajalle
*/
try {
Tiedostonlukija lukija = new Tiedostonlukija("src/tasot/" + i + ".txt");
TasonLuonti luonti = new TasonLuonti(lukija.getRivit());
... | 2 |
public void makeMove(Location loc)
{
if (loc.equals(getLocation()))
{
double r = Math.random();
int angle;
if (r < 0.5)
angle = Location.LEFT;
else
angle = Location.RIGHT;
setDirection(getDirection() + angle)... | 2 |
public static void main(String[] args) throws InterruptedException {
final BlockingQueue<Integer> blockingQueue = new BlockingQueue<>(10);
final Random random = new Random();
Thread t1 = new Thread(new Runnable() {
public void run() {
try {
while (... | 5 |
public static void unsetFlag(BoardModel boardModel, Point point) {
Cell currentCell = boardModel.getBoard()[point.getPosX()][point.getPosY()];
if (boardModel.getNumberOfFlags() < boardModel.getNumberOfMines() && currentCell.isFlagged()) {
currentCell.setFlagged(false);
boardMode... | 2 |
public List<Word> sentenceProcess(String sentence) {
List<Word> tokens = new ArrayList<Word>();
int N = sentence.length();
Map<Integer, List<Integer>> dag = createDAG(sentence);
Map<Integer, Pair<Integer>> route = calc(sentence, dag);
int x = 0;
int y = 0;
... | 8 |
protected void insertRecords(PreparedStatement stmt, Importer importer) throws IOException, SQLException {
int recordCount = 0;
int insertedCount = 0;
int errorCount = 0;
while (true) {
Object[] row = importer.nextRow();
if (row == null || row.length == 0) {
... | 8 |
@Override
public void keyReleased(int key, char c) {
if(key == 57) { //space
checkDialogs();
}
if(!inputEnabled)
return;
ArrayList<GameKeyListener> keyListenersCopy = new ArrayList<GameKeyListener>(keyListeners); //Create a copy because scripts can register keyrelease components.
System.out.println(... | 3 |
public static void main(String[] args) {
String[] sortedData;
SortOperations so = new SortOperations();
MyFileReader rf = new MyFileReader();
String fileContent;
if (args.length == 2 && 0 == args[0].compareTo("-r")) {
fileContent = rf.readFile(args[1]);
St... | 4 |
@Override
public void init(GameContainer container) throws SlickException {
board = new GameBoard();
selected = new int[2];
select = false;
wturn = true;
black = new chess_game.NPC(false);
//Create the players
players = new ChessPlayer[2];
pl... | 0 |
@Override
public void extract() {
Thread extract = new ExtractThread();
extract.start();
} | 0 |
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e)) {
resetPath();
repaint();
return;
}
for (int i = e.getX() - pRadius; i<e.getX()+pRadius; i++) {
for (int j = e.getY() -pRadius; j<e.getY()+pRadius; j++) {
Node temp = myGraph.nodeAt(i, j);
... | 7 |
public void updateGemsInBag(String newTheme)
{
for(int loop = 0; loop<Bag.size(); loop++)
{
Gem temp = (Gem) Bag.get(loop);
temp.setNewImage(newTheme+"Gem.png");
}
} | 1 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int score = Integer.parseInt(in.next());
if (score > 85) {
System.out.println("A");
} else if (score > 75) {
System.out.println("B");
} else if (score > 65) {
System.... | 4 |
public void writeTableToFile(GetLectureTweets lt, GetTagTweet tt, GetToTweet totw, String tag, String tagStartDate, String tagStartTime, String tagEndDate, String tagEndTime, String svTwUni, String lectureStartDate, String lectureStartTime, String lectureEndDate, String lectureEndTime, String lectureName){
... | 8 |
public int calculoElevacao(JButton button, String grausDigitado) {
int graus = Integer.parseInt(grausDigitado);
try {
if ("Elevação".equals(button.getActionCommand())) {
System.out.println("**************ELEVAÇÃO*********************");
if (graus >= 0 && graus... | 7 |
@Override
public String toString() {
return String.format("%1$-15s %2$-5d %3$-7s %4$13d",
getAddress().getHostAddress(), getPort(),
isOnline() ? "online" : "offline", getUsage());
} | 1 |
public static void parser(File fIn, Socket sckIn, EzimContact ecIn)
{
Hashtable<String, String> htHdr = null;
InputStream isData = null;
String strCType = null;
String strCLen = null;
long lCLen = 0;
try
{
isData = sckIn.getInputStream();
htHdr = EzimDtxSemantics.getHeader(fIn);
strCType = htHd... | 7 |
private void verifyBranches() throws AssemblyException {
int maxLabelLength = 0;
for (int i = 0; i < lines.size(); ++i) {
String label = lines.get(i).label;
if (label != null) {
if (label.length() > maxLabelLength)
maxLabelLength = label.length();
if (branches.containsKey(label))
throw new A... | 9 |
private void kingBottomLeftPossibleMove(Piece piece, Position position)
{
int x1 = position.getPositionX();
int y1 = position.getPositionY();
if((x1 >= 1 && y1 >= 1) && (x1 < maxWidth && y1 < maxHeight))
{
if(board.getChessBoardSquare(x1-1, y1-1).getPiece().getPieceType() != board.getBlankPiece().getPiec... | 6 |
@Override
public String execute(SessionRequestContent request) throws ServletLogicException {
String page = ConfigurationManager.getProperty("path.page.hotels");
try {
Criteria criteria = new Criteria();
Hotel currHotel = (Hotel) request.getSessionAttribute(JSP_CURRENT_HOTEL)... | 3 |
private void setType(int type) {
if (type == 0){
units1 = new JComboBox<Object>(LengthUnits.values());
units2 = new JComboBox<Object>(LengthUnits.values());
} else if (type == 1){
units1 = new JComboBox<Object>(AreaUnits.values());
units2 = new JComboBox<Object>(AreaUnits.values());
} else if (type ==... | 7 |
private Object getIndexOf(Object o, int index) {
if (index == -1) {
return o;
}
if (o instanceof List<?>) {
List<?> list = (List<?>) o;
if (index < list.size()) {
return list.get(index);
} else {
return 0;
... | 6 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.