text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void shutdown() {
System.out.println("Stopping Object Remote Service");
lrs.stop();
System.out.println("Joining Service Thread");
try {
tp.join();
System.out.println("Thread " + tp.toString() + "succesull closed");
} catch (InterruptedException e1){
e1.printStackTrace();
}
i... | 4 |
protected void UpdateLineColumn(char c)
{
column++;
if (prevCharIsLF)
{
prevCharIsLF = false;
line += (column = 1);
}
else if (prevCharIsCR)
{
prevCharIsCR = false;
if (c == '\n')
{
prevCharIsLF = true;
}
else
line += (column = 1);
... | 6 |
public void register(Class<? extends Command> c) {
CommandInfo info = c.getAnnotation(CommandInfo.class);
if (info == null) return;
try {
commands.put(info.pattern(), c.newInstance());
}
catch (Exception e) {
e.printStackTrace();
}
} | 3 |
public String depict() {
switch (type) {
case CONQUER: return "The army of " + subject() + " conquering " + gobject();
case DEFEAT: return "The army of " + subject() + " vanquishing the army of " + gobject();
case RESTING: return subject() + " sleeping";
case SEXING: return subject() + " mating with " + gobje... | 5 |
public void dfsRec(Node rt) //prefix traversal & DFS seems same
{
if(rt == null)
return;
else
{
System.out.print(rt.value+" ");
dfsRec(rt.left);
dfsRec(rt.right);
}
} | 1 |
private Map<String, Set<String>> mergeIdentities(
Collection<PersonIdent> persons) {
Map<String, Set<String>> namesToEmails = new TreeMap<String, Set<String>>(
caseInsensitveComparator);
namesToEmails.putAll(RepositoryUtils.mapNamesToEmails(persons));
Map<String, Set<String>> emailsToNames = RepositoryUtil... | 9 |
protected static String normaliseTag(String tag) {
StringBuffer nt = new StringBuffer();
for(char c : tag.toLowerCase().toCharArray()) {
if((int)c >= 0x20 && (int)c <= 0x7d &&
(int)c != 0x3d) {
nt.append(c);
}
}
return nt.toStri... | 4 |
public boolean scramble(String a, String b, int p, int q, int len) {
if (flag[len][p][q] != 0)
return (flag[len][p][q] == 1 ? true : false); // 已经计算过
if (a.substring(p, p + len + 1).equals(b.substring(q, q + len + 1))) { // 子串相等
flag[len][p][q] = 1;
return true;
}
for (int i = p + 1; i < p + len + 1; i... | 8 |
@SuppressWarnings("unchecked")
public synchronized long generateWayId(String key, List<Long> nodes, List<String> shapes ){
Long id = null;
if (totalWays.get(key) == null)
totalWays.put(key, new ConcurrentHashMap<WayOsm, Long>());
if (!totalWays.isEmpty())
id = totalWays.get(key).get(new WayOsm(nodes));
... | 5 |
public boolean getBoolean(int index) {
Object value = get(index);
if (Boolean.TRUE.equals(value) || value instanceof String && "true".equalsIgnoreCase((String) value)) { //$NON-NLS-1$
return true;
}
return false;
} | 3 |
public ArrayList<String> connect(String tableName) {
Connection con = null;
ResultSet rs = null;
Statement st = null;
String url = "jdbc:mysql://musoni.c4leprqodag9.eu-west-1.rds.amazonaws.com/musoni";
String user = "student";
String password = "cfg2014!";
try {
Class.forName("com.mysql.jd... | 3 |
public void run() {
java.net.Socket socket;
// accept a connection
try {
socket = server.accept();
} catch (java.io.IOException e) {
System.out.println("Class Server died: " + e.getMessage());
e.printStackTrace();
return;
}
// create a new thread to accept the next conn... | 5 |
protected void adaptNegative(){
int newOriginX = originX, newOriginY=originY, newWidth=width, newHeight=height;
if(width<0 && height<0){
newOriginX = originX+width;
newOriginY = originY+height;
newWidth = width*-1;
newHeight = height*-1;
}else if(width<0){
newOriginX = originX+width;
newWidth = ... | 4 |
public Token scan() {
Token tok;
SourcePosition pos;
int kind;
boolean isDiv;
currentlyScanningToken = false;
while(currentChar == '/'
|| currentChar == ' '
|| currentChar == '\n'
|| currentChar == '\r'
|| ... | 6 |
public int removeAt(int index)
{
if(isEmpty())
throw new ArrayIndexOutOfBoundsException();
int temp = ListArray[index];
for(int i = index; i < size; i++)
ListArray[i] = ListArray[i+1];
size--;
System.out.print("Removed Element: " + temp + "\n");
System.out.println(" ");
return temp;
} | 2 |
private Location findFood()
{
Field field = getField();
List<Location> adjacent = field.adjacentLocations(getLocation());
Iterator<Location> it = adjacent.iterator();
while(it.hasNext()) {
Location where = it.next();
Object animal = field.getObjectAt(where);
... | 5 |
public void processSrcDirMessage(OMMMsg respMsg)
{
// *_log<<"Received source directory response"<<endl;
myCallback.notifyStatus("Received source directory response");
if (respMsg.getMsgType() == OMMMsg.MsgType.REFRESH_RESP
|| respMsg.getMsgType() == OMMMsg.MsgType.UPDATE_RE... | 6 |
public void removePoints(ArrayList<Point> points) {
for (int i = 0; i < attachedPoints.size(); i++) {
if (points.contains(attachedPoints.get(i)))
attachedPoints.set(i,null);
}
attachedPoints.removeAll(Collections.singleton(null));
} | 2 |
public int doRTTY_8000FFT (CircularDataBuffer circBuf,WaveData waveData,int start,int ss,double baud) {
// 45.45 baud
if (baud==45.45) {
// Get the data from the circular buffer
double datar[]=circBuf.extractDataDouble(start,FFT_176_SIZE);
fft176.realForward(datar);
double spec[]=getSpect... | 9 |
public int minimumTotal(ArrayList<ArrayList<Integer>> triangle) {
if(triangle == null )
return 0;
List<Integer> list = triangle.get(triangle.size()-1);
int[] min = new int[list.size()];
for(int i = 0 ; i < list.size(); i++)
min[i] = list.get(i);
for(int i ... | 4 |
@Override
public int compareTo (Result o) {
if (value == null) {
return o.value == null ? 0 : 1;
}
if (o.value == null) {
return -1;
}
if (value.getClass() == o.value.getClass()) {
if (value instanceof String) {
return ((String) value).compareToIgnoreCase((String) o.value);
}
if (value ins... | 6 |
private boolean isAppendable(final AngleUnitFlapPattern pattern, final int from, final Piece piece) {
int tailOfAddition = from + piece.size() - 1;
// overlength.
if (tailOfAddition > tailIndex) {
trace("not appendable: index overrun");
return false;
}
// empty?
for (int i = from + 1; i < tailOfAdd... | 7 |
public Point2D.Float locatePoint()
{
final int TIME_UP = 600;
AIPlane thisP = AIPlane.this;
GameWorld world = thisP.getGameWorld();
Point2D.Float p = thisP.getCenterPoint();
if(currentMode == RANDOM_MODE)
{
if(point.distance(p) < 2.0) //CONSTANT
{
currentMode = FIND_MODE;
time ... | 6 |
public void visitThrowStmt(final ThrowStmt stmt) {
print("throw ");
if (stmt.expr() != null) {
stmt.expr().visit(this);
}
println(" caught by " + stmt.catchTargets());
} | 1 |
private byte[] Encode (int input[], int len) {
int i, j;
byte out[];
out = new byte[len];
for (i = j = 0; j < len; i++, j += 4) {
out[j] = (byte) (input[i] & 0xff);
out[j + 1] = (byte) ((input[i] >>> 8) & 0xff);
out[j + 2] = (byte) ((input[i] >>> 16) & 0xff);
out[j + 3] = (by... | 1 |
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch ... | 4 |
public static void main( String[] argv ) {
ProcessableResource pr = null;
try {
java.util.List<String> command = new java.util.LinkedList<String>();
// This will print the directory contents of cwd (Linux only)
//command.add( "ls" );
//command.add( "-l" );
// This will call the PHP interpr... | 3 |
* @param direction The direction in which to attack.
*/
private void moveAttack(Unit unit, Direction direction) {
clearGotoOrders(unit);
// Extra option with native settlement
Tile tile = unit.getTile();
Tile target = tile.getNeighbourOrNull(direction);
IndianSettlement... | 7 |
public PacketIOException(IOException e, Packet packet) {
super("IOException sending packet" + (e == null ? "." : "--" + e.getMessage()), packet);
wrappedException = e;
} | 1 |
public synchronized List<Long> getNodesIds(int pos){
if (nodes.size()>pos)
return nodes.get(pos);
else
return null;
} | 1 |
public static String coerceToModuleName(Stella_Object namespec, boolean warnP) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(namespec);
if (Surrogate.subtypeOfStringP(testValue000)) {
{ StringWrapper namespec000 = ((StringWrapper)(namespec));
return (namespec000.wrapperValue);... | 8 |
public int getInt(String key) throws JSONException {
Object object = this.get(key);
try {
return object instanceof Number
? ((Number)object).intValue()
: Integer.parseInt((String)object);
} catch (Exception e) {
throw new JSONException("JSO... | 2 |
public BEValue peerAnswerAsBEValue(TrackedPeer peer)
throws UnsupportedEncodingException {
Map<String, BEValue> params = new HashMap<String, BEValue>();
params.put("interval", new BEValue(this.announceInterval));
params.put("complete", new BEValue(this.seeders()));
params.put("incomplete", new BEValue(this.l... | 5 |
public static void main(String[] args) {
String traceFile, ignoreFile, knownFile, tmp;
int stackLimit = 50;
CommandLine cmd = null;
Options options = new Options();
options.addOption("f", "trace_file", true,
"dalvik method profiling trace file");
options.addOption("i", "ignore_pattern_list", true,
"... | 8 |
public static void main(String[] args) {
if (args.length == 0 || "-h".equals(args[0]) || "--help".equals(args[0])) {
System.out.println("Purpose: Transforms the POM files to use Debian versions.");
System.out.println("Usage: [option] <poms>");
System.out.println("");
... | 7 |
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
DaoFactory daoFactory = MySqlFactory.getDaoFactory();
OrderDao orderDao = daoFactory.getOrderDao(daoFactory.getConnection());
HttpSession session = request.getSession();
try {
List<O... | 3 |
public synchronized void close()
{
if (isOpen())
{
closeImpl();
setOpen(false);
decoder = null;
}
} | 1 |
public void writeImage(String path, String ext, BufferedImage img) {
try {
File f = new File(path);
f.delete();
ImageIO.write(img, ext, f);
} catch (Exception e) {
ConsoleHelper.appendError("Error while saving file.");
ConsoleHelper.appendErro... | 1 |
/* */ @EventHandler
/* */ public void onPlayerDamage(EntityDamageEvent event)
/* */ {
/* 148 */ if ((event instanceof EntityDamageByEntityEvent))
/* */ {
/* 150 */ EntityDamageByEntityEvent event1 = (EntityDamageByEntityEvent)event;
/* */
/* 152 */ if ((event1.getDamager()... | 5 |
long nthWeekday(int n, int weekday,
int year, int monthOfYear, int dayOfMonth)
{
if (n > 0) {
return 7 * n + weekdayBefore
(fixedFromGJ(year, monthOfYear, dayOfMonth), weekday);
} else {
return 7 * n + weekdayAfter
(fixedFro... | 1 |
public final void setSliderPercent(int sliderIndex, double sliderPercent)
{
// Check sliderIndex is within array bounds,
// if not create exception.
if (sliderIndex < 0 || sliderIndex >= sliders.size())
{
Tools.errorWindow(new IndexOutOfBoundsException(
"The index you passed into the '... | 6 |
public void turnDown() {
turnOffCommand.execute();
} | 0 |
private void workOutServer() {
try {
Set<SelectionKey> keySet = ((Selector) this.serverTable.get(curServer)[1]).selectedKeys();
for (SelectionKey key : keySet) {
// System.out.println("new Key!");
if ((key.readyOps() & SelectionKey.OP_READ) == SelectionKey.... | 9 |
public void writeKnownAttributes(GrowableConstantPool gcp,
DataOutputStream output) throws IOException {
if (constant != null) {
output.writeShort(gcp.putUTF8("ConstantValue"));
output.writeInt(2);
int index;
if (typeSig.charAt(0) == 'J' || typeSig.charAt(0) == 'D')
index = gcp.putLongConstant(cons... | 5 |
public File createProjectFilename( TProject project )
{
File file = project.getProjectFile() ;
if ( file == null )
{
TProjectFileList fList = project.getProjectData().getAvailableLangs() ;
if ( fList.size() > 0 )
{
TLanguageFile lFile = fList.get( 0 ) ;
if ( lFile != null... | 5 |
public static ArrayList<Reservation> getAllReservations(){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<Reservation> reservationL... | 5 |
public void nextQuestion()
{
if(i == QuestionCount -1 )
{
i = 0;
}
else
{
// Current Question Id incremented by 1
i++;
}
// Display question in form
this.setUp();
} | 1 |
@Override
public Matrix run(Matrix coef, Matrix free) {
assert(free.getWidth() == 1);
Matrix b1 = new Matrix(coef.getHeight(), coef.getWidth());
Matrix b2 = new Matrix(coef.getHeight(), coef.getWidth());
Matrix ieb = new Matrix(coef.getHeight(), coef.getWidth());
Matrix c = n... | 8 |
public boolean getLimiteEnlace()
{
if(this.jRadioButton1.isSelected())
return true;
return false;
} | 1 |
public void printGridletList(boolean detail)
{
LinkedList list = receiveList_;
String name = name_;
int size = list.size();
Gridlet gridlet = null;
String indent = " ";
System.out.println();
System.out.println("============= OUTPUT for " + name + " ======... | 3 |
public Object getObject(int x, int y) {
if (x < 0 || x >= WIDTH || y < 0 || y >= HEIGHT) {
if (ChristmasCrashers.isDebugModeEnabled())
System.err.println("Failed to retrieve the object at the tile location (" + x + ", " + y + ") - index out of bounds.\nThe x value must be between 0 and " + (WIDTH - 1) + ", and... | 5 |
public static void generateContextAndBlanks(GRESCTask task, List<String> context, List<List<GRESCBlank>> blanks) {
String[] tokens = task.getSentence().split(" ");
for (String token : tokens) {
if (! GRESCTask.GRE_FORMAT_BLANK_INDICATOR.equals(token)) {
context.add(token);
}
}
List<GRESCOption> opt... | 6 |
public void readMap(){
try {
Scanner scan = new Scanner(new File(file));
width = scan.nextInt();
height = scan.nextInt();
tiles = new Tile[height][width];
int temp;
for(int h = 0; h < height; h++){
for(int w = 0; w < width; w++){
temp = scan.nextInt();
if(temp == 2){
... | 4 |
public void setVitality(double vitality) {
this.vitality = vitality;
} | 0 |
@Override
public FileVisitResult visitFile(Path file,
BasicFileAttributes attr) {
String name = "" + file;
if (!name.toLowerCase().contains("sopa")) {
return CONTINUE;
}
if (attr.isRegularFile()) {
if (name.endsWith(".tx... | 5 |
private int getCommentsNum(File file) {
if(!file.exists()) {
return 0;
}
try {
int comments = 0;
String currentLine;
BufferedReader reader = new BufferedReader(new FileReader(file));
while((currentLine = reader.readLine()) != nu... | 4 |
public void visitCode() {
if (mv != null) {
mv.visitCode();
}
} | 1 |
@Override
public View create(Element elem)
{
String kind = elem.getName();
if (kind != null)
{
if (kind.equals(AbstractDocument.ContentElementName))
{
return new LabelView(elem);
} else if (kind.equals(AbstractDocument.ParagraphElemen... | 6 |
void checkIndex(int index)
{
if(index < 0 || index >= size)
throw new IndexOutOfBoundsException("index = " + index + " size = " + size);
} | 2 |
public void visitForceChildren(final TreeVisitor visitor) {
if (visitor.reverse()) {
end.visit(visitor);
start.visit(visitor);
array.visit(visitor);
} else {
array.visit(visitor);
start.visit(visitor);
end.visit(visitor);
}
} | 1 |
public boolean tick(double speed) {
// XXX note that we use inGameStateNextFrame here, because this is an
// indication of whether the timer should exist for the upcoming
// frame. However, another timer in the timer set may change the
// state, so there's actually a race condition here.
if (parent_state!=nu... | 7 |
public E peek() {
E rv = null;
int mp = 0;
for(E e : this) {
int ep = e.priority();
if((rv == null) || (ep > mp)) {
mp = ep;
rv = e;
}
}
return(rv);
} | 3 |
public void LoadDictionary(String dictionaryPath){
BufferedReader reader = null;
try {
String word;
reader = new BufferedReader(new FileReader(dictionaryPath));
while ((word = reader.readLine()) != null) {
this.dictionary.put(word, word);
}
} catch (Exception ex){
ex.printStackTrace();
}
} | 2 |
@Override
public void actionPerformed(ActionEvent e) {
try {
conn = DriverManager.getConnection(Utils.DB_URL);
PreparedStatement checkStat;
checkStat = conn.prepareStatement("select name from section where name = ?");
checkStat.setString(1, newSectionTextField... | 5 |
private void sendAsFixedLength(OutputStream outputStream, PrintWriter pw) throws IOException {
int pending = data != null ? data.available() : 0; // This is to support partial sends, see serveFile()
pw.print("Content-Length: "+pending+"\r\n");
pw.print("\r\n");
pw.flush(... | 6 |
public void createChunk() {
for (int x = 0; x < sizeX; x++) {
for (int y = 0; y < sizeY; y++) {
for (int z = 0; z < sizeZ; z++) {
tiles[x][y][z] = Tile.Grass.getId();
}
}
}
} | 3 |
@Override
protected void inspectContents(File file, String contents) {
StringBuffer buf = new StringBuffer();
// Split it into lines
StringSplitter splitter = new StringSplitter(contents, getLineEnding());
// Scan each line
int totalMatchesForThisFile = 0;
int lineCount = 1;
while (splitter.hasMore... | 5 |
public void actionPerformed(ActionEvent e) {
if( e.getSource() == cancel)
this.setVisible(false);
else if( e.getSource() == ok){
int selected = this.recordTable.getSelectedRow();
System.out.println(selected);
if( selected == -1){
JOptionPane.showMessageDialog(this, "请选择一条记录", "警告", 1);
}else{
... | 4 |
public static void main(String[] args) {
LinkedList<Pet> pets = new LinkedList<Pet>(Pets.arrayList(5));
System.out.println(pets);
// Identical:
System.out.println("pets.getFirst(): " + pets.getFirst());
System.out.println("pets.element(): " + pets.element());
// Only differs in empty-list behavior:
Sys... | 0 |
/* */ public void handleCollision()
/* */ {
/* 300 */ for (int i = 0; i < Core.bunkers.size(); i++) {
/* 301 */ Bunker bunker = (Bunker)Core.bunkers.get(i);
/* 302 */ if (bunker.collision.intersects(this.collision))
/* */ {
/* 304 */ if (bunker.collision.x + bunker.collisio... | 5 |
static void checkForCycle( SimpleQueue<Node> list, Arc a, int limit )
throws MVDException
{
if ( list.contains(a.to) )
throw new MVDException("Cycle: node"+a.to.nodeId+" already encountered");
else if ( limit > 0 )
{
ListIterator<Arc> iter = a.to.outgoingArcs();
while ( iter.hasNext() )
{
Arc b... | 3 |
@EventHandler
public void CreeperHeal(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getCreeperConfig().getDouble("Creeper.Heal.Do... | 6 |
public static void main(String[] args) {
System.out.println("Starting.");
if (args.length > 0 && args[0] != null) {
testHostName = args[0];
}
if (args.length > 1 && args[1] != null) {
testBasePort = Integer.parseInt(args[1]);
}
try {
TestRunner.run(suite());
} catch (Throwa... | 5 |
public BufferedImage createCompatibleImage(int w, int h,
int transparancy)
{
Window window = device.getFullScreenWindow();
if (window != null) {
GraphicsConfiguration gc =
window.getGraphicsConfiguration();
return gc.createCompatibleImage(w, h, transpa... | 1 |
private void handleCurveDeletion(Point clickedPoint) {
List<Curve> curves = Main.getCurveManager().getCurves();
int i = curves.size() - 1;
boolean found = false;
while (i >= 0 && !found) {
selectedPoint = curves.get(i).checkMouseCollision(clickedPoint);
if (selectedPoint != -1) {
curves.remove(i);
... | 3 |
public int getLargestChildIndex(int n)
{
int leftChildIndex = getLeftNode(n); //with passed in index, get the left child index
int rightChildIndex = getRightNode(n); // get the right child index
Comparable leftChild = getLeftKid(n); // get the left child itself from the get left me... | 5 |
private void moveUp() {
if (facingEast()) {
turnLeft();
if (frontIsClear()) {
move();
turnLeft();
}
} else {
turnRight();
if (frontIsClear()) {
move();
turnRight();
}
}
} | 3 |
private boolean isListSorted(List tl) {
// tl must be populated with DateTime objects.
DateTime lhDT = (DateTime)tl.get(0);
DateTime rhDT = null;
Long lhVal = new Long( lhDT.getMillis() );
Long rhVal = null;
for (int i = 1; i < tl.size(); ++i) {
rhDT = (DateTi... | 2 |
public boolean startTraining() {
if (allData == null || facit == null) {
return false;
}
int iterate = 0;
do {
iterate++;
Collections.shuffle(allData);
populateLists();
for (FaceData f : trainingData) {
buildNetwork(f);
for (int i = 0; i < 4; i++) {
double act = calculateActivation... | 6 |
public int findFarthest(){
int index=-1;
for(int q=0;q<objects.size();q++) {
if (objects.get(q) == this||objects.get(q).kind==kind||objects.get(q).kind==0)
continue;
int searchRadius = 400; //radius of whether the object will be findable
boolean search... | 8 |
public void doTurn() {
if (!isPlayerOver) {
System.out.println("Your score:" + player.getScore());
System.out.println("Hit? 1:Yes 0:No");
Scanner in = new Scanner(System.in);
int input = in.nextInt();
if (input == 1) {
player.add(deck.getRandomCardFromDeck());
} else {
isPlayerOver = tru... | 4 |
public void saveProgramAs(){
File file = askForFileName();
if (file != null){
LogoDocument program = getProgram();
program.setFile(file);
try {
program.save();
} catch (IOException e) {
e.printStackTrace();
}
}
} | 2 |
public ReverseIterator(List<T> source)
{
this._source = source;
this._position = this._source.size()- 1;
} | 0 |
public int getNbOfReservationsOfClient(String client) {
int nbOfReservations = 0;
for (Car car : this.cars)
for (Reservation reservation : car.getReservations())
if (reservation.getCarRenter().equals(client))
nbOfReservations++;
... | 3 |
private static void initializeSupport(String wavType) {
String waveFamily = "";
// Create the string for the wavelet family
int ordBegin = -1;
for (int i = 0; i < wavType.length(); i++) {
char currentChar = wavType.charAt(i);
if (Character.isDigit(currentChar)) {
ordBegin = i;
break;
}
el... | 7 |
public void savePurchasedItems(ArrayList<Item> shoppingCart, int receiptid) {
Connection con = null;
try {
con = ConnectionService.getConnection();
String query = "INSERT INTO PURCHASEITEM VALUES(?,?,?)";
PreparedStatement ps = con.prepareStatement(query);
for (Item items : shoppingCart) {
ps.setIn... | 7 |
@Override
public void emettre() throws InformationNonConforme {
int i = 1, j = 0;
float sum = 0.0f;
int nbBits = informationRecue.nbElements() / nbEch;
Boolean[] tabBool = new Boolean[nbBits];
for (i = 0; i < nbBits ; i++) {
for (j = 0; j < nbEch; j++) {
sum += informationRecue.iemeElement((i*nbE... | 5 |
public void paintMonitoAbajo(Graphics g) {
if (tipo == 1 || tipo == 3 || tipo == 4 || tipo == 5 || tipo == 7 && monitosSentados.size() > 3) {
Silla aux = (Silla) sillas.get(3);
try {
if (aux.isOcupada()) {
monitosSentados.get(3).paintSentado(g, aux, th... | 8 |
public boolean getActive()
{
return active;
} | 0 |
public void compressStates() {
StateHistory.compressTimestampHistory(lcdc, true);
StateHistory.compressTimestampHistory(wy);
StateHistory.compressTimestampHistory(wx);
StateHistory.compressTimestampHistory(scy);
StateHistory.compressTimestampHistory(scx);
for (int i = 0; i < 0x800; i++)
if... | 7 |
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof RelHermanoPasoId) ) return false;
RelHermanoPasoId castOther = ( RelHermanoPasoId ) other;
return ( (this.getDni()==castOther.getDni()) || ( this.getDn... | 7 |
@Override
public void actionPerformed(ActionEvent e) {
//Si il s'agit du bouton d'envoi a la pioche ouverte
if ( e.getSource() == selected.getToOpenPickButton() && selected.hasSelection()) {
//Demande au serveur si il est possible d'envoyer a la pioche ouverte
try {
this.client.sendMessage("SEND_TO_O... | 7 |
@Override
public boolean isEmpty() {
return bestPlays.isEmpty();
} | 0 |
private static String getRemoveHardLinkCommandTemplate() throws IOException {
//read rdpro.properties in the user home's folder?
String homeDir = System.getProperty("user.home");
Properties config = new Properties();
InputStream input = null;
try {
input = new FileInputStream(homeDir+"/rdpro.properties"... | 9 |
public static Planet buildPlanet(PlanetEnum type) {
Planet planet = null;
switch(type) {
case TERRESTRIAL:
planet = new TerrestrialPlanet();
break;
case GAS:
planet = new GasPlanet();
break;
case VOLCANIC:
planet = new VolcanicPlanet();
break;
case JUNGLE:
planet = new JunglePlanet();
... | 7 |
public static List<Praticien> selectAllOrderPraNum(EntityManager em) throws PersistenceException {
List<Praticien> lesPraticiens = null;
Query query= em.createQuery("select pra from Praticien pra order by pra.numero");
lesPraticiens = query.getResultList();
return lesPraticiens;
} | 0 |
public boolean commit(){
if(writes.size()==0)
return true;
Write primary=writes.get(0);
if(!prewrite(primary,primary))
return false;
for(int i=1;i<writes.size();i++){
if(!prewrite(writes.get(i),primary))
return false;
}
commit_ts=OracleTimestampEmu.getCurTimestamp();
Write p=primary;
BigTab... | 7 |
public boolean blockBishop(int ex, int ey) {
if (ex > x && ey > y) {
bishopNW(ex, ey);
}
if (ex > x && ey < y) {
bishopSW(ex, ey);
}
if (ex < x && ey > y) {
bishopNE(ex, ey);
... | 9 |
private void backTrackToUnit()
{
if (myUnitStepMap==null)
return;
int index=0;
while (index<myAnswer.size())
{
for (ArrayList <Production> key: myUnitStepMap.keySet())
{
if (myUnitStepMap.get(key).equals(myAnswer.get(index)))
{
myAnswer.remove(index);
int c=0;
for (Production p ... | 5 |
@Override
public String getCur() {return cur;} | 0 |
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.