text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void resetArgs() {
if (Options.Size == GameSize.C8) {
R8.setSelected(true);
}
else if (Options.Size == GameSize.C7) {
R7.setSelected(true);
}
else {
R6.setSelected(true);
}
} | 2 |
public ArrayList<Person> getPersonV2(String value) {
ArrayList<Person> fundnePersoner = new ArrayList<>();
for (Person p : personer) {
if (p.getCpr().equalsIgnoreCase(value)) {
fundnePersoner.add(p);
return fundnePersoner;
} else if (p.getFornavn()... | 9 |
public PBKDF2ParameterType.Salt createPBKDF2ParameterTypeSalt() {
return new PBKDF2ParameterType.Salt();
} | 0 |
public static void setOutputFilePath(String outputFilePath)
{
if (CommonUtil.isNull(outputFilePath))
{
return;
}
if (!outputFilePath.endsWith("/"))
{
outputFilePath += "/";
}
CrawlerManager.outputFilePath = outputFileP... | 2 |
public void SetAPIHost(String apiHost) {
if (null == apiHost || apiHost.length() < 2)
throw new IllegalArgumentException("Too short API host.");
_requestUri = "http://" + apiHost + ".alchemyapi.com/calls/";
} | 2 |
public static void add(ArrayList<Track> newSongs) {
boolean lastTrackCase = false;
if(newSongs == null)
return;
if(playQueueTracks.size() != 0) {
if(currentTrack.equals(playQueueTracks.get(playQueueTracks.size()-1))) {
lastTrackCase = true;
}
... | 5 |
public static ClassInfo forName(String name) {
if (name == null || name.indexOf(';') != -1 || name.indexOf('[') != -1
|| name.indexOf('/') != -1)
throw new IllegalArgumentException("Illegal class name: " + name);
int hash = name.hashCode();
Iterator iter = classes.iterateHashCode(hash);
while (iter.hasN... | 6 |
public static String escape(String string) {
StringBuffer sb = new StringBuffer();
for (int i = 0, length = string.length(); i < length; i++) {
char c = string.charAt(i);
switch (c) {
case '&':
sb.append("&");
break;
cas... | 6 |
public ListNode rotateRight(ListNode head, int n) {
if(head==null||n<=0){
return head;
}
ArrayList<ListNode> box = new ArrayList<ListNode>();
ListNode temp = head;
while(temp !=null){
box.add(temp);
temp = temp.next;
}
if(n>=box... | 6 |
public void focusGained(FocusEvent e)
{
Object oggetto = e.getSource();
for (int i=0; i<calcoli; i++)
{
if (oggetto.equals((Object)txtSpazio.get(i)))
{
JTextField tmp = txtSpazio.get(i);
tmp.selectAll();
txtSpazio.set(i,... | 6 |
public boolean belongsTo(GUIComponent component) {
return (this == component) || (superGroup != null && superGroup.belongsTo(component));
} | 2 |
@Override
public long whereCantWear(MOB mob)
{
long where=super.whereCantWear(mob);
final Wearable.CODES codes = Wearable.CODES.instance();
if(where == 0)
{
for(long code : codes.all())
{
if((code != 0)
&& fitsOn(code)
&&(code!=Item.WORN_HELD)
&&(!CMath.bset(where,code)))
{
if(h... | 7 |
public void draw() {
UI.clearGraphics(false);
UI.setColor(c);
for (int h = 0; h < map.length; h++) {
for (int w = 0; w < map[0].length; w++) {
if (map[h][w] != null) UI.fillRect(w * Cell.CELL_WIDTH, h * Cell.CELL_HEIGHT, Cell.CELL_WIDTH, Cell.CELL_HEIGHT, false);
}
}
if (charX >= 0 && charY >= 0) U... | 5 |
private final void method779(boolean bool) {
anInt1301++;
anInt1291 += ++anInt1294;
for (int i = 0; (i ^ 0xffffffff) > -257; i++) {
int i_13_ = anIntArray1296[i];
if ((i & 0x2) != 0) {
if ((0x1 & i ^ 0xffffffff) == -1)
anInt1293 ^= anInt1293 << -853467134;
else
anInt1293 ^= anInt1293 >>> 13... | 5 |
public void updatePhysics() {
clock++;
if(clock > fullTime) {
activated = false;
climber.lostPower(getState());
}
} | 1 |
@Override
public void documentAdded(DocumentRepositoryEvent e) {
// local vars
int whichOne = isThisOneOfOurs(PropertyContainerUtil.getPropertyAsString(e.getDocument().getDocumentInfo(), DocumentInfo.KEY_PATH));
// if it's one of ours ...
if (whichOne != DOCUMENT_NOT_FOUND) {
// mark it open
docOp... | 1 |
private static Set<EEnum> getAllEEnumerations(EClass sysmlClass,
LinkedHashSet<EEnum> linkedHashSet) {
for (EAttribute eAttribute : sysmlClass.getEAllAttributes()) {
if (eAttribute.getEType() instanceof EEnum) {
EEnum eEnum = (EEnum) eAttribute.getEType();
linkedHashSet.add(eEnum);
}
}
for (ERef... | 9 |
protected void quitterTerritoire(Territoire t) {
this.territoiresOccupes.remove(t);
t.setOccupant(null);
if (this.enDeclin && this.territoiresOccupes.size() == 0) {
joueur.pertePeupleEnDeclin();
Partie.getInstance().remettreBoite(this);
}
} | 2 |
public static void main(String... args) throws IOException {
MyScanner sc = new MyScanner();
int h = sc.nextInt();
int w = sc.nextInt();
int k = sc.nextInt();
int counter = 0;
int max = 0;
int a = 1;
int b = 1;
int t = 1;
for (int i = 1; i... | 7 |
@Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
short flag1 = buf.readUByte();
showExperience = BooleanByteWrapper.getFlag(flag1, 0);
showExperienceLevelFloor = BooleanByteWrapper.getFlag(flag1, 1);
showExperienceNextLevelFloor = BooleanByteWrapper.get... | 5 |
private STNode<Key, Value> balance(STNode<Key, Value> x)
{
switch (getShape(x))
{
case LLEFT:
return rotateRight(x);
case LRIGHT:
x.left = rotateLeft(x.left);
return rotateRight(x);
case RRIGHT:
return rotateLeft(x);
case RLEFT:
x.right = rotateRight(x.right);
return rotateLeft(x);
defa... | 4 |
public static ArrayList<Node> execute(Node node) {
ArrayList<Node> results = new ArrayList<Node>();
// If defining a constant, then add it to the runtime stack. If defining a procedure, do nothing.
if (node.getToken() != null && node.getToken().getType() == TokenType.KW_DEFINE) {
St... | 9 |
public boolean displayModesMatch(DisplayMode mode1,
DisplayMode mode2)
{
if (mode1.getWidth() != mode2.getWidth() ||
mode1.getHeight() != mode2.getHeight())
{
return false;
}
if (mode1.getBitDepth() != DisplayMode.BIT_DEPTH_MULTI &&
mode2... | 8 |
public Component getFirstComponent(Container container) {
return m_Components[0];
} | 0 |
public static void main(String[] args)
{
LinkedListNodeIterator<String> list = new LinkedListNodeIterator <String>();
list.addFirst("p");
list.addFirst("a");
list.addFirst("e");
list.addFirst("h");
System.out.println(list);
LinkedListNodeIterator<String> twin = list.copy3(... | 2 |
public boolean fromDiscard(Game g, Rack r)
{
int index = indexer.index(g, r);
int newDrawState = index;
int newDrawAction = drawStates[index].getLeastVisited();
if (oldDrawState != -1)
{
drawStates[oldDrawState].updateReward(drawStates[newDrawState], oldDrawAction);
}
oldDrawState = newDrawState;
ol... | 2 |
@Override
public void sendRequest(String request) throws Exception {
int retriesLeft = REQUEST_RETRIES;
while (retriesLeft > 0 && !Thread.currentThread().isInterrupted()) {
LOGGER.info("Sending request " + request);
requester.send(request);
int expect_reply = 1;
while (expect_reply >... | 8 |
public static boolean deleteRecursively(File root) {
if (root != null && root.exists()) {
if (root.isDirectory()) {
File[] children = root.listFiles();
if (children != null) {
for (File child : children) {
deleteRecursively(child);
}
}
}
return root.delete();
}
return false;
... | 5 |
public static int[] removeDuplicates(int[] input){
int j = 0;
int i = 1;
//return if the array length is less than 2
if(input.length < 2){
return input;
}
while(i < input.length){
if(input[i] == input[j]){
i++;
... | 4 |
private void addCustomIngredient(){
Ingredient ingredient;
try{
ingredient = db.retrieveIngredient(ingredientTextField.getText());
} catch (DataStoreException e){
showErrorMessage("There was a problem retrieving the ingredient from the data store", "Data store error");
... | 4 |
public void setCatchBlock(StructuredBlock catchBlock) {
this.catchBlock = catchBlock;
catchBlock.outer = this;
catchBlock.setFlowBlock(flowBlock);
if (exceptionLocal == null)
combineLocal();
} | 1 |
private void moveWindow(Packet pkt){
int seqNum = pkt.getSeqnum();
if (windowBuffer.peek().getSeqnum() > pkt.getSeqnum()){
return; //ack for an old packet
}
Packet head = windowBuffer.poll();
while (head != null && head.getSeqnum() != seqNum){
head = windowBuffer.poll();
}
aBase = (head == null) ? a... | 4 |
public CommandGroup addUngroupedCommands(Command... command)
{
for(Command c : command)
{
ungroupedCommands.add(c);
}
return this;
} | 1 |
private void drawTerrain() {
int width = UIGlobals.getScreenWidth();
int height = UIGlobals.getScreenHeight();
int cameraX = UIGlobals.camera_x;
int cameraY = UIGlobals.camera_y;
int tileSize = UIGlobals.tileSize;
int xOff = -(tileSize + ((cameraX % tileSize) - tileSize));
int yOff = -(tileSize + ((cam... | 4 |
public static void affecter(GestItineraire gestItineraire, Plan plan,
NoeudItineraire entrepot, PlageHoraire plageHoraireInitiale)
{
List<Livraison> livraisonsInitiales = plageHoraireInitiale.getLivraisons();
List<List<Livraison>> clusters = kmeans(livraisonsInitiales,2);
boolean clustersValides = fals... | 9 |
@Override
public boolean equals(Object obj) {
return obj != null &&
obj instanceof Token &&
((Token) obj).character == character &&
((Token) obj).type == type;
} | 3 |
public void executeEvents(){
if(activeEvents.isEmpty())
return;
for(Job event : activeEvents){
if(event instanceof InterruptableEvent && ((InterruptableEvent)event).shouldEnd() || event instanceof RecurringEvent){
continue;
}
if(((DatedEven... | 6 |
public static void close(){
try
{
rs.close();
} catch (SQLException e)
{
System.out.println("Close ResultSet Failed :" + e);
e.printStackTrace();
}
try
{
stmt.close();
} catch (SQLException e)
{
System.out.println("Close Statement Failed :" + e);
e.printStackTrace();
}
... | 3 |
public static EllipseEquation newInstance(float a, float b, float h, float k) {
return new EllipseEquation(a, b, h, k);
} | 0 |
public void setUitleningen(List<Uitlening> uitleningen) {
this.uitleningen = uitleningen;
} | 0 |
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
Integer2 i2 = new Integer2();
System.out.println("Enter a number: ");
String str = s.nextLine();
int i = Integer.parseInt(str);
i2.setValue(i);
System.out.println("The n... | 3 |
public static BanEntry func_73688_c(String par0Str)
{
if (par0Str.trim().length() < 2)
{
return null;
}
String as[] = par0Str.trim().split(Pattern.quote("|"), 5);
BanEntry banentry = new BanEntry(as[0].trim());
int i = 0;
if (as.length <= ++i)
... | 9 |
public boolean open( )
{
state = State.PROCESSING;
setVisible(true);
while (state == State.PROCESSING);
return(state == State.OKAY);
} | 1 |
protected boolean approachingTurn(Segment s) {
Segment overlappingSegment = findOverlappingSegment(s);
if (desire == Desire.STRAIGHT) {
return false;
}
if (desire == Desire.TURN_LEFT && !vehicle.getLane().canTurnLeft()) {
return false;
}
i... | 7 |
private void clearOldBlocks(Player player, boolean effTimeUp){
Iterator<Block> iceIter = null;
final HashSet<Block> nearPlayer = new HashSet<Block>(9);
Block startBlock = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
for(BlockFace bFace : bCheck){
nearPlayer.add(startBlock.getRelative(bFace));... | 5 |
public void setSurfaceChargeDensity(double sigma){
if(this.psi0set){
System.out.println("You have already entered a surface potential");
System.out.println("This class allows the calculation of a surface charge density for a given surface potential");
System.out.println("or ... | 2 |
public static void main(String a[]) throws IOException {
TreeMap<BigInteger, BigInteger> map = new TreeMap<BigInteger, BigInteger>();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int test = Integer.valueOf(br.readLine());
while(test!=0) {
int N = Integer.valueOf(br.re... | 7 |
private void drawPlayers(Graphics g){
g.setColor(Color.BLACK);
for(int i=0; i<grid.length; i++){
for(int j=0; j<grid[0].length; j++){
for(GameMatter itm: grid[i][j].getItems()){
if(itm instanceof Bandit){
if(itm.equals(player))
g.setColor(Color.MAGENTA);
g.fillRect(j*widthBlock+paddin... | 5 |
private void calculateEnabledState(JoeTree tree) {
if (tree.getComponentFocus() == OutlineLayoutManager.ICON) {
setEnabled(true);
} else {
if (tree.getCursorPosition() == tree.getCursorMarkPosition()) {
setEnabled(false);
} else {
setEnabled(true);
}
}
} | 2 |
public synchronized boolean openSlot(int slotID) {
if (!_isOpen) {
return false;
}
if ((slotID < 0) || (slotID >= _slots.size())) {
return false;
}
if (!_slots.get(slotID).isClosed()) {
return false;
}
_slots.get(slotID... | 5 |
@Override
public ElectionState getElectionState() {
// gets the current date
Date date = new Date();
if (openNominationsDate == null || date.before(openNominationsDate))
return ElectionState.NOT_STARTED;
else if (date.before(startDate))
return ElectionState.NOMINATIONS_OPEN;
else if (date.before(endDat... | 5 |
public static List<GraphNode> generateGraph(List<String> values) {
GraphNode head = null;
List<GraphNode> nodes = new ArrayList<GraphNode>();
for (int i = 0; i < values.size(); i++) {
GraphNode node = new GraphNode(values.get(i));
if (null == head) head = node;
nodes.add(node);
}
for (Gra... | 7 |
@Override
public void checkAssocAddRestriction(ClassSubInstance source,
ClassSubInstance target, ModelSubInstance m)
throws RestrictionException {
Iterator<Map.Entry<Integer, AssociationSubInstance>> it = m.assocs.entrySet().iterator();
while(it.hasNext()) {
AssociationSubInstance a = it.next().getValue();... | 6 |
public void update(Observable o, Object arg) {
// update garage.occupancy and the garage.isOpen status as needed
// the garage observes both the entry and exit in order to
// keep occupancy correct
if ((String)arg == "entry") {
currentOccupancy++;
} else if ((String)arg == "exit") {
currentOccupanc... | 5 |
public RobotType getRobotType(IRobotItem robotItem, boolean resolve, boolean message) {
IRobotClassLoader loader = null;
try {
loader = createLoader(robotItem);
Class<?> robotClass = loader.loadRobotMainClass(resolve);
if (robotClass == null || java.lang.reflect.Modifier.isAbstract(robotClass.getModifier... | 8 |
@Override
public void update(final int delta) {
if (!isActive && !Game.getInstance().getCurrentLevel().isWon())
return;
pos.y -= 400. * delta / DURATION;
timeLeft -= delta;
if (timeLeft < 0) {
kill();
if (Game.getInstance().getCurrentLevel().getLevelType() == Level.LEVEL_COMPLEX) {
World.getIns... | 7 |
public void sendMessage(byte[] message) {
try {
to_peer.write(message);
to_peer.flush();
} catch (IOException e) {
System.err.println("Error sending message: " + message.toString() +
"/nto peer located at: " + peer_ip);
}
} | 1 |
public void update(Map userCredentials) throws AuthenticationException {
if (passwordFile == null)
throw new AuthenticationException("update()", new IllegalStateException());
try {
String userName = (String) userCredentials.get(Registry.SASL_USERNAME);
String password = (String) ... | 5 |
private static String getRelativeLink( String fromDir, String toDir )
throws IOException
{
StringBuffer toLink = new StringBuffer(); // up from fromDir
StringBuffer fromLink = new StringBuffer(); // down into toDir
// create a List of toDir's parent directories
List parent... | 8 |
private static Code[][] convertStringArrayToCodeArray2D(String[] strArray) {
int len = strArray.length;
// Make histogram of sizes
int[] codeLengths = new int[64];
for (int i = 0; i < len; i++) {
int entryLength = strArray[i].length();
codeLengths[entryLength]++;... | 7 |
public static void randomVector(Configuration conf) {
FSDataOutputStream output = null;
BufferedWriter outputBR = null;
try {
FileSystem hdfs = FileSystem.get(conf);
output = hdfs.create(EntityDriver.randomVectorPath, true);
outputBR = new BufferedWriter(new OutputStreamWriter(output,"UTF-8"));
Rand... | 5 |
public Acceptor(int port, ConcurrentLinkedQueue<AIConnection> globalClients, int backlogArg, boolean isGraphicsManagerArg, GraphicsContainer graphicsContainer){
try {
acceptorSocket = new ServerSocket(port);
acceptorSocket.setReuseAddress(true);
graphics = graphicsContainer;
backlog = backlogArg;
... | 2 |
/* */ public static void close()
/* */ {
/* 187 */ for (Map.Entry entry : playerMap.entrySet())
/* */ {
/* 189 */ ArrayList<BlockState> blockStateList = (ArrayList<BlockState>)entry.getValue();
/* */
/* 191 */ for (BlockState blockState : blockStateList) {
/* 192 */ bloc... | 2 |
public static void test3()
{
String databaseName = "mytest";
MySQLIdentity mytestAtMytest = MySQLService.createMyIdentity("localhost",databaseName, "mytest", "password");
try {
MySQLService.createConnectionPool(mytestAtMytest);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStack... | 6 |
public JMenuItem getMntmDesconectar() {
if (mntmDesconectar == null) {
mntmDesconectar = new JMenuItem("Desconectar");
}
return mntmDesconectar;
} | 1 |
protected void updateList(List<Hunter> hunters) {
if(log.isLoggable(Logger.INFO))
log.log(Logger.INFO, "updateList(), size: " + hunters.size());
this.model = hunters;
rowData = new String[10][4];
for (int i=0; i<10; i++) {
tableModel.setValueAt("", i, 0);
tableModel.setValueAt("", i, 1);
... | 4 |
protected void loadJarURLs() throws Exception {
state = 2;
String jarList = "lwjgl.jar, jinput.jar, lwjgl_util.jar, client.zip, " + mainGameUrl;
jarList = trimExtensionByCapabilities(jarList);
StringTokenizer jar = new StringTokenizer(jarList, ", ");
int jarCount = jar.countTokens() + 1;
urlL... | 7 |
public void changeHeight(int height)
{
for(int i=0;i<markers;i++)
{
if(marker[i].isSelectedHeight())
{
marker[i].changeHeight(height);
}
}
} | 2 |
public String[] getLatLon(int id){
/*
* epistrefei tis suntetagmenes enos oximatos
*/
String[] oxima=new String[2];
try {
pS = conn.prepareStatement("SELECT * FROM oximata WHERE id=?");
pS.setInt(1, id);
rs=pS.executeQuery();
if(rs.next()){
oxima[0]=rs.getString("lat");
oxima[1]=rs.getSt... | 3 |
private void jButton1ActionPerformed(ActionEvent evt) {
try {
socket = new Socket("127.0.0.1",2009);
login = jTextField1.getText();
password = new String(jPasswordField1.getPassword());
LoginCheck lc = new LoginCheck(socket);
IDcheck = lc.Check(login, p... | 3 |
public void saveUser(User user) {
File f = new File(users, user.getUserID() + ".sav");
try {
if (!f.exists())
f.createNewFile();
ObjectOutputStream out = new ObjectOutputStream(
new FileOutputStream(f));
out.writeObject(user);
out.flush();
out.close();
} catch (Exception ex) {
ex.printS... | 2 |
private void showTP() {
Object o = logic
.showTPStatus(((DeptVO) deptChooser.getSelectedItem()).deptName);
if (o instanceof Feedback) {
JOptionPane.showMessageDialog(null, ((Feedback) o).getContent());
} else if (o instanceof TPDeptVO) {
if (((TPDeptVO) o).isCommitted) {
lb.setLabelText(((TPDeptVO) ... | 8 |
public ImmReg(ImmRegOp operation, long leftOperand, Register rightOperand) {
switch(rightOperand.width()) {
case Byte:
if(leftOperand < Byte.MIN_VALUE || leftOperand > Byte.MAX_VALUE) {
throw new IllegalArgumentException("immediate operand does not fit into byte");
}
break;
case Word:
if(l... | 9 |
public static void main(String arg[]) throws IOException{
Xls_Reader datatable = null;
datatable = new Xls_Reader("C:\\CM3.0\\app\\test\\Framework\\AutomationBvt\\src\\config\\xlfiles\\Controller.xlsx");
for(int col=0 ;col< datatable.getColumnCount("TC5"); col++){
System.out.println(datatable.g... | 1 |
public boolean intersects(Dimension d) {
int x1 = (int) source.drawx;
int y1 = (int) source.drawy;
int x2 = (int) destination.drawx;
int y2 = (int) destination.drawy;
return (((x1 > 0 || x2 > 0) && (x1 < d.width || x2 < d.width)) && ((y1 > 0 || y2 > 0) && (y1 < d.height || y2 < d.height)));
} | 7 |
public static AccessToken getAccessToken(String path, Configuration config) {
AccessToken at = null;
String token = "325878645-W8s04eclPdOy1QOjyh4WTcdHkeCNttPYTiUIDlAZ";
String tokenSecret = "3M0lrV45DRqZCd5BxCrDHEik5wThOLmkrhc7yqWZYjs";
at = new AccessToken(token, tokenSecret);
... | 7 |
public void deleteUser(User user) {
System.out.println(users);
System.out.println(user);
System.out.println("Started delete user");
if(users.contains(user)) {
int i = 0;
System.out.println("delete user: " + user);
while(i<categories.size()) {
... | 7 |
private void notifyListeners()
{
for (ScoreListener listener : listeners)
listener.onScoreChanged();
} | 1 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = in.readLine();
int n = Integer.parseInt(line);
int arr[] = atoi(in.readLine());
int i = 0;
int res = 0;
ArrayList<Integer> lista = new ArrayList<Integer>();
... | 8 |
public boolean concatenateAligned(BitOutputStream src) {
int bitsToAdd = src.totalBits - src.totalConsumedBits;
if (bitsToAdd == 0) return true;
if (outBits != src.consumedBits) return false;
if (!ensureSize(bitsToAdd)) return false;
if (outBits == 0) {
System.arrayco... | 7 |
public static void main(String... args) throws IOException {
MyScanner sc = new MyScanner();
int n = sc.nextInt();
int m = sc.nextInt();
PriorityQueue<Integer>[] p = new PriorityQueue[n];
for (int i = 0; i < n; i++) {
p[i] = new PriorityQueue<>();
}
i... | 9 |
private void computePositions() {
// Determine time for rendering
if (fConf.getInt("fixedTime") == 0) {
// No fixed time.
// final long lTimePassed = System.currentTimeMillis() - fsStartTime;
// fCurrentTime = fsStartTime + (long) (fConf.getDouble("timeWarpFactor") * lTimePassed);
fCurrentTime = System.... | 8 |
public final SymbolraetselASTNormalizer.num_return num() throws RecognitionException {
SymbolraetselASTNormalizer.num_return retval = new SymbolraetselASTNormalizer.num_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last ... | 5 |
protected void cellsAdded(Object[] cells)
{
if (cells != null)
{
mxIGraphModel model = getGraph().getModel();
model.beginUpdate();
try
{
for (int i = 0; i < cells.length; i++)
{
if (!isSwimlaneIgnored(cells[i]))
{
swimlaneAdded(cells[i]);
}
}
}
finally
{
m... | 3 |
@Override
public void reduce(Text key, Iterator<Node> values,
OutputCollector<Text, Node> output, Reporter reporter)
throws IOException {
int min = Integer.MAX_VALUE;
Node node = null;
while (values.hasNext()) {
Node distance = values.next();
if(LOGGER.isDebugEn... | 9 |
public SignatureVisitor visitSuperclass() {
if (type != CLASS_SIGNATURE || (state & (EMPTY | FORMAL | BOUND)) == 0) {
throw new IllegalArgumentException();
}
state = SUPER;
SignatureVisitor v = sv == null ? null : sv.visitSuperclass();
return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
} | 3 |
public void addControlLogic() {
Action run = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
run();
}
};
runButton.addActionListener(run);
Action clear = new AbstractAction() {
public void actionPerformed(ActionEven... | 8 |
public void seguridadMenus() {
@SuppressWarnings("static-access")
String mcodusr = mcod_usr;
try {
rs = sql.executeQuery("SELECT permission FROM perfil INNER JOIN admg02 ON admg02.id_perfil = perfil.id_perfil WHERE admg02.cod_usr = '" + mcod_usr + "'");
if (rs.next()) {
... | 8 |
private WriteConcern buildWriteConcern(final Boolean safe, final String w,
final int wTimeout, final boolean fsync, final boolean journal) {
if (w != null || wTimeout != 0 || fsync || journal) {
if (w == null) {
return new WriteConcern(1, wT... | 8 |
private final void pop(char c) throws JSONException {
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m != c) {
throw new JSONException("Nesting error.");
}
this.top -= 1;... | 5 |
public void dailyBonus(Player player)
{
//for (List<WorldMapObject> s: p2o.objects()) {
for (WorldMapObject o: p2o.objects()) {
o.dailyBonus(player);
}
for (WorldMapObject o: p2h.objects()) {
o.dailyBonus(player);
}
//}
} | 2 |
@Override
public void deserialize(Buffer buf) {
id = buf.readShort();
if (id < 0)
throw new RuntimeException("Forbidden value on id = " + id + ", it doesn't respect the following condition : id < 0");
finishedlevel = buf.readShort();
if (finishedlevel < 0 || finishedlevel... | 3 |
public boolean isCellEditable(int row, int column) {
return false;
} | 0 |
private void doConversion(int startPosition, int stepAlgorithm) {
int block[] = new int[BLOCK];
int col = 0;
int row;
int x = 0;
int y = 0;
int position = startPosition;
for (int i = 0; i < HEIGHT; i += SIZE_BLOCK) {
row = i + STEP;
for (in... | 5 |
public void Download10KbyCIKList(String filename) {
try {
FileReader fr = new FileReader(filename);
BufferedReader br = new BufferedReader(fr);
String str = br.readLine();
while (str != null) {
Download10KbyCIK(str, false);
str = br.readLine();
}
br.close();
} catch (FileNotFoundException ... | 3 |
private void findChromosomeRegionItems(RPTreeNode thisNode, RPChromosomeRegion selectionRegion,
ArrayList<RPTreeLeafNodeItem> leafHitItems) {
int hitValue;
// check for valid selection region - ignore request if null
if (selectionRegion == null)
... | 9 |
public Bomb getBomb() {
return bomb;
} | 0 |
@Override
public boolean onCommand(CommandSender commandSender, Command command, String strLabel, String[] vArgs)
{
if (commandSender instanceof Player)
{
KaramPlayer player = m_plugin.playerManager.addOrGetPlayer((Player)commandSender);
if (vArgs.length == 1)
... | 7 |
public int removeElement(int[] A, int elem) {
// if (A.length==0) return 0;
int n = -1;
for (int i = 0; i < A.length; i++) {
while (i < A.length && A[i] == elem) {
i++;
}
if (i < A.length && A[i] != elem) {
n = n + 1;
A[n] = A[i];
}
}
return n + 1;
} | 5 |
public boolean shouldDeconstruct() {
if (dist > Asteroids.getScreenDims()[0])
return true;
return false;
} | 1 |
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.