text stringlengths 14 410k | label int32 0 9 |
|---|---|
protected void readImage() {
ix = readShort(); // (sub)image position & size
iy = readShort();
iw = readShort();
ih = readShort();
int packed = read();
lctFlag = (packed & 0x80) != 0; // 1 - local color table flag
interlace = (packed & 0x40) != 0; // 2 - inte... | 7 |
private static int method503(char ac[], char ac1[], int j) {
if (j == 0)
return 2;
for (int k = j - 1; k >= 0; k--) {
if (!method517(ac[k]))
break;
if (ac[k] == '@')
return 3;
}
int l = 0;
for (int i1 = j - 1; i1 >= 0; i1--) {
if (!method517(ac1[i1]))
break;
if (ac1[i1] == '*')
... | 9 |
public void draw() {
GL11.glPushMatrix();
GL11.glTranslatef((float)(container.getX() - Theater.get().getScreen().camera.getX()), (float)(container.getY() - Theater.get().getScreen().camera.getY()), 0);
GL11.glColor3f(0.75f, 0.5f, 1.0f);
GL11.glLineWidth(1.0f);
GL11.glBegin(GL11.GL_LINE_LOOP);
{
GL11.g... | 2 |
public static void main(String [] args) {
long limit = ((long)1e8)-1L;
long palindromicSum = 0;
for (int i=1; i<=Math.sqrt(limit); i++) {
long sqSum = 0;
for (int j=i; sqSum < limit; j++) {
sqSum += j*j;
if (i != j) { // don't want a single square like 3*3 = 9 (per hint that 11 palindromics below 1... | 5 |
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof DHCPPacket)) {
return false;
}
DHCPPacket p = (DHCPPacket) o;
boolean b;
b = (this.comment.equals(p.comment));
b &= (this.op ... | 2 |
public void delete(Integer id){
Vector<String> usr = fileToVector();
FileWriter usersFile = null;
PrintWriter pw = null;
String key = id.toString();
try{
usersFile = new FileWriter("users.txt");
pw = new PrintWriter(usersFile);
int i=0;
while(i<usr.size()){
if(!usr.get(i).equals(key)){
pw... | 3 |
private void processRequest(Packet packet) throws IOException {
Packet out = null;
if(packet == null) {
out = Packet.getIncorrectCommandPacket();
} else {
String code = packet.getCode();
if(code.equals(Packet.PACKET_CODES.REGISTR... | 8 |
private void btnSubmit() {
Factory f = new Factory();
try {
String username = this.txtUsername.getText();
Authentication a = Factory.createAuthentication();
ArrayList<User> u = f.getUsers();
System.out.println(username);
//System.out.println(this.txtPassword.getPassword());
if(a.authenticateUs... | 9 |
protected static void createDescriptor()
{
try
{
InputStream descriptorStream = TTC13ParseControllerGenerated.class.getResourceAsStream(DESCRIPTOR);
InputStream table = TTC13ParseControllerGenerated.class.getResourceAsStream(TABLE);
boolean filesystem = false;
if(descriptorStream == ... | 9 |
public void showProfileToFile(FileWriter f) throws IOException, ProfileNotSetException {
if (this.getEmail() == "" || this.getPhone() == ""
|| this.getDescription() == "") {
f.write("User " + this.getName() + " does not have any info set.\n");
} else {
f.write("Us... | 3 |
@Override
public Value evaluate(Value... arguments) throws Exception {
// Check the number of argument
if (arguments.length == 1) {
// get Value
Value value = arguments[0];
// If numerical
if (value.getType().isNumeric()) {
return new Value(new Double(Math.cos(value.getDouble())));
}
if (val... | 4 |
public static String getCMDKey(final MetaData columnMD, final String line) {
if (!columnMD.isAnyRecordFormatSpecified()) {
// no <RECORD> elements were specified for this parse, just return the
// detail id
return FPConstants.DETAIL_ID;
}
final Iterator<Entry<... | 4 |
@Override
public void visit(Page page)
{
if (!(page.getParseData() instanceof HtmlParseData))
{
return;
}
HtmlParseData htmlParseData = (HtmlParseData)page.getParseData();
Document doc = Jsoup.parse(htmlParseData.getHtml());
Elements links = doc.select("a[href^=magnet]");
if (l... | 9 |
public boolean is_legal_bilevel()
{
final DjVuInfo info = getInfo();
if(info == null)
{
return false;
}
final int width = info.width;
final int height = info.height;
if((width <= 0) || (height <= 0))
{
return false;
}
final JB2Image fgJb2 = getFgJb2();
if(... | 8 |
@Override
public void probeEquivalence(final Node other, final Notification result) {
try {
final SyntaxNode syntax = (SyntaxNode) other;
if (!getAttribute(Attributes.TITLE).equals(syntax.getAttribute(Attributes.TITLE))) {
result.error("Titles of syntx differs: '%s' ... | 6 |
private ResultSet executeQueryRS(String sql, Object[] params) {
try {
con = this.getConnection();
ps = con.prepareStatement(sql);
for (int i = 0; i < params.length; i++) {
ps.setObject(i + 1, params[i]);
}
rs = ps.executeQuery();
... | 2 |
public final static String replaceAlls(String str, final String pairs[][])
{
if((str==null)
||(pairs==null)
||(str.length()==0)
||(pairs.length==0))
return str;
final StringBuilder newStr=new StringBuilder("");
boolean changed=false;
for(int i=0;i<str.length();i++)
{
changed=false;
for (final ... | 9 |
public final WaiprParser.stat_return stat() throws RecognitionException {
WaiprParser.stat_return retval = new WaiprParser.stat_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope globalstat54 =null;
ParserRuleReturnScope localstat55 =null;
try { dbg.enterRule(getGramma... | 7 |
private int partition(final int p, final int r) {
final int x = values[p];
int i = p - 1;
int j = r + 1;
while (true) {
do {
j--;
} while (values[j] > x);
do {
i++;
} while (values[i] < x);
if (i < j) {
final int v = values[i];
values[i] = values[j];
values[j] = v;
fin... | 4 |
private ETrainerType trainerTypeMenu(){
ETrainerType trainerType = ETrainerType.NONE;
do{
System.out.println("Select the energy type :");
System.out.println("1 - Item");
System.out.println("2 - Supporter");
System.out.println("3 - Stadium");
this.typedChoice = sc.nextLine();
switch(this.typ... | 4 |
private void unloadNatives(String nativePath) {
if (!natives_loaded)
return;
try
{
Field field = ClassLoader.class.getDeclaredField("loadedLibraryNames");
field.setAccessible(true);
@SuppressWarnings("rawtypes")
Vector libs = (Vector)field.get(getClass().getClass... | 4 |
static public void main(String[] argv) throws Exception
{
// if (argv.length != 2) {
// System.err.println("usage: java HTMLLinkExtractor [url] [file-to-process]");
// System.exit(1);
// }
// argv[0] should be in the form of proto://host.domain/dir/file
URL aUrl = new URL("http://index.html");
File aFil... | 1 |
private void genTajnA() {
if (klientA == null || klientA.kluczPrywatny == null) {
JOptionPane.showMessageDialog(null, "Naley wygenerowa klucz prywatny uytkownika A.", "Bd", JOptionPane.ERROR_MESSAGE);
}
else if (klientA.kluczPublicznyB == null) {
JOptionPane.showMessageDialog(null, "Naley obliczy klucz publ... | 6 |
public void interval(int symbol, int[] result, ByteSet exclusions) {
if (symbol == ArithCodeModel.EOF) symbol = EOF_INDEX;
int sum = 0;
for (int i = 0; i < symbol; ++i) if (!exclusions.contains(i)) sum += _count[i];
result[0] = sum;
sum += _count[symbol];
result[1] = sum;
for (int i = symbol+1; i < _count.lengt... | 6 |
public ArrayList<Interval> merge(ArrayList<Interval> intervals) {
ArrayList<Interval> result = new ArrayList<Interval>();
Collections.sort(intervals, new Comparator<Interval>(){
public int compare(Interval obj1, Interval obj2) {
if (obj1.start>obj2.start)
... | 5 |
public WeaponSlots getWeaponSlot(){
return weaponSlot;
} | 0 |
public void setLineGain(float gain) {
if (source != null) {
if (source.isControlSupported(FloatControl.Type.MASTER_GAIN)) {
FloatControl volControl = (FloatControl) source.getControl(FloatControl.Type.MASTER_GAIN);
float newGain = Math.min(Math.max(gain, volControl.ge... | 2 |
private void readFromFile(File file){
// fieldNameFile.setText(file.getName().split(".java")[0]);
fieldNameFile.setText(file.getName());
ArrayList<String> buffer =(ArrayList<String>)PreparingNewAlgos.readSourceFromFile(file);
for(int i = buffer.size()-1; i>=0; i--)
textArea... | 1 |
@Override
public void readValue(NBTInputStream input) throws IOException
{
while (true)
{
final NamedBinaryTag nbt = input.readNBT();
if (nbt == null)
{
return;
}
this.addTag(nbt);
}
} | 2 |
public void computeEditKeyFr(float value) {
currentTrack().setKeyFr(value);
currentTrack().setRefFr(refFr);
float frPerBpm = 0;
currentTrack().setTempoForRef(currentTrack().getBpm()*currentTrack().getRefFr()/currentTrack().getKeyFr());
if (currentTrack().getTempoForRef() > 0)
frPerBpm = currentTrack().ge... | 4 |
public void testSePeriodAfterStart_RI2() {
MutableInterval test = new MutableInterval(TEST_TIME1, TEST_TIME2);
try {
test.setPeriodAfterStart(new Period(-1L));
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
final public void WhileStatement() throws ParseException {
/*@bgen(jjtree) WhileStatement */
BSHWhileStatement jjtn000 = new BSHWhileStatement(JJTWHILESTATEMENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(WHILE);
jj_consume_token... | 8 |
protected void turnRight() {
if (moveDirection == UP) {
moveDirection = RIGHT;
checkDirection = UP;
}
else if (moveDirection == RIGHT) {
moveDirection = DOWN;
checkDirection = RIGHT;
}
else if (moveDirection == DOWN) {
... | 4 |
public static void w(ActionCharacter x) {
x.fight();
} | 0 |
private void merge(int left, int middle, int right){
for(int printCount=left; printCount<=middle; printCount++)
System.out.println("MergeSort_Adv: Elements in LeftArray == > "+inputArray[printCount]);
for(int printCount=middle+1; printCount<=right; printCount++)
System.out.println("MergeSort_Adv: Elements... | 8 |
@SuppressWarnings("unchecked")
private static <T extends Number> T parseNumber(String text, Class<T> targetClass) {
if (text == null) {
throw new IllegalArgumentException("Text must not be null");
} else if (targetClass == null) {
throw new IllegalArgumentException("Target class must not be null");
}
Str... | 8 |
public int synthesis(Packet op) {
Info vi = vd.vi;
// first things first. Make sure decode is ready
opb.readinit(op.packet_base, op.packet, op.bytes);
// Check the packet type
if (opb.read(1) != 0) {
// Oops. This is not an audio data packet
return (-1... | 9 |
public static boolean demoPauseP(boolean pauseP, Object [] MV_returnarray) {
{ boolean exitP = false;
String input = null;
if (pauseP) {
System.out.print("------ pause ------");
input = InputStream.readLine(Stella.STANDARD_INPUT);
System.out.println();
if (input.length()... | 7 |
public void tick() {
up = keys[KeyEvent.VK_UP];
down = keys[KeyEvent.VK_DOWN];
left = keys[KeyEvent.VK_LEFT];
right = keys[KeyEvent.VK_RIGHT];
enter = keys[KeyEvent.VK_ENTER] || keys[KeyEvent.VK_E];
use = keys[KeyEvent.VK_X];
attack = keys[KeyEvent.VK_C];
... | 5 |
public boolean match(PathInput input) {
input.rewind();
if ((httpMethods & input.getHttpMethod()) == 0) {
return false;
}
for (Element element : elements) {
if (element == null) {
continue;
}
if (!element.match(input)) {
... | 4 |
protected static boolean fixedTimeEqual(String lhs, String rhs) {
boolean equal = (lhs.length() == rhs.length() ? true : false);
// If not equal, work on a single operand to have same length.
if (!equal) {
rhs = lhs;
}
int len = lhs.length();
for (int i = 0; i < len; i++) {
if (lhs.charAt(i) == rhs.... | 6 |
public CheckResultMessage checkF05(int day) {
return checkReport.checkF05(day);
} | 0 |
public static void addBlock(Block b) {
if (custom.contains(b))
return;
custom.add(b);
} | 1 |
@Override
public int compare(Object o1, Object o2) {
Aula aula1 = (Aula) o1;
Periodo p1 = aula1.getPeriodo();
Aula aula2 = (Aula) o2;
Periodo p2 = aula2.getPeriodo();
int flag = 0;
if(aula1.getDiaDaSemana() > aula2.getDiaDaSemana() ){
... | 4 |
public static int ZipFiles(File[] srcfile, String zipFile) {
try {
// Create the ZIP file
OutputStream os = new FileOutputStream(zipFile);
BufferedOutputStream bs = new BufferedOutputStream(os);
ZipOutputStream out = new ZipOutputStream(bs);
// Compress the files
for (int i = 0; i < srcfile.length; ... | 2 |
public void data( String sentence )
{
String identifier = sentence.substring( 1, 6 ).replaceAll( "-", "" );
NMEASentence s;
Class c;
//create class object and sentence
try {
//get class object
c = Class.forName( "com.anthonyontheweb.nmea.sentence." + identifier + "Sentence" );
//create the ... | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Moto other = (Moto) obj;
if (!Objects.equals(this.tipo, other.tipo)) {
return false;
... | 8 |
public static void allTests() throws IOException{
int error = 0;
if(testEmptyString() == false){
error += 1;
}
if(testRightBraces() == false){
error += 1;
}
if(test1() == false){
error += 1;
}
/*
if(testPlus() ... | 5 |
public void run( int pageCount, boolean outputContent ) throws Exception {
String seedFile = createSeedFile(pageCount);
Path seedFilePath = new Path(seedFile);
Configuration conf = new Configuration();
String input = Constants.SEED_INPUT;
String output = Constants.POST_OUTPUT_DIR;
FileSystem fileSystem =... | 1 |
public ComboViewer(Setting s) throws Exception {
super(s);
box_ = new JComboBox<>();
if (s.getType() == ValueType.ENUM) {
@SuppressWarnings("unchecked")
EnumSet<?> set = EnumSet.allOf(s.getValue().getEnum().getClass());
for (Object obj : set.toArray()) {
box_.addItem(obj.toString());
}
} else if... | 5 |
public static void main(String[] args) throws Exception {
SAXBuilder sb = new SAXBuilder();
Document doc = sb.build(new File("jdom.xml"));
Element element = doc.getRootElement();
System.out.println(element.getName());
Element student = element.getChild("学生");
System.out.println(student.get... | 1 |
private boolean diagonalIncrementingAttack(int[][] grid, LinkedList<Square> squareStore, boolean pickOne) {
//Attack - Diagonal Inc
if ((grid[2][0] == 2 && grid[1][1] == 2) && grid[0][2] != 1) {
BuildAndAddSquareZeroTwo(squareStore);
pickOne = updateGridZeroTwo(grid);
} e... | 9 |
public int lancerDe(int bonusDe) {
showTemp("Lancement du dé...");
int value = (int) Math.round(Math.random() * (3.0 - 1.0)) + 1;
if (bonusDe == 0) {
showTemp("Résultat: " + value);
}
else if (bonusDe > 0) {
showTemp("Résultat: " + value + " (+ " + bonusDe + ")");
}
else {
showTemp("Résulta... | 2 |
private boolean promptForNew(boolean brandNew)
{
// SO NOW ASK THE USER FOR A WORLD NAME
String worldName = JOptionPane.showInputDialog(
app.getWindow(),
WORLD_NAME_REQUEST_TEXT,
WORLD_NAME_REQUEST_TITLE_TEXT,
JOptionPane.QUESTION_MESSA... | 6 |
public static void deleteFile(String realpath) {
File file = new File(realpath);
if (file.exists())
file.delete();
} | 1 |
public CheckResultMessage checkL7(int day){
int r1 = get(17,5);
int c1 = get(18,5);
int r2 = get(30,5);
int c2 = get(31,5);
if(checkVersion(file).equals("2003")){
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
if(0!=getValue(r2+7, c2+day, 10).compareTo(getValue(r1+2+day... | 5 |
@Override
public boolean equals(Object object) {
if (object == null) {
return false;
}
if (object == this) {
return true;
}
if (object instanceof Instructor) {
Instructor other = (Instructor) object;
return name.equals(other.get... | 4 |
public void parseVariable() {
String var = nameField.getText() + ";";
if(stringField.isEnabled()) {
var += "S;" + stringField.getText();
} else if(intSpinner.isEnabled()) {
var += "I;" + intSpinner.getValue();
} else if(booleanBox.isEnabled()) {
var += "B;" + booleanBox.isSelected();
} else if(floatS... | 4 |
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 fe... | 3 |
public Object retrieve(String key) {
if(key == null) {
return null;
}
totalAccess++;
if(entryMap.containsKey(key)) {
RREntry entry = entryMap.get(key);
hitCount++;
if(debug) System.out.println("Hit cache entry: " + key);
return entry.value;
} else if(refresherMap.containsKey(key)) {
RREntry... | 8 |
@Override
public void executeTask() {
try {
m_SendingSocket = new ServerSocket(LISTEN_PORT);
} catch (IOException e2) {
LISTEN_PORT += 1;
executeTask();
}
/* Responding the client to tell them which port to connect to */
try {
Server selfServer = new Server();
selfServer
.setCurrentIP(... | 7 |
synchronized void backward(float[] in, float[] out){
if(_x.length<n/2){
_x=new float[n/2];
}
if(_w.length<n/2){
_w=new float[n/2];
}
float[] x=_x;
float[] w=_w;
int n2=n>>>1;
int n4=n>>>2;
int n8=n>>>3;
// rotate + step 1
{
int inO=1;
int xO=0;
... | 5 |
@Override
public int getRowCount() {
return size();
} | 0 |
private int getDirection(Pair<Integer, Integer> init, Pair<Integer, Integer> target) {
if (target.second - 1 == init.second) {
return Mouse.UP;
} else if (target.second + 1 == init.second) {
return Mouse.DOWN;
} else if (target.first - 1 == init.first) {
retur... | 3 |
private void removeParentSelectionPath(TreePath p) {
if (p.getPathCount() == 3 || p.getPathCount() == 4) {
removeParentSelectionPath(p.getParentPath());
}
super.removeSelectionPath(p);
} | 2 |
public void run(){
try{
in = new BufferedReader(
new InputStreamReader(
clientSocket.getInputStream()));
String inputLine;
StringBuilder input = new StringBuilder();
Message msg = null;
while ((inputLine = in.readLine()) != null) {
if (inputLine.equalsIgnoreCase("EOM")){
msg = Mes... | 6 |
private void notifyStatChange(int eventType) {
try {
Object[] curListeners = listeners.getListenerList();
CycWorkerEvent cwe = null;
for (int i = curListeners.length-2; i>=0; i-=2) {
if (curListeners[i]==CycWorkerListener.class) {
if (cwe == null) { cwe = new CycWorkerEvent(this); }
switch(... | 7 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
if (row == null)
{
return "";
}
switch(columnIndex) {
case 0:
return row.getId();
case 1:
return row.getVal();
case 2:
return row.getExtra();
}
return null;
} | 4 |
public void sendContentProviderMail(Screen s, String data) {
//System.out.println("Send mail to CP: " + data);
JSONObject form = (JSONObject) JSONValue.parse(data);
String email = (String) form.get("email");
String id = (String) form.get("identifier");
String provider = (String) form.get("provider");
... | 9 |
@Override
public void mouseReleased(MouseEvent e) {
} | 0 |
private boolean canDoOpToChunk(int x, int z, int op)
{
if (x < 0 || x >= xSize)
return false;
if (z < 0 || z >= zSize)
return false;
if (chunks[x][z] == null)
return false;
if (chunks[x][z].opsDone[op])
return false;
for (int x... | 9 |
@Override
public void writeTo(Movie movie, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
JsonGenerator gen = Json.createGenerator(entityStream);
gen.... | 1 |
public ArrayList<BEPlaylist> getAllPlaylists() throws Exception {
try {
if (m_songs == null) {
m_songs = ds.getAllPlaylists();
}
return m_songs;
} catch (SQLException ex) {
throw new Exception("Could not get songs...");
}
} | 2 |
public void afficherDecoder(ArrayList<Integer> decoding)
{
System.out.print("[");
for (Integer tab : decoding)
{
System.out.print(tab + " ");
}
System.out.print("]");
} | 1 |
@Override
public void setCountry(String c) {
super.setCountry(c);
} | 0 |
public Sprite getSpriteCollision(Sprite sprite) {
// run through the list of Sprites
Iterator i = map.getBullets();
while (i.hasNext()) {
Sprite otherSprite = (Sprite)i.next();
if (isCollision(sprite, otherSprite)) {
// collision found, return the Sprite
... | 8 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Item target=getTarget(mob,mob.location(),givenTarget,commands,Wearable.FILTER_ANY);
if(target==null)
return false;
if(!(target instanceof Weapon))
{
mob.tell(L("That's not a weapon!")... | 7 |
public String getRegisseur() {
return regisseur;
} | 0 |
public BasicFileHandler() {} | 0 |
public String patch_addPadding(LinkedList<Patch> patches)
{
short paddingLength = this.Patch_Margin;
String nullPadding = "";
for(short x = 1; x <= paddingLength; x++)
{
nullPadding += String.valueOf((char) x);
}
// Bump all the patches forward.
for(Patch aPatch : patches)
{
aPatch.start1 += pad... | 8 |
@Override
public void keyTyped(KeyEvent event) {
if (event.getKeyChar() == 'q') {
hasQuit = true;
}
} | 1 |
private double[] sampleFlows() {
double[] sample = new double[flows.length];
for (int i = 0; i < flows.length; i++) {
sample[i] = flows[i].sample();
}
return sample;
} | 1 |
public boolean matches( Class<?> clazz )
{
Annotation fromElement = clazz.getAnnotation( this.annotation.annotationType() );
return this.annotation.equals( fromElement );
} | 1 |
private static X509Certificate[] getX509CertsFromStringList(
String[] paramArrayOfString1, String[] paramArrayOfString2)
throws CertificateException {
CertificateFactory localCertificateFactory = CertificateFactory
.getInstance("X.509");
ArrayList localArrayList =... | 7 |
public MapData createBasicMap(){
for(int y=0;y<mapData.HEIGHT;y++){
for(int x=0;x<mapData.WIDTH;x++){
mapData.map[y][x] = dict.getTile('.');
if(x == 0 || x == mapData.WIDTH-1 || y == 0 || y == mapData.HEIGHT-1){
mapData.map[y][x] = dict.getTile('#');
}
}
}
return mapData;
} | 6 |
public static String numberToWords(int number) {
// Zero Rule
if (number == 0) {
return smallNumbers[0];
}
// Array to hold four three digits group
int[] digitGroups = new int[4];
// Ensure the number is positive to extract from
int positiveNumber = ... | 9 |
public void setAlgorithm(String value) {
this.algorithm = value;
} | 0 |
public void analyseData(String path, int skipf) throws IOException {
int amount = new File(path).listFiles().length;
for (int i = 1; i <= amount; i += skipf) {
DecimalFormat format = new DecimalFormat("0000000");
BufferedImage img = ImageIO.read(new File(path + "image-" + format.format(i) + ".png"));
// if... | 9 |
public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
for(int var6 = 0; var6 < 64; ++var6) {
int var7 = var3 + var2.nextInt(8) - var2.nextInt(8);
int var8 = var4 + var2.nextInt(4) - var2.nextInt(4);
int var9 = var5 + var2.nextInt(8) - var2.nextInt(8);
... | 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.ge... | 4 |
public String nextString() {
String returnedString = null;
if(length == 0){
returnedString = "";
}
else{
for (int idx = 0; idx < buf.length; ++idx){
buf[idx] = symbols[random.nextInt(symbols.length)];
returnedString = new String(buf);
}
}
ret... | 2 |
private String getUpdatedLogPropertiesFileContent() {
final File propertiesFile = new File(logPropertiesFile);
final String logRegex = ".*<file>(.*?)</file>.*";
final String logBackupRegex = ".*<fileNamePattern>(.*?)</fileNamePattern>.*";
final String logPath = (new File(logFilePath, logFileName)).getPath();
... | 3 |
private void display() {
blitNumber((int) totalFps, 5, 2);
blitNumber((int) lastPps, 5, 12);
plantMan.drawRadar(buffer, car);
if (!openGL) {
if (!fullscreen) {
buffer.display(gFrame, leftBorderWidth, titleBarHeight);
} else {
Graphics g=bufferStrategy... | 2 |
public static void main(String[] args) {
try {
String input = null;
boolean outTime = false;
for(int i = 0; i<args.length; i++) {
switch(args[i]) {
case "-time":
outTime = true;
break;
def... | 5 |
public 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://download.or... | 6 |
public void mousePressed(MouseEvent e){
int loop;
if (!holdingTurret && !sellOrUndo.contains(mX, mY)){
for (loop = 0; loop < turretBuilder.size(); loop++){
if (turretBuilder.get(loop).turretArea().contains(mX, mY)){
turretBuilder.get(loop).changeFocus(true);
}
else{
turretBuilder.get(loop).... | 4 |
public static HolidayTypeEnumerationx fromValue(DayTypeEnumeration v) {
for (HolidayTypeEnumerationx c: HolidayTypeEnumerationx.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v.toString());
} | 2 |
protected void invoke() {
// Reads the memory address register
int address = Integer.parseInt(registerStore.readFrom(Register.MAR));
try {
// Finds what memory operation should be performed
switch(Integer.parseInt(registerStore.readFrom(Register.MRW))... | 6 |
private boolean isFinished(Algebra algebra, SolveFor solveFor) {
switch(solveFor) {
case SOLVE:
return algebra instanceof Equation && isSolved((Equation) algebra);
case SIMPLIFY:
return algebra instanceof AlgebraicParticle && isSimplified((AlgebraicParticle)algebra) || algebra instanceof Expression && (isF... | 7 |
public void update()
{
for(int i = 0; i < collidable.size(); i++)
{
if(collidable.get(i).getAttachedEntity().isDead())
{
collidable.remove(i);
}
}
} | 2 |
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.