text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean equals(Object o) {
if(o instanceof TreasureLocation){
TreasureLocation location = (TreasureLocation) o;
if(location.getX() == getX()){
if(location.getY() == getY()){
if(location.getZ() == getZ()){
return true;
}
}
}
}
return false;
} | 4 |
public Card[][] getSets()
{
int count = cards.size();
if (count < 3)
return new Card[0][];
ArrayList<Card[]> sets = new ArrayList<Card[]>();
for (int i = 0; i < count; i++)
{
for (int j = i + 1; j < count; j++)
{
for (int k = j + 1; k < count; k++)
{
Card[] set = {cards.get(i), cards... | 5 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=proficiencyCheck(mob,0,auto);
if(success)
{
final CMMsg msg=CMClass.getMsg(mob,null,this,CMMsg.... | 8 |
public void jump(boolean forceJump) {
if (onGround || forceJump) {
onGround = false;
setVelocityY(JUMP_SPEED);
if(anim == left)
anim = animJumpLeft;
else if (anim == right)
anim =animJumpRight;
anim.update(JUMP_TIME);
... | 4 |
public ExitMessage(){
int len = 12;
buf = new byte[len];
TypeConvert.int2byte(len, buf, 0);
TypeConvert.int2byte(RequestId.Exit, buf, 4);
} | 0 |
public static String byte2hex2(byte[] source) {
if (source == null || source.length <= 0) {
return "";
}
final int size = source.length;
final char str[] = new char[size * 2];
int index = 0;
byte b;
for (int i = 0; i < size; i++) {
b = source[i];
str[index++] = sHexDigits[b >>> 4 & 0xf];
str[... | 3 |
@Override
public void startEvent(){
try{
for(int i = 0 ; i < 5; i++){
if(inputs[0].getText().isEmpty() &&
inputs[1].getText().isEmpty()
&& inputs[2].getText().isEmpty()){
voltage = DEFAULT_VOLTAGE;
... | 9 |
public AnnotatedWith( Annotation annotation )
{
this.annotation = annotation;
} | 0 |
private synchronized void setState(ClientState state) {
if (this.state != state) {
this.setChanged();
}
this.state = state;
this.notifyObservers(this.state);
} | 1 |
@Test
public void edgeIsToggled()
{
Vertex v1 = vc.addVertex(3, 5);
Vertex v2 = vc.addVertex(5, 3);
vc.toggleEdge(v1, v2);
boolean b1 = v1.getAdjacents().contains(v2) && v2.getAdjacents().contains(v1);
vc.toggleEdge(v2, v1);
boolean b2 = v1.getAdjacents().isEmpty(... | 3 |
public void filter(FileFilter customFilter) {
FileFilter filter = makeFilter();
//Adds custom filter if exists
if (filter != null && customFilter != null) {
filter = new AndFilter(filter, customFilter);
} else if (filter == null && customFilter != null) {
filter ... | 7 |
public String getClipboardContents()
{
String result = "" ;
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() ;
//odd: the Object param of getContents is not currently used
Transferable contents = clipboard.getContents( null ) ;
boolean hasTransferableText = ( contents != null... | 4 |
private void readObject(ObjectInputStream in) throws IOException {
setLevel(Level.parse(in.readUTF()));
setLoggerName(in.readUTF());
setMessage(in.readUTF());
setMillis(in.readLong());
final Object[] params = new Object[in.readInt()];
for (int i = 0; i < params.length; i+... | 5 |
@Override
public boolean put( String key, Long value )
{
if ( key == null )
{
throw new IllegalArgumentException( "key was null" );
}
if ( value == null )
{
throw new IllegalArgumentException( "value was null" );
}
int iteration = ... | 7 |
void verificarObstaculos(){
int cabeza = inicioSnake +longSnake -1;
cabeza = cabeza %(ancho *alto);
for(int i = inicioSnake;i< inicioSnake +longSnake -1 ;i++){
int pos = i %(alto*ancho);
if(snakeX[cabeza] == snakeX[pos]&&
snakeY[cabeza] ==snakeX[pos]){... | 3 |
public void ConsultarAdmin(String user, String clave) throws SQLException {
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
try{
Conexion.GetInstancia().Conectar();
ResultSet consulta=Conexion.GetInstan... | 3 |
public static String convertFileToString(File file) {
if (file != null && file.exists() && file.canRead() && !file.isDirectory()) {
Writer writer = new StringWriter();
InputStream is = null;
char[] buffer = new char[1024];
try {
is = new FileInputStream(file);
Reader reader = new BufferedReader(... | 8 |
static public CycSymbol getCycSymbolForBoolean(boolean val) {
return (val == false) ? CycObjectFactory.nil : CycObjectFactory.t;
} | 1 |
public static void main(String[] args) {
System.out.println("Backspace = <\b>");
System.out.println("New line = <\n>");
System.out.println("Return = <\r>");
System.out.println("Formfeed = <\f>");
System.out.println("Tab = <\t>");
System.out.println("Backslash = <\\>");
System.out.println("Single quote = <\'>");
... | 0 |
public static void scrollBothPaneV(String str, int delta) {
if (str == "inc") {
scrollPane1.getVerticalScrollBar().setValue(scrollPane1.getVerticalScrollBar().getValue() - delta);
scrollPane2.getVerticalScrollBar().setValue(scrollPane2.getVerticalScrollBar().getValue() - delta);
... | 2 |
@Override
protected Integer doInBackground() throws Exception {
/* Try to connect to the server on localhost, port 5556 */
jLabel3.setText("Sending transfer command");
ChatBox.MultiThreadChatClient.os.println("/send");
Socket sk = new Socket("188.26.255.139", 5557... | 4 |
private final void loadProps() {
if (props == null) {
props = new Properties();
}
InputStream in;
try {
File propsFile = new File(StaticString.PROPS_NAME);
if (propsFile.exists()) {
in = new FileInputStream(propsFile);
} else {
in = ClassLoader.getSystemClassLoader().getResourceAsStream(
... | 4 |
public void beforeFirst() throws SQLException {
if (first == 1) {rs.beforeFirst();}
else {rs.absolute(first - 1);}
} | 1 |
private void copierFichier(String source, String destination) throws IOException {
FileInputStream fis = null;
FileOutputStream fos = null;
try {
byte buffer[] = new byte[1024];
int taille = 0;
fis = new FileInputStream(source);
fos = new FileOutputStream(destination);
... | 5 |
public void zoom(int amount) {
int direction = amount / Math.abs(amount);
for (int i=1; i<=Math.abs(amount); i++) {
if (radius > originalRadius || direction > 0) {
radius = radius + 30*direction;
}
}
this.windowCoordsUpdated = false;
updateCenterCoordinates();
} | 3 |
public String getCode() {
return code;
} | 0 |
public Entity(EntityType type, Point world_position) {
this.type = type;
is_opaque = EntityType.isOpaque(type);
is_passable = EntityType.isPassable(type);
name = EntityType.getName(type);
needs_update = EntityType.needsUpdate(type);
default_interact = EntityType.defaultIn... | 2 |
private IMode getMode(byte[] key, byte[] iv, int state) {
IBlockCipher cipher = CipherFactory.getInstance(properties.get("cipher"));
if (cipher == null) {
throw new IllegalArgumentException("no such cipher: " + properties.get("cipher"));
}
int blockSize = cipher.defaultBlockSize();
... | 5 |
private static int determineWinner(FutureTask<Integer> task1, FutureTask<Integer> task2)
throws InterruptedException,
ExecutionException
{
boolean isDone = false;
int winnerTime = 0;
while (!isDone)
{
if (task1.isDone())
{
... | 3 |
public static Keyword interpretIterativeForallScores(ControlFrame frame, Keyword lastmove) {
if (lastmove == Logic.KWD_DOWN) {
if (frame.partialMatchFrame == null) {
ControlFrame.createAndLinkPartialMatchFrame(frame, Logic.KWD_ITERATIVE_FORALL);
}
else {
while (frame.partialMatchFr... | 7 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(target==mob)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return f... | 7 |
public void move(boolean forward) {
_motor.set((forward ? 1 : -1)*MOTOR_SPEED);
} | 1 |
public RarHandler(File album) {
Logger.getLogger(RarHandler.class.getName()).entering(RarHandler.class.getName(), "RarHandler", album);
try {
archive = new Archive(album);
} catch (RarException | IOException ex) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVE... | 5 |
public void saveState(Session s) throws Exception {
s.saveInt(homeworld == null ? -1 : homeworld.ID) ;
s.saveInt(partners.size()) ;
for (System p : partners) s.saveInt(p.ID) ;
for (int i = NUM_J ; i-- > 0 ;) {
s.saveFloat(jobSupply[i]) ;
s.saveFloat(jobDemand[i]) ;
}
s... | 4 |
public static String formatArray(String[] arr, char sep) {
if (arr.length == 0)
return "";
StringBuffer sb = new StringBuffer();
int sepcount = arr.length - 1;
for (int i = 0; i < sepcount; i++)
sb.append(arr[i] + sep);
sb.append(arr[sepcount]);
return sb.toString();
} | 2 |
private void setPreparedStatementValues(PreparedStatement preparedStatement,
Field field,
int index,
Product product) {
try {
Class<?> type = field.getType();
String typeName = type.getSimpleName();
if (typeName.equals("String")) {
preparedStatement.setString(ind... | 7 |
@EventHandler
public void onMessageEvent(MessageEvent event){
try{
Object o = Utils.fromByteArray(event.b);
if(o instanceof String){//assume its json //****************************
GSONListener.listen((String)o, event.sc);// Gson/Json *
return; // Listener ... | 6 |
boolean handleWrite() throws IOException {
synchronized (this.bufferQueueMutex) {
ByteBuffer buffer = this.bufferQueue.peek();
while (buffer != null) {
channelWrite(buffer);
if (buffer.remaining() > 0) {
return false; // Didn't finish this buffer. There's more to
// send.
} else {
... | 2 |
public boolean intersects(KDPoint q, double distActual) {
return isInside(q, distActual) || intersectHorizontal(q, distActual, true) || intersectHorizontal(q, distActual, false) ||
intersectVertical(q, distActual, true) || intersectVertical(q, distActual, false);
} | 4 |
public boolean readFAT() {
//System.out.println("Reading FAT from disk");
int entries= 0;
File file = new File(cacheDir, "FAT");
if(!file.isFile()) {
return false;
}
FileInputStream fileIn;
try {
fileIn = new FileInputStream(file);
} catch (IOException e) {
return false;
}
DataInputSt... | 7 |
public MethodCollector visitMethod(int access, String name, String desc) {
// already found the method, skip any processing
if (collector != null)
return null;
// not the same name
if (!name.equals(methodName))
return null;
Ty... | 9 |
private void updateParts() {
entireView.removeAll();
for (JComponent jp : parts) {
entireView.add(jp);
}
} | 1 |
public void toggleKey(int keyCode,boolean isPressed){
if(keyCode == KeyEvent.VK_W || keyCode == KeyEvent.VK_UP){
up.toggle(isPressed);
}
if(keyCode == KeyEvent.VK_S || keyCode == KeyEvent.VK_DOWN){
down.toggle(isPressed);
}
if(keyCode == KeyEvent.VK_A || keyCode == KeyEvent.VK_LEFT){
left.toggle(isPr... | 8 |
public void resolve(String name_, boolean ip4only_) {
name = name_;
int hash = name_.hashCode();
if (hash < 0)
hash = -hash;
hash = hash % 55536;
hash += 10000;
try {
address = new InetSocketAddress(InetAddress.g... | 2 |
public static node Huffman(ArrayList<node> list){//Creates tree and returns root
int n = list.size();
node x = eMin(list);
node y = eMin(list);
node no = new node();
no.l = x;
no.r = y;
no.val = x.val + y.val;
no.frequency = x.frequency+y.frequency;
list.add(no);
... | 1 |
private void sendToAll(ChatMsg input) {
byte[] data = new byte[UTF_CHAT_MSG_BYTESIZE];
try {
data = input.toString().getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
data = input.toString().getBytes();
}
for (User u... | 3 |
public void initiateRemoval() {
if(this.isRemoving()) return;
try
{
List<Appointment> aAppt = Appointment.findByVenue(this.getId());
// if no user is concerned, finalize it
if(aAppt.size() <= 0) {
this.finalizeRemovalWithoutChecking();
return;
}
this.aWaitingId.clear();
for(Appointment a... | 4 |
@Override
public void onCompleted( EntityConcentrationMap data )
{
for(EntityGroup group : data.getAllGroups())
{
if(!mSettings.matchesWarn(group))
continue;
mReporter.reportGroup(mSettings, group.getEntities().size(), group.getLocation());
}
mReporter.groupDone(mSettings);
} | 2 |
final public void Function_name() throws ParseException {
/*@bgen(jjtree) Function_name */
SimpleNode jjtn000 = new SimpleNode(JJTFUNCTION_NAME);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
Identifier();
} catch (Throwab... | 8 |
public Object getValue (HashMap<String,HashMap<String,Object>> map, String mainKey, String nodeKey) {
// do mainKey exist?
if(!map.containsKey(mainKey)) {
return false;
}
HashMap<String,Object> obj = map.get(mainKey);
if(!obj.containsKey(nodeKey)) {
return false;
... | 3 |
@Override
public void loadOp() throws DataLoadFailedException {
ConfigurationSection sec = getData(specialYamlConfiguration, "op");
YamlPermissionBase permBase = new YamlPermissionOp(sec);
load(PermissionType.OP, permBase);
} | 0 |
public String nextCDATA() throws JSONException {
char c;
int i;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
if (end()) {
throw syntaxError("Unclosed CDATA");
}
sb.append(c);
i = ... | 6 |
public static void handleEvent(int eventId)
{
if(eventId == 1)
{
System.out.println("Level one selected");
}
else if(eventId == 2)
{
System.out.println("Level two selected");
}
else if(eventId == 3)
{
System.out.println("Level three selected");
}
else if(eventId == 4)
{
... | 5 |
public static void load() {
File file = new File(Shortcuts.dataFolder, "bannedPlayers.dat");
if (!file.exists()) {
return;
}
FileInputStream fis = null;
ObjectInputStream ois = null;
try {
fis = new FileInputStream(file);
ois = new Ob... | 6 |
private boolean isEdgeNode(int index)
{
int x = index % width;
int y = index / width;
boolean isValid = false;
if( (x == 0 || x == width - 1) && (y > 0 && y < height - 2) )
{
isValid = true;
}
else if( (y == 0 || y == height - 1) && (x > 0 && x < width - 2) )
{
isValid = true;
}
else
{
i... | 8 |
public void storageAreaCardBackgroundSetter(List<String> backgrounds){
for(int i=0; i<backgrounds.size(); i++){
storageAreaCardsJlabelList.get(i).setIcon(new ImageIcon((URL)this.getClass().getResource(backgrounds.get(i))));
storageAreaCardsJlabelList.get(i).addMouseListener(new MouseListener() {
@Overr... | 8 |
public void processFrame(ArrayList<Integer> frame) {
// Remove all escape characters in the array.
for (int i = 0; i < frame.size(); i ++) {
//System.out.println("Processing " + String.format("0b%8s", Integer.toBinaryString((int) 0xFF & frame.get(i))).replace(' ', '0') + "");
System.out.print(frame.get(i)... | 6 |
public void addLista(AbstractRolamento r, String s)
{
if(s.equals("Torno") && (r.getEtapa()!=-1))
{
listaTorno.add(r);
checaPrioridades(listaTorno);
checaPrioridades(listaTorno);
}
if(s.equals("Fresa") && (r.getEtapa()!=-1))
{
listaFresa.add(r);
checaPrioridades(listaFresa);
checaPrior... | 8 |
protected void landingOn(PlayerClass pPlayer)
{
//If you land on it, 100*die*breweries owned
if(this.owned == false) // if not owned
{
if(cout.buyBrewery(this.buyPrice) == true) // prompt the player
{
pPlayer.account.addBalance(-this.buyPrice, pPlayer.getName(), true);
pPlayer.account.addTypeOwn... | 4 |
public EntityComponent getComponent(int id) {
Iterator<EntityComponent> it = components.iterator();
while (it.hasNext()) {
EntityComponent current = it.next();
if (current.getId() == id) {
return current;
}
}
return null;
} | 2 |
public void testWeighted(String prefix, int maxIter, int seedSize,
double threshold, int noTrees) throws FileNotFoundException {
if (noTrees == 0) {
noTrees = Integer.MAX_VALUE;
}
double sumacc = 0.0;
// double sumaccw = 0.0;
double acc = 0.0;
// dou... | 8 |
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) {
if (!(table.getParent() instanceof JViewport)) {
return;
}
JViewport viewport = (JViewport) table.getParent();
Rectangle rect = table.getCellRect(rowIndex, vColIndex, true);
Rectangle viewRect =... | 9 |
private boolean newTable(MCDAssociation ass) {
if (ass.sizeLink() > 2 || ass.sizeInformation() > 0)
return true;
boolean porteuse = true;
for (Iterator<MCDLien> e = ass.links(); e.hasNext();)
if (!((MCDLien) e.next()).getCardMax().equals("N"))
porteuse = false;
return porteuse;
} | 4 |
@Override
public boolean equals(Object obj) {
if (obj instanceof BulkFood){
BulkFood objFood = (BulkFood)obj;
if (objFood.name.equals(this.name) && objFood.unit.equals(this.unit) &&
objFood.pricePerUnit == this.pricePerUnit
&& objFood.supply == this.supply)
return true;
else
retur... | 5 |
@Override
public BufferedImage[] getClonedObject(String name, Map<String, String> data) {
BufferedImage[] oldImages = getObject(name, data);
BufferedImage[] newImages = new BufferedImage[oldImages.length];
for(int i = 0; i < oldImages.length; i++){
newImages[i] = oldImages[i].getSubimage(0, 0, oldImages[i].ge... | 1 |
public void edit(Room room) throws NonexistentEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
room = em.merge(room);
em.getTransaction().commit();
} catch (Exception ex) {
... | 5 |
@Override
public void executar() throws Exception
{
boolean goBack = false;
while ( !goBack )
{
mostrarOpcions();
int choice = readint("\nOPCIO: ");
switch (choice)
{
case 1:
... | 5 |
public Medico getMedico() {
return medico;
} | 0 |
@Test
public void testTruncate_null()
{
Assert.assertEquals(null, _helper.truncate(null, 35));
} | 0 |
public synchronized void sendBinary(Object message)
throws IOException {
if (trace >= API_TRACE_MESSAGES) {
Log.current.println(df.format(new Date()) + "\n Sending request: " + message + " to connection: " + this);
}
if (logger.isLoggable(Level.FINE)) {
logger.fine("sendBinary: " + ... | 2 |
private BufferedImage convertGreyscaleToArgb(byte[] data, BufferedImage bi) {
// we use an optimised greyscale colour conversion, as with scanned
// greyscale/mono documents consisting of nothing but page-size
// images, using the ICC converter is perhaps 15 times slower than this
// method. Using an example sc... | 9 |
private final boolean cvc(int i)
{ if (i < 2 || !cons(i) || cons(i-1) || !cons(i-2)) return false;
{ int ch = b[i];
if (ch == 'w' || ch == 'x' || ch == 'y') return false;
}
return true;
} | 7 |
public TileMap loadNextMap() {
TileMap map = null;
while (map == null) {
currentMap++;
try {
if(currentMap==4){
currentMap=1;
}
map = loadMap(
"/maps/map" + currentMap + ".txt");
}... | 4 |
public void setShuffledState() {
Random random = new Random();
for(int i=0;i<20;i++) {
switch(random.nextInt(5)) {
case 0 : shiftUp(random.nextInt(3)); break;
case 1 : shiftDown(random.nextInt(3)); break;
case 2 : shiftLeft(random.nextInt(3)); break;
case 3 : shiftRight(random.nex... | 8 |
public static void goToUnexplored(){
int x = RobotData.INSTANCE.getLocation().x;
int y = RobotData.INSTANCE.getLocation().y;
Point coor = PatternCheck.getClosestUnexplored(x, y, map,0);
int tarX = coor.x;
int tarY = coor.y;
//path planning, going to unexplored
... | 9 |
private ForNode For() throws SyntaxException {
try {
BlockNode init = null;
ExpressionNode condition = null;
BlockNode<ExpressionNode> step = new BlockNode<ExpressionNode>();
Position pos = iterator.current().coordinates().starting();
nextToken();
... | 8 |
public Sprite getSprite(String ref) {
if (sprites.containsKey(ref)) return sprites.get(ref);
BufferedImage sourceImage;
try {
URL url = this.getClass().getClassLoader().getResource(ref);
if (url == null) {
System.out.println("Can't find: " + ref);
}
sourceImage = ImageIO.read(url);
Gr... | 3 |
public ArrayList<Tayte> haeTaytelista() throws DAOPoikkeus {
ArrayList<Tayte> taytteet = new ArrayList<Tayte>();
// Avataan yhteys
Connection yhteys = avaaYhteys();
try {
// Haetaan tietokannasta kaikki sinne tallennetut täytteet.
String tayteQuery = "select nimi, tayteID from Tayte ORDER BY ... | 2 |
public InputStream createIncomingStream(StreamInitiation initiation) throws XMPPException {
PacketCollector collector = connection.createPacketCollector(
getInitiationPacketFilter(initiation.getFrom(), initiation.getSessionID()));
connection.sendPacket(super.createInitiationAccept(initi... | 9 |
public void onCommand(CommandSender sender, ChunkyCommand command, String label, String[] args) {
if (!(sender instanceof Player)) {
Language.IN_GAME_ONLY.bad(sender);
return;
}
if (args.length == 0) {
Player player = (Player) sender;
displayInfo(... | 3 |
public String[][] getStringArrayByQuery(String query) throws SQLException {
checkConnection();
if(conn != null) {
Statement stmt;
try {
stmt = conn.createStatement();
ResultSet resSt = stmt.executeQuery(query);
ArrayList<String[]> al = new ArrayList<String[]>();
int rowCount = resSt.getMetaDat... | 4 |
static final int method1098(int i) {
if ((double) Class26.aFloat473 == 3D) {
return 37;
}
if ((double) Class26.aFloat473 == 4D) {
return 50;
}
if ((double) Class26.aFloat473 == 6D) {
return 75;
}
if (i != 37) {
retur... | 5 |
public void magicOnItems(int slot, int itemId, int spellId) {
switch(spellId) {
case 1162: // low alch
if(System.currentTimeMillis() - c.alchDelay > 1000) {
if(!c.getCombat().checkMagicReqs(49)) {
break;
}
if(itemId == 995) {
c.sendMessage("You can't alch coins");
break;
}
... | 9 |
public void op(Object x, Object y) {
if (x instanceof double[])
opDouble((double[]) x, (double[]) y);
else if (x instanceof int[])
opInt((int[]) x, (int[]) y);
else if (x instanceof boolean[])
opBoolean((boolean[]) x, (boolean[]) y);
else if (x instanc... | 8 |
public static ArrayList<String[]> generateStandardPopulation(String popType,
int popSize, String missing) {
ArrayList<String[]> pedList = new ArrayList<String[]>();
int numlength = Integer.toString(popSize).length();
DecimalFormat format = new DecimalFormat("0000000000".substring(0, ... | 8 |
void func_523_a(int var1, int var2, int var3, float var4, byte var5, int var6) {
int var7 = (int)((double)var4 + 0.618D);
byte var8 = otherCoordPairs[var5];
byte var9 = otherCoordPairs[var5 + 3];
int[] var10 = new int[]{var1, var2, var3};
int[] var11 = new int[]{0, 0, 0};
int var12 =... | 5 |
public static AppWindow getTopWindow() {
if (!WINDOW_LIST.isEmpty()) {
return WINDOW_LIST.get(0);
}
return null;
} | 1 |
public void setBuyBackMoney(double buyBackMoney){
this.buyBackMoney = buyBackMoney;
} | 0 |
public void reconnect()
{
reconnecting = true;
close();
// Attempt reconnects every 5s
while (!isConnected())
{
try
{
connect();
}
catch (IOException e)
{
System.err.println("Error when reconnecting: ");
e.printStackTrace(); // For debug purposes
sleep(5000);
}
}
... | 2 |
public boolean submitResponseBipolar(BipolarQuestion bipolarQuestion) {
Element bipolarQuestionE;
boolean flag = false;
for (Iterator i = root.elementIterator("responseToBipolar"); i.hasNext();) {
bipolarQuestionE = (Element)i.next();
if (bipolarQuestionE.element("id").getText().equals(bipolarQuestion.getId... | 4 |
public void printBoard( boolean[][] b, Tuple<Integer,Integer> currentLight ) {
for ( int i = 0; i < 100; i++ ) {
for ( int j = 0; j < 100; j++ ) {
if ( currentLight != null && currentLight.y == i && currentLight.x == j ) {
System.err.print( "*" );
} else {
if (b[j][i]) {
System.err.print( ... | 6 |
public InputField() {
super(510);
setMaximumSize( new Dimension(0, 28) );
setFocusTraversalKeysEnabled(false);
addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
handleInputText();
}
... | 3 |
public void paint(Graphics g) {
Dimension size = getSize();
Color bgColor = getBackground();
if(bgColor != null) {
g.setColor(bgColor);
g.fillRect(0, 0, size.width, size.height);
}
if(useCustomImages) {
Graphics2D g2 = (Graphics2D) g.create();
BufferedImage image = getOrientation() == J... | 8 |
public static void addMenu() {
JSScriptInfo.RemoveAllSriptsFromMenu();
unionRoot = new MenuElement(null,
new String[]{CustomMenu.menu_prefix}, resUnion, "Union",
"Union functions", 'U', "union_root");
union_menu.setRootElement(unionRoot);
/*Здесть насрал Керрига... | 8 |
public GameLogic(){
for (int i=0; i<9; i++){
this.gameField[i] = 0;
}
this.isFull = false;
this.turn = 1;
} | 1 |
public void ge_print(TextArea area,String var,String prefix){
String instr="";
if(!var.equals("-145876239")){
instr = prefix + "%call" + String.valueOf(call_num) + " = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([5 x i8]* @.str, i32 0, i32 0), i32 " + var + ")\n";
}
... | 1 |
public HUD(Main main, OrthographicCamera cam) {
this.cam = cam;
this.main = main;
this.character = main.character;
//font = TextureRegion.split(Game.res.getTexture("text"), 8, 11)[0];
//font = TextureRegion.split(Game.res.getTexture("text2"), 7, 12)[0];
font = TextureRegion.split(Game.res.getTexture("tex... | 4 |
@Override
public String toString() {
String result = "";
for (int y = 0; y < this.image.getHeight() - scale; y += scale) {
for (int x = 0; x < this.image.getWidth() - scale; x += scale) {
result += pixelToChar(getBlockIntensity(x, y));
... | 2 |
public static double[][] getArrayCoordinates(Point[] array){
int n = array.length;
int m = array[0].getPointDimensions();
double[][] cc = new double[m][n];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cc[j][i] = (array[i].getPointCoordinates())[j];
... | 2 |
private static void makeLevel(int level) {
if (level == 1) {
makeLevel1();
}
if (level == 2) {
makeLevel2();
}
if (level == 3) {
makeLevel3();
}
} | 3 |
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.