text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void paivita(Object uusi, int rivi, int sarake) {
Elokuva elokuva = elokuvat.get(rivi);
if (sarake == 1) elokuva.setNimi((String) uusi);
else if (sarake == 2) elokuva.setOhjaaja((String) uusi);
else if (sarake == 3) elokuva.setNayttelijat((String) uusi);
else if (sarake ==... | 7 |
public Game()
{
grid = new Tile[GRID_WIDTH][GRID_HEIGHT];
currentPiece = generatePiece();
for (int i = 0; i < 4; i++)
currentPiece = new Piece().changeX(currentPiece, 1);
nextPiece = generatePiece();
for (int i = 0; i < 4; i++)
nextPiece = new Piece().changeX(nextPiece, 1);
//insert(nextPiece, 7, ... | 4 |
public synchronized void startGame(List<String> wordList) {
if (wordList.isEmpty()) {
// TODO: do something.... end game?
}
gameEnded = false;
currentScore = 100;
while (countClients() < GamePlay.NUM_PLAYERS) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
R... | 7 |
@Override
public void Parse(Session Session, EventRequest Request)
{
if (!Session.GrabActor().InRoom())
{
return;
}
Session.GrabResponse().Initialize(ComposerLibrary.LeavingRoom);
Session.GrabResponse().AppendBoolean(false);
Session.SendResponse();
if (Session.GrabActor().CurrentRoom.GrabParty(... | 2 |
final public void VarDecl() throws ParseException {
/*@bgen(jjtree) VarDecl */
SimpleNode jjtn000 = new SimpleNode(JJTVARDECL);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);Token value;
try {
jj_consume_token(VAR_TAG);
value = jj_c... | 8 |
@Override
public void doTask()
{
if(!dead)
{
// Log.debug("Moving Man");
this.direction = ai.getNextDirection();
if (direction.equals(Direction.TOP))
{
if (!collisions.contains(Direction.TOP))
{
super.setRealY(super.getRealY() - super.speed);
}
}
if (direction.equals(Dire... | 9 |
public User getUserById(long userId) throws DataAccessException {
Connection connection = getConnection();
try {
PreparedStatement ps = connection.prepareStatement(
"SELECT * FROM grad_users WHERE user_id=?");
PreparedStatement ps2 = connection.prepareStatemen... | 4 |
private void viewHistory()
{
System.out.println("View interpretation history ...");
// get list of grouping effective time:
ArrayList<DataTimestamp> timestamps = this.loader.getGroupingEffectiveTimestamps();
// insert a "Baseline" timestamp
timestamps.add(ti... | 6 |
private void assertReaderClosed(IndexReader reader, boolean checkSubReaders, boolean checkNormsClosed) {
assertEquals(0, reader.getRefCount());
if (checkNormsClosed && reader instanceof SegmentReader) {
assertTrue(((SegmentReader) reader).normsClosed());
}
if (checkSubReaders) {
if... | 9 |
public void refreshMonLocs() {
// if (this.useDelay)
// this.flushNewInf(this.mySim.curTime);
if (this.numMonitors == 0 || this.trackLocations.size() == 0)
return;
else if (this.weightByPop)
this.refreshMonLocsWeightByPop();
else if (this.actualInfCount)
this.refreshMonLocsActInfCount();
else if (th... | 8 |
private final void printMessageFunc(final String title,
final String message, @SuppressWarnings("hiding") final String text) {
if (Thread.currentThread() == this.master) {
synchronized (Button.class) {
this.pressed = Button.ABORT;
Button.class.notifyAll();
}
}
if (title == null) {
Debug.print(... | 5 |
public static void initializeRuntime() {
String bootPath = System.getProperty("sun.boot.class.path");
String pathSeparator = System.getProperty("path.separator");
if ((bootPath == null) || (pathSeparator == null)) {
StandardLog
.warning("Cannot initialize boot pat... | 9 |
public PrioritizedTaskProducer(Queue<Runnable> q, ExecutorService e)
{
queue = q;
exec = e;
} | 0 |
public HMWord(String word) {
this.setWord(word);
length = word.length();
setWrongLetters(new ArrayList<Character>());
setPlaceholder(new ArrayList<Character>());
for (int i = 0; i < length; i++) {
getPlaceholder().add(UNDERSCORE);
}
} | 1 |
@Override
public boolean match(ValueExpression te, Map<String, ValueExpression> map) {
if (!(te instanceof TupleExpression)) {
return false;
}
TupleExpression tuple = (TupleExpression)te;
if (!(tuple.getTupleType().equals(getTupleType()))) {
return false;
}
else {
if (element... | 5 |
@Override
public C next() {
if (lastNode!=null && (index < lastNode.keysSize)) {
lastValue = lastNode.getKey(index++);
return lastValue;
}
while (toVisit.size()>0) {
// Go thru the current nodes
... | 4 |
public boolean isInBound ( int x, int y)
{
if(x<0||x>=boardSize||y<0||y>=boardSize)
return false;
return true;
} | 4 |
static void readBTX(File f) throws Throwable {
BTXParser v = new BTXParser(f);
l:
while (true) {
switch (v.next()) {
case ATTRIBUTE :
BTXAttribute at = v.getEventData().getAttribute();
at.getName();
at.asString();
break;
case END_OBJECT :
break;
default :
case EOF :
... | 5 |
private void asetaTKuva() {
if (noppa == 2 || noppa == 3){
ImageIcon nyrkki = new ImageIcon(new ImageIcon(getClass().getResource("/nyrkky.jpg")).getImage());
setIcon(nyrkki);
} else if (noppa == 4){
ImageIcon jousi = new ImageIcon(new ImageIcon(getClass().getResource(... | 5 |
public boolean HandleRequest( HTTPRequest request, StringWriter out )
{
if ( !request.method.equals( "GET" ) && !request.method.equals( "POST" ) )
return false;
String command = "";
if ( request.parameters.containsKey( "command" ) )
{
command = request.parame... | 7 |
private boolean isLeaf() {
if (internal_node)
return false;
if (objects.size() < max_objects_per_leaf)
return true;
grow_leaves();
return false;
} | 2 |
public Collection<GroupSettings> getGroups(boolean includeManual)
{
if(includeManual)
return Collections.unmodifiableList(mAllGroups);
else
return Collections.unmodifiableList(mAutoGroups);
} | 1 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Client other = (Client) obj;
if (this.idClient != other.idClient) {
return false;
}
... | 6 |
public synchronized static void print(String name) {
for (int i = 0; i < 20; i++) {
System.out.printf("%s %s\n", name, i);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} | 2 |
public void mouseClicked(MouseEvent e)
{
} | 0 |
private int computeGlobalSize() {
int size = (allocator.getRegNumber() + 2) * 4; // useless, just to make
// code logic simple
int maxReg = 0;
for (int reg : regMap.values()) {
if (maxReg < reg) {
maxReg = reg;
}
}
if (maxReg > allocator.getRegNumber() + 2) {
size = maxReg * 4;
}
for (Varia... | 4 |
@Override
public void computeFontSize(List<TagCloudElement> elements) {
if (elements.size() > 0) {
Double minCount = null;
Double maxCount = null;
for (TagCloudElement tce : elements) {
double n = tce.getWeight();
if ((minCount == null) || ... | 8 |
void hitmiss(int xe, int ye, int [][] pixel2, int [][]pixel, int [] lut){
int x, y;
// considers the pixels outside image to be 0 (not set)
for (x=1; x<xe-1; x++) {
for (y=1; y<ye-1; y++) {
pixel[x][y]+= lut[(
pixel2[x-1][y-1] +
pixel2[x ][y-1] * 2 +
pixel2[x+1][y-1] * 4 +
pixel2[x-1][y ]... | 9 |
private int method42(int i, int j, int k) {
int l = k >> 7;
int i1 = j >> 7;
if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
return 0;
int j1 = i;
if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
j1++;
int k1 = k & 0x7f;
int l1 = j & 0x7f;
int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundAr... | 6 |
protected void carregaTabelaEnderecos(List<Endereco> lista){
this.modeloTabelaEndereco = new DefaultTableModel();
this.modeloTabelaEndereco.addColumn("Rua");
this.modeloTabelaEndereco.addColumn("Bairro");
this.modeloTabelaEndereco.addColumn("Cep");
this.modeloTabelaEndereco.addCo... | 1 |
private boolean impliedBy(int and, int xor) {
for (int i = 0; i < andMasks.length; i++) {
if (implies(and, xor, andMasks[i], xorMasks[i]))
return true;
}
return false;
} | 2 |
public static void load() {
File file = new File("./Player.xml");
if(file.exists()){
playerData = JAXB.unmarshal(file, PlayerData.class);
} else {
playerData = JAXB.unmarshal(PlayerData.class.getResourceAsStream("/data/Player.xml"), PlayerData.class);
}
} | 1 |
public static void display(long array[]){
for(long arr : array){
System.out.print(arr+" ");
}
System.out.println();
} | 1 |
public int getCoordonneeX() {
return x;
} | 0 |
private void gererLesEvenementsUtilisateurs() {
while (Mouse.next()) {
this.camera.onMouseEvent();
}
while (Keyboard.next()) {
this.sphere.onKeyEvent();
}
} | 2 |
private void assertTagValue(Document doc, String tagName, String tagValue)
throws XPathExpressionException {
NodeList list;
if (tagName.startsWith("/")) {
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();
XPathExpression expr = xpath.compil... | 4 |
public List<String> getPrefNames() {
return prefNameCombo.getItems();
} | 0 |
private OutputChannels(int channels)
{
outputChannels = channels;
if (channels<0 || channels>3)
throw new IllegalArgumentException("channels");
} | 2 |
public boolean playerWon(int p){
// If sentinel won
if(winner == 1)
{
// Check whether player was on team sentinel
for(int s:sentinel)
{
if(s == p)
return true;
}
}
// If scourge won
if(wi... | 6 |
public static List<Point2D> ConnectionPoint (ABObject o1, ABObject o2)
{
List<Point2D> connection_p = new ArrayList<Point2D>();
if (o1.id != o2.id)
{
List<Point2D> pointsO1 = MathFunctions.getObjectContourPoints(o1);
List<Point2D> pointsO2 = MathFunctions.getObjectContourPoints(o2);
//System.out.println... | 4 |
public void hataHesapla(double ideal[]) {
int i, j;
final int arakatmanİndeksi = girisSayisi;
final int cikisİndeksi = girisSayisi + arakatmanSayisi;
for (i = girisSayisi; i < neuronSayisi; i++) {
hata[i] = 0;
}
for (i = cikisİndeksi; i < neuronSayisi; i++) {
hata[i] = ideal[i ... | 7 |
public void gameLoop() {
long startTime = System.currentTimeMillis();
long currTime = startTime;
while (isRunning) {
long elapsedTime =
System.currentTimeMillis() - currTime;
currTime += elapsedTime;
// update
if (startTim... | 3 |
public static void display(JPanel p, String font)
{
// loops for the length of how many non-repeating words there are
rect = new ArrayList<Rectangle>();
System.out.println("hi hi hi world!! " + wordsList.size());
p.setOpaque(true);
p.setBackground(Color.white);
for(int q = 0; q < words... | 9 |
static public boolean checkInstallation(JavaPlugin plugin, Properties config, Logger log) {
boolean ret = true;
String pluginName = plugin.getDescription().getName();
byte buffer[] = new byte[512];
Iterator<Entry<Object, Object>> it = config.entrySet().iterator();
while (it.h... | 9 |
public boolean isFull(Comparable[] flatTree)
{
boolean answer = true;
for (int i = 1; i < flatTree.length; i++) // go through everything in the flattree
{
Comparable left = getLeftKid(i,flatTree); // get the left child of the current item
Comparable right = get... | 5 |
private void flipColors(Node h) {
// h must have opposite color of its two children
assert (h != null) && (h.left != null) && (h.right != null);
assert (!isRed(h) && isRed(h.left) && isRed(h.right))
|| (isRed(h) && !isRed(h.left) && !isRed(h.right));
h.color = !h.color;
... | 7 |
public void writeKnownAttributes(GrowableConstantPool gcp,
DataOutputStream output) throws IOException {
if (bytecode != null) {
output.writeShort(gcp.putUTF8("Code"));
output.writeInt(bytecode.getSize());
bytecode.write(gcp, output);
}
if (exceptions != null) {
int count = exceptions.length;
ou... | 5 |
public synchronized void buyBooks(Set<BookCopy> bookCopiesToBuy)
throws BookStoreException {
if (bookCopiesToBuy == null) {
throw new BookStoreException(BookStoreConstants.NULL_INPUT);
}
// Check that all ISBNs that we buy are there first.
int ISBN;
BookStoreBook book;
Boolean saleMiss = false;
for... | 8 |
@Override
public void stop()
{
switch( channelType )
{
case SoundSystemConfig.TYPE_NORMAL:
if( clip != null )
{
clip.stop();
clip.setFramePosition(0);
}
break;
case Sou... | 4 |
public void copyField( Level level ) {
for ( int i = 0; i < level.field.length; i++ ) {
System.arraycopy( level.field[i], 0,
field[i], 0, level.field[0].length );
}
} | 1 |
public LinkedList<File> getPatches() {
LinkedList<File> patches = new LinkedList<File>();
if(carrierString!=null) {
if(carrierString.length()>0) {
patches.add(findReplace(extractFromJar(CARRIER_PATCH), "/*Edit Here*/",
"+\t\t\tthis.carrierText = \"" + ... | 5 |
private void init() {
_view.cmb_status.setModel(new javax.swing.DefaultComboBoxModel(fa.Ticket_ComboBox(4).toArray(
new Object[fa.Ticket_ComboBox(4).size()])));
_view.cmb_category.setModel(new javax.swing.DefaultComboBoxModel(fa.Ticket_ComboBox(3).toArray(
... | 1 |
private void readGroups( Element groupsElement )
{
NodeList nl = groupsElement.getChildNodes();
for ( int i=0;i<nl.getLength();i++ )
{
org.w3c.dom.Node node = nl.item( i );
if ( node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE )
{
String nodeName = node.getNodeName();
if ( nodeName != null &... | 4 |
public void filter(byte[] samples, int offset, int length) {
for (int i=offset; i<offset+length; i+=2) {
// update the sample
short oldSample = getSample(samples, i);
short newSample = (short)(oldSample + decay *
delayBuffer[delayBufferPos]);
setS... | 2 |
public static void main(String[] args)
{
if (args.length < 2)
{
System.out.println("Please indicate the number of planes and the length of a time unit (in milliseconds) as command line arguments (in that order).");
return;
}
int num_aircraft;
int time_unit;
Lock lock;
try
{
num_aircraft = Int... | 8 |
public static NormalDistributedStochasticLotsizingProblem generate(
int quarterPeriodLength, int numberOfQuarterPeriods, double baseLevelMean, double amplitudeMean, double cv,
double setupCost, double inventoryHoldingCost,
float alpha, AbstractNormalLikeOrdersGenerator orderGenerator){
//calculate sin ste... | 1 |
public synchronized ClassInfo loadClass(String className) throws ClassNotFoundException {
// Lots of interesting stuff to do here. For the moment, just
// load the class from the ClassInfoLoader and add it to the
// hierarchy.
className = className.replace('.', '/').intern();
// Check the cache of ClassInfo... | 1 |
public int inserir(Manutencao m){
Connection conn = null;
PreparedStatement pstm = null;
int retorno = -1;
try{
conn = ConnectionFactory.getConnection();
pstm = conn.prepareStatement(INSERT, Statement.RETURN_GENERATED_KEYS);
pstm.setString(1, m.getMoti... | 3 |
public void actionPerformed(ActionEvent evt) {
String response;
try {
Object source = evt.getSource(); //finds the source of the objects that triggers the event
int indexPosition = (Integer) ((JComponent) evt.getSource()).getClientProperty("index"); //variable that represents the... | 5 |
private float getValue(char letter) {
switch (letter) {
case 'I':
return I;
case 'V':
return V;
case 'X':
return X;
case 'L':
return L;
case 'C':
return C;
case... | 9 |
@Test
public void testMoveForward()
{
Random rand = Mockito.mock(Random.class);
// On s'assure que le terrain et toujours franchissable.
Mockito.when(rand.nextInt(Land.CountLand())).thenReturn(0);
Robot r = new Robot();
r.land(new Coordinates(0,0), new LandSensor(rand));... | 4 |
public static void main(String[] args) throws IOException {
// 1. Reading input by lines:
BufferedReader in = new BufferedReader(new FileReader("mao.txt"));
String s, s2 = new String();
while ((s = in.readLine()) != null)
s2 += s + "\n";
in.close();
// 1b. Reading standard input:
BufferedReader stdin =... | 9 |
public void addMessageListener(int type, MessageEventListener messageEventListener) {
try {
switch(type) {
case 0: this.stdmessageEventManager.addEventListener(messageEventListener); break;
case 1: this.authmessageEventManager.addEventListener(messageEventListener); break;
case 2: this.usermessageEvent... | 6 |
public void setState1(State state1) throws IllegalArgumentException{
if(state1 != null)
this.state1 = state1;
else
throw new IllegalArgumentException();
} | 1 |
@BeforeClass
public static void setUpClass() {
clock_ = new LamportClock();
timestampList_ = new ArrayList<Long>();
thread1_ = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 1; i <= events1_; i++) {
clock_.... | 2 |
public long skip( long n )
throws IOException {
if( this.isClosed )
throw new IOException( "This stream was already closed. Cannot skip input." );
if( this.emptyStopMarkSet() )
return this.in.skip( n );
// First call?
if( this.currentStreams[0] == null )
initStreamStack();
return this.currentS... | 3 |
public Taso getTaso() {
return taso;
} | 0 |
public boolean implementedBy(ClassInfo clazz) {
while (clazz != this && clazz != null) {
ClassInfo[] ifaces = clazz.getInterfaces();
for (int i = 0; i < ifaces.length; i++) {
if (implementedBy(ifaces[i]))
return true;
}
clazz = clazz.getSuperclass();
}
return clazz == this;
} | 4 |
protected String getList() {
StringBuilder fileList = new StringBuilder();
File[] files = new File( configPath ).listFiles();
fileList.append( " " );
for ( int i = 0; i < files.length; i++ ) {
if ( files[i].getName().contains( ".txt" ) ) {
fileList.append... | 5 |
public static int ppt2pdf(String srcPath, String destPath) {
File file = new File(srcPath);
if (file.exists()) {
ComThread.InitMTA();
ActiveXComponent ppt = null;
try {
ppt = new ActiveXComponent("Powerpoint.Application");
ppt.setProperty("Visible", new Variant(true));
Dispatch presentations = ... | 4 |
public boolean deleteKey(String key) {
try {
if (METHOD_DELETE_KEY == null) {
METHOD_DELETE_KEY = getMethod(mRoot.getClass(), "WindowsRegDeleteKey", int.class, byte[].class);
}
return ((Integer) METHOD_DELETE_KEY.invoke(mRoot, new Object[] { mRootKey, toCstr(key) })).intValue() == 0;
} catch (Exception... | 2 |
private boolean verifyValidExport() {
for (Link link : story.getAllLinks()) {
// Check if there are any links with no media item
if (link.getMediaItems().isEmpty()) {
JOptionPane.showMessageDialog(null,
"There are Links with no Media items. Add so... | 8 |
protected DatabaseHandler() {
try {
//contructor method to initiate (combo)DataSource for pooled connections on spawning an object.
//initiateDataSource();
initiateDataSource();
} catch (SQLException ex) {
throw new RuntimeException("Something went wrong w... | 1 |
public void testTrackRead()
{
try
{
buildEmptyTrackForTest();
Record r = GetRecords.create().getRecords("fake-empty-tracks-testing").get(0);
for (int i = 1; i <= r.getNumberOfFormatTracks(); i++)
{
assert (r.getFormTrackArtist(i).length() > 0);
... | 2 |
public static double[][] readMatrix(Path path, HamaConfiguration conf,
int rows, int columns, int blockSize) {
int finalRows = getBlockMultiple(rows, blockSize);
int finalCols = getBlockMultiple(columns, blockSize);
double[][] matrix = new double[finalRows][finalCols];
SequenceFile.Reader reader = null;
... | 8 |
public final TMState createBlock(Point point) {
int i = 0;
while (getStateWithID(i) != null)
i++;
OpenAction read = new OpenAction();
OpenAction.setOpenOrRead(true);
JButton button = new JButton(read);
button.doClick();
OpenAction.setOpenOrRead(false);
return getAutomatonFromFile(i, point);
} | 1 |
public Integer insert(MovimientosBeans movi) throws DAOException {
PreparedStatement pst = null;
ResultSet generatedKeys = null;
try {
pst = con.prepareStatement(sql.getString("INSERT_MOVIMIENTOS"),
Statement.RETURN_GENERATED_KEYS);
//INSERT INTO MOVIMIENTOS (IDTIPO_MOVIMIENTO, IDUSUARIOS, IDUNICO_MOV... | 7 |
public void get(int key) {
HashPrinter.tryGet(key);
/** Run along the array */
int runner = 0;
int hash = (key % TABLE_INITIAL_SIZE);
while (table[hash] != null && runner < TABLE_INITIAL_SIZE) {
if (table[hash].getKey() == key) {
break;
}
runner++;
hash = ((key + runner) % TABLE_INITIAL... | 4 |
@Override
public boolean canImport(TransferSupport support) {
return (support.getComponent() instanceof JList) && support.isDataFlavorSupported(RosterTransferComponent.ROSTER_COMPONENT_DATA_FLAVOR);
} | 1 |
private static ArrayList<ResidualEdge> minCostFlowWithPrimalDualSub(
ArrayList<ResidualEdge>[] edges, int[] lastShortestDists, int s, int t) {
int n = edges.length;
ResidualEdge[] prevE = new ResidualEdge[n];
int[] prevV = new int[n];
int[] dist = new int[n];
Arrays.f... | 9 |
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 Bag getDiscsByType(DiscType discType) {
LOGGER.log(Level.INFO, "Getting all discs of type " + discType);
Bag discBag = new Bag();
for (int i = 0; i < discs.size(); i++) {
if (discs.get(i).getDiscType() == discType) {
discBag.addDisc(discs.get(i));
}
... | 2 |
private static int procmemsize(long rnum, String path) {
System.gc();
long musage = memusagerss();
double stime = Utility.time();
long count = -1;
if (path == null) {
int bnum = rnum < Integer.MAX_VALUE ? (int)rnum : Integer.MAX_VALUE;
Map<String, String> map = new HashMap<String, String... | 5 |
@Override
public void update(Observable o, Object arg) {
searchNumber.setText(arg+"");
if (board.getValidAnswer()){
switch(movePlayer){
case moveByA: pointsPlayerA++;
log.finer("Player A was right!");
break;
case moveByB: pointsPlayerB++;
log.finer("Player B was right!");
break;
}
... | 5 |
public void rotCW() {
if (!pause) {
plateau.updatePosition(0, 1);
updateObservers();
}
} | 1 |
public LinkedHashMap<Integer, Persona> cargarPersonaTexto(String nombreFichero) {
LinkedHashMap<Integer, Persona> personas = new LinkedHashMap<>();
Persona p;
FileInputStream fis = null;
ObjectInputStream ois = null;
try {
fis = new FileInputStream(nombreFichero);
... | 5 |
public static double documentRankIDFWeighted(List<String> document, List<String> query, IDFMatrix iDF) {
if(document.isEmpty() && query.isEmpty()) return 1;
if(document.isEmpty() && !query.isEmpty()) return 0;
if(query.isEmpty() && !document.isEmpty()) return 0;
Frequen... | 9 |
public static long bstExperiment(BSTInterface<Long> tree)
{
int choice;
Long number;
startTime = (new Date()).getTime();
for(int i = 0; i < NUMBER_OF_CHOICES; i++)
{
choice = choices[i];
number = numbers[choice];
if(!tree.contains(number))
{
System.out.println("Not found");
br... | 3 |
public final void addDragListeners(final Node n) {
n.setOnMousePressed(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent me) {
startDragX = me.getSceneX();
startDragY = me.getSceneY();
root.setStyle("-fx-opacity:.7;");
}
});
n.setOnMouseReleased(new EventHandler<Mous... | 0 |
@Override
public String compress(String xml) {
if(!enabled || xml == null || xml.length() == 0) {
return xml;
}
//preserved block containers
List<String> cdataBlocks = new ArrayList<String>();
//preserve blocks
xml = preserveBlocks(xml, cdataBlocks);
//process pure xml
xml = processXml(xml)... | 3 |
static void printNumbers(int n){
if(n <= 0){
return;
}
System.out.println(n);
printNumbers(n-2);
printNumbers(n-3);
System.out.println(n);
} | 1 |
public Map<Vertex, Integer> calculate(WeightedNonDirectedGraphImpl<Integer> graph, Vertex<Integer> start) {
processedVertices = new HashSet<Vertex<Integer>>();
unsettledVertices = new HashSet<Vertex<Integer>>();
distances = new HashMap<Vertex, Integer>(graph.numVertices());
for (Vertex... | 7 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, SQLException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
HttpSession session=request.getSession(true);
... | 7 |
public static void print_help_if_requested(List<String> argv, String doc) {
if (argv.isEmpty() || ArrayExtensions.contain(argv, "-h") || ArrayExtensions.contain(argv, "--h")
|| ArrayExtensions.contain(argv, "-help") || ArrayExtensions.contain(argv, "--help")) {
System.err.println(doc);
System.e... | 5 |
private void scruffPolyline(Element element) {
StringBuilder modified = new StringBuilder();
List<Point2D> points = Point2D.parsePoints(element.getAttribute("points"));
for(int i=0, n=points.size()-1; i<n; i++) {
Point2D pn0Orig = points.get(i);
Point2D pn0 = pn0Orig;
... | 4 |
public void setPostalCode(String postalCode) {
Address.setPostalCode(postalCode);
} | 0 |
@Override
public final void update(Graphics g) {
if (graphics == null) {
graphics = g;
}
shouldClearScreen = true;
raiseWelcomeScreen();
} | 1 |
public int[] getIntsArray() {
if (this.getTypeByte() == Encoder.TAG_NULL) return null;
Decoder dec;
try {
dec = this.getContent();
} catch (ASN1DecoderFail e) {
e.printStackTrace();
return null;
}
ArrayList<BigInteger> ints = new ArrayList<BigInteger>();
for(;;){
Decoder val = dec.getFirstObje... | 5 |
public void generateWeapon(int ALG_TYPE, int roundNumber) {
Weapon w;
cw = CalculateWeapon.makeCalc(ALG_TYPE, roundNumber);
w = cw.calculateWeapon();
super.setWeapon(w);
if (ALG_TYPE == 1) {
setPredictedWeapon(null);
} else {
setPredictedWeapon(w);... | 1 |
public void keyup(KeyEvent ev) {
setmods(ev);
if (keygrab == null)
root.keyup(ev);
else
keygrab.keyup(ev);
} | 1 |
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.