text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void mouseButtonEvent(MouseEvent event) {
if (event.isConsumed())
return;
int m = event.getModifiersEx() & MODIFIER_MASK;
if (event.getButton() == MouseEvent.BUTTON2)
m &= ~MouseEvent.ALT_DOWN_MASK;
if (event.getButton() == MouseEvent.BUTTON3)
m &= ~MouseEvent.META_DOWN_MASK;... | 7 |
private boolean isGewonnen(Figur[] figurenArray, int[][] zielPos) {
boolean besetzt;
for (int zielNr = 0; zielNr < zielPos.length; zielNr++) {
besetzt = false;
for (Figur figur : figurenArray) {
if (figur.getZeile() == zielPos[zielNr][0]
&& figur.getSpalte() == zielPos[zielNr][1]) {
besetzt ... | 5 |
public void startClient() {
localPlayer = new Player("O", this.nextMove);
final Client gameClient = new Client(localPlayer, nextMove, this.whoseTurn);
gameClient.addGameEventListener(this);
try {
gameClient.connect();
remotePlayer = gameClient.waitForServerPlayer... | 2 |
private int checkState() {
int win = -1;
if (checkDiagonal(0)) {
win = board[0][0];
} else if (checkDiagonal(2)) {
win = board[0][2];
}
//проверка остальных линий
if (win == -1)
for (int i = 0; i < board.length; i++) {
... | 8 |
public void applyGravity(List<GameObject> nearby) {
boolean[] surroundings = checkSurroundings(nearby);
// array[0] = north, surroundings[1] = south, surroundings[2] = east, surroundings[3] = west
boolean north = surroundings[0];
boolean south = surroundings[1];
boolean east = surroundings[2];
boolean west ... | 9 |
private String establishSocks5UploadConnection(Socket connection) throws XMPPException, IOException {
OutputStream out = new DataOutputStream(connection.getOutputStream());
InputStream in = new DataInputStream(connection.getInputStream());
// first byte is version should be 5
... | 7 |
public void testJIoSocket() throws Exception
{
ServerSocket serverSocket = new ServerSocket(10002);
Socket socket = null;
try
{
while (true)
{
socket = serverSocket.accept();
System.out.println("socket连接:" + socket.getRemoteSock... | 5 |
@Override
public boolean action() throws JSONException {
Output.printClockLn("HopTop-Feld", Output.INFO);
Control.sleep(10);
JSONObject set = Utils.getJSON("bundesklatsche/set_hoptop/"
+ getResult().getJSONObject("char").getInt("beute"));
int code = Math.round(((set.getInt("srn") * 5 + 234) * 2 - 1104) /... | 1 |
@Override
public boolean addItemToInventory(Item item) {
for (int i = 0; i < contains.length; i++){
if (contains[i] == null){
contains[i] = item;
return true;
}
}
return false;
} | 2 |
public boolean istGroesseAendernUnproblematisch(int breite, int hoehe)
{
assert breite > 0 : "Vorbedingung verletzt: breite > 0";
assert hoehe > 0 : "Vorbedingung verletzt: hoehe > 0";
if(breite < _buttons.length)
{
for(int y = 0; y < getHoehe(); ++y)
{
for(int x = breite; x < getBreite(); ++x)
... | 8 |
private void addCrew() {
squareSelector.reset();
squareSelector.setCriteria(new SquareCriteria() {
private final String desc = "Add: Crew";
public String getDescription() { return desc; }
public boolean isSquareValid( SquareSelector squareSelector, int roomId, int squareId ) {
if ( roomId < 0 || squa... | 6 |
public void stockShelves() {
if (level == 1 || level ==2 || level ==3) {
merchandise[0] = new Weapon(10, 50, "Shitty Axe", 1);
merchandise[1] = new Armor(5, 40, "Cardboard Chest Plate", 2);
merchandise[2] = new Shield(2, 2, "Basic Shield", 2, 2);
merchandise[3] = new Consumable(10, "Weak Healing Potion", ... | 3 |
public void spawnWave(Client c) {
if (c != null && c.inBarbDef) {
c.getCombat().resetPrayers();
if (c.barbWave >= WAVES.length) {
endGame(c, true);
c.barbWave = 0;
return;
}
if (c.barbWave < 0)
return;
int npcAmount = WAVES[c.barbWave].length;
for (int j = 0; j < npcAmount; j++) ... | 7 |
static int Load() {
try {
javaPath = new JavaPathMgmt(configBean);
if (!Load.It().InitNative(javaPath, "")) {
return 0; // user cancelled
}
if (Load.It().Init()) {
passwordImageMgmt = new PasswordImageM... | 8 |
private void refreshFootprints() {
for (int i = 0; i < numSlots; i++) {
refreshFootprint(i);
}
} | 1 |
public final synchronized Phasor readPhasor(){
this.inputType = true;
String word="";
Phasor ph = null;
if(!this.testFullLineT) this.enterLine();
word = nextWord();
if(!eof)ph = Phasor.parsePhasor(word.trim());
... | 2 |
public void visiteurSelectionner (){
Visiteur visiteurSelect = (Visiteur) getVue().getjComboBoxVisiteur().getSelectedItem();
getVue().getTxtNom().setText(visiteurSelect.getNom());
getVue().getTxtPrenom().setText(visiteurSelect.getPrenom());
getVue().getTxtAdrs().setText(visiteurSelect.ge... | 0 |
private RouteLength currentShortestLength()
{
RouteLength shortestRouteLength = new RouteLength();
if (routes.size() > 0)
{
shortestRouteLength = routes.get(0).getLength();
}
return shortestRouteLength;
} | 1 |
public Grid extend(PointDouble values) {
double minX;
double maxX;
double minY;
double maxY;
double distance;
Grid result;
// left
if (Utils.smOrEq(values.getX(), getMinX())) {
distance = getMinX() - values.getX();
// exactly on grid point?
if (Utils.eq(distance... | 9 |
public static void main(String[] args) {
// we use Integer wrapper class because
// the parameter expects a subclass of Object, and
// not a primitive type
HashMap<Integer, String> mapOfPlanets = new HashMap<Integer, String>();
mapOfPlanets.put(1, "Mercury");
mapOfPlanets.put(2, "Venus");
mapOfPlanets.pu... | 2 |
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 |
public boolean needsBraces() {
return declare != null && !declare.isEmpty();
} | 1 |
public void merge(VariableSet vs) {
for (int i = 0; i < count; i++) {
LocalInfo li = locals[i];
int slot = li.getSlot();
for (int j = 0; j < vs.count; j++) {
if (li.getSlot() == vs.locals[j].getSlot())
li.combineWith(vs.locals[j]);
}
}
} | 3 |
public static Texture loadTexture(final String textureLocation)
throws IOException
{
if (!FILE_NAME_TO_TEXTURE.containsKey(textureLocation))
{
final BufferedImage bufferedImage = ImageIO.read(new File(
textureLocation));
final int[] pixels = new int[bufferedImage.getWidth()
* bufferedImage.getHe... | 3 |
public Point getTileCollision(Sprite sprite,
float newX, float newY)
{
float fromX = Math.min(sprite.getX(), newX);
float fromY = Math.min(sprite.getY(), newY);
float toX = Math.max(sprite.getX(), newX);
float toY = Math.max(sprite.getY(), newY);
// get the tile loca... | 5 |
public static void main(String[] args) {
int count;
String message = "";
String result = "";
checking = new Account("",200,Account.ACCOUNT_CHECKING);
savings = new Account("",1000,Account.ACCOUNT_SAVINGS);
// Set up name database, normally this ould be done in a ... | 7 |
@EventHandler
public void BlazeWither(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.getBlazeConfig().getDouble("Blaze.Wither.Dodg... | 6 |
private Color getSolulleVari(int miinoja) {
switch (miinoja) {
case 1:
return Color.BLUE;
case 2:
return Color.GREEN;
case 3:
return Color.RED;
case 4:
return Color.BLACK;
case 5:
... | 7 |
public void generateTable(int n) {
table = new JTable(n, n);
scrollPane = new JScrollPane(table);
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setHorizontalAlignment(JLabel.CENTER);
for (int i = 0; i < table.getColumnCount(); i++) {
ta... | 7 |
@Override
public Iterator<T> iterator() {
return new Iterator<T>() {
private int next = -1;
@Override
public boolean hasNext() {
return (top != -1 && next != top);
}
@Override
public T next() {
if (isEmpty() || next == top) {
throw new NoSuchElementException();
}
next++;
... | 3 |
public ZLien chercheLien(int x, int y)
{
for (int i = 0; i < zliens.size(); i++)
if (getLien(i).isSelected(x, y))
return getLien(i);
return null;
} | 2 |
private char getEscapeChar(char ch) {
switch (ch) {
case 'b':
ch = '\b';
break;
case 't':
ch = '\t';
break;
case 'n':
ch = '\n';
break;
case 'f':
ch = '\f';
break;
case 'r':
ch = '\r';
break;
// do nothing - ch already contains correct character
case '"':
case '\'':
... | 8 |
public void run () {
while (running) {
long now = System.currentTimeMillis();
clientLock.lock();
try {
for (ServerThread t : clients) {
if(now - t.lastAction > SOFT_TIMEOUT && !t.softTimeout) {
System.out.println("Cl... | 7 |
public void vizConceptLinksToDotEdges(LogicObject concept, Module module) {
{ VizInfo self = this;
{ OutputStream stream = self.stream;
int count = 0;
{ LogicObject renamed_Super = null;
edu.isi.powerloom.PlIterator iter000 = edu.isi.powerloom.PLI.getDirectSuperrelations(concept, m... | 8 |
public void setAlwaysDrawGrouting(boolean always) {
if (alwaysDrawGrouting != always) {
alwaysDrawGrouting = always;
forceRedraw();
}
} | 1 |
public int getType() {
return type;
} | 0 |
public File writeExcelFile(String nombreArchivo) throws IOException{
ArrayList credencialTemaAr=new ArrayList();
credencialTemaAr=ctDAO.getCredencialTema();
Iterator itcredencialTema=credencialTemaAr.iterator();
Credencial_Tema credencialTema=new Credencial_Tema();
String credenc... | 9 |
public static String toString(JSONObject jo) throws JSONException {
boolean b = false;
Iterator keys = jo.keys();
String string;
StringBuffer sb = new StringBuffer();
while (keys.hasNext()) {
string = keys.next().toString();
if (!jo.isNull(s... | 3 |
@Override
public void mouseEntered(MouseEvent e)
{
Game.gui.update(true);
} | 0 |
private void submitAction() {
if (this.findRadioButton.isSelected()) {
System.out.println("Find :\t" + StringDemo.find(this.mainTextField.getText(), this.searchTextField.getText()));
} else if (this.replaceRadioButton.isSelected()) {
System.out.println("Replace :\t" + StringDemo.replace(this.mainTextField.ge... | 4 |
public static void setPropertyAsBoolean(PropertyContainer container, String key, boolean value) {
if (container != null) {
container.setProperty(key, new Boolean(value));
} else {
throw new IllegalArgumentException("Provided PropertyContainer was null.");
}
} | 1 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
public void characters(char[] ch, int start, int length) throws SAXException {
// we're only interested in this inside a <phone.../> tag
if (currentFacture != null) {
// don't forget to trim excess spaces from the ends of the string
if (id_factureT.equals("open")) {
... | 5 |
public static void main (String [] args) {
Display display = new Display();
Shell shell = new HoverHelp().open(display);
// Event loop
while (shell != null && ! shell.isDisposed()) {
if (! display.readAndDispatch()) display.sleep();
}
// Cleanup
display.dispose();
} | 3 |
public void removeValueChangeListener(ValueChangeListener l) {
if(l == null) {
return;
}
valueChangeListener = null;
} | 1 |
public void actualizaTabla(){
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
for (Segmento seg : ticket.getSegmentos()) {
addRow(new Object[]{seg.getNumeroSegmento(),seg.getNomSalida(),seg.getNomLlegada()... | 1 |
public void test_01() throws IOException {
String dirName = "./tests/";
File dir = new File(dirName);
for (String fileName : dir.list()) {
if (fileName.endsWith(".txt") || fileName.endsWith(".vcf")) {
if (fileName.equals("testLukas.vcf")) {
fileName = dirName + fileName;
long hashExp = calcHashB... | 4 |
public boolean getPath1(int x, int y, ArrayList<Point> path,
Hashtable<Point, Boolean> cache) {
Point p = new Point(x, y);
if (cache.containsKey(p)) {// alrady visited thsi cell
return cache.get(p);
}
if (x == 0 && y == 0) {
return true;// found a pth
}
boolean success = false;
if (x >= 1 && is... | 9 |
private void clueFiles(List<Path> sortedChunks, Path outputFile, ByteBuffer bb) throws IOException {
try (ByteChannel output = Files.newByteChannel(outputFile, WRITE, CREATE)) {
for (Path path : sortedChunks) {
try (ByteChannel input = Files.newByteChannel(path)) {
... | 5 |
public ArrayList<Molecule> sortIntoArray(ArrayList<Molecule> arrList){
arrList.add(this);
if( !((children.get(0).getID() == 0) || (children.get(1).getID()==0)) ){
children.get(0).sortIntoArray(arrList);
children.get(1).sortIntoArray(arrList);
}
return arrList;
} | 2 |
Message receive() {
try {
// first sort the input queue for multicast message
sortInputQueue();
return inputQueue.remove(0);
} catch (Exception e) {
return null;
}
} | 1 |
private static int addHelper( LinkedListNode l1, LinkedListNode l2, Stack<Integer> head ) {
if ( l1.next == null && l2.next == null ) {
int sum = l1.data + l2.data ;
head.push( sum % 10 );
return sum / 10;
}
int carry = addHelper( l1.next, l2.next, head );
int sum = l1.data + l2.data + carry;
... | 2 |
Grapher( RrdGraphDef graphDef, RrdGraph rrdGraph )
{
super( graphDef, rrdGraph );
this.graphDef = graphDef;
// Set font dimension specifics
if ( graphDef.getDefaultFont() != null )
normal_font = graphDef.getDefaultFont();
if ( graphDef.getTitleFont() != null )
title_font = graphDef.getTitleFont();
... | 4 |
public List<MessageDTO> getMessagesFromFolder(FolderDTO folderDTO) throws DataProcessingException {
Folder folder = folderDAO.getFolder(folderDTO.getId());
if (folder == null) {
logger.warn("Folder with name " + folderDTO.getFolderName() + " does not exist");
throw new DataProcessingException(ExceptionType.f... | 3 |
public void setAnimationToStartNextMove(String direction) {
animationShiftCount = 50;
if (direction.equals("right")) {
drawImage = 1;
}
if (direction.equals("left")) {
drawImage = 7;
}
} | 2 |
private void processMoveToBoard(MouseEvent e) {
int col = findCol(e.getX());
List<Card> possibleCards = game.getBoard().get(col);
if (activeMove != null) {
activeMove.cardReleased(col, false);
System.out.println("Moving:" + activeMove);
String result = active... | 1 |
public static String readTextFile(String fileName) {
try {
File f = new File(fileName);
WebServer.logDebug(f.getPath());
if (f.exists() && !f.isDirectory()) {
FileInputStream fstream = new FileInputStream(fileName);
// Create a stream and re... | 4 |
public void saveGuiState() {
try {
fos = new FileOutputStream(filename);
out = new ObjectOutputStream(fos);
out.writeObject(model);
out.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logg... | 2 |
void createExampleWidgets () {
/* Compute the widget style */
int style = getDefaultStyle();
if (dateButton.getSelection ()) style |= SWT.DATE;
if (timeButton.getSelection ()) style |= SWT.TIME;
if (calendarButton.getSelection ()) style |= SWT.CALENDAR;
if (shortButton.getSelection ()) style |= SWT.SHORT... | 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 |
public Result execute(Command command) {
Set<AccountDTO> accountDTOgetsend = (Set<AccountDTO>) command.getCommandSource();
Set<MessageStatuss> messageStatusssend = new HashSet<MessageStatuss>();
List<Account> accountIdsend = new ArrayList<Account>();
for (Iterator<AccountDTO> it = accou... | 2 |
public boolean getBackupFile(String sourceURL, String HTTPuser, String HTTPpassword, String filePath, String fileName, String fileExt, String fileDate) throws IOException{
FileOutputStream fout = null;
boolean success = false;
URL url = new URL (sourceURL);
Strin... | 2 |
private JButton createGameBoardButton(Tile t, Set<Map.Entry<Location, Integer>> bonusSquares, int i, int j){
JButton button;
String label = "";
Color c =EMPTY_SQUARE_COLOR;
for(Map.Entry<Location, Integer> e : bonusSquares){
Location loc = e.getKey();
if(loc.getX()== i && loc.getY() == j){
int bonu... | 7 |
public boolean isLL1() {
return Operations.isLL1(grammar);
} | 0 |
public boolean match() {
int matchIndex = 0;
boolean anyMatches = false;
AbstractInsnNode currentNode = nodes.getFirst();
while (currentNode != null) {
if (matchIndex == opcodes.length) {
//found a fully matching pattern, add a new index to the list and keep searching
matches.add(new AbstractInsnN... | 7 |
public static void asm_comf(Integer akt_Befehl, Prozessor cpu) {
Integer f = getOpcodeFromToBit(akt_Befehl, 0, 6);
Integer result = 255 - cpu.getSpeicherzellenWert(f);
// Speicherort abfragen
if(getOpcodeFromToBit(akt_Befehl, 7, 7) == 1) {
// in f Register speichern
cpu.setSpeicherzellenWert(f, result, ... | 1 |
RegulationFileConsensus readBeds(List<String> bedFiles, String cellType) {
RegulationFileConsensus regCons = new RegulationFileConsensus(true);
// Read all files, creating a consensus for each
for (String bedFile : bedFiles) {
if (verbose) Timer.showStdErr("Reading file '" + bedFile + "'");
String epigene... | 2 |
private static void mergeWithNextVisibleNode(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node currentNode = textArea.node;
Node nextNode = tree.getNextNode(currentNode);
if (nextNode == null) {
return;
}
// Abort if nextNode is not editable
if (!nextNode.isEditable(... | 2 |
public void setWidth(double _width) {
width = _width;
} | 0 |
public ImplCurlConnection(String curlURL, String user, String pwd, String authType, HashMap<String, String> props) {
this.curlURL = curlURL;
this.user=user;
this.pwd=pwd;
Logger log = Logger.getLogger(this.getClass().getName());
log.setLevel(Level.FINE);
this.setLogger(log);
LogHandler.initLogFileHandler(... | 2 |
public void setPage(int page) {
this.page = page;
} | 0 |
protected void update(CheckedFrequencyTable freqs, int symbol) throws IOException {
// State check
if (low >= high || (low & MASK) != low || (high & MASK) != high)
throw new AssertionError("Low or high out of range");
long range = high - low + 1;
if (range < MIN_RANGE || range > MAX_RANGE)
throw new Asser... | 9 |
public IVPNumber multiply(IVPNumber number, Context context, DataFactory factory, HashMap map) {
IVPNumber result = factory.createIVPNumber();
map.put(result.getUniqueID(), result);
if(getValueType().equals(IVPValue.INTEGER_TYPE) && number.getValueType().equals(IVPValue.INTEGER_TYPE)){
int resultInt = context.... | 5 |
private void create(Color bg, String title, String initialFont, int initialSize, final Color initialColor, boolean bold,
boolean underline, boolean shadow) {
setPreferredSize(new Dimension(GUIConstants.DEFAULT_FIELD_WIDTH, FIELDHEIGHT));
setBackground(bg);
setLayout(new VerticalLayou... | 2 |
private int nextElement(int above, int index){
boolean hasNext = true;
int n = above;
while(hasNext){
if(n == map.lastKey()){
return Integer.MIN_VALUE;
}
n = map.higherKey(n);
int currentN = 0;
boolean good = true;
int maxN = map.get(n);
for(int i = 0; i < index; i++... | 5 |
private void doNew(String[] messageParts, InetAddress hostName)
throws IOException {
if (!isLoggedIn) {
if(true){
if (messageParts.length == 2) { // dann hat der username keine
// leerzeichen, da er nicht zerlegt
// wurde.
String userName = messageParts[1]; // username kommt nach de... | 4 |
public static void sortTexturePacks() {
texturePackPanels.clear();
texturePacks.removeAll();
currentTexturePacks.clear();
int counter = 0;
selectedTexturePack = 0;
texturePacks.repaint();
HashMap<Integer, List<TexturePack>> sorted = new HashMap<Integer, List<TexturePack>>();
sorted.put(0, new ArrayLi... | 7 |
@Override
public AbstractPlay mkRandom() {
return bestPlays.get(rnd.nextInt(bestPlays.size()));
} | 0 |
private void readall(InputStream in, byte[] buf) throws IOException {
int ret, off = 0;
while (off < buf.length) {
ret = in.read(buf, off, buf.length - off);
if (ret < 0)
throw (new LoadException("Incomplete resource at " + name, this));
off += ret;
}
} | 2 |
@Override
public void connect() throws IOException {
checkInitiate();
super.connect();
sync.clear();
prevCallId = 0;
keepAliveThread = new KeepAliveThread();
keepAliveThread.start();
} | 0 |
public int amountCaught() {
int num = 0;
for (Iterator<Integer> i = data.keySet().iterator(); i.hasNext();) {
if (data.get(i.next()) == State.caught)
num++;
}
return num;
} | 2 |
public void encryptFile() {
try {
if (_path.isEmpty()) {
Logger.addMessage("Select file to encrypt.");
return;
}
this.setSecretKeyFromProvider(_keyProvider);
if (!_properies.mode.equalsIgnoreCase("ECB")) {
SecureRa... | 3 |
static final void method721(SubNode class348_sub42,
SubNode class348_sub42_1_, int i) {
do {
try {
if (((SubNode) class348_sub42_1_).subnodeChild
!= null)
class348_sub42_1_.removeSubnode();
anInt1194++;
((SubNode) class348_sub42_1_).subnodeParent
= class348_sub42;
((SubNode) class348... | 6 |
protected void attemptConnection()
{
if (loadingLabel.isVisible())
return; // If the loading label is visible, we are already attempting a connection.
loadingLabel.setVisible(true);
/* Reset error messages to hidden. */
addressErrorLabel.setVisible(false);;
nameErrorLabel.setVisible(false);
passwo... | 6 |
public void removeDocumentRepositoryListener(DocumentRepositoryListener l) {
documentRepositoryListeners.remove(l);
} | 0 |
public void run() {
boolean current = false;
if (!this.choice.equals(Choice.NO_UPDATE)) {
this.getJSON();
if (this.latest != null) {
if (this.choice.doCheck()) {
this.checkVersion();
}
if (this.choice.doDownload(... | 5 |
@Override
final protected CommandExecutionResult executeArg(List<String> arg) {
final String arrow = StringUtils.manageArrowForSequence(arg.get(posArrow));
final Participant p = getSystem().getOrCreateParticipant(
StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get(posParticipant)));
final bool... | 7 |
protected String buildSqlQuery(Query query) throws IOException {
StringBuilder sql = new StringBuilder("SELECT ");
//column names
selectColumns(getSchema(), null, query, sql);
sql.setLength(sql.length() - 1);
// from
sql.append(" FROM ");
sql.app... | 3 |
@Override
public CommandLog visit(Robot robot) {
if(!robot.isAlreadyStarted()) { // ignore if robot has not yet initiated
String message = "Robot has not been PLACED. MOVE command ignored";
CommandLog ignoredCommand = new CommandLog(true, message);
return ignoredCommand;
}
Position robotPos = robot.g... | 6 |
public SimpleHelper(final String func, final List<String> args) {
if (func==null || func.length()==0) throw new NullPointerException(); //TODO: message
this.func = func;
if (args!=null && args.size()>0) {
this.args = (String[]) args.toArray(new String[0]);
for (int i=0; i... | 5 |
public static Object[][] getRegisterData(String csvFile) throws Exception {
int numberOfLines = countLines(new File(csvFile));
if (numberOfLines == -1) {
throw new Exception("File not found exception");
}
BufferedReader br = null;
String line = "", csvSplitBy = ",";
... | 8 |
public void draw() {
// Iterate over the atoms and draw them one by one
// TODO: sort them by layer
for (Atom a : atoms) {
// Try to get a texture for our atom from its sprite
BufferedImage buf = a.getCurrentImage();
// Check if the image exists
if(buf == null) continue;
// Do we have the text... | 4 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
final Player s = (Player)sender;
if (plugin.getLookup().isEnabled()) {
String target = null;
if (args.length == 0 && sender instanceof Player) {
target = sender.getName();
}
else {
target = arg... | 3 |
public void displayChunks(File filelocation) {
int mask = 1 << 13;
mask--; // 13 bit of '1's
File f = filelocation;
FileInputStream fs = null; // For sliding window
FileInputStream fsChunk = null; // For chunking the input stream
BufferedInputStream bis = null;
try {
fs = new FileInputStream(f);
fs... | 9 |
public Timeline(String[] names, StatDB db) {
this.names = names;
List<List<Stat>> stats = new ArrayList<List<Stat>>();
for (String name: names) {
stats.add(getStats(name, db));
}
merge(stats);
} | 1 |
public boolean next() {
int[] toff = this.roff.getShape();
int l = itr.length - 1;
if (itr[l] >= roff.getShape()[l]) {
return false;
}
int j = 0;
int len = toff.length - 1;
while (j <= len) {
itr[j]++;
if (j != 0) {
pos += jump[j - 1];
} else {
pos++;
}
if (itr[j] < toff[j]) {
... | 7 |
/* */ protected ROElement(Node n)
/* */ throws RIFCSException
/* */ {
/* 55 */ if (n == null)
/* */ {
/* 57 */ throw new RIFCSException("Null Node passed to constructor");
/* */ }
/* */
/* 60 */ if (!(n instanceof Element))
/* */ {
/* 62 */ throw ... | 6 |
public void action() {
switch (step) {
case 0:
//enviar cfp a las agencias
ACLMessage cfp = new ACLMessage(ACLMessage.CFP);
for (int i = 0; i < agencias.length; ++i) {
cfp.addReceiver(agencias[i]);
}
//renombro por facilidad
String[] r1 = requerimientoTuristaLugar;
String[] r2 =... | 9 |
public static void main(String[] args) throws Exception {
display = new Display();
System.out.println("\nRepDev " + VERSION + " Copyright (C) 2008-2014 RepDev.org Team\n"
+"This program comes with ABSOLUTELY NO WARRANTY.\n"
+"This is free software, and you are welcome to redistribute it \n"
+"under ce... | 9 |
public JCheckListBox(Object[] items) {
setModel(new CheckListBoxModel(items));
init();
} | 0 |
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.