text stringlengths 14 410k | label int32 0 9 |
|---|---|
static int process(String line) {
int cases = Integer.parseInt(line.trim());
for(int c = 1; c <= cases; c++) {
String s = readLine().trim();
while(s.compareTo("") == 0) {
s = readLine().trim();
}
int[] arr = giveArray(s.split(" "));
int n = arr[0], b = arr[1], r = arr[2];
int[] jump = new ... | 9 |
public static boolean isPlate(String plate) {
if(plate.length() == 7)
{
char[] charPlate = plate.toCharArray();
for (int i = 0; i < charPlate.length; i++) {
if(i < 3)
{
if(!Character.isLetter(charPlate[i]))
{
return false;
}
}
else
{
if(i == 3)
{
... | 7 |
public static boolean zmq_disconnect(SocketBase s_, String addr_) {
if (s_ == null || !s_.check_tag ()) {
throw new IllegalStateException();
}
return s_.term_endpoint (addr_);
} | 2 |
double []tax_rate(char status, int income){
double []ledger = new double[2];
//String norma = String.format("%s",status);
//ledger[0] = (String.format("%s",status).toLowerCase().equals("s")) ? income < 32000 ? .10*32000 : 3200 +
// (income * .25):2;
if (String.format("%s",status)... | 4 |
public void swt() throws SWTException {
display = new Display();
shell = new Shell(display);
createContents();
addListener();
update();
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
} | 2 |
public void sendJoinClanChat(String username, String clanName) {
OutputStream stream = new OutputStream();
stream.writePacketVarShort(7);
stream.writeByte(1);
if (!player.inClanChat) {
int idk = 2;
int idk3 = 1;
boolean idk1 = false;
boolean idk2 = false;
stream.writeByte(idk);
if (idk == 1) {... | 7 |
public void update(float dt){
highlight.update(dt);
if(scrolling){
scrollTime+=dt;
scrollOff.x = Vars.easingFunction(scrollTime, .2f, prevScroll.x, goalScroll.x);
scrollOff.y = Vars.easingFunction(scrollTime, .2f, prevScroll.y, goalScroll.y);
if(scrollTime>=SCROLL_TIME)
scrolling = false;
}... | 6 |
public int addUtf8Info(String utf8) {
Utf8Info info = (Utf8Info)strings.get(utf8);
if (info != null)
return info.index;
else {
info = new Utf8Info(utf8, numOfItems);
strings.put(utf8, info);
return addItem(info);
}
} | 1 |
@Override
public boolean onCommand(CommandSender cs, Command c, String l, String[] args) {
if(c.getName().equalsIgnoreCase("flogin")){
new FLoginCommand(cs, args);
return true;
}
if(c.getName().equalsIgnoreCase("flogout")){
new FLogoutCommand(cs, args);
return true;
}
return false;
} | 2 |
public void deleteSelectedItem()
{
// DELETE THE SELECTED INTERSECTION, BUT MAKE SURE IT'S
// NOT THE STARTING LOCATION OR DESTINATION
if ((selectedIntersection != null)
&& (selectedIntersection != level.startingLocation)
&& (selectedIntersection != level.des... | 8 |
private static void readTaskSet()
{
try
{
BufferedReader br = new BufferedReader(new FileReader(inputFile));
String line = "";
/*Skip first line*/
br.readLine();
while((line = br.readLine()) != null)
{
/*split line on spaces*/
String[] tokens = line.split("[ \t]+");
... | 8 |
void retract() {
assert movesMade() > 0;
Move lastMove = _moves.remove(_moves.size() - 1).reversed();
makeMove(lastMove);
_moves.remove(_moves.size() - 1);
if (numOnLine(lastMove) != lastMove.length()) {
setPiece(lastMove.getRow0(), lastMove.getCol0(),
... | 2 |
@Override
public void received(Connection c, Object o) {
UserConnection connection = (UserConnection) c;
User user = connection.user;
if (o instanceof Login) {
LoginResult lr = new LoginResult();
lr.result = true;
// Ignore if alr... | 6 |
public void render(Graphics g)
{
for (int i = 0; i < 4; i++)
{
g.drawLine(edges[i].x0, edges[i].y0, edges[i].x1, edges[i].y1);
}
} | 1 |
public void loadOrFail(String fileName) throws IOException
{
// set the current picture's file name
this.fileName = fileName;
// set the extension
int posDot = fileName.indexOf('.');
if (posDot >= 0)
this.extension = fileName.substring(posDot + 1);
// if the current title is null use th... | 4 |
public boolean getBoolean(String key) throws JSONException {
Object object = this.get(key);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equals... | 6 |
public HTMLAnchor getAnchorByText(String regex) {
Pattern p = Pattern.compile(regex);
for (HTMLAnchor a : anchors) {
final String bodyText = a.getBody();
if (bodyText != null && p.matcher(bodyText).find())
return a;
}
return null;
} | 3 |
@Override
@Execute
public void preLogic(IChassis chassis) {
//Generate the primary camera matrices
if(this.camera != null) this.camera.generateMatrices(chassis.getRenderEngine().getDelta());
Iterator<GUIElement> it = this.guiElements.values().iterator();
while(it.hasNext()) {
GUIElement element = it.nex... | 3 |
public void unhideCards(CardGame game) {
//Not efficient, but easy
if (!game.getDeck().isEmpty()) {
game.getDeck().peek().setHidden(false);
}
for (List<Card> cardList : game.getBoard()) {
for (Card card : cardList) {
card.setHidden(false);
... | 5 |
public Long[] getPropertyLongArry(String key, Long[] defaultValue) {
try {
if (containsPropery(key)) {
StringTokenizer stk = new StringTokenizer(getProperty(key), ",");
Long ret[] = new Long[stk.countTokens()];
for (int i = 0; stk.hasMoreTokens(); i++)... | 8 |
private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged
try {
if (jList1.getSelectedValue().equals("Artist")) {
sort.byArtist();
DefaultListModel model = new DefaultListModel();
for(int i = 0; i <... | 9 |
private void create(final String skinname) {
JPanel topPanel = new JPanel();
topPanel.setBackground(GUIConstants.DEFAULT_BACKGROUND);
String tmp = GUIStrings.keyToLocatedString(GUIStrings.KEY_RENAMEDIALOG_TITLE);
topPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createE... | 5 |
@Override
public void deserialize(Buffer buf) {
jobId = buf.readByte();
if (jobId < 0)
throw new RuntimeException("Forbidden value on jobId = " + jobId + ", it doesn't respect the following condition : jobId < 0");
minSlot = buf.readByte();
if (minSlot < 0 || minSlot > 9)... | 4 |
@Override
protected void setColoredExes() {
// TODO Auto-generated method stub
coloredEx = LineGenerator.Brezenhem(begin, end);
} | 0 |
public void readFile() throws FileNotFoundException {
File inFile = new File(fileName);
Scanner in = new Scanner(inFile);
// Check for the header, the right format of specifying the width,
// height and the color instance. If all ok, proceed with the reading
// RGB components.
try {
String header = ... | 8 |
private boolean expr_sempred(ExprContext _localctx, int predIndex) {
switch (predIndex) {
case 0: return precpred(_ctx, 11);
case 1: return precpred(_ctx, 10);
case 2: return precpred(_ctx, 9);
case 3: return precpred(_ctx, 8);
case 4: return precpred(_ctx, 7);
case 5: return precpred(_ctx, 6);
case 6: ... | 8 |
private String makePileMove(CardGame game) {
if (topRow) {
return game.moveCardOntoTopRowFromRow(boardIndexFrom, boardIndexTo);
} else {
return game.moveCardOntoCardFromTopRow(boardIndexFrom, boardIndexTo);
}
} | 1 |
boolean scrambleHelper(int is, int js, int l) {
if (!setMatch(is, js, l))
return false;
if (l == 1)
return true;
for (int cut = 1; cut < l; cut++) {
boolean valid;
valid = scrambleHelper(is, js, cut)
&& scrambleHelper(is + cu... | 7 |
public void setAttributeValue(int i, int j) {
try {
if (vn.toString(i + j).equals("action")) {
int attr = j + 1;
actions = vn.toString(i + attr);
setActions(actions);
}
if (vn.toString(i + j).equals("element_location")) {
int attr = j + 1;
elementLocation = vn.toString(i + attr);
setE... | 7 |
public void execute(NewRowEvent newRowEvent){
String[] formattedResults = new String[finalReportColumnCount];
Object[] nonFormattedResults = new Object[finalReportColumnCount];
Object[] previousRowGrpValues = getPreviousRowOfGroupingValues();
Object valueForCurrentColumn = null;
boolean groupChanged = ... | 7 |
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
String input= userNameField.getText();
if (OK.equals(cmd) && !input.trim().equals("")) {
if (checkAccount(input)==false && input.equalsIgnoreCase("Admin") || input.equalsIgnoreCase("Administrat... | 8 |
@Override
public T findByID(Integer id) throws DaoException {
waitCompete();
return getEntities().get(id);
} | 0 |
@Override
public void update()
{
} | 0 |
protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... | 9 |
@Override
public double getValue(int row, int col) throws MatrixIndexOutOfBoundsException {
if ((row < 0) || (col < 0) || (row >= mas.size()) || (col >= mas.get(0).size())) {
throw new MatrixIndexOutOfBoundsException("Inadmissible value of an index.");
}
return mas.get(row).get(c... | 4 |
private void botonAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAceptarActionPerformed
int fila = tabla.getSelectedRow();
int columna = tabla.getSelectedColumn();
if(fila == -1 || columna == -1){
JOptionPane.showMessageDialog(this, "Debe seleccionar u... | 3 |
private void loadConfig() {
String configpath = "/plugins/BungeeSuite/config.yml";
config = new Config(configpath);
username = config.getString("BungeeSuite.SQL.Username", "root");
password = config.getString("BungeeSuite.SQL.Password", "password");
database = config.getString("BungeeSuite.SQL.Database", "... | 4 |
public void addTank(Tank t, int battles, int wins) {
if (tankBattles.containsKey(t)) {
BattleStats b = tankBattles.get(t);
battlesByType[t.type.ordinal()] += battles - b.battles;
b.battles = battles;
b.victories = wins;
} else {
BattleStats b = new BattleStats();
b.battles = battles;
b.victorie... | 9 |
private void writeValue(Object value) throws JSONException {
if (value instanceof Number) {
String string = JSONObject.numberToString((Number) value);
int integer = this.valuekeep.find(string);
if (integer != none) {
write(2, 2);
write(integer,... | 9 |
@Test
@SuppressWarnings("unused")
public void testSynchronizeString()
{
final int ITERATIONS = 1000000;
watch.start("Without synchronized... ");
String j = "";
for (int i = 0; i < ITERATIONS; i++) {
j += i;
if (i % 20 == 19) {
j = "";
}
}
watch.stop("%.6f seconds.\n");
long x = watch.n... | 4 |
public ArrayList<String[]> solveNQueens(int n) {
ArrayList<String[]> res = new ArrayList<String[]>();
if (n <= 0)
return res;
board = new boolean[n][n];
solveNQueensDFS(0, n, res);
return res;
} | 1 |
public Environment getEnvironment() {
return environment;
} | 0 |
public boolean accept(File f) {
return true;
} | 0 |
private boolean pluginFile(String name) {
for (final File file : new File("plugins").listFiles()) {
if (file.getName().equals(name)) {
return true;
}
}
return false;
} | 2 |
private void expand1(byte[] src, byte[] dst) {
for(int i=1,n=dst.length ; i<n ; i+=8) {
int val = src[1 + (i >> 3)] & 255;
switch(n-i) {
default: dst[i+7] = (byte)((val ) & 1);
case 7: dst[i+6] = (byte)((val >> 1) & 1);
case 6: dst[i+... | 8 |
@Override
public int attack(final NPC npc, final Entity target) {
final NPCCombatDefinitions defs = npc.getCombatDefinitions();
npc.setNextAnimation(new Animation(defs.getAttackEmote()));
switch (Utils.getRandom(5)) {
case 0:
npc.setNextForceTalk(new ForceTalk("Bwuk"));
break;
case 1:
npc.setNextFor... | 8 |
public Task updateTaskByIdName( String id,
String name,
String date,
String status,
String required,
String description,
String attendants)throws JAXBException, IOException{
//Check this line
//FileInputStream stream = new FileInputStream("/WEB-INF/task-manager-xml.x... | 3 |
public boolean supports(final Class clazz) {
return EntityForm.class.equals(clazz);
} | 0 |
private Item onItem(double nx, double ny){
for (Item i : model.getItems()){
Rectangle s = (Rectangle) i.getShape();
if(s.getX()== nx
&&
s.getY() == ny
){
return i;
}
}
return null;
} | 3 |
@Override
public void getResults(Course curr, StyledDocument doc) {
// TODO Auto-generated method stub
// Load the default style and add it as the "regular" text
Style def = StyleContext.getDefaultStyleContext().getStyle( StyleContext.DEFAULT_STYLE );
Style regular = doc.addStyle( "regular", def );
// Cre... | 8 |
public static void blur( int[] in, int[] out, int width, int height, int radius ) {
int widthMinus1 = width-1;
int tableSize = 2*radius+1;
int divide[] = new int[256*tableSize];
for ( int i = 0; i < 256*tableSize; i++ )
divide[i] = i/tableSize;
int inIndex = 0;
... | 6 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Measurement that = (Measurement) o;
if (channel != that.channel) return false;
if (id != that.id) return false;
if (timestamp != that.t... | 7 |
public void addAllCreatures(Collection<? extends ICreature> creatures) {
actionables.addAll(creatures);
} | 1 |
private void parseFields( Token token ) {
if ( !token.isWord() ) {
throwException( "Expecting type." );
}
else {
parseCommonFields( token );
}
} | 1 |
private void analyzeWhere()
{
if(where==null)
return;
ArrayList<Expression> exprs=new ArrayList<Expression>();
decomposer.andBreaker(where, exprs);
System.out.println("***************************************************************************");
//print the broken expression out
Iterator<Expression... | 7 |
Capture(Socket s){
this.s=s;
} | 0 |
public void print(String outStr) {
try {
// Open output file?
if ((outputFile != null) && (out == null)) out = new BufferedWriter(new FileWriter(outputFile));
// Write something?
if ((outStr != null) && (!outStr.isEmpty())) {
// Write to file?
if (out != null) {
out.write(outStr);
out.w... | 6 |
public void generateSetPath() {
double currentX = this.startX;
double currentY = this.startY;
double tempY = this.widthY;
int i;
if (currentX < (this.widthX) / 2) {
i = 0;
} else {
i = 1;
}
// pushes points in reverse order from the opposite corner into the robot in an s pattern
// while ignori... | 5 |
private String unicodeToPlain(String source, Boolean uppercase, String postchars) {
String plainResult = "";
Integer srcLen = source.length();
String hex = "";
int j;
// Cycles through encoded text. Finds all instances of %XX and converts them
// to the plain text equiv... | 8 |
@Override
public Object _save(Object o) {
if (null == o) {
System.err.println("Warning, object to save is a nullptr");
return null;
}
Connection connection = createConnectionObject();
try {
checkAndSyncSchema(o.getClass(), connection);
} catch (SQLException e) {
e.printStackTrace();
return ... | 4 |
protected boolean out_grouping_b(char [] s, int min, int max)
{
if (cursor <= limit_backward) return false;
char ch = current.charAt(cursor - 1);
if (ch > max || ch < min) {
cursor--;
return true;
}
ch -= min;
if ((s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) {
cursor--;
return true;
}
return... | 4 |
private void addToList(Class<?> c, Listener l){
if(map.containsKey(c)){
if(map.get(c)!= null){
if(!map.get(c).contains(l)){
map.get(c).add(l);
}
}
}
} | 4 |
public static void printAllHebrewCharter() {
for (int i = 0X0591; i <= 0x05f4; i++) {
System.out.printf("%2c %3c %4X\n", i, 0x2502, i);
}
} | 1 |
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignedInfo")
public JAXBElement<SignedInfoType> createSignedInfo(SignedInfoType value) {
return new JAXBElement<SignedInfoType>(_SignedInfo_QNAME, SignedInfoType.class, null, value);
} | 0 |
private void setHeadSprite() {
if(direction.y() < 0) {
snake.set(0, sprites[0]);
} else if(direction.y() > 0) {
snake.set(0, sprites[1]);
} else if(direction.x() < 0) {
snake.set(0, sprites[2]);
} else if(direction.x() > 0) {
snake.set(0, sprites[3]);
}
} | 4 |
public int getEnergy() {
return energy;
} | 0 |
public void calcRepulsion() {
for (int i = 0; i < vertexArray.length; i++) {
for (int j = i; j < vertexArray.length; j++) {
if (progress.isStopped())
return;
if (j != i) {
double xDelta = cellLocation[i][0] - cellLocation[j][0];
double yDelta = cellLocation[i][1] - cellLocation[j][1];
... | 9 |
protected void cacheCtClass(String classname, CtClass c, boolean dynamic) {
if (dynamic) {
super.cacheCtClass(classname, c, dynamic);
}
else {
if (repository.isPrune())
c.prune();
softcache.put(classname, c);
}
} | 2 |
private void postPlugin(boolean isPing) throws IOException {
// Server software specific section
PluginDescriptionFile description = plugin.getDescription();
String pluginName = description.getName();
boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enab... | 5 |
public static Stella_Object accessReverseIntegerIntervalIteratorSlotValue(ReverseIntegerIntervalIterator self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Stella.SYM_STELLA_INTERVAL_CURSOR) {
if (setvalueP) {
self.intervalCursor = ((IntegerWrapper)(value)).wrapperValue;
... | 6 |
private String evalExpectedType2(ArrayList equiv, int n) throws BadBytecode {
String origName = null;
for (int i = 0; i < n; i++) {
TypeData td = (TypeData)equiv.get(i);
if (!td.isNullType())
if (origName == null)
origNa... | 4 |
private void setListeners() {
nameText.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
... | 5 |
public void sortColors2Pass(int[] A) {
int[] counts = new int[3]; // count for color 0,1,2
System.out.println("Before");
printIntArray(A);
for (int i = 0; i < A.length; i++) {
switch (A[i]) {
case 0:
counts[0]++;
break;
case 1:
counts[1]++;
break;
case 2:
counts[2]++;
break... | 7 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
return toString().equals(o.toString());
} | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
BoardCell other = (BoardCell) obj;
if (index == null) {
if (other.index != null)
return false;
} else if (!index.equals(other.index))
... | 6 |
@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 Tournament)) {
return false;
}
Tournament other = (Tournament) object;
if ((this.id == null && other.id != null... | 5 |
private static void inputgraph() throws FileNotFoundException {
// TODO Auto-generated method stub
File f = new File("src/dijkstraData.txt");
int i;
int j;
for (i = 0; i < 201; i++) {
graph.add(new ArrayList<Integer>());
//exploredarray.add(false);
pathlength[i]= 15000;
for(j =0 ; j<205;j++){
... | 4 |
static public AudioInputStream convertToPCM(AudioInputStream in) throws IllegalArgumentException
{
AudioFormat targetFormat = null;
AudioInputStream pcm = in;
AudioFormat sourceFormat = in.getFormat();
int sampleSizeInBits;
//check for not null
if(in == null)
throw new IllegalArgumentEx... | 8 |
public void setLocation(float xPos, float yPos)
{
if( keyPoint != null)
{
float keyPointXLoc = keyPoint.getXPos();
float keyPointYLoc = keyPoint.getYPos();
float extraShiftY = 0;
float extraShiftX = 0;
for( Point movingPoint: PointList )
{
extraShiftX = movingPoint.getXPos() - keyPointXLoc;
... | 2 |
public static int longestValidParentheses1(String s) {
int len = s.length();
if(len == 0) {
return 0;
}
Stack<Integer> last = new Stack<Integer>();
String[] parts = s.split("");
int count = 0;
int tmp = 0;
int max = 0;
for(int i=0;i<len;i++) {
if(parts[i].equals("(")) {
count++;
las... | 7 |
public AutomatonPane getAutomatonPane() {
return automatonPane;
} | 0 |
private Matrix getExcludedMatrix(int row, int column) {
Matrix m = new Matrix(numRows - 1, numColumns - 1);
for(int i = 0; i < numRows - 1; i++) {
for(int j = 0; j < numColumns - 1; j++) {
m.elements[i][j] = elements[i < row ? i : i + 1][j < column ? j
: j + 1];
}
}
return m;
} | 4 |
public void dailyBonus(Player player)
{
if (!player.getName().equals("dummy")) {
movePoints = getMaxMovePoints();
}
if (color == player.getColor()) {
for (Artifact a: active.values()) {
a.dailyBonus(player);
}
}
} | 3 |
public void onEnable() {
instance = this;
getConfig().options().copyDefaults(true);
saveConfig();
Server server = getServer();
ConsoleCommandSender console = server.getConsoleSender();
if(getConfig().getString( "Send Stats" ).equals("enabled" ) ) {
try {
... | 5 |
public boolean hasCollided(int xa, int ya) {
int xMin = 0;
int xMax = 7;
int yMin = 3;
int yMax = 7;
for (int x = xMin; x < xMax; x++) {
if (isSolidTile(xa, ya, x, yMin)) {
return true;
}
}
for (int x = xMin; x < xMax; x++) {
if (isSolidTile(xa, ya, x, yMax)) {
return true;
}
}
... | 8 |
@Override
public void messageSent(NextFilter nextFilter, IoSession session,
Object message) throws Exception {
InputStream inputStream = (InputStream) session
.getAttribute(CURRENT_STREAM);
if (inputStream == null) {
nextFilter.messageSent(session, message);
... | 6 |
public synchronized boolean needsGui() {
BeanContext bc = getBeanContextPeer();
if (bc != this) {
if (bc instanceof Visibility) return ((Visibility)bc).needsGui();
if (bc instanceof Container || bc instanceof Component)
return true;
}
synchroniz... | 8 |
public static GraphFilter getCorrectFilter(ArrayX<String> filter) {
GraphFilter gf = null;
if (filter.getValue().equals(Filters.Integral)) {
gf = new IntegralFilter();
} else if (filter.getValue().equals(Filters.LaplacianIntegral)) {
gf = new LaplacianIntegralFilter();
... | 8 |
public boolean looksLike(Peer other) {
if (other == null) {
return false;
}
return this.ip.equals(other.getIp()) && this.port == other.getPort();
} | 2 |
public boolean ApplyRingz() {
if (IsDeadTimer == false) {
actionAmount++;
actionTimer = 4;
ResetAttack();
//setAnimation(0x718);
IsDeadTimer = true;
}
if (actionTimer == 0 && IsDeadTimer == true) {
teleportToX = 2899;
teleportToY = 3557;
resetAnimation();
IsDeadTeleporting = true;
up... | 3 |
public String getCode(){
String str = condition.getCode() +
this.printLineNumber(true) +
"if " + condition.place + " == false " +
"goto := " + String.valueOf(this.currentLineNumber + truePart.tLineCount() + (falsePart != null ? 2 : 1)) + "\n" +
truePart.getCode();
if(falsePart != null)
str += ... | 2 |
@Override
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
String line = getLine(value);
lastKLines.add(line);
while (lastKLines.size() > k) {
lastKLines.poll();
}
if (line == null || line.isEmpty()) {
return;
}
// Handle line ... | 8 |
public String getClassString(ClassInfo clazz) {
String name = clazz.getName();
if (cachedClassNames == null)
/* We are not yet clean, return the full name */
return name;
/* First look in our cache. */
String cached = (String) cachedClassNames.get(name);
if (cached != null)
return cached;
int pkg... | 6 |
public boolean equals(Object object) {
try {
ColorComparator comparator = (ColorComparator) object;
} catch (ClassCastException e) {
return false;
}
return true;
} | 1 |
public boolean commitSportsBooking(Connection conn) throws SQLException {
boolean status = true;
try {
// Start of system transaction
conn.setAutoCommit(false);
BookingMapper bm = new BookingMapper();
status = status && bm.addNewSportsBooking(newSPBooking,... | 3 |
public static void run(){
try{
while(true){
cWaitTime=waitTime;
synchronized (LOCK){
while (!running){
LOCK.wait();
}
if (!field.act(curP)){
int lC = field.take... | 7 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
while ((line = in.readLine()) != null && line.length() != 0) {
int n = Integer.parseInt(line.trim());
out.append(... | 3 |
public static void main(String[] args)
{
try
{
Console console = new Console();
loop: while (true)
{
System.out.println("1 | Toon alle programmaties voor een bepaalde bioscoop tussen 2 datums");
System.out.println("2 | Voeg een soc... | 9 |
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run()
{
new JuliaMandelbrotFrame();
}
});
} | 0 |
@Override
public boolean execute() {
Boolean val = true;
try {
List<Font> fonts = new ArrayList<Font>();
for (int i = this.startFrom; i <= this.endAt; i++) {
Font previousFont = this.document.getChildren().get(i)
.getFont();
Font newFont = new Font(previousFont.getName(),
previousFont... | 2 |
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.