text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setLastName(String lastName) {
this.lastName = lastName;
} | 0 |
public void doDamage(Enemy e) {
//isSplitting added for debug purposes
if (Math.random()<0.1 || isSplitting()) {
setSplit(false);
Enemy newEnemy;
try {
newEnemy = e.getClass().newInstance();
newEnemy.setActionListener(listener);
e.getRoad().enter(newEnemy);
newEnemy.setHP(e.getHP()/2);
}... | 4 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (cmd.getName().equalsIgnoreCase("ar") || cmd.getName().equalsIgnoreCase("antirelog") || cmd.getName().equalsIgnoreCase("ar... | 8 |
public String getRosterNames() {
if ((trip == null) || (trip.getRosterCount() == 0)) {
return "<?>";
}
String r ="";
for (int i = 0; i < trip.getRosterCount(); i++) {
if (i > 0)
r = r + ", ";
r = r + trip.getRosterName(i);
}
return r;
} | 4 |
public void selectPosition(int position, char playerToken)
{
// Select the position
switch (position){
case 1: this.setPosition(0,0, playerToken);
break;
case 2: this.setPosition(0,1, playerToken);
break;
case 3: this.setPosition(0,2, playerToken);
break;
... | 9 |
@Override
public Object getValue()
{
Name n = getName();
try
{
Ptg[] p = n.getCellRangePtgs();
if( p.length == 0 )
{
return new String( "#NAME?" );
}
if( (p.length == 1) || !(parent_rec instanceof Array) )
{ // usual case
return p[0].getValue();
} // multiple values; create an ar... | 5 |
public void archiveResponse(Data data) {
synchronized (this) {
// aus den Daten das byte-Array anfordern. In dem Array sind die Informationen,
// ob die Infoanfrage geklappt hat, gespeichert
byte[] requestInfoResponse = data.getUnscaledArray("daten").getByteArray();
InputStream in = new ByteArrayInputStr... | 8 |
@Override
public void setPathShape( PathShape shape ) {
if( shape == null ) {
throw new IllegalArgumentException( "shape must not be null" );
}
this.path = shape;
} | 1 |
public void start()
{
init();
RenderUtil.initGraphics();
window.setIcon();
if(isRunning)
return;
run();
} | 1 |
public static void main(final String[] args) {
/* Just go up to a million for testing sake */
int max = 1000000;
int exponentMax = 100;
List<Integer> list = new ArrayList<Integer>();
List<Integer> otherList = new ArrayList<Integer>();
for (int i = 3; i < max; i += 2) {
otherList.add(i);
System.out.p... | 7 |
public void update() {
if (health <= 0) {
dead = true;
if (Player.target == this)
Player.target = null;
deathTimer();
return;
}
if (!frozen) {
anim++;
if (anim % 100 == 0) {
move = random.nextInt(5); // Comment to freeze movement
anim = random.nextInt(50); // Comment to freeze movem... | 8 |
public static void runResultView(){
frames.runResultView();
frames.getResultView().setVisible(true);
} | 0 |
public void remover(InstituicaoCooperadora instituicaocooperadora) throws Exception
{
String sql = "DELETE FROM instituicaocooperadora WHERE id = ?";
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setLong(1, instituicaocooperadora.getId());
stmt.executeU... | 1 |
@Override
public boolean equals(Object object){
if(this.x == ((DCoord)object).x && this.y == ((DCoord)object).y)
return true;
else
return false;
} | 2 |
public int getPlayCount(int player_id) {
PreparedStatement pst = null;
ResultSet rs = null;
try {
pst = conn.prepareStatement("SELECT times_played FROM ffa_leaderboards WHERE player_id=?");
pst.setInt(1, player_id);
rs = pst.executeQuery();
while (rs.next()) {
return rs.getInt("times_played");
... | 6 |
@Override
protected void onPrivateMessage(String sender, String login, String hostname, String message) {
if (!message.startsWith("USERCOLOR") && !message.startsWith("EMOTESET") && !message.startsWith("SPECIALUSER") && !message.startsWith("HISTORYEND") && !message.startsWith("CLEARCHAT") && !message.startsW... | 8 |
public int max(int hori, int verti, int dia) {
if (hori >= verti && hori >= dia && hori >= 0) {
return hori;
} else if (verti >= hori && verti >= dia && verti >= 0) {
return verti;
} else if (dia >= hori && dia >= verti && dia >= 0) {
return dia;
} els... | 9 |
Fraction findFrction(double x) {
boolean negative = false;
if (x < 0) {
negative = true;
x = -x;
}
double max = 1d;
double tmp = x;
while ((long) tmp != tmp) { // still has decimal part
max *= 10;
tmp = x * max;
}
// denominator minimization via iterative division algorithm
long i = (long)... | 6 |
private void checkRandom(){
int min=100,max=0,total=0;
for(int i = 0; i <10000; ++i){
int x = (int) (Math.random()*100);
if(min>x) min = x;
if(max<x) max = x;
total+=x;
}
System.out.println("Min: "+ min +"Mean: " + (total/10000) +" Max: "+ max + " Total: " + total);
} | 3 |
public void readFromXMLPartialByClass(XMLStreamReader in,
Class<?> theClass)
throws XMLStreamException {
int n = in.getAttributeCount();
setId(in.getAttributeValue(null, ID_ATTRIBUTE));
for (int i = 0; i < n; i++) {
String name =... | 6 |
public void Solve() {
ArrayList<Long> pentagonals = new ArrayList<Long>();
for (int n = 1; n < _max; n++) {
long pentagonal = n * (3 * n - 1) / 2;
if (pentagonal < 0) {
throw new RuntimeException("Overflow for n=" + n);
}
pentagonals.add(p... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PlayerDescription other = (PlayerDescription) obj;
if (id != other.id)
return false;
if (name == null) {
if (other.name != null)
retu... | 7 |
public void sort(double[] pq) {
int N = pq.length;
// Create heap structure
for (int k = N/2; k >= 1; k--) {
sink(pq, k, N);
}
// Move largest item to end of unsorted section of the array
while (N > 1) {
Helper.exch(pq, 1-1, --N);... | 2 |
int insertKeyRehash(int val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look un... | 9 |
private void genererTerrain() {
// génération de la grille d'effets (flammes)
for (int hauteur = 1; hauteur < grilleJeu.length - 1; hauteur++) {
for (int largeur = 1; largeur < grilleJeu[0].length - 1; largeur++) {
effets[hauteur][largeur] = 0;
}
}
// generation du millieu du plateau
for (int ha... | 9 |
public double getCost() {
return this.cost;
} | 0 |
public int translateEscapeSequence(int[] buffer) {
try {
if (buffer[0] == LSB) {
switch (buffer[1]) {
case A:
return TerminalIO.UP;
case B:
return TerminalIO.DOWN;
case C:
... | 6 |
public static void multiRun() {
System.out.println("alpha: "+alpha);
int[] numLocs = {10000};//{1000,2000,5000,10000};
double[] detect = {0.01};//{0.005,0.01,0.02,0.05};
long[] duration = {EpiSimUtil.dayToSeconds(100)};//{EpiSimUtil.dayToSeconds(3),EpiSimUtil.dayToSeconds(7),EpiSimUtil.dayToSeconds(10),EpiSimUt... | 7 |
private double[][] createEmptyValueGrid(GeoParams geoParams, Operator operator) {
double delta_y = Math.abs(geoParams.geoBoundNW.latitude - geoParams.geoBoundSE.latitude);
double delta_x;
if (geoParams.geoBoundNW.longitude > geoParams.geoBoundSE.longitude) {
//We've wrapped around from 180 to -180,
delta_x ... | 5 |
private double getAxisVal(int loc) {
switch(loc){
case 0:
case 7:
return -1;
case 1:
case 6:
return -.5;
case 2:
case 5:
return .5;
case 3:
case 4:
return 2;
default:
return 0;
}
} | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final VtDataAck other = (VtDataAck) obj;
if (acceptedOctetCount == null) {
... | 9 |
public void updateScores(int result) {
if (result == 0) {
scores.incrementTie();
}
if (result == -1) {
scores.incrementLoss();
}
if (result == 1) {
scores.incrementWin();
}
} | 3 |
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
super.loadFields(__in, __typeMapper);
__in.peekTag();
if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) {
... | 9 |
public final void silence_statement_list(SS_scriptset scriptset) throws RecognitionException {
try {
// SayScript.g:513:48: ( ( silence_statement[scriptset] )+ )
// SayScript.g:513:50: ( silence_statement[scriptset] )+
{
// SayScript.g:513:50: ( silence_statement[scriptset] )+
int cnt42=0;
loop42:
... | 7 |
public static Set<Month> getMonthBySeason(Season season) {
Set<Month> months = new HashSet<Month>();
switch (season) {
case SUMMER: {
months.add(Month.JUN);
months.add(Month.JUL);
months.add(Month.AUG);
break;
}
case AUTUMN: {
months.add(Month.SEPT);
months.add(Month.OCT);
months.add(Mont... | 4 |
public void guardarArchivoOrigen()
{
byte c[];
try
{
clsEnKardex[] arreglo1;
arreglo1=lista.toArray(arreglo);
FileOutputStream file=new FileOutputStream("kardex.txt");
String n="~";
c=n.getBytes();
file.write(c);
... | 3 |
@Override
public void addPatient(Patient patient)throws Exception {
// Get JDBC Connection
Connection conn= JDBCManager.getConnection();
PreparedStatement stmt=null;
String sql="INSERT INTO Patient "+
"(HealthRecordNumber,FirstName,LastName,Gender,Age) VALUES "+
"(?,?,?,?,?)";
try {
... | 3 |
public void getTwitterTimeline() {
try {
Twitter twitter = new TwitterFactory().getInstance();
try {
RequestToken requestToken = twitter.getOAuthRequestToken();
System.out.println("Got request token.");
System.out.println("Request token: " + requestToken.getToken());
System.... | 9 |
final public BigDecimal Primary() throws ParseException {
Token t ;
BigDecimal d ;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NUMBER:
t = jj_consume_token(NUMBER);
{if (true) return new BigDecimal( t.image ) ;}
break;
case OPEN_PAR:
jj_consume_token(OPEN_PAR);
d = Expres... | 7 |
public void visitCheckExpr(final CheckExpr expr) {
if (expr instanceof ZeroCheckExpr) {
visitZeroCheckExpr((ZeroCheckExpr) expr);
} else if (expr instanceof RCExpr) {
visitRCExpr((RCExpr) expr);
} else if (expr instanceof UCExpr) {
visitUCExpr((UCExpr) expr);
}
} | 3 |
public static ArrayList<File> GetAllFiles(String src, String ext, boolean recurse) {
ArrayList<File> ret_files = new ArrayList<File>();
File[] files = new File(src).listFiles();
for (File f : files) {
if (f.isDirectory()) {
if (recurse)
ret_files.addAll(GetAllFiles(f.getPath(), ext, recurse));
... | 5 |
public void generateParenthesisDFS(int left, int right, String s) {
if(right < left) return;
if(left == 0 && right == 0){
res.add(s);
}
if(left > 0){
generateParenthesisDFS(left - 1, right, s + "(");
}
if(right > 0){
generateParenthesis... | 5 |
public void damage(int amt)
{
if(state == STATE_IDLE)
state = STATE_CHASE;
health -= amt;
if(health > 0)
AudioUtil.playAudio(hitNoise, transform.getPosition().sub(Transform.getCamera().getPos()).length());
} | 2 |
public static void main(String... args)
{
Scanner s = new Scanner("Hello my love");
String token;
do {
token = s.findInLine("");
System.out.print(token + " ");
} while (token != null);
} | 1 |
public Hand(Deck d) {
ArrayList<Card> Import = new ArrayList<Card>();
for (int x = 0; x < 5; x++) {
Import.add(d.drawFromDeck());
}
CardsInHand = Import;
} | 1 |
public static String[] getTokensUsingDelim( String instr, String token )
{
if( instr.indexOf( token ) < 0 )
{
String[] ret = new String[1];
ret[0] = instr;
return ret;
}
CompatibleVector output = new CompatibleVector();
new StringBuffer();
int lastpos = 0;
int offset = 0;
int toklen = token.le... | 5 |
private void drawNumbers(Graphics2D g2d) {
for (int i=0; i<width; i++) {
for (int j=0; j<height; j++) {
if (numbers[i][j] >= 0) {
if (black [i][j] == null || !black[i][j]) {
g2d.setColor(Color.black);
} else {
g2d.setColor(Color.white);
}
g2d.drawString("" + numbers[i][j], i*SIZ... | 5 |
public String findAlgorithm(Cube cube, TileColor c1, TileColor c2) {
int rotation = 4 - (c1.getInt() < 3 ? c1.getInt() - 1 : c1.getInt() - 2);
String top = "";
for (int k = 0; k < 4; k++) {
for (int i = 1; i < F2L.length; i++) {
String alg = F2L[i];
Cube cubeClone = cube.clone();
for (int j = 0; j ... | 5 |
public void setDataRegistrazione(Date dataRegistrazione) {
this.dataRegistrazione = dataRegistrazione;
} | 0 |
public static void main(String[] args) {
// args[0] = -d is for debug, -r is for running
if (args.length == 0 || args[0].equals("-r")) {
runState = runStates.RUN;
} else if (args[0].equals("-d")) {
runState = runStates.DEBUG;
}
switch (runState) {
case DEBUG:
log("Running in DEBUG mode.");
gen ... | 6 |
public void run()
{
if(this.sampleSize==-1)
{
this.TGA();
}
else {
String arr[] = this.outputFilename.split("\\.(?=[^\\.]+$)");
double n = this.sampleSize;
double sum = 0;
double sum2 = 0;
d... | 6 |
public static void setCellStyleFlags(mxIGraphModel model, Object[] cells,
String key, int flag, Boolean value)
{
if (cells != null && cells.length > 0)
{
model.beginUpdate();
try
{
for (int i = 0; i < cells.length; i++)
{
if (cells[i] != null)
{
String style = setStyleFlag(model... | 4 |
public static int posteX(int travee,int orientation){
int centreX = centrePositionX(travee) ;
switch(orientation){
case Orientation.NORD :
centreX -= 25 ;
break ;
case Orientation.EST :
break ;
case Orientation.SUD :
centreX -= 25 ;
break ;
case Orientation.OUEST :
centreX -= 20 ... | 4 |
public int getWidth() {
return width;
} | 0 |
public void playGame(Agent player1, Agent player2)
{
GameAction p1move, p2move;
GameAction[] history = new GameAction[roundsPerGame*2];
player1.matchScore = 0;
player2.matchScore = 0;
for(int i = 0; i < roundsPerGame; i++)
{
p1move = player1.getNextMove(i, history, false);
p2move = player2.getNextM... | 9 |
public static Complex log(final Complex value) {
if (value == null)
throw new NullPointerException("The value is not properly specified.");
if (isNaN(value) || isInfinite(value))
return Complex.NaN;
if (isOrigin(value))
return Complex.Infinity;
double ... | 5 |
private boolean validateValues(String column, String value)
throws MobbedException {
String type = typeMap.get(column.toLowerCase());
try {
if (type.equalsIgnoreCase("uuid"))
UUID.fromString(value);
else if (type.equalsIgnoreCase("integer"))
Integer.parseInt(value);
else if (type.equalsIgnoreCas... | 5 |
public static void main(String[] args) {
Tank t1 = new Tank();
Tank t2 = new Tank();
t1.level = 9;
t2.level = 47;
System.out.println("1: t1.level: " + t1.level + ", t2.level: " + t2.level);
t1 = t2;
System.out.println("2: t1.level: " + t1.level + ", t2.level: " + t2.level);
t1.level = 27;
System.out.p... | 0 |
@Override
public List<Map<String, ?>> Listar_hist_fecha(String FE_MODIF, String idtra) {
List<Map<String, ?>> lista = new ArrayList<Map<String, ?>>();
try {
this.cnn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
String sql = "SELECT * FROM RHVD_MOD_TRABAJADOR \n"
... | 9 |
private void chooseBrainActionPerformed(java.awt.event.ActionEvent evt) throws Exception {
AntBrain b = new AntBrain(chooseBrain.getSelectedFile().getName());
brains.add(b);
numBrainsLabel.setText("Number of Brains(2 Minimum): " + brains.size());
} | 0 |
private int laskeMiinat(int x, int y){
int miinoja = 0;
int yla = y - 1;
int ala = y + 1;
int vasen = x - 1;
int oikea = x + 1;
if (onKartallaJaMiina(vasen, yla)) {
miinoja++;
}
if (onKartallaJaMiina(x, yla)) {
miinoja++;
... | 8 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto, asLevel))
return false;
if((auto)&&(givenTarget!=null)... | 8 |
static final void method1230(int i) {
anInt1517++;
FileOnDisk fileondisk = null;
try {
Class241 class241 = Class240.aSignLink2946.method3631(true, "2", (byte) 126);
while (class241.anInt2953 == 0)
Class262_Sub22.method3208(1L, false);
if ((class241.anInt2953 ^ 0xffffffff) == -2) {
fileondisk = (F... | 9 |
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
Person person = listPerson.get(rowIndex);
switch (columnIndex) {
case 0:
person.setId(Integer.parseInt((String) aValue));
break;
case 1:
person.setFirstName((String) aValue);
break;
case 2:
person.setLastN... | 8 |
public void show(){
game.getContentPane().removeAll();
menuWrapper.removeAll();
menuPanel.removeAll();
this.prepareSpecificMenu();
this.menuWrapper.add(this.menuPanel);
game.add(this.menuWrapper, BorderLayout.CENTER);
game.setVisible(true);
} | 0 |
public void update(){
up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W];
down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S];
left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A];
right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D];
sprint = keys[KeyEvent.VK_SHIFT];
for(int i=0; i< keys.length; i++... | 6 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((((ClanItem)this).clanID().length()>0)
&&(CMLib.flags().isGettable(this))
&&(msg.target()==this)
&&(owner() instanceof Room))
{
final Clan C=CMLib.clans().getClan(clanID());
if((C!=null)&&(C.getDonation().length()>0))... | 7 |
public boolean almostEquals(Object obj){
if (this == obj)
return true;
if (getClass() != obj.getClass())
return false;
Fraction other = (Fraction) obj;
if (bottom == null) {
if (other.bottom != null)
return false;
} else if (!bottom.equals(other.bottom))
return false;
if (top == null) {
i... | 8 |
public final KeyStroke getAccelerator() {
Object value = getValue(ACCELERATOR_KEY);
return value instanceof KeyStroke ? (KeyStroke) value : null;
} | 1 |
public static int scoreForCards( ArrayList<Card> cards )
{
int totalScore = 0;
for ( Card aCard : cards )
{
switch ( aCard.value() )
{
case 1:
totalScore += 11;
break;
case 3:
... | 6 |
public void pysaytaLiike() {
this.xSuunta = 0;
} | 0 |
public String getCurrentLoanIndex() {
Statement stmt = null;
int max = 0;
try {
stmt = con.createStatement();
ResultSet results = stmt.executeQuery("Select * from Loan");
while (results.next()) {
String strnum = results.getString("ID");
int intnum = Integer.parseInt(strnum);
if (intnum > m... | 5 |
private int getClosestMatch(){
int lowestMatchFactorIndex = 0;
double lowestMatchFactor = 99999999;
for (int i = 0; i < this.log.size(); i++){
if (getMatchFactor(i) < lowestMatchFactor)
lowestMatchFactorIndex = i;
}
return lowestMatchFactorIndex;
} | 2 |
private void init(char[][] array) {
int size = GameConfiguration.gameConfiguration_SIZE;
this.label = new JLabel[size][size];
this.grid.setLayout(new GridLayout(size,size));
this.infos.setLayout(new GridLayout(1,1));
BorderLayout layout = new BorderLayout();
this.setLayout(layout);
for (int i=0; i<size; i... | 3 |
void move() {
switch(dir) {
case U:
y -= Y_SPEED;
break;
case D:
y += Y_SPEED;
break;
case L:
x -= X_SPEED;
break;
case R:
x += Y_SPEED;
break;
case LU:
x -= X_SPEED;
y -= Y_SPEED;
break;
case RU:
x += X_SPEED;
y -= Y_SPEED;
break;
case LD:
x -= X_SPEED;
y... | 8 |
public static void processFlower(Client c) {
final int[] coords = new int[2];
coords[0] = c.absX;
coords[1] = c.absY;
Server.objectHandler.createAnObject(c, -1, coords[0], coords[1]);
Server.objectHandler.createAnObject(c, c.randomFlower(), coords[0], coords[1]);
c.canWalk = true;
if (Region.getClippin... | 6 |
@Override
public void piirra(Graphics graphics) {
graphics.setColor(vari);
for (KentallaOlija osa : osat){
osa.piirra(graphics);
}
if (suojakilpi){
int halkaisija = (int)getSuojakilvenHalkaisija();
graphics.drawOval((int)(this.get... | 2 |
public void updateFK(String table, String nameColumn, int valueColumn,
String nameID, int valueID) {
try {
con = DriverManager.getConnection(url, user, password);
String stm = null;
stm = "UPDATE " + table + " SET " + nameColumn + " = '" + valueColumn + "' WHERE "
+ nameID + " = " + valueID;
ps... | 4 |
public static InputSource getFromHTTPS(String adresse){
//String result = "";
URL url = null;
System.out.println("downloading...");
try{
disableCertificateValidation();
url = new URL(adresse.replace(" ", "%20"));
HttpsURLConnection client = (HttpsURLConnection) url.openConnection();
client.... | 1 |
protected void onRemoveNoExternalMessages(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} | 0 |
static int[] merge(int[] a, int[] b) {
if (a == null)
throw new NullPointerException("a is null");
if (b == null)
throw new NullPointerException("b is null");
int[] result = new int[a.length + b.length];
// Precondition
assert result.length == a.length + b.length : "length mismatch";
for (int i = 0; i... | 4 |
public void getMovesFromWord ( Word word, int x, int y, Vector<Move> moves,
boolean isUpDownCheck ) {
for ( int i = 0 ; i < word.length ( ) ; i++ ) {
final int xNew = x - ( isUpDownCheck ? 0 : i ) ;
final int yNew = y - ( isUpDownCheck ? i : 0 ) ;
if ( xNew >= 0 && yNew >= 0 && xNew < Player... | 7 |
private void compute_pcm_samples0(Obuffer buffer)
{
final float[] vp = actual_v;
//int inc = v_inc;
final float[] tmpOut = _tmpOut;
int dvp =0;
// fat chance of having this loop unroll
for( int i=0; i<32; i++)
{
float pcm_sample;
final float[] dp = d16[i];
pcm_sample = (float)(((vp[0 + dvp] * d... | 1 |
public boolean inside(Bullet b){
if(b.getX()>x && b.getX()<x+WIDTH && b.getY()>y && b.getY()<y+HEIGHT ){
return true;
}
return false;
} | 4 |
private void method130(int arg0, int id, int rotation, int arg3, int y, int objectType, int plane, int x, int arg8) {
SceneObject object = null;
for (SceneObject sceneObject = (SceneObject) aClass19_1179.getFront(); sceneObject != null; sceneObject = (SceneObject) aClass19_1179.getNext()) {
... | 6 |
public static void main(String[] args) {
InetAddress addr = null;
try {
addr = InetAddress.getByName(DEFAULT_HOST);
} catch (UnknownHostException e) {
e.printStackTrace();
}
int port = DEFAULT_PORT;
if (args.length > 0) {
try {
... | 9 |
private static File syncAssets(File assetDir, String indexName) throws JsonSyntaxException, JsonIOException, IOException
{
Logger.logInfo("Syncing Assets:");
File objects = new File(assetDir, "objects");
AssetIndex index = JsonFactory.loadAssetIndex(new File(assetDir, "indexes/{INDEX}.json".replace("{IN... | 6 |
public boolean check_for_zombies() {
check();
boolean change=false;
Iterator<Entry<String, FileState>> it = m.entrySet().iterator();
while (it.hasNext()) {
Entry<String,FileState> pair = it.next();
FileState fs=pair.getValue();
String repo_filename=pair.getKey();
File f... | 9 |
public int getAge()
{
return age;
} | 0 |
protected byte[] computeSHAdigest(final byte[] value) {
try {
return MessageDigest.getInstance("SHA").digest(value);
} catch (Exception e) {
throw new UnsupportedOperationException(e.toString());
}
} | 1 |
public boolean attack(Spinner self, Spinner target) {
if (!newSp.contains(target) || !newSp.contains(self)) {
return false; //crappy way of handling concurrency issues
}
float targetEnergy = target.getEnergy();
float selfEnergy = self.getEnergy();
... | 3 |
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 setHTML(URL url) {
// Lazy Instantiation
if (!isInitialized()) {
initialize();
}
try {
this.viewer.setPage(url);
} catch (IOException e) {
System.out.println("IOException: " + e.getMessage());
}
} | 2 |
public AntAttack() {
} | 0 |
private Version mapFrameworkPackageVersion(Version pv) {
if (pv.getMajor() != 1)
return null;
Version version;
switch (pv.getMinor()) {
case 7:
version = new Version(5, 0, 0);
break;
case 6:
version = new Version(4, 3, 0);
break;
case 5:
version = new Version(4, 2, 0);
break;
case 4:... | 9 |
public boolean onCommand(Player player, String[] args) {
File fichier_language = new File(OneInTheChamber.instance.getDataFolder() + File.separator + "Language.yml");
FileConfiguration Language = YamlConfiguration.loadConfiguration(fichier_language);
if(player.hasPermission(getPermission())){
if(args.length ... | 6 |
public String getPrettyErrors() {
String errors = null;
if (hasErrors()) {
for (String errorMsg : getErrors()) {
errors = errors + errorMsg;
}
} else {
errors = "Unknown";
}
return errors;
} | 2 |
private EntryElement getEntryElement(final ZipOutputStream zos) {
if (outRepresentation == SINGLE_XML) {
return new SingleDocElement(zos);
}
return new ZipEntryElement(zos);
} | 1 |
private static void paintTextEffect(Graphics2D g, String s, Color c,
int size, double tx, double ty, boolean isShadow) {
prepareGraphics(g);
final float opacity = 0.8f; // Effect "darkness".
final Composite oldComposite = g.getComposite();
final Color oldColor = g.getColor(... | 7 |
public static void countSort (int[] array, int k) {
int[] count = new int[k];
int size = array.length;
for (int i = 0; i < size; i++) {
count[array[i]]++;
}
for (int i = k - 1; i >= 0; i--) {
while (count[i]-- > 0) {
array[--size] = i;
}
}
} | 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.