text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setReplace(int i, String s) {
this.replaces.set(i, s);
} | 0 |
public void checkWar() {
if(bb.size()>0){
for (int i = 0; i < bb.size(); i++) {
Barb b = (Barb)bb.get(i);
if(grid[b.getX()][b.getY()]==4) {
System.out.println("Farm contact");
setBlock(b.getX(),b.getY(),3);
M... | 6 |
private AlgebraicParticle constructExpression(boolean sign, ArrayList<AlgebraicParticle> list, int exponent) {
if(list.size() == 0) {
//if the exponent isn't one then it needs to be carried over to the number
if(exponent != 1) return Number.ZERO.cloneWithNewSignAndExponent(sign, exponent);
return Number.ZERO... | 7 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0 &&
... | 7 |
public void setInputStream(InputStream inputStream) {
this.inputStream = inputStream;
} | 0 |
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 static int loadProgram(String path, String vertexName, String fragmentName) {
int program = glCreateProgram();
int vertex = glCreateShader(GL_VERTEX_SHADER);
int fragment = glCreateShader(GL_FRAGMENT_SHADER);
StringBuilder vertexSource = new StringBuilder();
StringBuilder fragmentSource = new String... | 6 |
public void setOwner(Owner o){
owner = o;
} | 0 |
public byte[] serialize() {
// 6 bytes for mac
byte[] serialized = new byte[1 + data.length + 13];
serialized[0] = (byte) type.ordinal();
serialized[1] = (byte) ttl;
byte[] mac = getMacAsBytes(this.receiverMac);
for (int i = 2; i <= 7; i++) {
serialized[i] = mac[i - 2];
}
mac = getMacAsBytes(this... | 3 |
public void setSelected( Selection selection ) {
SelectableCapability capability = getCapability( CapabilityName.SELECTABLE );
if( capability != null ) {
Selection old = capability.getSelected();
if( !old.equals( selection ) ) {
capability.setSelected( selection );
}
}
} | 2 |
public void show(TreeNode node) {
if (defaultVisible)
visibleNodes.remove(node);
else
visibleNodes.put(node, null);
} | 1 |
synchronized void unlockContext(int x, int z)
{
for (int xx = 0; xx < 3; xx++)
for (int zz = 0; zz < 3; zz++)
{
Chunk c = getChunk(x + xx - 1, z + zz - 1);
if (c != null)
c.opLock.unlock();
}
taskQueue.addAll(loc... | 3 |
public static void main(String[] args) {
BoardInterface board = new Board();
BoardViewer boardViewer = new BoardViewer();
board.initializeBoard(3);
boardViewer.setViewedBoard(board);
Score score = new Score();
Output oc = new OutputImpl(new ConsoleDisplay());
Player player1 = new HumanPlayer(new P... | 9 |
@Override
public BufferedImage generate() {
BufferedImage completePic = new BufferedImage(xSize, ySize,
BufferedImage.TYPE_INT_RGB);
for (int i = 0; i < xSize; i++) {
for (int j = 0; j < ySize; j++) {
Color newPixel = colGen.getPixel();
completePic.setRGB(i, j, newPixel.getRGB());
}
}
return ... | 2 |
public void newFiles(File file, FilterPanel searchPanel) {
MP3Container temp = showCon;
mainCon.add(file, searchPanel);
if (temp == showCon) {
update();
}
} | 1 |
private void recieveHandshake() throws IOException {
ByteBuffer ch = ByteBuffer.allocate((this.remoteHandshake != null ? this.remoteHandshake.capacity() : 0) + this.buffer.capacity());
if (this.remoteHandshake != null) {
this.remoteHandshake.rewind();
ch.put(this.remoteHandshake)... | 9 |
@Override
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
if (kirjaudutaankoUlos(request)) {
kirjauduUlos(request, response);
} else if (... | 4 |
public static void main(String[] args) {
BufferedReader reader;
File file = new File("D:/www/tmp/10.183.131.236-20150309-php_2701sell.log");
String root = "d:/www/tmp/";
Map<String, FileWriter> fileWriteMap = new HashMap();
String[] typeArray = new String[]{"tid"};//$act, $value,... | 6 |
@Override
public void shade(Color outIntensity, Scene scene, Ray ray, IntersectionRecord record, int depth) {
// TODO: fill in this function.
// You may find it helpful to create helper methods if the code here gets too long.
Vector3 outgoing = new Vector3(ray.direction);
outgoing.scale(-1);
outgoing.normali... | 8 |
public void processFire(Bullet bullet) throws Exception {
this.bullet = bullet;
int step = 1;
while ((bullet.getX() > -14 && bullet.getX() < 590) && (bullet.getY() > -14 && bullet.getY() < 590)) {
if (bullet.getDirection() == Direction.UP) {
bullet.updateY(-step);
} else if (bullet.getDirection() == Dir... | 9 |
public boolean checkNeighbors(mxGraph graph, Object edge, Object source,
Object target)
{
mxIGraphModel model = graph.getModel();
Object sourceValue = model.getValue(source);
Object targetValue = model.getValue(target);
boolean isValid = !validNeighborsAllowed;
Iterator<String> it = validNeighbors.iterato... | 5 |
public Object getValueAt(int rowIndex, int columnIndex) {
switch (columnIndex) {// parcour par colonne
case 0://colonne id_Stock
return medicaments.get(rowIndex).getId_mdc();
case 1://colonne id_Stock
return medicaments.get(rowIndex).getRef();
... | 6 |
public boolean removeClientConnected(ServerHandleConnect serverHandleConnect) {
for (int i = 0; i < this.serverHandleConnectList.size(); i++) {
if (serverHandleConnectList.get(i) == serverHandleConnect) {
serverHandleConnectList.remove(i);
this.curconnected--;
}
}
if (this.curconnected <= 0) {
re... | 3 |
private char[] generatePasswd(char []inputval) throws IOException {
char[] lineBuffer;
char[] buf;
int i;
buf = lineBuffer = new char[128];
int room = buf.length;
int offset = 0;
int c;
int index = 0;
int lenofinputval = inputval.length;
System.out.println("D... | 8 |
@Test
public void testLexer()
{
Random rand = new Random();
List<TokenType> types = new ArrayList<TokenType>();
StringBuilder sb = new StringBuilder();
final int max = TokenType.values().length;
for(int i = 0; i < 10000; i++)
{
TokenType type = TokenType.values()[rand.nextInt(max)];
types.add(type)... | 6 |
public String getDate() {
return date;
} | 0 |
private static void loadEventsFromFile() throws FileNotFoundException, IOException {
File eventsTxt = new File("events.txt");
if(!eventsTxt.exists()){
eventsTxt.createNewFile();
}
try(BufferedReader br = new BufferedReader(new FileReader("events.txt"))) {
StringBuilder sb = new StringBuilder()... | 5 |
public boolean stop() {
if (!(started)) {
return false;
}
started = false;
plugin.getBroadcaster().alertEveryone(this, "The game is over!");
if (taskId != -1) {
plugin.getServer().getScheduler().cancelTask(taskId);
taskId = -1;
}
for (String player : deadPlayers) {
Player p = plugin.getServer(... | 6 |
private void populateData() {
String sharedDir = Configuration.getConfig(Configuration.CONFIG_SHARED_FILESYSTEM_PATH);
String cluster = Configuration.getConfig(Configuration.CONFIG_SGE_CLUSTER);
String location = Configuration.getConfig(Configuration.CONFIG_SGE_ROOT);
String sp... | 7 |
public final void reserve(int count) throws VerifyException {
if (stackHeight + count > maxHeight) {
maxHeight = stackHeight + count;
if (maxHeight > stack.length)
throw new VerifyException("stack overflow");
}
} | 2 |
public void drawPalette(int spanInPixels, TerrainTypes terrain, Vector<Boolean> desiredFeatures) {
String[] features = {"Bonus","Road","Railroad","Irrigation","Village","City"};
String[] abbr = {"+", "", "", "i", "V", "1"};
features[0] = terrain.getBonusDescription(... | 8 |
public static List<Class<?>> getAllInterfacesIncludingSuper(Class<?> c)
{
ArrayList<Class<?>> res = new ArrayList<Class<?>>();
while (c != null)
{
res.addAll(getAllInterfaces(c));
c = c.getSuperclass();
}
return res;
} | 5 |
public void setState(ShotType shotType)
{
type = shotType;
switch(type)
{
case PISTOL:
body.setMass(1.5d);
body.setVelocity(new Vector3d(0.0d, 0.0d, 20.0d));
body.setAcceleration(new Vector3d(0.0d, -0.5d, 0.0d));
body.setDamping(0.99d, 0.8d);
radius = 0.2d;
break;
case ARTI... | 4 |
private static ArrayList<int[]> rleToList(RunLengthEncoding rle) {
ArrayList<int[]> runs = new ArrayList<int[]>();
for (RunIterator it = rle.iterator(); it.hasNext();)
runs.add(it.next());
return runs;
} | 1 |
public SchlangenGlied getPreviousGlied() {
return previousGlied;
} | 0 |
public boolean nonIPnonMonsterWithMe(MOB me)
{
if((me.location()!=null)&&(me.session()!=null))
{
final Room R=me.location();
for(int i=0;i<R.numInhabitants();i++)
{
final MOB M=R.fetchInhabitant(i);
if((M==null)||(M==me))
continue;
if((M.session()!=null)&&(M.session().getAddress().equals... | 7 |
@Override
public void render(Graphics g) {
for(int y = 0; y < tiles[0].length; y++)
for(int x = 0; x < tiles.length; x++)
perspective.render(g, tiles[x][y]);
for(int y = 0; y < tiles[0].length; y++)
for(int x = 0; x < tiles.length; x++)
for(Entity entity : tiles[x][y].getEntities())
perspective... | 5 |
public JButton getjButtonPrevious() {
return jButtonPrevious;
} | 0 |
@Override
public boolean isManagingFocus() {return true;} | 0 |
private void profileListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_profileListMouseClicked
// Handles right clicks and double clicks on the Profile List
if(evt.getClickCount() == 2){
try {
if(evt.getX() <= 16){
// Clicked on the icon
... | 8 |
public void mouseMoved(MouseEvent e)
{
if (!gameWon && board.getWhoseTurn() == 2)
{
mouseX = e.getX();
mouseY = e.getY();
if (mouseX > grid.getGridX() + grid.getDiameter()/2 && mouseX < grid.getGridX() + grid.getGridWidth() - grid.getDiamet... | 6 |
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 fe... | 6 |
private byte[] get_img_stream(File dot, String type)
{
File img;
byte[] img_stream = null;
try {
img = File.createTempFile("graph_", "."+type, new File(GraphViz.TEMP_DIR));
Runtime rt = Runtime.getRuntime();
// patch by Mike Chenault
String[] args = {D... | 4 |
public void installEditPolicy(Object key, EditPolicy editPolicy) {
Assert.isNotNull(key, "Edit Policies must be installed with keys");//$NON-NLS-1$
if (policies == null) {
policies = new Object[2];
policies[0] = key;
policies[1] = editPolicy;
} else {
int index = 0;
while (index < policies.length &... | 8 |
private Class getCommandClass(HttpServletRequest request) {
final String CLASS_PATH = "com.study.vital.webApp.commands.";
Class result;
final String commandClassName;
if(request.getParameter(Attributes.COMMAND)==null){
commandClassName = CLASS_PATH;
} else {
... | 2 |
@Override
public void updateLong() {
super.updateLong();
if(generationTimerEnd == 0) {
resetGenerationTimer();
}
if(generationTimerEnd <= System.currentTimeMillis() && this.isActivated()) {
placeableManager.playerAddItem("Platinum", 1);
... | 3 |
private void attemptLogin(){
name = tfUsername.getText();
password = new String(pfPassword.getPassword());
if(name.isEmpty()||password.isEmpty()){
tfUsername.setText("");
lblLoginError.setText("Incorrect Login Credentials");
}
else{
ip = tfServerIp.getText();
int connected = co... | 5 |
private void registerActionListeners() {
view.btnSave.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
boolean written = false;
Object[] options = { "Yes", "No" };
int result = JOptionPane.showOptionDialog(null, "Would you like to save your level?", "Save", JOptionP... | 5 |
private void deleteCase5(RBTreeNode<K,V> node) {
if (node == node.parent.left &&
nodeColor(node.sibling()) == Color.BLACK &&
nodeColor(node.sibling().left) == Color.RED &&
nodeColor(node.sibling().right) == Color.BLACK) {
node.sibling().color = Color.R... | 8 |
private void processNodeTag(Attributes attributes) {
byte[] node = null;
long lastTS = 0;
short lastClockSeq = 0;
for (int i = 0; i < attributes.getLength(); i++) {
String attributeName = attributes.getLocalName(i);
if ("".equals(attributeN... | 9 |
public SynchronizedLyric(String text, int timeStamp)
{
if (text == null || text.trim().length() == 0)
throw new IllegalArgumentException("The text field in a synchronized lyric, " + text + ", in the " + FrameType.SYNCHRONIZED_LYRIC_TEXT.getId() + " frame may not be empty.");
if (timeStamp < 0)
... | 3 |
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
String input= userNameField.getText();
if (OK.equals(cmd) && !input.trim().equals("")) {
if (checkAccount(input)==true) { //if account exists
controllingFrame.setVisible(false);
... | 7 |
public static void merge(int[] result, int[] left, int[] right) {
int i1 = 0; // index into left array
int i2 = 0; // index into right array
for (int i = 0; i < result.length; i++) {
if (i2 >= right.length || (i1 < left.length &&
... | 4 |
void addTriangle(int vertexA, int vertexB, int vertexC) {
if (vertexValues != null
&& (Float.isNaN(vertexValues[vertexA]) || Float.isNaN(vertexValues[vertexB]) || Float
.isNaN(vertexValues[vertexC])))
return;
if (Float.isNaN(vertices[vertexA].x) || Float.isNaN(vertices[vertexB].x) || Float.isNaN(vertic... | 9 |
@Override
public String toString()
{
return String.format( "or(%s, %s)", this.a, this.b );
} | 0 |
public boolean shellCollideCheck(Shell shell)
{
if (deadTime != 0) return false;
float xD = shell.x - x;
float yD = shell.y - y;
if (xD > -16 && xD < 16)
{
if (yD > -height && yD < shell.height)
{
world.sound.play(Art.samples[Art.SAMP... | 7 |
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte) {
byte b0 = 4;
byte b1 = 16;
byte b2 = 63;
int k = b0 + 1;
byte b3 = 17;
int l = b0 + 1;
this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGe... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CarsModel carsModel = (CarsModel) o;
if (idCars != carsModel.idCars) return false;
if (makeId != carsModel.makeId) return false;
if (mo... | 9 |
public Vector findPointForWall(double x, double y){
double xRes = -1, yRes = -1,r = 100000;
for (Wall wall:walls){
if (sqrt((x - wall.getX1()) * (x - wall.getX1()) + (y - wall.getY1()) * (y - wall.getY1())) < RADIUS_TO_DETECT_WALL_POINT &&
r > sqrt((x - wall.getX1()) * (... | 6 |
public IBomber getOwner() {
return owner;
} | 0 |
private long getNext() {
boolean primeFound = false;
if (numPrimesFound == 0) {
primesFound.add(2l);
maxPrimeFound = 2;
numPrimesFound = 1;
maxNumberSearched = 2;
return (long) 2;
}
for (long i = maxNumberSearched+1; !primeFound; i++) {
// test if i is prime
// divide by all primes <= sqr... | 5 |
public void makePlain() {
if (this.isDisposed()) {
return;
}
isBold = false;
setFont(null);
} | 1 |
public SizedStack(int size) {
super();
this.maxSize = size;
} | 0 |
public static void main(String[] args) {
TransferQueue<String> stringTransferQueue = new LinkedTransferQueue<>();
try {
stringTransferQueue.put("Await receipt");
} catch (InterruptedException e) {
e.printStackTrace();
}
TransferQueueExample transferQueue =... | 1 |
public static void main( String[] args )
{
int loopLimit = 100;
int count = 0;
while ( count < loopLimit )
{
if ( count % 2 == 0 )// check if the "count" is completely divisible by 2
{
System.out.println( count );
}
cou... | 2 |
public static Cons cppGetMethodDefinitions(Stella_Class renamed_Class, Object [] MV_returnarray) {
{ Cons publicmemberfuncdefs = Stella.NIL;
Cons protectedmemberfuncdefs = Stella.NIL;
{ Slot slot = null;
Cons iter000 = renamed_Class.classLocalSlots.theConsList;
for (;!(iter000 == Stell... | 9 |
public void settime (String s)
{
StringParser p = new StringParser(s);
if ( !p.skip("Game")) return;
int g = p.parseint();
if (p.error()) return;
p.skipblanks();
if ( !p.skip("I:")) return;
String w = p.parseword();
p.skipblanks();
if ( !p.skip("(")) return;
int w1 = p.parseint();
int w2 = p.pars... | 8 |
@Override
public String toString() {
final int maxNumber = m.length * m.length - 1;
final int fieldLength =
Math.max(5, (int)(Math.floor(Math.log10(maxNumber))) + 1);
final StringBuilder sb = new StringBuilder();
final StringBuilder ALL = new StringBuilder(8... | 9 |
private TrainNumber CreateK600K597() {
TrainNumber rs = new TrainNumber();
rs.setId(UUID.randomUUID());
rs.setName("K600/K597");
Route route = new Route();
route.setId(UUID.randomUUID());
route.setStartDate(new LocalDate(0L));
route.setEndDate(LocalDate.now().plusYears(10));
rs.getRoutes().a... | 1 |
public String toString() {
int reporterGroupSize = -1;
if (reporterGroup != null) {
reporterGroupSize = reporterGroup.size();
}
int blGroupSize = -1;
SampleGroup baselineGroup = getBaselineGroup();
if (baselineGroup!=null) {
blGroupSize = baselineGroup.size();
}
Sa... | 5 |
private static void fw_write(String msg, String file)
{
//System.out.print(msg);
FileWriter fwriter = null;
try
{
fwriter = new FileWriter(file, true);
} catch (Exception ex)
{
ex.printStackTrace();
System.out.println("Unwanted err... | 3 |
FormAttachment setAttachment (String attachment) {
String control, align;
int position, offset;
int comma = attachment.indexOf (',');
char first = attachment.charAt (0);
if (Character.isLetter(first)) {
/* Case where there is a control */
control = attachment.substring (0, comma);
int i = 0;
while... | 6 |
@Override
public void disablePlugin(Plugin plugin) {
Validate.isTrue(plugin instanceof InjectablePlugin, "Plugin is not associated with this PluginLoader");
if (plugin.isEnabled()) {
String message = String.format("Disabling %s", plugin.getName());
plugin.getLogger()... | 4 |
private void saveLibraryEntry(LibraryEntry libraryEntry, List<SlateObject> filterList, boolean saveChallengeMonster)
{
List<Piece> pieces = new ArrayList<Piece>();
Iterator<Entry<Integer,Map<Long,SlateObject>>> iterator = slateComponent.getObjectMap().entrySet().iterator();
while (iterator.hasNext())
{
En... | 8 |
private static Cell construct(Sequence s1, Sequence s2, float[][] matrix,
float o, float e, byte[] pointers, short[] lengths) {
logger.info("Started...");
char[] a1 = s1.toArray();
char[] a2 = s2.toArray();
int m = s1.length() + 1; // number of rows in similarity matrix
... | 9 |
public ByteBuffer getBuffer(){
if(this.currentBufferQueue == null){
this.currentBufferQueue = new ConcurrentLinkedQueue<ByteBuffer>();// 当前正在处理的缓冲区队列
}
if(this.currentByteBuffer == null || this.currentByteBuffer.remaining() <= 0){
this.currentByteBuffer = BufferPool.getInstance().getBuffer();
this.... | 3 |
public List<Integer> determinePrizePool() {
List<Integer> tempList = new ArrayList<Integer>();
int numu = getAllUsers().size();
if (numu <= 0) { // no users
return null;
} else if (numu == 1) {
// one user, he gets the whole pool
tempList.add(getTotalAmount());
} else if (numu == 2) {
// two ... | 3 |
public void visit_dload(final Instruction inst) {
final int index = ((LocalVariable) inst.operand()).index();
if (index + 2 > maxLocals) {
maxLocals = index + 2;
}
if (inst.useSlow()) {
if (index < 256) {
addOpcode(Opcode.opc_dload);
addByte(index);
} else {
addOpcode(Opcode.opc_wide);
... | 8 |
public int removeDuplicates(int[] A) {
int length = A.length;
int i =0;
while (i < length)
{
if (i < length -1 && A[i] == A[i+1])
{
i++;
}
int j = i + 1;
while (j <= length -1 && A[j] == A[j-1])
{
j++;
}
if (j == len... | 8 |
private void setupDocumentLayer ( )
{
documentPresentationLayer = new DefaultStyledDocument()
{
private static final long serialVersionUID = 1L;
public void insertString (int offset, String str, AttributeSet a) throws BadLocationException {
super.insertString... | 8 |
public ArrayList getAttributeList(Filter filter)
{
// check for errors first
int rcID = getReplicaCatalogueID();
if (filter == null || rcID == -1) {
return null;
}
ArrayList attrList = null;
int eventTag = DataGridTags.CTLG_FILTER;
Object[] packet... | 3 |
public static int pideInt(String texto) {
InputStreamReader flujo=new InputStreamReader(System.in);
BufferedReader teclado=new BufferedReader(flujo);
String cadnum;
int numero=0;
boolean correcto;
do {
try {
correcto=true;
... | 3 |
void radb3(int ido, int l1, final double cc[], double ch[],
final double wtable[], int offset)
{
final double taur=-0.5D;
final double taui=0.866025403784439D;
int i, k, ic;
double ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
int iw1, ... | 4 |
public IntegerGenerator(String tableName, String columnName, int start) {
super(tableName, columnName);
this.start = start;
this.current = start;
} | 0 |
@Override
public float millisecondsPlayed()
{
// get number of samples played in current buffer
float offset = (float)AL10.alGetSourcei( ALSource.get( 0 ),
AL11.AL_BYTE_OFFSET );
float bytesPerFrame = 1f;
switch( ALformat )
... | 5 |
private void infect() {
for (int i = 0; i < Integer.parseInt(Config
.getProperty("Grid.Infected")); i++) {
// Position x
int x = (int) (grid.getWidth() * Math.random());
// Position y
int y = (int) (grid.getDepth() * Math.random());
... | 6 |
public boolean isWalls(){
if(this.heading%(Math.PI/2)!=0) return false;
if((this.x>=17 && this.x<=19) || (this.x>=781 && this.x<=783) || (this.y>=17 && this.y<=19) || (this.y>=581 && this.y<=583) ) return true;
return false;
} | 9 |
public void traverseTree(IHuffmanNode node, int[] word, int depth, HeaderInfo headerInfo) {
//empty node
if (node == null)
return;
//Node is leaf, attach code
if (node.isLeaf()) {
((Word) node.getWord()).setOutputParam(
word,
... | 9 |
@Override
public void changeImage(ImageMovementState movementState, ImageRotationState rotationState)
{
switch (movementState)
{
case Idle:
imageMovementState = ImageMovementState.Idle;
switch (rotationState)
{
cas... | 8 |
public void setDetermineImageNumber(boolean newValue)
{
determineNumberOfImages = newValue;
} | 0 |
public int getEncodedMotorPosition(int motor)
{
if (!isConnected())
{
error("Robot is not connected!", "RXTXRobot", "getEncodedMotorPosition");
return -1;
}
if (!getOverrideValidation() && (motor < RX... | 5 |
public void testDajZauzeteSobe() {
java.util.Date datumOD= new java.util.Date();
java.util.Date datumDO= new java.util.Date();
java.util.Date rezervisanoOD= new java.util.Date();
java.util.Date rezervisanoDO= new java.util.Date();
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");... | 4 |
public static Class<?> findCommonElementType(Collection<?> collection) {
if (isEmpty(collection)) {
return null;
}
Class<?> candidate = null;
for (Object val : collection) {
if (val != null) {
if (candidate == null) {
candidate = val.getClass();
} else if (candidate != val.getClass()) {
... | 8 |
@Override
public void nodeDataChanged(ZVNode node) {
boolean updateView = false;
if (nodes != null) {
for (int i = 0; i < nodes.length; i++) {
if ((nodes[i] == node)) {
updateView = true;
}
}
... | 4 |
public List getNextElements(int count)
throws IteratorException {
int i = 0;
Object object = null;
LinkedList list = new LinkedList();
if (listIterator != null) {
while (listIterator.hasNext() && (i < count)) {
object = listIterator.next();
list.add(object);
i++;
... | 3 |
private TextBlock getCircledCharacter(ILeaf entity, ISkinParam skinParam) {
final Stereotype stereotype = entity.getStereotype();
if (stereotype != null && stereotype.getSprite() != null) {
return skinParam.getSprite(stereotype.getSprite()).asTextBlock(stereotype.getHtmlColor());
}
if (stereotype != null && ... | 8 |
private NamesManager()
{
} | 0 |
public static void main(String[] args) {
for (int i = 0; i < 5; i++)
new Thread(new LiftOff()).start();
System.out.println("Waiting for LiftOff");
} | 1 |
public void forceClose(){
try{
this.fileChannel.close();
this.fileOutputStream.close();
}catch(Exception e){
e.printStackTrace();
try{
this.fileChannel.close();
this.fileOutputStream.close();
}catch(Exception e1){
e1.printStackTrace();
}
}finally{
this.file.delete();// 丢弃损害的文件... | 2 |
private void saveImage(){
if (this.jLabelImage.getIcon()!=null){
ImageProcessing.imageFormat extension;
switch(this.jComboBox1.getSelectedItem().toString()){
case "BMP":
extension= ImageProcessing.imageFormat.bmp;
break;
ca... | 5 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.