text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void loadVisOp(String visOpName)
{
Department visOp = DataBase.departments[DataBase.findDeptPos(visOpName)];
if (visOp != null)
{
for (int index = 0; index<visOpsPanel.getComponentCount(); index++)
{
try
{
((JSpinner) visOpsPanel.getComponent(index)).setValue("1");
((JSpinner) visO... | 7 |
public void setExpiryDate(XMLGregorianCalendar value) {
this.expiryDate = value;
} | 0 |
public void testSet(Set<Object> set) {
// first test add and contains
set.clear();
assertTrue("Clear should make it empty", set.isEmpty());
Object[] items=new Object[itemCount];
for (int i =0; i < itemCount; i++) {
Integer o =Integer.valueOf(i);
items[i]=o;
set.add(o);
assertTrue("add/contains", s... | 8 |
synchronized boolean frameCorrectionFirstCodingExon() {
List<Exon> exons = sortedStrand();
// No exons? Nothing to do
if ((exons == null) || exons.isEmpty()) return false;
Exon exonFirst = getFirstCodingExon(); // Get first exon
// Exon exonFirst = exons.get(0); // Get first exon
if (exonFirst.getF... | 5 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
ArrayList<CompRequest> comp = new ArrayList<CompRequest>();
... | 9 |
private boolean follows(Gob g1, Gob g2) {
Following flw;
if ((flw = g1.getattr(Following.class)) != null) {
if (flw.tgt() == g2)
return (true);
}
if ((flw = g2.getattr(Following.class)) != null) {
if (flw.tgt() == g1)
return (true);
}
return (false);
} | 4 |
public int read(final int[] docs, final int[] freqs) throws IOException {
while (true) {
while (current == null) {
if (pointer < readers.length) { // try next segment
if (tenum != null) {
smi = tenum.matchingSegments[matchingSegmentPos++];
if (smi==nu... | 7 |
public void replaceTile(Tile find, Tile replace) {
for (int y = bounds.y; y < bounds.y + bounds.height; y++) {
for (int x = bounds.x; x < bounds.x + bounds.width; x++) {
if(getTileAt(x,y) == find) {
setTileAt(x, y, replace);
}
}
... | 3 |
public Object getValueAt(int row, int col) {
try {
return audienceResultList.get(row).getColumnData(col);
} catch (Exception e) {
e.getMessage();
return null;
}
} | 1 |
public static void openURL(String url)
{
try
{ // attempt to use Desktop library from JDK 1.6+
Class<?> d = Class.forName("java.awt.Desktop");
d.getDeclaredMethod("browse", new Class[] { java.net.URI.class }).invoke(
d.getDeclaredMethod("getDesktop").invok... | 9 |
public PDAToCFGConverter() {
initializeConverter();
} | 0 |
public void addProduction(Production production) {
if (myProductions.size() == 0
&& !ProductionChecker.isRestrictedOnLHS(production))
throw new IllegalArgumentException(
"The first production must be restricted.");
super.addProduction(production);
} | 2 |
private static UnitTypes defineUnitToBuild(int freeMinerals, int freeGas) {
// boolean arbiterAllowed =
// UnitCounter.weHaveBuilding(UnitTypes.Protoss_Arbiter_Tribunal);
boolean valkyrieAllowed = UnitCounter.weHaveBuilding(UnitTypes.Terran_Control_Tower);
boolean scienceVesselAllowed = UnitCounter
.weHaveB... | 5 |
@Override
public int hashCode() {
return Objects.hash(terminalID);
} | 0 |
public Sprite(String texture) {
try {
this.texture = load(texture);
} catch (IOException e) {
loadError();
}
} | 1 |
private void genPostponed(final Node node) {
final Instruction inst = (Instruction) postponedInstructions.get(node);
if (inst != null) {
method.addInstruction(inst);
// Luckily, the rc and aupdate don't change the stack!
postponedInstructions.remove(node);
}
} | 1 |
public void addResidualFlowTo(int v, double delta)
{
if (v == from) // backward edge
flow -= delta;
else if (v == to) // forward edge
flow += delta;
throw new IllegalArgumentException();
} | 2 |
public void checkGroups(boolean includeManual, CommandSender sender)
{
CheckReport report = new CheckReport(sender);
for(GroupSettings settings : getGroups(includeManual))
checkGroup(settings, report);
} | 1 |
public final boolean completeTask()
{
if (this.complete)
{
return true;
}
if (this.triesLeft == 0)
{
return true;
}
boolean finish = false;
try
{
finish = this.finishTask();
}
catch (Throwable e)
{
Logger.err(e);
}
if (finish)
{
synchronized (this)
{
... | 6 |
private void initContentNumber() {
contentNumber = 0;
if (content.length() == 0)
return;
// check to already get exception during parsing rather than during
// checking (later). we keep these
// values already in long form rather than executing Long.parseLong(...)
// many times (during check).
switch ... | 9 |
private static void showAllUser() throws Exception {
System.out.println("Users...");
UserDAO dao = new UserDAO();
ArrayList users = (ArrayList) dao.findAll();
User o;
for (int i = 0; i < users.size(); i++) {
o = (User) users.get(i);
Syste... | 1 |
private List<QCProjectSet> getProjectSetList(File dir, int negDepth) {
List<QCProjectSet> result = new ArrayList<>();
if (negDepth > 0) {
List<File> folder = dirFolderlist(dir);
for (File f : folder) {
if (isProjectSetDirectory(f)) {
result.add(new QCProjectSet(f, getProjectList(f, MAX_SET_SCAN_DEP... | 4 |
public void load(ProBotGame game){
this.setPosition
(
new Point
(
(int)Math.floor(this.getCurrentWorld().getWidth()/2*POSITION_MULTIPLYER),
(int)Math.floor(this.getCurrentWorld().getHeight()/2*POSITION_MULTIPLYER-60)
)
);
this.setHead(game.getUpgradeManager().getHeadByName("Head 2"));
... | 0 |
public int getInboxNumber(){
int number=0;
String requete= "select count(*) from message";
try {
Statement statement = MyConnection.getInstance().createStatement();
ResultSet resultat = statement.executeQuery(requete);
while(resultat.next()){
n... | 2 |
@Test
public void testStringArrays() throws Exception
{
PersistenceManager pm1 = new PersistenceManager(driver,database,login,password);
StringArrayContainer sac = new StringArrayContainer();
sac.setValues(new String[]{"Foo","bar","BAZ"});
pm1.saveObject(sac);
//get the object from another PersistenceMan... | 3 |
public List<Clan> load() {
List<Clan> list = new ArrayList<Clan>();
// Check if folder exists
if (plugin.clanClassFolder == null) {
plugin.logger.warning("No clans found in the classes folder. This plugin will only use the default clans.");
return list;
}
// Create Class Loader Instance
ClassLoader... | 8 |
public static String replaceExtension(String filename, String newExtention)
{
int i = filename.lastIndexOf('.');
return (i > 0 && i < filename.length() - 1) ? filename.substring(0,
i + 1)
+ newExtention : filename;
} | 2 |
public static String periodToFormat(long period) {
long elapsedYears = getYears(period);
period = period % yearInMillis;
long elapsedDays = getDays(period);
period = period % dayInMillis;
long elapsedHours = getHours(period);
period = period % hourInMillis;
long e... | 8 |
public void drawarrows(GOut g) {
Coord oc = viewoffset(sz, mc);
Coord hsz = sz.div(2); //half size
double ca = -Coord.z.angle(hsz);
for (Party.Member partyMember : glob.party.memb.values()) {
// Gob gob = glob.oc.getgob(id);
Coord memberCoords = partyMember.getc()... | 9 |
public static void printAll()
{
try
{
PreparedStatement stmt = Main.EMART_CONNECTION.prepareStatement("select * " +
"from ReplenishmentOrder");
ResultSet rs = stmt.executeQuery();
System.out.println("Replenishment Order:");
while (rs.next())
{
System.out.println(rs.getInt("order_id") + "|" ... | 3 |
@SuppressWarnings("unchecked")
public static <T extends Number> T[][] array2DArraySorter(T[][] tab,
int sortColumn) {
int tabLength = tab.length;
if (tabLength == 0)
return tab;
for (int i = 0; i < tabLength; ++i) {
if (sortColumn > tab[i].length - 1)
throw new ArrayIndexOutOfBoundsException(
... | 7 |
public static Cons buildOneTableAssertion(NamedDescription tableRelation, Cons tuple, Module dbModule) {
{ Cons assertion = Stella.NIL;
int colno = -1;
{ int i = Stella.NULL_INTEGER;
int iter000 = 0;
int upperBound000 = tableRelation.arity();
boolean unboundedP000 = upperBound00... | 9 |
public boolean similar(Object other) {
try {
if (!(other instanceof JSONObject)) {
return false;
}
Set<String> set = this.keySet();
if (!set.equals(((JSONObject) other).keySet())) {
return false;
}
Iterator<S... | 9 |
@SuppressWarnings({ "unchecked", "rawtypes" })
public void initializeComponents() {
regionCombobox = new JComboBox<String>();
progressBar = new JProgressBar();
contentPane = new JPanel();
coverLabel = new JLabel("");
lolPath = new JTextField();
openButton = new JButton("Open");
ButtonPatch = new JButton(... | 3 |
public Segment getIntersection(GeometricModel model) {
/*if (centre.getBrutalLength(model.centre) > this.maxLength + model.maxLength)
return null;*/
float maxLength = this.maxLength + model.maxLength;
maxLength *= maxLength;
if (centre.getLengthSquared(model.centre) > maxL... | 5 |
public void run() {
try {
while (running) {
if(IsConnectedToServer == true){
String message = null;
try{
message = din.readUTF();
LatestServerReply = message;
GetServerMessages.CheckServerMessages(message);
waitingforreply = false;
}catch(Exception e){
IsConnectedTo... | 8 |
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
out.println("Please enter the maze you would like to run:");
String input = "src/MazeReadIn/trickysearch2";//console().readLine();
String output = input+"Solution";
Maze myMaze = ReadMaze.parseMaze(input); // classN... | 4 |
public void drawWorldMap(){
worldMap[1] = super.mouseX >= 522 && super.mouseX <= 558 && super.mouseY >= 124 && super.mouseY < 161;
if (worldMap[0] && worldMap[1]) {
WorldOrb[1].drawSprite(10, 123);
} else if (worldMap[1]) {
WorldOrb[1].drawSprite(10, 123);
} else {
WorldOrb[0].drawSprite(10, 123);
}
... | 6 |
public static boolean getBooleanValue(String value) {
if(value != null)
if(value.equals("true"))
return true;
else if(value.equals("false"))
return false;
throw new IllegalArgumentException("Invalid value");
} | 3 |
public void judge() {
int d = dealer.score();
int p = player.score();
if ((d > 21 && p > 21) || d == p) {
System.out.println(EVEN);
} else if (p <= 21 && (d > 21 || d < p)) {
System.out.println(WIN);
} else {
System.out.println(LOST);
... | 6 |
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 provideFontChar(char chr, RSFontChar fontChar)
{
if (disposed)
return;
if (fontChar == null)
fontChar = DUMMY_FONT_CHAR;
int sector = chr >>> 8;
int index = chr & 0xff;
RSFontChar[][] charCache = this.charCache;
RSFontChar[] cacheSector = charCache[sector];
if (cacheSector != null)
... | 3 |
public static int maxProfit2(int[] prices) {
BestTimetoBuyandSellStockIII main = new BestTimetoBuyandSellStockIII();
Queue<Integer> profitQueue = new PriorityQueue<Integer>(1000,
main.new OwnComparator());
Stack<Integer> stack = new Stack<Integer>();
int lowPos = 0;
int tempLowPos = 0;
int highPos = 0;
... | 8 |
private void listaDeclaraciones() {
if(aux.getTipo()!=Nodo.tipoToken.EOF){
Nodo tem = this.declaracion();
if (tem != null) {
tip.add(tem);
if (aux.getTipo()==Nodo.tipoToken.PuntoyComa) {
aux=(Tokens2)tok.next();
this... | 9 |
public void visitInRange(int id, AABB range, IEntityVisitor visitor) {
Set<Entity> entities = structure.queryRange(new HashSet<Entity>(),
range);
Iterator<Entity> it = entities.iterator();
while (it.hasNext()) {
Entity entity = it.next();
if (entity.isRemoved) {
continue;
}
EntityComponent com... | 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 Servidor)) {
return false;
}
Servidor other = (Servidor) object;
if ((this.idServidor == null && other.idServid... | 5 |
private static String readResponse(URLConnection connection, String encoding) throws IOException {
if ( !isValidContentType(connection) )
throw new IOException("Invalid content type for " + connection.getURL());
BufferedReader reader = new BufferedReader( new InputStreamReader(connection.ge... | 2 |
public void Update() {
for (int i = 0; i < yPositions.length; i++) {
// Move image
yPositions[i] += speed;
// If image moving left
if (speed < 0) {
// If image is out of the screen, it moves it to the end of line of images.
if (yPo... | 4 |
public static int[] rotate(int[] pix, float beta, int iw, int ih, int owh) {
int[] opix = new int[owh * owh];
double t = beta / 180;
float cos_beta = (float) Math.cos(t * Math.PI);
float sin_beta = (float) Math.sin(t * Math.PI);
for (int i = 0; i < owh; i++) {
for (int j = 0; j < owh; j++) {
float u = ... | 6 |
public Object getParameterValue(Object parameter)
{
if (parameter == null || parameter instanceof Number
|| parameter instanceof String
|| parameter instanceof Character
|| parameter instanceof Boolean || parameter instanceof Date
|| parameter ... | 8 |
public static void main(String[] args) {
Factual factual = factual();
// Get all entities that are possibly a match
ReadResponse resp = factual.resolves(new ResolveQuery()
.add("name", "Buena Vista")
.add("latitude", 34.06)
.add("longitude", -118.40));
for(Map<?, ?> rec : resp.getData()) {... | 3 |
public void test_toPrinter() {
DateTimeFormatterBuilder bld = new DateTimeFormatterBuilder();
try {
bld.toPrinter();
fail();
} catch (UnsupportedOperationException ex) {}
bld.appendLiteral('X');
assertNotNull(bld.toPrinter());
} | 1 |
public List getModelChildren() {
List modelChildren;
if (getModel() instanceof PaletteContainer)
modelChildren = new ArrayList(
((PaletteContainer) getModel()).getChildren());
else
return Collections.EMPTY_LIST;
PaletteEntry prevVisibleEntry = null;
for (Iterator iter = modelChildren.iterator(); i... | 8 |
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
final PrintWriter out = response.getWriter();
long startTime = System.currentTimeMillis();
out.println("Checking WEB-INF/classes...");
out.println();
WebScanner scanner = new WebScanner... | 5 |
public void testGetSetNextSegment() {
VehicleAcceptor[] roads = new VehicleAcceptor[10];
for (int i = 0; i < 10; i++) {
VehicleAcceptor r = VehicleAcceptorFactory.newRoad();
roads[i] = r;
if (i > 0) {
roads[i-1].setNextSeg(r);
}
}
for (int i =0; i < 9; i++) {
Assert.assertTrue(roads[... | 3 |
@Override
public void loadFromFile(String trainFile, String testFile, String quizFile, String featureFile)
{
System.out.print("Loading dataset... ");
try
{
if(trainFile != null && trainFile.length() > 0);
loadDataFromFile(trainFile, InstanceType.Train);
if(testFile != null && testFile.length() > 0)
... | 9 |
public boolean detectAmbiguities() {
iteration = 0;
int maxpairs = 0;
int prevSize;
int size = nfa.items.size() + 2 + nfa.transitions.size();
do {
++iteration;
monitor.println("\nBuilding pair graph:");
if (!traverse()) {
// aborted by user
return false;
}
monitor.println(done... | 7 |
public static String getNoteName(int i)
{
if(i<0)
return "Paus";
return NOTE_NAMES[i % 12];
} | 1 |
public ShellLinkHeader setShowCommand(int n) throws ShellLinkException {
if (n == SW_SHOWNORMAL || n == SW_SHOWMAXIMIZED || n == SW_SHOWMINNOACTIVE) {
showCommand = n;
return this;
} else
throw new ShellLinkException();
} | 3 |
@Override
public void reactToChanges(ObservationEvent ev) {
if (ev instanceof CheckBoxEvent) {
CheckBoxEvent event = (CheckBoxEvent) ev;
this.setThoricity(event.isChecked());
this.notifyObserver();
} else if (ev instanceof OptionLineEvent) {
OptionLi... | 7 |
private void updateGame() {
handler.updateObjects();
for (int i = 0; i < handler.objects.size(); i++) {
if (handler.objects.get(i).getID() == ObjectID.Player) {
cam.updateCam(handler.objects.get(i));
}
}
} | 2 |
public void handleNonGeometricAttributes(SimpleFeatureImpl feature) throws UnsupportedEncodingException, FileNotFoundException {
try
{
String featureAttribute = "featureWithoutID";
String featureName = "featureWithoutName";
String featureClass = "featureWithoutClass";
//... | 9 |
public Type getHint() {
Type bottomHint = bottomType.getHint();
Type topHint = topType.getHint();
if (topType == tNull && bottomType.equals(bottomHint))
return bottomHint;
return topHint;
} | 2 |
public int compare(ByteBuffer o1, ByteBuffer o2) {
byte[] byteString1 = o1.array();
byte[] byteString2 = o2.array();
int minLength = byteString1.length > byteString2.length ? byteString2.length : byteString1.length;
for (int i = 0; i < minLength; i++) {
int bitCompare = bitCo... | 5 |
private Builder setStackTrace(Throwable t) {
// view button
stage.viewStacktraceButton = new ToggleButton("View stacktrace");
// copy button
stage.copyStacktraceButton = new Button("Copy to clipboard");
HBox.setMargin(stage.copyStacktraceButton, n... | 5 |
public static float[][] convertToFloatArray2D(String string) {
float[][] theData = null;
String[] segments = string.split(" ");
theData = new float[segments.length][];
for (int i = 0; i < theData.length; i++) {
theData[i] = convertToFloatArray1D(segments[i], i);
}
return theData;
} | 1 |
public static long fatorial(long number) {
if (number == 0 || number ==1) {
return 1;
}
return number * fatorial(number - 1);
} | 2 |
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 setOptions(String[] options) throws Exception {
setDebug(Utils.getFlag('D', options));
String classIndex = Utils.getOption('c', options);
if (classIndex.length() != 0) {
if (classIndex.toLowerCase().equals("last")) {
setClassIndex(0);
} else if (classIndex.toLowerCase().eq... | 8 |
private static void
writeTable(PdfWriter __writer)
throws BadElementException, DocumentException, IOException
{
PdfContentByte canvas = __writer.getDirectContent();
canvas.saveState();
canvas.setLineWidth(0.1f);
float origin_x = 50f;
float origin_y = 70... | 6 |
public static void flush()
{
if(mStream != null)
mStream.flush();
} | 1 |
public void enterQueue(Vehicle v) throws SimulationException, VehicleException {
if(v.isParked() || v.isQueued() || v.wasParked() || v.wasQueued()){
throw new VehicleException("Vehicle not in correct state");
}
if(queueFull()){
throw new SimulationException("Queue is full");
}
status += setVehicleMsg(v... | 5 |
public void hitEnemy(String name, int damage) {
// vind de juiste enemy in de array
for (Enemy E : myEnemies) {
String[] namesplit = E.getName().split(" ");
if (namesplit[0].toLowerCase().equals(name) || E.getName().toLowerCase().equals(name)) {
// Als de enemy levend is
if (E.isAlive()) {
System... | 5 |
private int valueValidator(int value, JTextField field) {
if (!field.equals(minesField) && value < 8) {
value = 8;
} else if (field.equals(heightField) && value > 16) {
value = 16;
} else if (field.equals(widthField) && value > 30) {
value = 30;
} else... | 9 |
public void escape(KeyEvent e)
{
if (selectionCellsHandler != null)
{
selectionCellsHandler.reset();
}
if (connectionHandler != null)
{
connectionHandler.reset();
}
if (graphHandler != null)
{
graphHandler.reset();
}
if (cellEditor != null)
{
cellEditor.stopEditing(true);
}
} | 4 |
@RequestMapping(value = "/buildQuestion", method = RequestMethod.POST)
public @ResponseBody
String buildQuestion(@RequestParam int count) {
ObjectWriter mapper = new ObjectMapper().writer().withDefaultPrettyPrinter();
List<Question> listQuestions = questionService.getQuestions();
String json = "";
try {
if... | 4 |
public static void deleteByAppt(long apptId) throws SQLException {
PreparedStatement statement = connect.prepareStatement(
"delete from Reminder where appointmentId = ? ");
statement.setLong(1, apptId);
statement.executeUpdate();
} | 0 |
private void doTheDamnThing(RandomAccessFile fp) throws IOException
{
byte[] b = new byte[26];
// Load IMPM header
fp.read(b, 0, 4);
if(b[0] == 'I' && b[1] == 'M' && b[2] == 'P' && b[3] == 'M')
{
loadDataIT(fp);
return;
}
// Attempt to load XM
fp.seek(0);
if(Util.readStringNoNul(fp,b,17).... | 8 |
private List<HantoCell> getContiguousCells(List<HantoCell> board, HantoCell aCell){
List<HantoCell> contigCells = new ArrayList<HantoCell>();
if (aCell != null){
int x = aCell.getX();
int y = aCell.getY();
if (isCellOccupied(x, y + 1)){
contigCells.add(findCell(x, y + 1, board));
} if (isCellOcc... | 7 |
public static ArrayList<Integer> numerosPrimos(int n) {
if (n < 2)
return new ArrayList<Integer>();
char[] is_composite = new char[(n - 2 >> 5) + 1];
final int limit_i = n - 2 >> 1, limit_j = 2 * limit_i + 3;
ArrayList<Integer> results = new ArrayList<>((int) Math.ceil(1.25506
* n / Math.log(n)));
resu... | 4 |
public int getParameter(String paramname){
if(paramname == "HoodSize"){return 0;}
if(paramname == "NextX"){return -1;}
if(paramname == "NextY"){return -1;}
if(paramname == "Age"){ return age;}
if(paramname == "Mat"){ return mat;}
if(paramname == "Matcount"){ return matcount;}
if(paramname == "... | 8 |
public String toInfoString() {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < total; i++) {
sb.append("LinkedList[" + i + "] = " + findElement(i).toInfoString());
if (i < total - 1) {
sb.append("\n");
}
}
return sb.toString();
} | 2 |
public static void main(String[] args) throws InterruptedException, IOException {
TCounter messagesReceived = new DropwizardTCounter();
messagesReceived.register("DEBUG.ClientPusb.MessagesReceiced");
ClientTurtleEnvironment nioClientMT = new ClientTurtleEnvironment();
nioClientMT.open()... | 6 |
protected boolean isFinished() {
return false;
} | 0 |
CtField getField2(String name) {
CtField df = getDeclaredField2(name);
if (df != null)
return df;
try {
CtClass[] ifs = getInterfaces();
int num = ifs.length;
for (int i = 0; i < num; ++i) {
CtField f = ifs[i].getField2(name);
... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
//System.out.println("CutAction");
OutlinerCellRendererImpl textArea = null;
boolean isIconFocused = true;
Component c = (Component) e.getSource();
if (c instanceof OutlineButton) {
textArea = ((OutlineButton) c).renderer;
} else if (c instanceo... | 6 |
@Test
public void testGetFileContentHash_CalculatesHashCorrectly_Succeeds() {
Path tempFile = null;
try {
try {
tempFile = Files.createTempFile("Photons_test_CalculatesHashCorrectly", ".txt");
} catch (IOException e) {
e.printStackTrace();
fail("Could not create temp file.");
}
// Write... | 8 |
public void testCsvTools() {
String filePath = "C:\\Users\\tdhuang\\Desktop\\功夫baby数据表格1(未加数值)\\关卡对应图片\\high_level_picture.csv";
CsvFile csvFile = new CsvFile(filePath, 0, 4, 1);
List<CsvDataLine> data = CsvTools.parse(csvFile);
System.out.println(data);
assertNotNull(data);
} | 0 |
public void query(String query, boolean instant) {
if (!instant) {
m_thread.query(query);
} else {
final Connection connection = getConnection();
try {
if (connection == null) {
Utilities.outputError("Could not connect to database '" + m_databaseName + "'");
return;
}
m_st... | 4 |
public String toString(){
String tmp = "";
for (int r = 1; r <= 17; r++) { // for every row
int c = ((r % 2 == 0) ? 2 : 1); // what col to start?
for (; c <= 9; c += 2) {
Hexpos h = new Hexpos(r, c);
if (h.onBoard()){
tmp += "[ " + h.hashCode() + " : " + owner(h ) + "] " ;
}
}
}
... | 4 |
@Override
public void sayToBomberman(String message) throws IOException {
writer.append(message).append("\n");
writer.flush(); //possibly not needed as the writer may autoflush after linebreak
} | 0 |
public void save(XMLWriter out, LengthUnits units) {
double[] size = getPaperSize(units);
double[] margins = getPaperMargins(units);
PrintService service = getPrintService();
out.startTag(TAG_ROOT);
if (service != null) {
out.writeAttribute(ATTRIBUTE_PRINTER, service.getName());
}
out.writeAttribute(A... | 1 |
public static boolean nameIsOnlyUpperCase(Variable variable) {
String name = variable.getName();
for (int i = 0; i < name.length(); i++) {
if (!Character.isUpperCase(name.charAt(i)) && name.charAt(i) != '_') {
return false;
}
}
return true;
} | 3 |
public static final long extractLong(String buffer, long def, boolean localized) {
buffer = normalizeNumber(buffer, localized);
if (hasDecimalSeparator(buffer, localized)) {
return (int) extractDouble(buffer, def, localized);
}
long multiplier = 1;
if (hasBillionsSuffix(buffer)) {
multiplier = 100000000... | 7 |
public void run () {
running = true;
while (running) {
try {
Thread.sleep (timeInterval);
} catch (Exception e) {
break;
}
if (paused) {
running=MoveOn();
if (running) {
s... | 5 |
@SuppressWarnings("unchecked")
public void saveTabData(ArrayList<Section> list) {
for (Section s : list) {
for (Object o : s.getQuestions()) {
if (o != null) {
for (Object tab : (ArrayList<Object>) o) {
if (tab != null) {
... | 8 |
public ArrayList<Collidable[]> checkCollisions() {
ArrayList<Collidable[]> collisions = new ArrayList<Collidable[]>();
for(int a = 0; a < entities.size() - 1; a++) {
for(int b = a + 1; b < entities.size(); b++) {
Collidable[] current = new Collidable[2];
current[0] = entities.get(a);
current[1] = ... | 3 |
public DownloadXML(String weburl) {
HttpClient client = HttpClients.createDefault();
HttpGet get = new HttpGet(weburl);
get.setHeader("Content-Type", "application/xml");
HttpResponse response;
try {
response = client.execute(get);
HttpEntity entity = response.getEntity();
if (entity != null) {
In... | 3 |
@Test
public void testPersonenEnRelaties() {
assertNotNull(pietEnTeuntje);
assertSame(pietEnTeuntje, adm.getGezin(pietEnTeuntje.getNr()));
Iterator<Gezin> it = teuntje.getGezinnen();
Gezin teuntjeEnPiet = it.next();
assertFalse(it.hasNext());
assertSame(pietEnTeuntje, teunt... | 4 |
public void removeElement (klasse o)
{ int i=indexOf(o);
if (i<0) return;
O[i]=null; ON--;
if (Gap<0 || Gap>i) Gap=i;
if (i==OLast-1) OLast--;
while (OLast>0 && O[OLast-1]==null) OLast--;
if (Gap>=OLast) Gap=-1;
} | 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.