text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
int type;
if (commandLabel.equalsIgnoreCase("unban")) {
if (sender.hasPermission(SeruBans.UNBANPERM) || sender.isOp()
|| (!(sender instanceof Player))) {
... | 8 |
@Override
public boolean activate() {
return (Inventory.isFull() && !Widgets.get(13, 0).isOnScreen()
&& !Constants.ESCAPE_AREA.contains(Players.getLocal())
&& (Constants.VARROCK_WEST_BANK_AREA.contains(Players.getLocal())
|| Constants.VARROCK_EAST_BANK_AREA.contains(Players.getLocal())));
} | 4 |
private IRubyObject log(Level level, ThreadContext ctx, IRubyObject[] args, Block block) {
IRubyObject nil = ctx.getRuntime().getNil();
IRubyObject message = args.length == 1 ? args[0] : null;
if (block.isGiven()) {
if (isSufficientLevel(level)) {
message = block.yield(ctx, nil);
}
}... | 9 |
public LibraryBean[] searchInBooleanMode(String query){
LinkedList<LibraryBean> list = new LinkedList<>();
try {
PreparedStatement statement = connection.prepareStatement(SEARCH_IN_BOOLEAN_MODE);
statement.setString(1, query);
statement.setString(2, query);
ResultSet resultSet = statement.executeQuery()... | 3 |
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
leftPressed = true;
}
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
rightPressed = true;
}
if (e.getKeyCode() == KeyEvent.VK_N) {
nPressed = true;
}
if (e.getKeyCode() == K... | 4 |
public static String GetTimeString() {
SimpleDateFormat sdf = new SimpleDateFormat("MMddHHmmss");
return sdf.format(new Date());
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final RequisicaoModel other = (RequisicaoModel) obj;
if (!Objects.equals(this.pmProjeto, other.pmProjeto)) {
... | 5 |
public JSONObject toJSONObject(JSONArray names) throws JSONException {
if (names == null || names.length() == 0 || this.length() == 0) {
return null;
}
JSONObject jo = new JSONObject();
for (int i = 0; i < names.length(); i += 1) {
jo.put(names.getString(i), this.... | 4 |
protected Field[] getFields(Object obj) {
ArrayList<Field> allFields = new ArrayList<Field>();
ArrayList<Class<?>> classTower = this.getClasses(obj);
// Printout to observe the shown packages
//if(logger.isDebugEnabled())
// logger.debug("Object " + obj.toString() + "has " +
// classTower.size() + " clas... | 8 |
private int maxMove(Board prev, int depth, int alpha, int beta)
{
moves++;
if(depth >= maxDepth) return prev.getScore(); // exceeded maximum depth
int maxScore = MIN_SCORE;
Board b = new Board(prev);
for(int j = 0; j < size; j++)
{
for(int i = 0; i < size; i++)
{
if(b.move(i, j)... | 9 |
public void mouseClicked(MouseEvent e)
{
if (isDrawing && e.getButton() == MouseEvent.BUTTON3){
Polygon p = generatePolygon();
polygons.add(p);
polygonsWithColors.put(p, color);
polygonLineCreate();
}
Set<Map.Entry<String, Boolean>> visibleSet =... | 7 |
@Override
public void exec(String channel, String sender, String commandName, String[] args, String login, String hostname, String message) {
String fmlMessage = "";
try {
URL url = new URL("http://rscript.org/lookup.php?type=fml");
BufferedReader bReader = new BufferedReader... | 5 |
public Properties getProperties() {
if (properties == null) {
InputStream stream = TestSettings.class.getResourceAsStream("/usecases.properties");
try {
properties = new Properties();
properties.load(stream);
} catch (IOException e) {
... | 2 |
public String getFullName() {
return fullNameText.getText();
} | 0 |
public void filter(final String search)
{
RowFilter<TableModel, Object> rf = new RowFilter<TableModel, Object>()
{
@Override
public boolean include(RowFilter.Entry<? extends TableModel, ? extends Object> entry)
{
final MediaElement elt = (MediaElement) entry.getModel().getValueAt((In... | 4 |
public String toString()
{
PrintfFormat fmt = new PrintfFormat(cellFormat);
StringBuffer buf = new StringBuffer();
// line 1 - a ruler
buf.append(" "); buf.append(" ");
for (int i=1; i<=s.length(); i++) buf.append(fmt.sprintf((double)i));
buf.append("\n");
... | 8 |
private String getEditorHtml(WikiContext context, String name) throws IOException {
String template = null;
try {
// NOTE: There is CSS in this template. Keep it in sync with the add_header.css file.
//
// IMPORTANT: Only multipart/form-data encoding works in plugins.... | 5 |
public Item SwapHeadArmor(Item willBeSwappedItem) {
return headArmorSlot.swap(willBeSwappedItem);
//return false;// swap failed
} | 0 |
private boolean isHeader(Element el) {
if(el == null) return false;
return el.tagName().equals("h2") || el.tagName().equals("h3") || el.tagName().equals("h4");
} | 3 |
public void listarPesqGerente() {
UsuarioBO Gerente = new UsuarioBO();
try {
tbResultadoBusca.setModel(DbUtils.resultSetToTableModel(Gerente.pesquisaGerente(txtCampoBuscaGerente.getText())));
} catch (SQLException ex) {
}
} | 1 |
private static int stringSize(long num, int radix) {
int exp;
if (radix < 4)
{
exp = 1;
}
else if (radix < 8)
{
exp = 2;
}
else if (radix < 16)
{
exp = 3;
}
else if (radix < 32)
{
exp = 4;
}
else
{
exp ... | 5 |
public int compareMove(Move otherMove) {
if(this.equals(otherMove)) {
return 0;
} else {
switch (this) {
case ROCK:
return (otherMove == SCISSORS ? 1 : -1);
case PAPER:
return (otherMove == ROCK ? 1 : -1);
case SCISSORS:
return (otherMove... | 7 |
public static int[] fillRandomInt(int length, int min, int max, int count) {
int[] array = new int[length];
for (int i = 0; i < array.length; i++) {
array[i] = (int) random(min, max, count);
}
return array;
} | 1 |
public boolean editEvidence(Evidence e) {
Element evidenceE;
Evidence evidence;
boolean flag = false;
for (Iterator i = root.elementIterator("evidence"); i.hasNext();) {
evidenceE = (Element)i.next();
if (evidenceE.element("id").getText().equals(e.getId())) {
evidenceE.element("title").setText(e.getTi... | 3 |
public static void main(String[] args){
while(!Plateau.boucleJeu){ // Tant que le jeu n'est pas fini
Mot m=new Mot();
Fenetre f=new Fenetre();
Chrono c=f.getChrono();
Plateau p=f.getPlateau();
int essais=0;
m.init(f);
while(!Plateau.boucleMots){ // Tant que le mot n'est pas trouve
int iCh... | 6 |
private boolean add(ADD request){
if(request.username.matches("^.*[^a-zA-Z0-9 ].*$"))
return false;
byte[] salt = new byte[AuthServer.saltLength];
new SecureRandom().nextBytes(salt);
String query_create = "INSERT INTO User values('" + request.username + "','" + request.name +
"', 0x" + Misc.getHexBytes(H... | 8 |
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
String userName = txtFieldUserName.getText();
char[] pw = txtFieldPassword.getPassword();
String password = new String(pw);
String errorMessage = "";
if(userName... | 8 |
@Override
public Point getDirection() {
return direction;
} | 0 |
private void removeHelper(RedBlackNode<T> toRemove) {
if (toRemove.isLeaf()) {
if (toRemove.getColor() == Color.RED) { //removing a red leaf is never a problem
delete(toRemove);
} else { //it is a black leaf
if (toRemove == root) { //there is only one node... | 7 |
public void createGoodsMenu(final GoodsLabel goodsLabel) {
final Goods goods = goodsLabel.getGoods();
final InGameController inGameController = freeColClient.getInGameController();
ImageLibrary imageLibrary = parentPanel.getLibrary();
this.setLabel("Cargo");
JMenuItem name = new ... | 7 |
public ArrayList<Entity> getSolidProps(Entity entity) {
if(noChildren()) {
ArrayList<Entity> tempProps = new ArrayList<Entity>();
for(int x = 0; x<props.size(); x++) {
if(props.get(x).isSolid()) {
tempProps.add(props.get(x));
}
}
return tempProps;
//return props;
} else {
ArrayList<En... | 5 |
public static <E extends Enum<?>> E caseInsensitiveValueOf(E[] enumValues, String constant) {
for (E candidate : enumValues) {
if(candidate.toString().equalsIgnoreCase(constant)) {
return candidate;
}
}
throw new IllegalArgumentException(
String.format("consta... | 3 |
public static Rule_LF parse(ParserContext context)
{
context.push("LF");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>();
int s1 = c... | 7 |
@Override
public void mouseReleased(MouseEvent mouse) {
Tool tool = controls.getTool();
if (selectedMessage != null) {
selectedMessage.selected = 0;
selectedMessage = null;
noClick = true;
}
if (tool.compatible(ToolType.create) && tool.compatible(T... | 4 |
private boolean checkIfTargetNearby() {
try {
if (getRatSurrounding().get(Direction.NORTH).isTarget()) {
dir = Direction.NORTH;
goForward();
return true;
} else if (getRatSurrounding().get(Direction.EAST).isTarget()) {
dir = Direction.EAST;
goForward();
return true;
} else if (getRatS... | 5 |
private void reply_if_isACK(Packet packet)
{
TransportLayer tl = packet.getTransport();
if (tl instanceof TCP)
{
TCP transport = (TCP) tl;
if (transport.isACK())
{
Packet ack_packet = new Packet("TCP");
ack_packet.setIP_source(this.computer_ip);
ack_packet.setIP_destination(packet.getIP... | 4 |
public GUICanvas() {
super();
addMouseListener(this);
} | 0 |
private Map<String, String> loadChecksums(File file, int algorithm) {
Map<String, String> checksums = new HashMap<String,String>();
if ( file.exists() ) {
try {
FileInputStream fis = new FileInputStream(file.getAbsolutePath());
// Get the object of DataInp... | 9 |
private void advance() {
next = null;
if(rs!=null) {
try {
int n = colNames.length;
final Map<String,Object> mp = new LinkedHashMap<String,Object>();
for(int i=0;i<n;++i) {
Object field = null;
try {
field = colInfos[i].extracter.getField(rs,i);
} catch (Exception ex) {... | 8 |
static final void method1919(int i, float f, byte[] is, float f_0_,
int i_1_, float f_2_, Class186 class186,
float f_3_, int i_4_, byte i_5_, int i_6_,
float f_7_, int i_8_) {
try {
int i_9_ = 0;
if (i_5_ < 11)
method1919(97, -1.4756906F, null, 0.7518226F, 93, -0.33127537F,
null, -0.66... | 5 |
public void close() {
socket.close();
} | 0 |
public static boolean esCorrecta(int d, int m, int a){
int diasDelMes[]={31,29,31,30,31,30,31,31,30,31,30,31};
if(a<=0) {
return false;
}
if(d<=0 || d>31) {
return false;
}
if(m<=0 || m>12) {
return false;
}
if(... | 9 |
public void copyToPencilMode () {
int i = 0, j = 0;
for (i = 0; i < 16; i++){
for (j = 0; j < 16; j++) {
if ((pencilEntries[i][j].isEditable()) && (pencilEntries[i][j].getText().equals(""))) {
pencilEntries[i][j].setText(entries[i][j].getText());
}
}
}
} | 4 |
public boolean onCommand(CommandSender sender, Command cmd, String CommandLabel, String[] args){
final ChatColor yellow = ChatColor.YELLOW;
final ChatColor red = ChatColor.RED;
final ArrayList<Player> cFire = CrazyFeet.CrazyFire;
if(args.length < 1) {
if(sender instanceof Player) {
Player player = ... | 9 |
public boolean Login(String email, String password, String loginUrl) {
try {
print("User : " + email + " log-in to the system..");
driver.get(loginUrl);
waitTillElementLoad(By.id("email"));
driver.findElement(By.id("email")).clear();
driver.findElement... | 2 |
@Override
public HashMap<String, Float> getDocWeightsForDoc(long idDoc) {
try {
HashMap<String, Integer> doc = index.getTfsForDoc(idDoc);
int total = 0;
for (int v : doc.values()) {
total += v;
}
HashMap<String, Float> weights = new... | 8 |
@Override
public void undo() {
this.to.removePiece(this.piece);
this.from.addPiece(this.piece);
this.to.addPiece(this.capturedPiece);
this.piece.decreaseMoveCount();
} | 0 |
public static String toString(Map<String, List<Boolean>> _truth_table) {
if (_truth_table == null)
return "";
else {
StringBuilder res = new StringBuilder();
List<String> col_head = new ArrayList<>(_truth_table.keySet());
if (col_head.size() == 0)
return "";
Collections.sort(col_head);
... | 7 |
public void removeApplicant(Applicant selectedApplicant) {
em.remove(em.contains(selectedApplicant) ? selectedApplicant : em.merge(selectedApplicant));
} | 1 |
public int count(String[] field,int dist){
this.field = field;
this.dist = dist;
if (field == null || field.length == 0||dist<0) return 0;
height = field.length;
width = field[0].length();
for (int[] row:grid){
Arrays.fill(row,0);
}
int count ... | 9 |
private void addWwwRootDir(File wwwroot) {
rootDirs.add(wwwroot);
} | 0 |
public void doStringBuffer() {
final int repeat = ConsoleMenu.getInt("How many times?", 100000);
final int characters = ConsoleMenu.getInt("How many char?", 20);
long start = System.currentTimeMillis();
for (int i = 0; i < repeat; i++) {
final StringBuffer sb = new StringBuf... | 4 |
@Override
protected void runInternal() throws IOException {
//Get inputStream from context
BitInputStream inputStream = _context.getInputBitStream();
//Init params
int[] chunk = _context.getChunkArray();
int wordSize = _context.getWordSize();
int subChunkCounter = 1;... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PeerInfo other = (PeerInfo) obj;
if (ip == null) {
if (other.ip != null)
return false;
} else if (!ip.equals(other.ip))
return false;... | 7 |
public int multiplication() {
if (stack.stackLength() > 1) {
int firstNum = stack.top();
stack.pop();
int secondNum = stack.top();
stack.pop();
return firstNum * secondNum;
} else {
return error;
}
} | 1 |
private Expression plus( List<Expression> args, String caller ) {
boolean ints = true;
boolean intsOrDecimals = true;
for ( int i = 0; i < args.size(); ++i ) {
// if it's not an int
if ( ! args.get(i).show(defSubst, caller).matches("\\d+") ) {
ints... | 8 |
public static JSONObject getJSONObject(SampleEvent evt) {
SampleResult res = evt.getResult();
long t = res.getTime();
long lt = res.getLatency();
long ts = res.getTimeStamp();
boolean s = res.isSuccessful();
String lb = escape(res.getSampleLabel());
String rc = es... | 2 |
public boolean banUser(String name){ //ban a user by name
if (name.equalsIgnoreCase("admin")) return false; //can't ban the admin
UserAccount user = users.get(name.toLowerCase()); if (user==null) return false;
user.setIsBanned(true);
disconnectUser(user);
return true;
} | 2 |
public Contact(byte[] record) {
name = name.concat(Converter.getNameFromADNEntry(record));
int telefoneLength = record[14];
if (record[15] == (byte) 0x91) {
phoneNumber = phoneNumber.concat("00");
}
for (int j = 16; j < (15 + telefoneLength); j++) {
Str... | 5 |
public int getActionIndex( String action ){
if( action.equals(NOP) ){
return (getActionsNumber() - 1);
}else{
int[] values = new int[3];
int k = 0;
try {
StreamTokenizer tokenizer = new StreamTokenizer(new
StringRead... | 5 |
private static int method515(char arg0[], int arg1) {
for (int k = arg1; k < arg0.length && k >= 0; k++) {
if (arg0[k] >= '0' && arg0[k] <= '9') {
return k;
}
}
return -1;
} | 4 |
public static boolean adjacent(char x, char y) {
initPositionSingleton();
KeyPosition pos = (KeyPosition) qwertyposSingleton.get(new Character(Character.toLowerCase(x)));
if(pos == null) {
return false;
}
int col = pos.getCol();
int row = pos.getRow();
String keyRow = QWERTY[row];
if(col == 0) {
... | 6 |
public StructuredBlock[] getSubBlocks() {
return (subBlock != null) ? new StructuredBlock[] { subBlock }
: new StructuredBlock[0];
} | 1 |
public void newPdf(List<String> fighterNames, Object fightersSorted[], int poolNumber, String filePathAndName, String tournamentName, String wightBox, String genderBox) {
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
try {
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream... | 9 |
public boolean canPlayAt(int x, int y) {
if (x >= 0 && x < boardSize && y >= 0 && y < boardSize && intersections[x][y] != UNPLAYED) {
return false;
}
Intersection koIntersection = getKoIntersection();
if (koIntersection != null && koIntersection.x == x && koIntersection.y == y) {
return false;
}
ret... | 8 |
private static BufferedReader createInputMessageReceiver(Socket clientSocket) {
BufferedReader messageReceiver = null;
try {
messageReceiver = new BufferedReader(new InputStreamReader(
clientSocket.getInputStream()));
log.info("Create BufferedReader from clientSocket");
} catch (IOException e) {
// ... | 1 |
protected static String flattenIndent(final String wikiText) {
String[] linesArr = wikiText.split("\\n");
for (int i = 0; i < linesArr.length; i++) {
if (isStringTooIndent(linesArr[i])) {
linesArr[i] = linesArr[i].replaceFirst(":{1,}", "");
}
}
ret... | 2 |
@Override
public ICacheable get(Object key) {
if (key == null) {
throw new NullPointerException("key == null");
}
ICacheable mapValue;
synchronized (this) {
mapValue = mCacheMap.get(key);
if (mapValue != null) {
mHitCount++;
return mapValue;
}
mMissCount++;
}
return null;
} | 2 |
@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 Categoria)) {
return false;
}
Categoria other = (Categoria) object;
if ((this.idCategoria == null && other.idCa... | 5 |
public boolean register(String user, String pass, String email) {
if (!plugin.getConfig().getBoolean("registration.enabled")) {
response = "register.error.disabled";
return false;
} else if (player.isRegistered()) {
response = "register.error.registered";
return false;
} else if (!isWithinAccLimit(pla... | 5 |
public String toString()
{
if (nome != null)
return nome.toString();
return id + "";
} | 1 |
public String getInputString()
{
return myInputString;
} | 0 |
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
if(cmd.getName().equalsIgnoreCase("Nostalgia")) {
if(sender instanceof Player) {
Player p = (Player) sender;
PlayerUtil pu = new PlayerUtil(p);
if(pu.hasPermission("Nostalgia.Command.nostalgia", PermissionType... | 6 |
@Override
protected void onPostExecute(Boolean result) {
if (super.getSignatureListener() == null) {
return;
}
if (result != null) {
file.setTestResult(result);
file.setLastCheckedDate(new Date());
StringBuilder str = new StringBuilder();
... | 2 |
public void run() {
while (running) {
show();
}
} | 1 |
@Override
public CommandResponse executeCommand(RequestType requestType, List<Pair<String,String>> headers, String commandName, Object commandParameters, Class<?> responseCastClass){
System.out.println();
System.out.println(commandName);
CommandResponse serverResponse = null;
String translatedJson = jsonTra... | 4 |
public int index(XMLNodeWrapper child)
{
int count = childCount();
for (int i = 0; i < count; i++)
{
if (child.getE() == this.child(i).getE())
{
return i;
}
}
return -1; // Should never get here.
} | 2 |
public void refreshProfilesList() {
Logger.getLogger(MainInterface.class.getName()).entering(MainInterface.class.getName(), "refreshProfilesList");
Logger.getLogger(MainInterface.class.getName()).log(Level.INFO, "Refresh the profiles list items and combo box");
try {
refreshProfileCo... | 4 |
public void writeControl (byte type, byte request,
short value, short index, byte buf [])
throws IOException
{
if (fd < 0) {
throw new USBException("Dev.writeControl aborted",-USBException.IO_NotOpen);
}
if (buf == null) {
//assume we... | 6 |
public static int chebyshevDist(int color1, int color2)
{
int rd = Math.abs( ((color1 & RED_MASK) >> 16) - ((color2 & RED_MASK) >> 16) );
int gd = Math.abs( ((color1 & GREEN_MASK) >> 8) - ((color2 & GREEN_MASK) >> 8) );
int bd = Math.abs( (color1 & BLUE_MASK) - (color2 & BLUE_MASK) );
... | 2 |
private void writeListTagPayload(ListTag tag) throws IOException {
Class<? extends Tag> clazz = tag.getType();
List<Tag> tags = tag.getValue();
int size = tags.size();
os.writeByte(NBTUtils.getTypeCode(clazz));
os.writeInt(size);
for(int i = 0; i < size; i++) {
writeTagPayload(tags.get(i));
}
} | 2 |
public void keyReleased(KeyEvent e)
{
System.out.println("Key event initialized");
int key = e.getKeyCode();
//moveDirection = 0;
if (key == KeyEvent.VK_LEFT)
{
Magnus.dx = 0;
}
if (key == KeyEvent.VK_RIGHT)
{
Magnu... | 4 |
private void readDataFileHeader(MappedByteBuffer buffer) {
int magic = buffer.getInt();
if (magic != TRACE_MAGIC) {
System.err.printf(
"Error: magic number mismatch; got 0x%x, expected 0x%x\n",
magic, TRACE_MAGIC);
throw new RuntimeExceptio... | 7 |
public void shiftPressed() {
HUD hud = null;
for (int i = (huds.size() - 1); i >= 0; i--) {
hud = huds.get(i);
hud.shiftPressed();
}
} | 1 |
private boolean sendMessage(String message) {
String currMessageMD5;
boolean isStatus=false;
try
{
//check if output got shutdown, this probably will never evaluate but worth a shot
if (siriSocket.isOutputShutdown())
{
throw new Exception("Output Shutdown");
}
if (!siriSocket.isConnected())
... | 8 |
public void updatePosition(Mower mower, Lawn lawn) {
final Direction direction = mower.getCurrentPosition().getDirection();
//mower changing direction
if (direction == Direction.NORTH) {
mower.getCurrentPosition().setDirection(Direction.EAST);
} else if (direction == Direction.EAST) {
mower.getCurrentP... | 4 |
static public void run(String name) {
if (states.containsKey(name)) {
states.get(name).action();
}
} | 1 |
static int letterDistance(char c1, char c2){
int x1;
int x2;
int y1;
int y2;
if (KEYBOARD_MATRIX.get(0).contains(c1))
x1=0;
else if (KEYBOARD_MATRIX.get(1).contains(c1))
x1=1;
else if (KEYBOARD_MATRIX.get(2).contains(c1))
x1=2;
else
x1=3;
if (KEYBOARD_MATRIX.get(0).contains(c2))
x2... | 8 |
public void visit_f2i(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} | 1 |
SelectorNode selector() {
IdentNode subject = constIdent();
SelectorNode node = null;
if (test(DOT)) {
read(DOT, ".");
node = new RecordSelectorNode(subject, constIdent());
} else if (test(LBRAC)) {
read(LBRAC, "[");
node = new ArraySelectorNode(subject, expr());
read(RBRA... | 5 |
public void log(String line) {
if (_verbose) {
System.out.println(System.currentTimeMillis() + " " + line);
}
} | 1 |
private static int getSubTypes(int types) {
int result = 0;
for (int i = 0; i < NUM_TYPES; i++) {
if (((1 << i) & types) != 0)
result |= subTypes[i];
}
return result;
} | 2 |
public synchronized void mouseMoved(MouseEvent me) {
if(isRelative) {
Point p = me.getPoint();
dx += p.x - center.x;
dy += p.y - center.y;
if(!((dx == 0) && (dy == 0))) {
centerMouse();
}
}
} | 3 |
public void setHeight(int height) {
this.height = height;
} | 0 |
public static int getEnvironmentalPressureUnit() throws ClassNotFoundException {
int weightUnit = 0;
try{
//Class derbyClass = RMIClassLoader.loadClass("lib/", "derby.jar");
Class.forName(driverName);
Class.forName(clientDriverName);
}catch(java.lang.ClassNotF... | 4 |
public static void main(String[] args) throws Exception{
txtPath = args[0];
label = args[1];
ArrayList<File> files = FileFinder.GetAllFiles(txtPath, ".txt", true);
int count = 0;
for(File f : files){
@SuppressWarnings("resource")
BufferedReader br = new BufferedReader(new FileReader(f));
String li... | 5 |
public void visitEnd() {
if (!subroutineHeads.isEmpty()) {
markSubroutines();
if (LOGGING) {
log(mainSubroutine.toString());
Iterator it = subroutineHeads.values().iterator();
while (it.hasNext()) {
Subroutine sub = (Sub... | 4 |
public void migrateAgentToGroup(Agent a, Group toGroup) {
//int numExternal = a.getNumExternalNeighbors();
numMigrations++;
if(a.getNumExternalNeighbors() > 20) System.out.println("whaaaa");
//long[] profile = new long[10];
Group fromGroup = a.getGroup();
//remove neighbors from a's original set of ag... | 8 |
@Override
public void run() {
InetAddress serverAddr= null;
try {
serverAddr= InetAddress.getByName(GlobalV.serverIP);
} catch (UnknownHostException e1) {
e1.printStackTrace();
}
Socket socket = null;
try {
System.out.println("send Alert to server");
socket = new Socket(serverAddr,8... | 4 |
public List<String> readHTMLWithOutWriteToFile(URL url, String site){
String str = "";
String tmp;
try {
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
while((tmp = in.readLine()) != null){
str = str + tmp;
}
str = str.replace("\t", "");
str = str.replace("> <"... | 4 |
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.