text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void spawn(final Player p){
PlayerData data = PluginData.getPlayerData(p);
if(data == null) Broadcast.error("You cannot be spawned because your player data cannot be found. Report this error.", p);
else{
final ClassType classChoice = data.getNextClass();
if(classChoice == null){
MenuManager.sendP... | 3 |
public void setValueString(String newValueString)
{
valueString = newValueString;
// parse:
try
{
value = new Double(valueString);
isValid = true;
}
catch (NumberFormatException e)
{
isValid = false;
}
catch (NullPointerException e)
{
isValid = false;
}
// perform limit checking:
... | 8 |
public static void main(String args[]){
int headCount=0,tailCOunt=0;
GenericCoin GC=new GenericCoin();
for(int i=0;i<50;i++){
GC.toss();
if(GC.isHeadSide())
headCount++;
else
tailCOunt++;
}
System.out.println("HeadCount is: "+headCount);
System.out.println("TailCount is: "+tailCOunt);
... | 2 |
public Map<String, Object> findSimpleResult(String sql, List<Object> params)
throws SQLException {
Map<String, Object> map = new HashMap<String, Object>();
int index = 1;
pstmt = connection.prepareStatement(sql);
if (params != null && !params.isEmpty()) {
for (int i = 0; i < params.size(); i++) {
pstm... | 6 |
public void mousePressed(MouseEvent e) {
//NIVEL 1 ............................................
if(bNivel1){
for(Object lnkProducto : lnkProductos1) {
Producto proObjeto = (Producto) lnkProducto;
// Si se selecciona un objeto
if(pr... | 9 |
public static void sendMail(EmailDetailsDto emailDto) throws SwingObjectException{
MultiPartEmail email=null;
try {
if(emailDto.isHtml()) {
email=new HtmlEmail();
((HtmlEmail)email).setHtmlMsg(emailDto.getBody());
}else {
email = new MultiPartEmail();
email.setMsg(emailDto.getBody());
}
... | 7 |
public void setPixel(int x, int y, int gray) throws Exception {
if (x < 0 || x >= width)
throw new Exception("x out of range");
if (y < 0 || y >= height)
throw new Exception("y out of range");
if (gray < 0)
gray = 0;
if (gray > 255)
gray = 255;
this.image[x][y] = gray;
} | 6 |
public static void m68ki_set_sm_flag(long s_value, long m_value) {
/* ASG: Only do the rest if we're changing */
s_value = (s_value != 0) ? 1L : 0L;
m_value = (m_value != 0 && (m68k_cpu.mode & CPU_MODE_EC020_PLUS) != 0) ? 1 : 0 << 1;
if (get_CPU_S() != s_value || get_CPU_M() != m_value) ... | 8 |
public void colourGrid(int i, int j) {
if((i / 3 < 1 || i / 3 >= 2) && (j / 3 < 1 || j / 3 >= 2)
|| (i / 3 >= 1 && i / 3 < 2) && (j / 3 >= 1 && j / 3 < 2)) {
gridView[i][j].setBackground(Color.LIGHT_GRAY);
} else {
gridView[i][j].setBac... | 8 |
public static String[] getBadCharactersForPassingNamingValidation(String password) {
String[] badCharacters = new String[0];
//return badCharacters;
String badCharacter = "";
int j =0;
passwordValidation:
for (String character : password.split(""))
{
// fix for first empty ch... | 8 |
public static boolean transform(InstructionContainer ic,
StructuredBlock last) {
if (!(last.outer instanceof SequentialBlock)
|| !(ic.getInstruction() instanceof StoreInstruction)
|| !(ic.getInstruction().isVoid()))
return false;
return (createAssignOp(ic, last) || createAssignExpression(ic, last));
... | 4 |
public int treeDepth(BTPosition<T> current) throws InvalidPositionException {
if (current == root)
return 1;
return 1 + treeDepth(current.getParent());
} | 1 |
@BeforeClass
public static void setUpClass() {
} | 0 |
public InnerClassInfo getOuterClassInfo(ClassInfo ci) {
if (ci != null) {
InnerClassInfo[] outers = ci.getOuterClasses();
if (outers != null)
return outers[0];
}
return null;
} | 2 |
public void addDeploymentAlternativeIfNotPresent(DeploymentAlternative deploymentAlternative, SequenceAlternative sequenceAlternative) {
for (DeploymentAlternative da : project.getDeploymentAlternatives())
if (da.getId().equals(deploymentAlternative.getId())) {// deploymentAlternative
// already
... | 4 |
@Test
public void testSetNombre() {
System.out.println("setNombre");
String nombre = "";
Cuenta instance = new Cuenta();
instance.setNombre(nombre);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
... | 0 |
public boolean hasPrimitivePeer() {
if (mObjectClass == Integer.class ||
mObjectClass == Boolean.class ||
mObjectClass == Byte.class ||
mObjectClass == Character.class ||
mObjectClass == Short.class ||
mObjectClass == Long.class ||
mObjectC... | 9 |
protected boolean isPalindrome(int pNumber){
boolean check = false;
int[] digits = breakIntToDigitsArray(pNumber);
if (pNumber > 99999){
if(digits[0] == digits[5] && digits[1] == digits[4] && digits[2] == digits[3]){
check = true;
}
} else {
if(digits[0] == digits[4] && digits[1] == digits[3]){
... | 6 |
public static void removeAdress(int memberID){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
conn.setAutoCommit(false);
PreparedS... | 4 |
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String inputLine = scan.nextLine();
String[] words = inputLine.split("[^a-zA-Z]+");
// for (String string : words) {
// System.out.println(string);
// }
HashSet<String> cognateWords = new... | 7 |
@Override
public Color[][] getColors(double[][] heightmap, boolean[][] watermap) {
Color[][] color = new Color[heightmap.length][heightmap.length];
for (int x = 0; x < heightmap.length; x++)
for (int y = 0; y < heightmap[x].length; y++)
color[x][y] = getColor(heightmap, watermap, x, y);
return color;
} | 2 |
@Test
public void deepMiddleTest() {
Array<Integer> arr = ObjectArray.from(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26);
for(int i = 8; i >= 6; i--) {
arr = arr.remove(i);
}
for(int i = 15; i >= 9; i--) {
arr =... | 5 |
public void shoot(int dist, Point shooterPosition) {
int d6 = 42 + (6 * 6 * currentTime.getH() + 6 * currentTime.getM() +
currentTime.getS()) % 42;
int d7 = 42 + (7 * 7 * currentTime.getH() + 7 * currentTime.getM() +
currentTime.getS()) % 42;
int id = 0;
if (dist < d6)
id = 6;
if (... | 7 |
public int compare(Object o1, Object o2) {
o1 = ((Vector<?>) o1).elementAt(column);
o2 = ((Vector<?>) o2).elementAt(column);
if(o1 instanceof Double && o2 instanceof Double) {
return ((Double) o1).compareTo(((Double) o2));
}
if(o1 instanceof String && o2 instanceof String) {
return ((String) o1).compare... | 8 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Email)) {
return false;
}
Email other = (Email) object;
if ((this.id == null && other.id != null) || (this.id !... | 5 |
public void flatten(TreeNode root) {
if(root == null)
return;
List<TreeNode> list = new ArrayList<TreeNode>();
addTreeNode(list,root);
TreeNode node = root;
for(int i = 1 ;i < list.size();i++){
node.left = null;
node.right = list.get(i);
... | 2 |
public boolean insertNewCod(String cod, String nome){
out("Inserindo novo código...");
boolean isThere = false;
rs = responseQuery("SELECT cod FROM " + tableCodName + " WHERE cod = '" + cod + "';");
try
{
while(rs.next())
{
String str = rs.... | 4 |
@Override
public boolean equals( Object otherObj )
{
try
{
// If same object, just quickly return true.
if ( this == otherObj )
{
return true;
}
// If other object is not same class as this object, quickly return false.... | 9 |
public ConfigFile() {
gson = new GsonBuilder().setPrettyPrinting().create();
File root = Constants.getRoot();
configurationFile = new File(root,"config.json");
if (configurationFile.exists())
config = gson.fromJson(readString(), Configuration.class);
else
{
config = new Configuration();... | 3 |
protected Class getTransitionClass() {
return automata.fsa.FSATransition.class;
} | 0 |
@Override
public void onDeleteDirectory(String arg0, DokanFileInfo arg1)
throws DokanOperationException {
try {
if (DEBUG)
System.out.println("SeleteDir: " + arg0);
fileSystem.deleteDirectoryRecursively(mapWinToUnixPath(arg0));
} catch (AccessDeniedException e) {
throw new DokanOperationException(n... | 4 |
@Override
public boolean equals(Object object) {
if (!(object instanceof Organization)) {
return false;
}
Organization other = (Organization) object;
if ((this.organizationName == null && other.organizationName != null) || (this.organizationName != null && !this.organizat... | 5 |
private List<Entry> createEntries(GoodsType goodsType) {
List<Entry> result = new ArrayList<Entry>();
if (goodsType.isFarmed()) {
for (ColonyTile colonyTile : colonyTiles) {
Tile tile = colonyTile.getWorkTile();
if (tile.potential(goodsType, null) > 0
... | 9 |
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | 0 |
public ImportXml(String fileName, String type) {
// Use the default (non-validating) parser
SAXParserFactory factory = SAXParserFactory.newInstance();
Debug.print("Using Sax Parser factory: " + factory.getClass() + "\n");
try {
// Parse the input
SAXParser saxParser = factory.newSAXParser();
if (ty... | 8 |
@Override
protected int getAvgIndex(ChannelType c) {
switch (c) {
case HUE:
return 0;
case SATURATION:
return 1;
default:
throw new IllegalArgumentException();
}
} | 2 |
public int nextInt() {
do {
int cursorNow = bufferCursor.get() ;
int cursorNext = cursorNow+1 ;
if ( cursorNext < BUFFER_SIZE && bufferCursor.compareAndSet(cursorNow, cursorNext) ) {
return buffer[cursorNext] ;
}
else {
synchronized (bufferGen) {
cursorNow = bufferCursor.get() ;
c... | 5 |
public ClientHanldler(Socket client) {
this.client = client;
} | 0 |
@EventHandler
public void SkeletonBlindness(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.getZombieConfig().getDouble("Skeleton.B... | 7 |
protected final void CreateConfirmWindow() {
sum = getTotalSumOfTheOrder();
try {
log.debug("Contents of the current basket:\n"
+ model.getCurrentPurchaseTableModel());
Object[] options = { "Accept", "Cancel" };
NumberFormat amountFormat = NumberFormat.getNumberInstance();
sumField = new JFormat... | 5 |
public static HashMap<String, Integer> readMileage(String path)
throws IOException
{
// Set up a HashMap to store the data
HashMap<String, Integer> mileageData = new HashMap<String, Integer>();
// Set up the reader from the text file
try
{
BufferedReader reader = new BufferedReader(n... | 9 |
public void drawMap(Graphics2D g){
for(int row = 0; row < numRowsToDraw; row++){
if(row >= numRows) break;
for(int col = 0; col < numColsToDraw; col++){
if(row >= numCols) break;
if(map[row][col] == 0) continue;
... | 5 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
return getSuppliercode() == ((SuppliersModel) obj).getSuppliercode() &&
getName() == ((SuppliersModel) obj).getName();
} | 2 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final int newDressCode=1;
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
... | 7 |
private static void initMainMenuMask() {
String s = System.getProperty("os.name");
if ((s.lastIndexOf("Windows") != -1)
|| (s.lastIndexOf("windows") != -1))
MAIN_MENU_MASK = InputEvent.CTRL_MASK;
else
MAIN_MENU_MASK = InputEvent.META_MASK;
} | 2 |
public boolean suppressionFichier(ObjectInputStream input, ObjectOutputStream output) throws IOException
{
//lecture du pathname envoyé par le client
String pathnameFichier = input.readUTF();
try
{
boolean estSupprime = this.deleteDirOrFile(new File(pathnameFichier));
envoiCo... | 1 |
public int getHealth(String userName){
try {
cs = con.prepareCall("{call returnPlayerHealth(?)}");
cs.setString(1, userName);
ResultSet rs = cs.executeQuery();
if(rs.next()){
return rs.getInt(1);
}
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
} | 2 |
public void setListener(DollarListener listener)
{
this.listener = listener;
} | 0 |
@Test
public void testPropertiesFile() throws Exception
{
String filename = "temporary_test.prop";
//create a file for the properties
FileWriter fw = new FileWriter(filename);
// test all values correctly set
if (driver != null)
{
fw.write("com.github.conserveorm.driver=" + driver + "\n");
}
fw.wr... | 6 |
public void test_22() {
initSnpEffPredictor();
VariantFileIterator snpFileIterator;
snpFileIterator = new SeqChangeTxtFileIterator("tests/chr_not_found.out", config.getGenome());
snpFileIterator.setIgnoreChromosomeErrors(false);
boolean trown = false;
try {
// Read all SNPs from file. Note: This should... | 4 |
private int rank(GoodsType g) {
return (!g.isStorable() || g.isTradeGoods()) ? -1
: (g.isFoodType()) ? 1
: (g.isNewWorldGoodsType()) ? 2
: (g.isFarmed()) ? 3
: (g.isRawMaterial()) ? 4
: (g.isNewWorldLuxur... | 8 |
public CheckField(boolean initialValue, Color bg, String fieldTitle, String checkboxFunction) {
if (bg == null) {
setBackground(Color.WHITE);
}
if (fieldTitle == null) {
fieldTitle = "";
}
if (checkboxFunction == null) {
checkboxFunction = ""... | 3 |
public void doA08(MsgParse mp)
throws SQLException {
if (!mp.visit.getPatient_class().isEmpty())
try {
PreparedStatement prepStmt = connection.prepareStatement(
"update patient set "
+ "last_name = ?"
+ ", fi... | 2 |
private void initialiserHeuresAccumulees() {
heuresAccumulees = new HashMap<>();
for (String categoriesReconnue : categoriesReconnues) {
heuresAccumulees.put(categoriesReconnue, 0);
}
} | 1 |
public boolean start() {
synchronized (this.optOutLock) {
// Did we opt out?
if (this.isOptOut()) {
return false;
}
// Is metrics already running?
if (this.task != null) {
return true;
}
// Begin hitting the server with glorious data
this.task = this.plugin.getServer().getSched... | 7 |
public void addNoInstrumentReg(String arg) {
String patternString = arg.substring(NO_INSTRUMENT_REG_PREFIX.length());
if (patternString.startsWith("/"))
patternString = patternString.substring(1);
try {
patternMatchers.add(PatternMatcherRegEx.getExcludePatternMatcher(patt... | 2 |
public TabbedPanel(final JFrame frame) {
setLayout(new BorderLayout());
this.frame = frame;
final JTabbedPane tabbedPane = new JTabbedPane();
CijferOverzichtPanel coPanel = new CijferOverzichtPanel();
tabbedPane.addTab("Cijfer overzicht", coPanel);
if (Sessie.getIngelogdeGebruiker().isDocent()
|| Ses... | 4 |
public int countRows(String tableName) throws SQLException {
if (conn != null) {
PreparedStatement stmt = conn.prepareStatement(String.format("SELECT COUNT(*) AS rowcount FROM %s", tableName));
ResultSet rs = stmt.executeQuery();
rs.next();
return rs.getInt("rowcount");
}
return 0;
} | 1 |
private static Element findElement( Element root, String tag ) throws IOException
{
NodeList elements = root.getElementsByTagName( tag );
if (elements.getLength() == 0)
{
throw new IOException( "Tag " + tag + " was expected and not found." );
}
else if (elements.getLength() !=... | 2 |
private boolean canMakeDocument() {
if (!domaineExists()) {
return false;
}
if (domaine.getCategoriesMotClef().size() > 0) {
for (CategorieMotClef c : domaine.getCategoriesMotClef()) {
if (c.getMotClefs().size() > 0) {
return true;
}
}
javax.swing.JOptionPane.showMessageDialog(MainWindow... | 4 |
public OperatingSeat getSeat() {
return this._seat;
} | 0 |
private final void escapeAndAdd(StringBuffer sb, String text) {
// TODO: On the move to 1.5 use StringBuffer append() overloads that
// can take a CharSequence and a range of that CharSequence to speed
// things up.
//int last = 0;
int count = text.length();
for (int i=0; i<count; i++) {
char ch = text.c... | 7 |
public boolean mouseup(Coord c, int button) {
if (dm) {
ui.grabmouse(null);
dm = false;
storepos();
} else {
super.mouseup(c, button);
}
return (true);
} | 1 |
public void move(int direction)
{
if(direction == NORTH)
{
if(row != 0)
row--;
}
else if(direction == SOUTH)
{
if(row != cells-1)
row++;
}
else if(direction == WEST)
{
if(column != 0)
column--;
}
else if(direction == EAST)
{
if(column != cells-1)
column++;
}
else i... | 9 |
public File verificaArquivoDeConfiguracao() {
File xml = new File("config.xml");
if (xml.isFile() && xml.exists()) {
return xml;
} else {
return null;
}
} | 2 |
private ByteBuffer retrieveMessage(
RetrieveMessageRequest retrieveMessageRequest, String address) {
// TODO: P1
ClientConnectionLogRecord record = new ClientConnectionLogRecord(
address, SystemEvent.RETRIEVE_MESSAGE,
"Received request to retrieve a message by "
+ retrieveMessageRequest.getFilterTy... | 7 |
private void invoke(final ObjectName name)
throws Exception
{
log.debug("Invoke " + name);
MBeanServerConnection server = getMBeanServer();
// get mbean info for this mbean
MBeanInfo info = server.getMBeanInfo(name);
// does it even have an operation of this name?
... | 9 |
public boolean equalsMat( MVMaterial mat ){
return (mat.ignoreData&&mat.id==id) || (ignoreData&&mat.id==id) || (mat.data==data && mat.id==id);
} | 5 |
*/
public byte[] getOriginator() {
//return mesh address if available
if(sixLoWPANpacket != null && sixLoWPANpacket.isMeshHeader()){
return sixLoWPANpacket.getOriginatorAddress();
//else look for an existing sixlowpan address
} else if(sixLoWPANpacket != null && sixLoWPANpacket.isIphcHeader() && sixLoWPANpa... | 5 |
public void handEndHandler(){
if (player.didSplit == false){//if they didn't split
player.total = totalCards(player.cards, player.total, "player");
dealerTotal = totalCards(cards, dealerTotal, "dealer");
if (dealerTotal > player.total){
System.out.println("Dealer wins with " + dealerTotal + ". You had " ... | 9 |
private void updateZebraColors( )
{
if ( (rowColors[0] = getBackground( )) == null )
{
rowColors[0] = rowColors[1] = java.awt.Color.white;
return;
}
final java.awt.Color sel = getSelectionBackground( );
if ( sel == null )
{
rowColor... | 5 |
private URLConnection openClassfile0(String classname) throws IOException {
if (packageName == null || classname.startsWith(packageName)) {
String jarname
= directory + classname.replace('.', '/') + ".class";
return fetchClass0(hostname, port, jarname);
}
... | 2 |
public boolean isFeasible(Coordinate c) {
boolean validI = c.i >= 0 && c.i < size;
boolean validJ = c.j >= 0 && c.j < size;
boolean validCell = false;
if (validI && validJ) {
validCell = (maze.get(c.i).get(c.j).val == 0);
}
return validI && validJ && validCell;
} | 6 |
@Override
public boolean execute() {
try {
/* Always delete in reverse order */
int i = this.endAt;
while (i >= this.startFrom) {
this.document.remove(i);
i--;
}
return true;
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
} | 2 |
@Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
// counter.setSharedCounter(counter.getSharedCounter()+1);
int val = counter.incrementAndGet();
System.out.println("Thread name=" + Thread.currentThread().getName() +", id=" + Thread.currentThread().getId()+ ", counter = " + val)... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Item other = (Item) obj;
if (id != other.id)
return false;
return true;
} | 4 |
public static void main(String[] args) {
int valorx,valory,r;
valorx=Integer.parseInt(JOptionPane.showInputDialog("Ingrese el valor del entero X"));
valory=Integer.parseInt(JOptionPane.showInputDialog("Ingrese el valor del entero Y"));
if (valorx<=0 || valorx>255)
{
... | 5 |
@Override
public Staff find(int id) {
Staff found = null;
PreparedStatement pst = null;
ResultSet rs = null;
try {
pst=this.connect().prepareStatement("select * from Staff where id= ?");
pst.setInt(1, id);
rs=pst.executeQuery();
... | 6 |
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
vasen = true;
if (ensiksiPainettu == Painike.NULL) {
ensiksiPainettu = Painike.VASEN;
}
}
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
oikea ... | 6 |
public static void main(String[] args){
new Lanceur();
} | 0 |
public void setVolume(String soundName, double volume) {
Sound sound = sounds.get(soundName);
if (sound != null) {
sound.setVolume(volume);
}
} | 1 |
public String coder()
{
this.completeTabFrequence();
this.sortTabFrequence();
this.initTree();
this.buildTree();
this.tabBinary = this.lstArbre.get(0).codageTabBinary();
String chaineCoder = "";
for (int code : this.encoding) {
chaineCoder... | 1 |
public void setSize(int new_size) {
if (item_names != null) {
String[] new_item_names = new String[new_size];
for (int i = 0; i < new_size; i++) {
if (i < size) {
new_item_names[i] = item_names[i];
} else {
new_item_... | 6 |
public void update(GameContainer gc, StateBasedGame sbg, int delta) {
//Checks to see whether owner has reached end of path and needs to turn around.
distance += speed*delta;
if (distance > range){
distance = 0;
isForward = !isForward;
}
//Updates position based on current travel path.
if (isForward){... | 2 |
public static void paintStory(BufferedImage image, Movie movie)
{
Graphics2D g2 = (Graphics2D) image.getGraphics();
g2.setFont(Constants.fontStory);
FontMetrics fm = g2.getFontMetrics();
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
String[] words = movie.getStory(... | 5 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int n = to.length();
char[] circle = new char[n];
/*
* First fill the circle buffer with as many characters as are in the
* to string. If we... | 9 |
private static String readAll(Reader rd) throws IOException {
StringBuilder sb = new StringBuilder();
int cp;
while ((cp = rd.read()) != -1) {
sb.append((char) cp);
}
return sb.toString();
} | 1 |
@Override
public void mousePressed(MouseEvent mouseEvent) {
if(mouseEvent.getX()<100 && mouseEvent.getY() < 140)
daVisualizzare();
else visualizzata=null;
} | 2 |
public Bernoulli(double p) throws ParameterException {
if (p < 0 || p > 1) {
throw new ParameterException("Bernoulli parameter 0 <= p <= 1.");
} else {
this.p = p;
}
} | 2 |
public final void setCurrentServerIndex(int currentServer) {
if(currentServer < Settings.serversCount)
this.serverBox.setSelectedIndex(currentServer);
} | 1 |
public Client() {
_scanner = new Scanner(System.in);
try {
UnicastRemoteObject.exportObject(this, 0);
_instance = this;
} catch(RemoteException ex) {
System.out.println(ex.getMessage());
}
_username = "";
_password = "";
} | 1 |
public void reset() {
for (int x = 0; x < cells.length; x++) {
for (int y = 0; y < cells[x].length; y++) {
cells[x][y] = new Cell(x, y);
cells[x][y].setScreenX(10 + x * 13);
cells[x][y].setScreenY(10 + y * 13);
}
}
for (int... | 4 |
public void run() {
onStart();
while (true) {
List<WebURL> assignedURLs = new ArrayList<>(50);
isWaitingForNewURLs = true;
frontier.getNextURLs(50, assignedURLs);
isWaitingForNewURLs = false;
if (assignedURLs.size() == 0) {
if (frontier.isFinished()) {
return;
}
try {
Thread.sle... | 7 |
public void setMode(int mode) throws ParserConfigurationException,
TransformerException, IOException, SAXException {
if (this.mode == GeneralDestruction.MODE_EDITOR && mode == MODE_GAME) {
this.mode = mode;
gui.setMode(mode);
if (currentPath != null) {
saveTo(currentPath);
initialize(currentPath);... | 6 |
public void init() {
setSize(700, 400);
setLayout(new BorderLayout()); // JFrame layout
lblStatus = new JLabel(sMessage);
lblMoney = new JLabel(sMoney);
lblBet = new JLabel(sBet);
txtMoney = new JTextField("", 4);
arLblPlayer = new JLabel[6];
arLblDealer ... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Carnivoro other = (Carnivoro) obj;
if (anni != other.anni)
return false;
if (forza != other.forza)
return false;
if (livelloCibo != oth... | 9 |
public static String escape(String string) {
StringBuffer sb = new StringBuffer();
for (int i = 0, len = string.length(); i < len; i++) {
char c = string.charAt(i);
switch (c) {
case '&':
sb.append("&");
break;
case '<':... | 5 |
public void setAPasso(TNumeroInt node)
{
if(this._aPasso_ != null)
{
this._aPasso_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this)... | 3 |
public static boolean isUnderline(JTextPane pane)
{
AttributeSet attributes = pane.getInputAttributes();
if (attributes
.containsAttribute(StyleConstants.Underline, Boolean.TRUE))
{
return true;
}
if (attributes.getAttribute(CSS.Attribute.TEXT_DECORATION) != null)
{
Object fontWeight = attribut... | 2 |
public boolean right() {
for(boolean[] position : emplacement.getCoordoneeJeu())
if(position[emplacement.getNombreColonne()-1]==true)
return false;
for(boolean[] position : emplacement.getCoordoneeJeu())
for(int x=emplacement.getNombreColonne()-1; x>=0; x... | 5 |
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.