text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String getHeader()
{
StringBuffer buffer = new StringBuffer();
String outputEncoding = this.outputEncoding;
if ( outputEncoding == null )
{
outputEncoding = "UTF-8";
}
// header
buffer
.append(
"<!DOCTYPE html P... | 4 |
private void updateOptions()
{
options = new ArrayList();
try
{
options.add(getIndoorText());
options.add(getOutdoorText());
}
catch(DataFormatException e)
{
//JOptionPane.showMessageDialo(frame,"input error",e.getMessage());
}
... | 4 |
public void close() {
terminer = true;
} | 0 |
public String explainScore(StringWrapper s, StringWrapper t) {
BagOfSourcedTokens sBag = (BagOfSourcedTokens) s;
BagOfSourcedTokens tBag = (BagOfSourcedTokens) t;
StringBuilder buf = new StringBuilder("");
PrintfFormat fmt = new PrintfFormat("%.3f");
buf.append("Common tokens: ")... | 5 |
private boolean validateBsDate(int bsYear, int bsMonth, int bsDayOfMonth) {
if (bsYear < lookupNepaliYearStart) {
throw new CustomerDiedException();
} else if (bsYear > (lookupNepaliYearStart + monthDays.size() - 1)) {
throw new CustomerYetToBornException();
}
if (lookupNepaliYearStart <= bsYear
&& bsYe... | 7 |
void readSetDesktopName(int x, int y, int w, int h) {
String name = is.readString();
if (x != 0 || y != 0 || w != 0 || h != 0) {
vlog.error("Ignoring DesktopName rect with non-zero position/size");
} else {
handler.setName(name);
}
} | 4 |
public static Instances clusterInstances(Instances data) {
XMeans xmeans = new XMeans();
Remove filter = new Remove();
Instances dataClusterer = null;
if (data == null) {
throw new NullPointerException("Data is null at clusteredInstances method");
}
//Get the ... | 7 |
protected Dimension computeLayoutSize(Container parent, int hp, int vp) {
if (!validWidths)
return null;
Component[] components = parent.getComponents();
int preferredWidth = 0, preferredHeight = 0;
widths = new int[COLUMNS];
heights = new int[components.length / COLUMNS];
// System.out.println("Grid: " ... | 4 |
private void showWinners() {
if (posFido >= tracksize -1) {
System.out.println("Fido Wins!");
}
if (posSpot >= tracksize -1) {
System.out.println("Spot Wins!");
}
if (posRover >= tracksize -1) {
System.out.println("Rover Wins!");
}
} | 3 |
public void setPrice(String price) {
this.price = price;
} | 0 |
protected synchronized void buildClassifiers(final Instances data) throws Exception {
for (int i = 0; i < m_Classifiers.length; i++) {
if (m_numExecutionSlots > 1) {
final Classifier currentClassifier = m_Classifiers[i];
final int iteration = i;
Runnable newTask = new Runnable() {
... | 7 |
@Override
public MailPiece parsePostalItemData(String data)
{
final MailPiece piece = new MailPiece();
for(int i=0;i<5;i++)
{
final int x=data.indexOf(';');
if(x<0)
{
Log.errOut("StdPostman","Man formed postal data: "+data);
return null;
}
switch(i)
{
case 0:
piece.from = data.s... | 7 |
public List<String> getLines() {
synchronized (lines) {
if (line.length() > 0) {
addLine();
}
return new ArrayList<String>(lines);
}
} | 1 |
public void interrupt() {
Thread t = threadVar.get();
if (t != null) {
t.interrupt();
}
threadVar.clear();
} | 1 |
public void importFunctions() {
File f = Tools.showOpenDialog("Importer");
if (f != null) {
String ext = f.getName().substring(f.getName().length() - 3,
f.getName().length());
if (ext.compareTo("txt") != 0)
JOptionPane.showMessageDialog(
null,
Tools.getLocalizedString("ERROR_IMPORT") + " ... | 7 |
public void testXMLParser(){
String s = "<a>value</a>";
DocumentBuilder parser = null;
Document document = null;
try {
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
document = parser.parse(new InputSource(new StringReader(s)));
} catch (SAXException e) {
e.printStackTrace();
}... | 3 |
@Override
public ArrayList<String> getTopKills() {
ArrayList<String> top_Players = new ArrayList<String>();
PreparedStatement pst = null;
ResultSet rs = null;
try {
pst = conn.prepareStatement("SELECT player_name FROM `ffa_leaderboards` ORDER BY `killcount` DESC");
rs = pst.executeQuery();
int count =... | 7 |
public void prependKnooppunt(Knooppunt knooppunt)throws IllegalArgumentException {
if(knooppunt == null) throw new IllegalArgumentException("Je hebt geen knooppunt meegegeven");
this.kortsteWeg.add(0, knooppunt);
} | 1 |
public static void cocktailSort(int[] array) {
printArray(array);
int a = 0;
for (int i = 0; i < array.length / 2; i++) {
for (int m = 1; m < array.length - i; m++) {
if (array[m - 1] > array[m]) {
a = array[m - 1];
array[m - 1] = array[m];
array[m] = a;
}... | 5 |
protected void computeArgumentsByteArray(OSCJavaToByteArrayConverter stream) {
stream.write(',');
if (null == arguments) {
return;
}
stream.writeTypes(arguments);
for (Object argument : arguments) {
stream.write(argument);
}
} | 2 |
public Picture getOppositeInversedImage() {
Color[][] col = new Color[h][w];
Color c;
int r=0;
int g=0;
int b=0;
for (int i=green.length-1; i>=0; i--) {
for (int j=green[0].length-1;j>=0; j--) {
for (int k=green[0][0].length-1; k>=0; k--) {
if (green[i][j][k]==1)
... | 8 |
protected double getNextFailureLengthSample() {
double sample;
if (failureLengthPatternDiscrete_ != null)
{
sample = failureLengthPatternDiscrete_.sample();
return Math.abs(sample);
}
else if (failureLengthPatternCont_ != null)
{
sample... | 3 |
public void setSelectedEditor(final int selectedEditor) {
final int oldEditor = this.selectedRootEditor;
if (oldEditor == selectedEditor) {
// no change - so nothing to do!
return;
}
this.selectedRootEditor = selectedEditor;
// make sure that only the sele... | 9 |
public WorkloadFileReader(String fileName, int rating) {
if (fileName == null || fileName.length() == 0) {
throw new IllegalArgumentException("Invalid trace file name.");
}
else if (rating <= 0) {
throw new IllegalArgumentException("Resource PE rating must be > 0.");
... | 3 |
public String longestCommonPrefix(String[] strs) {
if (strs.length == 0) {
return "";
}
if (strs.length == 1) {
return strs[0];
}
String common = "";
for (int j = 0; j < strs[0].length(); j++) {
char c = strs[0].charAt(j);
... | 7 |
public static void main(final String args[]) {
UserListRoot list = new UserListRoot();
User u = new User();
u.setName("danny");
u.setPassword("danny");
u.setPhoneNumber("123243");
u.setType(0);
User u2 = new User();
u2.setName("aly");
u2.setPasswo... | 2 |
public void setOutput(AudioBus newOutput) {
if(this.isMaster())
return;
if(newOutput == null)
newOutput = AudioBus.getMasterBus();
if(this.output != newOutput) {
this.output.removeAsInputBus(this);
this.output = newOutput;
newOutput.addAsInputBus(this);
}
} | 3 |
private boolean checkStartEndBounds(int xp, int yp){
//TODO: Still prettu buggy, can still erase edges of start and end rooms.
for(int y = 0; y < 9; y++){
int ya = y + (32 / 2) - (9 / 2);
for(int x = 0; x < 10; x++){
int xa = x - 1 + (64 - 10);
if(xp == x && yp == ya) return false;
if(xp == xa && ... | 8 |
public static Batch <Recreation> audienceFor(Boardable venue, Performance p) {
final Batch <Recreation> audience = new Batch <Recreation> () ;
for (Mobile m : venue.inside()) if (m instanceof Actor) {
final Actor a = (Actor) m ;
for (Behaviour b : a.mind.agenda()) if (b instanceof Recreation) {
... | 5 |
public ClusterNode(double distance, Cluster cluster) {
this.distance = distance;
this.cluster = cluster;
} | 0 |
public Double aStarSearch(Vertex[] vertices, int start, int goal) {
PriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();
vertices[start].gScore = 0.0;
vertices[goal].isGoal = true;
vertexQueue.add(vertices[start]);
while (!vertexQueue.isEmpty()) {
Vertex current = vertexQueue.po... | 7 |
public void updateConfigFile() {
// Only do this if the old configuration is present
if (getConfig().isConfigurationSection("Warnings.warned")) {
// Get all the currently warned players and put them in a HashMap
Map<String,Object> userList= getConfig().getConfigurationSection("Warnings.warned").getValues... | 2 |
private static boolean isPropertyAnnotated(String line, List<String> annotatedVariables){
boolean contains = false;
for (String property : annotatedVariables){
if (line.contains(property))
contains = true;
}
return contains;
} | 2 |
public static Rank getRank(String r) {
char test = r.charAt(0);
for (Rank rank : Rank.values()) {
if (rank.shortName == test) {
return rank;
}
}
throw new RuntimeException("Rank not recognized!!!");
} | 2 |
@Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
playerId = buf.readInt();
if (playerId < 0)
throw new RuntimeException("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0");
playerName = buf.re... | 3 |
public static void main(String[] args)
{
Conf.init();
boolean nicequit = false;
while(!nicequit) {
try {
Wrapper serv = new Wrapper();
serv.start();
while(!serv.hasStopped()) {
try {
serv.join();
} catch (Exception e) {
e.printStackTrace();
}
}
nicequit = serv.wasNiceQuit();... | 5 |
public static void prepareNodes() {
try {
CoordinatorGUI.textArea.append("Transmitting ready checks to nodes..." + "\n" + "\n");
String ready = "ready?";
buf = ready.getBytes();
packet = new DatagramPacket(buf, buf.length, group, 4446);
socket.send(pa... | 5 |
public void onTick() {
if (timeLeftInFog>0)
timeLeftInFog--;
else
setFog(false);
if (getTimeleft() > 0) {
setTimeleft(getTimeleft() - speed);
listener.onTowerAction(this);
return;
}
if (isInFog()) {
for (Road r : closeNeighbours) {
if (r.hasEnemy() != null) {
Enemy e = r.ha... | 7 |
@SuppressWarnings("rawtypes")
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
BasicFamilyObject other = (BasicFamilyObject) obj;
if (children == null) {
if (other.children != null)
retu... | 9 |
public String printParkInfoBySingle(){
String text="";
if(park == null && getParkBoyList().size() == 0) {
text="目前没有管理任何停车场!" ;
return text;
}
int emptyNum = 0;
int totalNum = 0;
if(park != null) {
text= " 停车场编号:" + park.getCode() +"\n";
text=text+ " 停车场名称:" + park.getP... | 3 |
@Override
public Object getValue(Method method, Map<Class<?>, ClassBuilder<?>> hows) {
List<Object> objects = new ArrayList<Object>();
for (Class<?> clazz : this.classes) {
objects.add( hows.get(clazz).build(hows) );
}
return objects;
} | 4 |
void output(int code, OutputStream outs) throws IOException {
cur_accum &= masks[cur_bits];
if (cur_bits > 0)
cur_accum |= (code << cur_bits);
else
cur_accum = code;
cur_bits += n_bits;
while (cur_bits >= 8) {
char_out((byte) (cur_accum & 0xff), outs);
cur_accum >>= 8;
cur_bits -= 8;
}
if... | 8 |
private final void drawHudItems(Graphics2D drawScreen, int offsetX, int offsetY) {
for (IHudItem hudItem : hudItemQueue) {
// Decide where the object should be drawn. Call the draw method of
// the hudItem as IHudItem extends IDrawable
switch (hudItem.getRelativeDraw()) {
case CENTER:
hudItem.draw(... | 6 |
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getTeamNameBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
... | 4 |
@Test
public void testGame()
{
// barely anything to test here..
_underTest = new Game(_paperPlayer, _rockPlayer);
assertNotNull(_underTest);
} | 0 |
void saveImages(File parentFile) {
if (((MDView) getView()).getFillMode() instanceof FillMode.ImageFill) {
String url = ((FillMode.ImageFill) ((MDView) getView()).getFillMode()).getURL();
String s = url;
String base = FileUtilities.getCodeBase(url);
/*
* if background image is set using the filechoose... | 8 |
public TabletStatus startApps(int type, int quantity) throws InvalidOperationException, IllegalArgumentException {
TabletStatus status = getCurrentStatus();
if (quantity <= 0) throw new IllegalArgumentException();
if (type < 0) throw new IllegalArgumentException();
if (status.cpuSpeed ... | 9 |
private void copyWorld()
{
//gespeicherte Welt löschen
Lines.clear();
Goals.clear();
//Alles kopieren
for(int i=0; i<Reflines.size(); i++)
{
int[] a = new int[4];
a[0] = Reflines.elementAt(i)[0];
a[1] = Reflines.elementAt(i)[1];
a[2] = Reflines.elementAt(i)[2];
a[3] = Reflines.elementAt(i... | 2 |
@Override
public void train() {
double sim = 0;
String[] t = socialNeighbourhood.split("_");
int k = new Integer(t[1]);
for (Integer user1 : data.getItemsByUser().keySet()) {
if (data.getUserFriends().get(user1) == null) {
// User has no friends :)
continue;
}
ArrayList<Integer> friendsKth... | 9 |
private static String getStringFromDocument(Document doc) {
try {
DOMSource domSource = new DOMSource(doc);
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
TransformerFactory tf = TransformerFactory.newInstance();
... | 1 |
@Override
public void boot() {
running = true;
this.configuration = getAudioInputConfiguration();
try {
lsr = new LiveSpeechRecognizer(configuration);
} catch (IOException e) {
System.out.println("Eva was unable to configure Ears.");
e.printStackT... | 2 |
public int genotypeSize(){
return this.bins.size();
} | 0 |
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 CreateTextureSetsSkinBodyFemale_1RBS_old() throws Exception {
// it copies SkinBodyFemale and changes the textures getting out of RBS folders.
for (TXST t : ListRBSTXSTMerger) {
if (t.getEDID().equals("SkinBodyFemale_1")) {
NumberFormat formatter = new DecimalFor... | 6 |
public ArrayList<String> leerArchivo(String nombre) {
ArrayList<String> datos = new ArrayList();
try {
FileReader fr = new FileReader("./Data/" + nombre + ".o");
BufferedReader br = new BufferedReader(fr);
String line;
while ((line = br.readLine()) != null... | 3 |
public void coreWorkflow(Configuration config) {
// Build a list of files to validate
try {
System.out.print(" -- Finding files to process");
AbstractQueue<String> queue = new ArrayBlockingQueue<String>(100000);
findDNGFiles(queue, config.inputDir);
int qs = queue.size();
System.out.println("\n -... | 4 |
private static int pivot(int[] a, int low, int high) {
int i1 = low, i2 = high - 1, i3 = (low + high) / 2;
int a1 = a[i1], a2 = a[i2], a3 = a[i3];
int n = (a1 > a2) ? a1 : a2;
int m = (a2 > a3) ? a2 : a3;
if (m > n) {
return (a1 > a2) ? i1 : i2;
} else if (n... | 8 |
public static int[] countSort(int[] a, int k){
int[] b = new int[a.length];
int[] c = new int[10];
for(int i=0; i<b.length; i++){
b[i] = 0;
}
for(int i=0; i<c.length; i++){
c[i] = 0;
}
int s = 1... | 6 |
private void showCrewEditor( final CrewSprite crewSprite ) {
final String NAME = "Name";
final String RACE = "Race";
final String HEALTH = "Health";
final String PILOT_SKILL = "Pilot Skill";
final String ENGINE_SKILL = "Engine Skill";
final String SHIELD_SKILL = "Shield Skill";
final String WEAPON_SKILL =... | 4 |
public void printPSolutions() {
String coord = "";
String solutions = "";
for (int j = 0 ; j < 9 ; j++) {
for (int i = 0 ; i < 9 ; i++) {
solutions = "";
if (getSolver().getGridModel().getValue(i, j) == ' ') {
coord = "["+i+","+j+"]... | 5 |
public Document toDOM(java.io.Serializable structure) {
Grammar grammar = (Grammar) structure;
Document doc = newEmptyDocument();
Element se = doc.getDocumentElement();
// Add the productions as subelements of the structure element.
Production[] productions = grammar.getProductions();
if (productions.length... | 2 |
@Override
public void setBuffer()
{
if (isDirty())
{
int numTempoChangeBytes = 0;
for(TempoChange tempoChange : tempoChanges)
numTempoChangeBytes += ((tempoChange.getBeatsPerMinute() < 256 ? 1 : 2) + 4);
buffer = new byte[1 + numTempoChangeBytes];
int ... | 5 |
public Database(Logger log, String prefix, String dp) throws DatabaseException {
if (log == null)
throw new DatabaseException("Logger cannot be null.");
if (prefix == null || prefix.length() == 0)
throw new DatabaseException("Plugin prefix cannot be null or empty.");
this.log = log;
this.PREFIX = prefi... | 3 |
@Override
public void run() {
nextAntiBan.endIn(Random.nextInt(5000, 45000));
final Dimension dimension = ctx.game.dimensions();
switch (Random.nextInt(0, 5)) {
case 0:
ctx.camera.angle(Random.nextBoolean() ? Random.nextInt(0, 360) : Random.nextInt(-359, 0));
break;
case 1:
ctx.input.move(Rand... | 6 |
public static boolean inBounds(String position)
{
String file_bounds = "abcdefgh";
String rank_bounds = "12345678";
if(file_bounds.contains(position.substring(0,1))&&rank_bounds.contains(position.substring(1)))
{
return true;
}
return false;
} | 2 |
public List<Field> findAllAnnotatedFields(Class<? extends Annotation> annotationClass) {
List<Field> annotatedFields = new LinkedList<Field>();
for(Field field : getFields()) {
if(field.isAnnotationPresent(annotationClass)) {
annotatedFields.add(field);
}
}
getFieldDetailStore().addAllFi... | 3 |
private void printOptions() {
Scanner s = new Scanner(System.in);
int option;
System.out.println("\n \n");
do {
System.out.println("Select one of the options: \n \n");
System.out.println("[1] Make a cell alive");
... | 6 |
private void loadConfig(){
this.getConfig().addDefault("config.settings.enable", true);
this.getConfig().addDefault("config.material.door", Material.QUARTZ.name());
this.getConfig().options().copyDefaults(true);
saveConfig();
doorMaterial = Material.getMaterial(getConfig().getString("config.material.door"... | 3 |
private Object parse(Class<?> type, String argument) {
try {
for (Types t : Types.values()) {
if (t.getWrapper() == type)
return Types.parseArg(t.getPrimitive(), argument,
savedObjects);
}
return Types.parseArg(type, argument, savedObjects);
} catch (IllegalArgumentException e) {
} catc... | 9 |
private String getDate(String path) {
File file = new File(path+ File.separator+ "Info.plist");
String date;
try {
NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(file);
date = rootDict.objectForKey("Last Backup Date").toString();
} catch (Exception e) {
e.printStackTrace();
ret... | 1 |
@Override
public byte[] write(DataOutputStream out, PassthroughConnection ptc, KillableThread thread, boolean serverToClient) {
if(!serverToClient || (!ptc.clientInfo.getLocalCache())) {
return super.write(out, ptc, thread, serverToClient);
} else {
int length = super.lengthUnit.getValue();
byte[] buffe... | 9 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int k = in.nextInt();
int a[] = new int[n];
//int diff[]=new int[n];
int sum=0;
// HashMap<Integer,Integer> map=new HashMap<Integer,Integer>(n);
... | 3 |
public void writeAssertion(CycAssertion cycAssertion)
throws IOException {
if (trace == API_TRACE_DETAILED) {
Log.current.println("writeAssertion = " + cycAssertion.toString());
}
write(CFASL_EXTERNALIZATION);
write(CFASL_ASSERTION);
writeList(cycAssertion.getFormula());
... | 1 |
public final WaiprParser.statdefs_return statdefs() throws RecognitionException {
WaiprParser.statdefs_return retval = new WaiprParser.statdefs_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token char_literal36=null;
Token char_literal38=null;
ParserRuleReturnScope statdef35 =null;
Par... | 6 |
public void setMaxParticleNumber(int maxParticles) {
if (maxParticles <= 0) {
throw new IllegalArgumentException("The maximum particle number cannot be set to zero or less!");
}
if (particleArray == null || maxParticles != particleArray.length) {
particleArray = ... | 3 |
public Date getDateTime() throws ParseException {
if (dateTime == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
dateTime = sdf.parse(dateTimeStr);
}
return dateTime;
} | 1 |
private boolean contensFuncionario(String nome) {
for (Funcionario f : funcionarios) {
if (f.getNome().equalsIgnoreCase(nome)) {
return true;
}
}
return false;
} | 2 |
private static Schedule getSchedule(Schedule bean, PreparedStatement stmt, ResultSet rs) throws SQLException{
stmt.setDate(1, bean.getWorkDay());
stmt.setString(2, bean.getUsername());
rs = stmt.executeQuery();
if (rs.next()) {
Schedule newBean = new Schedule();
newBean.setWorkDay(rs.getDate("work_d... | 1 |
public static void main(String[] args) {
int x = 5;
if (x < 5)
if (x > 5)
System.out.println('b');
else
System.out.println('a');
} | 2 |
public int getPageSize() {
return pageSize;
} | 0 |
private void updateLasers(){
Iterator l = map.getLasers();
Laser laser;
Object player;
double x1, y1, x2, y2;
while(l.hasNext()){
laser = (Laser)l.next();
player = laser.getParent();
if(player instanceof Ship){
//moves the players laser with reguards to his/her mouse.
... | 4 |
@Override
public boolean equals(Object o) {
if(o instanceof VariableReference) {
VariableReference v = (VariableReference)o;
return this.getInnerValue().equals(v.getInnerValue())
&& this.getVariable().equals(v.getVariable());
}
return false;
} | 2 |
public static void main(String[] args) {
if (args.length < 4) {
System.err
.println("Usage: JPLEphemerisSerialiser filename start-date end-date outputfile");
System.exit(1);
}
String filename = args[0];
double jdstart = Double.parseDouble(args[1]);
double jdfinis = Double.parseDouble(args[2]);
... | 4 |
@Override
public String toString() {
String name = getName();
String append = "";
if(name != null && !name.equals("")) {
append = "(\"" + this.getName() + "\")";
}
return "TAG_Double" + append + ": " + value;
} | 2 |
protected void getImagePixels() {
int w = image.getWidth();
int h = image.getHeight();
int type = image.getType();
if ((w != width)
|| (h != height)
|| (type != BufferedImage.TYPE_3BYTE_BGR)) {
// create new image with right size/format
BufferedImage temp =
new BufferedImage(width, height, Buffe... | 3 |
public String getType() {
return type;
} | 0 |
@Override
public void log(LogLevel logLevel, boolean isAuditMessage, Class<?> clazz, Throwable throwable,
String pattern, Object... arguments) {
switch (logLevel) {
case DEBUG:
debug(clazz, isAuditMessage, throwable, pattern, arguments);
break;
case ERROR:
error(clazz, isAuditMessage, throwable, pa... | 7 |
public void runProtocoloDHCP() {
try {
// DHCPMessage messageIn = new DHCPMessage();
byte[] datos = new byte[1024];
DatagramPacket messageIn = new DatagramPacket(datos, datos.length);
socket.receive(messageIn);
pack = new PaqueteDHCP(messageIn.getData());
switch (pack.existInOption(53).getIntValu... | 7 |
public boolean equals(Object obj) {
if (obj instanceof ProgramImpl) {
List<Reaction> otherProgramReactions = ((ProgramImpl) obj).getReactions();
for (Reaction r : otherProgramReactions) {
if (!this.reactions.contains(r)) {
return false;
}
}
for (Reaction r : this.reactions) {
if (!otherPr... | 5 |
private void cargarTemporadajButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cargarTemporadajButtonActionPerformed
// Carga la temporada que se ha seleccionado.
int tempIndex = temporadaList.getSelectedIndex();// se obtiene el indice en cual se encuentra la temporada
thi... | 5 |
public List findByOutputFormat(Object outputFormat) {
return findByProperty(OUTPUT_FORMAT, outputFormat);
} | 0 |
private void readMaze (String filePath){
try (Scanner scan = new Scanner(new File(filePath));){
this.width = scan.nextInt();
this.height = scan.nextInt();
scan.nextLine();
for (int i=0; i<height; i++){
String[] myList = scan.nextLine().split(" ");
List<Integer> row = Array... | 5 |
public void mergeSets(){
//System.out.println("");
// We repeat this process until we have at least 3 clusters
while (spagenumbers.size()>3){
ArrayList<RGB> averages = new ArrayList<RGB>();
// Obtaining the average color for each cluster
for (int i = 0; i<... | 7 |
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
String extension = Utils.getExtension(f);
if (extension != null) {
if (extension.equals(Utils.tiff) ||
extension.equals(Utils.tif) ||
extension.equals(Ut... | 8 |
public static void main(String[] args) {
CutOperations operations = new CutOperations();
MyFileReader readContent = new MyFileReader();
String fileContent;
if (args.length == 3) { // for delimiter
String separator = args[1].substring(2, 3);
int fieldNumb... | 6 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
public void reduce(Text prefix, Iterator<Text> iter,
OutputCollector<Text, Text> output, Reporter reporter)
throws IOException
{
//Map<String, Node> nodes = new HashMap<String, Node>();
List<Node> nodes = new ArrayList<Node>();
Map<String, Node> nodes_fr = new Has... | 9 |
public static void main(String[] args) {
name = "";
client = new Client();
RegisterClasses.register(client.getKryo());
client.start();
//Input address
String address = "127.0.0.1";
String addressInput = getInput("Enter address IP or leave blank for default:");
if (!"".equals(addressInput)){
addres... | 7 |
private void getDMESG(final Device device) {
new Thread() {
@Override
public void run() {
try {
final File ADB = adbController.getADB();
ProcessBuilder process = new ProcessBuilder();
List<String> args = new Arra... | 3 |
public boolean isBlockHere(int x, int y, int z) {
if((x >= 0 && y >= 0 && z >= 0) && (x < chunkW && y < chunkH && z < chunkD)) {
if (data[x + (y * chunkW) + (z * chunkW * chunkH)]) {
return true;
}
return false;
}
return false;
} | 7 |
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.