text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args){
int i;
Scanner keyboard = new Scanner(System.in);
while (true) {
System.out.println("Please input an odd number:");
i = keyboard.nextInt();
if (i % 2 == 0) {
System.out.println("It's an even number! Try again.");
} else {
//calcute how many lines need to... | 5 |
public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... | 7 |
void setExampleWidgetAlignment () {
int alignment = 0;
if (leftButton.getSelection ()) alignment = SWT.LEFT;
if (centerButton.getSelection ()) alignment = SWT.CENTER;
if (rightButton.getSelection ()) alignment = SWT.RIGHT;
label1.setAlignment (alignment);
label2.setAlignment (alignment);
label3.setAlignme... | 3 |
public boolean isDirectlyAccessible(Coordinate coord) {
int x = coord.getCoordX();
int y = coord.getCoordY();
Coordinate coordTemp;
if (y > 0) {
coordTemp = coord.copy();
coordTemp.moveNorth();
if (!isObstacle(coordTemp)) {
return true;
}
}
if (x < dimension - 1) {
coordTemp = coord.copy... | 8 |
public Connection getConnectionWith(Neuron other){
for(int i=0;i<outputs.size();i++)
if(outputs.get(i).getGiveNeuron()==other||outputs.get(i).getRecieveNeuron()==other)
return outputs.get(i);
for(int i=0;i<inputs.size();i++)
if(inputs.get(i).getGiveNeuron()==other... | 6 |
public LinkedList<Review> getOtherReviews(String reviewer, String isbn) throws SQLException {
LinkedList<String> select = new LinkedList<String>();
select.add("*");
LinkedList<String> from = new LinkedList<String>();
from.add("Reviews");
LinkedList<Pair<String, String>> whereClau... | 4 |
int bonuses(Token token) {
int r = 0;
if(right!=null)
{
r += Item.get(right,token);
if(right==Item.Axe && left==null)
r++;
}
if(left!=null)
r += Item.get(left,token);
for(Item e : items)
r += Item.get(e, token);
for(Token e : skills) {
if(e==token)
r++;
}
return r;
} | 7 |
public Activity find(long id) throws InstanceNotFoundException {
Activity a = null;
try {
a = activities.get((int) id);
} catch (ArrayIndexOutOfBoundsException e) {
throw new InstanceNotFoundException(id, "Activity");
}
return a;
} | 1 |
public void testWithField2() {
Period test = new Period(1, 2, 3, 4, 5, 6, 7, 8);
try {
test.withField(null, 6);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public void testSoundThread() throws Exception {
System.out.println("playSoundThread");
MusicController mc = new MusicController();
Thread instance=new Thread (mc);
// instance.start();
for(int i=0;i<150;i++){
System.out.println(i+" Seconds passed ");
Threa... | 1 |
* @param elements Elemente der Menge der Objekt-Typen
*
* @throws ConfigurationChangeException Falls die Menge nicht am Objekt gespeichert werden konnte.
*/
private void setObjectSetTypeObjectTypes(ConfigurationArea configurationArea, ObjectSetType objectSetType, String[] elements)
throws Configurati... | 7 |
public CheckResultMessage checkE05(int day) {
return checkReport.checkE05(day);
} | 0 |
public void uninstallUI(JComponent c) {
super.uninstallUI(c);
c.remove(rendererPane);
rendererPane = null;
} | 0 |
public static Point getLayout(int numWindows, int maxX, int maxY) {
// Look for rectangular layout
Set<Integer> divisors = findDivisors(numWindows);
for (int x : divisors) {
int y = numWindows / x;
if (x <= maxX && y <= maxY) {
return new Point(x, y);
}
}
// No rectangular layout found. Use a ... | 3 |
private int[] orderMerging(int[] a) {
if(a.length == 1) return a;
int leftLen = a.length / 2;
int rightLen = a.length - leftLen;
int[] left = new int[leftLen];
int[] right = new int[rightLen];
System.arraycopy(a, 0, left, 0, leftLen);
System.arraycopy(a, leftLen... | 1 |
public ListNode deleteDuplicates(ListNode head) {
if (head == null)
return null;
ListNode p = head;
ListNode t = head;
p = p.next;
while (p != null) {
if (t.val == p.val) {
p = p.next;
}
else {
t.n... | 3 |
private int getBonusMultiplier(Location loc){
Location toRemove = null;
for(Location bonus : bonusSquares.keySet()){
if(loc.sameCoord(bonus)){
toRemove = bonus;
break;
}
}
if(toRemove != null){
int multiplier = bonusSquares.get(toRemove);
bonusSquares.remove(toRemove);
return multiplier;
... | 3 |
@Override
public PokerAction makeDecision(Card[] table, int small, int big,
int amount, int potSize, int chipCount, int numPlayers, boolean allowedBet) {
double random = Math.random()/(this.aggressiveness);
if(table == null){
double winOdds = stats.getStat(numPlayers, currentHand);
if(winOdds > 0.5 && all... | 9 |
public void areStreamsUp() {
if (!streamList.isEmpty()) {
for (;threadCount < streamList.size(); threadCount++) {
new StreamIsUp(streamList.get(threadCount), threadCount, streamName.get(threadCount)).start();
}
}
} | 2 |
public void showPersonMenu() {
//Menüoptionen
final int NEW_PERSON = 0;
final int EDIT_PERSON = 1;
final int DELETE_PERSON = 2;
final int BACK = 3;
//Personenverwaltungsmenü
Menu maklerMenu = new Menu("Personen-Verwaltung");
maklerMenu.addEntry("Neue Person", NEW_PERSON);
maklerMenu.addEntry("Perso... | 5 |
public boolean shouldStore(final LocalExpr expr) {
// We should store if there are more than 2 type 1 uses or
// any uses of type greater than one-- which will be indicated
// by type1s being greater than 2
// the parameter expr might be null, e.g., if this method is
// called from "dups" in "!shouldStore((... | 5 |
public static JSONObject showUnauthorized() {
JSONObject jo = new JSONObject();
try
{
jo.put("rtnCode", "401 unauthorized");
} catch (JSONException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return jo;
} | 1 |
public List<Integer> findMinHeightTrees(int n, int[][] edges) {
if (n == 1) {
return Collections.singletonList(0);
}
List<Set<Integer>> adj = new ArrayList<>(n);
for (int i = 0; i < n; ++i) adj.add(new HashSet<>());
for (int[] edge : edges) {
... | 8 |
private String getPersistencyMethode() {
File file = new File("init.dat");
String juist = null;
if (file.exists()) {
try {
Scanner scanner = new Scanner(file);
int tel = 0;
while (scanner.hasNextLine()) {
tel++;
String fout = scanner.nextLine();
if (tel == 2) {
juist = ... | 5 |
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().equ... | 8 |
@Override
public ArrayList<Integer> findByType(String type) {
ArrayList list = new ArrayList();
try {
connection = getConnection();
ptmt = connection.prepareStatement("SELECT id FROM Task WHERE type=?;");
ptmt.setString(1, type);
resultSet = ptmt.execu... | 6 |
public DataPair split(int feat){
HashSet<Integer> index = new HashSet<Integer>();
int[] examples = data.get(new Integer(feat));
if (examples == null)
return null;
for (int i=0; i < examples.length; i++){
index.add( examples[i] );
}
TreeMap<Intege... | 9 |
public void write(ByteBuffer block, int offset) throws IOException {
this.channel.write(block, offset);
} | 0 |
public static String transformLabel(Tree<String> tree) {
String transformedLabel = tree.getLabel();
int cutIndex = transformedLabel.indexOf('-');
int cutIndex2 = transformedLabel.indexOf('=');
int cutIndex3 = transformedLabel.indexOf('^');
if (cutIndex2 > 0 && (cutIndex2 < cutIndex || cutI... | 8 |
private static int[] EachPlayerIO(){
// This will take inputs of visions for each player in turn, and give them their
// visions immediately.
int[] randOrder = getRandomOrdering(NumPlayers);
// randOrder now contains a randomised ordering of indices.
boolean[] CanSee = RunningGame.CheckLiveSeers();
b... | 3 |
private static <E> CycList<CycList<E>> combinationsOfInternal(final CycList<E> selectedItems, final CycList<E> availableItems) {
final CycList<CycList<E>> result = CycList.list(selectedItems);
if (availableItems.size() == 0) {
return result;
}
CycList<E> combination = null;
for (int i = 0; i <... | 3 |
public static String[] readLgooFile(String path) {
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(
path));
} catch (FileNotFoundException e1) {
e1.printStackTrace();
System.out.println("file not found");
}
String line = null;
String[] tempArray = new String[get... | 5 |
public static String parseErrorMessage(String errorMessage) {
StringBuilder response = new StringBuilder();
Pattern pattern = Pattern.compile(".*?/series/(\\d*?)/default/(\\d*?)/(\\d*?)/.*?");
Matcher matcher = pattern.matcher(errorMessage);
// See if the error message matches the patt... | 8 |
public void Update(GameTime gameTime)
{
mMenu.Update();
if (!mMenu.IsMenuItemSelected())
{
mMenu.SelectMenuItem(new Vector2(mInput.GetMouseX(), GameProperties.WindowHeight() - mInput.GetMouseY()));
if (mInput.IsMouseHit(0))
{
switch(mMenu.GetSelected())
{
case 0:
{
gameTim... | 5 |
protected JPanel buildSortPanel() {
JPanel ans = new JPanel();
GridBagLayout layout = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
ans.setLayout(layout);
//
c.fill = GridBagConstraints.HORIZONTAL;
nameSort = new JRadioButton("");
JRadioButton noSort = new JRadioButton("ѧ", tr... | 0 |
public static <T> boolean equals(T[][] matrix, T[][] withMatrix)
throws NullPointerException {
if (matrix == withMatrix)
return true;
if (matrix == null && withMatrix == null)
return true;
if (matrix == null || withMatrix == null)
return false;
int width = getWidth(matrix);
int height = getHeig... | 9 |
public float priorityFor(Actor actor) {
if (storeShortage() <= 0) {
if (sumHarvest() > 0) return Plan.ROUTINE ;
else done = true ;
}
final float hunger = actor.health.hungerLevel() ;
if (store == null && hunger <= 0) done = true ;
if (done) return 0 ;
float impetus = 0 ;
imp... | 9 |
public EntityPlayer updateInput()
{
if (Keyboard.isKeyDown(Keyboard.KEY_W))
{
position.y -= speed;
currentY -= speed;
}
if (Keyboard.isKeyDown(Keyboard.KEY_A))
{
position.x -= speed;
currentX -= speed;
}
if (Keyb... | 4 |
public void testProperty() {
LocalDate test = new LocalDate(2005, 6, 9, GJ_UTC);
assertEquals(test.year(), test.property(DateTimeFieldType.year()));
assertEquals(test.monthOfYear(), test.property(DateTimeFieldType.monthOfYear()));
assertEquals(test.dayOfMonth(), test.property(DateTimeFie... | 2 |
public void setPrice(float price) {
this.price = price;
} | 0 |
protected SchlangenGlied(Rectangle masse, IntHolder unit, Color color) {
super(masse, unit);
this.color = color;
} | 0 |
public void deleteMessage(String sender, String receiver, String message, int sentBy) {
db.deleteMessage(sender, receiver, message);
if((sentBy == ServerInterface.CLIENT) && (backupServer != null)) {
try {
backupServer.ping();
backupServer.deleteMessage(sender, receiver, message, ServerInterface.SERVE... | 3 |
public void accept(Visitor visitor) {
if (visitor.visit(this)) {
if (sour != null) {
sour.accept(visitor);
}
if (date != null) {
date.accept(visitor);
}
if (subm != null) {
subm.accept(visitor);
}
if (subn != null) ... | 7 |
public void draw(Graphics g) {
Image I;
boolean noBonus = false;
I = map.game.getImages().getBonusBomb();
switch(type) {
case 1:
I = map.game.getImages().getBonusBomb();
break;
case 2:
I = map.game.getImages().getBon... | 4 |
boolean treeContains(CoreInterface ci){
if(ci.getClass() == Dvd.class){
if(dvdTree.contains(ci)){
return true;
}
return false;
}else if(ci.getClass() == Location.class){
if(locationTree.contains(ci)){
return true;
}
return false;
}else if(ci.getClass() == Genre.class){
if(genreTree.co... | 6 |
public String updateDailyScheduleRequest(Sport sport, int year, String month, String day) {
String request = null;
switch(sport) {
case NBA: case NHL:
request = "http://api.sportsdatallc.org/" + sport.getName() + "-" + access_level + sport.getVersion() + "/games/" + year + "/" + month + "/" + day + "/schedul... | 6 |
public HiloBean load(HiloBean oHilo) throws NumberFormatException, ParseException {
try {
if ((request.getParameter("nombre") != null)) {
oHilo.setNombre(request.getParameter("nombre"));
}
if ((request.getParameter("fecha") != null)) {
oHilo.se... | 3 |
@Override
public void paintComponents(Graphics g) {
if (this.skin.getLocaleButtonVisible()) {
Graphics g2 = g.create();
int x, y;
int w, h;
if (this.skin.isChanged() || (this.ground == null)) {
try {
String p = this.skin.g... | 4 |
public byte[] getG() {
return g;
} | 0 |
@Override
public void actionPerformed(ActionEvent e) {
repaint();
} | 0 |
public static void main(String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException {
SimpleInterface simpleInterface = new SimpleClass();
simpleInterface.method(3, new SimpleClass());
simpleInterface.method(3);
simpleInterface.someOtherMethod();
} | 0 |
public void extractConfig(final String resource, final boolean replace) {
final File config = new File(this.getDataFolder(), resource);
if (config.exists() && !replace) return;
this.getLogger().log(Level.FINE, "Extracting configuration file {1} {0} as {2}", new Object[] { resource, CustomPlugin... | 4 |
public static void main(String[] args) {
int myPoint = 0;
Status gameStatus;
int sumOfDice = rollDice();
switch ( sumOfDice ) {
case SEVEN:
case YO_LEVEN:
gameStatus = Status.WON;
break;
... | 9 |
private Map<String, List> addStormsFromYear(DefaultMutableTreeNode root, String year) {
DefaultMutableTreeNode yearRoot;
try{
StormSet stormSet = new StormSet(new File("noaaStormCoords" + year + ".gpx"));
yearRoot = new DefaultMutableTreeNode(year);
root.add(yearRoot);
Map<String, List> storms = sto... | 3 |
public int getVertical(int i, int j, int r) {
int sum = 0;
int imax = this.length;
int jmax = this.width;
for (int n = 0; n <= 2 * r; n++) {
int ii = topo.idI(i - r + n, j, imax, jmax);
int jj = topo.idJ(i, j, imax, jmax);
if (
(!(ii < 0) && !(ii >= imax)) &&
(!(jj < 0) && !(jj >= jmax)) ... | 7 |
public void cancelTimer(The5zigModTimer timer) {
timer.cancel(getPlayer());
} | 0 |
public void keyPressed(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_A || e.getKeyCode() == KeyEvent.VK_LEFT);
velx = -5;
if(e.getKeyCode() == KeyEvent.VK_D || e.getKeyCode() == KeyEvent.VK_RIGHT);
velx = 5;
} | 4 |
private void addParserNoticeHighlights(ParseResult res) {
// Parsers are supposed to return at least empty ParseResults, but
// we'll be defensive here.
if (res==null) {
return;
}
if (DEBUG_PARSING) {
System.out.println("[DEBUG]: Adding parser notices from " +
res.getParser());
}
if (noti... | 9 |
public int typeCode() {
if (desc.length() == 1) {
switch (desc.charAt(0)) {
case BOOLEAN_CHAR:
return Type.BOOLEAN_CODE;
case CHARACTER_CHAR:
return Type.CHARACTER_CODE;
case FLOAT_CHAR:
return Type.FLOAT_CODE;
case DOUBLE_CHAR:
return Type.DOUBLE_CODE;
case BYTE_CHAR:
return Typ... | 9 |
public Collection<? extends Object> search(Object obj, Connection conn) {
if(obj instanceof Aluno){
return this.listAll(this.createSelectAlunoHistoricoCmd((Aluno)obj), conn);
}
else if(obj instanceof Turma){
return this.listAll(this.createSelectAlunosTurmaCmd((Turma)obj),... | 3 |
public static void main(String[] args) throws IOException {
// file names : dealreport.txt and Serialized_Deals.dat
String fileNames[] = {"dealreport.txt", "Serialized_Deals.dat"};
try {
ZipOutputStream out_zip = new ZipOutputStream(
new BufferedOutputStream(
new FileOutputStream("out_zip.zip")));
... | 3 |
public double nextValue(int generatorID) {
long k,s;
double u=0.0;
if( generatorID>Maxgen) System.out.println( "ERROR: Genval with g > Maxgen\n");
s=Cg[0][generatorID]; k=s/46693;
s=45991*(s-k*46693)-k*25884;
if( s<0) s+=2147483647;
Cg[0][generatorID]=s;
u+=(4.65661287524579692e-10*s);
s=Cg[... | 8 |
public static ArrayList<String> searchTicketProduct(Integer ID) {
Database db = dbconnect();
ArrayList<String> Array = new ArrayList<String>();
try {
String query = ("SELECT name FROM ticket_products WHERE TID = ?");
db.prepare(query);
db.bind_param(... | 2 |
public void startServer(int port) throws CouldNotStartServerException {
logger.fine("Starting server on port " + port + "...");
synchronized(CONNECTION_LOCK) {
if(isRunning) {
logger.fine("Server is already started!");
throw new ServerAlreadyStartedException();
}
try {
socket = new DatagramSock... | 2 |
private SlotState checkVerticalLines()
{
if(!((GridSlot)board[0][0]).isEmpty() && ((GridSlot)board[0][0]).getState().equals(((GridSlot)board[1][0]).getState()) && ((GridSlot)board[1][0]).getState().equals(((GridSlot)board[2][0]).getState()))
{
return ((GridSlot)board[0][0]).getState();
}
else if(!((GridSlot... | 9 |
private JPanel getPanelOfComponents() {
JPanel panel = new JPanel();
toStringT = new JTextField(30);
toStringT.setFont(new Font("COURIER", Font.BOLD, 20));
panel.add(toStringT);
return panel;
} | 0 |
public static void main(String[] args) {
//standard input
Scanner in = new Scanner(System.in);
int n = in.nextInt();
//if no temperatures provided
if(n <= 0) {
System.out.println(0);
in.close();
return;
}
//find the closest number to the zero
Integer closest = null;
for(int i = 0; i... | 6 |
@Override
public Action postAction(Action a) throws JSONException, BadResponseException {
Representation r = new JsonRepresentation(a.toJSON());
r = serv.postResource("intervention/" + interId + "/action", a.getUniqueID(), r);
Action action = null;
try {
action = new Action(new JsonRepresentation(r).get... | 2 |
@Override
public boolean equals(Object o)
{
if (o.getClass() != Tree.class) return false;
Tree t = (Tree)o;
LinkedList list = toLinkedList();
while (list.hasNext())
if (!t.contains(list.getNext())) return false;
return size == t.size();
} | 3 |
private void sendEventsToThem(Set<SimpleEntity> loadedEntities, int createdIfIdGreaterThan) {
for (SimpleEntity entity : loadedEntities) {
Map<Class<? extends Component>, Component> components = new HashMap<>();
for (Map.Entry<Class<? extends Component>, Component> originalComponents : e... | 5 |
public static boolean login(String userName, String password)
{
try {
String parameters = "user=" + URLEncoder.encode(userName, "UTF-8") + "&password=" + URLEncoder.encode(password, "UTF-8") + "&version=" + URLEncoder.encode(GlobalVar.Version, "UTF-8");
String result = Utils.excutePost(GlobalVar.AuthUR... | 4 |
public Node getHeadNode(int linkedListLength){
if(linkedListLength==0){
return null;
}
Node node = new Node();
node.setData(count);
count++;
node.setNextNode(getHeadNode(linkedListLength-1));
return node;
} | 1 |
public static String combineStringArray(String[] words, String separator) {
String string = "";
for (String word : words) {
if (!string.isEmpty())
string += separator;
string += word;
}
return string;
} | 2 |
public void addIntersectionAtCanvasLocation(int canvasX, int canvasY)
{
// FIRST MAKE SURE THE ENTIRE INTERSECTION IS INSIDE THE LEVEL
if ((canvasX - INTERSECTION_RADIUS) < 0) return;
if ((canvasY - INTERSECTION_RADIUS) < 0) return;
if ((canvasX + INTERSECTION_RADIUS) > viewport.leve... | 6 |
public List<List<SetCard>> findMatches() {
//don't even bother if there aren't enough cards
if (cards.size() < 3) {
return null;
}
/*
* iterate through all of the cards, getting all possible permutations
* of SetCards...
*/
for (int i = 0; i < cards.size(); i++) {
SetCard card1 = cards.ge... | 6 |
public void calcEffectiveRefractiveIndices(){
if(this.setMeasurementsTEgrating)this.calcTEmodeEffectiveRefractiveIndices();
if(this.setMeasurementsTMgrating)this.calcTMmodeEffectiveRefractiveIndices();
} | 2 |
public Map getRecordByID(String table, String primaryKeyField, Object keyValue, boolean closeConnection)
throws SQLException, Exception {
Statement stmt = null;
ResultSet rs = null;
ResultSetMetaData metaData = null;
final Map record = new HashMap();
// do this in an... | 7 |
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
float notches = e.getWheelRotation();
final double BY = 0.05;
if (notches > 0) {
vscale *= (1 + BY);
} else {
vscale *= (1 - BY);
}
setScale(vscale);
repaint();
} | 1 |
public Map<String, String> getStyles() {
if (styles == null) {
styles = new HashMap<String, String>();
}
return styles;
} | 1 |
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
World world = player.getWorld();
String worldname = world.getName();
String playername = player.getName();
Boolean staff = false;
double x = (int) Math.floor(player.getLocati... | 4 |
public int saveContact(enmSavingMode aSavingMode, clsContactsDetails aContactDetails) throws SQLException {
//The creation id in the database.
int mIDContacts = 0;
//Create the entry in the Contacts table.
String mFormattedBirthdayDate = "";
if (aContactDetails.getBirthday() != n... | 5 |
public static void showGUI(TableModel tbl) {
final TableModel t = tbl;
/* 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.
... | 6 |
public boolean hasPathSum(TreeNode root, int sum) {
boolean result1 = false;
boolean result2 = false;
if (root == null) {
return false;
}
if (root.val == sum && root.left == null && root.right == null) {
return true;
}
if (root.left != nul... | 7 |
@Override
public void mousePressed(MouseEvent e) {} | 0 |
public final boolean deleteAll()
{
if(!exists())
return false;
if(!canWrite())
return false;
if(CMath.bset(vfsBits, CMFile.VFS_MASK_NODELETEANY))
return false;
if(!mayDeleteIfDirectory())
return false;
if(demandVFS)
return deleteVFS();
if(demandLocal)
return deleteLocal();
final boolean... | 7 |
public void GUI()
{
setUndecorated(true);
setSize(breite, hoehe);
setTitle(Read.getTextwith("installer", "name"));
setLocationRelativeTo(null);
setIconImage(new ImageIcon(this.getClass().getResource("src/icon.png")).getImage());
final Point point = new Point(0,0);
addMouseListener(new MouseAdapter(... | 5 |
public BSTNode(Term term){
this.term = term;
} | 0 |
public double[] distributionForInstance(Instance instance) throws Exception {
String stringInstance = instance.toString();
double cachedPreds[][] = null;
if (m_cachedPredictions != null) {
// If we have any cached predictions (i.e., if cachePredictions was
// called), look for a cached set ... | 9 |
private void resolveValueGrid(Node parentNode) {
validateTagsOnlyOnce(parentNode, new String[]{"show_grid", "grid_step", "label_factor"});
boolean showGrid = true;
double gridStep = Double.NaN;
int NOT_SET = Integer.MIN_VALUE, labelFactor = NOT_SET;
Node[] childNodes = getChildNo... | 8 |
public boolean canMoveRight(){
int [][] temp = BlockInControl.getBlock();
int tempPosX = BlockPosX;
int tempPosY = BlockPosY;
for(int r = 0; r <4; r++){
for(int c = 0; c < 4;c++){
if(temp[r][c] == 1){
if(c ==3){
if(tempPosX+1 > MAX_COL-1)
return false;
if(board[tempPosY][tempPosX+1]==1)... | 9 |
static void print(Poker[][] pers){
int len1 = pers.length;
for (int i = 0; i < len1 && i < 4; i++){
System.out.print(colors[i]+":");
int len2 = pers[i].length;
for (int j = 0; j < len2; j++){
if (pers[i][j] != null){
System.out.prin... | 4 |
public User getUser() {
return user;
} | 0 |
private static Product getProduct(Serializable productID)
{
final Serializable productIDCopy = productID;
Product result;
synchronized (AutoAppro.products)
{
if ((result = AutoAppro.products.get(productID)) == null)
{
/* Try to find another that has a similar name */
for (Product p : AutoAppro.pr... | 9 |
public static void main (String[] args) {
// The pattern for generating a range of ranom numbers looks like so.
// (Math.random() * (Min - Max + 1)) + Min
// Here's what a basic ranom number looks like.
for (int i = 0; i < 100; i++) {
System.out.println( Math.random() );
}
/... | 8 |
public static boolean canMove(){
IsoEntity other;
for (Iterator<IsoEntity> iie = PistolCaveGame.stop.iterator(); iie.hasNext(); ) {
other = iie.next();
if(secondPlayer){
if (PistolCaveGame.player2.collides(other) != null) return false;
}
else{
if (PistolCaveGame.player.collides(other) ... | 4 |
public Object instantiate(String name) throws ClassNotFoundException {
String implementation = getProperty("me4se.implementation");
if(implementation != null) {
implementation += ";";
}
else {
implementation = "";
}
implementation += "o... | 4 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
if (sender.hasPermission("bossbar.config")) {
if (args.length == 0 || args[0].equalsIgnoreCase("help")) {
getExecutor("help").onCommand(sender, cmd, label, args);
return true;
} else if (commandExist... | 4 |
private boolean checkTouchObject(int pos){
ArrayList<Line2D.Double> linies = this.getBoundLines();
boolean toca = false;
for (int i = 0; i < linies.size(); i++) {
for (int j = 0; j < Board.getObstacles().size(); j++) {
Rectangle r = new Rectangle((int)Board.get... | 3 |
public Object nextContent() throws JSONException {
char c;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new Str... | 7 |
public final void setOptions(Map<String, ?> options) {
/* Is verification of YubiKey owners enabled? */
this.verify_yubikey_owner = true;
if (options.get(OPTION_YUBICO_VERIFY_YK_OWNER) != null) {
if ("false".equals(options.get(OPTION_YUBICO_VERIFY_YK_OWNER).toString())) {
... | 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.