text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean checkTables() throws SQLException, ClassNotFoundException {
sqlClass();
DatabaseMetaData dbm = sqlCon().getMetaData();
ResultSet tables;
if (forumType.equalsIgnoreCase("xenforo")) {
tables = dbm.getTables(null, null, tablePref + "user", null);
} else if (forumType.equalsIgnoreCase("smf")
... | 4 |
@Override
public void mouseClicked(MouseEvent e) {
if (_move != null) {
return;
}
Component c = _gameboard.findComponentAt(e.getX(), e.getY());
if (c instanceof PieceGUI) {
PieceGUI p = ((PieceGUI) c);
if (p.isSelected()) {
p.setSel... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FightState other = (FightState) obj;
if (!Arrays.deepEquals(atkCnt, other.atkCnt))
return false;
if (spareDamage != other.spareDa... | 6 |
@Override
public boolean execute(String code)
{
int indexValue = 0;
int pointerToAdd = 0;
String effectiveAddress = "";
String val = "";
seperateCode(code);
// Get addressing mode.
int addressMode = getAddressingMethod(code);
try {
... | 9 |
public float[][] decode() throws IOException {
while(true) {
int len = dsp.synthesis_pcmout(pcmp, idxp);
if(len > 0) {
float[][] ret = new float[chn][];
for(int i = 0; i < chn; i++) {
ret[i] = new float[len];
System.arraycopy(pcmp[0][i], idxp[i], ret[i], 0, len);
}
dsp.synthesis_read(len)... | 6 |
public static TestInstanceInfo getTestInstanceInfo(HierarchicalConfiguration testInstanceData) {
TestInstanceInfo testInstanceInfo = null;
if (testInstanceData != null) {
try {
testInstanceInfo = new TestInstanceInfo();
testInstanceInfo.setId(testInstanceData.... | 2 |
protected void initDefaultCommand() {} | 0 |
private void jComboBox_AssetContractsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_AssetContractsActionPerformed
System.out.println("In Action for Asset Combo main tab");
/*String nymID = Utility.getKey(nymMap, (String) jComboBox1.getSelectedItem());
String assetID... | 9 |
public long getT() {
return initTemps[1];
} | 0 |
public void handleCustomPayload(Packet250CustomPayload var1)
{
ModLoader.receivePacket(var1);
MessageManager inst = MessageManager.getInstance();
if (var1.channel.equals("REGISTER"))
{
try
{
String channels = new String(var1.data, "UTF8");
... | 6 |
protected void inAttrib(final char c)
{
switch(c)
{
case ' ': case '\t': case '\r': case '\n': changedTagState(State.INPOSTATTRIB); return;
case '=': changeTagState(State.BEFOREATTRIBVALUE); return;
case '<':
endEmptyAttrib(bufDex);
piece.innerStart = bufDex;
abandonTagState(State.BEFORETAG);
r... | 8 |
static final void method1430
(int i, byte i_1_, int i_2_, int i_3_, int i_4_, int i_5_, int i_6_,
int i_7_, Mob class318_sub1_sub3_sub3,
Mob class318_sub1_sub3_sub3_8_) {
try {
anInt2567++;
int i_9_ = class318_sub1_sub3_sub3.method2425(-1);
if (i_9_ != -1) {
Object object = null;
RasterToolkit ... | 7 |
private boolean checkResource(Collection list, int id)
{
boolean flag = false;
if (list == null || id < 0) {
return flag;
}
Integer obj = null;
Iterator it = list.iterator();
// a loop to find the match the resource id in a list
while ( it.hasNex... | 4 |
public void connectDb() {
startSQL();
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(url, user, password);
st = con.createStatement();
} catch (Exception e) {
e.printStackTrace();
... | 1 |
private void createErrorImage()
{
Image eImg = new Image(rfr.getW(), rfr.getH());
for(int i = 0; i < errorBlocks.size();i++)//find min and max
{
RGB[][] e = errorBlocks.get(i);
for(int y = 0; y < 16; y++)
{
for(int x = 0; x < 16; x++)
{
double err = getGrayPixel(e[x][y].getRGB());
if(... | 8 |
public void setProtected(final boolean flag) {
int modifiers = classInfo.modifiers();
if (flag) {
modifiers |= Modifiers.PROTECTED;
} else {
modifiers &= ~Modifiers.PROTECTED;
}
classInfo.setModifiers(modifiers);
this.setDirty(true);
} | 1 |
private void sleep() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new CrawlerException("main thread died. ", e);
}
} | 1 |
public ListRadio(String[] list, String selecionado)
{
setLayout(new FlowLayout(FlowLayout.LEFT));
setBorder(new EmptyBorder(-10, 0, 0, 0));
boolean primeiro = true;
for (String nome : list)
{
boolean marcado = false;
if (primeiro)
{
primeiro = false;
marcado = true;
}
if (selecionado !... | 4 |
public void openDevice(int index) { // Opens the device takes in index you
// want to use
deviceIndex = index; // Sets the index to the parameter
try { // beginning of a try catch block
sender = JpcapSender.openDevice(devices[deviceIndex]); // Opens the
// selected
//... | 1 |
@Override
public void write(String currentDVDFile, String masterDVDFile)
throws FatalBackEndException {
FileWriter cdf, mdf;
try {
cdf = new FileWriter(currentDVDFile);
} catch (IOException ex) {
throw new FatalBackEndException(ex.getMessage(),
FileType.CurrentDVD, currentDVDFile);
}
try {
... | 9 |
public boolean SetBusActiveStatus(int busNumber, int inputBufferNumber, int packetSequence, int TIME, ConfigFile cfg)
{
//REMOVE IN CROSSBAR FABRIC TYPE
//only one bus present in this fabric type,
busNumber = 0;
//ensure valid busNumber chosen
if(((busNumber+1)<= VE... | 7 |
public static void moveFile(File source, File dest){
StringBuilder debugMessage = new StringBuilder(64);
debugMessage.append("Unable to move:\n");
debugMessage.append(source.getPath());
debugMessage.append("\nto:\n");
debugMessage.append(dest.getPath());
debugMessage.app... | 8 |
public void setLowerAndUpperBounds(double lower, double upper) {
if (data == null) {
return;
}
this.originalLowerBound = lower;
this.originalUpperBound = upper;
if (originalLowerBound < min) {
offset = Math.abs(originalLowerBound) + 10;
} else {
... | 3 |
public void keyReleased(KeyEvent e){
int key = e.getKeyCode();
if (key == KeyEvent.VK_RIGHT || key == KeyEvent.VK_LEFT){
dx = 0;
}
if (key == KeyEvent.VK_UP || key == KeyEvent.VK_DOWN){
dy = 0;
}
} | 4 |
public int canAdd(CardStack src)
{
if(orderedPair(this.top(), src.chosen()))
return 1;
// If stack clicked twice on & doubleclicking set to select all
// ordered cards, select them
else if(src == this)
{ if(doubleClickSelect && nSelected < nOrdered() && nSelec... | 8 |
public void damageDetection ()
{
if (character.equals("P1"))
{
P2AttackArea getHit = (P2AttackArea)getOneIntersectingObject(P2AttackArea.class);
hurt = false;
if (getHit != null)
{
hitpoint-= getHit.damageDealt();
hurt =... | 6 |
private int computeColorDepth(int colorcount)
{
// color depth = log-base-2 of maximum number of simultaneous colors, i.e.
// bits per color-index pixel
if (colorcount <= 2)
return 1;
if (colorcount <= 4)
return 2;
if (colorcount <= 16)
return 4;
return 8; ... | 3 |
public float[] clone1df(float[] orig){
int ii = orig.length;
float[] temp = new float[ii];
for (int i = 0; i<ii; i++){
temp[i] = orig[i];
}
return temp;
} | 1 |
@Override
public void getAlleOpdrachten(OpdrachtCatalogus opdrachtCatalogus) {
try {
con = JDBCConnection.getConnection();
String query = "select opdrachten.idopdrachten, opdrachten.vraag,opdrachten.antwoord,opdrachten.maxAantalpogingen,opdrachten.antwoordHint,opdrachten.maxAntwoordTijd, opdrachtcategorieën.op... | 7 |
public String convert(String s, int nRows) {
if (s == null || s.length() == 0 || nRows <= 0) {
return "";
}
if (nRows == 1) {
return s;
}
StringBuilder res = new StringBuilder();
//every 2 column will be (2 * row - 2)
int size = 2... | 9 |
@Test
public void testTruncate_trim()
{
String s = " Already short enough, when trimmed. ";
Assert.assertEquals(
"Already short enough, when trimmed.",
_helper.truncate(s, 35)
);
} | 0 |
private DatabaseManager(ConnectionSource source){
this.source=source;
try {
TableUtils.createTableIfNotExists(source, Info.class);
QueryBuilder<Info, Integer> queryEvent=getInfoDao().queryBuilder();
queryEvent.where().eq("key", DATABASE_VERSION_KEY);
Info info=queryEvent.queryForFirst();
if(in... | 3 |
public void DeleteProjeto(Projeto projeto) throws SQLException, excecaoDeletarElemento {
Connection conexao = null;
PreparedStatement comando = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_DELETE_UM_PROJETO);
... | 6 |
public ArraysDataBase(){
arraysBase = new ArrayList<DataStructures>();
} | 0 |
public static Keyword continueForallProof(ControlFrame frame, Keyword lastmove) {
lastmove = lastmove;
{ boolean testValue000 = false;
if (frame.reversePolarityP) {
testValue000 = true;
}
else {
{
{ boolean alwaysP000 = true;
{ PatternVariable var = null... | 7 |
public void pedirAmistad(String Nick, String receptor) { //??
try {
String queryString = "INSERT INTO peticionAmistad ( emisor, receptor) VALUES(?,?)";
connection = getConnection();
ptmt = connection.prepareStatement(queryString);
ptmt.setString(1, Nick);
... | 5 |
public String getConsumerSecret() {
return consumerSecret;
} | 0 |
public void actionListener (Action e) {
switch (e.getActionType()) {
case "start":
start(white_player);
break;
case "quit":
unRegisterPlayer(curPlayer.color);
end();
break;
case "move":
ActionMove mev = (ActionMove)e;
curPlayer.put(board, mev.x, mev.y);
process();
break;
default:
... | 3 |
public EmailTest() {
bigLocal = new String("a");
for(int i = 0; i < 70; i++)
bigLocal = bigLocal.concat("a");
bigDomain = new String("c");
for(int i = 0; i < 257; i++)
bigDomain = bigDomain.concat("c");
bigDomain = bigDomain.concat(".com");
} | 2 |
public static boolean isEffective(boolean player, int moveNum) {
int move = getMove(player,moveNum);
if(move <= 0)
return false;
int atkType = curGb.getROM()[curGb.pokemon.listMovesAddress + (move-1)*curGb.pokemon.listMovesEntryLength + 3];
int defenderTypeAddress = player ? curGb.pokemon.fightEnemyMonTypes... | 8 |
public FlipTest() {
} | 0 |
public static ArrayList<Integer> getOtherServerIds() {
ArrayList<Integer> serverIds = new ArrayList<Integer>();
for (int i = 1; i <= 3; i++) {
if (i != serverId)
serverIds.add(i);
}
return serverIds;
} | 2 |
public String getMobileLab() {
return MobileLab;
} | 0 |
private void method468()
{
super.modelHeight = 0;
anInt1650 = 0;
anInt1651 = 0;
anInt1646 = 0xf423f;
anInt1647 = 0xfff0bdc1;
anInt1648 = 0xfffe7961;
anInt1649 = 0x1869f;
for(int j = 0; j < anInt1626; j++)
{
int k = anIntArray1627[j];
int l = anIntArray1628[j];
int i1 = anIntArray1629[j];
... | 8 |
@Override
public void paint(Graphics2D g2d) {
//lo pintamos como sólido
super.paint(g2d);
try{
if(!disparos.isEmpty())//pintamos sus disparos si los hubiera
for(Disparo d: disparos) d.paint(g2d);
}catch(java.util.ConcurrentModificationExcepti... | 3 |
@Override
public void restoreHealth(int healing) {
if (this.curHP + healing >= this.maxHP) {
this.curHP = this.maxHP;
} else {
this.curHP += healing;
}
} | 1 |
public void notePhrase(String s, int id_phrase) throws SQLException {
Phrase comm;
comm = new Phrase(s);
Statement lanceRequete;
lanceRequete = connG.conn.createStatement();
ResultSet requete;
ArrayList<String> liste;
liste = new ArrayList<>();
liste = ext... | 7 |
protected void getCloseCreatures() {
Thread creatureRadarThread = new Thread(new Runnable() {
@Override
public void run() {
try {// wait until the plants align properly
Thread.sleep(80);
} catch (InterruptedException e) {
e.printStackTrace();
}
// True if this creature is alive
... | 9 |
public static AddItemDialog create(final Class type, final Object instance) {
final AddItemDialog dialog = new AddItemDialog();
for (final Method m : type.getMethods()) {
if (m.getName().startsWith("set")
&& (m.getParameterTypes().length == 1)) {
final String name = m.getName().substring(3);
Metho... | 8 |
private void register(List<String> watchedFiles) throws IOException
{
for(String watchedFile : watchedFiles)
{
String watchedDir = new File(watchedFile).getParentFile().getAbsolutePath();
Path dir = Paths.get(watchedDir);
// we are not watching for cr... | 1 |
private HashFamily getHashFamily(double radius,String hashFamilyType,int dimensions){
HashFamily family = null;
if(hashFamilyType.equalsIgnoreCase("cos")){
family = new CosineHashFamily(dimensions);
}else if(hashFamilyType.equalsIgnoreCase("l1")){
int w = (int) (10 * radius);
w = w == 0 ? 1 : w;
famil... | 5 |
static public Integer getZipFromString(String zipStr) {
Integer retVal = null;
try {
retVal = getIntegerFromSubString(zipStr, "-");
if (retVal == null) {
retVal = getIntegerFromString(zipStr);
}
} catch (Exception e) {
retVal = null... | 2 |
public void queueSound(FilenameURL filenameURL) {
if (!toStream) {
errorMessage("Method 'queueSound' may only be used for "
+ "streaming and MIDI sources.");
return;
}
if (filenameURL == null) {
errorMessage("File not specified in method 'queueSound'");
return;
}
synchronized (soundSequenceL... | 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... | 7 |
@Override
public boolean canAttack(Board board, Field currentField, Field occupiedField) {
return this.validSetupForAttack(currentField, occupiedField) && occupiedField.areAdjacentTo(currentField);
} | 1 |
public SolarSystemLoc(Ticker ticker) {
super(ticker);
initializationLevel();
} | 0 |
public List<EventBranch> getEventBranchList() {
return eventBranchList;
} | 0 |
public void setCueNaturaleza(String cueNaturaleza) {
this.cueNaturaleza = cueNaturaleza;
} | 0 |
public Point getPosn(ArrayList<Point> lst) {
Point result = this.from;
for (Point p : lst) {
if (p.x == this.from.x && p.y == this.from.y) {
result = this.to;
}
}
return result;
} | 3 |
public void addBook() {
// User inputs: isbn, title, mainAuthors, otherAuthors,
// publisher, year, subjects
JTextField isbnField = new JTextField(15);
JTextField titleField = new JTextField(20);
JTextField mainAuthorField = new JTextField(20);
JTextField otherAuthorsField = new JTextField(90);
JTextFiel... | 7 |
@RequestMapping(value = "/store/employee/skills", method = RequestMethod.POST)
public String insertEmployeeSkillRatings(@RequestBody UserSkillSet userSkillSet ) {
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode objectNode = objectMapper.createObjectNode();
employeeDao.insertSkillSet(userSkillSet);
o... | 0 |
public int execute() {
// Build info
/*String[] commands = YuccaCommandFactory.getImplementedCommands();
StringBuffer b = new StringBuffer( "Available commands: " );
for( int i = 0; i < commands.length; i++ ) {
if( i > 0 )
b.append( ", " );
b.append( commands[i] );
}
System.out.println( b.toS... | 3 |
public Iterator<Point2D> getPoints( final float start, final float end, final int nPoints ) {
if( nPoints == 1 ) {
return new Iterator<Point2D>() {
private boolean hasNext = true;
@Override
public boolean hasNext() {
return hasNext;
}
@Override
public Point2D next() {
hasNext = ... | 1 |
@Override
public void paint(Graphics g){
this.requestFocus();
Graphics2D tileGraphics = (Graphics2D) g;
for (int row = 0; row < Map.ARRAYSIZE; row++) {
for (int col = 0; col < Map.ARRAYSIZE; col++) {
tileGraphics.setColor(Color.BLACK);
tileGraphics.fill... | 4 |
protected boolean in_grouping_b(char [] s, int min, int max)
{
if (cursor <= limit_backward) return false;
char ch = current.charAt(cursor - 1);
if (ch > max || ch < min) return false;
ch -= min;
if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return false;
cursor--;
return true;
} | 4 |
public boolean containsValidCustomerDetails() {
return isValidForename()
&& isValidSurname()
&& isValidHouseNum()
&& isValidStreet()
&& isValidPostcode()
&& isValidEmail()
&& isValidCardNum()
&& isValidPassword()
&& isMatchForPassword();
} | 8 |
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
if (ovalColorGB != null && ovalColorGB.getBgColor1() != null)
gc.setBackground(ovalColorGB.getBgColor1());
gc.setAntialias(aliasValues[aliasCombo.getSelectionIndex()]);
Path path =... | 4 |
public void correct() {
System.out.println("correct method");
} | 0 |
public boolean checkBookValues(String isbn, String title, String author){
boolean resultCheck = false;
if(isbn.length() <= Model.getInstance().getBookIsbnSize() &&
title.length() <= Model.getInstance().getBookTitleSize() &&
author.length() <= Model.getInstance().getBookAu... | 8 |
private static boolean isStalemateSituation(BotState state) {
boolean isStalemateSituation = true;
int ownIncome = state.getStartingArmies();
int opponentIncome = HeuristicMapModel.getGuessedOpponentIncome();
// No stalemate situation without seeing the opponent
if (state.getVisibleMap().getEnemyRegions(state... | 6 |
public void calibrate() {
double minValue = minData;
double maxValue = maxData;
if (minAxisFlag== AT_ZERO) {
minValue = 0;
} else if (minAxisFlag == AT_VALUE) {
minValue = this.minValue;
}
if (maxAxisFlag== AT_ZERO) {
maxValue = 0;
... | 9 |
private int affecteNumCourt(String terrain) {
if (terrain.equals("Court central")) return 1;
else if (terrain.equals("Court annexe")) return 2;
else if (terrain.equals("Court d'entrainement 1")) return 3;
else if (terrain.equals("Court d'entrainement 2")) return 4;
else if (terra... | 5 |
public void updatePosition() {
//System.out.println(xPos + " " + yPos);
//System.out.println(xDestination + " yolo " + yDestination);
if (xPos < xDestination)
xPos+=2;
else if (xPos > xDestination)
xPos-=2;
if (yPos < yDestination)
yPos+=2;
... | 9 |
private void buildQuestionPanelP2() {
pnlNewQ2 = new JPanel();
pnlNewQ2.setLayout(new BoxLayout(pnlNewQ2, BoxLayout.X_AXIS));
pnlQTypeSwap = new JPanel();
cardQType = new CardLayout();
pnlQTypeSwap.setLayout(cardQType);
/* Multiple choice: */
ButtonGroup bg = new ButtonGroup();
rbAnsList = new ... | 2 |
public void paintIcon(Component c, Graphics g, int x, int y) {
Color color = c == null ? Color.GRAY : c.getBackground();
// In a compound sort, make each succesive triangle 20%
// smaller than the previous one.
int dx = (int)(size/2*Math.pow(0.8, priority))... | 5 |
public void movePegs() {
x.centerX = centerX - Peg.width;
z.centerX = centerX + Peg.width;
y.centerX = centerX;
x.centerY = centerY;
z.centerY = centerY;
y.centerY = centerY + Peg.height;
} | 0 |
public Token read() throws IOException {
try {
while (reader.ready()) {
int c = reader.read();
if (Character.isWhitespace(c)) {
whitespaceReader.readValue(reader, c);
} else if (Character.isLetter(c)) {
return identifierReader.getToken(reader, c);
} else if (Character.isDigit(c))... | 6 |
public void setCellState(int x, int y, boolean alive)
{
if (x > 0 && x < width && y > 0 && y < height)
grid[y][x] = alive;
} | 4 |
private void handleEvents(byte[] resp) {
if(resp == null || resp.length == 0) {
return;
}
RS232Packet respPacket = socket.parseResponse(resp);
creditAction = respPacket.getCreditAction();
rawFirmwareRevision = respPacket.getFirmwareRevision();
rawAcceptorMo... | 5 |
public boolean simpleIsConcurrent(String pathExpression1, String pathExpression2, String operator1, String operator2, String type1, String type2){
if (pathExpression1.equals(pathExpression2)){
if (type1.equals(type2)){
return mutuallyExclusive(operator1, operator2, type1, type2);
} else {
System.err.pri... | 2 |
private void buildQueryMapSet(Triple buildQuery){
Node subject = buildQuery.getSubject();
Node object = buildQuery.getObject();
Predicate predicate = buildQuery.getPredicate();
//Possible permutations of the query
String Q1 = "?"+" "+predicate.getIdentifier()+" "+object.getIdentifier();
String Q2 = su... | 8 |
private void Build()
{
greenPlants = ps.getGreenPlants();
plasticWrap = ps.getPlasticWrap();
roundRocks = ps.getRoundRocks();
energy = ps.getEnergy();
Dialog.message("I can build a solar still to collect");
Dialog.message("water over time for me to consume.\n", 2000... | 7 |
public void show() {
if (getMessage() == null)
setMessage(DEFAULT_MESSAGE);
super.show();
} | 1 |
public static void changeToParent(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node newSelectedNode = textArea.node.getParent();
if (newSelectedNode.isRoot()) {
return;
}
tree.setSelectedNodesParent(newSelectedNode.getParent());
tree.addNodeToSelection(newSelectedNode)... | 1 |
public void createTables() {
// Table PLAYER
if (!_sqLite.isTable("player")) {
try {
_sqLite.query("CREATE TABLE player("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "playername TEXT UNIQUE COLLATE NOCASE);");
} catch (Exception e) {
// TODO
}
}
// Table LOGIN
if (!_sqLit... | 4 |
public void addOperator(BinaryOperator operator) {
if (!functionContextStack.isEmpty()) {
Integer sizeOperators = functionContextStack.peek().getSizeOperatorsForParameters();
if (sizeOperators != null) {
while (!operatorStack.isEmpty() &&
sizeOper... | 7 |
public static ArrayList doit(ExtendedIterator<? extends OntResource> it, VelocityContext context) {
/* create our list of maps */
ArrayList list = new ArrayList();
for (OntResource r = null; it.hasNext(); ) {
r = it.next();
if (r.isAnon()) {
continue;
... | 3 |
private void renderGrid(Graphics g) {
Coordinate worldSize = wb.getSize();
g.setColor(Color.red);
for (int i = 1; i <= worldSize.x; i++) {
Coordinate c1 = coordinateToPixel(i, 0);
Coordinate c2 = coordinateToPixel(i, worldSize.y);
g.drawLine(c1.x, c1.y - blockHeight / 2, c2.x, c2.y);
}
for (int i =... | 2 |
public static boolean correctOrder(String str){
//base case-if there are only 2 chars and the first and last are in correct order-true
if(str.length()==3 && (str.charAt(0)>str.charAt(2))){
return true;
}
//if the string is less than 3 chars long it returns true as impossible ... | 5 |
private static void countWords(String file,String count, String struct) {
DataCounter<String> counter = null;
// divide into several situations and create different structures
if(count.equals("-b"))
counter= new BinarySearchTree<String>(new StringComparator());
else if(count.equals("-m"))
... | 8 |
public boolean search(int val) {
DLNode current = head;
if (this.head == null) {
return false;
}
while (current != null) {
if (val == current.getVal()) {
return true;
} else if (current.getVal() == Integer.MIN_VALUE) {
if (current.getList().search(val) == true) {
return true;
}
... | 5 |
private void construct(Constraint[] constraints, int nconstraints) {
this.constraints=constraints;
this.nconstraints=nconstraints;
VERBOSE=CSPStrategy.VERBOSE;
variables=null;
nodes = new ConstraintList[nconstraints*2];
nvariables=0;
min=0;
max=0;
bestProbe=null;
// tally variables and count maximum mines... | 9 |
private ArrayList<Boolean> getRowByLeftState(String state, String topOrBottom) {
ArrayList<Boolean> fullRow = new ArrayList<Boolean>();
if (topOrBottom.equals("top")) {
int index = topOfTableRow.indexOf(state);
if (index == -1 ) return fullRow;
fullRow = topTable.get(index);
... | 4 |
public static void main(String[] args) {
System.out.println("Start");
InputStreamReader input = new InputStreamReader(System.in);
processor = new ValueFrequencyProcessor();
while (runing) {
int value = 0;
try {
value = input.read();
} c... | 4 |
private void setToflagOthers(myDataList mylist) {
for (int i = 0; i < mylist.size() - 1; i++) {
((data) mylist.get(i)).setFlag(false);
}
} | 1 |
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
// TODO add your handling code here:
int chose = this.jComboBox1.getSelectedIndex();
if(chose==0) this.setParams(null, null, null,0,1,false);
if(chose==3) this.setParams(... | 9 |
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile... | 9 |
public static final void showCourses(DARSInfo.CLASS... classes) {
for (DARSInfo.CLASS curClass : classes) {
System.out.println(curClass.Subject + " " + curClass.Number);
}
Vector<CourseInfo> allCourse = CoursesFile.loadAllCourses();
for (CourseInfo course : allCourse) {
for (DARSInfo.CLASS curCl... | 7 |
public boolean cast (Sorcerer sorcerer, Trigger trigger, Event event)
{
if (isOnCooldown(sorcerer))
return false;
cooldowns.put(sorcerer, System.currentTimeMillis() + 1000);
if (trigger.isInteractTriggered())
{
PlayerInteractEvent interactEvent = (PlayerInte... | 5 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Unidade)) {
return false;
}
Unidade other = (Unidade) object;
if ((this.codigo == null && other.codigo != null)... | 5 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.