text stringlengths 14 410k | label int32 0 9 |
|---|---|
final public void forceSubtreeValid() {
if(children==null)
return;
for(PropertyTree child : children) {
child.forceSubtreeValid();
}
} | 2 |
public static Company [] findAllCompanyData() {
Company [] companydata;
String read;
ArrayList<String> companyData = new ArrayList<String>();
try {
BufferedReader reader = new BufferedReader(new FileReader("company.txt"));
while((read = reader.readLine()) != null) {
companyData.add(read);
}... | 3 |
@Override
public void valueChanged(ListSelectionEvent arg0) {
int select = table.getSelectedRow();
if (select != -1) {
Item item = null;
String title = (String) table.getValueAt(select, 0);
String author = (String) table.getValueAt(select, 1);
String genre = (String) table.getValueAt(select,... | 5 |
public Integer increment(K key){
if (map.containsKey(key)){
map.put(key, map.get(key)+1);
}
else {
map.put(key, 1);
}
return map.get(key);
} | 1 |
public void setCity(String city) {
City = city;
} | 0 |
private void collisionCheck() {
if ( (ballY <= 0) || (ballY >= frameHeight - size - 22) )
ballSpeedY *= -1;//reverses y direction when the ball hits the sides
if (ballX < width) {
if ((new Rectangle(p1x, (int) p1y, width, height).contains(new Point((int)ballX, (int) ballY + (... | 6 |
public Date getEnd() {
return end;
} | 0 |
public List<T> create(int nElements){
List<T> result = new ArrayList<T>();
try {
for(int i=0;i < nElements;i ++){
result.add(type.newInstance());
}
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return result;
} | 3 |
public FileStream(RandomAccessFile source) throws OggFormatException, IOException {
this.source = source;
ArrayList<Long> po = new ArrayList<>();
int pageNumber = 0;
try {
while (true) {
po.add(this.source.getFilePointer());
// skip data if p... | 8 |
private void btn_proximoDadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_proximoDadosActionPerformed
try {
if (txt_operacao.getText().equals("INCLUSÃO") == true) {
if (cbx_segmento.getSelectedItem() == null) {
JOptionPane.showMessageDial... | 6 |
public List<RoomEvent> findRoomEventsByHallEventIdForTimeInterval(
final Long hallEventId, final Long start, final Long end
) {
return new ArrayList<RoomEvent>();
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CappedValue)) {
return false;
}
CappedValue other = (CappedValue) obj;
if (max == null) {
if (other.max != null) {
return false;
}
} else if (!max... | 9 |
public boolean updateHotkeyBinding(String key, HotkeyEntry entry) {
if (!this.fileLoaded) {
return false;
}
try {
XMLNode hotkeysNode = this.rootNode.getChildNodesByType("hotkeys")[0];
XMLNode[] hotkeyNodes = hotkeysNode.getChildNodesByType("hotkey");
... | 5 |
protected void typeTableGen(){
for(String key: dataTable.keySet()){
/*This http transanction happens more than once*/
String typeType = dataTable.get(key).returnType();
// System.out.println("Pcik out record with type of: "+typeType);
int typeCount = dataTable.get(key).returnCount();
int typeSize... | 4 |
@Override
public void simpleInitApp() {
try {
initLogging();
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} catch (SecurityException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.get... | 6 |
@Test
public void checkRandomness()
{
List<Integer> sides = Arrays.asList(1,2,3,4,5,6);
int[] counts = new int[sides.size()];
Dice<Integer> dice = new Dice<Integer>(sides);
for ( int i = 0; i < NUMBER_OF_THROWS; i++)
{
counts[dice.roll() - 1]++;
}
final int averageNumberExpected = NUMBER_OF_THROWS... | 2 |
@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 TaxonNameStatus)) {
return false;
}
TaxonNameStatus other = (TaxonNameStatus) object;
if ((this.key == null && ... | 5 |
final public void conclusion() throws ParseException {
Token conclusionType;
Literal literal;
if (jj_2_70(7)) {
conclusionType = jj_consume_token(DEFINITE_PROVABLE);
} else if (jj_2_71(7)) {
conclusionType = jj_consume_token(DEFINITE_NOT_PROVABLE);
} else if (jj_2_72(7)) {
conclusionType... | 7 |
public BlueprintList() {
BPO = new ArrayList<Blueprint>();
} | 0 |
public GrammarChecker() {
} | 0 |
public boolean getConcurrent(){
return this.concurrent;
} | 0 |
public Class<? extends APacket> getPacketClassByID(int id) {
return PList.get(id);
} | 1 |
@Override
public void validate(Object obj, Errors e) {
Image image = (Image) obj;
if (image.getFile() == null) {
e.rejectValue("file", "error.nothing.to.upload");
return;
}
String mime = image
.getFile()
.getContentType()
.substring(image.getFile().getContentType().indexOf("/") + 1, image.get... | 4 |
public static byte[] getExcelEncoding( String s )
{
byte[] strbytes = null;
try
{
strbytes = s.getBytes( "UnicodeLittleUnmarked" );
}
catch( UnsupportedEncodingException e )
{
log.warn( "Error creating encoded string: " + e, e );
}
boolean unicode = false;
for( int i = 0; i < strbytes.length; i... | 4 |
public void block(MatchData data)
{
numCorrectPairs = countCorrectPairs(data);
pairList = new ArrayList();
for (int i=0; i<data.numSources(); i++) {
int lo1 = clusterMode? i : i+1;
for (int j=lo1; j<data.numSources(); j++) {
String src1 = data.getSource(i);
String src2 = data.getSource(j);
f... | 7 |
public void check() {
try {
status = a.isReachable(600);
} catch (IOException e) {
e.printStackTrace();
}
} | 1 |
public static String reverse(String input) {
if (input == null || input.isEmpty()) {
return input;
}
String reverse = "";
String word = "";
String output = "";
for (int i = input.length() - 1; i >= 0; i--) {
reverse = reverse + input.charAt(i);
}
for (int j = 0; j < reverse.length(); j++) {
if ... | 6 |
private void doFirmwareUpload() throws FirmwareFlashException {
int exitCode;
try {
ProcessBuilder pb = new ProcessBuilder();
// this would be where you'd switch based on OS to run the appropriate
// firmware upload command.
Vector<String> commandLine = new Vector<String>();
if (os == OS.WINDOWS) {
/... | 5 |
public ArrayList<Yhdistelma> mahdollisetYhdistelmat(){
Yhdistelma y = new Yhdistelma(kasi);
ArrayList<Yhdistelma> yhdistelmat = y.getYhdistelmat(); // Kaikki kädestä saatavat yhdistelmät
ArrayList<Yhdistelma> toReturn = new ArrayList<Yhdistelma>(); // Palautettavat yhdistelmät
for(int i=0; i<yhdistelmat.size();... | 2 |
public static void main(String[] args)
{
Comparator<fringeObject> comparator = new fringeObjectComparator();
PriorityQueue<fringeObject> queue =
new PriorityQueue<fringeObject>(10, comparator);
queue.add(new fringeObject(null, null, 121, 22222222));
queue.add(new fringeO... | 1 |
public static void main(String[] args) {
CommandLine cmd;
if (args.length == 6) {
cmd = doCommandLineParsing(args);
} else {
fromUI();
return;
}
/*
* Fügen Sie hier Anweisungen zum Einlesen einer PNG-Datei gemäß der
* Hinweise auf dem Übungblat... | 4 |
public void setFovY(float fovY) {
Radar.fovY = fovY;
} | 0 |
private void method46(int i, Stream stream)
{
while(stream.bitPosition + 21 < i * 8)
{
int k = stream.readBits(14);
if(k == 16383)
break;
if(npcArray[k] == null)
npcArray[k] = new NPC();
NPC npc = npcArray[k];
npcIndices[npcCount++] = k;
npc.anInt1537 = loopCycle;
int l = stream.readBi... | 6 |
public void process() {
if (action != null) {
if (player.isDead()) {
forceStop();
} else if (!action.process(player)) {
forceStop();
}
}
if (actionDelay > 0) {
actionDelay--;
return;
}
if (action == null)
return;
int delay = action.processWithDelay(player);
if (delay == -1) {
... | 6 |
static String seq_name(int[] code, int max)
{
int j;
String buffer="";
StringBuilder dest = new StringBuilder();
for(j=0;j<SEQ_MAX;++j)
{
String name;
if ((code)[j] ==CODE_NONE)
break;
if (j != 0 && 1 + 1 <= max)
{
dest.append(' ');//*dest ... | 8 |
public Collection<Column> getHiddenColumns() {
ArrayList<Column> list = new ArrayList<>();
for (Column column : mColumns) {
if (!column.isVisible()) {
list.add(column);
}
}
return list;
} | 2 |
public static void main(String[] args) {
PriorityQueue<Integer> priorityQueue = new PriorityQueue<Integer>();
Random rand = new Random(47);
for (int i = 0; i < 10; i++)
priorityQueue.offer(rand.nextInt(i + 10));
QueueDemo.printQ(priorityQueue);
List<Integer> ints = Arrays.asList(25, 22, 20, 18, 14, 9, 3,... | 2 |
public String getTelefono() {
return telefono;
} | 0 |
private synchronized void albumsTableValueChanged(javax.swing.event.ListSelectionEvent evt) {
Logger.getLogger(MainInterface.class.getName()).entering(MainInterface.class.getName(), "albumsTableValueChanged");
album = null;
if (booksDirectory == null) {
return;
}
int ... | 5 |
public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String requestUsername = request.getParameter("username");
String requestPassword = request.getParameter("password");
Map <String, Object> pageVariables = new HashMap<>();
... | 8 |
private int buildJump(int xo, int maxLength)
{ gaps++;
//jl: jump length
//js: the number of blocks that are available at either side for free
int js = random.nextInt(4) + 2;
int jl = random.nextInt(2) + 2;
int length = js * 2 + jl;
boolean hasStairs = random.nextIn... | 9 |
private void processQueue() {
SoftValueRef ref;
while ((ref = (SoftValueRef)queue.poll()) != null) {
if (ref == (SoftValueRef)hash.get(ref.key)) {
// only remove if it is the *exact* same WeakValueRef
//
hash.remove(ref.key);
}
... | 2 |
private void muoviBianca (boolean turno) { // cerca possibili mosse bianche (movimenti e mangiate)
// try catch usati per evitare i controlli sulle celle (superamento estremi damiera)
boolean occupata = false; // cella vicina è occupata da una pedina
try{
if(damiera.getC... | 5 |
@Override
public File createFile(final HTTPRequest request, String filePath)
{
final Pair<String,String> mountPath=config.getMount(request.getHost(),request.getClientPort(),filePath);
if(mountPath != null)
{
String newFullPath=filePath.substring(mountPath.first.length());
if(newFullPath.startsWith("/")&&m... | 8 |
public String getCountry() {
return country.get();
} | 0 |
private static void UnZip(String ZipName,long fileSize, ProgressBar progressCurr,ProgressBar progressBarTotal) throws PrivilegedActionException
{
String szZipFilePath;
String szExtractPath;
String path = (String)AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public O... | 8 |
private CalcState testPoints(CalcState state, Point p2, Point p3) {
double bestDist = state.bestDist;
Triangle bestTriangle = null;
int[] rgba = new int[4];
for (int r = 0; r <= conf.colorSteps; r++) {
rgba[0] = expandColor(r);
for (int g = 0; g <= conf.colorSteps... | 5 |
public List<Contestant> getActiveContestants(boolean active) {
List<Contestant> list = new ArrayList<Contestant>(
allContestants.size());
for (Contestant c : allContestants) {
if (c != null) {
if (active && !c.isCastOff()) {
list.add(c);
} else if (!active && c.isCastOff()) {
list.add(c);... | 6 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
public int map_pf_move(Coord real_coord) {
if (path != null) {
path.clear();
path_moving = false;
path_step = 0;
path_interact_object = null;
}
path = APXUtils._pf_find_path(real_coord, 0);
update_pf_moving();
return path == null ? -1 : path.size();
} | 2 |
public static FileOutputStream createOutputStream(File file) throws IOException {
if (file.exists()) {
if (file.isDirectory()) {
throw new IOException("File '" + file + "' exists but is a directory");
}
if (!file.canWrite()) {
throw new IOExcep... | 6 |
@Basic
@Column(name = "supplier_id")
public Integer getSupplierId() {
return supplierId;
} | 0 |
private void setStartPoint( Calendar t, int unit, long exactStart )
{
t.setTimeInMillis( exactStart );
t.setFirstDayOfWeek( firstDayOfWeek );
for (int i = 0; i < HOUR && i <= unit; i++)
t.set( calendarUnit[i], 0 );
if ( unit >= HOUR )
t.set( Calendar.HOUR_OF_DAY, 0 );
if ( unit == WEEK )
t.... | 6 |
public void printPatients() {
System.out.println("Patient: " + name + ", age: " + age + ", illness: " + illness);
if (nextPatient != null) {
nextPatient.printPatients();
}
} | 1 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the... | 9 |
public void makeDeclaration(Set done) {
super.makeDeclaration(done);
if (subBlocks[0] instanceof InstructionBlock)
/*
* An instruction block may declare a variable for us.
*/
((InstructionBlock) subBlocks[0]).checkDeclaration(this.declare);
} | 1 |
private static void test_toggle(TestCase t) {
// Print the name of the function to the log
pw.printf("\nTesting %s:\n", t.name);
// Run each test for this test case
int score = 0;
for (int i = 0; i < t.tests.length; i += 3) {
int bits = (Integer) t.tests[i];
int exp = (Integer) t.tests[i + 1];
int ... | 3 |
public void deposit(BigInteger amount) throws IllegalArgumentException {
if ( (amount == null) || (amount.compareTo(BigInteger.ZERO) < 0) )
throw new IllegalArgumentException();
setBalance(this.getBalance().add(amount));
} | 2 |
public boolean unload100OldestChunks()
{
int var1;
for (var1 = 0; var1 < 100; ++var1)
{
if (!this.droppedChunksSet.isEmpty())
{
Long var2 = (Long)this.droppedChunksSet.iterator().next();
Chunk var3 = (Chunk)this.chunkMap.getValueByKey(... | 6 |
@SuppressWarnings("unchecked") // FIXME in Java7
public BuildQueuePanel(FreeColClient freeColClient, GUI gui, Colony colony) {
super(freeColClient, gui, new MigLayout("wrap 3", "[260:][390:, fill][260:]", "[][][300:400:][]"));
this.colony = colony;
this.unitCount = colony.getUnitCount();
... | 8 |
public long toLong() {
switch (this) {
case _0:
return 0L;
case _1:
return 1L;
case _2:
return 2L;
case _3:
return 3L;
case _4:
return 4L;
case _5:
return 5L;
case _6:
return 6L;
case _7:
return 7L;
... | 9 |
private void initCloseCode() throws InvalidFrameException {
code = CloseFrame.NOCODE;
ByteBuffer payload = super.getPayloadData();
payload.mark();
if( payload.remaining() >= 2 ) {
ByteBuffer bb = ByteBuffer.allocate( 4 );
bb.position( 2 );
bb.putShort( payload.getShort() );
bb.position( 0 );
code... | 7 |
@Override
public void registerTrigger(ITrigger<?> trigger) {
if (!wrapper.triggers.contains(trigger))
wrapper.triggers.add(trigger);
} | 2 |
public ImageList getImages(String asImageType, boolean abEncodedData, int aiMaxSize,
String asLastModified) {
Map<String, String> lhtParameters = new HashMap<String, String>();
if (UtilityMethods.isValidString(asLastModified)) {
lhtParameters.put(PARAM_LAST_MOD... | 4 |
public static ArrayList<String> getAllXlsFilesFromFolder(String path) {
ArrayList<String> filesList = new ArrayList<String>();
String files;
File folder = null;
try{
folder = new File(path);
}catch(Exception e){
e.printStackTrace();
}
if(folder.listFiles() != null){
File[] listOfFiles = folder... | 5 |
@EventHandler
public void SnowmanNightVision(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getsnowgolemConfig().getDouble("Snowma... | 6 |
public String getString(String key) throws JSONException {
Object object = this.get(key);
if (object instanceof String) {
return (String) object;
}
throw new JSONException("JSONObject[" + quote(key) + "] not a string.");
} | 1 |
public static Vektor3D determineSpeedVW(Sprite sp)
{
Vektor3D vekt = new Vektor3D();
if(sp.getDirection() == Consts.NORTH)
{
vekt.setX(sp.getSpeedInitWalk()/Math.sqrt(2));
vekt.setY(sp.getSpeedInitWalk()/Math.sqrt(2));
}
else if(sp.getDirection() == Co... | 8 |
public ArrayList<ArrayList<String>> translate(ArrayList<ArrayList<String>> sentenceBundle) {
ArrayList<String> charIdentifier = sentenceBundle.get(1);
for (int i = 0; i < charIdentifier.size(); i++) {
for (int j = 0; j < key.length; j++) {
if (charIdentifier.get(i).equals(ke... | 3 |
public void close() {
try {
if( m_ClientOutput != null ) {
m_ClientOutput.flush();
m_ClientOutput.close();
}
}
catch( IOException e ) {
}
try {
if( m_ServerOutput != null ) {
m_ServerOutput.flush();
m_ServerOutput.close();
}
}
catch( IOException e ) {
}
try {
if( m_C... | 8 |
public double computeSimilarity(int user1, int user2) {
double sim = 0;
// generate arrays containing ratings from users which rated both movies
List<Integer> sharedMovies = findSharedMovies(user1, user2);
if (sharedMovies.isEmpty()) {
return sim;
}
Double[] userOneRatings = new Double[sharedMovies.si... | 4 |
public static DataPersister lookupForField(Field field) {
// see if the any of the registered persisters are valid first
if (registeredPersisters != null) {
for (DataPersister persister : registeredPersisters) {
if (persister.isValidForField(field)) {
return persister;
}
// check the classes in... | 8 |
public List<EncryptionPropertyType> getEncryptionProperty() {
if (encryptionProperty == null) {
encryptionProperty = new ArrayList<EncryptionPropertyType>();
}
return this.encryptionProperty;
} | 1 |
public PropertiesWindow(Shell parent) {
shell = new Shell(parent, SWT.BORDER | SWT.TITLE);
shell.setFont(Main.appFont);
shell.setSize(186, 235);
shell.setLocation(parent.getLocation().x + 100, parent.getLocation().y + 100);
shell.setLayout(new GridLayout(2, false));
lblRoomId = new Label(shell, SWT.NONE)... | 9 |
private static boolean b1(int i, int j, BufferedImage image) {
Boolean above = ((image.getRGB(i-1, j+1) == BLACK) ||
(image.getRGB(i , j+1) == BLACK) ||
(image.getRGB(i+1, j+1) == BLACK));
Boolean with = ((image.getRGB(i-1, j-1) == WHITE) &&
... | 6 |
public static boolean authenticateManager(String inName, String inPassword) {
Connection c = null;
Statement stmt = null;
boolean authenticated = false;
try {
Class.forName("org.sqlite.JDBC");
c = DriverManager.getConnection("jdbc:sqlite:Restuarant.db");
c.setAutoCommit(false);
System.out.println("O... | 5 |
public static boolean validID(int ID) {
BufferedReader reader;
try {
reader = new BufferedReader(new FileReader(System.getProperty("resources") + "/database/spells"));
String line;
while((line = reader.readLine()) != null) {
String[] temp = line.split(";");
if(Integer.parseI... | 4 |
private void merge(int[] array, int startIndex, int splitIndex, int endIndex){
int[] tmpArray = new int[endIndex - startIndex + 1]; //new temporary array for storing merged elements
int tmpIndex = 0; //index to iterate over temporary array
int i=startIndex, j=splitIndex+1;
while(i<=splitIndex... | 7 |
public static void main(String[] args) throws IOException {
Scanner seuss;
// Step 0:
// seuss = new Scanner(CLASSIC).useDelimiter("[^A-Za-z]+");
// System.out.println(findUniqueWords(seuss).size()); // how many words did Dr Seuss use?
// seuss.close();
// Step 1:
// seuss = new Scanner(CLASSIC).useDe... | 5 |
public void SetFirstTicks(int firstTicks)
{
//set the tick time the person got to the stop for the bus
this.firstTicks = firstTicks;
} | 0 |
private void addProgram(String text, int type)
{
int shader = glCreateShader(type);
if(shader == 0)
{
System.err.println("Shader creation failed: Could not find valid memory location when adding shader");
System.exit(1);
}
glShaderSource(shader, text);
glCompileShader(shader);
if(glGetShad... | 2 |
public static void makeCompactGrid(Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout) parent.getLayout();
} catch (ClassCastException exc) {
System.err.println("The first argument to makeCompactGrid must use SpringLayout... | 7 |
@Override
protected void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g.create();
g2d.setColor(backgroundColor);
g2d.fillRect(0, 0, this.getBounds().width + 1, this.getBounds().height + 1);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, Renderin... | 4 |
private Object decodeAMF0() throws NotImplementedException, EncodingException
{
int type = readByte();
switch (type)
{
case 0x00:
return readIntAMF0();
case 0x02:
return readStringAMF0();
case 0x03:
return readObjectAMF0();
case 0x05:
return null;
case 0x11: // AMF3
return decode();
... | 5 |
@SuppressWarnings("unchecked")
@Override
public void validate(ProcessingEnvironment procEnv,
RoundEnvironment roundEnv, TypeElement annotationType,
AnnotationMirror annotation, Element e) {
AnnotationMirror steretypeAnnotation = AnnotationProcessingUtils
.findAnnotationMirror(procEnv, e,
"javax.ente... | 4 |
private static String stackToString(Throwable exception) {
String result = "";
if (exception.getMessage() == null) result = exception.toString();
else result = exception.getMessage() + ": ";
if (exception.getStackTrace() == null) result = result + " <== stacktrace is null";
else {
StackTr... | 3 |
private void fetchSubscribedCategoryList(HttpSession session) {
StudentBean bean = (StudentBean)session.getAttribute("person");
StudentDao dao=new StudentDao();
HashMap<String, Boolean> categoryMap = new HashMap<String, Boolean>();
List<String> nonSubscribed = dao.fetchCategories(bean.getUserid(), "NotSubscribe... | 2 |
@Test
public void testBubbleSort(){
bubbleSort.load(array,null,null);
bubbleSort.run();
assertArrayEquals(array, arrayActuals);
} | 0 |
public synchronized void start() {
if (running)
return;
running = true;
game = new Thread(this, "game");
game.start();
} | 1 |
public String getOpenFileFormatNameForExtension(String extension) {
String lowerCaseExtension = extension.toLowerCase();
for (int i = 0, limit = openers.size(); i < limit; i++) {
OpenFileFormat format = (OpenFileFormat) openers.get(i);
if (format.extensionExists(lowerCaseExtension)) {
return (String) open... | 2 |
@Override
public int compareTo(Object o) {
int row1 = modelIndex;
int row2 = ((Row) o).modelIndex;
for (Directive directive : sortingColumns) {
int column = directive.column;
Object o1 = tableModel.getValueAt(row1, column);
Obje... | 7 |
DefaultMutableTreeNode addNodes(DefaultMutableTreeNode curTop, File dir)
{
String curPath = dir.getPath();
DefaultMutableTreeNode curDir = new DefaultMutableTreeNode(curPath);
if (curTop != null)
{ // should only be null at root
curTop.add(curDir);
}
Vector ol = new Vector();
String[] tmp = dir.list... | 6 |
public static List<Kurssi> getKurssit() {
Connection c = connect();
if (c == null) return null;
try {
List<Kurssi> kurssit = new ArrayList<Kurssi>();
PreparedStatement ps = c.prepareStatement("SELECT * FROM kurssi;");
ResultSet rs = ps.executeQuery();
while (rs.next()) {
kurssit.add(kurssiResultS... | 3 |
@Override
public void update(int delta) {
super.update(delta);
if(standAnim != null && moveAnim != null && bumpAnim != null) {
for(int i = 0; i < 4; i++) {
standAnim[i].update(delta);
moveAnim[i].update(delta);
bumpAnim[i].update(delta);
}
}
} | 4 |
public Automata buildDFA() {
if (states.length > maxStateOfNFA) {
return null;
}
optimaze();
Automata a = createTemplateForDFA();
int maxMask = (1 << states.length);
Queue<Integer> queue = new LinkedList<>();
boolean was[] = new boolean[maxMask];
... | 7 |
public void RevealRooms(){
for(int i=0; i<grid.length; i++)
for (int j=0; j<grid.length; j++)
visited[i][j] = RoomState.VISITED;
} | 2 |
public void msgRefreshClientInfoHard(String userId, ArrayList<String> usersId, String turnUserId, String winnerId, String field) {
UserSession userSession = sessionIdToUserSession.get(userId);
if (userSession.isHardRefreshProcessing()) {
utils.resources.Game gameRes = (utils.resources.Game)u... | 4 |
public static void main(String[] args) {
String[] a = {"Color","Apple","Boy"};
List<String> list = Arrays.asList(a);
Collections.sort(list);
System.out.println(list);
Iterator<String> t = list.iterator();
while(t.hasNext()){
System.out.println(t.next());
}
ListIterator<String> lt = list.listIterator(... | 3 |
public void uimsg(String msg, Object... args) {
if (msg == "upd") {
this.avagob = (Integer) args[0];
return;
}
if (msg == "ch") {
List<Indir<Resource>> rl = new LinkedList<Indir<Resource>>();
for (Object arg : args)
rl.add(ui.sess.g... | 5 |
@Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
// TODO Auto-generated method stub
JCas jcas = aJCas;
try {
chunker = (ConfidenceChunker) AbstractExternalizable.readObject(modelFile);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (I... | 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.