text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void Light()
{
if (hasFireBuilt)
{
battery = ps.getBattery();
gum = ps.getGum();
Dialog.message("\nHow should I light the fire?");
if (battery >= 1 && gum >= 1)
{
Dialog.message("\nHey I still have a cou... | 8 |
public void edit(T entity) {
getEntityManager().merge(entity);
} | 0 |
public static int sizeOfRawVarInt(final int value) {
if ((value & (0xffffffff << 7)) == 0) {
return 1;
}
if ((value & (0xffffffff << 14)) == 0) {
return 2;
}
if ((value & (0xffffffff << 21)) == 0) {
return 3;
}
if ((value & (0xffffffff << 28)) == 0) {
return 4;
}
return 5;
} | 4 |
private void execSalvarCrlv() throws ClassNotFoundException, SQLException{
ModelCRLV c = new ModelCRLV();
c = jifCrlv.getModelCrlv(c, "adicionar");
int result = daoCrlv.insert(c);
gcrlv.addCrlv(c);
if(result == 1){
JOptionPane.showMessageDialog(null, "Registro i... | 1 |
static Method getMethod(Class cls,String name,Object [] args) {
Class [] args_cls = new Class[args.length];
for (int i=0; i<args.length; i++) {
if (args[i] instanceof Boolean) {
args_cls[i] = Boolean.TYPE;
} else if (args[i] instanceof Character) {
args_cls[i] = Character.TYPE;
} else if (args[i] i... | 8 |
public void InstrLoad() throws ParseException {
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk) {
case LDI:
InstrLDI();
break;
case LD:
InstrLD_variant();
break;
case LDD:
InstrLDD();
br... | 7 |
@Override
public String toString() {
return "POP " + new Integer(levelsOfStackToPop).toString();
} | 0 |
public InputStream pcmstream() {
return (new InputStream() {
private byte[] buf;
private int bufp;
private boolean convert() throws IOException {
float[][] inb = decode();
if (inb == null) {
buf = new byte[0];
... | 9 |
synchronized void method87(byte i) {
if (i > -11)
paint(null);
if (Class305.canvas != null) {
Class305.canvas.removeFocusListener(this);
Class305.canvas.getParent().setBackground(Color.black);
Class305.canvas.getParent().remove(Class305.canvas);
}
anInt7++;
Container container;
if (Class34.aFr... | 6 |
public void actionPerformed(ActionEvent e) {
JMenuItem source = (JMenuItem)e.getSource();
System.out.println(source.getText() + " pressed.");
if (source.getText() == "New")
newFile();
else if (source.getText() == "New Layer")
newLayer();
else if (source.getText() == "Open")
openFile();
else if (sou... | 5 |
public Object invokeMethod(Reference ref, boolean isVirtual, Object cls,
Object[] params) throws InterpreterException,
InvocationTargetException {
if (isWhite(ref))
return super.invokeMethod(ref, isVirtual, cls, params);
MethodIdentifier mi = (MethodIdentifier) Main.getClassBundle()
.getIdentifier(ref)... | 3 |
protected void setPeriod(double period){
_period = period;
} | 0 |
public static int computeRawVarint64Size(long value) {
if ((value & (0xffffffffffffffffL << 7)) == 0)
return 1;
if ((value & (0xffffffffffffffffL << 14)) == 0)
return 2;
if ((value & (0xffffffffffffffffL << 21)) == 0)
return 3;
if ((value & (0xffffffff... | 9 |
public void add(double d) {
Double lows_max = lows.peek();
Double highs_min = highs.peek();
if (lows_max != null && highs_min != null) {
if (d < lows_max) {
lows.add(-d);
lows_count++;
} else {
highs.add(d);
highs_count++;
}
} else if (lows_max == null) {
lows.add(-d);
lows_cou... | 7 |
@Override
public int compare(Body b1, Body b2) {
int res=0;
if (sortMode==0){
if (b1.getId()>b2.getId()) res=1;
else if (b1.getId()<b2.getId()) res=-1;
}
else if (sortMode==1){
res=b1.getName().compareTo(b2.getName());
}
else if (sortMode ==2){
... | 8 |
public void moveHorizontal(int movement) {
stopHor = false;
moveHor = movement;
if(moveHor != 0) moveHor += movement / 10;
if(moveHor < -50) moveHor = -50;
if(moveHor > 50) moveHor = 50;
} | 3 |
public void startMysql() throws IOException
{
ServerSocket socket = new ServerSocket(0);
port = socket.getLocalPort();
socket.close();
dbDir = File.createTempFile("mysqldb", ".db");
Assert.assertTrue(dbDir.delete());
Assert.assertTrue(dbDir.mkdir());
mysqld... | 1 |
@Override
public void windowIconified(WindowEvent arg0)
{
} | 0 |
public void update(E object, AABB volume) {
if (traversalCount != 0) {
throw new ConcurrentModificationException("Index cannot be modified during traversal.");
}
Node node = leafMap.get(object);
if (node == null) {
return;
}
if (node != root) {
Node parent = node.parent;
for (int i = 0; i < ... | 8 |
@Override
public void setReceiveMessage(IReceiveMessage receiveMessage) {
this.receiveMessage = receiveMessage;
} | 0 |
public static void extractFromJar(String fileName) {
JarFile jar = null;
InputStream in = null;
OutputStream out = null;
try {
String path = Chunky.class.getProtectionDomain().getCodeSource()
.getLocation().getPath();
path = path.replaceAll("%2... | 9 |
public static void loadSpawnPoint(File file) {
Spawn newpoint;
try {
newpoint = Spawn.loadConfig(file);
FearTheReaper.SpawnPointList.put(newpoint.getName(), newpoint);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
... | 3 |
private void checkOpenConnections() {
if (stopping) {
return;
}
// do routine checks on active connections
synchronized (m_OpenConnections) {
for (Iterator<Connection> iter = m_OpenConnections.iterator(); iter.hasNext();) {
Connection conn = iter.n... | 6 |
public int getLength() {
return getFollowingGlieder();
} | 0 |
public Boolean isStringValid(String in) {
//System.out.println("M " + in + " M");
Boolean returnVal=Boolean.TRUE;
if (in==null || in.length()==0) return returnVal;
try {
for (int i=0; i<in.length(); ) {
int start=startChars.indexOf(in.charAt(i));
if (start!=-1) {
int end=... | 9 |
public static int getUnreadCount(User user) {
int unreadCount = 0;
try {
String statement = new String("SELECT COUNT(mid) FROM " + DBTable + " WHERE uid2 = ? and isConfirmed = false and isRejected = false");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
stmt.setInt(1, user.userID);... | 2 |
public RUBTClient(String[] args){
// the following is a check to make sure the command line arguments were
// stored correctly
input = new Scanner(System.in);
if(args.length != 2 && args.length != 3){
System.err.println("Please enter command line arguments: <torrentfile>.torrent <saveFile>.<ext>");
Sys... | 9 |
public void modify(int value)
{
if (stack.empty())
{
stack.push(value);
return;
}
if (value == 0)
return;
if (stack.peek() != -3 || value == -4)
{
stack.pop();
stack.push(value);
}
} | 4 |
public static void main(String[] args) {
if (args.length != 1)
throw new IllegalArgumentException("Incorect parameters count. Expected count is 1 that is assumed as threads count," +
"but current is " + args.length);
threadsCount = Integer.parseInt(args[0]);
//--... | 5 |
public boolean process(boolean peakX, boolean peakY, boolean peakZ, Double xValue) {
/*
if (peakY) {
if (bottomYcounter < WINDOW_SIZE) {
bottomYcounter = 0;
bottomOk = false;
} else {
bottomOk = true;
}
peakYcount... | 6 |
public ArrayList<Ligne> getLignesStation(Station s) {
if(s == null || metro == null) return null;
ArrayList<Ligne> res = new ArrayList<Ligne>();
for(Ligne ligne : metro) {
if(ligne.existeStation(s)) res.add(ligne);
}
return res;
} | 4 |
private boolean func_151635_b(int[] p_151635_1_, int[] p_151635_2_, int p_151635_3_, int p_151635_4_, int p_151635_5_, int p_151635_6_, int p_151635_7_, int p_151635_8_)
{
if (p_151635_6_ != p_151635_7_)
{
return false;
}
else
{
int k1 = p_151635_1_[p_... | 5 |
protected boolean isInterface(final Type t) {
if (currentClass != null && t.equals(currentClass)) {
return isInterface;
}
return getClass(t).isInterface();
} | 2 |
private static ArrayList<Fact> loadFacts()
{
ArrayList<Fact> facts = new ArrayList<>();
int k = da.getNumberOfFacts();
for(int i=1; i<=k; i++)
{
Fact fact = new Fact(i,
da.getFact(i),
da.getFactTex... | 3 |
public String getStyle(String key) {
if(styles!=null)
return styles.get(key);
return null;
} | 1 |
@Override
public void deleteProduct(Product product) throws SQLException {
Session session=null;
try{
session=HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.delete(product);
session.getTransaction().commit();
}catch(Exception e){
e.printStackTrace();
}finall... | 3 |
public JTextField getTxtNom() {
return txtNom;
} | 0 |
public void list(String path) throws IOException {
FileStatus[] status = fs.listStatus(new Path(path));
for(int i=0;i<status.length;i++){
System.out.println(status[i].getPath());
}
} | 1 |
@Override public double nextDouble() throws IOException {
JsonToken token = peek();
if (token != JsonToken.NUMBER && token != JsonToken.STRING) {
throw new IllegalStateException("Expected " + JsonToken.NUMBER + " but was " + token);
}
double result = ((JsonPrimitive) peekStack()).getAsDouble();
... | 5 |
public int getInt(String Pos) {
switch (Pos) {
case "a1":
return 0;
case "a2":
return 1;
case "a3":
return 2;
case "b1":
return 3;
case "b2":
return 4;
case "b3":
return 5;
case "c1":
return 6;
case "c2":
return 7;
case "c3":
return 8;
default:
return 10000;
}
} | 9 |
public static List<String> defineDescription(HashMap<String,List<String>> pDictionary) {
// category
String namespaceCat = "http://vocabularies.wikipathways.org/wp#category";
String namespaceDes = "http://purl.org/dc/terms/description";
comments.clear();
List<String> tempList = new ArrayList<String>()... | 4 |
public void addItemtoUndo(ArrayList<UndoableItem> udi) {
undoStack.push(udi);
} | 0 |
private void addProgram( String text, int type )
{
int shader = glCreateShader( type );
if ( shader == 0 )
{
System.err.println( "Shader creation failed: Could not find valid memory location when adding shader" );
System.exit( 1 );
}
glShaderSource( shader, text );
glCompileShader( shader );
if ... | 2 |
private void processLogin2Msg(byte[] pktBuffer, DatagramPacket rcvPkt) {
try {
DataInputStream dis = new DataInputStream(
new ByteArrayInputStream(pktBuffer));
dis.readByte();
int len = dis.readInt();
byte[] encName = new byte[len];
dis.read(encName);
len = dis.readInt();
byte[] retCookie = ne... | 7 |
public void detection_region(Image image) {
long start = System.currentTimeMillis();
long end;
int region = 1;
liste = new ArrayList();
Color noir = new Color(0, 0, 0);
//On init à 0 les pixels noirs ( frontières )
regions.add(new Region(0));
for(... | 9 |
public int minYDistance(int y) {
if (type == TYPE_POLY) {
int p=10000;
for (int i=0; i<poly.npoints; i++) {
int np=poly.ypoints[i];
if (Math.abs(y-np) < Math.abs(y-p))
p=np;
}
return p;
} else if (type == TYPE_RECT) {
int[] points =... | 8 |
public void decryptFile(File read, File write) {
InputStream filein = null;
InputStream in = null;
OutputStream fileOut = null;
try {
cipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
filein = new FileInputStream(read);
fileOut = new FileOutputStream(w... | 6 |
protected Window getParentWindow()
{
Container container = getParent();
while(container != null) {
if(container instanceof Window)
return ((Window)(container));
else if(container instanceof Component)
container = ((Component)container).getParen... | 3 |
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g... | 4 |
private void setKey(byte[] key)
{
int[] k32e = new int[MAX_KEY_BITS/64]; // 4
int[] k32o = new int[MAX_KEY_BITS/64]; // 4
int[] sBoxKeys = new int[MAX_KEY_BITS/64]; // 4
gSubKeys = new int[TOTAL_SUBKEYS];
if (k64Cnt < 1)
{
throw new IllegalArgumentExc... | 9 |
public static String xsddatetime(long date) {
/*******************************************************************
* Finally, we succeed in creating ISO conform dateTime strings!
*******************************************************************/
DateTimeFormatter formatter = ISODateT... | 0 |
public Type intersection(Type type) {
if (type == tError)
return type;
if (type == Type.tUnknown)
return this;
Type newBottom = getSpecializedType(type);
Type newTop = getGeneralizedType(type);
Type result;
if (newTop.equals(newBottom))
result = newTop;
else if (newTop instanceof ReferenceType
... | 6 |
public static CrowdAgentState swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
return swigValues[swigValue];
for (int i = 0; i < swigValues.length; i++)
if (swigValues[i].swigValue == swigValue)
return swigValues... | 5 |
public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Usage: Main numOfHints");
System.exit(1);
}
// Informative output
System.out.println("Using K=" + K);
// Create
BitSet message = generateRandomBitSet(64);
// Informative output
System.out.println("\nOriginal Me... | 4 |
public String getContent(){
String content = "";
if(containsRock){
content = content + "#";
}
else if(containsRedAntHill){
content = content + "+";
}
else if(containsBlackAntHill){
content = content + "-";
}
if(isClear){
content = content + ".";
}
if(containsAnt){
if(ant.getColou... | 8 |
private static void measure(Benchmark run)
{
for (int i = 0; i < WARMUP_REPEATS; i++)
{
run.run();
}
long time = 0;
for (int i = 0; i < TEST_REPEATS; i++)
{
final long startT = System.nanoTime();
run.run();
time += System.nanoTime() - startT;
}
System.out.printf("%1$s: %2$,d nannos/run (total: %3... | 2 |
public static Karaoke leerArchivoKaraoke(String ruta) {
File archivo = new File(ruta);
FileInputStream fileInputStream = null;
ObjectInputStream objectInputStream = null;
try {
fileInputStream = new FileInputStream(archivo);
objectInputStream = new ObjectInputStream(fileInputStream);
} catch (FileNotFou... | 5 |
protected void initialize() {
Logger.log((Settings.UsePondaration ? "using" : "not using") + " pondarated random");
frame = new JFrame();
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
try {
UserManager.getUser().save();
} catch (Excepti... | 6 |
@Override
public String getDesc() {
return "DoubleAttack";
} | 0 |
public double standardizedPersonMean(int index){
if(!this.dataPreprocessed)this.preprocessData();
if(index<1 || index>this.nPersons)throw new IllegalArgumentException("The person index, " + index + ", must lie between 1 and the number of persons," + this.nPersons + ", inclusive");
if(!this.varia... | 4 |
public Terminated<Element> create() {
if (ready() == false) {
throw new IllegalStateException();
}
final String header = getDataSource().next().getElement();
assert header.startsWith("{");
TableStrategy strategy = TableStrategy.DRAW_NONE;
if (header.length() == 2) {
strategy = TableStrategy.fromChar(... | 8 |
public void update() {
if (Game.keys.isDown(KeyEvent.VK_RIGHT))
pos.x += 5;
else if (Game.keys.isDown(KeyEvent.VK_LEFT))
pos.x -= 5;
else if (Game.keys.isDown(KeyEvent.VK_DOWN))
pos.y += 5;
else if (Game.keys.isDown(KeyEvent.VK_UP))
pos.y -... | 8 |
public void reset()throws TableException{
String createString;
java.sql.Statement stmt;
try{
createString = "drop table " + ADDRESS_TABLE_NAME + ";";
stmt = sqlConn.createStatement();
stmt.executeUpdate(createString);
} catch (java.... | 3 |
static private void ajouterNoeud(Integer a, Integer b,TreeMap<Integer, TreeSet<Integer> > noeuds)
{
TreeSet<Integer> tmp = noeuds.get(a);
if(tmp == null)
{
tmp = new TreeSet<Integer>();
}
tmp.add(b);
noeuds.put(a, tmp);
tmp = noeuds.get(b);
if(tmp == null)
{
tmp = new TreeSet<In... | 2 |
public FieldVisitor visitField(final int access, final String name,
final String desc, final String signature, final Object value) {
if (owner.startsWith("java/")) {
System.out.println(owner + ' ' + name);
}
return null;
} | 1 |
private static HashMap clonePreexists(final HashMap old) {
final HashMap clone = new HashMap();
final Iterator vars = old.keySet().iterator();
while (vars.hasNext()) {
final LocalVariable var = (LocalVariable) vars.next();
final HashSet set = (HashSet) old.get(var);
if (set == null) {
clone.put(var, ... | 2 |
public Server() {
super("SERVER");
/*init ligne */
try {
InfoLigne = Utile.getStation();
TabLigne[0]=true;
ID_controleur[0]=true;
for (int i = 1; i < TabLigne.length; i++) {
TabLigne[i]=false;
ID_controleur[i]=false;
}
} catch (IOException e) {
// TODO Auto-generated ca... | 2 |
public static final boolean isAllowedContainsAny(final MOB mob, final Room room, final SecGroup secGroup)
{
if(mob==null)
return false;
if(isASysOp(mob))
return true;
if((mob.playerStats()==null)
||((mob.soulMate()!=null)&&(!mob.soulMate().isAttributeSet(MOB.Attrib.SYSOPMSGS))))
return false;
final ... | 9 |
public boolean containsResend(){
if(len<6) return false;
for (int i = 0; i < len-3; i++) {
if(array[i]=='R' && array[i+1]=='e' && array[i+2]=='s' && array[i+3]=='e' && array[i+4]=='n' && array[i+5]=='d') return true;
}
return false; //ASCII
} | 8 |
public static String[] getTactics(String name) {
try {
TacticsLogFile help = new TacticsLogFile(
Output.getInstance().htmlPath);
JSONObject content = new JSONObject(help.read("{}"));
if (content.has(name)) {
JSONArray t = content.getJSONObject(name).getJSONArray(
"tactics");
String[] tacti... | 4 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equal... | 6 |
private void setPixels(int originalOffset, int width, int pixels[], int originalPixels[], int originalDeviation, int height, int deviation, int alpha, int offset) {
int color;
int alphaValue = 256 - alpha;
for (int k2 = -height; k2 < 0; k2++) {
for (int l2 = -width; l2 < 0; l2++) {
color = originalPixels[o... | 3 |
public Communicator() {
try {
sender = new OSCPortOut();
reciever = new OSCPortIn(57111);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (SocketException e) {
e.printStackTrace();
}
this.addListeners();
} | 2 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(exitProgram)) {
System.exit(0);
}
if (e.getSource().equals(loadFile)) {
operations.loadMap();
}
if (e.getSource().equals(saveFileAs)) {
operations.saveMapAs();
... | 9 |
@Override
public int evict(int evictionQuota) {
int counter = 0;
for(ConcurrentSkipListMap<IndexValue, EvictableServerEntry> priority : getPriorities().values())
if(counter == evictionQuota)
break;
else if(priority.isEmpty())
continue;
else {
Iterator<EvictableServerEntry> iterator = priori... | 8 |
@Override
protected int findPrototypeId(String s)
{
int id;
// #generated# Last update: 2007-05-09 08:16:01 EDT
L0: { id = 0; String X = null;
L: switch (s.length()) {
case 4: X="exec";id=Id_exec; break L;
case 7: X="compile";id=Id_compile; break L;
... | 7 |
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
if(e.isCancelled())
return;
if(e.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if(e.getClickedBlock().getType() != Material.SIGN && e.getClickedBlock().getType() != Material.SIGN_POST && e.getClickedBlock().getType() != Material.WALL_SI... | 9 |
public static String capitalise(String s) {
String finalString = "";
if (s.contains(" ")) {
StringBuilder builder = new StringBuilder();
String[] sp = s.split(" ");
for (String string : sp) {
string = string.substring(0, 1).toUpperCase() + string.subst... | 2 |
StringBuffer leerAsm(Scanner entrada){
StringBuffer contenido = new StringBuffer();
while(entrada.hasNextLine()){
String linea = entrada.nextLine();
if(!linea.startsWith(";") && !linea.contains(";") && !linea.equals("")){
contenido.append(linea);
contenido.append("\n");
}else if(linea.contains(";... | 8 |
@EventHandler
public void onInventoryClick(InventoryClickEvent event){
if(event.getInventory().getHolder()!=null && event.getInventory().getHolder() instanceof Player){
Player eventPlayer = (Player)event.getInventory().getHolder();
if(event.getInventory().getTitle().contains("Welches Stockwerk?"... | 6 |
public MeterHoras(Principal Obj) {
initComponents();
this.setLocationRelativeTo(null);
this.setVisible(true);
this.Obj = Obj;
Obj.principal.diaActual = 0;
mostrar();
String key;
Iterator iterator = Obj.principal.claves.keySet().iterator();
while (... | 4 |
@Override
public void emitterUpdated(EmitterInterface e) {
if (this.connections_.contains(e)) {
if (!this.isCompatible(e)) {
this.deconnect(e);
}else if (this.getType()==ValueType.VOID||getType()==ValueType.NONE){
this.setType(e.getType());
}
}
} | 4 |
private Connection getConnection() throws LoginException {
final String dsJndi = this.getProperty(PARAM_DATASOURCE_JNDI);
final String dbUser = this.getProperty(PARAM_DB_USER);
final String dbPassword = this.getProperty(PARAM_DB_PASSWORD);
try {
/*String nonTxJndiName = dsJn... | 3 |
public WorldInitPanel(Player gamemaster, Vector<World> worlds) {
this.worlds = worlds;
// - initialize miglayout manager
this.setBorder(BorderFactory.createEmptyBorder());
this.setLayout(new MigLayout("width 400!", "[]10[]10[]"));
this.setOpaque(false);
// - introduction
JLabel introduction = new JL... | 8 |
public static void doTxWork( Work work ) {
// Non-managed environment idiom
Session sess = getSessionFactory().openSession();
Transaction tx = null;
try {
tx = sess.beginTransaction();
// do some work
work.work(sess);
tx.commit();
}
catch (RuntimeExcep... | 2 |
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
System.out.println("Please input a serial number to search for: ");
inputSerialNumber = new Scanner (System.in);
unitSerialNumber = inputSerialNumber.nextLine();
fromDir1 = new File("//mri-fileserver/SMW Shipping/55... | 7 |
public Game() {
Framework.gameState = Framework.GameState.GAME_CONTENT_LOADING;
Thread threadForInitGame = new Thread() {
@Override
//run the thread for game class
public void run() {
// Sets variables and objects for the game.
Initia... | 0 |
public String useSkill(int skill, Characters enemy)
{
if (mana >= skillSet.getCost(skill))
{
int damage = roll(skillSet.getValue(skill));
String message = skillSet.getDescription(skill);
if (damage > 0)
{
message = message + " " + enemy.getName() + " suffers " + damage + " damage.";
}
... | 4 |
@Override
public void execute(String inputFile, String outputFile) throws IOException {
final List<PropertiesFile> inputPropFiles = PropertiesFileUtils.findFiles(inputFile);
Collections.sort(inputPropFiles, new PropertiesFileComparator());
final List<String> keys = new ArrayList<String>();
for (PropertiesFi... | 7 |
public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null) return false;
if (obj.getClass() != this.getClass()) return false;
Picture that = (Picture) obj;
if (this.width() != that.width()) return false;
if (this.height() != that.height()) return... | 8 |
public HiloBean get(HiloBean oHiloBean) throws Exception {
if (oHiloBean.getId() > 0) {
try {
oMysql.conexion(enumTipoConexion);
if (!oMysql.existsOne("hilo", oHiloBean.getId())) {
oHiloBean.setId(0);
} else {
oH... | 4 |
public void paintComponent(Graphics g) {
super.paintComponent(g);
int w = getWidth()-1;
int h = getHeight()-1;
g.setFont(font);
FontMetrics fm = g.getFontMetrics(font);
String heading = "Items in "+name+": "+content.size();
switch(direction) {
case EAST:
g.setColor(Color.black);
g.drawString(headi... | 6 |
public int getType(TextGrid grid) {
if(typeIsValid) return type;
typeIsValid = true;
if(size() == 1) {
type = TYPE_OPEN;
return TYPE_OPEN;
}
int typeTrace = getTypeAccordingToTraceMethod(grid);
if(DEBUG){
System.out.println("trace: "+typeTrace);
}
if(typeTrace == TYPE_OPEN) {
type = TYPE_... | 8 |
void next() {
while (input.hasNext()) {
final char currentCharacter = input.next();
// Must be befor whitespace check, because \n is also whitespace
if ('\n' == currentCharacter) {
if (scanNewline()) {
continue;
}
... | 9 |
@Override
public void onDisable()
{
// 'Attempt to' Cancel all tasks
getServer().getScheduler().cancelTasks(this);
Component.disableComponents();
p = null;
// Backup the current files
if (updater != null && updater.getResult() == Updater.UpdateResult.SUCCESS)
{
File destination = new File(... | 6 |
@Test
public void testThatJumpheightCannotBeSetToABadValue() {
corridor.setJumpheight(0);
assertTrue("Jumpheight can't be 0 or smaller.", corridor.getJumpheight() < 4 && corridor.getJumpheight() > 0);
corridor.setJumpheight(4);
assertTrue("Jumpheight can't be 4 or larger.", corridor.getJumpheight() < 4 && c... | 2 |
@Override
public void act()
{
// Cleans unnecessary handleds
removeDeadHandleds();
// Informs all listeners of the last changes
for (int i = 0; i < getHandledNumber(); i++)
{
AdvancedKeyListener listener = getListener(i);
if (listener == null)
continue;
// Informs if a key was presse... | 9 |
public String loginSuivant(String nomPersonne) {
String res = "";
nomPersonne = nomPersonne.toLowerCase();
String dernierLogin = this.dernierDuNom(nomPersonne);
if ("".equals(dernierLogin)) {
int taille = Math.min(4,nomPersonne.length());
String partieNom = nomPe... | 6 |
public Rectangle2D calibrate(Graphics2D g2, Node node) {
RootedTree tree = treePane.getTree();
nodeBar = null;
Line2D barPath = treePane.getTreeLayoutCache().getNodeBarPath(node);
if (barPath != null) {
double height = tree.getHeight(node);
double upper = height;
double lower = height;
boolean h... | 8 |
private Token scaenNumber(CharStream line) throws AssemblerSyntaxException {
if (!CharUtils.isNumeric(line.getCurrentChar())) {
throw new AssemblerSyntaxException(
String.format("Number must start with digit at index %d!", line.getIndex()),
line.getLineNumber(... | 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.