text stringlengths 14 410k | label int32 0 9 |
|---|---|
public ArrayList<Target> getList() {
return list;
} | 0 |
@SuppressWarnings("rawtypes")
public static MultiColumnComparator createIntegerComparator(NumberName[] numberNames, boolean ascending, String defaultString) throws Exception
{
final String type="integer";
if (ascending)
{
if (defaultString.equals(""))
{
return new MultiColumnComparat... | 5 |
public ArrayList<String[]> regresaMarcaSerieDeparta(int id_equipo) {
String res = "";
ArrayList<String[]> resultado = new ArrayList<>();
String[] nombre = new String[4];
try {
Class.forName(driver);
Connection con = DriverManager.getConnection(connectString, user,... | 2 |
private void bigStrike (final Location loc)
{
final int radius = 8;
final int radiusSq = radius * radius;
final int blockX = loc.getBlockX();
final int blockY = loc.getBlockY();
final int blockZ = loc.getBlockZ();
final int fireworksY = blockY + 15;
int iter... | 6 |
final AnimatableToolkit method152(i var_i, byte i, int i_47_, boolean bool) {
i var_i_48_;
i var_i_49_;
if (i == 1) {
var_i_48_ = anI5110;
var_i_49_ = anI5106;
} else if (i == 2) {
var_i_48_ = anI5107;
var_i_49_ = anI5111;
} else if (i == 3) {
var_i_48_ = anI5109;
var_i_49_ = anI5108;... | 5 |
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
Random rnd = new Random();
int random = rnd.nextInt(100);
int count = 7;
String again = "";
boolean play = true;
System.out.println("Enter your name");
String name = scan.next();
w... | 8 |
public void download() throws IOException {
if (!file.exists()) {
File temp = new File(file.toString().substring(0,
file.toString().lastIndexOf("\\") + 1));
temp.mkdirs();
file.createNewFile();
}
BufferedInputStream bis = new BufferedInputStream(url.openStream());
BufferedOutputStream bos = new Bu... | 2 |
private short[] findY1(short t1Index, short t2Index){
int numTries = 0;
short pathT2Index = path[t2Index];
x1Dist = dist(pathT2Index, path[t1Index]);
short stopBefore = mod(t1Index - 2);
for(short t3Index = mod(t2Index + 2); t3Index != stopBefore && numTries < LIMIT; t3Index = mod(t3Index + 1)){
// visua... | 4 |
@Override
public boolean equals(Object o){
if(!(o instanceof Sum)){
return false;
}
Sum comparing = (Sum) o;
if(comparing.quarter == this.quarter && comparing.dime == this.dime
&& comparing.nickel == this.nickel && comparing.penny == this.penny){
return true;
}
... | 5 |
public static void print(Object o) {
Date date = new Date();
String hours = date.getHours() > 10 ? "" + date.getHours() : "0" + date.getHours();
String minutes = date.getMinutes() > 10 ? "" + date.getMinutes() : "0" + date.getMinutes();
String seconds = date.getSeconds() > 10 ? "" + date.getSeconds() : "0" + da... | 3 |
@Override
public T build(Map<Class<?>, ClassBuilder<?>> how) {
T newInstance;
try {
newInstance = this.underConstruction.newInstance();
} catch (Exception e) {
e.printStackTrace();
throw new NecesitamosUnConstructorException(e,this.underConstruction);
}
for (PropertyBuilder propBuilder : properti... | 6 |
public void testLRUCache() throws Exception {
final int n = 100;
Object dummy = new Object();
Cache cache = new SimpleLRUCache(n);
for (int i = 0; i < n; i++) {
cache.put(Integer.valueOf(i), dummy);
}
// access every 2nd item in cache
for (int i = 0; i < n; i+=2) {
... | 6 |
protected void add() {
if (!dialog.showAddDialog())
return;// ûȡζԻ
// ݿв,ɹѧstudents
if (database.addStudent(dialog.student)) {
students.add(dialog.student);
this.updateDisplay();
} else
JOptionPane.showMessageDialog(this, "ӵѧѧѧѧųͻ",
"ѧʧ", JOptionPane.WARNING_MESSAGE);
} | 2 |
public void testCheckMinIdleObjectPool() throws Exception {
try {
PoolUtils.checkMinIdle(null, 1, 1);
fail("PoolUtils.checkMinIdle(ObjectPool,,) must not allow null pool.");
} catch (IllegalArgumentException iae) {
// expected
}
try {
final... | 9 |
private void readRDCInput(File file) {
try {
Format fileFormat = getFileFormat(file);
switch(fileFormat) {
case Simple:
if(media.size() == 0) {
JOptionPane.showMessageDialog(mainFrame, "Please add at least one medium", "Alert", JOptionPane.WARNING_MESSAGE);
return;
}
RDCTypeSelectD... | 9 |
public CipherPanel(int cipherID) {
this.cipherID = cipherID;
this.cipherResult = new JTextField();
ImageIcon regExCheck = makeImageIcon("/images/regex_maybe.png");
this.regExImage = new JLabel(regExCheck);
this.cipherInformation = CipherHandler.getCipherInformation(cipherID);
... | 2 |
static final int method3055(int i, Class304 class304) {
anInt9106++;
if (i < 94)
method3054(false, -98, -116);
if (class304 != AbstractMouseEvent.aClass304_7103) {
if (Class108.aClass304_1662 == class304)
return 6408;
if (class304 == Class348_Sub40_Sub38.aClass304_9471)
return 6406;
if (Class... | 7 |
public ArrayList<Edge> kruskalAlg() {
ArrayList<Edge> mst = new ArrayList<Edge>();
while (mst.size() < this.cells.size() - 1) {
//Select a random edge from the list of edges
Random rand = new Random();
Edge randEdge = this.edges.get(rand.nextInt... | 2 |
@Test
public void comparePerformance() {
long timeStringConcatenation = measureTime(() ->
{
for (int i = 0; i < StringExampleTest.LOOP_COUNT; i++) {
testStringConcatenation();
}
}
);
System.out.p... | 4 |
@Override
public void mouseReleased(MouseEvent e) {} | 0 |
private void loadScenario() {
Pilot pilot = data.getCurrentPilot();
Sailplane glider = data.getCurrentSailplane();
Airfield airfield = data.getCurrentAirfield();
GliderPosition position = data.getCurrentGliderPosition();
Runway runway = data.getCurrentRunway();
W... | 9 |
public static void main(String[] args) {
try {
AppGameContainer app = new AppGameContainer(new main());
app.setDisplayMode(1280, 768, false); //was 960 and 1080
app.setTargetFrameRate(60);
app.setFullscreen(false);;
app.start();
} catch (SlickException e) {
e.printStackTrace();
}
} | 1 |
protected synchronized @Override Module retrieveModule(final String locator, final long revision)
throws StorageException {
// bottleneck alert: the file storage implementation is not really meant for multithreading use
assert (locator != null): "Supplied locator is null";
assert (!"".equals(locator)): "No stora... | 5 |
public List<CalendarObject> loadFile(String filename){
myFile = new File(filename);
try {
myDocument = builder.build(myFile);
} catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
List<Calend... | 4 |
private void check_protocol (String protocol_)
{
// First check out whether the protcol is something we are aware of.
if (!protocol_.equals("inproc") && !protocol_.equals("ipc") && !protocol_.equals("tcp") /*&&
!protocol_.equals("pgm") && !protocol_.equals("epgm")*/) {
ZEr... | 9 |
private void addAnafores(){
anafores=con.getAnafores(); //pairnei tis anafores apo thn vash
anaforesInfo = new HashMap<String, String>(); //dimiourgia HashMap
for(int i=0;i<anafores.size();i++){
anaforesInfo=anafores.get(i); //pairnei ta stoixia mias seiras
listModel.addElement((i+1)+
") "+anaforesInfo... | 1 |
public int getArrowProjectileGfxId(int weaponId, int arrowId) {
if (arrowId == 884) {
return 11;
} else if (arrowId == 886) {
return 12;
} else if (arrowId == 888) {
return 13;
} else if (arrowId == 890) {
return 14;
} else if (arrowId == 892)
return 15;
else if (arrowId == 11212)
return 1... | 7 |
@EventHandler
public void onSpoutcraftAuth(SpoutCraftEnableEvent event) {
SpoutPlayer sPlayer = event.getPlayer();
if (!sPlayer.hasPermission("PlayerPlus.use")) {
for(AccessoryType ttype : AccessoryType.values()) {
String url = get(event.getPlayer().getName(), ttype);
sPlayer.removeAccessory(ttype);... | 9 |
public static GbAudio rewriteTo4bitSimple(short[] samples) {
int len = samples.length / 2;
int[] outSamples = new int[len * 2];
int[] soValues = new int[len];
for (int pos = 0; pos < len; pos++) {
int so = 7;
for (int offset = 0; offset < 2; offset++) {
int minError = Integer.MAX_VA... | 4 |
public static boolean specializingPropositionsIteratorDnextP(SpecializingPropositionsIterator self) {
{ Cons specializingrelations = self.specializingRelations;
for (;;) {
if (TruePropositionsIterator.truePropositionsIteratorDnextP(self)) {
if ((specializingrelations != null) &&
... | 8 |
public String getDepartmentName() {
return departmentName;
} | 0 |
private File getConfigFile(String file) {
if (file.isEmpty() || file == null) {
return null;
}
File configFile;
if (file.contains("/")) {
if (file.startsWith("/")) {
configFile = new File(plugin.getDataFolder()
+ file.replace("/", File.separator));
} else {
configFile = new File(plugi... | 4 |
public void onDisable() {
cC.config.set("spawns.1.world", spawn1.getWorld().getName());
cC.config.set("spawns.1.x", spawn1.getBlockX());
cC.config.set("spawns.1.y", spawn1.getBlockY());
cC.config.set("spawns.1.z", spawn1.getBlockZ());
cC.config.set("spawns.1.yaw", spawn1.getYaw());
cC.config.set("spawns.... | 2 |
public boolean collision(int xa, int ya) {
boolean solid = false;
for (int c = 0; c < 4; c++) {
int xt = ((x + xa) + (((c % 2) * 17) + 7)) >> 5;
int yt = ((y + ya) + (((c / 2) * 16) + 8)) >> 5;
if (loadLevel.getTile(xt, yt).solid()) {
solid = true;
... | 4 |
public void morrisTraverse(TreeNode root) {
while (root != null) {
if (root.getLeft() == null) {
System.out.println(root.getData());
root = root.getRight();
} else {
TreeNode ptr = root.getLeft();
while (ptr.getRight() != null && ptr.getRight() != root)
ptr = ptr.getRight();
if (ptr.... | 5 |
private Enemy(Vector2 position, float health, float shield, float speed, TreeMap<Integer,Pair<Integer,Integer>> FRAME_ROWS, int FRAME_COLS, Texture texture) {
this.position = position;
this.health = health;
this.shield = shield;
this.speed = speed;
this.sprite = new Rectangle();
this.texture = texture... | 6 |
public String levelUpDisplay() {// don't use this in game this is to test
// the basic leveling implementation with an output
int[] out = new int[5];
this.level++;
out[0] = (int) (this.nextExp * 1.1 - this.nextExp);
this.nextExp *= 1.1;
int total = 0;
while (total == 0) ... | 8 |
public String getTotal() {
return this.total;
} | 0 |
public List<String> reverseSortedKeys() { //Returns a List of type String, sorted based on their corresponding values. Uses insertion sort.
List<String> keysList = getKeys();
int index;
int v;
String s;
for(int i = 0; i < keysList.size(); i++) {
index = i;
s = keysList.remove(i);
v = getInt(s);
fo... | 3 |
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerDeathInArena(PlayerDeathInArenaEvent evt) {
Player victim = evt.getVictim();
if (evt.getCause() == DeathCause.ENVIRONMENT) {
PlayerStorage storage = SE.getStorage(victim.getName());
if (storage != null) {
String lastAttacker = storage.ge... | 2 |
private TextureResource loadTexture(String fileName, int textureTarget, int[] filter, int[] internalFormat, int[] format, boolean clamp, int[] attachment) {
String[] splitArray = fileName.split("\\.");
String ext = splitArray[splitArray.length - 1];
try {
BufferedImage image = Image... | 4 |
public double averageWeigthDiff(Organism org) {
double W = 0.0;
int i = 0, j = 0;
double count = 0.0;
while (i < this.getGenomeSize() && j < org.getGenomeSize()) {
if (this.getGenome().getGenes().get(i).getInnovation_num() == org.getGenome().getGenes().get(j).getInnovation_nu... | 5 |
public static boolean cantMakeACompleteRobot() {
int i = GameApplet.thisApplet.getGameState().getPolymetals();
int j = GameApplet.thisApplet.getGameState().getEnergyUnits();
Robot localRobot = GameApplet.thisApplet.getBuildPanel().getRobotOnRamp();
if (localRobot != null)
{
i += 20;
j +=... | 8 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
char grade = in.next().charAt(0);
switch (grade) {
case 'A':
System.out.println("Excellent");
case 'B':
System.out.println("Good");
case 'C':
System.out.println("So so");
case 'D':
System.out.println("Fails");
case 'F':
System.out.... | 5 |
@Override
public void onDraw(Graphics G, int viewX, int viewY) {
if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
{
G.setColor(Color.ORANGE);
G.fillArc((int)(X-16)-viewX, (int)(Y-10)-viewY, 32, 20, 0, 360);
G.setColor(Color.BLACK);
G.drawArc((in... | 5 |
public void setRNC(String rNC) {
RNC = rNC;
} | 0 |
public int consumeIncoming(short[] incoming, TelnetClient client) {
int read = 0;
if (incoming[0] == client.IAC &&
incoming[1] == client.SB &&
incoming[2] == getCode() &&
incoming[3] == IS)
{
int iacIndex = 0;
// from [4] to the next IAC is the regime to be supported.
for (int i = 4; i < incomi... | 9 |
private void connect(String host, int port, String password) {
// Close current
if (connection != null) {
try { this.close(); } catch (Exception cause) { /* nothing */ }
}
synchronized (lock) {
active = true;
new RedisConnectionThread(host, port, lock).start();
// waite channel ... | 9 |
public int minDepth(TreeNode root) {
// Start typing your Java solution below
// DO NOT write main() function
if (root == null)
return 0;
if (root.left == null && root.right == null)
return 1;
ArrayList<TreeNode> cur, next;
cur = new ArrayList<TreeNode>();
cur.add(root);
int minDep = 0;
while ... | 9 |
public JTextField getTxtPrenom() {
return txtPrenom;
} | 0 |
public OFMatch loadFromPacket(byte[] packetData, short inputPort) {
short scratch;
int transportOffset = 34;
ByteBuffer packetDataBB = ByteBuffer.wrap(packetData);
int limit = packetDataBB.limit();
this.wildcards = 0; // all fields have explicit entries
this.inputPort =... | 9 |
void del(File f) throws IOException{
if(f.exists() && f.isDirectory()){
if(f.listFiles().length==0){//del it if it's empty
f.delete();
}else{
File delFile[]=f.listFiles();
int i =f.listFiles().length;
for(int j=0;j<i;j++){
if(delFile[j].isDirec... | 5 |
public void setDefaultSaveFileFormat(SaveFileFormat defaultSaveFileFormat) {
this.defaultSaveFileFormat = defaultSaveFileFormat;
} | 0 |
public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
{
fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
fillWithBlocks(par1World, par3StructureBoundingB... | 7 |
@Test
public void testMain() throws Exception {
// pre-conditions
Assert.assertFalse(outputFile.exists());
// execute
Main.main(null);
// post conditions
Assert.assertTrue(outputFile.exists());
Scanner scanner = new Scanner(outputFile);
ArrayList<Str... | 3 |
public boolean hasCycle(ListNode head) {
if (head == null || head.next == null)
return false;
ListNode slow = head;
ListNode fast = head;
while (true) {
slow = slow.next;
if (fast.next == null)
return false;
else
fast = fast.next.next;
if (slow.equals(fast))
return true;
if ((... | 7 |
public void addPriceStep(double startPrice, double endPrice, double fixedPrice,
double variablePricePercent) throws RemoteException {
// trimming to 2 decimal points
startPrice = round(startPrice);
endPrice = round(endPrice);
fixedPrice = round(fixedPrice);
variablePricePercent = round(variablePricePerc... | 6 |
public void setParameters(Object value) {
this.parameters = value;
} | 0 |
public void punch(){
if(knockedOut) return;
setAnimation(Anim.PUNCHING, LoopBehavior.ONCE, Vars.ACTION_ANIMATION_RATE/1.25f);
for(Entity e : attackables){
if(e instanceof Mob)
if(((Mob)e).getIFF()!=IFFTag.FRIENDLY)
((Mob) e).damage(strength, DamageType.PHYSICAL, this);
else{
// either damage ... | 5 |
public String getMinecraftColor() {
return "§" + MinecraftColor;
} | 0 |
public static LinkedQueue mergeSortedQueues(LinkedQueue q1, LinkedQueue q2) {
LinkedQueue out = new LinkedQueue();
Object item1 = null;
Object item2 = null;
int flag = 0;
int iterate = 0;
while(!q1.isEmpty() && !q2.isEmpty()){
try{
item1 = q1.front();
item2 = q2.front();... | 8 |
public String[] toArray() {
String[] result = new String[size];
System.arraycopy(data, 0, result, 0, size);
return result;
} | 0 |
@Override
public Object run() throws Exception {
if (getModel() == null) {
throw new ComponentException("missing 'model'.");
}
if (calib_start == null) {
throw new ComponentException("missing 'calibration_start'");
}
if (steps.isEmpty()) {
... | 8 |
public void processAnswer() {
GameStrategyFactory factory = GameStrategyFactory.getInstance();
GameStrategy gameStrategy = factory.getStrategy(isCorrect);
gameStrategy.handleGameStatus(gameStatus, caretaker);
if (caretaker.isFinalRound() && !isCorrect) {
sleepQuiz();
... | 3 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] A = new int[n];
for (int i = 0; i < n; i++) {
A[i] = in.nextInt();
}
System.out.println(binarySearch(A, 5, 0, A.length-1));
} | 1 |
private HandRank(int value) {
this.value = value;
} | 0 |
public void write(File file, boolean append) {
Properties properties = new Properties();
properties.setProperty(USER, getUser() == null ? DEFAULT_USER : getUser());
properties.setProperty(POLL_INTERVAL, getPollInterval() <= 0 ? DEFAULT_POLL_INTERVAL : String.valueOf(getPollInterval()));
properties.setProperty(A... | 6 |
private void recurseFft(double[] input, double[] output, int numFftPoints, boolean invert) {
double divisor;
/**
* The direct and inverse FFT are essentially the same algorithm, except for two difference:
* a scaling factor of "numberFftPoints" and the signal of the exponent in the w... | 2 |
public boolean isItemUsableInBattle() {
if (itemnumber <= 13) {
inBattle = true;
} else if (itemnumber >= 14 && itemnumber <=32) {
inBattle = false;
} else if (itemnumber == 33 || itemnumber == 34 ||
itemnumber == 35 || itemnumber == 36) {
inBattle = true;
... | 7 |
@Override
public void actionPerformed(ActionEvent event) {
String command = event.getActionCommand();
if (OK.equals(command)) {
ui.updateOption();
getGUI().removeFromCanvas(this);
setResponse(group);
} else if (CANCEL.equals(command)) {
getGUI(... | 8 |
public void setSocket(Socket s) {
this.serverSide = s;
try {
serverSideWriter = new PrintWriter(serverSide.getOutputStream(), true);
serverSideReader = new BufferedReader(new InputStreamReader(serverSide.getInputStream()));
clientSide = new Socket("127.0.0.1", match.p... | 1 |
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
Composite composite = new Composite(shell, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setLayout(new GridLay... | 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 fe... | 6 |
public boolean CloseFile()
{
boolean result = false;
try
{
//flush the buffer
br.flush();
//close the file
out.close();
//set status flag
result = true;
}
catch(Exception e){}
//... | 1 |
private boolean insertActivity(Activity activity) {
String activityName = activity.getName();
boolean saved = false;
try {
Connection conn = Dao.getConnection();
if (!"".equals(activityName)) {
if (!activityDao.nameExists(conn, activityName)) {
int insertActivity = activityDao.insertActivity(con... | 5 |
public synchronized void add(long count) {
this.bytes += count;
if (this.reset == 0) {
this.reset = System.currentTimeMillis();
}
this.last = System.currentTimeMillis();
} | 1 |
@Override
public int compareTo(Node o) {
return this.cnt-o.cnt;
} | 0 |
public int[] willBreakGround(int startX, int startZ, int endX, int endZ) {
int[] groundLoc = new int[4];
groundLoc[0] = 0;
groundLoc[1] = 0;
groundLoc[2] = 0;
groundLoc[3] = 0;
int dx = endX - startX;
int dz = endZ - startZ;
int count = (int) Math.sqrt(dx ... | 8 |
public boolean isValidBSTRec(TreeNode root, int min, int max){
if(root == null) return true;
if(root.val <= min || root.val >= max) return false;
boolean l = isValidBSTRec(root.left, min, root.val);
if(!l) return false;
boolean r = isValidBSTRec(root.right, root.val, max);
... | 5 |
@Override
public void iterate() {
for (int i = 0; i < this.length; i++) {
String cellPattern = "" + cells().leftOf(i, 1)
+ cells().getCell(i).toBit()
+ cells().rightOf(i,1);
switch(cellPattern){
case "111":
applyRule(0, i);
break;
case "110":
... | 9 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
DeliveryPacket packet = delivertPackets.get(rowIndex);
if (columnIndex == DELIVERY_PACKET_ID) {
return packet.getId();
} else if (columnIndex == MEMBER_NAME) {
return packet.getMember().getFullName();... | 5 |
public GedcomObjectFactory findFactoryForTag(String tag) {
if (tag.equalsIgnoreCase("DATE"))
return dateFactory;
else if (tag.equalsIgnoreCase("PLAC"))
return placeFactory;
else
return null;
} | 2 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(aiTimer)) {
if (ballMovement) {
updateStatus();
updateRemote();
moveBall();
repaint();
}
} else if (e.getSource().equals(playerTimer... | 3 |
public void saveHighScores() throws IOException {
if (highScores == null || highScores.isEmpty()) {
return;
}
Collections.sort(highScores, highScoreComparator);
XMLOutputFactory xof = XMLOutputFactory.newInstance();
FileOutputStream fos = null;
try {
... | 8 |
private boolean parseMapFile(File f) {
try {
FileReader fr = new FileReader(f);
int readInt = 0;
StringBuilder sb = new StringBuilder();
while ((readInt = fr.read()) != -1) {
sb.append((char) readInt);
}
System.out.println(s... | 9 |
public Stella_Object pop() {
{ HashSet self = this;
{ Stella_Object element = null;
Stella_Object setmap = self.theMap;
if (setmap != null) {
if (self.crossoverPoint == 0) {
{ StellaHashTable map = ((StellaHashTable)(setmap));
KvCons[] table = map.theTable... | 7 |
public void DoAction()
{
Scanner sc = new Scanner(System.in);
String action;
boolean valid = false;
while(!valid)
{
action = Input.getStringInput(sc);
if(action.equalsIgnoreCase("EXPLORE"))
{
explore.Traveling()... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if(src == btLogin){
try{
if(tfEnterNickname.getText().length() <= 12){
User Loginuser = new User(tfEnterNickname.getText());
this.out.writeObject(Loginuser);
tfEnterNickname.setText("");
setVisible(false);
... | 6 |
public static int loadTexture(BufferedImage image) {
int[] pixels = new int[image.getWidth() * image.getHeight()];
image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth());
ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.get... | 2 |
public TreeRow selectUp(boolean extend) {
TreeRow scrollTo = null;
if (mRoot.getChildCount() > 0) {
int count = mSelectedRows.size();
if (extend && count > 0) {
scrollTo = getLastSelectedRow();
if (scrollTo == mAnchorRow) {
scrollTo = getBeforeFirstSelectedRow();
if (scrollTo != null) {
... | 9 |
public long getLong(String key) throws JSONException {
Object o = get(key);
if(o==null) return 0;
if(o instanceof String){
if(o.toString().length()>0){
return Long.valueOf((o.toString()));
}else
return 0;
}
return o instanceof Numbe... | 4 |
@Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
if (plugin.warpList.containsKey("Spawn")) {
try {
plugin.warpList.get("Spawn").warpPlayer((ProxiedPlayer) sender);
... | 5 |
public List<Ticket> getTicketsByCOid(int coID) {
List<Ticket> coTickets = new ArrayList<Ticket>();
for (Ticket ticket : tickets) {
if (ticket.getCashOffice().getNumber() == coID) {
coTickets.add(ticket);
}
}
return coTickets;
} | 2 |
public Integer getId() {
return id;
} | 0 |
public static final Iterator<SecFlag> getSecurityCodes(final MOB mob, final Room room)
{
if((mob==null)||(mob.playerStats()==null))
return EMPTYSECFLAGS;
final MultiIterator<SecFlag> it=new MultiIterator<SecFlag>();
it.add(mob.playerStats().getSecurityFlags().flags());
it.add(mob.baseCharStats().getCurrentC... | 7 |
public void mouseWheelMoved(MouseWheelEvent e) {
mouseHelper(MOUSE_WHEEL_UP, MOUSE_WHEEL_DOWN,
e.getWheelRotation());
} | 0 |
public static void main(String[] args) throws Exception {
if (args.length != 1) {
System.err.println(
"Usage: java Sink <processing server address>");
System.exit(1);
}
// get the dest host + port from console
String dest_host = args[0];
... | 2 |
private void drawSelectingCollection() {
// Draws collection window
parent.stroke(0);
parent.fill(225);
parent.rect(posX + 270, posY + 150, 235, 300);
float start = posY + 167;
for (int i = 0; i < parent.getCollectionLength(); i++) {
if (indexSelected == i) {
parent.noStroke();
parent.fill(190... | 2 |
public boolean areCoordinatesSet() {
return (row != null && col != null);
} | 1 |
public static int compatibleRealMethods(MethodSlot prototypemethod, Surrogate abstracttype, Object [] MV_returnarray) {
{ Symbol methodname = prototypemethod.slotName;
int nofrealsubtypes = 0;
int nofrealmethods = 0;
boolean compatiblesignaturesP = true;
{ Surrogate sub = null;
Cons... | 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.