text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void initiate(){
//Reset the boolean chosen of the other starters sprites
Iterator<Sprite> it = starters.iterator();
while (it.hasNext()) {
Sprite element = it.next();
((StarterSprite) element).setChosen(false);
}
//Remove all components
jCheck1.setSelected(false);
jCheck2.setSelected(fals... | 9 |
public static void main(String args[]){
int mapSize = 5;
//Creating a colour scheme to test the renderer with
Colour[] colours = new Colour[mapSize];
for (int i=0; i<5; i++) {
switch (i) {
case 0: Colour black = new Colour("#000000");
colours[i] = black;
... | 6 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
&& string.indexOf('E') < 0) {
while... | 7 |
public void testValidEdge2() {
try {
TreeNode tree = new TreeNode("tree", 2);
TreeNode subtree = new TreeNode("spare-subtree");
tree.setBranch(new TreeNode[]{ new TreeNode("subtree"), subtree });
setTree(tree);
TreeNode realTree = ((Question1)answer);
... | 7 |
protected void assertDecodedSourcesEqual(DecodedSource a, DecodedSource b)
{
try
{
int idx = 0;
while (true)
{
boolean aHasData = true;
double aData = 0.0f;
try
{
aData = a.getSample(idx);
}
catch (NoMoreDataException e)
{
aHasData = false;
}
boolea... | 5 |
@Override
public boolean supportsEditability() {return true;} | 0 |
public GameWorld(WorldDescriptor descr)
throws WeigthNumberNotMatchException {
stepCount = 0;
conf = descr.configuration();
entities = Collections.synchronizedList(new LinkedList<Entity>());
dead = Collections.synchronizedList(new LinkedList<Entity>());
Random rng = new Random();
// adding agents
for (... | 2 |
@Test
public void getTest() throws Exception {
mockMvc.perform(get("/get.json"))
.andExpect(status().isOk())
.andExpect(view().name("jsonView")).andExpect(model().size(1));
} | 0 |
public int grab()
{
Random rand = new Random();
int randNumber = 0;
return randNumber = data[rand.nextInt(manyItems)];
} | 0 |
public boolean nextChunk() {
if (!this.hasNext()) {
return false;
}
int len = vsize.length -1;
int tmp = len;
while (tmp >= 0
&& this.start[tmp] + this.chunkStep[tmp] >= this.vsize[tmp]) {
tmp--;
}
this.start[tmp] += this.chunkStep[tmp];
for (int i = len; i > tmp; i--) {
this.start[i] = 0;
... | 4 |
private CreaturePluginFactory(double inMaxSpeed) {
try {
pluginLoader = new PluginLoader(pluginDir,ICreature.class);
}
catch (MalformedURLException ex) {
}
maxSpeed=inMaxSpeed;
constructorMap = new HashMap<String,Constructor<? extends ICreature>>();
load();
} | 2 |
public String leerLog(String path){
File f = new File(path);
if(f.exists())
{
try {
BufferedReader br = new BufferedReader(new FileReader(path));
StringBuilder sb = new StringBuilder();
String line = br.readLine();
... | 3 |
public double distToExit(Point pos){
return (Math.abs(pos.x - exitP.x) + Math.abs(pos.y - exitP.y));
} | 0 |
public static int check(String aWord, String bWord) {
char[] a = aWord.toCharArray();
char[] b = bWord.toCharArray();
int curSum = 0, sum = 0, aSize = a.length, bSize = b.length, ia;
for (int i = 0; i < aSize + bSize - 1; i++) {
ia = i - (bSize - 1);
curSum = 0;
for (int j = 0; j < b.length; j++, ia++)... | 5 |
public void operate(Iqueue platformQueue, int phase){
if(!this.sellerQueue.isEmpty()){
int beforMoveCount = platformQueue.getSize();
moveCustomerToPlatformQueue(platformQueue,phase);
int afterMoveCount = platformQueue.getSize();
if( !this.sellerQueue.isEmpty() &&
afterMoveCount != beforMoveCount){... | 3 |
protected void standardTransform(int kc) {
if (kc == forwardKey) {
moveForward();
} else {
if (kc == backKey) {
moveBackward();
} else {
if (kc == leftKey) {
rotateLeft();
} else {
if (kc == rightKey) {
rotateRight();
}
}
}
}
} | 4 |
public Behaviour getNextStep() {
final float demand = venue.stocks.demandFor(made.type) ;
if (demand > 0) made = Item.withAmount(made, demand + 5) ;
if (venue.stocks.hasItem(made)) {
return null ;
}
if (GameSettings.hardCore && ! hasNeeded()) return null ;
return new Action(
actor, v... | 4 |
public void setUserSavedGame(String true_false) {
File file = new File("Users.txt");
String line = "";
FileWriter writer;
ArrayList<String> userData= new ArrayList<String>();
ListIterator<String> iterator;
try {
Scanner s = new Scanner(file);
while(s.hasNextLine()) {
userData.add(s.nextLine());
... | 8 |
public static boolean isAnagrams1(String s,String t){
if( s== null || t == null){
return false;
}
if(s.length() != t.length()){
return false;
}
int[] map = new int[256];
char[] u = s.toCharArray();
char[] v = t.toCharArray();
int len = u.length;
for(int i=0;i<len;i++){
map[(int)u[i]]++;
ma... | 6 |
public void keyReleased(KeyEvent e)
{
//System.out.println("Key = " + e);
key = e.getKeyCode();
if (key == 32)
space = false;
else if (key == 38)
up = false;
else if (key == 37)
left = false;
else if (key == 39)
... | 7 |
private StringVector getNodesByID(XPathContext xctxt, int docContext,
String refval, StringVector usedrefs,
NodeSetDTM nodeSet, boolean mayBeMore)
{
if (null != refval)
{
String ref = null;
// DOMHelper dh = xctxt.getDOMHelper... | 9 |
private static String describeSupport(Property p,
List<GeneralNameValueConfig> fieldSet) {
String supp="";
for(GeneralNameValueConfig cfg : fieldSet) {
if(cfg.fieldProperty==p) {
if(supp.length()>0)
supp+=", ";
supp+=cfg.fieldName
... | 5 |
public int compute()
{
subSequence[0] = 0;
backPointers[0] = -1;
len = 1;
for (int i = 1; i < seq.length; i++) {
if (seq[i] > seq[subSequence[len-1]]) {
backPointers[i] = subSequence[len-1];
subSequence[len++] = i;
} else if (se... | 3 |
@Override
public void loadFromFile(String trainFile, String testFile, String quizFile, String featureFile)
{
System.out.print("Loading dataset... ");
try
{
if(trainFile != null && trainFile.length() > 0);
loadDataFromFile(trainFile, InstanceType.Train);
if(testFile != null && testFile.length() > 0)
... | 9 |
FlowBlock getSuccessor(int start, int end) {
/* search successor with smallest addr. */
Iterator keys = successors.keySet().iterator();
FlowBlock succ = null;
while (keys.hasNext()) {
FlowBlock fb = (FlowBlock) keys.next();
if (fb.addr < start || fb.addr >= end || fb == this)
continue;
if (succ == ... | 6 |
public Ifrit(int room) {
super(new Earthquake(), new SonicBlow(), 180.0*room, 199.0*room, 190.00*room, 2.0*room, 120.0*room, 25.0*room, "Ifrit");
} // End DVC | 0 |
public void setTriArrows(CellElement current,
boolean showNotChoosen) {
m_arrowList.clear();
int cCol, cRow;
cCol = current.getColumn();
cRow = current.getRow();
this.setGridCircle(cCol, cRow);
if (((NussinovCellElement)current).isEndCell()) {
return;
... | 8 |
private MoveAndCost findBestMoveInternal(int[][] board, int depth) {
int n = board.length;
int m = board[0].length;
double minCost = Double.POSITIVE_INFINITY;
int[][] bestBoard = null;
Move bestMove = null;
for (Move move : Move.ALL) {
int[][] newBoard = makeM... | 9 |
private boolean jj_3R_36() {
if (jj_3R_82()) return true;
return false;
} | 1 |
private static void receive() {
LOG.debug("Receiving packet");
String parameterType = (String) cbType.getSelectedItem();
LOG.debug("Parameter types: {}", parameterType);
try {
GWCAPacket gwcaPacket = gwcaConnection.receivePacket();
byte[] w = null, l = null;
... | 4 |
@Override
public void run() {
int skippedFrames;
long runTime = 0;
ticksClock.start();
framesClock.start();
while (game.isRunning()) {
long nsPerTick = Clock.NS_PER_SEC / game.ups;
long nsPerFrame = Clock.NS_PER_SEC / game.fps;
ticksCl... | 6 |
public Vector<TestRecord> getRecordList(ResultSet rs) {
Vector<TestRecord> records = new Vector<TestRecord>();
try {
while (rs.next()) {
TestRecord record = new TestRecord();
record.setTest_id(rs.getInt("test_id"));
record.setType_id(rs.getInt("type_id"));
record.setPatient_no(rs.getInt("patient_... | 2 |
private String createResultMessage() {
StringBuffer message = new StringBuffer();
message.append(TextUserInterface.HORIZENTAL_LINE).
append(TextUserInterface.NEW_LINE).
append(TextUserInterface.HORIZENTAL_LINE).
append(TextUserInterface.NEW_LINE).
append("You ");
switch ... | 7 |
public static void add(long uid, Notification notification) {
UserNotificationBuffer buffer = getMonitorFor(uid);
buffer.addNotification(notification);
} | 0 |
public static void initiate(JavaPlugin plugin, String name, String prefix) {
logPrefix = prefix;
fileName = name;
File folder = plugin.getDataFolder();
if (!folder.exists()) {
folder.mkdir();
}
File log = new File(plugin.getDataFolder(), fileName + ".log");
... | 3 |
private static Component getFirstFocusableField(Object comp) {
if (comp instanceof JTextComponent || comp instanceof KeyStrokeDisplay) {
return (Component) comp;
}
if (comp instanceof Container) {
for (Component child : ((Container) comp).getComponents()) {
Component field = getFirstFocusableField(child... | 5 |
@Override
public Value run(CodeBlock i) {
try {
__return = false;
if (body_ == null) {
body_ = parseForRun();
}
while (!__end && !__return && condition_.run(i).getBoolean()) {
Value v = runBlock(body_, this);
if ... | 6 |
@Override
public void execute() {
Inventory.getItem(Constants.INVENTORY_BURNED_ROOT_ID).getWidgetChild().interact("Fletch");
final Timer timeout = new Timer(2000);
while(timeout.isRunning() && !validate(Constants.FLETCH_WIDGET)) {
Task.sleep(50);
}
if (validate(Constants.FLETCH_WIDGET)) {
Widgets.ge... | 3 |
public static List<Record> getRecords(String baseformat, int num) throws SQLException
{
String cd_extra = "AND riploc IS NOT NULL";
if (!baseformat.equalsIgnoreCase("cd"))
cd_extra = "";
String sql = "select recordnumber,count(score_value) as cnt,avg(score_value) AS mean from records,scor... | 2 |
public static void startupArithmetic() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/PL-KERNEL-KB", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEX... | 6 |
private String generateMIPSCode(String irCode)
{
String[] lines = irCode.split("\n");
ArrayList<String> newLines = new ArrayList<String>();
newLines.add(model.getDataHeader());
newLines.add(".text\n");
newLines.add(".globl main\n");
for(int i = 0; i < lines.length; i++)
{
if(lines[i].contains(":") && ... | 6 |
public String getOutput() {
int nextBlank = buffer.indexOf("" + BLANK, getTapeHead());
if (nextBlank == -1)
nextBlank = buffer.length();
return buffer.substring(getTapeHead(), nextBlank);
} | 1 |
public ConfigTextParser(String filePath){
textFilePath = filePath;
//lecture du fichier texte
try{
InputStream ips=new FileInputStream(textFilePath);
InputStreamReader ipsr=new InputStreamReader(ips);
BufferedReader br=new BufferedReader... | 9 |
public void and(BitSet set)
{
if (this == set)
return;
while (wordsInUse > set.wordsInUse)
words[--wordsInUse] = 0;
// Perform logical AND on words in common
for (int i = 0; i < wordsInUse; i++)
words[i] &= set.words[i];
... | 3 |
private void loadConfig() {
saveDefaultConfig();
FileConfiguration cfg = getConfig();
// Add defaults
if (cfg.getConfigurationSection("global-settings") == null) {
cfg.createSection("global-settings");
cfg.set("global-settings.enabled", true);
cfg.set("global-settings.check-for-updates", true);
... | 5 |
public void doPrintSchnitt() {
for (int i = 0; i < this.inspectedVertices.size(); i++) {
boolean isSchnitt = false;
String schnittTarget = "";
String node = this.inspectedVertices.get(i);
List<String> edges = this.graph.getIncident(node);
for (String edge : edges) {
String target = this.graph.ge... | 4 |
private void jButtonCalcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCalcActionPerformed
/**This method calculates Monthly Mortgage Payment**/
/**Get Input**/
//Get the vlaue of the text fiels
sPrinciple = jTextFieldPrincipal.getText();
... | 4 |
private boolean initConnections(StringBuffer msg) {
JnnLayer currentLayer;
JnnLayer testLayer;
JnnUnit currentUnit;
JnnUnit testUnit;
JnnConnection currentConnection;
int layerIndex;
int unitIndex;
for (JnnLayer layer : layers) {
currentLayer... | 8 |
private void siirryTunnuksenLoppuun() {
while (true) {
if (!merkkiOsaTunnusta()) {
break;
}
paikka++;
}
} | 2 |
public boolean isSameTree(TreeNode p, TreeNode q) {
if((p == null && q != null) || (p != null && q == null)) return false;
if(p == null && q == null) return true;
if(p.val != q.val) return false;
return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
} | 8 |
public Query retryResult(String query) {
boolean passed = false;
Connection connection = open();
Statement statement = null;
ResultSet result = null;
while (!passed) {
try {
statement = connection.createStatement();
result = statement.executeQuery(query);
passed = true;
return new Query(co... | 4 |
public void UpdateAll(float delta)
{
Update(delta);
for(GameObject child : m_children)
child.UpdateAll(delta);
} | 1 |
public void init(String n,int id){
if(n.equals("Creneau"))
etat = Etat.Creneau;
else if (n.equals("Creneau1")){
etat = Etat.Creneau1;
try {
this.creneau = new Seance(id);
} catch (SQLException ex) {
Logger.getLogger(New_Etud... | 6 |
private static void printGroup(ContactGroupEntry groupEntry) {
System.err.println("Id: " + groupEntry.getId());
System.err.println("Group Name: " + groupEntry.getTitle().getPlainText());
System.err.println("Last Updated: " + groupEntry.getUpdated());
System.err.println("Extended Properties:");
for (... | 5 |
public final void loadMonsterRate(final boolean first) {
final int spawnSize = monsterSpawn.size();
/* if (spawnSize >= 25 || monsterRate > 1.5) {
maxRegularSpawn = Math.round(spawnSize / monsterRate);
} else {
maxRegularSpawn = Math.round(spawnSize * monsterRate);
}*/
... | 7 |
public static void sort(double[] a)
{
int N = a.length;
// Sentinel
for (int i = N - 1; i > 0; i--)
{
if (a[i] < a[i - 1])
{
double t = a[i];
a[i] = a[i - 1];
a[i - 1] = t;
}
}
// Sort a[] into increasing order.
for (int i = 2; i < N; i++)
{ // Insert a[i] among a[i-1], a[i-2],
... | 5 |
private double[][] enlarge(double[][] small, int factor){
int smallXSize = small.length;
int smallYSize = small[0].length;
int largeXSize = smallXSize*factor;
int largeYSize = smallYSize*factor;
double[][] large = new double[largeXSize][largeYSize];
for(int y=0; y<large... | 6 |
public Snapshot validate() {
if(f_0 != null || s_0 != null || v2_0 != null || (v3_0 != null && v3_0.len() > 0) || c_0 != null || d_0 != null) return this;
return null;
} | 7 |
public void start() {
// crawl through all pages and grab every link you can get
System.out.print("CRAWLING #" + pagesCrawled);
crawlPage(ROOT_URL);
if (GUI != null) GUI.notifyCrawlingFinished();
// Print results
System.out.println("\n\nINTERNAL LINKS:");
int i =... | 4 |
public void writeReducedOtuSpreadsheetsWithTaxaAsColumns(
File newFilePath, int numTaxaToInclude) throws Exception
{
HashSet<String> toInclude = new LinkedHashSet<String>();
HashMap<String, Double> taxaSorted =
getTaxaListSortedByNumberOfCounts();
numTaxaToInclude = Math.min(numTaxaToInclude, taxaSort... | 9 |
private void realput(URL loc, byte[] data) {
FileContents file;
try {
try {
file = back.get(loc);
} catch(FileNotFoundException e) {
back.create(loc, data.length);
file = back.get(loc);
}
if(file.getMaxLength() < data.length) {
if(file.setMaxLength(data.length) < data.length) {
back.... | 5 |
private void performSecurityOperation(APDU apdu) {
byte[] buffer = apdu.getBuffer();
short p1p2 = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);
short len;
switch (p1p2) {
case (short)0x9e9a:
byte[] counter = signCount.getData();
... | 7 |
public boolean isMatchHelp(String s, String p) {
if (p.length() == 0) {
if (s.length() == 0)
return true;
return false;
}
if (s.length() == 0) {
if (p.equals("*"))
return true;
return false;
}
if (p... | 8 |
public Map<String, UUID> call() throws Exception {
Map<String, UUID> uuidMap = new HashMap<String, UUID>();
int requests = (int) Math.ceil(names.size() / PROFILES_PER_REQUEST);
for (int i = 0; i < requests; i++) {
HttpURLConnection connection = createConnection();
String ... | 4 |
public static double showSign (double value) {
if (value == 0.0) {
return 0.0;
}
else {
return (value / Math.abs(value));
}
} | 1 |
public Float getFloatItem(String... names) throws ReaderException {
try {
return Float.parseFloat(getItem(names).toString());
} catch (NumberFormatException e) {
throw new ReaderException("No key exists with this type, keys: " + _parseMessage(names) + ". In file: " + ConfigurationManager.config_file_path);
... | 1 |
public Environment<K,V> locateChild( Path<String> path ) {
if( path == null )
throw new NullPointerException( "Cannot locate children by null-paths." );
if( path.getLength() == 0 )
return this;
Environment<K,V> child = this.getChild( path.getFirstElement() );
if( child == null || path.getLength() ==... | 4 |
public LibraryBean[] showByTags(String[] tags){
//Get all idlibrary that have tags
LinkedList<Integer> list = new LinkedList<>();
TagListDAO tagListDAO = new TagListDAO(connection);
for(int i = 0; i < tags.length; i++){
list.addAll(tagListDAO.getAllLibraryIdByTag(tags[i]));
}
Collections.sort(lis... | 7 |
public void updateCheck()
{
//check to make sure we have a base folder system to work out of
//Normally will generate files it need if not something is wrong
addToConsole("Checking File System");
Boolean fileExist = FileManager.rootFileCheck();
if(fileExist)
{
if(FileManager.errors... | 7 |
public void mousePressed(MouseEvent e) {
if (scrollableTabLayoutEnabled()) {
MouseListener[] ml = tabPane.getMouseListeners();
for (int i = 0; i < ml.length; i++) {
ml[i].mousePressed(e);
}
}
if (!tabPane.isEnabled()... | 7 |
public Position getRandomPassablePos(double radius) {
Position middlePos = new Position(this.getWidth() / 2,
this.getHeight() / 2);
Position pos = new Position(this.random.nextDouble() * this.getWidth(),
this.random.nextDouble() * this.getHeight());
for (int attempt = 0; attempt < 5; attempt++) {
if(!... | 3 |
private boolean testaaPiste(Piste piste) {
if(this.osuikoJohonkin == EsteenTyyppi.QUIT) {
return false;
}
EsteenTyyppi este = taso.onkoPisteessaEste(piste);
if (este != null) {
this.osuikoJohonkin = este;
return true;
}
return false;
... | 2 |
@Override
public void resetProperty(String key) {
this.current_values.put(key, this.default_values.get(key));
} | 0 |
protected void populateResults(int year, boolean wantPrev) {
colName.setCellValueFactory(new PropertyValueFactory<SgaPOJO,String>("Name"));
colCat.setCellValueFactory(new PropertyValueFactory<SgaPOJO,String>("Category"));
colPyReq.setCellValueFactory(new PropertyValueFactory<SgaPOJO,... | 6 |
public String join(String separator) throws JSONException {
int len = length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < len; i += 1) {
if (i > 0) {
sb.append(separator);
}
sb.append(JSONObject.valueToString(this.myArrayList.g... | 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 changeWidth(int width)
{
for(int i=0;i<markers;i++)
{
if(marker[i].isSelectedWidth())
{
marker[i].changeWidth(width);
// break;
}
}
} | 2 |
public boolean blocksColor(Point p, int x, int y, int i, int a,
ArrayList<Integer> list) {
Point[] arr = { new Point(x + 1, y), new Point(x, y + 1),
new Point(x - 1, y), new Point(x, y - 1) };
return board.getCell(p.x, p.y).isFull()
// Cell is full
&& i != (player.getColor())
// the color being ... | 7 |
private void createTablePage() {
Composite parent = getContainer();
// XXX move all the creation into its own component
Canvas canvas = new Canvas(parent, SWT.None);
GridLayout layout = new GridLayout(6, false);
canvas.setLayout(layout);
// create the header part with the search function and Add/Delete r... | 6 |
private void btnCalcCoinageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcCoinageActionPerformed
// TODO add your handling code here:
//validation for number entry; resets form if entry is not a numerical value
boolean floatTest = (MyUtils.isFloat(txt... | 6 |
public Dimension getViewSize() {
return (viewIsUnbounded() ? getView().getPreferredSize() : super.getViewSize());
} | 1 |
public void weaponSwing(Arc2D.Double arc, Point p) {
boolean projectileHit = false;
Projectile projectile = null;
try {
for (String key : projectiles.keySet()) {
projectile = (Projectile) projectiles.get(key);
if (projectile != null) {
... | 5 |
@Override
public String execute() throws Exception {
memberDAO.save(member);
return SUCCESS;
} | 0 |
public List<String> getMcEcho_ActiveChannels(){ return McEcho_ActiveChannels; } | 0 |
public int reduceHealth(int damage)
{
health = health - damage;
if(health <= 0)
{
health = 0;
}
if(health > 200)
{
health = 200;
}
return health;
} | 2 |
final AbstractFontRasterizer createFontRasterizer(BitmapFont class143, ImageSprite[] class207s,
boolean bool) {
int[] is = new int[class207s.length];
int[] is_60_ = new int[class207s.length];
boolean bool_61_ = false;
for (int i = 0; i < class207s.length; i++) {
is[i] = ((ImageSprite) class207s[i]).indexW... | 5 |
public boolean esta(Recorrido x){
if(recorridos.isEmpty())
return false;
for(Recorrido r:recorridos)
if(r.equals(x))
return true;
return false;
} | 3 |
public static void resetTextures() {
if (Rasterizer.textureStore == null) {
Rasterizer.textureStoreCount = 20;
if (Rasterizer.lowMem) {
Rasterizer.textureStore = new int[Rasterizer.textureStoreCount][16384];
} else {
Rasterizer.textureStore = new int[Rasterizer.textureStoreCount][0x10000];
}
fo... | 3 |
public void esborraRest(int tipus,int numRest){
switch (tipus){
case 1:
cgen.getCjtResGA().remove(numRest);
break;
case 2:
cgen.getCjtRestGS().remove(numRest);
break;
case 3:
c... | 6 |
void splitExp(Entity thnStore, int CUR_EXP)
{
if (thnStore.BLN_POPUP)
{
thnStore.send(""+(char)33+"You have lost "+CUR_EXP+" CUR_EXP\n");
} else
{
thnStore.chatMessage("You have lost "+CUR_EXP+" CUR_EXP\n");
}
thnStore.CUR_EXP -= CUR_EXP;
Vector vctStore;
double tp,
sidepoints=0;
Entity thn... | 8 |
public Color getColor(int index, int c) {
if (blastCounter > 0) {
c = 255 - c;
return new Color(c, c, c);
}
if (index == 0)
return new Color(c, c / 2, c / 2);
if (index == 1)
return new Color(c / 2, c, c / 2);
if (index == 2)
return new Color(c / 2, c / 2, c);
if ... | 7 |
public static PlayerMovementServer getInstance() {
if(instance == null)
instance = new PlayerMovementServer();
return instance;
} | 1 |
public ArrayList<Action> readData(String path2File) throws IOException {
logger.debug("Reading actions.");
ArrayList<Action> actions = new ArrayList<Action>();
BufferedReader br = new BufferedReader( new FileReader( path2File ) );
String line;
while ((line... | 2 |
static void criaAreaNotificacao() {
//Verifica se n�o � poss�vel trabalhar com "TrayIcon"
if (!SystemTray.isSupported()) {
System.out.println("Não da pra fazer, nem tenta!");
return;
}
//Instancia��o de um objeto java.awt.PopupMenu
final PopupMenu pop = ... | 5 |
protected void updatePaving(boolean inWorld) {
if (! inWorld) {
base().paving.updatePerimeter(this, null, false) ;
return ;
}
final Batch <Tile> toPave = new Batch <Tile> () ;
for (Tile t : Spacing.perimeter(area(), world)) {
if (t.blocked()) continue ;
boolean between = fal... | 9 |
public int readIdfTable(String file_name) throws SQLException, IOException{
//creating a hashmap which will have all tokens
int total_records =0;
String line_read;
Runtime runtime = Runtime.getRuntime();
BufferedReader buffReader_obj = new BufferedReader(new FileReader(file_name));
long time = System.cur... | 5 |
@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 StatusPessoa)) {
return false;
}
StatusPessoa other = (StatusPessoa) object;
if ((this.codstatuspessoa == null ... | 5 |
protected Automaton getAutomaton() {
return automaton;
} | 0 |
private void saveList() {
int serverCount = servers.size();
for (int i = 0; i < serverCount; ++i)
storeDetails(i);
storage.store(servers);
MainWindow.getInstance().getMainMenu().loadFavoriteServersList(servers);
} | 1 |
public static void hangup() {
try {
if (rxSock != null) {
rxSock.close();
}
} catch (IOException ex) {
Alerter.getHandler().warning("Message Listener", "Unable to correctly hang up - some sockets may not have been closed.");
}
listener.interrupt();
} | 2 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.