text stringlengths 14 410k | label int32 0 9 |
|---|---|
private long[] readCPU(final Process pc) throws Exception {
try {
long[] returnCPUInfo = new long[2];
pc.getOutputStream().close();
InputStreamReader inputReader = new InputStreamReader(pc.getInputStream());
LineNumberReader lineNumberInput = new LineNumberReader... | 9 |
@Transactional
public void finishById(Integer id) {
tasksDao.setFinishedById(id, true);
} | 0 |
@Test
public void testCheckDefeat() {
GameController gc = new GameController(paddle1,paddle2,ball,view,padq1,ballq1);
int radius = Ball.getSize();
//ball is not near paddle zone
boolean b = gc.checkDefeat();
if(b)
fail("Failure Trace: ");
//ball y=300
ball.setPosition(250, 300, 0);
b= gc.checkDef... | 9 |
public void testAdd_DurationFieldType_int2() {
MutableDateTime test = new MutableDateTime(TEST_TIME1);
try {
test.add((DurationFieldType) null, 0);
fail();
} catch (IllegalArgumentException ex) {}
assertEquals(TEST_TIME1, test.getMillis());
} | 1 |
public int characterAt(int at) throws JSONException {
int c = get(at);
if ((c & 0x80) == 0) {
return c;
}
int character;
int c1 = get(at + 1);
if ((c1 & 0x80) == 0) {
character = ((c & 0x7F) << 7) | c1;
if (character > 0x7F) {
... | 8 |
public void mousePressed(MouseEvent e)
{
// Selects to create a handler for resizing
if (!graph.isCellSelected(cell))
{
graphContainer.selectCellForEvent(cell, e);
}
// Initiates a resize event in the handler
mxCellHandler handler = graphContainer.getSelectionCellsHandler().getHandler(
cel... | 2 |
@Override
public List<Editor> listAll() {
Connection conn = null;
PreparedStatement pstm = null;
ResultSet rs = null;
List<Editor> editores = new ArrayList<>();
try{
conn = ConnectionFactory.getConnection();
pstm = conn.prepareStatement(LIST);
... | 3 |
private static void sendCommand(String cmd) {
boolean com = false;
cmd = cmd.substring(1);
if (cmd.contains(" ")) {
String cmdPar[] = cmd.split(" ");
for(int i = 0; i < commands.length; i++) {
for(int j = 1; j < commands[i].length; j++) {
if(cmdPar[0].equalsIgnoreCase(commands[i][j])) {
run... | 8 |
public static Unit findHighPriorityTargetIfPossible(Collection<Unit> enemyBuildings) {
for (Unit unit : enemyBuildings) {
UnitType type = unit.getType();
if (type.isSporeColony() || type.isMissileTurret() || type.isBase()) {
if (isProperTarget(unit)) {
return unit;
}
}
}
return null;
} | 5 |
public Level() {
if (!(this instanceof LevelEditor) && JOptionPane.showOptionDialog(null, "Skip tutorials?", "Tutorial",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
null, null) == JOptionPane.YES_OPTION) {
try {
maxLives = Integer.parseInt(JOptionPane.showInputDialog(null,
"How... | 4 |
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = pgrid.service.corba.PeerReferenceHelper.type ();
__typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (pgrid.service... | 1 |
@Override
public int compareTo(BString other)
{
// same object
if (other == this) return 0;
int p = start;
int pOther = other.start;
while (true) {
// same length, all bytes matched
if (p == end && pOther == other.end) return 0;
// a... | 7 |
public boolean contains(T test)
{
if (test == null)
{
for (int i = 0; i < array.length; i++)
if (array[i] == null)
return true;
}
else
{
for (int i = 0; i < array.length; i++)
if (test.equals(get(i)))... | 5 |
@Deprecated
public void draw(int screenX, int screenY, int xStart, int yStart, int xStop, int yStop){
for (int x = xStart; x < xStop; x++){
for (int y = yStart; y < yStop; y++){
contents[x][y].draw(screenX + (x * Standards.TILE_SIZE), screenY + (y * Standards.TILE_SIZE));
}
}
} | 2 |
private static void solve70(){
double small = 2.0;
for (int i = 2000; i < 5000; i++) {
for (int j = 2000; j < 5000; j++) {
if (i != j && i*j < 1_000_000_0) {
if (isPrime(i) && isPrime(j)) {
int phi = (i - 1) * (j - 1);
if (small > (double) (i * j) / phi) {
if (isPermutable(i * j, phi... | 8 |
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and fe... | 6 |
private int strcmp(String s1, int i1, String s2, int i2) {
int l1 = s1.length() - i1;
int l2 = s2.length() - i2;
int len = l1;
boolean diff = false;
if (len > l2) {
len = l2;
}
while (len-- > 0) {
if (s1.charAt(i1++) != s2.charAt(i2++)) {
diff = true;
break;
}
}
if (diff == false ... | 6 |
private void analisaRegistro() {
System.out.println("ENTROU22");
if (!acabouListaTokens()) {
nextToken();
if (tipoDoToken[0].equals("Identificador")) {
nomeRegistro = tipoDoToken[1];
if (!acabouListaTokens()) {
nextToken();
... | 5 |
private String[][] createScoreList(String string){
if (string==null){
return null;
} else {
int savedScores = numbersOfSymbols(string, DATA_DIVIDER2);
String temp[][] = new String[savedScores][2];
for (int a=0; a < savedScores; a++){
for (int b=0; b < 2; b++){
String indexThingie=D... | 4 |
public static CommandManager getInstance(){
if (instance == null){
synchronized (CommandManager.class) {
if (instance == null){
instance = new CommandManager();
}
}
}
return instance;
} | 2 |
private int compareFitness(int particle1, int particle2){
double p1 = fitness.get(particle1);
double p2 = fitness.get(particle2);
if(maximum){
if(p1 > p2){
return particle1;
}else{
return particle2;
}
}else{
if(p1 < p2){
return particle1;
}else{
return particle2;
}
}
} | 3 |
public static void main(String[] args) {
BinaryTree BT = new BinaryTree();
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Node root = null;
for (int i = 0; i < n; i++) {
root = BT.addToTree(root, in.nextInt());
}
System.out.println(findPredecessor(root, root.left).v);
} | 1 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Curso)) {
return false;
}
Curso other = (Curso) object;
if ((this.id == null && other.id != null) || (this.id !... | 5 |
public ResultSet select(String query){
try{
Statement stm = this.con.createStatement();
ResultSet rs = stm.executeQuery(query);
// stm.close();
return rs;
}
catch(SQLException e){
LogHandler.writeStackTrace(log, e, Level.SEVERE);
return null;
}
} | 1 |
private boolean jj_2_3(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_3(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(2, xla); }
} | 1 |
public int searchForEmployeeIndex(String firstName, String lastName)
{
if (arrayDirty) {
insertionSort();
}
final int count = employees.size();
for (int i = 0; i < count; ++i) {
final Employee employee = employees.get(i);
if ( lastName.equalsIgnoreCase(employee.getLastName()) && firstName.equalsIgn... | 4 |
@Override
public void setMiscText(String text)
{
super.setMiscText(text);
final Vector<String> V=CMParms.parse(text);
dayFlag=false;
doneToday=false;
lockupFlag=false;
sleepFlag=false;
sitFlag=false;
openTime=-1;
closeTime=-1;
lastClosed=-1;
Home=null;
shopMsg=null;
for(int v=0;v<V.size();v+... | 9 |
public boolean write(int id, byte... file) {
synchronized(this) {
try {
byte header[] = new byte[6];
int length = file.length;
int position = (int) ((data.length() + 519L) / 520L); // writing the
header[0] = (byte) (length >> 16);
header[1] = (byte) ... | 3 |
private void initializeBoard(int bl, int wa, int pi) {
// Put the blocks on the board.
int k= 0;
// invariant: k blocks have been added.
while (k < bl) {
int xx = JManApp.rand(0, width-1);
int yy = JManApp.rand(0, height-1);
if(isEmpty(xx, yy)) {
... | 6 |
public static void jar(File directory, File jarfile)
{
try
{
final URI base = directory.toURI();
final Deque<File> queue = new LinkedList<File>();
queue.push(directory);
final OutputStream out = new FileOutputStream(jarfile);
Closeable res = null;
final JarOutputStream zout = new JarOutputStream(... | 5 |
public JavaSerializer(Class cl, ClassLoader loader)
{
introspectWriteReplace(cl, loader);
if (_writeReplace != null)
_writeReplace.setAccessible(true);
ArrayList primitiveFields = new ArrayList();
ArrayList compoundFields = new ArrayList();
for (; cl != null; cl = cl.getSuperclass... | 9 |
private void checkForNumber() {
int offs = this.currentPos;
Element element = this.getParagraphElement(offs);
String elementText = "";
try {
// this gets our chuck of current text for the element we're on
elementText = this.getText(element.getStartOffset(), elemen... | 9 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
... | 9 |
@Override
public void mousePressed(MouseEvent e)
{
if ( ! toolBar.isAddingLink() && ! toolBar.isEditingLink()
&& ! toolBar.isRemovingLink())
{
try
{
if (tree.getSelectedSquare() != null)
{
this.clickX = ((e.getX() - (lblMap.getWidth() - 32 * map
.getWidth()) / 2) / 32);
this.clickY ... | 5 |
private boolean execEstimateUsingFeatureFrequencies(VectorMap queryParam, StringBuffer respBody, DBAccess dbAccess) {
try {
int clntIdx = queryParam.qpIndexOfKeyNoCase("clnt");
String clientName = (String) queryParam.getVal(clntIdx);
int ftrsIdx = queryParam.qpIndexOfKeyNoCa... | 9 |
public boolean drawShape(mxGraphicsCanvas2D canvas, mxCellState state,
mxRectangle bounds, boolean background)
{
Element elt = (background) ? bgNode : fgNode;
if (elt != null)
{
String direction = mxUtils.getString(state.getStyle(),
mxConstants.STYLE_DIRECTION, null);
mxRectangle aspect = computeA... | 5 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Album)) {
return false;
}
Album other = (Album) object;
if ((this.albumid == null && other.albumid != null) || ... | 5 |
private static String getStringFromDocument(Document doc) {
try {
DOMSource domSource = new DOMSource(doc);
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
TransformerFactory tf = TransformerFactory.newInstance();
... | 1 |
public TextViewPanel(Grid initGame){
super();
setBackground(Color.BLACK);
game = initGame;
this.setFont(new Font(Font.MONOSPACED, Font.BOLD, 22));
} | 0 |
static public int extractZipToFolder(File pZipFile, File pDestinationDirectory)
throws ZipException, IOException {
if(!pDestinationDirectory.isDirectory()){
throw new ExInternal(pDestinationDirectory.getAbsolutePath() + " is not a valid directory");
}
ZipFile lZipFile = new ZipFile(pZipFi... | 4 |
Operation transactOperation(Operation src, boolean updated) throws OperationServiceException {
Account account = src.getAccount();
BigDecimal repositoryBalance;
if (updated) {
repositoryBalance = getRollbackBalance(src);
} else {
repositoryBalance = account.getBal... | 7 |
public String getApellido1() {
return apellido1;
} | 0 |
public Explorer() {
String date = (new SimpleDateFormat("EEEE, d MMMM yyyy")).format(new Date());
m_LogPanel.logMessage("Weka Explorer");
m_LogPanel.logMessage("(c) " + Copyright.getFromYear() + "-" + Copyright.getToYear()
+ " " + Copyright.getOwner() + ", " + Copyright.getAddress());
m_LogPanel.... | 8 |
@SuppressWarnings("unchecked")
public Class<Reducer<Writable, Writable, Writable, Writable>> loadClass ()
throws IOException, ClassNotFoundException {
/* Load Jar file */
String jarFilePath = this.task.getJarEntry().getLocalPath();
if (MapReduce.Core.DEBUG) {
System.out.println("DEBUG RunReducer.loadCla... | 5 |
@Override
public void load(String input) {
StringBuilder sb = new StringBuilder();
ImagePanel imgPanel = MainWindow.MAIN_WINDOW.getImagePanel();
for(String str : input.split("\n")) {
if (str.startsWith("img")){
sb.setLength(0);
sb.append(str+"\n");
} else if (str.startsWith("anim")) {
sb.set... | 6 |
public CtClass getSuperclass() throws NotFoundException {
String supername = getClassFile2().getSuperclass();
if (supername == null)
return null;
else
return classPool.get(supername);
} | 1 |
@Override
public boolean delete(int prenodeid, int nownodeid) {
boolean flag = false;
System.out.println(prenodeid + " " + nownodeid);
Timenode prenode = getTimenode(prenodeid);
Timenode nownode = getTimenode(nownodeid);
prenode.setNextnode(nownode.getNextnode());
nownode.setDisplay("false");
if (update(... | 2 |
public static boolean isName(String name) {
if (isNull(name)) {
return false;
}
for (char c : name.trim().toCharArray()) {
if (((!isChar(c)) && (!Character.isWhitespace(c)))
|| (c == CharPool.COMMA)) {
return false;
}
}
return true;
} | 5 |
@Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
if (plugin.allMuted) {
plugin.allMuted = false;
for (ProxiedPlayer data : plugin.getProxy().getPlayers()) {
data.... | 4 |
protected void downloadEagerResources() {
synchronized (this) {
if (eager_resources_started_flag) return;
}
//update the flag
synchronized (this) {
eager_resources_started_flag = true;
}
List<CacheResource> eagerResources = new ArrayList<CacheResource>();
f... | 8 |
public void run() {
BufferedImage image = null;
try {
URL imgUrl = new URL(link);
image = ImageIO.read(imgUrl);
ImageIO.write(image, "png", new File(filename));
} catch(Exception ex) {}
System.out.println("Downloaded to " + filename);
} | 1 |
protected List<PhysicalAgent> loadMobsFromFile(Environmental scripted, String filename)
{
filename=filename.trim();
List monsters=(List)Resources.getResource("RANDOMMONSTERS-"+filename);
if(monsters!=null)
return monsters;
final StringBuffer buf=getResourceFileData(filename, true);
String thangName="null"... | 9 |
public static String capitalFirst(String input) {
String[] table = input.split(" ");
String output = "";
for (int i = 0; i < table.length; i++) {
if (i > 0) {
output += " ";
}
if (table[i].equalsIgnoreCase("and") || table[i].equalsIgnoreCase("or") || table[i].equalsIgnoreCase("with") || table[i].equa... | 8 |
private void battle() throws IOException {
boolean end =false;
String line = null;
while(!end && !closed){
//все что в цикле сугубо для того чтоб комп не вис)
line = inputStream.readUTF();
if(line.equals("$lost$")){
... | 6 |
public void pause() {
pause = true;
timer.cancel();
timer.purge();
} | 0 |
private void getClassAndMethod() {
try {
Throwable throwable = new Throwable();
throwable.fillInStackTrace();
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter( stringWriter );
throwable.printStackTrace( printWri... | 3 |
public void setPWFieldFontsize(int fontsize) {
if (fontsize <= 0) {
this.pWFieldFontSize = UIFontInits.PWFIELD.getSize();
} else {
this.pWFieldFontSize = fontsize;
}
somethingChanged();
} | 1 |
public String toString() {
String ret = "";
int roundheight = (int)Math.ceil(height);
int roundwidth = (int)Math.ceil(width);
for(int j = 0; j < roundheight; j++) {
for(int i=0; i < roundwidth; i++) {
if((i == 0) || (j == 0) || (i == (roundwidth-1)) || (j == (roundheight-1))) {
ret += f... | 7 |
public void comment(String s) {
if (inStartTag) {
maybeWriteTopLevelAttributes();
inStartTag = false;
write(">");
newline();
}
if (!inText)
indent();
write("<!--");
int start = 0;
level++;
for (;;) {
int i = s.indexOf('\n', start);
if (i < 0) {
... | 8 |
private boolean checkWordForDuplicate (String motherLangWord, String translation) throws SQLException {
boolean hasDuplicate = false;
Connection conn = null;
try {
conn = DriverManager.getConnection(Utils.DB_URL);
PreparedStatement motherLangWordPStat = conn.prepareStatem... | 3 |
private void addDataEx(){
/*
SensorDao dao = new SensorDao();
Sensor sensor = dao.getOne(1);
*/
Sensor sensor = new Sensor();
sensor.setAddDate(new Date(System.currentTimeMillis()));
sensor.setUnity("s");
sensor.setStatementFrequency(1222);
sensor.setName("Sensor_Test");
sensor.setSensorType(Sensor... | 2 |
public void warn(final String msg) {
if(disabled) return;
else logger.warning("" + route_name + "-" + connection_id + "[warn]: " + msg);
} | 1 |
public static Cons parseColumnSpecs(Stella_Object relconst, Stella_Object columnspecs, Object [] MV_returnarray) {
if (!(Stella_Object.consP(columnspecs))) {
{ OutputStringStream stream000 = OutputStringStream.newOutputStringStream();
{ Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();
... | 6 |
public boolean deleteTestEmployees(Connection con)
{
boolean didItWork = true;
ArrayList<Integer> empno = new ArrayList();
String SQLString1 = "SELECT medarbejderno "
+ "FROM medarbejder "
+ "WHERE navn = 'test'";
... | 5 |
public boolean hasErrorOrWarning() {
return isErrorProteinLength() || isErrorStartCodon() || isErrorStopCodonsInCds() // Errors
|| isWarningStopCodon() // Warnings
;
} | 3 |
public startGui(boolean bol, String ip, int Port){
//Manual_Server = bol;
catalogue.setmanualServer(bol);
if(!bol){
getServerNames();
}
else{
Server = new ServerList(ip, Port);
serverlist = Server.getServerList();
}
StartGui();
... | 2 |
* @param terminal New terminal to be used.
* @param source Specifies if the new terminal is the source or target.
* @param constraint Constraint to be used for this connection.
*/
public void cellConnected(Object edge, Object terminal, boolean source,
mxConnectionConstraint constraint)
{
if (edge != null)
... | 6 |
private List<String> replaceInUnescapedSegmentsInternal(Pattern pPattern, String pReplacement, int pReplaceLimit){
List<String> lReplacedStringsList = new ArrayList<String>();
int lReplaceCount = 0;
for(ScriptSegment lSegment : mSegmentList){
if(lSegment instanceof UnescapedTextSegment) {
... | 5 |
private void initializeThread() {
Thread outputter = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
String message = packetFactory.receiveMessage().trim();
if (message.startsWith("/m/")) {
... | 2 |
public int next_tick( int tick, boolean key_on ) {
tick = tick + 1;
if( looped && tick >= loop_end_tick ) {
tick = loop_start_tick;
}
if( sustain && key_on && tick >= sustain_tick ) {
tick = sustain_tick;
}
return tick;
} | 5 |
static public CycList convertMapToPlist(final Map map) {
final CycList plist = new CycList();
if (map != null) {
for (final Iterator<Map.Entry> i = map.entrySet().iterator(); i.hasNext();) {
final Map.Entry entry = i.next();
plist.add(entry.getKey());
plist.add(entry.getValue());
... | 2 |
void connectGenerator (Synthesizer synth)
throws SynthIfException
{
Generator freq = ((Input)inputs.elementAt (0)).getGenerator();
Generator phase = ((Input)inputs.elementAt (1)).getGenerator();
if (phase == null)
synth.add (phase = new Constant (synth, 0));
Generator amp = ((Input)inputs.el... | 7 |
public void start(String args[]) {
// TODO quit if wrong arguments
try {
this.host = args[0];
this.tcpPort = Integer.parseInt(args[1]);
this.analyticServerRef = args[2];
} catch(NumberFormatException e) {
logger.error("Seconds argument has to be an integer");
} catch(ArrayIndexOutOfBoundsExceptio... | 6 |
public boolean setSize(int players, int mapSize)
{
boolean condition = false;
//added for validation
if(players >= 2 && players <= 4)
{
while(mapSize < 5 || mapSize > 50)
{
System.out.print("Size of map should be between 5 and 50. Please re-enter size : ");
mapSize = keyboard.nextInt();
}
... | 8 |
private boolean loadNetwork(String file, boolean forDraw){
boolean loaded = false;
Network net = null;
//Try to load from a file
if (file != null){
File f = new File(file);
if (f.isFile()){
try{
net = new Network(file);
loaded = true;
} catch (Exception e){
System.out.println("Warni... | 8 |
@Override
public Void call() {
final String timestamp = this.writer.timestamp.format(new Date());
this.markers.clear();
for (final World world : this.writer.plugin.getServer().getWorlds()) {
for (final Ocelot ocelot : world.getEntitiesByClass(Ocelot.class)) {
if ... | 4 |
public boolean updateModel(Piece piece, PossibleTile pt) {
for (Piece p : this.gm.getBoard().getPieces()) {
if (p instanceof Pawn) {
Pawn pawn = (Pawn) p;
pawn.setPossibleToPassant(false);
}
}
Board b = this.gm.getBoard();
if (
b.isWhiteTurn() == piece.isWhite() &&
b.isWhiteTurn() == this.is... | 9 |
public static boolean deletEvent(String eventName)
{
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
boolean result=true;
try{
String sql="DELETE FROM EVENTS WHERE UPPER(NAME)=(?)";
con=ConnectionPool.getConnectionFromPool();
ps=con.prepareStatement(sql);
ps.setString(1, event... | 7 |
@Override
public void draw(Graphics2D g2d) {
AffineTransform at = new AffineTransform();
at.translate(loc.x - turrets[upg].getWidth() / 2,
loc.y - turrets[upg].getHeight() / 2);
if (isFailing())
g2d.drawImage(turrets[0], at, null);
else {
if (faction == 1) {
g2d.drawImage(turrets[upg], at, null)... | 9 |
public static synchronized boolean checkConnection() {
if (closed)
return false;
final int timeout = 5000;
try {
if (conn != null && conn.isValid(timeout))
return true;
} catch (SQLException e) {
// Consider as broken connection
}
final String url;
{
String url_ = "jdbc:mysql://" + Connec... | 9 |
public void draw(Graphics page)
{
planeImage.drawImage(page, xLocation, yLocation);//Draws the plane on the component
//Draws the collision Border
if(this.getBorderVisibility())
{
drawCollisionBorder(page,xLocation,yLocation,planeImage.getWidth(),planeImage.getHeight());
}
} | 1 |
private void carregaClientes(){
ClienteDAO daoCliente = new ClienteDAO();
try {
listaClientes = daoCliente.listarTodos();
} catch (ErroValidacaoException ex) {
Logger.getLogger(frmVenda.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessage... | 3 |
public void selectIndex(){
if (index >= 0) {
if (index > commands.size())
index = commands.size() - 1;
if (commands.size() - index >= 0) {
log("ConsoleUpClicked");
msg = commands.get(commands.size() - index);
}
}
} | 3 |
private void process(ArrayList<Gridspot> path , int max, pair<Gridspot,Gridspot> a)
{
ArrayList<Gridspot> revise = new ArrayList<Gridspot>(path);
ArrayList<Gridspot> state ;
boolean flag = true;
assignQuacks(a);
Gridspot temp ;//= revise.get(revise.size()-2);
for(int i =0; i < path.size(); i++)
{
temp ... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
HttpResponseEvent that = (HttpResponseEvent) o;
if (request != null ? !request.equals(that.request) : that.request != null)
return false;
... | 7 |
@Override
public void handle(KeyEvent event) {
final KeyCode keyCode = event.getCode();
switch(keyCode) {
case UP:
if(moveDirection != Direction.DOWN)
nextMoveDirection = Direction.UP;
break;
case DOWN:
... | 8 |
public void adjustColors(int redOff, int greenOff, int blueOff) {
for (int i = 0; i < pallete.length; i++) {
int red = pallete[i] >> 16 & 0xff;
red += redOff;
if (red < 0) {
red = 0;
} else if (red > 255) {
red = 255;
}
int green = pallete[i] >> 8 & 0xff;
green += greenOff;
if (green <... | 7 |
public void addTreasureBox(double x, double y, double width, double height, String note)
{
Element treasureBoxModule = doc.createElement("treasurebox");
campaignModule.appendChild(treasureBoxModule);
Element coordinatesModule = doc.createElement("coordinates");
treasureBoxMo... | 0 |
private int calculateNeighbourhoodBest(int i, int k, int j){
if(maximum){
return maxBest(i,j,k);
}else{
return minBest(i,j,k);
}
} | 1 |
public String toString() {
try {
return this.toJSON().toString(4);
} catch (JSONException e) {
return "Error";
}
} | 1 |
public String getPlayerClass( Player p )
{
if ( perm == null )
{
RegisteredServiceProvider<Permission> permissionProvider = getServer().getServicesManager().getRegistration( net.milkbowl.vault.permission.Permission.class );
if ( permissionProvider == null )
{
System.out.println( "Vault plugin was ... | 7 |
@Override
public void Write(IOClient p, Server server) {
PacketPrepareEvent event = new PacketPrepareEvent(p, this, server);
server.getEventSystem().callEvent(event);
if (event.isCancelled())
return;
Player player;
if (p instanceof Player) {
player = (Player)p;
}
else
return;
try {
ByteBuff... | 3 |
public CheckResultMessage checkFileName() {
return report.checkFileName();
} | 0 |
public void rotarAdelanteIzquierda() {
if (direccion.equals(Direccion.derecha)) {
rotar(tipoTrans.enZ, 135);
} else if (direccion.equals(Direccion.adelante)) {
rotar(tipoTrans.enZ, 45);
} else if (direccion.equals(Direccion.atras)) {
rotar(tipoTrans.enZ, -135)... | 7 |
public void setFrequency (CommandSender sender, String inputString) throws IOException{
if (new File("plugins/CakesMinerApocalypse/").mkdirs()) {
System.out.println("Frequencies file created");
}
File myFile = new File("plugins/CakesMinerApocalypse/frequencies.txt");
if (myFile.exists()){... | 8 |
public ArrayList<String> findAllDictWords(ArrayList<String> excluded){
//iterates through all words in the dictionary, checking them against excluded and checking if they are on the board
Iterator<String> iter=dict.iterator();
String word;
ArrayList<String> foundWords=new ArrayList<String>();
boolean isExclud... | 5 |
public void paintComponent(Graphics g) {
Rectangle visible = getVisibleRect();
int height = ARROW_LENGTH + icons[0].getIconHeight();
int max = icons.length - 1 - visible.y / height;
int min = icons.length - 1 - (visible.y + visible.height) / height;
try {
min = Math.max(min, 0);
g = g.create();
... | 2 |
public String dealWith(Long testObject) {
if (testObject > 3) {
return "大于3退出了!";
}
return "全部通过了!";
} | 1 |
private void writeColFields( Column col ) {
flds.append( SPACE );
flds.append( "private " );
String fldType = col.getFldType();
flds.append( fldType );
flds.append( makeSpace( FLD_SPACE, fldType ) );
flds.append( col.getFldName() );
flds.append( ";" );
... | 1 |
@Override
public void setupTest(JavaSamplerContext context) {
super.setupTest(context);
String hbaseZK = context.getParameter("hbase.zookeeper.quorum");
conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", hbaseZK);
if (table == null) {
String tableName = context.getParameter("tableName"... | 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.