text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void addWorker() {
this.days = Main.getDays();
javax.swing.JTabbedPane tempWorkerDays = new javax.swing.JTabbedPane();
javax.swing.JTextField tempWorkerName = new javax.swing.JTextField();
javax.swing.JPanel tempWorkerTab = new javax.swing.JPanel();
// Makes a tab for each day and a check box for eac... | 4 |
public static void room2()
{
EnemyRat enemy = new EnemyRat();
if (combatDone = false) {
System.out.printf("\n > You step in to a large room with high ceilings supported by stone arches.\n");
System.out.printf("\n > You see a rat!\n");
enemy.combatinitialize();
}
else
Room2.afterCombat();
... | 1 |
public void listenerPrincipal(final DiabetesPerceptronContainer diabetesPerceptronGui){
diabetesPerceptronGui.btnAgregarSetAprendizaje.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DefaultTableModel temp = (DefaultTableModel) diabetesPerceptronGui.tablaS... | 4 |
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par1World.isRemote)
{
return true;
}
else
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
int var7 = var6 & 7;
... | 6 |
public Integer save(Step step) {
return (Integer) sessionFactory.getCurrentSession().save(step);
} | 0 |
public int buscar(String str, int pos) {
String nom, cuen;
if (str == null) {
return -1;
}
if (pos < 0) {
pos = 0;
}
for (int i = pos; i < nElementos; i++) {
nom = clientes[i].obtenerNombre();
if (nom == null) {
... | 7 |
public World()
{
initWorld();
} | 0 |
public static int getVerticalDistance(ParserNode node, int childIndex,
int symbolSize) {
List<ParserNode> children = node.getChildren();
int childrenSize = children.size();
// vertikalna udaljenost najnižih sklopova i čvorova sa samo jednim
// djetetom je 0
if (node.getHeight() <= 2 || childrenSize == 1)... | 7 |
private void createSnapshotImage() throws IOException {
File outputfile = new File(snapshotimage);
System.out.println("Save snapshot of gcode to "+snapshotimage);
long time = System.currentTimeMillis();
gp.setSnapshotMode();
gp.jumptoLayer(10000);
gp.togglePause();
gp.setPainttravel(Travel.NOT_PAINTED);
... | 7 |
private String getPatternAsFixedString(Class<?> aTargetClass){
String result = null;
if ( BigDecimal.class == aTargetClass || Decimal.class == aTargetClass ) {
result = "_1_ is not in the expected format/range : '_2_'";
}
else if ( Integer.class == aTargetClass ) {
result = "_1_ is not an in... | 8 |
protected final void drawCan() {
Graphics pen = null;
final BufferStrategy b = this.getBufferStrategy();
if (b != null) {
pen = b.getDrawGraphics();
}
if (pen != null) {
myPen.simplePen.pen = (Graphics2D) pen;
pen.setColor(background);
pen.fillRect(0, 0, panelWidth, panelHeight);
pen.... | 3 |
public static final boolean isCPP(String fileName) {
for (String file : CPP) {
if (file.equals(fileName)) {
return true;
}
}
return false;
} | 2 |
public boolean validate(UnitStats unit, PhysicalGameState pgs) {
if (isValidated) {
return true;
}
is_ready = true;
if (unit.id == unitID) {
cooldown = DEFAULT_COOLDOWN;
switch (type) {
case MOVE:
cooldown = unit.definition.move_speed;
isValidated = true;
break;
case ATTACK:
... | 8 |
private void endGame(String message, int points) {
spielfeld.stopGameLoop();
setTitle(message + "! [" + points + " PUNKT" + (points > 1 ? "E" : "") + "]");
} | 1 |
private Set<Particle> getSingleChunck(Particle current) {
Set<Particle> impacting = new HashSet<Particle>();
impacting.add(current);
while (true) {
Set<Particle> tmp = new HashSet<Particle>();
for (Particle pi : impacting) {
tmp.addAll(pi.impacting);
}
boolean changed = impacting.addAll(tmp);
i... | 3 |
public static ResultSet query(Statement stat, String table, long uid, String... field) throws SQLException {
ResultSet rs = null;
StringBuffer sb = new StringBuffer();
sb.append("select ");
boolean bool = false;
if (field == null || field.length == 0 || field[0].equals("")) {
... | 6 |
public void setNovAaaamm(Integer novAaaamm) {
this.novAaaamm = novAaaamm;
} | 0 |
public void creer_message(ParseXML monFichier) {
for(int i = 0; i< monFichier.getTrame().length;i++){
int id = monFichier.getTrame()[i].getId();
int taille = monFichier.getTrame()[i].getDlc();
int date = 0;
if(filemessages.isEmpty()){
debut = monFichier.getTrame()[i].getDate();
}
else{
... | 2 |
public String getSimpleCode(){
String str = item.getSimpleCode();
if(this.items != null)
str += this.items.getSimpleCode();
return str;
} | 1 |
public void addSink(Set<AndroidMethod> sinks) {
this.sinkMethods.addAll(sinks);
} | 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 main(String args[]) {
// Create a hash map
HashMap hm = new HashMap();
// Put elements to the map
hm.put("Zara", new Double(3434.34));
hm.put("Mahnaz", new Double(123.22));
hm.put("Ayan", new Double(1378.00));
hm.put("Daisy", new Double(99.22))... | 1 |
public static Sprite getSprite(String filename)
{
// Try to load the sprite from the cache
Sprite rval = (Sprite) resourceByString.get(filename);
// If it's not in the cache, try to load it from disk
if(rval == null)
{
try {
rval = new Sprite(filename);
resourceByString.put(filename, rval);
... | 2 |
public static void doSmallSteps(int cases, DataInputStream in, DataOutputStream out) throws IOException {
for (int i = 1; i <= cases; i++) {
String[] input = in.readLine().split("\\ ");
int r = Integer.parseInt(input[0]); // rides
int k = Integer.parseInt(input[1]); // seats
int n = Integer.parseInt(inp... | 9 |
private static void createTestCase(String name, double bandwidth,
double delay, int totalGridlet, int[] glLength,
int testNum) throws Exception
{
switch(testNum)
{
case 1:
new TestCase1(name, bandwidth, delay, tota... | 8 |
private String escapeHTML(String source) {
String strResult = "";
String sourceText = "";
int k;
Integer srcLen = source.length();
// Cycle through each input character.
if (srcLen > 0) {
for (int i = 0; i < srcLen; i++) {
sourceText = sourc... | 5 |
@Override
public void huolehdi(){
if (tormaavatko()){
kimmotusehto++;
} else {
kimmotusehto = 0;
}
if (kimmotusehto == 1){
kimmota();
vahentaja.huolehdi();
}
} | 2 |
private void processTokenFile(String fileName, boolean reversed) throws IOException {
XMLStreamReader reader = resourceGetter.getXMLStreamReader(fileName);
try {
while (reader.hasNext()) {
if (reader.next() == XMLStreamConstants.START_ELEMENT) {
String tagName = reader.getLocalName();
if (tagName.e... | 9 |
public Color luoVari(int k1, int k2, int k3){
int a = lueKentta(k1);
int b = lueKentta(k2);
int c = lueKentta(k3);
if(a<0 || b<0 || c<0 || a>255 || b>255 || c>255){
return null;
}
Color co = new Color(a,b,c);
return co;
} | 6 |
private Map<String, String> convertGetAccountActivity(GetAccountActivityRequest request) {
Map<String, String> params = new HashMap<String, String>();
params.put("Action", "GetAccountActivity");
if (request.isSetMaxBatchSize()) {
params.put("MaxBatchSize", request.getMaxBatc... | 8 |
private static String sendHttpPost(String url,
List<NameValuePair> parameters) {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(url);
String output = "";
String line = "";
try {
// sets parameters
List<NameValuePair> nameValuePairs = parameters;
post.setE... | 2 |
private int getHeight(TreeNode root)
{
if(root==null) return 0;
if(root.left == null && root.right ==null) return 1;
if(root.left == null && root.right !=null) return getHeight(root.right) + 1;
if(root.left != null && root.right ==null) return getHeight(root.left) + 1;
return Math.max(get... | 7 |
private void putCardInToStack() {
if(cardStackTo != null && card != null) {
//card.setSeen(true);
cardStackTo.addCard(card);
cardStackToPanel.setCurrentCount(cardStackTo.getCount());
card = null;
modified = true;
}
} | 2 |
@Override
public void redo() {
node.setCommentState(newState);
} | 0 |
public static String typeof(Object value)
{
if (value == null)
return "object";
if (value == Undefined.instance)
return "undefined";
if (value instanceof Scriptable)
{
if (value instanceof XMLObject)
return "xml";
retur... | 8 |
private void restoreValues() {
for (StorageKey key : StorageKey.values()) {
if (!storageValues.containsKey(key.toString())) {
continue;
}
switch (key) {
case outputPath:
springLenghtsTextField.setText(storageValues.get(key.... | 6 |
private void calcTangents(Vertex[] vertices, int[] indices) {
for (int i = 0; i < indices.length; i += 3) {
int i0 = indices[i];
int i1 = indices[i + 1];
int i2 = indices[i + 2];
Vector3f edge1 = vertices[i1].getPos().sub(vertices[i0].getPos());
Vecto... | 3 |
private void warChecker() {
war.checker(playerData);
if (war.warzone) {
ward.setAttackers(player.team);
ward.update();
// war.checker(playerData);
}
} | 1 |
@Override
public void onPacket(SendClientHandshakePacket packet) throws ProtocolException {
log.info("Player[" + packet.nickname + "] tries to login...");
boolean passwordCorrect = ssparams.getHashedServerPassword() == null
|| (packet.hashedPassword != null && Hasher.isEqual(ssparams.getHashedServerPass... | 8 |
public static HDRExposure scaleTo( HDRExposure exp, int width, int height ) {
if( !aspectRatioPreserved(exp.width, exp.height, width, height) ) {
throw new UnsupportedOperationException("Cannot change aspect ratio");
}
double scale = width / exp.width;
if( scale == 0 ) {
return new HDRExposure(0, 0);
... | 8 |
public String getTypeDescription() {
if (this.triggerType==1) return " (START)";
else if (this.triggerType==2) return " (END)";
else if (this.triggerType==3) return " (GRAB)";
else return " (UNKNOWN)";
} | 3 |
public ArrayList<Integer> seach(String str) {
ArrayList<Integer> ends = new ArrayList<Integer>();
int i = 0;
Trie[] trieArray = sons;
while (i < str.length() && trieArray[str.charAt(i) - 'a'] != null) {
if (trieArray[str.charAt(i) - 'a'].finish) {
ends.add(i + 1);
}
trieArray = trieArray[s... | 3 |
public void init(int mode, byte[] key, byte[] iv) throws Exception{
String pad="NoPadding";
byte[] tmp;
if(iv.length>ivsize){
tmp=new byte[ivsize];
System.arraycopy(iv, 0, tmp, 0, tmp.length);
iv=tmp;
}
if(key.length>bsize){
tmp=new byte[bsize];
System.arraycopy(k... | 4 |
public final void premultiply(Matrix matrix) {
entry2[3][0] = entry[3][1] = entry[3][2] = 0.0;
entry2[3][3] = 1.0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++) {
entry2[i][j] = 0.0;
for (int k = 0; k < 4; k++)
entry2[i][j] += matrix.entry[i][k] * entry[k][j];
}
// Swap!
double[]... | 3 |
public void fillArr(int x, int y) {
ArrayList<Delta> changes = currentTool.apply(curColor, x, y, currentLayer.colorArr);
ArrayList<Delta> accepted = new ArrayList<>();
for (Delta d : changes) {
if (!d.amUseless()) {
accepted.add(d);
}
}
cu... | 3 |
@SafeVarargs
public static <T> List<T> concat(T[]... ts)
{
int size = 0;
for (T[] ta : ts)
{
if (ta == null)
{
continue;
}
size += ta.length;
}
List<T> l = new ArrayList<T>(size);
for (T[] ta : ts)
{
for (T t : ta)
{
l.add(t);
}
}
return l;
} | 4 |
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors erros = new ActionErrors();
if(contato.getNome() == null || contato.getNome().isEmpty()) {
erros.add("nome", new ActionMessage("erro.campoNome"));
}
if(contato.getEndereco() == null || contato.getE... | 6 |
@SuppressWarnings("deprecation")
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent event) {
Player p = event.getPlayer();
Action eAction = event.getAction();
if (p.hasPermission("spectacle.create")
&& p.getItemInHand().getTypeId() == Spectacles.toolID) ... | 4 |
@Override
public boolean updateCustomer(Customer customer) {
if (doc == null)
return false;
Element currRoot = doc.getRootElement();
Element parrentCusto = currRoot.getChild("customers");
List<Element> listCusto = parrentCusto.getChildren();
for (Element currCusto : listCusto) {
int custoID = Integer... | 3 |
public void setDefaultPoints(int defaultPoints) {
this.defaultPoints = defaultPoints;
} | 0 |
public void update(){
if(ticksScared >= MAX_TICKS_SCARED)scared = false;
if(scared) {
ticksScared++;
}
super.update();
if(scared)if(!isMoving() && Util.RANDOM.nextInt(1000) < WALK_CHANGE_SCARED) moveRandomLocation(WALK_RANGE);
else if(!isMoving() && Util.RANDOM.nextInt(1000) < WALK_CHANGE_NORMAL) m... | 7 |
private boolean pluginFile(String name)
{
for (final File file : new File("plugins").listFiles()) {
if (file.getName().equals(name)) {
return true;
}
}
return false;
} | 2 |
static void plot(int x, int y, int z, int argb, int argbBackground,
String text, Font3D font3d, Graphics3D g3d) {
if (text.length() == 0)
return;
Text3D text3d = getText3D(text, font3d, g3d.platform);
int[] bitmap = text3d.bitmap;
int textWidth = text3d.width;
int textHeight... | 9 |
public double median_as_double() {
double median = 0.0D;
switch (type) {
case 1:
double[] dd = this.getArray_as_double();
median = Stat.median(dd);
break;
case 12:
BigDecimal[] bd = this.getArray_as_BigDecimal();
median = Stat.median(bd).doubleValue();
bd = null;
break;
case 14:
throw ... | 3 |
public static List<Integer> intersectSortedArraysThree(int[] a, int[] b) {
ArrayList<Integer> result = new ArrayList<Integer>();
int i = 0;
int j = 0;
while (i < a.length && j < b.length) {
if ((i == 0 || a[i] != a[i - 1]) && (a[i] == b[j])) {
result.add(a[i]);
i++;
j++;
continue;
}
if ... | 6 |
private String buildNUM() {
int k = 0;
String str = "";
do {
str += (char) c;
k++;
c = getchar();
} while( myisdigit((char) c) && k < MAXLEN_ID );
putback = true;
if( myisdigit((char) c) && k == MAXLEN_ID ) {
do { c = getcha... | 5 |
static final void method2280(byte i, int i_20_) {
anInt3826++;
if (Class289.aByteArrayArrayArray3700 == null)
Class289.aByteArrayArrayArray3700
= (new byte[4][Class367_Sub4.mapSizeX]
[Class348_Sub40_Sub3.mapSizeY]);
if (i_20_ != 28587)
method2278(35, -47, (byte) 56, -93);
for (int i_21_ = 0; (i_21_... | 5 |
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 feel.
* For details see http://down... | 6 |
@Override
public Label predict(Instance instance) {
if (linkFunction(this.innerProduct(instance)) >= 0.5) {
return new ClassificationLabel(1);
}
return new ClassificationLabel(0);
} | 1 |
public void windowDeactivated(WindowEvent arg0) {
areax = game.getColumns()*2;
areay = game.getRows();
ships = game.getBoats();
player1 = game.playerOne();
player2 = game.playerTwo();
placement = game.gameType();
diagonal = game.levelType();
marked = game.gameMode();
grid1 = new TheGrid(areax... | 8 |
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 feel.
* For details see http://down... | 6 |
public void saveGraphFile()
{
//==== Initialize the filechooser, using the user's home dir, or the last working dir
if(this.currentDirectory.equals(""))
{ this.fc = new JFileChooser(); }
else
{ this.fc = new JFileChooser(this.currentDirectory); }
int returnVal = fc.showSave... | 4 |
public static void main(String[] args) throws Exception {
System.out.println("Please select a folder with your tiled pictures");
System.out.println("Your pictures will be stiched together from left to right \n in alphabetical order.");
File file = new File(FileChooser.pickADirectory());
if(file.listFiles() =... | 9 |
public static StdImage getImage(JComponent component) {
StdImage offscreen = null;
synchronized (component.getTreeLock()) {
Graphics2D gc = null;
try {
Rectangle bounds = component.getVisibleRect();
offscreen = StdImage.createTransparent(component.getGraphicsConfiguration(), bounds.width, bounds.heigh... | 2 |
private void jBListarIncidentesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBListarIncidentesActionPerformed
// TODO add your handling code here:
int tipo = combo_tipo_reporte.getSelectedIndex();
if (tipo != 0) {
TipoInscidente codigotipo = controlador.buscar... | 6 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(myHost instanceof MOB))
return super.okMessage(myHost,msg);
final MOB myChar=(MOB)myHost;
if((msg.tool()==null)||(!(msg.tool() instanceof Ability)))
return super.okMessage(myChar,msg);
if(msg.amISource(myChar)
&&(... | 9 |
@Override
public String intercept(ActionInvocation invocation) throws Exception {
Map<String, Object> session = invocation.getInvocationContext()
.getSession();
// 获取action
String actionNameString = invocation.getInvocationContext().getName();
// System.out.println(actionNameString);
// 获取用户等级
String l... | 8 |
public ShipChassis getShipChassis(String id) {
ShipChassis result = shipChassisMap.get(id);
if ( result == null ) { // Wasn't cached; try parsing it.
InputStream in = null;
try {
in = getDataInputStream("data/"+ id +".xml");
result = dataParser.readChassis(in);
shipChassisMap.put( id, result );
... | 6 |
public static void Eliminar(Object o) {
Transaction t = cx.beginTransaction();
try {
cx.delete(o);
t.commit();
cx.flush();
} catch (Exception e) {
System.out.println("no se inserto");
t.rollback();
}
} | 1 |
public void iterativePostOrder(TreeNode root) {
if (root == null) {
return;
}
Stack<TreeNode> stack = new Stack<TreeNode>();
TreeNode currentNode = root;
while (currentNode != null) {
if (currentNode.getLeft() != null) {
stack.push(currentNode);
currentNode = currentNode.getLeft();
} else ... | 8 |
public boolean checkShapeDate(long fechaDesde, long fechaHasta){
return (fechaAlta >= fechaDesde && fechaAlta < fechaHasta && fechaBaja >= fechaHasta);
} | 2 |
public void removeCompleteListener(ActionListener listener){
completeListeners.remove(listener);
} | 0 |
private static int createOldStyleIcon(StdImage image, List<byte[]> imageData, List<Integer> imageType, int type) {
int size = image.getWidth();
byte[] bytes = new byte[size * size * 4];
int i = 0;
for (int y = 0; y < size; y++) {
for (int x = 0; x < size; x++) {
EndianUtils.writeBEInt(image.getRGB(x, y),... | 2 |
@Override
public V put( K key, V value ) {
Node node = mRoot;
Node newNode = new Node( key, value );
if( node == null ) {
insertNode( newNode, node, false );
return null;
}
while( true ) {
if( mComp.compareMaxes( key, node.mMaxStop.mKey )... | 7 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("POST = ");
FacDAO usuarioDAO = (FacDAO) getServletContext().getAttribute("smsManager");
String login = request.getParameter("login");
// ... | 3 |
public void update(GameContainer container) {
timeout--;
if(timeout == 0 && current == images.size() - 1) {
Board.menuStack.pop();
Board.menuStack.add(new StartMenu());
} else if(timeout == 0) {
timeout = 150;
current++;
} else if((Mouse.isButtonDown(0) || Keyboard.isKeyDown(Keyboard.KEY_SPACE)) ... | 6 |
public void setPixel(int x, int y, short red, short green, short blue) {
// Your solution here.
assert (x < height && y < width);
assert (0 <= red && red <= 255);
assert (0 <= blue && blue <= 255);
assert (0 <= green && green <= 255);
pixel[y][x].red = red;
pixel[y][x].blue = blue;
pixel[y][x].green = ... | 4 |
public static void materializePrimitiveDescriptionBody(NamedDescription description) {
{ boolean nativeP = description.nativeRelation() != null;
Symbol name = (nativeP ? Symbol.internSymbolInModule(description.nativeRelation().name(), description.nativeRelation().homeModule(), true) : description.descriptionN... | 7 |
public static ArrayList<Electrodomestico> getAllElectrodomestico(int montoMin,int montoMax,char consumo)
{
ArrayList<Electrodomestico> colElectrodomestico=new ArrayList<Electrodomestico>();
String sqlFiltros="";
if(montoMin>0)
sqlFiltros=sqlFiltros.concat(" and preciobase>"+montoMin+" ");
if(montoMax>0)
... | 7 |
void menuSave() {
if (image == null) return;
animate = false; // stop any animation in progress
// If the image file type is unknown, we can't 'Save',
// so we have to use 'Save As...'.
if (imageData.type == SWT.IMAGE_UNDEFINED || fileName == null) {
menuSaveAs();
return;
}
Cursor waitCursor = dis... | 7 |
public void validate() throws XPathException {
checkSortComesFirst(false);
select = typeCheck("select", select);
ExpressionLocation locator = new ExpressionLocation(this);
ExpressionVisitor visitor = makeExpressionVisitor();
if (groupBy != null) {
groupBy = typeCheck... | 9 |
public static String getPassword() {
return password;
} | 0 |
public ListenerManager(LogOre plugin) {
this.plugin = plugin;
this.listeners.put("block", new BlockListener(this.plugin));
for (Listener l : this.listeners.values()) {
this.plugin.getServer().getPluginManager().registerEvents(l, this.plugin);
}
... | 1 |
public void setSlot(int slot, ItemStack item) {
if (item != null && item.getType() == Material.AIR) {
item = null;
}
if (slot < 0 || slot >= this.items.length) {
return;
}
this.items[slot] = item;
} | 4 |
public int compareTo(Object o) {
if (o.getClass() == MmsParameter.class) {
return name.compareTo(((MmsParameter)o).getName());
}
return name.compareTo((String)o);
} | 1 |
public boolean canDraw() {
ArrayList<int[]> moves = board.getMoves();
if (moves.size() >= 5) {
int[] currentMove = moves.get(moves.size()-1);
int[] prevMove = moves.get(moves.size()-5);
if (
currentMove[0] == prevMove[0] &&
currentMove[1] == prevMove[1] &&
currentMove[2] == prevMove[2]
) {
... | 5 |
/* */ public Object getMetaPacket(Object watcher)
/* */ {
/* 108 */ Class<?> DataWatcher = Util.getCraftClass("DataWatcher");
/* */
/* 110 */ Class<?> PacketPlayOutEntityMetadata = Util.getCraftClass("PacketPlayOutEntityMetadata");
/* */
/* 112 */ Object packet = null;
/* */ tr... | 8 |
public void setManager(Manager manager) {
if (manager != this.manager) {
Manager vorigeManager = this.manager;
this.manager = manager;
if (vorigeManager != null && vorigeManager.getCampus() == this) {
vorigeManager.setCampus(null);
}
if (manager != null && manager.getCampus() != this) {
this.ma... | 5 |
public static int[] quickSort(int[] candidates, int start, int end) {
if(start >= end) {
return candidates;
}
int i = start;
int j =end;
int mid = candidates[start];
while(i < j) {
while(j>=start &&candidates[j] > mid) {
j--;
}
if(i>=j) {
break;
... | 8 |
public static void main(String[] args) {
//generateData();
//Feat.Save();
Feat.Load();
if(Feat.getFeats().isEmpty()) {
generateData();
}
Collection<Feat> feats = Feat.getFeats().values();
try {
Class.forName("com.mysql.jdbc.Driver"... | 3 |
@EventHandler
public void ZombieSlow(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("Zombie.Slow.Dodge... | 6 |
public BufferedImage getImage() {
try {
BufferedImage bi = (BufferedImage) imageObj.getCache();
if (bi == null) {
byte[] data = null;
ByteBuffer jpegBytes = null;
final boolean jpegDecode = PDFDecoder.isLastFilter(imageObj, PDFDecoder.DCT_... | 3 |
public Car(int bornTime, int dest){
if (bornTime >= 0 && (dest == 1 || dest == 2)) {
this.bornTime = bornTime;
this.dest = dest;
}
else throw new IllegalArgumentException("bornTime >= 0 and dest [1,2]");
} | 3 |
public void addRoom(Scanner sc) {
long roomID, typeID;
System.out.println("Add a room");
System.out.println("DO you want to add a new type of room or existing type room?");
System.out.println("Enter n/N for new Type and e/E for existing type");
System.out.print("Enter choice: ")... | 2 |
@Override
public boolean accept(File pathname) {
if (pathname.isDirectory()) {
return true;
}
String nombrearchivo = pathname.getName().toLowerCase();
if (nombrearchivo.endsWith(extencion)) {
return true;
}
r... | 2 |
@Override
public int compare(Drillable one, Drillable two) {
if (one.getLastEdited() == null && two.getLastEdited() == null) {
return 0;
}
if (one.getLastEdited() == null) {
return -1;
}
if (two.getLastEdited() == null) {
return 1;
}
return one.getLastEdited().compareTo(two.getLastEdited());
} | 4 |
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Version other = (Version) obj;
if (this == ALL || other == ALL) {
return true;
}
if (major != other.major) {... | 9 |
@Override
public void execute() {
System.out.println("Production Dialog is off..... Turning on");
Constants.PRODUCTION_WIDGET.interact("Toggle Production Dialog");
final Timer timeout = new Timer(2000);
while(timeout.isRunning() && Settings.get(1173)==1879048192) {
Task.sleep(50);
}
} | 2 |
private String logginUser() {
try {
parameterPart = stringParts[1];
udpPort = Integer.parseInt(stringParts[2]);
} catch (ArrayIndexOutOfBoundsException e) {
return answer = "Error: Please enter the log in command like this: !login <Username>";
} catch (NumberFormatException e) {
return answer = "Error... | 7 |
public boolean wait_event (long timeout_) {
int rc = 0;
try {
if (timeout_ == 0) {
// wait_event(0) is called every read/send of SocketBase
// instant readiness is not strictly required
// On the other hand, we ca... | 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.