text stringlengths 14 410k | label int32 0 9 |
|---|---|
public MainSimplePanel(String fileName) throws IOException {
ToolTipManager.sharedInstance().setInitialDelay(5);
backgroundImage = ImageIO.read(new File(fileName));
this.setLayout(null);
// Creat Icons & Hints
icons = new String[3 * nbrButton];
for (i = 0; i < 3 * nbrBu... | 9 |
@Test
public void tasoKuuluukoPiste() {
t.lisaaEste(e);
assertTrue("onkoPisteessaEste() antoi väärän arvon olisi pitänyt olla true",
t.onkoPisteessaEste(p) != null);
p.siirra(20, 0);
assertTrue("onkoPisteessaEste() antoi väärän arvon",
t.onkoPisteess... | 0 |
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 static Rule_interfaceMode parse(ParserContext context)
{
context.push("interfaceMode");
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>... | 7 |
public void draw(Graphics g, int x, int y, int width, int height){
if(img == null)
return;
at = new AffineTransform();
at.translate(x, y);
if (img.getWidth() != width) {
at.scale((double)width/(double)img.getWidth(), 1);
}
if (img.getHeight() != height) {
at.scale(1, height/(double)img.getHeight())... | 3 |
public K getMin(){
K minKey = null;
Integer minValue = Integer.MAX_VALUE;
for (Map.Entry<K, Integer> entry : map.entrySet()){
if (entry.getValue() < minValue){
minKey = entry.getKey();
minValue = entry.getValue();
}
}
return... | 2 |
private String[] createFileString(String listData, String[] rfmFileFields) {
//Crea el arreglo con los datos que se escribiran en el archivo .frm
String[] data = new String[rfmFileFields.length + 2];
int index = 0;
for (String string : rfmFileFields) {
if (index == 1... | 6 |
public static void tick(){
while(Keyboard.next()){
if(Keyboard.getEventKeyState()){
if(Keyboard.getEventKey() == Keyboard.KEY_U){
if(Rainbow == false){
Rainbow = true;
}else{
Rainbow = false;
}
//System.out.println(Rainbow);
}
}
}
} | 4 |
@Override
public void addMeetingNotes(int id, String text) {
Calendar now = Calendar.getInstance();
Meeting convertedToPastMeeting = null;
Meeting updatedPastMeeting = null;
if (text == null) {
throw new NullPointerException("Please specify notes for the meeting");
... | 7 |
public void startServer() {
GameSession gameSession = null;
try {
this.remotePlayer = new ServerPlayer();
localPlayer = new Player("X", this.nextMove);
ServerPlayer _remotePlayer = (ServerPlayer) this.remotePlayer;
// TODO Ask the user for the dimensions... | 2 |
private boolean isPair()
{
return compareCardFigures(0, 1) || compareCardFigures(1, 2) || compareCardFigures(2, 3);
} | 2 |
public static byte[] getBytesFromFile(String filename) throws IOException
{
File file = new File( filename );
InputStream is = new FileInputStream(file);
// Get the size of the file
long length = file.length();
// You cannot create an array using a long type.
... | 4 |
public static void main(String args[])
{
_view=new View();
a=new ActionDispatch(_view);
c=new Controller(_view,a);
_view.show();
} | 0 |
public String getAnswer() throws Exception {
long prime = getNextPrime(56003);
while (prime < 200000) {
String primeStr = Long.toString(prime);
for (int i = 0;i<2;i++) {
int numPrimes = 1;
if (primeStr.contains(Integer.toString(i))) {
... | 9 |
public void testIsBefore_MD() {
MonthDay test1 = new MonthDay(6, 6);
MonthDay test1a = new MonthDay(6, 6);
assertEquals(false, test1.isBefore(test1a));
assertEquals(false, test1a.isBefore(test1));
assertEquals(false, test1.isBefore(test1));
assertEquals(false, test1a.isBe... | 1 |
private void sendAddonOutput(Addon addon, Message message) {
List<String> reaction = addon.generateReaction(message);
if ( addon.errorOccurred() ) {
displayAddonFailureIfIsSet( addon.getError() );
sendListOfNotices(message.author, reaction);
} else {
sendListO... | 1 |
@EventHandler
public void EnderDragonWither(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble("Ender... | 6 |
public synchronized void close() throws IOException {
if (socket != null) {
if (this.connected) {
this.closing = true;
// try to send outgoing data for at most 10ms
if (writeThread != null) {
try {
writeThread.join(10);
} catch (InterruptedException e) {
e.printStackTrace();
... | 5 |
private void checkScoutValidity(StrategyBoard gameBoard, PlayerColor currentTurn, PieceType movePiece,
Location moveFromLocation, Location moveToLocation) throws StrategyException
{
final int distance = moveFromLocation.distanceTo(moveToLocation);
if (gameBoard.getPieceAt(moveToLocation) != null && distance... | 9 |
public void run() {
FileRootEnumeration list = (FileRootEnumeration)FileSystemRegistry.listRoots();
while(list.hasMoreElements()){
String element = (String)list.nextElement();
roots.put(element, element);
}
while (FileSystemRegistry.fslistener != null) {
list = (FileRootEnumeration)FileSys... | 9 |
public void setHmac(Key key){
Mac hmac = null;
try {
hmac = Mac.getInstance("HmacSHA256");
} catch (NoSuchAlgorithmException e) {
System.err.println("NoSuchAlgorithmException (HmacSHA256 not valid): " + e.getMessage());
}
try {
hmac.init(key);
} catch (InvalidKeyException e) {
System.err.println... | 3 |
public void realAllSensorEx(){
String output = null;
try {
URL url = new URL("http://localhost:8080/WeatherBase/rest/sensor/sensors");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getR... | 3 |
public static void main(String[] args) throws IOException, ParseException {
Options opt = new Options();
opt.addOption("", "db", true, "The File used for Training");
opt.addOption("", "method", true, "The method used for Training");
opt.addOption("", "probabilities", false, "Print Probabilities?");
opt.addOpt... | 9 |
public static Vector findPackages() {
Vector result;
StringTokenizer tok;
String part;
File file;
JarFile jar;
JarEntry entry;
Enumeration enm;
HashSet set;
result = new Vector();
set = new HashSet();
// check all parts of the classpath, to include additional ... | 7 |
public void set_cdx_order( String tag )
{
if(Cdx!=null)
{
Cdx.setOrdByTag(tag);
if(Cdx.I>=0) order = Cdx.TagNames[Cdx.I];
Cdx.recno = recno;
updateseek();
}
} | 2 |
public void addValue(Variable x, Integer y) {
valueMap.put(x, y);
} | 0 |
public void fillDeclarables(Collection used) {
for (int j = 0; j < methods.length; j++)
methods[j].fillDeclarables(used);
} | 1 |
public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for (StringTokenizer st;(st=new StringTokenizer(in.readLine()))!=null;) {
int D=parseInt(st.nextToken()),A=parseInt(st.nextToken()),B=parseInt(st.nextToken()),C=parseInt(st.nextToke... | 8 |
private void fillBuffer() throws IOException{
buffer = buffer.substring(offset);
offset = 0;
while(buffer.length() < bufferSize){
String nextLine = input.readLine();
if(nextLine != null){
buffer = buffer.concat(nextLine).concat(String.format("%n"));
}
else{
break;
}
}
} | 2 |
@Override
public int onReadFile(String fileName, ByteBuffer buffer, long offset, DokanFileInfo arg3) throws DokanOperationException {
FileHandle handle;
synchronized (handles)
{
handle = handles.get(arg3.handle);
}
if (handle == null)
{
if (DEBUG)
System.out.println("Invalid handle");
thro... | 6 |
public ResGridlet get(int gridletId, int userId) {
ResGridlet gl = null;
Iterator<ResGridlet> iter = super.iterator();
while (iter.hasNext()){
gl = iter.next();
if (gl.getGridletID()==gridletId && gl.getUserID()==userId) {
return gl;
}
}
... | 3 |
public boolean mouseup(Coord c, int button) {
if (dm) {
ui.grabmouse(null);
dm = false;
return true;
} else {
return super.mouseup(c, button);
}
} | 1 |
public void cargarEmpleadoEnLista(Empleado empleado)
{
DefaultTableModel dtm = new DefaultTableModel(0, 0){
@Override
public boolean isCellEditable(int row, int column) {
if(column==8 || column==0 || column==9){
return false;
}
... | 5 |
public List<String> allFriends(String username) {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
int user_id = 0;
List<String> friends = new ArrayList<String>();
try {
conn = DbConnection.getConnection();
stmt = conn.prepareStatement(GET_USERID_STMT);
stmt.setStr... | 9 |
private void doUpdateUser(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String userId = StringUtil.toString(request.getParameter("userId"));
if(!StringUtil.isEmpty(userId)) {
ObjectMapper mapper = new ObjectMapper();
Map result ... | 3 |
public int getShortestDistance(String word1, String word2, String text)
{
// initialized at the length of the full text, every distance found will be less
int minDinstance = text.length();
if(minDinstance == 0){
// text is empty
return -1;
}
String tempWord = "";
String lastFoundWord = "";
int count... | 8 |
public void handle() {
Player player = World.getPlayer(username);
if (player == null)
return;
player.setClientAddress(address);
player.setClientPort(port);
if (location != null)
player.setLocation(location);
if (health > -1)
player.setHealth(health);
if (toggleAdmin)
player.setAdmin(!player.is... | 7 |
private boolean inBounds(Position d){
switch(state){
case INVENTORY:
return(d.x >= 0 && d.x < WIDTH && d.y>=0 && d.y< HEIGHT);
case MAIN_MENU:
return (d.y >= 0 && d.y <1 && d.x == 0);
case PICKUP_MENU:
return(d.y>=0 && d.y<entityManager.getMap().get(mov.getPos()).getItems()... | 9 |
public void test_convertText() {
OffsetDateTimeField field = new MockOffsetDateTimeField();
assertEquals(0, field.convertText("0", null));
assertEquals(29, field.convertText("29", null));
try {
field.convertText("2A", null);
fail();
} catch (IllegalArgumen... | 2 |
@Override
protected void parse() {
boolean parseOptions = true;
parsed = new LinkedList<String>(tokens);
String token;
while (!parsed.isEmpty()) {
token = parsed.remove(0);
if (parseOptions && EMPTY.equals(token)) {
parseArgument(token);
... | 9 |
protected int updateCreeperColorMultiplier(EntityCreeper var1, float var2, float var3) {
float var5 = var1.setCreeperFlashTime(var3);
if((int)(var5 * 10.0F) % 2 == 0) {
return 0;
} else {
int var6 = (int)(var5 * 0.2F * 255.0F);
if(var6 < 0) {
var6 = 0;
}... | 3 |
public boolean equals(Object o) {
if (o instanceof Map.Entry) {
Map.Entry e = (Map.Entry) o;
return key.equals(e.getKey()) && value.equals(e.getValue());
}
return false;
} | 2 |
public void migrated(){
this.id = ProcessManager.getInstance().generateID();
Field f[] = this.getClass().getDeclaredFields();
for (int i = 0; i < f.length; i++) {
if(f[i].getType().getSimpleName().equals("TransactionalFileInputStream"))
{
f[i].setAccessible(true);
... | 9 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
private void buildGamePlateau(String dataFilename)
{
HashMap<CouleurPropriete,Groupe> groups = new HashMap<>();
groups.put(CouleurPropriete.bleuCiel,new Groupe(CouleurPropriete.bleuCiel,50));
groups.put(CouleurPropriete.bleuFonce,new Groupe(CouleurPropriete.bleuFonce,200));
... | 9 |
public VariableStack mapStackToLocal(VariableStack stack) {
if (stack == null)
jode.GlobalOptions.err
.println("map stack to local called with null: " + this
+ " in " + this.flowBlock);
VariableStack middle = subBlocks[0].mapStackToLocal(stack);
if (middle != null)
// Otherwise the second block ... | 2 |
private void afficheChoixClassePersonnage()
{
/**
* On affiche d'abord la liste des classes de personnages
*/
//S'il y a des plugins déjà chargées, on les met dans la liste
if(modelClasse.isEmpty() && fenetre.getPluginClasse().size() != 0)
{
ArraylisteC... | 4 |
public PrimitiveOperator combineMidNRightOnLeft(PrimitiveOperator other) {
boolean[] newTruthTable = new boolean[8];
// the other gate is on the left side - on the MSB
newTruthTable[0] = truthTable[((other.truthTable[0]) ? 4 : 0) | 0]; //000
newTruthTable[1] = truthTable[((other.truthTable[0]) ? 4 : 0)... | 8 |
public int transform(CtClass clazz, int pos, CodeIterator iterator,
ConstPool cp) throws CannotCompileException
{
int index;
int c = iterator.byteAt(pos);
if (c == NEW) {
index = iterator.u16bitAt(pos + 1);
if (cp.getClassInfo(index).equals(cl... | 8 |
public void king()// kings piece.kk+ is
{
k = true;
if (piece == '@')
{
mid = String.format("%1s %1c %1s", "|", '#', "|");
} else if (piece == '$')
{
mid = String.format("%1s %1c %1s", "|", '&', "|");
}
} | 2 |
public static void testBarrier() throws QueueClosedException {
RemoveOneItem[] removers=new RemoveOneItem[10];
final Queue queue=new Queue();
int num_dead=0;
for(int i=0; i < removers.length; i++) {
removers[i]=new RemoveOneItem(i, queue);
removers[i].start();
... | 8 |
public ArrayList<Cliente> Consultar(String id){
//("") - Pesquisa sem precisar de id.
ArrayList<Cliente> clientes = new ArrayList();
try {
if(id.equals("")){
String sql = "SELECT id,nome,email,telefone,cod FROM tb_cliente";
ConsultarSQL(sq... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AssignmentNode other = (AssignmentNode) obj;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.... | 9 |
private void checkEmpty() {
if (isEmpty()) {
throw new NoSuchElementException("Priority queue empty");
}
} | 1 |
public EnumMap<RatChromosomes, ArrayList<Deletion>> readBreakdancerSVCalls() throws IOException {
// Map<String, ArrayList<Deletion>> chromPiclSVCallsMap = new HashMap<String, ArrayList<Deletion>>();
//initialize map to store list of deletions per ratchromosome
EnumMap<RatChromo... | 7 |
public StageFlipper init(StageFlipper nothing) {
String firstcall;
LobbyServerMessage LM = null;
try {
firstcall = network.receiveMessage();
LM = enc.lobbyServerMessageDecode(firstcall);
} catch (IOException | JSONException e) {
e.printStackTrace();
}
if (LM != null) {
lg = new LobbyGUI... | 2 |
public void showUnit(String[] parts){
int current = 1;
//go through the parts accordingly, starting with parts[1] which is unitType
int type = Integer.parseInt(parts[current]);
current++;
//if the unitType hasnt been initialized yet, initialize it, otherwise just create a new unit w... | 8 |
@Override
public void run() {
try {
if (this.ss != null) {
this.socket = this.ss.accept();
this.gm.startTimer();
this.update(gm, null);
}
while (this.active) {
try {
InputStream is = socket.getInputStream();
if (is.available() > 0) {
DataInputStream dis = new DataInputStream(... | 6 |
@Override
public void fire() {
if(receiver != null){
//NAO IMPLEMENTADO
return;
}else if(process){
((RoutingNode) this.node).processBroadcastMsg(m);
}else{
((RoutingNode) this.node).forwardMsg(m);
}
} | 2 |
public void run()
{
while(true)
{
runEnemy();
updateGame();
try{Thread.sleep(1);}catch(Exception ignored){}
repaint();
}
} | 2 |
public JSONObject increment(String key) throws JSONException {
Object value = this.opt(key);
if (value == null) {
this.put(key, 1);
} else if (value instanceof Integer) {
this.put(key, ((Integer)value).intValue() + 1);
} else if (value instanceof Long) {
... | 5 |
private static Method getMethod(Class<?> clazz, String name) {
name = name.substring(0, 1).toUpperCase() + name.substring(1);
Method method = null;
try {
method = clazz.getMethod("get" + name);
} catch (NoSuchMethodException e) {
// skip
} catch (Exception... | 6 |
public List<Integer> allAlbums(String username) {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
List<Integer> albumIds = new ArrayList<Integer>();
try {
conn = DbConnection.getConnection();
stmt = conn.prepareStatement(GET_USERID_STMT);
stmt.setString(1, usernam... | 9 |
public int code(byte[] buf, int off, int len) {
int end = off + len - 4;
int i;
for (i = off; i <= end; i += 4) {
if ((buf[i] == 0x40 && (buf[i + 1] & 0xC0) == 0x00)
|| (buf[i] == 0x7F && (buf[i + 1] & 0xC0) == 0xC0)) {
int src = ((buf[i] & 0xFF) ... | 6 |
public void doSomething() {
state.greeting(this);
} | 0 |
@Override
public List<ItemSet<V>> aprioriGen( List<ItemSet<V>> frequentCandidatesKMinus1) {
Collections.sort(frequentCandidatesKMinus1);
int allGeneratedCandidatesCounter = 0;
Set<ItemSet<V>> frequentCandidateSet = new HashSet<ItemSet<V>>();
// we iterate both itemsets and generate new candidates base on th... | 4 |
JComponent getHouseTab() {
JPanel inner = new JPanel(new GridBagLayout());
GridBagConstraints innerConstraints = new GridBagConstraints();
innerConstraints.fill = GridBagConstraints.BOTH;
innerConstraints.gridx = 0;
innerConstraints.gridy = 0;
innerConstraints.weightx = 1;
innerConstraints.weighty = 1;
... | 5 |
public int getRumblerCount() {
return rumblers.length;
} | 0 |
protected void doPadding(byte[] output, int outputOffset)
{
int ptr = flush();
int bitLen = ptr << 3;
int th = t1;
int tl = t0 + bitLen;
tmpBuf[ptr] = (byte)0x80;
if (ptr == 0) {
t0 = (int)0xFFFFFE00;
t1 = (int)0xFFFFFFFF;
} else if (t0 == 0) {
t0 = (int)0xFFFFFE00 + bitLen;
t1 --;
} else {... | 9 |
public String search(String name, String criteria)
{
String result = "";
//loop over entire table from start
for(int i = 0 ; i < hashTableSize -1 ; i ++)
{
//if current data is not null, and equals to search add to result and break out of loop
if(hashtable[i]!= null)
{
if(criteria.equals("First Na... | 8 |
private final void method1989(Node class348, boolean bool,
Deque class262_1_) {
do {
try {
anInt3325++;
Node class348_2_
= (((Node) ((Deque) this).parent)
.nodeChild);
((Node) ((Deque) this).parent).nodeChild
= ((Node) class348).nodeChild;
((Node) ((Node) class348).nodeChild)
... | 6 |
public static int FindPosition (String word) throws FileAlreadyExistsException, IOException{
BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream("input.txt")));
boolean b = false;
int[] mas = new int [10];
int c;
c = reader.read();
int i... | 7 |
public void nextTaken() throws ParseException {
while (isBlank()) {
nextChar();
}
if (isOperand()) {
operand = 0;
while (isOperand()) {
if (operand > Integer.MAX_VALUE / 10) {
throw new ParseException("Too mach value of ope... | 8 |
public static void main(String[] args)
{
int index;
String handle, host;
InetAddress address = null;
WhoisClient whois;
if (args.length != 1)
{
System.err.println("usage: fwhois handle[@<server>]");
System.exit(1);
}
index = a... | 4 |
public void generate(PropertiesConverter parser, String sourcePath, String targetPath) {
File dir = new File(sourcePath);
File[] files = dir.listFiles();
if (files != null) {
for (File file : files) {
Matcher matcher = propertiesFilesMatcher.getMatcher(file.getName());
while (matcher.find()) {
... | 4 |
private ArrayList<String> compileDeclaration(String type, String varname) throws MCCDeclareException {
if (vars.containsKey(varname)) throw new MCCDeclareException();
String varnameL = varname.toLowerCase();
if (varnameL.equals("true") || varnameL.equals("false") || varnameL.equals("if") || varnameL.equals("for")... | 6 |
public static void main(String[] args) {
int portNum;
if (args.length < 1) {
System.out.println("Using default port:9371");
portNum = 9371;
}
else {
System.out.println("Configuring to use port: " + args[0]);
portNum = Integer.parseInt(args[0]);
}
if (args.length < 2) {
System.out.printl... | 7 |
private void loadPlattformar() {
DefaultListModel<Plattform> dlm = (DefaultListModel<Plattform>) listPlattformar.getModel();
ArrayList<String> tempal = new ArrayList<>();
ArrayList<Plattform> al = new ArrayList<>();
try {
String query = "select pid from innefattar where sid... | 4 |
@Test
public void getScoreTest(){
assertEquals(city_graph.getScore(Owner.Rom), 6);
} | 0 |
public String validaFormulario() {
String strMsg = "";
if (jrbDocAnalise.isSelected() == false && jrbDocProjeto.isSelected() == false && jrbTestes.isSelected() == false && jrbCodigo.isSelected() == false) {
jrbDocAnalise.setForeground(Color.red);
jrbDocProjeto.setForeground(Color... | 4 |
public static void main(String[] args) {
port = 8080;
try {
server = new ServerSocket(port);
System.out.println(server.getLocalPort());
while (true) {
//Jede Verbindung wird angenommen und der String an den GameHandler weitergegeben
connection = server.accept();
System.out.println("N... | 4 |
public boolean matchesTypeAndContent(final MarkupTraceEvent event) {
if (this == event) {
return true;
}
if (event == null) {
return false;
}
if (this.eventType == null) {
if (event.eventType != null) {
return false;
... | 8 |
public static boolean isValidName(String name) {
if(name == null)
return false;
if(name.length() < 2)
return false;
if(!Character.isUpperCase(name.charAt(0)))
return false;
for(Character ch : name.toCharArray()) {
if(!(Character.isLetter(ch)))
return false;
}
return true;
} | 5 |
public void priseTerritoire() {
if (this.occupant != null) {
occupant.perteTerritoire(this);
occupant = null;
}
nbUnite = 0;
} | 1 |
private void GenerateEnemies(){
int ns = RandomEngine.randInt(2,width*height/4);
Enemies = new ArrayList();
int t;
int rand;
Enemy e;
float x,y;
float unitScale = constant.getFloatConstant("unitScale");
for(int i=0;i<ns;++i){
rand = RandomEngin... | 6 |
public void render(GOut g, Coord c, Coord ul, Coord br, Coord sz) {
GL gl = g.gl;
synchronized (idmon) {
if ((id != -1) && (mygl != gl)) {
dispose(mygl, id);
id = -1;
}
if (id < 0)
create(g);
g.texsel(id);
}
Color amb = blend(g, setenv(gl));
if (!disableall) {
gl.glBegin(GL.GL_QUADS... | 4 |
protected BigInteger coerceToBigInteger(Object value) {
if (value == null || "".equals(value)) {
return BigInteger.valueOf(0l);
}
if (value instanceof BigInteger) {
return (BigInteger)value;
}
if (value instanceof BigDecimal) {
return ((BigDecimal)value).toBigInteger();
}
if (value instanceof Num... | 8 |
public synchronized List<KeyRegistrationRecord> getNearestPeers( final String inBase64Key, final int inNumber, boolean updateRefreshTime ) {
if( isRegistered(inBase64Key) == false ) {
return null;
}
if( updateRefreshTime ) {
updateRefreshTime(inBase64Key);
}
Set<KeyRegistrationRecord> out = new... | 7 |
public static <GItem> Comparable<GItem> chainedComparable(final Comparable<? super GItem> comparable1, final Comparable<? super GItem> comparable2)
throws NullPointerException {
if (comparable1 == null) throw new NullPointerException("comparable1 = null");
if (comparable2 == null) throw new NullPointerException("... | 5 |
public Bank getMainBank() {
if (!Constants.Banking) {
return null;
}
Connection conn = null;
ResultSet rs = null;
PreparedStatement ps = null;
Bank bank = null;
try
{
conn = iConomy.getiCoDatabase().getConnection();
ps = conn.prepareStatement("SELECT * FROM " + Constan... | 7 |
public IndexedModel toIndexedModel()
{
IndexedModel result = new IndexedModel();
IndexedModel normalModel = new IndexedModel();
HashMap<OBJIndex, Integer> resultIndexMap = new HashMap<OBJIndex, Integer>();
HashMap<Integer, Integer> normalIndexMap = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> i... | 8 |
final public void train(StringWrapperIterator i)
{
Set seenTokens = new HashSet();
while (i.hasNext()) {
StringWrapper s = (StringWrapper)i.next();
BagOfTokens bag = asBagOfTokens(i.nextStringWrapper());
for (Iterator j=bag.tokenIterator(); j.hasNext(); ) {
Token tokj = (Token)j.next();
totalToke... | 5 |
public int moore(int i, int j, int r ) {
int sum = 0;
int imax = this.length;
int jmax = this.width;
for (int n = 0; n <= 2*r; n++){
for (int m = 0; m <= 2*r; m++){
int ii = topo.idI(i - r + n, j - r + m, imax, jmax);
int jj = topo.idJ(i, j - r + m, imax, jmax);
if ( (!(ii < 0) && !(ii >= imax)) ... | 8 |
public boolean checkStop(MOB mob, List<String> commands)
{
if((commands!=null)
&&(commands.size()==1)
&&(commands.get(0).equalsIgnoreCase("stop")))
{
final Ability A=mob.fetchEffect(ID());
if((A!=null)&&(!A.isNowAnAutoEffect())&&(A.canBeUninvoked()))
{
if(A instanceof CommonSkill)
((CommonSki... | 7 |
public void testFormatParse_textYear_UK() {
DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder()
.appendLiteral('$')
.appendText(DateTimeFieldType.year())
.toFormatter()
.withLocale(Locale.UK).withZoneUTC();
String str = new DateTime(2... | 1 |
private boolean jj_3R_70() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_104()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3R_105()) {
jj_scanpos = xsp;
if (jj_3R_106()) return true;
}
xsp = jj_scanpos;
if (jj_3R_107()) jj_scanpos = xsp;
if (jj_scan_token(91)) return true;
xsp... | 8 |
private void jList2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList2MouseClicked
jList2 = (JList) evt.getSource();
if (evt.getClickCount() == 2) {
int index = jList2.locationToIndex(evt.getPoint());
if (index >= 0) {
String s = (String) jList2.getModel().g... | 7 |
public static void addToTeam(Teams team, Player player) {
switch (team) {
case GREEN:
greenMembers = (player);
greenFriends.add(player);
break;
case BLUE:
blueMembers = (player);
blueFriends.add(player);
break;
case RED:
redMembers = (player);
redFriends.add(player);
break;
case ORA... | 4 |
public boolean registerOriginalFile(FileAttribute fAttr, int sourceID)
{
if (fAttr == null || sourceID == -1) {
return false;
}
ArrayList list = (ArrayList) catalogueHash_.get( fAttr.getName() );
if (list != null) {
list.add( new Integer(sourceID) );
... | 3 |
public int getS1() {
return this.state1;
} | 0 |
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.