text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void testConstructor_int_int_Chronology() throws Throwable {
YearMonth test = new YearMonth(1970, 6, GREGORIAN_PARIS);
assertEquals(GREGORIAN_UTC, test.getChronology());
assertEquals(1970, test.getYear());
assertEquals(6, test.getMonthOfYear());
try {
new YearM... | 4 |
private boolean hasSameProperties(ObjectRepresentation other)
{
// different size
if (props.size() != other.props.size())
{
return false;
}
for (int x = 0; x < props.size(); x++)
{
String fromProp = props.get(x);
int toIndex = other.props.indexOf(fromProp);
if (toIndex < 0)
{
// other ob... | 5 |
public void act() {
if(!end){
if(state == -1) {
ActionFactory.wait(1000, "", true);
}
else if(state == 0) {
float res = Robot.getInstance().getSonar().getMinDist();
if(res>20 && res<80){
System.out.println("deja la");
stop();
}
else {
Robot.getInstance().getMotion().getPilo... | 7 |
public void setSubscribed(String newsgroup, boolean flag)
{
if (subs == null)
{
load();
}
if (flag && !groups.contains(newsgroup))
{
groups.add(newsgroup);
}
boolean subscribed = subs.contains(newsgroup);
if (flag && !subscribed)
{
subs.add(newsgro... | 7 |
public static String getOption()
{
String option = "gui";
try
{
BufferedReader r = new BufferedReader(new FileReader("config.txt"));
String line = r.readLine();
while (line != null)
{
if (line.startsWith("Option="))
... | 8 |
public PrimevalIsle(String name, String descr)
{
super(name, descr);
for (L2Spawn npc : SpawnTable.getInstance().getSpawnTable())
if (Util.contains(MOBIDS, npc.getNpcId()) && npc.getLastSpawn() != null && npc.getLastSpawn() instanceof L2Attackable)
((L2Attackable) npc.getLastSpawn()).seeThroughSilentMove... | 4 |
InformGraphPrimitive(int x, int y, int width, int height, int widthDest, int heightDest, String name) {
super(x, y, width, height, widthDest, heightDest, name);
if(name.contains("_"))
setTexture(name.substring(0,name.indexOf("_")) + subName);
else
setTexture(name + subNam... | 1 |
public static void main(String args[])
{
new StartScreen();
} | 0 |
public static String removeDups(String s)
{
char[] arr = s.toCharArray();
if (arr == null) return null;
if (arr.length < 2) return s;
int end = 1;
for(int i = 0; i<arr.length; i++)
{
int j = 0;
for(; j<end; j++)
{
if(arr[i] == arr[j])
{
break;
}
}
if (j==end)
{
arr... | 6 |
private static LinkedList<Video> videoListFromResultSet(ResultSet resultSet) throws SQLException {
LinkedList<Video> videos = new LinkedList<Video>();
while (resultSet.next()) {
videos.add(new Video(resultSet.getString(1), resultSet.getString(2), resultSet.getDate(3),
res... | 1 |
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
return true;
}
// Begin hitting the s... | 7 |
public static void addPublicationsIntoDatabase(List<Publication> plist) {
try {
if (conn == null || conn.isClosed()) {
init();
}
if (statement == null || statement.isClosed()) {
statement = conn.createStatement();
}
StringBuffer sb = new StringBuffer(
"INSERT INTO soc.publications VALUES")... | 6 |
public String toStringAsciiArt() {
char art[] = new char[size()];
for (int i = start, j = 0; i <= end; i++, j++) {
Utr utr = findUtr(i);
if (utr != null) art[j] = utr.isUtr5prime() ? '5' : '3';
else {
Exon exon = findExon(i);
if (exon != null) art[j] = exon.isStrandPlus() ? '>' : '<';
else art[... | 5 |
public String[] getMafiaPlayers() {
ArrayList<String> mafiaPlayer = new ArrayList<String>();
for (Player player : players) {
if (player.getRole().equals(Role.Mafia.toString()))
mafiaPlayer.add(player.getName());
}
return mafiaPlayer.toArray(new String[mafiaPla... | 2 |
public static void deleteDirectory(final File directory) throws IOException {
if (!directory.exists()) {
return;
}
if (!isSymbolicLink(directory.toPath())) {
cleanDirectory(directory);
}
if (!directory.delete()) {
final String message = "Unab... | 3 |
public static OSMHighwayType fromString(String name) {
if (name != null) {
for (OSMHighwayType h : OSMHighwayType.values()) {
if (name.equalsIgnoreCase(h.name)) {
return h;
}
}
}
return null;
//throw new IllegalArgumentException("No constant with name " + name + " f... | 3 |
public final void para() throws RecognitionException {
try {
// fontes/g/CanecaSemantico.g:852:2: ( ^( PARA_ . . . . ) )
// fontes/g/CanecaSemantico.g:852:4: ^( PARA_ . . . . )
{
match(input,PARA_,FOLLOW_PARA__in_para2333); if (state.failed) return ;
... | 9 |
public void draw(Graphics2D g) {
bg.draw(g);
tileMap.draw(g);
player.draw(g);
teleport.draw(g);
// draw ememies
for (int i = 0; i < enemys.size(); i++) {
enemys.get(i).draw(g);
}
teleport.draw(g);
// draw Explostion
for (int i = 0; i < explosions.size(); i++) {
explosions.get(i).setMapPo... | 3 |
public static void EM(Instances data, Instances originalData) throws Exception {
// Create EM Clusterer
EM em = new EM();
em.setNumClusters(3);
em.buildClusterer(data);
// evaluate the EM clusterer
ClusterEvaluation emEvaluation = new ClusterEvaluation();
emEvaluation.setClusterer(em);
emEvaluatio... | 5 |
protected void setActiveEntryPage(EntryPage page) {
// Have the currently displayed page save its changes
if (activePage != null) {
activePage.apply();
}
if (page == null) {
// No page available to display, so hide the panel container
propertiesPanelContainer.setVisible(false);
} else {
// Show t... | 8 |
private String fixText (String s, DocumentFilter.FilterBypass fb) throws BadLocationException
{
if (s == null) {
return null;
}
int currentLength = fb.getDocument().getLength();
int l = fb.getDocument().getLength();
char prevChar = (l < 1) ? ' ' : fb.getDocument... | 7 |
@Override
public float contains( int x, int y ) {
if( boundaries.contains( x, y ) ){
return 1.f;
}
else{
return 0.f;
}
} | 1 |
public void kiemTraFileChunk(String tenFile, int soLuongChunkToiDa) {
try {
socket = new DatagramSocket(Bittorrent.portlisten + port);
socket.setSoTimeout(3000);
for (int i = 0; i < Bittorrent.danhSachPeer.size(); i++) {
String duLieuGui = "... | 8 |
static final CellEditable startEditing(CellRenderer self, Event event, Widget widget, String path, Rectangle backgroundArea, Rectangle cellArea, CellRendererState flags) {
long result;
if (self == null) {
throw new IllegalArgumentException("self can't be null");
}
if (event... | 7 |
public static void main(String[] args) throws Exception {
String host="localhost";
int port=8787;
String user=null;
for(int i=0; i < args.length; i++) {
if(args[i].equals("-host") || args[i].equals("-h")) {
host=args[++i];
continue;
... | 7 |
public static void addMovie(TravelAgent agent){
System.out.print("Plese enter in movie name: ");
input.nextLine();
String name = input.nextLine();
System.out.print("Please enter in movie running time in minutes: ");
int length = input.nextInt();
// create a movie object that can be added to a flight
Movie... | 6 |
protected <T> boolean isSameSetPrivate(Set<T> obj1, Set<T> obj2) {
// make sure both sets have the same size number of elements
if (obj1.size() != obj2.size())
return false;
// return obj1.containsAll(obj2);
// the sets have the same size - pick one
for (T item1 : obj1) {
boolean match = false; // did... | 5 |
public boolean deleteTopic(int id) {
Connection connection = ConnectionManager.getConnection();
if (connection == null) {
logger.log(Level.SEVERE, "Couln't establish a connection to database");
return false;
}
MessageManager messageManager = new MessageManager();
... | 3 |
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
String data;
try {
ArrayList<FilterBean> alFilter = new ArrayList<>();
if (request.getParameter("filter") != null) {
if (request.getParameter("filterop... | 7 |
private String[] parseCoordinates(final JSONObject json) throws NameResolverException {
try {
//final JSONArray jsonArray = json.getJSONArray("data");
final JSONArray jsonArray = json.getJSONArray("features");
final JSONArray coords = jsonArray.getJSONObject(0).getJSONObject("geometry").getJSONAr... | 4 |
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
Notice N = new Notice();
if(!"".equals(TextField_Titulo.getText()) && !"".equals(TextArea_Texto.getText()) && !"".equals(TextFild_Assuntos.getText()))
{
N.... | 4 |
public boolean addVertice(Point p) {
HashSet<Point> adjacent = graph.get(p);
if(adjacent == null) {
adjacent = new HashSet<Point>();
return true;
}
return false;
} | 1 |
private boolean jj_3R_22()
{
if (jj_3R_24()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_25()) { jj_scanpos = xsp; break; }
}
return false;
} | 3 |
private static void outOfMemory() {
Vector v = new Vector();
while (true) {
v.add(new Object());
}
} | 1 |
public void rotateEditingShip()
{
Ship testShip = new Ship(editingShip);
testShip.rotate();
if(myTurnEditing)
{
if(mySea.shipInBounds(testShip))
editingShip.rotate();
}
else
{
if(theirSea.shipInBounds(testShip))
editingShip.rotate();
}
} | 3 |
public void visitDeclaration(FieldDeclaration decl)
{
// On regarde si la déclaration possède une annotation Note
Note note = decl.getAnnotation(Note.class);
// Et on l'affiche eventuellement :
if(note != null)
printMessage(decl, note);
if(decl instanceof Map<?... | 7 |
public int[][][] getMapData() {
ensureCapacity();
if (mapData != null) {
return mapData;
}
FileInputStream dataStream = null;
try {
dataStream = new FileInputStream(DATA);
mapData = new int[4][64][64];
if (regionData != null) {
... | 8 |
@Override
public int strstr( char[] pattern, char[] string ) {
if( pattern.length > string.length )
return -1;
int ret = -1;
int hashP = 0;
for( int i = 0; i < pattern.length; i++ ) {
hashP += Character.valueOf( pattern[i] ).hashCode();
}
int[] hashS = new int[ string.length - pattern.length... | 9 |
public static CommandLineArgs toCommand(String _string)
{
try {
return valueOf(_string);
}
catch (Exception ex) {
return NOVALUE;
}
} | 1 |
public void showMenu()
{
/** Prints "Battleships" in Kick-Ass ASCII Art */
System.out.println(" ____ _______ _______ _ ______ _____ _ _ _____ _____ _____ _ \r\n | _ \\ /\\|__ __|__ __| | | ____|/ ____| | | |_ _| __ \\ / ____| |\r\n | |_) | / \\ | | | | | | | |__ | (___ ... | 5 |
public final BufferedImage extractImageSegment(
BufferedImage sourceImage, int x, int y, int width, int height) {
BufferedImage extractedImage = null;
if (sourceImage == null)
throw new NullPointerException(
"AssetLoader.extractImageSegement: NULL source imag... | 7 |
private static byte[] checksumToByteArray(int value) {
byte[] b = new byte[2];
for (int i = 0; i < 2; i++) {
int offset = (b.length - 1 - i) * 8;
b[i] = (byte) ((value >>> offset) & 0xFF);
}
return b;
} | 1 |
public String getDescription() {
return description;
} | 0 |
@Test
public void testSetAnt() throws IOException {
System.out.println("setAnt");
Cell instance = new Cell(0,0);
Ant expResult = null;
Ant result = instance.getAnt();
assertEquals(expResult, result);
AntBrain ab = new AntBrain("cleverbrain1.brain");
... | 0 |
@Override
protected void doAction(int option)
{
switch (option)
{
case 1:
listAllTeams();
break;
case 2:
addTeam();
break;
case 3:
updateTeam();
break;
... | 6 |
public String decrypt(byte[] encondeMessage) {
int[] intText = byte2int(encondeMessage);
int i, v0, v1, sum, n;
i = 0;
while (i < intText.length - 1) {
n = numCycles;
v0 = intText[i];
v1 = intText[i + 1];
sum = delta * numCycles;
for (int ind = 0; ind < n; ind++) {
v1 -= ((v0 << 4 ) + key[2... | 2 |
@SuppressWarnings("unchecked")
private void readFile() {
FileInputStream
sfis = null,
rfis = null;
ObjectInputStream
sois = null,
rois = null;
try {
sfis = new FileInputStream(sendURL);
rfis = new FileInputStream(reportURL);
if(sfis.available() > 0) sois = new ... | 5 |
@Override
public Protein getProteinFromFile(File f)
{
Protein protein = new Protein();
BufferedReader br;
try
{
br = new BufferedReader(new FileReader(f));
String line = null;
try
{
while((line=br.readLine()) != null)
{
... | 7 |
public final void setPos(int i, int j, boolean flag)
{
if(anim != -1 && Animation.anims[anim].anInt364 == 1)
anim = -1;
if(!flag)
{
int k = i - smallX[0];
int l = j - smallY[0];
if(k >= -8 && k <= 8 && l >= -8 && l <= 8)
{
if(smallXYIndex < 9)
smallXYIndex++;
for(int i1 = smallXYIndex... | 9 |
public void testPeutMarquerDame(){
Tablier t1 = new Tablier();
t1.initialiserCase();
assertFalse(t1.peutMarquerDame(CouleurCase.BLANC));
assertFalse(t1.peutMarquerDame(CouleurCase.NOIR));
// deplacement de toute les dames blanches
for (int i=0;i<2;i++)
t1.deplacerDame(t1.getListeCase().get(0), t1.getL... | 8 |
@Override
protected void drawLine(Graphics2D g, AZeit t1, float posPercent,
float sizePercent)
{
if(posPercent>1 || posPercent<0 || sizePercent>1 || sizePercent<0)
throw new IllegalArgumentException();
g.setStroke(new BasicStroke());
final double angle=timeToAngle(t1);
final double sin=Math.sin(angle);
... | 4 |
public void test_DateTime_new_Gaza() {
try {
new DateTime(2007, 4, 1, 0, 0, 0, 0, MOCK_GAZA);
fail();
} catch (IllegalInstantException ex) {
assertEquals(true, ex.getMessage().indexOf("Illegal instant due to time zone offset transition") >= 0);
}
} | 1 |
@Override
public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
try {
if (sender instanceof Player) {
Player player = (Player) sender;
if (cmd.getName().equalsIgnoreCase("talk")) {
player.sendMessage(ChatColor.GREEN
+ "Welcome to the Hunger Games... | 4 |
@Override
public void setCredits(double credits) {
if(credits < 0.5 || credits > 4.0) {
JOptionPane.showMessageDialog(null,
"Error: credits must be in the range 0.5 to 4.0");
System.exit(0);
}
this.credits = credits;
} | 2 |
private double closest(Point2D[] pointsByX, Point2D[] pointsByY, Point2D[] aux, int lo, int hi) {
if (hi <= lo) return Double.POSITIVE_INFINITY;
int mid = lo + (hi - lo) / 2;
Point2D median = pointsByX[mid];
// compute closest pair with both endpoints in left subarray or both in right ... | 8 |
private void drawols(GOut g, Coord sc) {
synchronized (map.grids) {
for (Coord gc : map.grids.keySet()) {
Grid grid = map.grids.get(gc);
for (Overlay lol : grid.ols) {
int id = getolid(lol.mask);
if (visol[id] < 1) {
continue;
}
Coord c0 = gc.mul(cmaps);
drawol2(g, id, c0.add... | 5 |
public void testSentenceParts() throws Exception {
ReadEngine engine = new ReadEngine();
Conversation conversation;
ArrayList<String> predicates = new ArrayList<>();
ArrayList<String> subjects = new ArrayList<>();
for (int i = 0; i < conversationsStory.length; i++) {
... | 9 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
out = new StringBuilder();
boolean noFirst = false;
while ((line = in.readLine()) != null && line.length() != 0) {
int n = Integer.parseInt(line);
if (n... | 5 |
public void checkNeighbours(Map map, ArrayList<Node> openlist, ArrayList<Node> closedlist){
openlist.remove(this);
closedlist.add(this);
if(posX == goal.x && posY == goal.y){
finalNode = this;
return;
}
for(Direction dir: directions){
Point newPosition = dir.nextPoint(posX, posY);
... | 6 |
private Koordinate getMin(WarMachine warMachine, Koordinate koord,
Ausrichtung ausrichtung) {
switch (ausrichtung) {
case XPLUS:
return koord;
case XMINUS:
return new Koordinate(koord.getX() - warMachine.getLaenge() + 1,
koord.getY() - warMachine.getBreite() + 1);
case YPLUS:
return new Koordin... | 4 |
private static void performStep17(BotState state) {
for (Region opponentBorderingRegion : state.getVisibleMap().getOpponentBorderingRegions(state)) {
List<Region> opponentNeighbors = opponentBorderingRegion.getEnemyNeighbors(state);
List<Region> sortedOpponentNeighbors = RegionValueCalculator.sortRegionsByAttac... | 6 |
void createExampleWidgets () {
/* Compute the widget style */
int style = getDefaultStyle();
if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL;
if (verticalButton.getSelection ()) style |= SWT.VERTICAL;
if (smoothButton.getSelection ()) style |= SWT.SMOOTH;
if (borderButton.getSelection ()) sty... | 5 |
private static String[] readFile(String file, int lines, String language) throws IOException
{
String encoding = getEncodingForLanguage(language);
BufferedReader in;
if (encoding == null)
in = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
else
in = new BufferedReader(new InputStr... | 2 |
public void dealerStand() {
if (player.ifBusted() == true) {
player.playerBust();
} else if (dealerHand.getHandValue() < player.getHand().getHandValue()) {
dealerLost();
} else if (dealerHand.getHandValue() > player.getHand().getHandValue()) {
dealerWon();
} else {
dealerPush();
}
} | 3 |
public void heapIncKey(int indeksi, int arvo) {
if (indeksi >= 0 && indeksi < keko.size()) {
if (arvo > keko.get(indeksi)) {
keko.set(indeksi, arvo);
}
while (indeksi > 0 && keko.get(parent(indeksi)) < arvo) {
int apuluku = keko.get(parent(inde... | 5 |
public void alustaIkkuna(int i) {
alustaTaso(i);
SwingUtilities.invokeLater(ikkuna);
} | 0 |
public LoadImage(String s) {
//img = ImageIO.read(new File(s));
//img = Toolkit.getDefaultToolkit().createImage(s);
img = Toolkit.getDefaultToolkit().createImage(s);
imageTracker = new MediaTracker(this);
imageTracker.addImage(img,0);
if(false == imageTracker.checkID(0))
{
try... | 4 |
@Override
public void setValue (final List<Value<?>> value) {
if (value == null) {
throw new NullPointerException();
}
this.value = new ArrayList<Value<?>>(value);
} | 3 |
public void keyPressed(int k) {
if(k == KeyEvent.VK_LEFT) {
player.setLeft(true);
}
if(k == KeyEvent.VK_RIGHT) {
player.setRight(true);
}
if(k == KeyEvent.VK_UP) {
player.setUp(true);
}
if(k == KeyEvent.VK_DOWN) {
player.setDown(true);
}
if(k == KeyEvent.VK_W) {
player.setJumping(true);... | 8 |
public final Level loadOnline(String var1, String var2, int var3) {
if(this.progressBar != null) {
this.progressBar.setTitle("Loading level");
}
try {
if(this.progressBar != null) {
this.progressBar.setText("Connecting..");
}
HttpURLConnection var6;
... | 8 |
short addUtf8(String k)
{
int theIndex = itsUtf8Hash.get(k, -1);
if (theIndex == -1) {
int strLen = k.length();
boolean tooBigString;
if (strLen > MAX_UTF_ENCODING_SIZE) {
tooBigString = true;
} else {
tooBigString = fal... | 8 |
private String buildJsonUsername() {
Iterator<String> iterator = getUserName().iterator();
JsonArrayBuilder jsonArrayBuilder = Json.createArrayBuilder();
while (iterator.hasNext()) {
jsonArrayBuilder.add((String) iterator.next());
}
System.out.println("User Array " + ... | 1 |
public ArrayList<ArrayList<ArrayList<String>>> erstelleBlockelementListAll(
ArrayList<Umlaufplan> umlaufplanliste) {
ArrayList<ArrayList<ArrayList<String>>> ListPlaeneGesamt = new ArrayList<ArrayList<ArrayList<String>>>();
int zaehler = 0;
for (int i = 0; i < umlaufplanliste.size(); i++) {
ArrayList<Array... | 6 |
public boolean intersectWith(BlockArea ba) {
if (this.l == null || ba.getLocation() == null) return false;
for (BlockPosition bp : blocks) {
BlockPosition bp1 = bp.bind(l);
for (BlockPosition bp2 : ba.blocks) {
if (bp2.bind(ba.l).equals(bp1)) return true;
... | 5 |
public static void apropos() {
if (fenetreApropos != null) {
fenetreApropos.dispose();
}
fenetreApropos = new WindowApropos();
} | 1 |
int setHandValue()
{
int handValue = this.handType * 0x100000;
int i = 0;
int n = 0x10000;
ArrayList < PlayingCard > reverseUsedList = this.usedCards;
Collections.sort( reverseUsedList, PlayingCard.Comparators.ACEHIGH );
Collections.reverse( reverseUsedList );
while ( i < reverseUsedList.size() )
{
... | 7 |
private void loadText(){
textPane.setText("");
StyledDocument doc = textPane.getStyledDocument();
for ( RecipeSection section: recipe.getSections() ){
try{
String headline = section.getHeadline();
if( headline != null && ! headline.equals("") ){
... | 4 |
private void processOpenFrame(int channelPtr,
int ctype,
int flag,
ByteBuffer data) {
OpenRequest request;
Channel channel;
synchronized (this) {
request = m_pendingOpenRequest;
... | 4 |
@Test
public void simpleWithWanFilter() throws Exception {
final byte[] input = new byte[15];
final byte[] zeroes = new byte[input.length];
Arrays.fill(zeroes, (byte) 0);
final int pipe_buf_size = 20;
new Random().nextBytes(input);
final Properties[] filter_configs = ... | 0 |
public Client(String ip,String playerName,String tankName,int tankSpeed,int bulletSpeed,int bulletDamage){
Client.ip = ip;
imageInit();
this.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
Dimension scrSize=Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(scrSize.width/2-SCREEN_WIDTH/2, scrSiz... | 4 |
public static Float parseSpeed(String data) {
String[] lines = data.split("\n");
for (String line : lines) {
String[] parts = line.split(":", 2);
if (parts[0].equals("s")) {
return Float.parseFloat( parts[1].replace(",",".") );
}
}
return null;
} | 2 |
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 |
public void run() {
try {
InputStream stream = socket.getInputStream();
connected=true;
while(connected){
int byteCount = stream.available();
if(byteCount>0){
logger.debug(byteCount+" bytes are available for reading");
byte[] oldByteBuffer = byteBuffer;
//int oldByteBufferLength = oldB... | 8 |
@Override
public ReturnStruct parse(String[] lines) throws InterpreterException {
int i = 0;
code_ = lines;
Block b = null;
while (i < lines.length) {
String line = Parser.clean(lines[i]);
String copy[] = new String[lines.length - i];
System.arrayc... | 4 |
public MethodAnalyzer getMethodAnalyzer() {
ClassAnalyzer ana = getClassAnalyzer();
if (ana == null)
return null;
return ana.getMethod(methodName, methodType);
} | 1 |
@Override
public void run() {
TcpSender packetSender = new TcpSender();
while (true) {
// A spin wait is super resource heavy
// TODO: not this
while (ccl.isEmpty()) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace(... | 3 |
public File getFile()
{
if (file == null)
{
String searchPath = Util.minecraftDirectory + "/libraries/";
String[] pathSplit = name.split(":");
pathSplit[0] = pathSplit[0].replace('.', '/');
for (int i = 0; i < pathSplit.length; i++)
{
... | 7 |
public String GenerateLinkID(){
return DateUtil.GetTimeString() + getTTenNum();
} | 0 |
private void loadDriver()
{
try
{
d = (Driver)Class.forName(driver).newInstance();
DriverManager.registerDriver(d);
}
catch (Exception e)
{
System.out.println("Error loading database driver: " + e.toString());
}
} | 1 |
@Override
public void paint(Graphics g, RsTransform gt){
int i, j;
int ix, iy, iRadius;
int w, h;
double [] xPlacement = null;
double [] yPlacement = null;
int [] xWall;
int [] yWall;
xWall = new int[6];
yWall = new int[6];
... | 8 |
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
System.exit(0);
}//GEN-LAST:event_formWindowClosed | 0 |
public void testPropertyCompareToHour() {
LocalTime test1 = new LocalTime(TEST_TIME1);
LocalTime test2 = new LocalTime(TEST_TIME2);
assertEquals(true, test1.hourOfDay().compareTo(test2) < 0);
assertEquals(true, test2.hourOfDay().compareTo(test1) > 0);
assertEquals(true, test1.hou... | 2 |
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 |
public static void shutdown() {
boolean gotSQLExc = false;
try {
try{
Class.forName(DRIVER_NAME);
}catch (Exception e) {
//Nothing
}
DriverManager.getConnection(SHUTDOWN_URL);
} catch (SQLException se) {
if ... | 4 |
public void remove(){
if (current == null)
throw new NoSuchElementException();
if (current == first){
first = first.link;
current = (LinkedListNode<T>) first;
previous = null;
if (first == null)
l... | 5 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
switch (columnIndex) {
case 0:
return listpharmacie.get(rowIndex).getId_pharmacie();
case 1:
return listpharmacie.get(rowIndex).getNom_pharmacie();
case 2:
... | 8 |
public void paintExpBar(Graphics g)
{
g.setColor(Color.CYAN);
//g.drawImage(battleImages[4],415,385,150,12,this);
if(allowedToPaintExp)
{
int prevLev=Battle.getLevel(userSelected)-1;
int nextLev=prevLev+1;
if(nextLev>100)
nextLev=100;
int expOver=Battle.getExp(userSelected)-(prevLev*prevLev*p... | 3 |
private void saveConnections(){
HashSet<String> roomSet = new HashSet<String>();
ExitDirection dir = null;
String rooms = "";
String connections = "";
String xml = "<?xml version=\"1.0\"?>\n<game name=\"";
xml = xml + name.getText()+"\">\n<description>\n\"";
xml = xml + desc.getText()+"\"\n</description>\... | 9 |
public static String unescapeTokenString(String token, char escapechar, boolean upcaseP) {
{ int nofescapes = 0;
int cursor = 0;
int cursor2 = 0;
int size = token.length();
StringBuffer result = null;
boolean escapeP = false;
while (cursor < size) {
if (token.charAt(curs... | 8 |
final int method1187(String string, boolean bool, int i,
RasterToolkit[] class105s) {
try {
anInt1984++;
int i_22_
= method1188(string, new int[] { i },
Class186.aStringArray2494, (byte) 87, class105s);
int i_23_ = 0;
if (bool != false)
((BitmapFont) this).anInt1988 = -58;
for ... | 6 |
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.