text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void movement(int delta) {
if (this.duration == null) {
if (this.speedY < 5) this.speedY += 0.5f;
if (this.speedY == 5) this.alive = false;
if (this.random == 0) this.x += 0.1f * delta;
if (this.random == 1) this.x -= 0.1f * delta;
this.y += delta * (speedY * 0.08f);
}
else {
... | 5 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Employee employee = (Employee) o;
if (id != employee.id) return false;
if (firstname != null ? !firstname.equals(employee.firstname) : employee... | 8 |
private void initTextFields(){
/*===================Text Field of algorithm`s name==============*/
nameTextField = new JTextField();
nameTextField.setBounds(10, 30, 200,27);
nameTextField.addActionListener(new ActionListener() {
@Override
public void a... | 0 |
public TabPane() {
super(JTabbedPane.NORTH);
datePane = new DatePane();
graphPane = new GraphPane();
exceptionPane = new ExceptionPane();
this.add("总流量", datePane);
this.add("统计图", graphPane);
this.add("异常日志",exceptionPane);
this.addChangeListener(new Chan... | 0 |
private PagePhotonSpectrometer createPhotonSpectrometer() {
PagePhotonSpectrometer s = new PagePhotonSpectrometer();
s.setPage(page);
s.setModelID(modelIndex);
if (uid != null) {
s.setUid(uid);
uid = null;
}
if (type != -1) {
s.setType(type);
type = -1;
}
if (borderType != null) ... | 8 |
public GridScheduler(String url, String downstream, String upstream, String registry) throws RemoteException {
// preconditions
assert(url != null) : "parameter 'url' cannot be null";
// init members
this.registry = registry;
this.url = url;
this.upstream_neighbour = upstream;
this.downstream_neighbour... | 5 |
private static void addForms(XWPFParagraph p, Word wt, String color, Lang explang) {
addSpace(p);
addLeftParenthesis(p, color);
for (int i = 0; i < wt.getForms().size(); i++) {
Form f = wt.getForms().get(i);
if (f.getType() != FormType.UNDEF && f.getType() != FormType.PAR... | 8 |
private boolean r_t_plural() {
int among_var;
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
// (, line 160
// setlimit, line 161
v_1 = limit - cursor;
... | 9 |
public synchronized static Integer getValue(Object layout, String key, int type)
{
Integer ret = null;
boolean cont = true;
for (int i = LAYOUTS.size() - 1; i >= 0; i--) {
Object l = LAYOUTS.get(i).get();
if (ret == null && l == layout) {
int[] rect = VALUES_TEMP.get(i).get(key);
if (cont && rect ... | 9 |
private int skipLine(InputStream in) throws IOException {
int c;
int len = 0;
while ((c = in.read()) >= 0 && c != 0x0d)
++len;
in.read(); /* skip 0x0a (LF) */
return len;
} | 2 |
public static boolean movementPressed() {
if(Keybinds.DOWN.press() || Keybinds.RIGHT.press() || Keybinds.LEFT.press() || Keybinds.UP.press())
return true;
return false;
} | 4 |
@Override
public AbstractComponent parse(String string) throws BookParseException {
if (string == null) {
throw new BookParseException("String is null");
}
try {
TextComponent component = (TextComponent) factory
.newComponent(EComponentType.WORD);
Pattern letterPattern = Pattern.compile(LETTER_REGE... | 3 |
@Override
public int compareTo(TexasHoldEmHand o) {
if (o.type == null) {
return -1;
}
if (type == null) {
return +1;
}
if (type == o.type) {
if (type == TexasHoldEmType.STRAIGHT_FLUSH || type == TexasHoldEmType.STRAIGHT) {
if ("A".equals(kickers.get(0).getRank())) {
return 1;
} else if... | 9 |
public static String intToHex(Integer value) {
String intString = Integer.toHexString(value);
System.out.println(intString.length());
System.out.println(intString);
Integer anzNullen = 4 - intString.length();
for(int i = 0; i < anzNullen; i++) {
intString = "0" + intString;
}
return intString;
} | 1 |
private void readFile(File file){
try {
BufferedReader reader = new BufferedReader(new FileReader(file));
try {
String line = reader.readLine();
while(line != null){
if(line.startsWith("[") && line.endsWith("]")){
line = line.replace("[","").replace("]","").trim();
if(line.endsWith("VBN... | 8 |
public final static void pickAllChar(SeekableLittleEndianAccessor slea, MapleClient c) {
int charId = slea.readInt();
int world = slea.readInt();
c.setWorld(world);
String macs = slea.readMapleAsciiString();
c.updateMacs(macs);
if (c.hasBannedMac()) {
c.getSes... | 5 |
public boolean remove(Locatable locatable) {
if (locatable == null) {
throw new IllegalArgumentException("Locatable must not be 'null'.");
} else if (locatable instanceof Unit && canCarryUnits()) {
if (super.remove((Unit)locatable)) {
spendAllMoves();
... | 7 |
public boolean deleteWithMouse(MouseEvent mouse) {
Tool tool = GUI.controls.getTool();
Object o = getObject(mouseGetX(mouse), mouseGetY(mouse), tool);
if (o == null)
return false;
if (o instanceof Vertex) {
removeVertex((Vertex) o);
return true;
... | 3 |
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 |
@Override
public int eval(Critter c) {
// returns the value of this expression for Critter c
Random rand = new Random();
int index = expr.eval(c);
int value;
String sensor = op.toString();
if(sensor.equals("mem")){
if(index >= c.memlength)
return 0;
value = c.getMem(index)... | 6 |
private void resize() {
size = getSkinnable().getWidth() < getSkinnable().getHeight() ? getSkinnable().getWidth() : getSkinnable().getHeight();
width = getSkinnable().getWidth();
height = getSkinnable().getHeight();
if (getSkinnable().isKeepAspect()) {
if (aspectRatio * wi... | 6 |
void setProgress(long progress) {
_progress = progress;
} | 0 |
private boolean wire(String color) {
switch (color) {
case "red":
return wire[0];
case "green":
return wire[1];
case "blue":
return wire[2];
}
return false;
} | 3 |
public void DeleteDepartamento(String Cod_Departamento) throws SQLException, excecaoDeletarElemento {
Connection conexao = null;
PreparedStatement comando = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_DELETE_DEPARTAMENTO)... | 6 |
public JPortInfo[] getConfig() throws Exception {
JPortInfo[] configInfo=null;
Vector lines = new Vector();
br = new BufferedReader(new FileReader(configFile));
line=null;
while ((line=br.readLine()) != null) {
if (!line.trim().startsWith("#") &&
!line.trim().equals("")) {
li... | 9 |
@Override
public Boolean isVisible(Integer playerId) {
boolean visible = false;
if (detectiveIdList.contains(playerId))
visible = true;
else {
for(MrX a : listMrX) {
//if current player is a detective && it is a visible turn - display Mr X
if(a.getID().equals(playerId) && currentPlayerID != 0 && vi... | 5 |
@Override
public void run() {
try {
directoryQueue.addLast(rootDirectory);
final FileFilter fileTraversalFilter = new FileFilter() {
@Override
public boolean accept(File pathName) {
if (pathName.isDirectory()) {
... | 4 |
private double upperVal(double x) {
double pow = 1;
if (x==1)
return 1;
if (x>1.0) {
while(x>1.0) {
x /= 10.0;
pow *= 10;
}
}
else {
while(x<1.0) {
x *= 10.0;
pow /= 10;
}
//We want x to be between zero and 1
x /= 10;
pow *= 10;
}
if (x>0.5)
return 1... | 8 |
public static void main(String[] args) throws Exception
{
// parse input
Scanner temp = new Scanner(new File(args[0]));
int lineCount = 0;
String curr = "";
while (temp.hasNextLine())
{
curr = temp.nextLine();
if (curr.length() == 0)
... | 7 |
private static List<String> processDeltas(List<String> origLines, List<Delta> deltas,
int contextSize) {
List<String> buffer = new ArrayList<String>();
int origTotal = 0; // counter for total lines output from Original
int revTotal = 0; // counter f... | 8 |
private void handleDelete() {
String ipString = ipText.getText().trim();
String domString = nameText.getText().trim();
if (!ipString.isEmpty() && !domString.isEmpty()) {
Integer ip = DNSDB.stringToIP(ipText.getText());
if (dnsDB.delete(domString, ip)) {
JOptionPane.showMessageDialog(GUI.this, "'" + ip... | 9 |
MapGetThread(Map<String, Integer> map) {
synchronized (lock) {
counter++;
}
this.map = map;
} | 0 |
private static String getLibraryJarfiles(String dir) {
try {
String ret = "";
for (File item : new File(dir).listFiles()) {
if (item.isDirectory()) {
ret += getLibraryJarfiles(item.getCanonicalPath());
} else {
if (... | 4 |
private static final boolean exchange(L2PcInstance player, int objectId)
{
L2ItemInstance item = player.getInventory().getItemByObjectId(objectId);
if (item == null)
return false;
// check enchant level
if (item.getEnchantLevel() < 10)
return false;
// check grade
if (item.getItem().getCrystalT... | 7 |
public String toChineseString(boolean ignoreFractionalPart, boolean upperCase) {
return new ChineseNumber(ignoreFractionalPart ? value.setScale(0).toString() : value.toString(), upperCase ? ChineseNumberStyle.UPPER_CASE : ChineseNumberStyle.LOWER_CASE).toString();
} | 2 |
public static <E extends Comparable<E>> BinaryTreeNode<E> insertNode(BinaryTreeNode<E> root, E value) {
if(root==null) {
root = new BinaryTreeNode<E>(value);
return root;
}
BinaryTreeNode<E> node = root;
while(node != null) {
if(value.compareTo(node.value)>0) {
if(node.right == null) {
Bina... | 6 |
private void requeteClient() throws IOException {
String data = "";
switch (statusCode()) {
case 200:
System.out.println("OK");
BufferedReader br = new BufferedReader(new FileReader(file));
String buffer;
do {
... | 5 |
public ArrayList<Token> tokenizeLine(String line) {
// Remove tokens from previous iteration
tokens.clear();
String aLine = line;
int j = 0;
// Remove any comments
if ((j = aLine.indexOf(";")) != -1) {
aLine = aLine.substring(0,j);
}
... | 9 |
public GetExecutor getGetExecutor(Class locatorClass, Object identifier) {
final Class<?> clazz = locatorClass;
final String property = (identifier == null ? null : identifier.toString());
// 尝试一下bean处理
if (property != null) {
PropertyGetExecutor pExecutor = new PropertyGetE... | 8 |
public final float getX(){
return getLocalTranslation().getX();
} | 0 |
public static void main(String[] args) {
System.out.println("Lancement du client");
try {
Remote r = Naming.lookup("rmi://"
+ InetAddress.getLocalHost().getHostAddress()
+ "/messagerieRMI");
if (r instanceof Messagerie) {
Messagerie irc = (Messagerie) r;
ActionsClientMessagerie clien... | 5 |
public static void execute(String command) {
List<String> args = new ArrayList<String>();
String parts[] = command.split(" ");
boolean inString = false;
StringBuilder buffer = new StringBuilder();
for (int n = 0; n < parts.length; n++) {
parts[n] = parts[n].trim();
if (!inString && parts[n].st... | 7 |
public Evaluator() {
Value = new int[Pattern.LAST][POW_3_8];
PatternNum = new int[Pattern.LAST][POW_3_8];
PatternSum = new int[Pattern.LAST][POW_3_8];
MirrorLine = new int[POW_3_8];
MirrorCorner = new int[POW_3_8];
for (int i = 0; i < POW_3_8; i++) {
int mirror_in = i;
int mirror_ou... | 6 |
public static String getWiki(String inputString, HashMap<String, String> data) throws MalformedURLException, IOException {
// StringBuffer inputSb = new StringBuffer(inputString);
String parsedText = inputString.trim().replaceAll("\\s+", "%20");
if(parsedText.length() == 0)
... | 9 |
private boolean containNull(EnvironnementAbs environment){
for(int i = 0;i< environment.taille_envi;i++){
for(int j = 0; j< environment.taille_envi;j++){
if(environment.grille[i][j] == null)
return true;
}
}
return false;
} | 3 |
public int[] search (ASEvaluation ASEval, Instances data)
throws Exception {
m_best = null;
m_generationReports = new StringBuffer();
if (!(ASEval instanceof SubsetEvaluator)) {
throw new Exception(ASEval.getClass().getName()
+ " is not a "
... | 8 |
public void tick() {
rawElapsedTime += TIME_DELAY;
if (rawElapsedTime % (1000 - level * 100) == 0) {
fall();
}
if (!currentTetromino.getActiveStatus()) {
Vector<Integer> indexY = getCompleteLineYIndices();
while (!indexY.isEmpty()) {
removeCompletedLines(indexY);
indexY = getCompleteLineYIndi... | 3 |
@Override
public void mousePressed(MouseEvent e)
{
switch(e.getButton())
{
case MouseEvent.BUTTON1:
{
AreaSelection.renew(e.getLocationOnScreen());
break;
}
case MouseEvent.BUTTON2:
{
if(AreaSelection.isEnabled())
{
AreaSelection.cancelSelection();
}
else
{
Sys... | 3 |
public void addEffect(SkillEffect e){
for (SkillEffect effect : skillEffects) {
if(effect == e) return;
}
skillEffects.add(e);
switch(skillEffects.size()){
case 1: tier = Tier.T1;
break;
case 2: tier = Tier.T2;
break;
case 3: tier = Tier.T3;
break;
case 4: tier = Tier.T4;
br... | 7 |
private void tempsreel_active() {
//System.out.println("temps reel actif");
connexion.setEnabled(false);
//conteneurNiv2_2.setEnabled(false);
Brep_source.setEnabled(false);
BLecture.setEnabled(false);
BPause.setEnabled(false);
BSuivant.setEnabled(false);
BPrecedent.setEnabled(false);
ip2.setEnabled(fa... | 0 |
@Override
public void run() {
gui = new SendGUI();
try {
ServerSocket ss = new ServerSocket( 9988 );
//System.out.println("Waiting for connection");
Socket s = ss.accept();
File sendfile = gui.getFile();
//System.out.println(sendfile.getAbsoluteFile());
gui.setVisible(true);
if( sendfile ... | 3 |
public void printSizeOfSccs(int length, int dec_flag) {
for (int i = 0; i < 100; i++) {
if (dec_flag>0)
System.out.print(sortedSCCsSize[length-1-i] + " ");
else
System.out.print(sortedSCCsSize[i] + " ");
}
} | 2 |
private void setZoomType(double magnitude, char zoomType)
{
//zoomType
//+ = zoom in
//- is zoom out
//s is standard
//t is trigonometric
//# is statistic
xmin=Double.parseDouble(Xmin.getText());
xmax=Double.parseDouble(Xmax.getText());
ymin=Do... | 5 |
public boolean isValidSudoku(char[][] board) {
int n = board.length;
if (n != 9)
return false;
int m = board[0].length;
if (m != 9)
return false;
List<HashSet<Integer>> rowCheckers = new ArrayList<>(9);
List<HashSet<Integer>> colCheckers = new ArrayList<>(9);
List<HashSet<Integer>> squareCheckers = ... | 9 |
@Test
public void addingVerticesToEmptyList() {
l.addVertex(v);
assertTrue(v.equals(l.getNeighbours(0).min()));
} | 0 |
private void sysCallRead()
{
int addr = m_CPU.popStack();
int deviceID = m_CPU.popStack();
//SOS.debugPrintln("sysCallRead");
//If the device exists
DeviceInfo di;
if((di = findDevice(deviceID)) != null)
{
//If the device is actually open
... | 5 |
public static void testPandR(int minTokenThreshold, int maxTokenThreshold, boolean includeApproximateMatches, String tokenizationType, File directory, boolean weighted) {
FileWriter writer;
String csv = "";
generateInvertedIndex(includeApproximateMatches, tokenizationType, directory);
... | 5 |
@Override
public void caseAAssignStmt(AAssignStmt node)
{
for(int i=0;i<indent;i++) System.out.print(" ");
indent++;
System.out.println("(Assign");
inAAssignStmt(node);
if(node.getIdentifier() != null)
{
node.getIdentifier().apply(this);
}
... | 6 |
protected Piece rotatePiece()
{
Piece piece = null;
Point[] temp = new Point[body.length];
//switch x,y to y,x
for (int i = 0; i < body.length; i++)
{
temp[i] = new Point();
temp[i].x = body[i].y;
temp[i].y = body[i].x;
}
... | 2 |
@Override
public void update() {
InputHandler input = world.getGame().getInput();
int speed = 8;
// if (input.hasMouseMoved() && input.isMouseIn()) {
// setX(input.getMouseX());
// } else {
if (input.left.isDown()) { move(-speed, 0); }
... | 8 |
public void handleLogin(String loginData) throws IOException {
Logger.writeInfo("New user connecting...");
Logger.writeInfo("Parsing userdata...");
String[] loginDataArray = loginData.split("::");
if (loginDataArray.length < 3) {
// ##LOGIN:address:username
Logger.writeError("Recieved unreadable userda... | 9 |
@Override
public void setData(int size, int transitions, int [][]bacteriaPosition) {
if(size <= 0)
throw new IllegalArgumentException();
if(transitions <= 0)
throw new IllegalArgumentException();
if(bacteriaPosition == null || !bacteriaPositionCheck(bacteriaPosition))
throw new IllegalArgumentException... | 4 |
public void add(Category cat) {
Session session = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.save(cat);
session.getTransaction().commit();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.ge... | 3 |
public void Update(final PCPanel panel, Graphics graphics) {
if(Counter < 100)
{
Counter++;
panel.Board.DrawBoard(graphics);
panel.AllPellets.DrawAllPellets(graphics);
panel.Blinky.Draw(graphics);
panel.Pinky.Draw(graphics);... | 7 |
private void reduceNewUnits(){
newTimeSecond = (newTimeSecond + (newTimeMinute * 60) + (newTimeHour * 3600) + (newTimeDay * 86400));
if ((newTimeSecond <= 60) || (newTimeSecond >= 60)){
newTimeMinute = newTimeSecond / 60;
newTimeSecond = newTimeSecond % 60;
}
if ((newTimeMinute <= 60) || (newTimeMinute... | 6 |
CtClass getPrimitiveType(int atype) {
switch (atype) {
case Opcode.T_BOOLEAN :
return CtClass.booleanType;
case Opcode.T_CHAR :
return CtClass.charType;
case Opcode.T_FLOAT :
return CtClass.floatType;
case Opcode.T_DOUBLE :
return C... | 8 |
@Override
public void run() {
// Get the graphics context for the background.
backgroundGraphics = (Graphics2D) background.getGraphics();
// Determine how many milliseconds to wait in between drawings.
long fpsWait = (long) (1.0 / targetFPS * 1000);
main: while (gameRunning) {
long renderStart = System.n... | 5 |
* @param mode
*/
public static void describe(Stella_Object name, Cons mode) {
{ Stella_Object renamed_Object = ((name == null) ? ((Stella_Object)(null)) : name.getObject(null));
Stella_Object modespec = mode.value;
Keyword validmode = null;
if (modespec == null) {
modespec = Stella.$... | 8 |
public void render(int xp, int yp, int xb, int yb, int size, int scale, SpriteSheet sheet){
int sheetSize = sheet.SIZE;
for(int y = 0; y < size * scale; y++){
int ya = y + yp;
for(int x = 0; x < size * scale; x++){
int xa = x + xp;
if(xa < -sheetSize || xa >= width || ya < 0 || ya >= height) break;
... | 9 |
private void showGame(){
getContentPane().removeAll();
getContentPane().add(this.canvas, BorderLayout.CENTER);
this.canvas.createBufferStrategy(2);
this.canvas.setVisible(true);
} | 0 |
public void setProtocol(String protocol) {
this.protocol = protocol;
} | 0 |
public static void inputGuess(Guess g, Player p) {
Scanner sc = new Scanner(System.in);
String dec = " ";
Game.clearConsole(); // Empty the screen
System.out.println(dec+"-- Captain " +p.name+", press enter to proceed --"); // Display name of player whose turn it is
sc.nextLine();
System.out.println(... | 3 |
public byte[] resetObjectReference(Reference objectReference, boolean isRc4) {
// Step 1: separate object and generation numbers for objectReference
int objectNumber = objectReference.getObjectNumber();
int generationNumber = objectReference.getGenerationNumber();
// Step 2:
//... | 4 |
private ScriptExecutor createScriptExecutor() {
String className = null;
ClassLoader loader = ScriptExecutor.class.getClassLoader();
// 1. try the JVM-instance-wide system property
try {
className = System.getProperty(property);
} catch (RuntimeException e) { /* norm... | 6 |
private boolean receiveMessage(Message message) {
if (this.enemies.contains(message.getSender())){
return false;
}
else if (this.friends.contains(message.getSender())) {
this.wall.add(message);
return true;
}
else if (message.getMessage().equa... | 3 |
@SuppressWarnings("unchecked")
static void save()
{
Protect.log.info("[XolioProtect]Saving cuboids...");
try {
fos = new FileOutputStream(new File("plugins/XolioProtect/cubos.txt"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// #########... | 5 |
public Register getRegister(int index) {
switch (index) {
case 0:
return R0;
case 1:
return R1;
case 2:
return R2;
case 3:
return R3;
case 4:
return R4;
case 5:
return R5;
case 6:
return R6;
case 7:
return R7;
default:
return null;
}
} | 8 |
public void endElement(String name)
{
if (name == null)
return;
String lastStartTag = (String) stack.peekFirst();
if (name.equalsIgnoreCase(lastStartTag)) {
if (name.equals("module")) {
currentModule = null;
} else if (currentModule != nu... | 4 |
public static String composeInternetUrl(String protocol, String userinfo, String host, int port, String path, String query, String fragment) {
{ OutputStringStream url = OutputStringStream.newOutputStringStream();
if (!(Stella.blankStringP(protocol))) {
url.nativeStream.print(protocol + "://");
... | 8 |
protected LinkedList<Task> checkTasks() {
LinkedList<Task> onsetTasks = new LinkedList<Task>();
for (Task task : model.getTaskList()) {
if (!task.isActive())
continue;
Date presentTime = new Date();
if (task.nextTimeAfter(presentTime) == null) {
... | 6 |
static public void main(String args[])
{
String[] argv;
long start = System.currentTimeMillis();
int argc = args.length + 1;
argv = new String[argc];
argv[0] = "jlc";
for(int i=0;i<args.length;i++)
argv[i+1] = args[i];
jlcArgs ma = new jlcArgs();
if (!ma.processArgs(argv))
System.exit(1);
Con... | 4 |
public String cryptanalyseCle(IMessage clair, IMessage crypte) {
/*
* La mthode cherche le premier caractre crypt du texte, puis evalue la clef de cryptage
* possible.
* Elle vrifie ensuite si le texte entier est cohrent avec cette cl.
*/
long d=new Date().getTime();
int i=0;
while(i<clair.taille() ... | 9 |
public Journal getById(Integer id) {
Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Journal.class);
criteria.add(Restrictions.eq("id", id));
return (Journal) criteria.uniqueResult();
} | 0 |
@Override
public boolean decideDraw(int turn){
boolean rval;
net_play_count++;
moves_in_round++;
//We only add the draw instnace if the decidePlay outcome is good
createDrawHistory();
if (!USE_RAND && net_play_count < RAND_LIMIT && games_played > RAND_ROUNDS){
drawNet.compute(draw_instance.inputs);
... | 3 |
public Karte karteZiehen(String actionCommand) {
Karte karte = null;
Spieler aktuellerSpieler = spieler.get(this.getAktuellerSpielerIndex());
if (aktuellerSpieler.getGezogenCount() > 0) {
if (actionCommand.equals("Kartenstapel")) {
karte = this.ziehen();
... | 6 |
@Override
public Line getPrecFromTitle() {
Section containingSection = ((TitleImp) this.getParent()).getParent();
if(containingSection.getIndex() >= 1) {
return containingSection.getParent().getSubSection(containingSection.getIndex() -1).getLastLine();
}
if (((TitleImp) this.getParent()).getParent().getPare... | 4 |
public String getNotes()
{
String eol = System.getProperty("line.seperator");
if(this.meetingNotes==null)
{
return "";
}else{
return this.meetingNotes;
}
} | 1 |
@Override
public String getColumnName(int columnIndex) {
if (columnIndex == NUMBER) {
return "№";
} else if (columnIndex == TYPE) {
return "Тип";
} else if (columnIndex == MODEL) {
return "Модель";
} else if (columnIndex == RETURN_DATE) {
... | 4 |
private void setBestSolve(Solve c) {
if (BestSolve == null) {
BestSolve = new Solve();
for (int i = 0; i < c.Colors.size(); i++) {
BestSolve.Colors.add(c.Colors.get(i));
}
BestSolve.Value = c.Value;
} else {
for (int i = 0; i < ... | 3 |
@Test
public void testStartOfDay() throws ParseException {
Date date = dateService.getStartOfDay(dateFormat.parse("19.08.2014 20:47:54.345"));
assertEquals(dateFormat.parse("19.08.2014 00:00:00.000"), date);
} | 0 |
private boolean isAreaEmpty(int x1, int x2, int y1, int y2)
{
if (x1 < 0 || y1 < 0 || x2 >= dungeon.length || y2 >= dungeon[0].length)
return false;
if (!isHorizontalLineEmpty(y1, x1, x2))
return false;
if (!isHorizontalLineEmpty(y2, x1, x2))
return false;... | 8 |
public int checkIfMadeIt(int score){
int index = -1;
if(m_scoreBoard.isEmpty()){
return 0;
}
else{
//DEscobrindo a posiçao:
for(int i = 0; i < 5; i++){
if(score >= m_scoreBoard.get(i).getM_maxCoins()){
index... | 3 |
public static String parseType(String type){
if(StringUtils.isBlank(type)){
throw new InvalidParameterException("empty param type");
}
if("string".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)){
return "String";
}else if("int".equalsIgnoreCase(type) || "i... | 8 |
public MatchCounter(File directory, String keyword)
{
this.directory = directory;
this.keyword = keyword;
} | 0 |
private ArrayList<ArrayList> getShapes(List shapes, Traject traject) throws UnsupportedEncodingException, FileNotFoundException, IOException {
FileInputStream stream = new FileInputStream("json/shapes.csv");
CSVReader reader = new CSVReader(new InputStreamReader(stream, "UTF-8"));
String[] next... | 8 |
public void setEncryptedValue(EncryptedDataType value) {
this.encryptedValue = value;
} | 0 |
public boolean setPlayer1(Player p1) {
boolean test = false;
if (test || m_test) {
System.out.println("GameBoardGraphics :: setPlayer1() BEGIN");
}
m_player1 = p1;
if (test || m_test) {
System.out.println("GameBoardGraphics :: setPlayer1(... | 4 |
public synchronized void run() {
try {
while (Thread.currentThread() == readerLog) {
try {
this.wait(100);
}
catch(Exception e) {}
if (inputLog.available() != 0) {
textArea.append(readLine(inputLog));
}
}
while (Thread.currentThread() == readerErr) {
tr... | 7 |
public static void main(String[] args) {
Integer n1 = 128;
Integer n2 = 128;
System.out.println(n1 == n2);
System.out.println(n1 != n2);
Integer n3 = 127;
Integer n4 = 127;
System.out.println(n3 == n4);
System.out.println(n3 != n4);
} | 0 |
public ArrayList<Point> downStairLocs() {
ArrayList<Point> locs = new ArrayList<Point>();
ArrayList<ArrayList<Entity>> entityarrays = new ArrayList<ArrayList<Entity>>(entities.values());
for (int x = 0; x < entityarrays.size(); x++) {
ArrayList<Entity> activeArray = entityarrays.get(... | 3 |
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.