text stringlengths 14 410k | label int32 0 9 |
|---|---|
public CheckResultMessage checkE04(int day) {
int r1 = get(13, 5);
int c1 = get(14, 5);
int r2 = get(17, 5);
int c2 = get(18, 5);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
if (0 != getValue(r1 + day, c1, 3).compareTo(
... | 5 |
public int MovePacket(int inputBufferNumber, int outputBufferNumber, int TIME)
{
//ONLY ONE BUS PRESENT IN THIS FABRIC
//if Active status was successful and the flag is true for having
//control of the bus
//set packet moved default
packetMoved = false;
//ge... | 4 |
public void addMutations() {
for (int i = 0; i < this.population.size(); i++) {
this.population.get(i).mutate(66, 2);
}
} | 1 |
private boolean isConnectedTo(RailLogic var1) {
for (int var2 = 0; var2 < this.connectedTracks.size(); ++var2) {
ChunkPosition var3 = (ChunkPosition) this.connectedTracks.get(var2);
if (var3.x == var1.trackX && var3.z == var1.trackZ) {
return true;
}
}... | 3 |
public HashSet<String> getQueryIDs(String queryString) {
HashSet<String> objList = new HashSet<String>();
//System.out.println(queryString);
// execute query
ItemIterable<QueryResult> results = session.query(queryString, false);
for (QueryResult qResult : results) {
... | 3 |
public void recordPackage(String jvmClassName) {
String classname = jvmToJavaName(jvmClassName);
for (;;) {
int i = classname.lastIndexOf('.');
if (i > 0) {
classname = classname.substring(0, i);
classPool.recordInvalidClassName(classname);
... | 2 |
@Override
public String toString() {
String result = "";
String newline = "\n";
for (int i = 0; i < colonnes; i++) {
for (int j = 0; j < lignes; j++) {
if (vampires[i][j] != 0) {
result += vampires[i][j] + " vampires " + "sur case " + i + " ," ... | 9 |
public static int indexOfSubString(String str,String sub){
int curIndex=0;
int subIndex=0;
while(curIndex<str.length() && subIndex<sub.length()){
//If it matches
if(str.charAt(curIndex)==sub.charAt(subIndex)){
curIndex++;
subIndex++;
continue;
}else{
//If it doesn't match, calc new curInd... | 5 |
public static boolean question(String question) {
System.out.println(question+"\n I/N?");
boolean correct = false;
while(!correct) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
String s1 = br.readLine();
if(s1.equals("I") || s1.equals("i"))
return true;
e... | 6 |
public void setName(String name) {
this.name = name;
} | 0 |
public Aukiolo haeAukiolot() throws DAOPoikkeus {
// Esitellään olio
Aukiolo aukiolo = new Aukiolo();
// Avataan tietokantayhteys:
Connection yhteys = avaaYhteys();
// Haetaan tietokannasta aukioloajat:
try {
String sql = "select arkialku, arkiloppu, vklpalku, vklploppu from Aukiolot";
Statem... | 2 |
protected void onSetInviteOnly(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} | 0 |
@Override
public void setCell(int x, int y, boolean live) {
if (y<0 || y>=getHeight()) return;
if (x<0 || x>=getWidth()) return;
if (live)
world[y][x] = 0;
} | 5 |
protected void addLevel2Tree( double cx, double cy, WorldUpdateBuilder ub ) {
switch( rand.nextInt(4) ) {
case( 0 ):
// ring!
double rad = 250+rand.nextDouble()*500;
double cir = rad * 2 * Math.PI;
int count = (int)(cir / 500)+1;
double phase = rand.nextDouble();
for( int i=0; i<count; ++i ) {
... | 7 |
public NoPreviousEmailKontaktFoundException(String message) {
super(message);
} | 0 |
public boolean controlErroresEmpleado(Empleado empleado)
{
boolean correcto=false;
if(empleado.getDisponible())
{
if(!empleado.getApellidos().isEmpty() && !empleado.getNombre().isEmpty())
{
if(!empleado.getDireccion().isEmpty() && empleado.getSueldo()>... | 9 |
public void getInput() {
String command;
Scanner inFile = new Scanner(System.in);
do {
this.display(); // display the menu
// get commaned entered
command = inFile.nextLine();
command = comma... | 6 |
public void setFixedOrientation(boolean fixedOrientation) {
this.fixedOrientation = fixedOrientation;
if(fixedOrientation)
mouseListener.show();
else
mouseListener.hide();
} | 1 |
public JSONObject optJSONObject(String key) {
Object object = this.opt(key);
return object instanceof JSONObject ? (JSONObject) object : null;
} | 1 |
public String getArea() {
return Area;
} | 0 |
private void loadPoperties() {
InputStream resourceFile = null;
properties = new Properties();
try {
resourceFile = getClass().getResourceAsStream(Constants.PROPERTIES_FILE.toString());
properties.load(resourceFile);
LOG.info("Validator Properties are successfully loaded.");
} catch (IOException e) {
... | 1 |
@Override
public boolean equals(Object o)
{
if (!(o instanceof ElementStAX))
{
return false;
}
else
{
ElementStAX i = (ElementStAX) o;
if(isText() != i.isText())
{
return false;
}
if(isText())
{
return i.text.equals(this.text);
}
else
{
return i.attributes.e... | 5 |
static String writeDate(int year, int month, int day, int hour, int minute,
int second) {
String retu = "";
if (day > 0) {
retu += month + "/" + day + "/" + year;
} else {
retu += month + "/" + year;
}
String h = "", m = "", s = "";
if (hour >= 0) {
if (hour < 10) {
h = "0" + hour;
} else... | 9 |
public void moveUp(){
switch (polygonPaint) {
case 0:
line.moveUp();
repaint();
break;
case 1:
curv.moveUp();
repaint();
... | 7 |
@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if(!(sender instanceof Player)){
sender.sendMessage(ChatColor.DARK_RED + "You need to be a Player!");
return true;
}
Player player = (Player) sender;
if(!player.hasPermission(pluginMain.pluginManag... | 5 |
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
Utils utils = new Utils() ;
String extension = utils.getExtension(f);
if (extension != null) {
if (extension.equals(Utils.tiff) ||
extension.equals(Utils.tif) ||... | 8 |
@Override
public StateBuffer execute(StateBuffer in) {
StateBuffer out = new StateBuffer();
int sumDelay = -1;
while(!out.isFull() && (!onlyOneStateNeeded || out.isEmpty())) {
sumDelay++;
System.out.println("FindShortestSequenceSegment: testing delay "+sumDelay+" size="+out.size());
for(State s : in.get... | 4 |
@Override
public int[] sort(int[] a) {
for(int i = 1; i < a.length; i++) {
for(int j = i; j > 0; j--) {
if(a[j] < a[j-1]) swap(a, j, j-1);
}
}
return a;
} | 3 |
private static String getJSON(String url) throws IOException {
BufferedReader bis = null;
InputStream is = null;
try {
URLConnection connection = new URL(url).openConnection();
is = connection.getInputStream();
// warning of UTF-8 data
bis = new BufferedReader(new InputStreamReader(i... | 5 |
protected boolean colidate(int x1, int y1, int x2, int y2){
int left = getX();
int right = getX()+getSWidth();
int top = getY();
int bottom = getY()+getSHeight();
for (int x = x1+5; x < x2-5; x++) {
for (int y = y1+5; y < y2-5; y++) {
if (x>=left && x<=right && y>=top && y<=bottom) {
... | 6 |
public static Hiscores lookup(String name) {
try {
final BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(WEBSITE + name).openStream()));
final StringBuilder builder = new StringBuilder();
String line;
while ((line = reader.readLine()) != n... | 2 |
@Override
public double getTemperature(int i, int j) {
if (i >= 0 && i < numLongCells && j >= 0 && j < numLatCells) {
return cellValues[i][j];
}
// Allow overrunning the "size" of the grid. We are on
// a sphere, after all. This is convenient for checking neighbors
... | 7 |
public List getMessByTimeAndUser(String beginTme, String endTime,
String username,String rescueStatus) {
if(beginTme!=null&&!beginTme.trim().equals("")){
if(endTime!=null&&!endTime.trim().equals("")){
String hql = "from Rescueapply r where r.applytime >=:beginTime and r.applytime <=:endTime and r.applype... | 6 |
public static void main(String[] args) throws JAXBException {
Worker worker = new Worker();
worker.setName("Sergii");
worker.setAge(25);
worker.setId(7);
File file = new File("D:\\Java SE\\src\\xml\\jaxb\\worker.xml");
JAXBContext jaxbContext = JAXBContext.newIn... | 0 |
@Override
public void execute() {
if (Game.getClientState() != Game.INDEX_MAP_LOADED) {
BearFurs.stop = 1000;
}
if (Game.getClientState() == Game.INDEX_MAP_LOADED && BearFurs.stop == 1000) {
BearFurs.stop = 50;
}
if (BearFurs.client != Bot.client()) {
WidgetCache.purge();
Bot.context().getEve... | 8 |
protected JTableExtender initializeTable(Object obj) {
// System.out.println("In regular multiple initialize");
boolean multiple = false;
int inputCount = 0;
if(this.getEnvironment().myObjects!=null){
multiple = true;
inputCount = 1;
}
//System.out.println("In initialize:"... | 8 |
public static void main (String[] args)
{
int pattern[] = new int[6];
for (int i = 0; i < 4; i++) {
initialize(pattern, 0, 5);
pattern[i] = 1;
for (int j = i+1; j < 5; j++) {
initialize(pattern, i+1, 5);
pattern[j] = 2;
... | 3 |
public int login(User loginUser) {
// Variable für Anzahl der gefundenen Datensätze
int numRows = 0;
try {
// PreparedStatement für den SQL-Befehl
String sqlStatement = "SELECT COUNT(*) FROM bookworm_database.users WHERE username = '"
+ loginUser.getUserName()
+ "' AND userpassword = '"
+ lo... | 2 |
public void addShadow(Identifier orig) {
if (isPreserved() && !orig.isPreserved())
orig.setPreserved();
else if (!isPreserved() && orig.isPreserved())
setPreserved();
Identifier ptr = this;
while (ptr.right != null)
ptr = ptr.right;
/* Check if orig is already on the ptr chain */
Identifier check... | 8 |
public void setProperties(Object instance, Map map) throws IllegalAccessException, InvocationTargetException {
if (map == null) {
return;
}
for (Object object : map.keySet()) {
String property = (String) object;
Object v = map.get(property);
if (is... | 4 |
public static void main(String[] args) throws ReadItemLineException, IOException {
BufferedReader br = null;
Reader r = new InputStreamReader(System.in);
br = new BufferedReader(r);
String str = null;
String outStr = null;
try {
do{
System.ou... | 7 |
private void araseLine(int lineNumber){
if(lineNumber < fieldSize) {
for (int i = 0; i < fieldSize; i++){
field[i][lineNumber] = DEFAULT_CELL_VALUE;
}
}
else {
System.out.println("Wrong data in araseLine");
}
} | 2 |
public static BoundaryBox clip(BoundaryBox bb, int minX, int minY, int maxX, int maxY){
int newX = Math.min(Math.max(minX, bb.getX()), maxX);
int newY = Math.min(Math.max(minY, bb.getY()), maxY);
int endX = Math.min(Math.max(minX, bb.getX()+bb.getWidth()), maxX);
int endY = Math.min(Math.max(minY, bb.getY()+... | 0 |
private void gameListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_gameListMouseClicked
// Get the selected game list item
int index = gameList.locationToIndex(evt.getPoint());
GameListItem item = (GameListItem) gameModel.get(index);
// See if the sele... | 7 |
public Board(TicTacUI owner, Game ownerGame)
{
this.setLayout(new GridBagLayout());
for(int i = 0; i < gameBoard.length; i++)
{
gameBoard[i] = new Tile(i, this);
GridBagConstraints constraint = new GridBagConstraints();
constraint.gridx = i % numCols;
... | 1 |
public static List<Labo> selectAll(EntityManager em) throws PersistenceException {
List<Labo> lesLabos = null;
Query query= em.createQuery("select l from Labo l");
lesLabos = query.getResultList();
return lesLabos;
} | 0 |
protected static void doPhoneNumbers() {
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
String phone = in.next();
Integer dictionarySize = in.nextInt();
for (int i = 0; i < dictionarySize; i++) {
String word = in.next();
... | 4 |
public static int maxProfit3(int[] prices) {
List<Integer> p = maxProfitPoint(prices, 0, prices.length);
int profit = p.get(2);
List<Integer> p1 = maxProfitPoint(prices, 0, p.get(0));
List<Integer> p2 = maxProfitPoint(prices, p.get(1) + 1, prices.length);
profit = profit + (p1.get(2) > p2.get(2... | 3 |
public boolean add(Object o) {
LocalInfo li = (LocalInfo) o;
LocalInfo contained = findSlot(li.getSlot());
if (contained != null) {
li.combineWith(contained);
return false;
} else {
grow(1);
locals[count++] = li;
return true;
}
} | 1 |
public Pair<List<Sentence>, Double> getBestSnippet(ScoreFunction func, int minLength, int maxLength, int delta, int windowSize) {
double highscore = Double.MIN_VALUE;
List<Sentence> bestSentences = null;
for (Pair<Integer, Integer> boundaries : chooseTwo(sentences.size())) {
int start = boundaries.first();
... | 8 |
@Override public boolean equals (Object other) {
Edge<?> e = (Edge<?>) other; // warning if use Edge<N> - unchecked method invocation
if (other == null) {return false;}
if (this.getClass() != other.getClass()) {return false;}
if (!this.src.equals(e.src)) {return false;}
... | 7 |
public void paint(Graphics pen)
{
if(myText.length() == 0)
return;
Graphics2D p = (Graphics2D)pen;
FontRenderContext frc = p.getFontRenderContext();
TextLayout layout = new TextLayout(myText, FONT, frc);
layout.draw(p, (float)myBottomLeft.getX(), (float)myBot... | 1 |
private static String sqlType2JavaType(int type) {
String typeStr = "";
if (Types.INTEGER == type || Types.NUMERIC == type) {
typeStr = "int";
} else if (Types.VARCHAR == type || Types.CHAR == type || -1 == type) {
typeStr = "String";
} else if (Types.DECIMAL == type) {
typeStr = "double";
} else if ... | 9 |
@Override
public Command planNextMove(Info info) {
enemyDistance=null;
enemyDistance= new double[info.getEnemies().size()];
enemyAngle=null;
enemyAngle= new double[info.getEnemies().size()];
x=info.getX();
y=info.getY();
angle=info.getDirection();
int i=0... | 9 |
public boolean hasPlayableCard() {
for (Card card : hand) {
if (canPlayCard(card)) {
return true;
}
}
return false;
} | 2 |
public static void main(String[] args) {
int i;
boolean[] sieve = new boolean[2000000];
long sum = 0;
for (i = 2; i < 2000000; sieve[i++] = true)
;
for (i = 2; i * i < 2000000; i++) {
if (sieve[i]) {
System.out.println(i);
sum += (long) i;
if (sum < 0) {
System.out.println("rollover err... | 8 |
private void paintEnemies(Graphics2D g2d) {
for (Enemy e : gameLogic.getEnemyList()) {
if(e.isAlive()){
g2d.drawImage(e.image, e.posX, e.posY, this);
}
}
} | 2 |
public void tableChanged(TableModelEvent e) {
Object o = e.getSource();
if (o instanceof TableModel && table.getRowSelectionAllowed()) {
int row = e.getFirstRow();
int column = e.getColumn(); // tells which student we are
// modifying
if (row == -1 || column == -1)
return;
TableMod... | 9 |
public static Board createCompleteBoard(int count, Device.Type... deviceType) throws IOException {
Board newBoard = createBoard();
Device device;
for (int i = 0; i < count; i++) {
String nameDevise = deviceType[rnd.nextInt(deviceType.length)].name();
switch (nameDevis... | 5 |
@SuppressWarnings("unchecked")
public void poppulateCriteria(HashMap<String, Object> criteria){
if(criteria.containsKey("endDate")){
this.endDate = new LocalDate((String) criteria.get("endDate"));
}
if(criteria.containsKey("startDate")){
this.strtDate = new LocalDate((String) criteria.get("startDate"));... | 7 |
public void setPitch(float pitch) {
if(pitch <= 90 && pitch >= -90)
this.pitch = pitch;
else if(pitch > 90) {
this.pitch = 90;
} else {
this.pitch = -90;
}
} | 3 |
public boolean canEatFish(Fish f) {
if (f instanceof Gyarados || f instanceof Magikarp) { return false; }
return true;
} | 2 |
public void addMessage(ChatMessage message){
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url = "jdbc:derby:" + DBName;
Connection connection = DriverManager.getConnection(url);
Statement statement = connection.createStatement();
DateFormat dtf = new SimpleDateFormat("yyyy-MM... | 1 |
private static boolean confirmQuit(String title) {
Game.pauseGame();
return
!Game.isActive() ||
JOptionPane.NO_OPTION != JOptionPane.showConfirmDialog(instance,
"Quit the Current Game?",
"Confirm " + title,
JOptionPane.YES_NO_OPTION
);
} | 1 |
public boolean equals(TProducto productoB)
{
return this._id == productoB.getId() && _nombre.equalsIgnoreCase(productoB.getNombre()) && _precio == productoB.getPrecio() && _descripcion.equalsIgnoreCase(productoB.getDescripcion()) && _codigoDeBarras.equalsIgnoreCase(productoB.getCodigoDeBarras()) && _activo ... | 5 |
@Test
public void runTestLocationLeak2() throws IOException {
InfoflowResults res = analyzeAPKFile("Callbacks_LocationLeak2.apk");
Assert.assertNotNull(res);
Assert.assertEquals(2, res.size());
} | 0 |
public Popup(int width,int height,PopupPosition pos){
if(width == 0){
throw new IllegalArgumentException("Width cannot be 0");
} if(height == 0){
throw new IllegalArgumentException("Height cannot be 0");
}
this.width = width;
this.height = height;
int screenWidth = JEngine.SCREEN_WIDTH;
int screenHe... | 5 |
private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRe... | 3 |
public boolean removeAt(int index) throws InvalidAccessException {
DLNode current = new DLNode();
DLNode next = current.getNext();
DLNode prev = current.getPrev();
if (this.head == null) {
throw new InvalidAccessException("Empty List!");
}
if (index - 1 < 0) {
throw new InvalidAccessException("Inde... | 8 |
public void ActivateCognitiveGraphEX(String symbol, int matchresult){
if(symbol.equals("红色") || symbol.equals("玫瑰")){
int result;
result=matchresult;
//1
if(result==0)//前一个词是对象,后一个词是属性值
{
//1.建立一个空节点
//2.将这个空节点链接到表示前一个词的节点后面
//3.对节点的Symbol和Relation赋值//注意,在例子中,属性名只有颜色。所以这里就把过程简单化了,否则应该检查属性... | 7 |
public void read(Node node)
{
while (node != null)
{
if (node instanceof Element)
{
Element elt = (Element) node;
IElementHandler handler = handlers.get(elt.getNodeName());
if (handler != null)
{
handler.parseElement(elt);
}
}
node = node.getNextSibling();
}
} | 3 |
public Player playGame(Player player1, Player player2)
{
Game game = new Game(player1, player2);
Player winner = game.play();
score(winner);
return winner;
} | 0 |
public boolean search(String word) {
if (word == null || word.length() == 0)
return false;
int len = 0;
TrieNode node = root;
while (len < word.length()) {
boolean found = false;
for (int i = 0; i < node.nodes.size(); i++) {
if (node.... | 7 |
public void loadData() {
int v = 1;
String s = "";
Integer i = 0;
Integer l = 1;
try {
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(this.getDataFolder() + "/ControllerBlock.dat"), "UTF-8"));
String version = in.readLine().trim();
if (version.equals("# v2")) {
v... | 9 |
public String getText(Player other) {
if ((other.getCurrentY()+1) == getCurrentY()) {
if ((other.getCurrentX()) == getCurrentX()) {
return text;
}
}
if ((other.getCurrentY()-1) == getCurrentY()) {
if ((other.getCurrentX()) == getCurrentX()) {
return text;
}
}
... | 8 |
private void carregaVariaveis() {
lblNome.setText(at.getNome());
lblNumVisualizacoes.setText("" + (at.getNumeroVisualizacoes() + 1));
if(at.getClassificacao()==0){
lblPontuacao.setText(bundle.getString("Sem_Classificacao"));
}else{
lblPontuacao.setText(... | 9 |
@Override
public boolean equals(Object object) {
if (object == null)
return false;
if (object == this)
return true;
if (this.getClass() != object.getClass())
return false;
PointGame point = (PointGame) object;
if (this.hashCode() == point.hashCode())
return true;
return false;
} | 4 |
private boolean parseHandshake(JSONObject o) throws ProtocolException {
try {
if(!(o.get("message").equals("connect"))){
throw new ProtocolException("Expected 'connect' handshake, but got '"
+ o.get("message") + "' key");
}
if(!(o.getInt("revision") == 1)){
throw new ProtocolException("Wron... | 3 |
protected void sort(SimpleFeatureType featureType, SortBy[] sort, String prefix, StringBuilder sql) throws IOException {
if ((sort != null) && (sort.length > 0)) {
sql.append(" ORDER BY ");
for (int i = 0; i < sort.length; i++) {
String order;
if (sort[i]... | 4 |
@Override
public void putAll( Map<? extends S, ? extends T> map )
{
for (Entry<? extends S, ? extends T> e : map.entrySet())
{
put( e.getKey(), e.getValue() );
}
} | 5 |
public void addConnection(PlayerMP player, Packet00Login packet){
boolean alreadyConnected = false;
for(PlayerMP p : this.connectedPlayers){
if(player.getUsername().equalsIgnoreCase(p.getUsername())){
if(p.ipAddress == null){
p.ipAddress = player.ipAddress;
}
if(p.port == -1){
p.port = play... | 5 |
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed
{//GEN-HEADEREND:event_jButton2ActionPerformed
if (!gameover) {
if (rule.turn()) {
if (rule.check(1, 0)) {
rule.pressed(1, 0);
if ... | 5 |
public int minPathSum(int[][] grid) {
int m = grid.length;
int n = grid[0].length;
int[] answer = new int[n];
answer[0] = grid[0][0];
for (int i = 1; i < n; i++)
answer[i] = grid[0][i] + answer[i - 1];
for (int j = 1; j < m; j++) {
answer[0] = gr... | 3 |
@Override
public void rotateXMinus() {
if(orientation == X) return;
orientation = (orientation == Y ? Z : Y);
for(int i = 0; i < others.length; i++) {
IntPoint p = others[i];
others[i] = new IntPoint(p.getX(), p.getZ(), -p.getY());
}
} | 3 |
protected void stepForward(boolean showSteps) {
switch (m_currentPhase) {
case PHASE_PREPROCESSING:
long precSize = getNumPrecomputedBlocs();
if (precSize > Integer.MAX_VALUE) {
JOptionPane.showMessageDialog(null,
"Num... | 9 |
public void mouseDragged(MouseEvent e) {
Rectangle bounds = getBounds();
Dimension d = getSize();
Point p = e.getPoint();
SwingUtilities.convertPointToScreen(p, e.getComponent());
int dx = p.x - lastPoint.x;
int dy = p.y - lastPoint.y;
switch (dragType) {
case DRAG_TOP:
Point loc = getLocat... | 8 |
private static List<String> readLines(String path) {
ArrayList<String> lines = new ArrayList<String>();
//open file
File file = new File(path);
//Error if not readable
if (!file.canRead()) {
System.err.println("File " + file.getAbsolutePath() + " could not be read!");
System.exit(1);
}
BufferedRe... | 4 |
private void displayInfo(ChunkyPlayer chunkyPlayer, CommandSender sender) {
String sFirstDate = "NA";
Long lFirstDate = chunkyPlayer.getFirstLoginTime();
if (lFirstDate != 0) {
sFirstDate = new Date(lFirstDate).toString();
}
String sLastDate = "NA";
Long lLast... | 7 |
public boolean fieldContainsThisPlayersPiece(Field field, Player playersTurn) {
return field.hasPiece() && field.getPiece().isWhite == playersTurn.isWhite;
} | 1 |
public void swap() {
Item itm1 = new NoItem();
Item itm2 = new NoItem();
int Itm1W = 0;
int Itm1H = 0;
int Itm2W = 0;
int Itm2H = 1;
int amount = 1;
for (int h = 0; h < ItemH; h++) {
for (int w = 0; w < ItemW; w++) {
if (ITEMS[h][w].isSelected) {
if (amount == 1) {
itm1 = ITEMS[h][w];... | 7 |
public void mouseDragged(MouseEvent pEvent) {
//Only One drag can occur at a time
if(currentDragComponent != pEvent.getComponent() || currentDragComponent==null) return;
//This info is all in the context of the Current Drag Component
Point _point = pEvent.getPoint();
Point _newLoc =... | 9 |
public static MapNode crossing(MapNode from, MapNode to,
Set<MapNode> neighbors, double direction) {
direction = normalize(direction);
if (neighbors.size() == 1) {
return from;
} else if (neighbors.size() == 2) {
Iterator<MapNode> iterator = neighbors.iterator();
MapNode tmp = iterator.next();
if ... | 6 |
static void initialize() {
try {
SHIP = ImageIO.read(SpaceShooter.class.getResourceAsStream("img/player/ship.png"));
MISSILE = ImageIO.read(SpaceShooter.class.getResourceAsStream("img/player/missile.png"));
PLASMA = ImageIO.read(SpaceShooter.class.getResourceAsStream("img/ene... | 5 |
private void addGroupBySelectedFields()
{
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) ((BrowserItems.DefaultTreeItem)
node.getParent()).getFirstChild();
for (int i = 0; i < selectNode.getChildCount() ; i++)
{
BrowserItems.DefaultTreeItem item = (Browser... | 8 |
public static int[][][] fillTable(String seq1, String seq2, String seq3, Map<String, Integer> matrix, int g) {
int[][][] scoreTable = new int[seq1.length()+1][seq2.length()+1][seq3.length()+1];
scoreTable[0][0][0]=0;
int[][] score2 = linearAlignment.fillTableLinear(seq1,seq2,matrix,g);
... | 9 |
public void createDirectory() {
File file = new File(source);
if (!file.exists()) {
if (file.mkdir()) {
System.out.println("Directory is created!");
} else {
System.out.println("Failed to create directory!");
}
}
} | 2 |
public boolean claimAnimal(Player p, Entity animal, ItemMeta meta){
String owner = p.getUniqueId().toString();
String pet = animal.getUniqueId().toString();
if(!plugin.getAnimalData().contains("Farmer." + owner + ".Animals")){
plugin.getAnimalData().set("Farmer."+ owner + ".Name", p.getName() + ".Animals");
... | 3 |
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ChunkyCoordinates)) return false;
ChunkyCoordinates coords = (ChunkyCoordinates) obj;
return coords.getWorld().equals(this.getWorld()) && coords.getX() == this.x && coords.getZ() == this.z;
} | 3 |
@Override
public void run(){
while(true){
if(running){
try {
sleep(500);
loadChannel();
} catch (Exception e) {
e.printStackTrace();
}
}
}
} | 3 |
@Override
public void mouseMove(MouseEvent e) {
if(this.getMouseListener() != null)
{
this.getMouseListener().MouseMove(this, e);
}
} | 1 |
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.