text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void setData(List<Integer> data) {
// System.out.println ("Setting display: " + this.id + " with data");
int[] elapsedTimeByteArray = new int[4];
int[] stopTimeByteArray = new int[4];
for (int i = 0; i < 4; i ++){
elapsedTimeByteArray[i]=data.get(i);
//System.out.println((byte... | 6 |
protected void checkKey(K key) {
if (key == null)
throw new Error("Invalid key:null.");
} | 1 |
public Iterator<Item> iterator() {
return new ListIterator<Item>(first);
} | 0 |
public static void main(String[] args) {
int direction = (int) (Math.random() * 4);
switch (direction) {
case NORTH:
System.out.println("travelling north");
break;
case SOUTH:
System.out.println("travelling south");
break;
case EAST:
System.out.println("travelling east");
break;
case WEST:... | 4 |
public static int[] insertionSort(int[] array) {
if(array == null || array.length <= 1) {
return array;
}
for(int i = 1; i < array.length; i++) {
int temp = array[i];
int j = i;
while(j > 0 && temp < array[j - 1]) {
array[j] = array[j - 1];
j--;
}
array[j] = temp;
}
ret... | 5 |
public int getFreeEntityId()
{
for (int i = 0; i < entities.length; i++)
{
if (entities[i] == null)
return i;
}
return -1;
} | 2 |
private void parseSettings( Token token ) {
if ( token.equals( "CLASS" ) ) {
token = getNextToken();
if ( isNewLine( token ) ) {
throwException( "Expected a class name, recieved new line." );
}
setClass( toCamelCase( token ) );
// ch... | 3 |
public GUI(ArrayList<ServerStatus> serverList, getStatus tStatus, Console tC){
status = tStatus;
c = tC;
this.setLayout(new BorderLayout());
this.setTitle("Diablo III - Server Status");
//menu Panel
JPanel menuPanel = new JPanel();
menuPanel.setLayout(new GridLayout(5,1));
// Refresh button
JBut... | 9 |
public void removeOnetimeLocals() {
cond = cond.removeOnetimeLocals();
if (type == FOR) {
if (initInstr != null)
initInstr.removeOnetimeLocals();
incrInstr.removeOnetimeLocals();
}
super.removeOnetimeLocals();
} | 2 |
public ViewPersonnelView(PayrollSystemModel model) {
this.model = model;
deleteBtn = new JButton(new ImageIcon(
getClass().getResource("/images/buttons/delete.png")));
statusLbl = new JLabel("Status: No Data Found!");
statusLbl.setIcon(loadScaledImage("/images/notifs/warning.png",.08f));
selectCl... | 4 |
public String getStartCity() {
return startCity;
} | 0 |
public void setId(Long id)
{
Id = id;
} | 0 |
public <T> List<T> dumpResultSet(ResultSet rs, Class clazz) {
// get the field mapping
ArrayList<FieldMap> fieldMap = getFieldMap(rs, clazz);
List<T> elements = new ArrayList<T>();
try {
while (rs.next()) {
Object newInstance = clazz.newInstance();
for (int i = 0; i < fieldMap.size(); i++) {
i... | 7 |
@Test
public void testNumDoors() {
int count = 0;
for (int i = 0; i < board.getCells().size(); i++) {
if (board.getCells().get(i).isDoorway()) {
count++;
}
}
Assert.assertEquals(NUM_DOORS, count);
} | 2 |
public void keyPressed(KeyEvent keyEvent) {
Iterator<PComponent> it = components.iterator();
while (it.hasNext()) {
PComponent comp = it.next();
if (shouldHandleKeys) {
if (comp.shouldHandleKeys())
comp.keyPressed(keyEvent);
}
... | 7 |
public <V> Adapter.Getter<V> makeGetter(String methodName, Class<V> _class) {
try {
final Method method = version.getClass().getMethod(methodName);
return new Adapter.Getter<V>() {
public V call() {
try{
lock.lock();
if (firstTime) {
((Recoverable... | 5 |
public static void main(String args[])
{
Termio UserInput = new Termio(); // Termio IO Object
boolean Done = false; // Main loop flag
String Option = null; // Menu choice from user
Event Evt = null; // Event object
boolean Error = false; // Error flag
SCSMonitor Monitor = null; // The envir... | 8 |
protected String dumpArray(final Object value) {
String result;
if (value.getClass() == byte[].class) {
result = Arrays.toString((byte[]) value);
}
else if (value.getClass() == short[].class) {
result = Arrays.toString((short[]) value);
}
else if (... | 7 |
public void setCategoryId(int categoryId) {
this.categoryId = categoryId;
} | 0 |
public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
HttpSession session = req.getSession(true);
String error = "";
Product product;
int sku = 0;
int price = 0;
int category = 0;
long owner = 0;
try {
// Checks if any attributes were blank
... | 8 |
public Snake(Point p, Rectangle field){
if(p.x < field.x || p.y < field.y || p.x >= (field.x + field.width) || p.y >= (field.y + field.height))
throw new IllegalArgumentException();
points = new ArrayList<Point>();
points.add(p);
p = new Point(p.x - 1, p.y);
points.add(p);
p = new Point(p.x - 1, p.y);
... | 4 |
public boolean removeImageButton(String name) {
for (ImageButton button : screenObjects) {
if (button.getText() == name) {
screenObjects.remove(button);
return true;
}
}
return false;
} | 2 |
public String getRightResult(long start_ts,long end_ts) {
String tempResult=null;
for (Map.Entry<String, String> entry : optimizedData.entrySet()) {
String times = entry.getValue();
String[] timespan = times.split(",");
Long firstTime = Long.parseLong(timespan[0]);
Long secondTime = Long.parseLong(times... | 5 |
@Override
public int hashCode() {
int result;
long temp;
result = itemId;
result = 31 * result + (name != null ? name.hashCode() : 0);
temp = percent != +0.0d ? Double.doubleToLongBits(percent) : 0L;
result = 31 * result + (int) (temp ^ (temp >>> 32));
return ... | 2 |
@Override
public List<Packet> onContact(int selfID, Sprite interactor, int interactorID, List<Integer> dirtySprites, List<Integer> spritesPendingRemoveal, ChatBroadcaster chater) {
if (interactor instanceof AmmoPickup && isAlive()) {
weaponsDataDirty = true;
WeaponInfo wi = getWeapon... | 4 |
private Tree statementsPro(){
Tree statement = null,
statements = null;
if((statement = statementPro())!= null){
if((statements = statementsPro())!=null){
return new Statements(statement, statements);
}
return statement;
}
return null;
} | 2 |
void printSprite()
{
//Get the current sprite path
NodeList listOfMovesSprites = sprites_doc.getElementsByTagName("Move");
boolean sprite_found=false;
for(int s=0; s<listOfMovesSprites.getLength() ; s++)
{
Node move_node = listOfMovesSprites.item(s);
Element move_element = (El... | 6 |
private int valueIexpand(char[] charArray, int i) {
if ('I' == charArray[i]) {
if (charArray.length > i
& ('V' == charArray[i + 1] | 'X' == charArray[i + 1]
| 'L' == charArray[i + 1] | 'C' == charArray[i + 1]
| 'D' == charArray[i + 1] | 'M' == charArray[i + 1])) {
return -1;
} else if (ch... | 6 |
public void collectStatistics() {
String word;
int numAccurances;
int numAccurancesPerWord;
double statistics;
boolean accurance;
DecimalFormat formatter = new DecimalFormat("##.00");
for (int j = 0; j < alphabet.length; j++) {
numAccurances = 0;
numAccurancesPerWord = 0;
statistics = 0;
fo... | 5 |
private void recurseComments(JSONObject jobj, Properties more, HashMap<String, Properties> data) {
try {
Properties properties = pullComment(jobj, more);
if (properties != null) {
data.put(properties.getProperty("name"), properties);
if (!jobj.getJSONObject("data").isNull("replies") && !(jobj.getJSONObj... | 6 |
public void pauseSimulation() {
if (sim != null)
sim.pause();
} | 1 |
public int gameTeamScore(int i) {
if (i >= 2 || i < 0)
throw new IllegalArgumentException();
int result = 0;
if (i == 0) {
result += players[0].getScore();
result += players[2].getScore();
} else if (i == 1) {
result += players[1].getScore();
result += players[3].getScore();
}
return result;
... | 4 |
private void saveStack() {
int height = 0;
for (int i = 0; i < stack.size(); i++) {
final Expr expr = stack.get(i);
if (Tree.USE_STACK) {
// Save to a stack variable only if we'll create a new
// variable there.
if (!(expr instanceof StackExpr)
|| (((StackExpr) expr).index() != height)) {
... | 7 |
@Override
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
String username = request.getParameter("username");
String password = request.getParameter("password");
if (username == null || use... | 9 |
public SimpleStringProperty phoneTypeProperty() {
return phoneType;
} | 0 |
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
accumulator.setLength(0);
if (qName.equals("servlet"))
temperature = attributes.getValue("id");
} | 1 |
public void setMouseListener(MouseListener mouseListener){
if(this.mouseListener != null){
gamePanel.removeMouseListener(this.mouseListener);
}
this.mouseListener = mouseListener;
gamePanel.addMouseListener(mouseListener);
} | 1 |
public void update() {
p.update();
for (Tile t : tiles) {
t.update();
p.collide(t.boundingBox);
}
if (p.Position.x > WIDTH - (WIDTH / 8)) {
p.Velocity.x *= -1;
p.Position.x = WIDTH - (WIDTH / 8);
xOffset+=32;
for (Tile t : tiles) {
t.Position.x -= 32;
}
}
if (p.Position.x < WIDTH /... | 9 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
int numero = Integer.valueOf(campoNumero.getText());
for (int i = 0; i <= numero; i++) {
textArea.append(" " + i);
if(i % 25 == 0 && i != 0)
... | 3 |
public boolean withdrawEvidence(Evidence evidence, String actionType) {
boolean flag = false;
Element evidenceE = (Element) document
.selectSingleNode("//" + actionType + "[@id='" + evidence.getId() + "']");
if (evidenceE != null) {
evidenceE.element("dialogState").setText(evidence.getDialogState());
//... | 6 |
public void set(Scanner scan){
System.out.println("SELECT FIELD:\nName\t1"
+ "\nAddress\t2\nEmail\t3\nPhone\t4\nCity\t5"
+ "\nState\t6\nZip\t7");
int field = scan.nextInt();
String newVal = "";
System.out.println("you have to enter the same value 3 times.");
while(1!=0){
System.out.println("E... | 8 |
@Test
public void test() {
try{
XmlIdRegister register = new XmlIdRegister("pre");
//Generate and register ID with default prefix
Id id1 = register.generateId();
assertNotNull(id1);
assertTrue(id1.toString().startsWith("pre"));
try {
register.registerId(id1);
} catch (InvalidIdException ... | 7 |
public void setFirstName(String firstName) throws Exception{
if (firstName.length() < MIN_INT_VALUE || firstName.toString() == null || firstName.length() > MAX_CHAR){
throw new IllegalArgumentException(NAME_ERR);
}
this.firstName = firstName;
} | 3 |
public static void saveFixture(DB db, String name, FixtureResource resource) throws IOException {
log.info("Saving [" + db.getName() + "." + db.getCollection(name) + "] to " + resource);
int savedIndexes = 0;
int savedDocuments = 0;
PrintWriter output = new PrintWriter(resource.getWriter());
output.println(na... | 3 |
public static boolean isChestEmpty(Inventory i){
for(ItemStack is:i.getContents()){
if(is!=null){
return false;
}
}
return true;
} | 2 |
public SimplifyResult simplify(AdditiveExpression expression) {
Multimap<String, ASTElement> mapping = LinkedListMultimap.create();
for (ASTElement term : expression.getChildren()) {
MathExpression expr = (MathExpression) term;
mapping.put(expr.getSignature(), term);
}
boolean simplified = f... | 8 |
private Result(Level level, String message) {
this.level = level;
this.message = message;
} | 0 |
public Auth_frame() {
int selection = JOptionPane.showConfirmDialog(
null
, "Authentication Failed!"
, "Input Error"
, JOptionPane.OK_CANCEL_OPTION
, JOptionPane.INFORMATION_MESSAGE);
if (selection == JOptionPane.OK_OPTION)
{
new Login();
}
else ... | 2 |
public static Vector performSearch(Graph searchGraph, int nStartNodeID, int nGoalNodeID)
{
// create the open and closed lists
Vector vOpenList = new Vector();
Vector vClosedList = new Vector();
// create the start node as an AstarNode
Astar.AstarNode currNode = new Astar.AstarNode();
currNode.m_Node = ... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
String comando=e.getActionCommand();
if(comando.equals("explorar")){
principal.mostrarExploracion();
}else if(comando.equals("buscar")){
principal.mostrarBusqueda();
}else if(comando.equals("historial")){
pr... | 8 |
public double evaluate(Individual ind) {
IntegerIndividual iind = (IntegerIndividual) ind;
Strategy es = strategies.get((Integer) iind.get(0));
int score = 0;
for (int i = 0; i < maxEncounters; i++) {
Strategy s = strategies.get(rnd.nextInt(strategies.size()));
... | 8 |
public void update(String line, LineStatus status, Scanner fileScan) throws IOException
{
boolean isUrlObjectComplete = false;
do {
switch (status)
{
case BlankLine: {
add("", BookmarkWorkbench.mainManifest);
isUrlObjectComplete = true;
}
break;
case Ti... | 8 |
public void refresh() {
zoeker.resetMap(accounts.getBusinessObjects());
combo.removeAllItems();
for(Project project : projects.getBusinessObjects()) {
((DefaultComboBoxModel<Project>) combo.getModel()).addElement(project);
}
Project[] result = new Project[projects.getBusinessO... | 3 |
public synchronized void addRule(Rule newRule) throws TheoryException {
if (newRule == null) throw new TheoryException(ErrorMessage.RULE_NULL_RULE);
// throw exception if rule contains no head literals
if (newRule.getHeadLiterals().size() == 0)
throw new RuleException(ErrorMessage.RULE_NO_HEAD_LITERAL, new Ob... | 7 |
public static double compute(double a) throws ArithmeticException {
double MAXLOG = 7.09782712893383996732E2;
double x, y, z, p, q;
double P[] = { 2.46196981473530512524E-10, 5.64189564831068821977E-1, 7.46321056442269912687E0,
4.86371970985681366614E1, 1.96520832956077098242E2, 5.26445194995477358631E2, 9... | 8 |
public void saveLaTeXTable(String fileName, List<List<String>> compact, List<List<String>> full) {
if (!fileName.contains(".txt")) {
fileName += ".txt";
}
FileWriter writer = null;
try {
writer = new FileWriter(fileName);
PrintWriter fout = new PrintWriter(writer);
fout.println("%");
fout.println... | 3 |
private String formatMonome(int exponent, int coeficient) {
if (coeficient == 0) {
return "";
}
if (exponent == 0) {
if (exponent == this.getMaximumExponent())
return "" + coeficient;
else return (coeficient > 0) ? "+" + coeficient : coeficien... | 8 |
private static void showScreen(final AbstractScreen screenToShow) {
for (AbstractScreen screen : screenRef) {
screen.setVisible(false);
}
screenToShow.reset();
screenToShow.loadFields();
screenToShow.setVisible(true);
} | 1 |
@Override
public void characters(char ch[], int start, int length) throws SAXException {
super.characters(ch, start, length);
} | 0 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if((mob!=null)&&(target!=null))
{
if((CMLib.flags().isSitting(target)||CMLib.flags().isSleeping(target)))
return Ability.QUALITY_INDIFFERENT;
if((target instanceof MOB)&&(((MOB)target).riding()!=null))
return Ability.QUALITY_INDIFFERENT... | 7 |
public StrongRenamer() {
charsets = new String[idents.length][parts.length];
for (int i = 0; i < idents.length; i++)
for (int j = 0; j < parts.length; j++)
charsets[i][j] = "abcdefghijklmnopqrstuvwxyz";
} | 2 |
private List<String> getProperties() {
List<String> properties = new ArrayList<String>();
for (Map.Entry<String, String> field: metadata.getEnvironment().entrySet()) {
String fieldKey = field.getKey();
String fieldValue = field.getValue();
if (includeDeprecatedEntries... | 3 |
public Vector2f(float x, float y) {
this.x = x;
this.y = y;
} | 0 |
public void quick(int[] array, int left, int right) {
if (left < right) {
int i = left, j = right, x = array[left];
while (i < j) {
while (i < j && array[j] >= x) j --;
if (i < j) array[i++] = array[j];
while(i < j && array[i] < x) i ++;
if (i < j) array[j--] = array[i];
}
array[i] = x;
... | 8 |
public String getNonPHr(int i){
String hr, min;
try{
hr = Integer.toString(nonPeakHr[i].get(11));
if (hr.length()==1)
hr = "0" + hr;
min = Integer.toString(nonPeakHr[i].get(12));
if (min.length()==1)
min = "0" + min;
return hr + ":" + min;
} catch(NullPointerException e){
}
return null;... | 3 |
@Override
public byte[] runBinaryMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp) throws HTTPServerException
{
String filename=getFilename(httpReq,"");
if(filename==null)
filename="FileData";
final int x=filename.lastIndexOf('/');
if((x>=0)&&(x<filename.length()-1))
filename=filename.subst... | 8 |
protected HTTPResponse handleUriRes(HTTPRequest req) {
Matcher m;
String urn;
String filenameHint;
if( (m = rawPattern.matcher(req.path)).matches() ) {
urn = urlDecodeString(m.group(1));
filenameHint = m.group(2);
} else if( (m = n2rPattern.matcher(req.path)).matches() ) {
urn = urlDecodeStri... | 5 |
private static long count(long n){
long twon = n*2;
String N = Long.toBinaryString(n);
String twoN = Long.toBinaryString(twon);
if(N.length()<k) return 0;
String smallest = findSmall(N);
String largest = findLarge(twoN);
if(Long.parseLong(smallest, 2) < n || Long.parseLong(largest, 2) > twon) return 0;
... | 4 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + x;
result = prime * result + y;
return result;
} | 0 |
@Override
public Iterator<List<S>> iterator() {
TreeNode<S> rootIntermediate = this;
while (this.parent != null) {
rootIntermediate = this.parent;
}
final ArrayDeque<TreeNode<S>> stack = new ArrayDeque<TreeNode<S>>();
stack.add(rootIntermediate);
List<List<S>> paths = new ArrayList<>();
while (!st... | 3 |
public InvalidPageNumberException(Exception ex, String name)
{
super(ex, name);
} | 0 |
private final Object[] loadScriptParameters(ByteBuffer class348_sub49, int i) {
if (i != -1)
return null;
anInt691++;
int i_33_ = class348_sub49.getUByte();
if (i_33_ == 0)
return null;
Object[] objects = new Object[i_33_];
for (int i_34_ = 0; i_34_ < i_33_; i_34_++) {
int i_35_ = class348_sub49.ge... | 5 |
public boolean delete(String zipPath, boolean delDirs) throws IOException
{
boolean failed = true;
Path path = fileSystem.getPath(zipPath);
if(!Files.exists(path) && !delDirs)
{
return false;
}
if(delDirs)
{
for(int i = path.getNameCount(); i > 0; i--)
{
Path p = path.subpath(0, i);
try
... | 5 |
private JsonElement jNull() throws MalformedJsonException{
if(next()=='u' && next()=='l' && next()=='l'){
next();
return null;
}else{
throw jsonError("invalid comment", true);
}
} | 3 |
private void overlayFragment(final long pos, long otherOffset,
long length, DeltaSource source, FragmentFactory factory)
throws IOException, DeltaFormatException
{
// There is a top layer, find its intersecting common fragments
CommonFragment topFragment = commonCursor.next();
if (pos > topFragment.oldOffs... | 8 |
public static int lengthOfPrimeSum(int[] primes, int n) {
int currLength = 0, sum = 0, maxLength = 0;
boolean foundSum = false;
for (int i = 0; i < primes.length && primes[i] <= Math.sqrt(n); i++) {
currLength = 0;
foundSum = false;
sum = 0;
for (i... | 7 |
public static void loadLevel(String levelFile, GameState parentState,
ArrayList<GameObject> gameObjectList) {
try {
BufferedReader in = new BufferedReader(new FileReader(levelFile));
String line = null;
int y = 0;
while ((line = in.readLine()) != null) {
for (int i = 0; i < line.length(); i... | 4 |
public boolean[] classify(int datapoint) {
double hypothesis;
boolean[] class_list = new boolean[classes];
int c, f, i;
//System.out.println("Classifying:");
for (c = 0; c < classes; c++) {
hypothesis = 0;
//System.out.println(" "+data.classlist[c]+":");
for (f = 0; f < features; f++) {
//Sy... | 4 |
private void sort_notes() {
if (!notes.isEmpty()) {
int min = notes.get(0);
for (int i = 0; i < notes.size(); i++) {
min = i;
for (int j = i + 1; j < notes.size(); j++) {
if (notes.get(j) < notes.get(min)) min = j;
}
if (min != i) {
int temp = notes.get(i);
notes.set(i, notes.get(... | 5 |
public int getHole(){
if(hole > -1){
return hole;
}
boolean[][] map = copyArray(imageMap);
//first, paint the background to black
paintBlack(map,0,0);
//then, start counting
int e = 0;
int i = 0;
int height = map.length;
int width = map[0].length;
for (int h = 0; h ... | 9 |
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget ();
int width = 0, height = 0;
if (wHint != SWT.DEFAULT) {
width = wHint;
} else {
if (columns.length == 0) {
for (int i = 0; i < itemsCount; i++) {
Rectangle itemBounds = items [i].getBounds (false);
width = Math.max (wid... | 4 |
public GClicker() throws Exception
{
super("gClicker");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocation(30, 30);
model = new GClickerModel();
myAddress = InetAddress.getLocalHost();
ipAddress = new int[4];
for (int i = 0; i < 4; i++)
ipAddress[i] = (0x000000FF & myAddress.getAddress()[i])... | 6 |
public void setAvailablePieces(List<? extends Piece> availablePieces) {
this.availablePieces = availablePieces;
} | 1 |
public static JSONObject toJSONObject(String string) throws JSONException {
JSONObject jo = new JSONObject();
HTTPTokener x = new HTTPTokener(string);
String token;
token = x.nextToken();
if (token.toUpperCase().startsWith("HTTP")) {
// Response
jo.p... | 2 |
public void setWord(Word newWord, int index){
words.set(index, newWord);
} | 0 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
AnsatDTO ansat = ansatList.get(rowIndex);
Object value = null;
switch (columnIndex) {
case 0:
value = ansat.getmedArbId();
break;
case 1:
value = ansat.getfornavn();
break;
case 2:
value = ansat.getefternavn();
break;
c... | 7 |
public int getLeftnumberByPID(Statement statement,String PID)//根据PID获取剩余车位数
{
int result = -1;
sql = "select leftnumber from Park where PID = '" + PID +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getInt("leftnumber");
}
}
catch (SQLException e)
{... | 2 |
public static boolean box_box(double ax0, double ay0, double ax1, double ay1, double bx0, double by0, double bx1, double by1){
double topA = FastMath.min(ay0, ay1);
double botA = FastMath.max(ay0, ay1);
double leftA = FastMath.min(ax0, ax1);
double rightA = FastMath.max(ax0, ax1);
double topB = FastMath.min(b... | 4 |
public ListDataOut(){
listDataOut = new ArrayList<DataOut>();
} | 0 |
public void drawSphere(float r, int scalex, int scaley)
{
BufferData data = RobotRace.VBOUtil.bufferHalfSphere(1F, scalex, scaley);
if(r != 1F)
gl.glScalef(r, r, r);
RobotRace.VBOUtil.drawBufferedObject(data);
gl.glScaled(1, -1, 1);
RobotRace.VBOUtil.drawBufferedO... | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Familia other = (Familia) obj;
if (!Objects.equals(this.idFamilia, other.idFamilia)) {
return... | 3 |
public static int adminSearch(Db db, LogAc logAc, String Username){
int i = 0;
while (logAc.getAdmin(i) != null)
{
if (Username.equals(logAc.getAdmin(i).userName))
return i;
i++;
}
return -1;
} | 2 |
@Override
public Map<String, Long> startExperiment(int amount, int maxRange,
final int iterations, List<SortingAlgorithm> list) {
System.out.printf("\n%s", "Starting experiment");
setPause(2);
// parameters check
if (amount == 0 || maxRa... | 8 |
private void initElements(String title, int size, Actor actor,
boolean editable) {
// labels
lName = new JLabel("Name");
lForename = new JLabel("Vorname");
lFamilyname = new JLabel("Nachname");
lNationality = new JLabel("Nationalität");
lBirthday = new JLabel("Geburtstag");
lMovie = new JLabel("Filme");
l... | 7 |
private void writeChunkToImage(RegionFile region, BufferedImage image,
int chunkX, int chunkZ) {
if (chunkZ == 0)
System.out.print(".");
DataInputStream chunkDataInputStream = region.getChunkDataInputStream(chunkX, chunkZ);
if (chunkDataInputStream == null)
return;
try {
Tag tag = Tag.readFrom... | 8 |
public void addResultToEvent(String eventIdentifier, Result newResult)
{
for(Event e: events){
if(e.getIdentifier().equals(eventIdentifier))
{
//We check if the result is already there
for(Result r: e.getResults()){
if(r.getIdentifier().equals... | 4 |
@Test
public void resolve() {
print(squaresOfSum(1,100)-sumOfSquares(1,100));
} | 0 |
@Override
void processStatus(Status status) {
if (_startDate == null) {
_startDate = new Date();
}
StringTokenizer tokenizer = new StringTokenizer(status.getText());
while (tokenizer.hasMoreElements()) {
String word = tokenizer.nextToken();
if ((_onlyHashtags == false && _stopWords.contains(word))
... | 6 |
private void button13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button13ActionPerformed
if (order2code2tf.getText().equals("1001"))
{
o2c2destf.setText("Chicken Nugget");
}
if (order2code2tf.getText().equals("1002"))
{
o2c2... | 9 |
protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... | 9 |
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.