text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void buildForest() {
intervalForest = new IntervalForest();
// Add all chromosomes to forest
if (useChromosomes) {
for (Chromosome chr : genome)
intervalForest.add(chr);
}
// Add all genes to forest
for (Gene gene : genome.getGenes())
intervalForest.add(gene);
//---
// Create (and ad... | 3 |
public String execute(LogInObject logInObject) throws SQLException{
String answer = "";
String result = authenticateUser(logInObject.getAuthUsername(), logInObject.getAuthPassword(), logInObject.getIsAdmin());
switch (result){
case "1":
logInRO.setLogOn(false);
logInRO.setExplanation("The email or pa... | 4 |
int insertKeyRehash(float val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look ... | 9 |
public Point move(Point[] pipers, // positions of dogs
Point[] rats) { // positions of the rats
npipers = pipers.length;
System.out.println(initi);
Point gate = new Point(dimension/2, dimension/2);
if (!initi) {
this.init();initi = true;
}
Point current = pipers[id]; // Where the pipers are rig... | 8 |
final public DBAccess open(final String connectionString)
throws ClassNotFoundException {
String user = null;
String password = null;
String driver = null;
String url = null;
// Split the connection string into commands.
final String[] commands = connectionS... | 6 |
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation, int direction) {
return 5;
} | 0 |
public KeyStroke getKey() {
return KeyStroke.getKeyStroke('u');
} | 0 |
@Override
public void run() {
if (!Inventory.isFull()) {
fish();
} else {
Item[] bob = Inventory.getItems();
for (int c = 0; inventoryCheck(); c++) {
bob[c].getWidgetChild().interact("Drop");
Time.sleep(100);
if (c == 29 && inventoryCheck()) {
c = 0;
}
}
}
} | 4 |
public P371E() {
Scanner sc = new Scanner(System.in);
// because we will deal with segments
N = sc.nextInt() - 1;
Pos[] pos = new Pos[N+1];
for (int i = 0; i < N+1; i++) {
int x = sc.nextInt();
pos[i] = new Pos(x, i+1);
}
Arrays.so... | 7 |
public BufferedImage getImage() {
BufferedImage bi = new BufferedImage(width,height, BufferedImage.TYPE_INT_RGB);
bi.setRGB(0,0,width,height,pixels,0,width);
return bi;
} | 0 |
public static Calendar jauJd2cal(double dj1, double dj2) throws JSOFAIllegalParameter
{
/* Minimum and maximum allowed JD */
final double djmin = -68569.5;
final double djmax = 1e9;
long jd, l, n, i, k;
double dj, d1, d2, f1, f2, f, d;
/* Verify date is acceptable. */
d... | 4 |
public void testForFields_datetime_DM() {
DateTimeFieldType[] fields = new DateTimeFieldType[] {
DateTimeFieldType.dayOfMonth(),
DateTimeFieldType.minuteOfHour(),
};
int[] values = new int[] {25, 20};
List types = new ArrayList(Arrays.asList(fields));
... | 2 |
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
BufferedReader buf = new BufferedReader(
new InputStreamReader(System.in));
String line = "";
BigInteger n = new BigInteger("0");
BigInteger aux = new BigInteger("0");
d: do {
line = buf.readLine();
... | 5 |
@RequestMapping(value="/{tripID}/detailsTravelTrip", method=RequestMethod.GET)
public String detailsTravelTrip(@PathVariable("tripID") String tripID, Model model){
TravelTrip tempTravelTrip = travelTripService.findById(Integer.parseInt(tripID));
model.addAttribute("detailsTravelTrip", tempTravel... | 0 |
public Parser(String pathname) {
this.file = new File(pathname);
try {
readFile();
}
catch(FileNotFoundException e) {
System.err.println("File: " + pathname + " not found!");
e.printStackTrace();
}
extractAssemblercode();
} | 1 |
private static boolean handleIsValidUser(Integer u) {
if (u < 0) {
System.err.println("Not a valid user");
return false;
} else {
UserModel userModel = new UserModel();
Iterable<Entry> userQuery = userModel.query("{id:" + u + "}");
if (!userQue... | 2 |
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Map<String, Integer> map = new HashMap<>();
while (true) {
try {
int id = Integer.parseInt(reader.readLine());
String ... | 4 |
public int GetNpcListHP(int NpcID) {
for (int i = 0; i < maxListedNPCs; i++) {
if (NpcList[i] != null) {
if (NpcList[i].npcId == NpcID) {
return NpcList[i].npcHealth;
}
}
}
return 0;
} | 3 |
@Override
public void update(Level level, int x, int y, int z, Random rand) {
boolean var8 = false;
boolean var6;
do {
--y;
if (level.getTile(x, y, z) != 0 || !canFlow(level, x, y, z)) {
break;
}
if (var6 = level.setTile(x, y,... | 8 |
public static HealthColorPixelType healthColorPixelTypeFor(Color color, int id) {
HealthColorPixelType type = healthColorPixels.get(color);
if (type == null) {
type = new HealthColorPixelType(id, color);
healthColorPixels.put(color, type);
}
return type;
} | 1 |
private boolean doOp (NodeOps op, double threshold, double input) {
switch (op) {
case GREATER_THAN:
return input > threshold;
case LESS_THAN:
return input < threshold;
case GREATER_THAN_OR_EQUAL_TO:
return input >= threshold;
... | 8 |
private boolean touchRobotMov(int pos) {
boolean toca = false;
for (SimulatorRobot robot : Board.robots) {
if (robot != this) {
ArrayList<Line2D.Double> linies = this.getBoundLines();
ArrayList<Line2D.Double> liniest2 = robot.getBoundLines();
... | 4 |
public ParametricEquation(String equ_x, String equ_y, double tstart, double tend, double dt){
this.tstart = tstart;
this.tend = tend;
this.dt = dt;
equx = new Equation(equ_x);
equy = new Equation(equ_y);
Vector<Variable> variables = equx.getVariables();
if(variables.size()!=1)
throw new EquationExce... | 4 |
public GrabAbility(String name, String trigger) {
super(name, trigger);
} | 0 |
public AttributeInfo copy(ConstPool newCp, Map classnames) {
AnnotationsAttribute.Copier copier
= new AnnotationsAttribute.Copier(info, constPool, newCp, classnames);
try {
copier.memberValue(0);
return new AnnotationDefaultAttribute(newCp, copier.close());
}
... | 1 |
private double getBulletPower() {
if (power != null) {
return power;
}
double bulletPower = 1.95;
if (state.targetDistance < 140) {
bulletPower = 2.95;
}
bulletPower = Math.min(state.robotEnergy / 4.0, bulletPower);
bulletPower = Math.min(state.targetEnergy / 4.0, bulletPower);
bulletPower = Ma... | 2 |
private void transformTree(TreeNode node) {
TreeNode left = node.left;
TreeNode right = node.right;
reverse(node);
if(left != null) transformTree(left);
if(right != null) transformTree(right);
mergeToRight(node);
} | 2 |
public int getFieldLineIndex() {
return fieldLineIndex;
} | 0 |
private static void runclient(String[] args) throws FileNotFoundException,
IOException {
//Get the addresses of machines from the property file
Properties prop = new Properties();
FileInputStream fis = new FileInputStream("./boltdb.prop");
prop.load(fis);
fis.close();
ClientArgs clientArgs = new ClientAr... | 9 |
public static MessageHandler getMessageHandler(Message message, ChatView chatView, ChatModel chatModel) throws UnknownMessageException {
if (message instanceof ServerErrorMessage) {
if (message instanceof FatalErrorMessage) {
return new ServerErrorMessageHandler(message, chatView, c... | 9 |
public static boolean isValueCode(char ch)
{
return ch == '@'
|| ch == ':'
|| ch == '%'
|| ch == '+'
|| ch == '#'
|| ch == '<'
|| ch == '>'
|| ch == '*'
|| ch == '/'
... | 9 |
private void writeToFile(double value) {
/*we assume the file doesn't already exist*/
boolean newlyCreated = true, alreadyWritten = false;
/*we count the number of lines in the file*/
int count = 0;
try {
File file = new File("/users/cristioara/workspace/CN_Tema06/out.txt");
/*if file doesn't exi... | 9 |
private void addGlobalSearchMenuItems(Menu submenu) {
MenuItem pageSearchItem = new MenuItem(submenu, SWT.PUSH);
pageSearchItem.addListener(SWT.Selection, new Listener () {
public void handleEvent(Event e) {
if (globalSearch.globalSearchAction()) {
pageSearch.setSearchParameters(globalSearch.getLastSear... | 2 |
@Override
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand().equals(VentanaPrincipal.COMANDO_ABRIR_REPRODUCCION)) {
ventanaPrincipal.manejoVentanaReproduccion('a');
}else if (event.getActionCommand().equals(VentanaReproduccion.COMANDO_CERRAR_REPRODUCCION)) {
ventanaPrincipal.manejo... | 6 |
protected void processSkipBlocks(List<String> skipBlocks) {
if(generateStatistics) {
for(String block : skipBlocks) {
statistics.setPreservedSize(statistics.getPreservedSize() + block.length());
}
}
} | 2 |
@Override
public List<Role> findRoleByAccountId(int accountId) {
List<Role> list = new ArrayList<Role>();
Connection cn = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
cn = ConnectionHelper.getConnection();
ps = cn.prepareStatement(QT... | 5 |
public void update() {
float newX = x + moveAmountX;
float newY = y + moveAmountY;
moveAmountX = 0;
moveAmountY = 0;
ArrayList<GameObject> objects = Game.rectangleCollide(newX, newY, newX + SIZE, newY + SIZE);
ArrayList<GameObject> items = new ArrayList<GameObject>();
boolean move = true;
f... | 5 |
public static double getDouble(String prompt, double low, double high) {
final int ALLOWABLE_INPUT_FAILURES = 3; // Avoid leaving a user stuck in here infinitely. If they fail to enter an int after 3 tries, bail out anyway.
String response;
int inputFailureCount = 0;
while (true) { // use an infinite loop. Exit... | 6 |
@Override
public int hashCode() {
if (hashCode == 0) {
int result = fromViewId != null ? fromViewId.hashCode() : 0;
result = 31 * result + (fromAction != null
? fromAction.hashCode()
: 0);
result = 3... | 9 |
private synchronized int count_servers(int numberOfUsers, int thrPerEngine) {
int servers;
if (thrPerEngine == 0) {
servers = 0;
} else {
servers = numberOfUsers / thrPerEngine;
if (numberOfUsers % thrPerEngine > 0) {
servers++;
}
... | 2 |
private ArrayList<String[]> splitPacketsFromStream(String message){
ArrayList<String[]> packets = new ArrayList<>();
ArrayList<String> tempPacket = new ArrayList<>();
int i = 1;
int j = 1;
if(!Character.isDigit(message.charAt(1))){
tempPacket.add(PacketTypes.INVALID.toString());
packets.add(tem... | 7 |
@Override
public void actionPerformed(ActionEvent e) {
// Get selected action.
final String action = (String) comboBox.getSelectedItem();
// Get all panels that are drawn.
Component[] panels = pane.getComponents();
// Selected panels.
final ArrayList<GElement> elementPanels = new ArrayList<GElement>();
... | 7 |
public static ArrayList getOpOp(String arg_op) throws SQLException, ClassNotFoundException, NumberFormatException {
ArrayList sts = new ArrayList();
Connection conPol = conMgr.getConnection("PD");
ResultSet rs;
if (conPol == null) {
throw new SQLException("Numero Maximo de Co... | 3 |
public void dumpInstruction(alterrs.jode.decompiler.TabbedPrintWriter writer)
throws java.io.IOException {
writer.closeBraceContinue();
writer.print("catch (");
writer.printType(exceptionType);
writer.print(" "
+ (exceptionLocal != null ? exceptionLocal.getName() : "PUSH")
+ ")");
writer.openBrace(... | 1 |
private String postprocessing(String world) {
// TODO Auto-generated method stub
boolean cond;
cond = "".equals(world)
|| "zeus".equals(world)
|| world.endsWith("a")
|| world.endsWith("e")
|| world.endsWith("i")
|| world.endsWith("o")
|| world.endsWith("u")
|| world.endsWith("r")
... | 9 |
public static void killme(int num) {
if (num==1){
if (server1 != null) {server1.interrupt();}
}else{
if (server2 != null) {server2.interrupt();}
}
} | 3 |
public String getAmount(){
String result = "";
if(gold < 1000) result = Integer.toString(gold);
if(gold >= 1000) result = Integer.toString(gold / 1000) + "k";
if(gold >= 1000000) result = Integer.toString(gold / 1000000) + "m";
if(gold >= 1000000000) result = Integer.toString(gold / 1000000000) + "b";
... | 4 |
private void pasteText(){
if(activField.equals("textArea"))
textArea.insert(pasteFromClipboard(),textArea.getCaretPosition());
if(activField.equals("fieldNameFile"))
fieldNameFile.setText(pasteFromClipboard());
if(activField.equals("fieldCommandLine"))
fieldCo... | 3 |
@Override
public boolean removeAll(Collection<?> c)
{
boolean removed = false;
for (Object o : c) {
removed |= remove(o);
}
return removed;
} | 2 |
@Test
public void hahmoPutoaaKorkealta() {
pe.siirra(0, -50);
int hahmonKoordinaattiAlussa = pe.getY();
t.lisaaEste(e);
for (int i = 0; i < 100; i++) {
pe.eksistoi();
}
assertTrue("Hahmo ei pysähtynyt esteesen vaan jatkoi y = "
+ pe.getY()... | 1 |
public void evaluateStack(){
validateEvaluateStack();
while(!operatorStack.empty()){
operandStack.push( op.performOperation(operandStack.pop(), operandStack.pop(), operatorStack.pop()) );
}
} | 1 |
private void unfilterPaeth(byte[] curLine, byte[] prevLine) {
final int bpp = this.bytesPerPixel;
int i;
for(i=1 ; i<=bpp ; ++i) {
curLine[i] += prevLine[i];
}
for(int n=curLine.length ; i<n ; ++i) {
int a = curLine[i - bpp] & 255;
int... | 8 |
public void setOutline(Color outline) {
this.outline = outline;
} | 0 |
public int pointToSymbol(int midCount, ByteSet exclusions) {
int sum = 0;
for (int mid = 0; ; ++mid) {
if (mid != EOF_INDEX && exclusions.contains(mid)) continue;
sum += _count[mid];
if (sum > midCount) return (mid == EOF_INDEX) ? ArithCodeModel.EOF : mid;
}
} | 5 |
public void setTipoMovimiento(String tipoMovimiento) {
this.tipoMovimiento = tipoMovimiento;
} | 0 |
@Override
public AlgorithmResult<V, E> start(final V vertex, final V startVertex, final V endVertex) throws IllegalGraphException
{
if (startVertex == null)
{
throw new IllegalArgumentException("The start vertex can not be null");
}
if (endVertex == null)
{
... | 8 |
public void generateSearchResults(){
irLists = new ArrayList<IRList>();
q = queryParser.nextQuery();
// while (q != null){
// ArrayList<DocScore> docScores = iRmodel.getRanking(q.toQueryHash());
// PageRank pageRank = new PageRank();
// ... | 8 |
public ArrayList<ArrayList<Float>> ArraytoArrayList(float[][] arr){
ArrayList<ArrayList<Float>> arrayL = new ArrayList<ArrayList<Float>>();
for (int j = 0; j < arr[0].length; j++) {
ArrayList<Float> tempL = new ArrayList<Float>();
for (int i = 0; i < arr.length; i++) {
tempL.add(arr[i][j]);
}
arr... | 2 |
private static int[] LastNWLine(int m, int n, String A, String B) {
int[][] K = new int[2][n + 1];
for (int i = 1; i <= m; i++) {
for (int j = 0; j <= n; j++)
K[0][j] = K[1][j];
for (int j = 1; j <= n; j++) {
if (A.charAt(i - 1) == B.charAt(j - 1))
K[1][j] = K[0][j - 1] + 1;
else
K[1][j]... | 6 |
@Override
public void encode() throws IOException {
System.out.println("Starting compression of file \"" + sourceFile.getFileName() + "\" to \"" + destinationFile.getFileName() + "\"");
totalTimer = new Timer().start();
// Count the number of occurences of each character in the file
printMessage("Counting char... | 5 |
private static void parseConfig(StyleConfig styleConfig, Element doc) {
NodeList childs = doc.getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
Node node = childs.item(i);
if ("is-fix-size".equals(node.getNodeName())) {
styleConfig.setIsFixSize(Boolean.parseBoolean(node
.getTextContent... | 7 |
@Override
public int[] batchUpdate(String... sql) {
try {
Connection connection = getConnection();
Statement stmt = connection.createStatement();
for (String string : sql) {
stmt.addBatch(string + ';');
}
int[] out = stmt.executeBatch();
JdbcUtil.closeStatement(stmt);
JdbcUtil.closeConnectio... | 2 |
Item newInvokeDynamicItem(final String name, final String desc,
final Handle bsm, final Object... bsmArgs) {
// cache for performance
ByteVector bootstrapMethods = this.bootstrapMethods;
if (bootstrapMethods == null) {
bootstrapMethods = this.bootstrapMethods = new ByteVe... | 9 |
public void parse(HttpParams params) {
if (params.exists("swLat")) {
swLat = Double.parseDouble(params.getFirst("swLat"));
}
if (params.exists("swLon")) {
swLon = Double.parseDouble(params.getFirst("swLon"));
}
if (params.exists("neLat")) {
neLat = Double.parseDouble(params.getFirst("neLat"));
}
... | 8 |
private boolean validMovesExist(){
List<Integer> diceOptions = diceRoll;
//Check bar
Location barOfPlayerInTurn = getBarOfPlayerInTurn();
int barCount = getCount(barOfPlayerInTurn);
if(barCount > 0){
for(int j = 0; j < diceOptions.size(); j++){
Location to = getToLocationFromBar(diceOptions.get(j)... | 8 |
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 |
@Override
public String execute() throws Exception {
if (cid == 0 || account ==null)
return ERROR;
System.out.println("have the account:" + account + " cid:" + cid);
HttpSession session=ServletActionContext.getRequest().getSession();
User host = (User) session.getAttribute(com.ccf.action.user.UserLogi... | 7 |
public GTFSPlugin getPlugin(){
if (plugin == null){
synchronized (this) {
String pluginName = properties.getProperty("plugin");
if (pluginName == null){
plugin = new DefaultPlugin();
}else{
try{
Class<?> pluginClass = Class.forName(pluginName);
boolean validPlugin = false;
... | 8 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(((msg.targetMajor()&CMMsg.MASK_MALICIOUS)>0)
&&(!CMath.bset(msg.sourceMajor(),CMMsg.MASK_ALWAYS))
&&((msg.amITarget(affected)))
&&(CMLib.flags().isAnimalIntelligence(msg.source())))
{
final MOB target=(MOB)msg.target();
... | 8 |
public int maxProfit(int[] prices) {
if (prices == null || prices.length == 0) {
return 0;
}
int[] left = new int[prices.length];
int[] right = new int[prices.length];
int maxSofar = 0, minSofar = 0;
for (int i = 0; i < prices.length; i++) {
if (... | 9 |
private void clearPath() {
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
if(lab.getWalkways()[i][j] == null) lab.getWalkways()[i][j] = true;
}
}
} | 3 |
private boolean recoverRequest(Request request) {
if (request.site == null) {
System.out.println("error: recovery request have no site");
return false;
}
if (request.site != null)
if (!this.siteMap.containsKey(request.site)) {
System.out.prin... | 4 |
private String extractImageID(final String leaseDescription) {
assert leaseDescription.startsWith("api services lease granted by ");
String currentImageID = leaseDescription.substring(30);
final int firstSpaceIndex = currentImageID.indexOf(" ");
if (firstSpaceIndex > 0) {
currentImageID = currentI... | 1 |
public PaymentEntity() {
setId(System.nanoTime());
} | 0 |
public void seeking() {
if (getDistanceToTarget() < SEEKING_TO_ATTACKING_DISTANCE) {
setState(STATE_ATTACKING, "distance to " + target + " is within attacking distance while seeking");
return;
} else if (getDistanceToTarget() > IDLING_TO_SEEKING_DISTANCE) {
setState(STATE_IDLING, "distance to target is out... | 2 |
@Override
public boolean mayICraft(final Item I)
{
if(I==null)
return false;
if(!super.mayBeCrafted(I))
return false;
if((I.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_WOODEN)
return false;
if(CMLib.flags().isDeadlyOrMaliciousEffect(I))
return false;
if(!(I instanceof Container))... | 8 |
@Override
public void update() {
if (Physics.checkCollisions(this, ball))
ball.paddleBounce(getCenterY());
float speed = (ball.getCenterY() - getCenterY()) * DAMPING;
if (speed > MAX_SPEEDY)
speed = MAX_SPEEDY;
else if (speed < -MAX_SPEEDY)
speed... | 3 |
@Override
public HeightMap applyTo(HeightMap... heightMaps){
double[][] finalHeights = heightMaps[0].getHeights();
int xSize = finalHeights.length;
int ySize = finalHeights[0].length;
for(int iteration = 0; iteration<numIterations; iteration++) {
if (iteration % 10 == 0) ... | 9 |
public Limbs getLimbs() {
return limbs;
} | 0 |
public LowerTilter() {
requires(Robot.tilter);
} | 0 |
public static int loadTexture(BufferedImage image) {
int[] pixels = new int[image.getWidth() * image.getHeight()];
image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0,
image.getWidth());
ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth()
* image.getHeight() * BYTES_PER_PIXEL... | 2 |
private void evalNewArray(int pos, CodeIterator iter, Frame frame) throws BadBytecode {
verifyAssignable(Type.INTEGER, simplePop(frame));
Type type = null;
int typeInfo = iter.byteAt(pos + 1);
switch (typeInfo) {
case T_BOOLEAN:
type = getType("boolean[]");
... | 8 |
public void test_DateTime_setHourZero_Gaza() {
DateTime dt = new DateTime(2007, 4, 1, 8, 0, 0, 0, MOCK_GAZA);
assertEquals("2007-04-01T08:00:00.000+03:00", dt.toString());
try {
dt.hourOfDay().setCopy(0);
fail();
} catch (IllegalFieldValueException ex) {
... | 1 |
public void method353(int i, double d, int l1) {
// all of the following were parameters
int j = 15;
int k = 20;
int l = 15;
int j1 = 256;
int k1 = 20;
// all of the previous were parameters
try {
int i2 = -k / 2;
int j2 = -k1 / 2;
int k2 = (int) (Math.sin(d) * 65536D);
int l2 = (int) (Math.... | 4 |
public void makeMove(Piece piece) {
if(validMove(piece)) {
ArrayList<Piece> captured = piece.getCapturedPieces(this);
for(Piece p : captured) {
p.setColor(p.getColor().getOpposite());
}
addPiece(piece);
}
} | 2 |
public boolean getvar2(String stat) {
StringTokenizer str = new StringTokenizer(stat, ",");
while (str.hasMoreTokens()) {
String line = str.nextToken();
String first = "", second = "", relation = "";
boolean check = false;
for (int i = 0; i < line.length(); i++) {
if (line.charAt(i) == '=' || line.c... | 7 |
private String parseDuration(String time){
if (time != null){
double number = Double.parseDouble(time)/60;
return String.format("%.2f", number)+ " mins";
}
return "NA";
} | 1 |
public void sortColors(int[] A) {
if(A == null || A.length == 0) return;
int first = 0;
int end = A.length -1;
while (first <= end &&A[first] == 0) first++;
first--;
while (end >= 0 && A[end] == 2) end--;
end++;
int i = first+1;
while (i < end){
... | 9 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
//GEN-FIRST:event_jButton1ActionPerformed
list = new LunchDao();
} catch (SAXException ex) {
Logger.getLogger(addItemToLunchMenu.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParserCon... | 8 |
public Table (String filePath){
super();
this.filePath = filePath;
robot = new Robot();
robot.X = 200;
robot.Y = 150;
robot.teta = 0;
} | 0 |
public void putAll( Map<? extends K, ? extends Short> map ) {
Iterator<? extends Entry<? extends K,? extends Short>> it = map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends K,? extends Short> e = it.next();
this.put( e.getKey(), e.getValue() );
... | 8 |
public Player waitForServerPlayer() throws IOException {
// TODO Send server our player info
this.send("JOIN " + this.ourPlayer.getName() + " " + this.ourPlayer.getSignature());
while (true) {
String[] tokens = this.inStream.readLine().split(" ");
if (tokens[0].equals("JO... | 2 |
public void actionPerformed(ActionEvent e) {
JButton currentButton = (JButton) e.getSource();
final int index = (int) currentButton.getClientProperty("index");
day = (index < COL) ? 0 : 1;
time = index % COL;
if (selectMany) {
Color btnBack = currentButton.getBackground();
if (btnBack.equals(Col... | 9 |
static final private HashMap<String,ProcedureDefinition> procedureRecur(HashMap<String,ProcedureDefinition> procedures) throws ParseException, CompilationException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TO:
procedure(procedures);
procedureRecur(procedures);
... | 4 |
private static List<Appointment> findDailyByDaySpan(long uid,
long startDay, long endDay) throws SQLException {
List<Appointment> aAppt = new ArrayList<Appointment>();
// select * from Appointment where frequency = $DAILY
// and startTime <= $(endDay+DateUtil.DAY_LENGTH)
// and lastDay >= $startDay
Prepar... | 1 |
public void changeTeamTemplate(String username, int newTemplateNumber) {
PreparedStatement newData = null;
PreparedStatement studentFinder = null;
int studentID = -1;
try {
studentFinder = connect.prepareStatement(
" select userID from User " +
... | 7 |
private void addLabyrinth(int height, int length) {
for (int i = 1; i < height; i++) {
for (int j = 1; j < length; j++) {
if (border(i,j,length,height)) {
super.addBricks(new Point(i, j));
} else if (everyFourthLine(i,j,length,... | 6 |
public static void query(String tagFile, String[] rpnQuery) {
Expression expression = null;
try {
expression = Querior.parse(rpnQuery);
}
catch(ParseException e) {
System.out.println("Problem parsing expression: " + e);
return;
}
if (ex... | 9 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
if((!auto)
&&(!mob.isMonster())
&&(!disregardsArmorCheck(mob))
&&(!CMLib.utensils().armorCheck(mob,CharClass.ARMOR_LEA... | 8 |
public boolean isInside(int x1, int y1, int x2, int y2)
{
int tmp = x1;
if (x2 < x1) {
x1 = x2;
x2 = tmp;
}
tmp = y1;
if (y2 < y1) {
y1 = y2;
y2 = tmp;
}
return (x1 < x && x < x2) && (y1 < y && y < y2)
... | 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.