text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static String stripNonCharCodepoints(String input) {
StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < input.length(); i++) {
ch = input.charAt(i);
// Strip all non-characters http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:Noncharacter_Code_... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Connective other = (Connective) obj;
if (left == null) {
if (other.left !... | 9 |
@Test
public void testName() {
Iterator<Pair<?>> i = info.namedValues.iterator();
String s = null;
Label label = null;
while(i.hasNext() && s == null){
pair = i.next();
label = pair.getLabel();
switch (label){
case cNme:
s = (String) pair.second();
break;
default:
s = null;
}
}... | 4 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(((msg.targetMajor()&CMMsg.MASK_MALICIOUS)>0)
&&(!CMath.bset(msg.sourceMajor(),CMMsg.MASK_ALWAYS))
&&((msg.amITarget(affected))))
{
final MOB target=(MOB)msg.target();
if((!target.isInCombat())
&&(msg.source().getVict... | 8 |
public Float getGainTrack_dB() {
return gainTrack_dB;
} | 0 |
public boolean hasItem(int itemSlot)
{
if(inv[itemSlot] != null)
if(itemSlot <= 5 && itemSlot >= 0)
return true;
return false;
} | 3 |
public void putAll(Map<? extends K,? extends V> m) {
for (Map.Entry<? extends K,? extends V> entry : m.entrySet()) {
put (entry.getKey(), entry.getValue());
}
} | 5 |
public static List<String> parseList(String listStr) {
if (isStringNullOrWhiteSpace(listStr) || listStr.length() < 2) return null;
listStr = listStr.substring(1, listStr.length() - 1);
if (isStringNullOrWhiteSpace(listStr)) return new ArrayList<String>();
return Arrays.asList(listStr.split(", "));
} | 3 |
public PapaBicho Factory (String pBicho){
if(pBicho == "tank"){
list = units.tanqueXMLUnit();
setVar();
PapaBicho tank = new PapaBicho(pLevel,pPrice,pIntelligence,pStrenght
,pWeight,pResistance,pMovespeed,
pHitpoints,pWeightLimit,pMana,
pMaxHitPoints);
return tank;
... | 9 |
public boolean LoadWallet() throws LoadingOpenTransactionsFailure {
if (!isPasswordCallbackSet) {
throw new LoadingOpenTransactionsFailure(LoadErrorType.PASSWORD_CALLBACK_NOT_SET, "Must Set Password Callback First!");
}
if (isWalletLoaded) {
throw new LoadingOpenTransact... | 3 |
protected void initGUI() throws SlickException {
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
try {
Renderer renderer = new LWJGLRenderer();
ThemeManager theme = loadTheme(renderer);
gui = new GUI(emptyRootWidget, renderer, null);
gui.applyTheme(theme);
... | 1 |
public AbstractOutlinerJDialog(boolean resizeOnShow, boolean alwaysCenter, boolean modal, int initialWidth, int initialHeight, int minimumWidth, int minimumHeight) {
super(Outliner.outliner, "", modal);
this.alwaysCenter = alwaysCenter;
setSize(initialWidth, initialHeight);
addComponentListener(new Window... | 0 |
private static Node arrayToTree(Integer[] arr) {
if(arr == null || arr.length<=0)
return null;
Node[] narr = new Node[arr.length];
if(arr[0]!=null){
narr[0] = new Node(arr[0]);
}
for(int i=0;i<arr.length;i++){
if(2*i+1 < arr.length && arr[2*i+1]!=null){
narr[2*i+1] = new Node(arr[2*i+1]);
... | 8 |
@Override
public String getSheetName()
{
if( sheetname == null )
{
if( parent_rec != null )
{
WorkBook wb = parent_rec.getWorkBook();
if( (wb != null) && (wb.getExternSheet() != null) )
{ // 20080306 KSC: new way is to get sheet names rather than sheets as can be external refs
String[] s... | 6 |
public List<Station> findStations( String prefix ) throws ApiException {
if ( prefix.length() < 2 )
return Collections.emptyList();
prefix = prefix.toUpperCase();
try {
Set<Station> fromServer = findStationsOnServer( prefix.substring( 0, 2 ) );
List<Station> results = new ArrayList<Station>();
for ... | 6 |
public Integer pop() {
if(len == 0) return null;
int max = heap[0];
heap[0] = heap[len - 1];
len--;
bubbleDown(0);
return max;
} | 1 |
public Tagesspiel(JSONObject setup) {
super("Tagesspiel");
try {
zwerg = setup.getBoolean("Zwergeneinsatz");
} catch (JSONException e) {
}
} | 1 |
private synchronized void processEvent(Sim_event ev) {
double currentTime = GridSim.clock();
boolean success = false;
if(ev.get_src() == myId_) {
// time to update the schedule, remove finished jobs,
// removed finished reservations, start reservations, etc.
if (ev.get_tag() == UPT_SC... | 4 |
public FastaItem getNextFastaItem() throws IOException {
String line;
String headerRow;
String acNum;
int counter = 0;
FastaItem fastaItem = null;
while ((line = reader.readLine()) != null) {
if (line.charAt(0) == '>' && counter == 0) {
headerRow = line;
acNum = line.split(... | 7 |
public boolean processMsg(CConnection cc) {
InStream is = cc.getInStream();
OutStream os = cc.getOutStream();
// Read the challenge & obtain the user's password
byte[] challenge = new byte[VNC_AUTH_CHALLENGE_SIZE];
is.readBytes(challenge, 0, VNC_AUTH_CHALLENGE_SIZE);
// JW: Launcher passes in p... | 6 |
public static String[] forgetPassword(String UserName) {
String strQuestion[] = new String[2];
String strList = FileHandle.readDataFile(strFile_User);
strList = strList.replace("<DairyRecord>", "");
strList = strList.replace("</DairyRecord>", "");
//String[] strLine = strList.split(System.getProperty(st... | 5 |
public void run() {
try {
in = new BufferedReader(new InputStreamReader(
socket.getInputStream()));
output = new DataOutputStream(socket.getOutputStream());
String line, path = root;
int method = 0;
while ((line = in.readLine()) != null) {
String temp = line.toUpperCase();
if (tem... | 8 |
private void update(int delta) {
rotation += 0.15f * delta;
if (Keyboard.isKeyDown(Keyboard.KEY_LEFT))
xpos -= 0.35f * delta;
if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
xpos += 0.35f * delta;
if (Keyboard.isKeyDown(Keyboard.KEY_UP))
ypos -= 0.35f * delta;
if (Keyboard.isKeyDown(Keyboard.KEY_DOWN))
... | 8 |
public final assignStatement assignStatement() throws RecognitionException {
assignStatement assignStatement = null;
Token ID20=null;
expression op1 =null;
expression op2 =null;
try {
// /Users/yefang/Documents/research/frontEndGen/test1/src/grammar1/Pi.g:90:58: ( ID ( '[' op1= expr ']' )* '=' op2= expr... | 7 |
public Display(final double s, final Chunk c) {
chunk = c;
scale = s;
setPreferredSize(getAssumedSize());
addMouseMotionListener(new MouseAdapter() {
@Override
public void mouseMoved(final MouseEvent e) {
final double scale = getScale();
final int x = (int) (... | 4 |
public static void main(String[] args) throws InterruptedException, ExecutionException {
final SynchronousQueue<Integer> queue = new SynchronousQueue<Integer>();
new Thread() {
@Override
public void run() {
try {
while (running) {
... | 2 |
@Override
public BufferedImage draw()
{
BufferedImage image = new BufferedImage(Chunk.getPixelLength(), Chunk.getPixelLength(), BufferedImage.TYPE_INT_ARGB);
Graphics2D gI = image.createGraphics();
return image;
} | 0 |
public void solveSudoku(char[][] board) {
boolean [][] rows = new boolean[9][9];
boolean [][] cols = new boolean[9][9];
boolean [][] cells = new boolean[9][9];
for(int i = 0; i < 9; ++i){
for(int j = 0; j < 9; ++j){
if(board[i][j] == '.') continue;
... | 3 |
public static void executeInstance(NanoHTTPD server) {
try {
server.start();
} catch (IOException ioe) {
System.err.println("Couldn't start server:\n" + ioe);
System.exit(-1);
}
System.out.println("Server started, Hit Enter to stop.\n");
try ... | 2 |
public boolean clearPathInDiagonalBetween(Field from, Field to) { // Is diagonal path between fields clear?
int fileAdjustment = from.file < to.file ? 1 : -1; // Move left or right
int rankAdjustment = from.rank < to.rank ? 1 : -1; // Move up or down
char file = (char) (from.file + fileAdjustment);
char rank = ... | 4 |
public TalkingFrame() {
frame = this;
this.setVisible(true);
this.setIconImage(new ImageIcon("images/logo.ico").getImage());
this.setLayout(new BorderLayout());
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
talkPanel = new JPanel();
talkPanel.setLayout(new FlowLa... | 9 |
public IndoorFaceControl(IndoorFace srcIndoorFace)
{
super();
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(new BevelBorder(BevelBorder.LOWERED));
this.indoorFace = srcIndoorFace;
CollapsablePanel.IndirectDataSource data1IndirectDataSource = new CollapsablePa... | 6 |
private void updateDisplay() {
StringBuilder txt = new StringBuilder();
for (Player p : game.getPlayers()) {
txt.append("Player ").append(p.getNum());
if (game.getCurrentPlayer().equals(p)) {
txt.append(" *");
}
txt.append("<br>");
txt.append("Money: ").append(p.getMoney()).append("<br>");
txt... | 3 |
@Override
public double getResult(Object[] object) {
double temp = ((Complex)object[1]).getRe();
double temp2 = ((Complex)object[1]).getIm();
return (Boolean)object[2] ? (temp > -bailout && temp < bailout || temp2 > -bailout && temp2 < bailout ? (Integer)object[0] + 100906 : -((Integer)obj... | 9 |
private void placeIdentityDiscs() {
while (getElementCoverage(IdentityDisc.class) < COVERAGE) {
final Position randomPos = getRandomPosition();
final IdentityDisc idDisc = new IdentityDisc(grid);
if (grid.validPosition(randomPos) && canHaveAsElement(randomPos, idDisc))
grid.addElementToPosition(idDisc, r... | 3 |
@Override
public String getColumnName(int columnIndex) {
switch (columnIndex) {
case 0:
return "Player";
case 1:
return "Status";
case 2:
return "Score";
}
return null;
} | 3 |
private void parsePrimitiveDef(){
PrimitiveDef def = new PrimitiveDef();
def.setType(Utils.createPrimitiveType(parts[2]));
int pinCount = Integer.parseInt(parts[3]);
int elementCount = Integer.parseInt(parts[4]);
ArrayList<PrimitiveDefPin> pins = new ArrayList<PrimitiveDefPin>(pinCount);
ArrayList<Element> ... | 9 |
private static String exec(String ...cmd)
{
try {
ProcessBuilder pb = new ProcessBuilder(cmd);
Process process = pb.start();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream stdout = process.getInputStream();
int readByte = std... | 3 |
public static void extract(File file, String outDir)
{
String result="";
String outFileName = null;
POITextExtractor extractor = null;
boolean filefound=false;
try {
FileInputStream fis = new FileInputStream(file.getAbsolutePath());
if (file.getName().toLowerCase().endsWith(".docx"))
{
... | 4 |
private void ArribaM() {
//Arriba
Punto temp = vibora.get(0);// La antigua Cabeza
Punto p = new Punto();
p.x = temp.x;
p.y = temp.y - 1;
if (validacion(p)) {
List<Punto> nueva = new ArrayList<Punto>();
nueva.add(p);
nueva.addAll(vibora);
if (!esComida(p))
nueva.remove(nueva.size() - 1);
... | 2 |
public void shoot(){
if(player.ammo > 0){
for(int i = 0; i < lasers.length; i++){
if(lasers[i] == null){
lasers[i] = new Laser(this,settings.shieldLaserColor, settings.laserSpeed,
player.getCenterPointX(), player.getCenterPointY() - 20,
Math.PI * 3, false, false,
settings.laserWidth,... | 3 |
public void SetWaitTime(int waitTime)
{
//set the wait time
this.waitTime = waitTime;
} | 0 |
private void printSubclasses(final Type classType, final PrintWriter out,
final boolean recurse, final int indent) {
final Iterator iter = this.subclasses(classType).iterator();
while (iter.hasNext()) {
final Type subclass = (Type) iter.next();
indent(out, indent);
out.println(subclass);
if (recurse)... | 2 |
private Object[] readOpenList() throws IOException {
ArrayList objects = new ArrayList();
int code;
while (true) {
try {
code = readNextCode();
} catch (EOFException e) {
code = Codes.END_COLLECTION;
}
if (code == Co... | 3 |
@Override
public void render(Graphics2D graphics) {
int startPointGridXCoordinate = 150;
int startPointGridYCoordinate = 20;
for (PlayerInfo p : objectTron.getPlayers()) {
Image cellToRender = cellFinishRed;
if (p.getPlayerNumber() == 2)
cellToRender = cellFinishBlue;
else if (p.getPlayerNumber... | 4 |
@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (args.length != 0) {
return false;
}
sender.sendMessage(plugin.getBroadcaster().styleMessage("Commands: "));
if (sender.hasPermission(HGPermission.ADMIN.toString())) {
sender.sendMessage("/hgadm... | 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://download.oracle.... | 6 |
@WebMethod(operationName = "ReadInvoiceIn")
public ArrayList<InvoiceIn> ReadInvoiceIn(@WebParam(name = "inv_in_id") String inv_in_id) {
InvoiceIn inv_in = new InvoiceIn();
ArrayList<InvoiceIn> inv_ins = new ArrayList<InvoiceIn>();
ArrayList<QueryCriteria> qc = new ArrayList<Quer... | 3 |
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
System.out.print("\n -------------------- MENU --------------------");
System.out.print("\n| |");
System.out.print("\n| 1 - Habitantes |");... | 6 |
@Override
public void mouseReleased(final MouseEvent e) {
if (this.draggedComponent != null) {
final Point p = e.getPoint();
final Set<Element> ignoreSelection = new HashSet<>();
ignoreSelection.add(this.draggedEdge);
final Element element = getGraphicPanel().... | 8 |
public int getSpeed() {
return speed;
} | 0 |
public void placeableDoneDestroying(Placeable p) {
Player player = p.getDestroyingPlayer();
gameController.stopGather(player);
if (player != null) {
if (gameController.playerAddItem(player, p.getItemName(), 1) == 0) {
p.destroy();
SoundClip cl = new ... | 5 |
private static Kind findKind(String lexeme) {
for (Kind kind : Kind.values()) {
if (kind.lexeme.equals(lexeme)) {
return kind;
}
}
return null;
} | 2 |
private Emision buscarEmision(List idEmisionTemporada){
Emision emi = null;
for (Emision emision : emisiones) {
if (emision.obtenerTVEmite().equals(idEmisionTemporada.get(0)) &&
emision.obtenerFechaPrevista() == idEmisionTemporada.get(1)) // Comprobar como se comparan fec... | 3 |
public static LedShape asciiToShape(int ascii) {
if(ascii >= 65 && ascii <= 90 || ascii >= 97 && ascii <= 122)
return charset[-65 + (ascii & ~(1 << 5))].clone();
if(ascii >= 48 && ascii <= 57)
return charset[-22 + ascii].clone();
return new LedShape(0,0, new LedRow(0));
} | 6 |
private void addItem(int numToAdd, ArrayList<Location> locations, boolean checkTargets)
{
Random rand = new Random(); //Random number generate to determine locations of spaces randomly
for(int i = 0; i < numToAdd; i++)
{
//Generate random location
Location newItem = new Location(rand.nextInt(MAX_X),rand.... | 9 |
public static Mask buildAnOtherMask(Direction d) {
switch (d) {
case HORIZONTAL:
double[][] dValues = { { 1, 1, -1 }, { 1, -2, -1 }, { 1, 1, -1 } };
return new Mask(dValues);
case VERTICAL:
double[][] aValues = { { 1, 1, 1 }, { 1, -2, 1 }, { -1, -1, -1 } };
return new Mask(aValues);
case DIAGONAL:
... | 4 |
private int esitaytaRivi(int rivinumero, int eiSaaJaadaTyhjaksi)
{
int tyhjaksiJatettava = -1;
do
tyhjaksiJatettava = satunnaisgeneraattori.nextInt((int)pelialue.alue().leveys() + 1) + (int)pelialue.alue().alkupiste().x();
while(tyhjaksiJatettava == eiSaaJaadaTyhjaksi);
... | 3 |
public static WaveData getWave(String pathToFile) {
File file;
if(Game.isRunningInIdea()) {
file = new File("src/main/resources/" + pathToFile);
}
else{
Console.log("outside IDE FOR WAVE");
file = new File(pathToFile);
}
byte[] bfile ... | 3 |
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 &&
... | 7 |
public void setType(int n) {
InputStreamReader isReader= new InputStreamReader(MyMenu.class.getClassLoader().getResourceAsStream(pathAttr));
try (BufferedReader reader = new BufferedReader(isReader)) {
String line = reader.readLine(); // read the first line containning the description of the column
whil... | 5 |
public void setEnvironmentFrame(EnvironmentFrame frame) {
myEnvFrame = frame;
} | 0 |
public void addFriend(User user) {
if (isFriend(user) == IS_FRIEND)
return;
try {
String statement = new String("INSERT INTO " + FriendDBTable
+ " (uid1, uid2)"
+ " VALUES (?, ?)");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
stmt.setInt(1, userID);
stmt.setInt... | 2 |
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent event) {
Block clickedBlock = event.getClickedBlock();
if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK)
&& clickedBlock.getType() == Material.WALL_SIGN
&& clickedBlock.getState() instanceof Sig... | 4 |
private static String prepare(LocalizationInfo info, Locale lang, boolean isDefaultLang) {
StringBuilder result = new StringBuilder();
result.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n");
result.append("<!-- " + GENERATOR_COMMENT + " -->\n\n");
result.append("<resources>\n");... | 8 |
protected JSONValue serialize( Object value )
{
if( value instanceof String )
{
return serializeJSONString((String)value);
} else if( value instanceof Number ) {
return serializeJSONNumber((Number)value);
} else if( value instanceof Boolean) {
return serializeJSONBoolean((Boolean)value... | 5 |
public void registerImportable(IImportable importable) throws StructureException {
if (this.parts.containsKey(importable.nameOf()))
throw new StructureException(String.format(
"Cannot register IImportable with the name %s: already exists!", importable.nameOf()));
parts.put(importable.nameOf(), importable);
... | 1 |
@SuppressWarnings("deprecation")
public Homework_current() {
initComponents();
try {
jEditorPane1.setPage("http://www.patana.ac.th/Gateway/eHomework.asp");
jEditorPane1.setMinimumSize(new Dimension(100, 16));
} catch (IOException ex) {
Logger.getLogger(Hom... | 1 |
private void selectChart() {
Object[] possibilities = {"Circolar", "Rectangular", "Linear"};
String s = (String)JOptionPane.showInputDialog(
getMainFrame(),
"Choose the chart type:\n",
"Chart Shape",
JOptionPan... | 7 |
public boolean hasNext() {
return (this.size() != 0);
} | 0 |
public int getIdPos(){
PhpposAppConfigEntity appConfig = getAppConfig("id_pos");
return Integer.parseInt(appConfig.getValue());
} | 0 |
public void setHireDay(int year, int month, int day)
{
Date newHireDay = new GregorianCalendar(year, month - 1, day).getTime();
// Example of instance field mutation
hireDay.setTime(newHireDay.getTime());
} | 0 |
private void process() {
boolean borderGeometryWas;
boolean lineGeometryWas;
boolean voronoiGeometryWas;
boolean flatGeometryWas;
boolean gcodeGeometryWas;
boolean wasTranslucent;
double toolDiameterWas;
long startTime = System.currentTimeMillis();
String processName = getClass().t... | 8 |
public EditorRightMenu(Editor editor, SkinPropertiesVO skinProps, Color background) {
this.editor = editor;
this.bg = background;
this.generalChangesMenu = new GeneralChangesMenu(this.bg, skinProps);
this.buttonChangesMenu = new ButtonChangesMenu(this.bg, skinProps);
this.userli... | 6 |
public void measure(long time) {
// sila ktora sa snazi odoslat spravu
if (player.state == RunState.running)
force = 1;
else
force = 0;
// spravy si udrzuju rozostupy
if ((prevM != null) && (prevM.position - position < defDist)) {
force -= Ma... | 7 |
public void tarjanSCC(int u) {
dfs_num[u] = dfs_low[u] = dfsNumberCounter++;
s.push(u);
visited[u] = true;
for (int i = 0; i < ady[u].size(); i++) {
int v = ady[u].get(i);
if (dfs_num[v] == -1)
tarjanSCC(v);
if (visited[v])
dfs_low[u] = Math.min(dfs_low[u], dfs_low[v]);
}
if (dfs... | 5 |
@EventHandler
public void receivePluginMessage( PluginMessageEvent event ) throws IOException, SQLException {
if ( event.isCancelled() ) {
return;
}
if ( !event.getTag().equalsIgnoreCase( "BSWarps" ) ) {
return;
}
if ( !( event.getSender() instanceof S... | 8 |
public DiceImage() {
setPreferredSize(new Dimension(32, 32));
try {
for(int i = 0; i < activeDiceImage.length; i++) {
activeDiceImage[i] = ImageIO.read(
new File(getClass().getResource("/storage/images/dice/" + (i + 1) + ".png").toURI()));
inactiveDiceImage[i] = ImageIO.read(
new File(getCla... | 3 |
public void onDisable() {
UVSave.save(vampires, (getDataFolder() + File.separator + "vampires.bin"));
saveConfig();
getLogger().info("UVampires v0.2 disabled!");
} | 0 |
@Override
public Rectangle getBounds() {
float x = position.x, y = position.y;
float width = getKeyFrame().getRegionWidth(), height = getKeyFrame().getRegionHeight();
bounds.x = x;
bounds.y = y;
bounds.width = width * scale.x;
bounds.height = height * scale.y;
switch (registration) {
case BOTTOM_CENTER:... | 7 |
public void testPlus_Minutes() {
Minutes test2 = Minutes.minutes(2);
Minutes test3 = Minutes.minutes(3);
Minutes result = test2.plus(test3);
assertEquals(2, test2.getMinutes());
assertEquals(3, test3.getMinutes());
assertEquals(5, result.getMinutes());
as... | 1 |
private RandomAccessFile getTmpBucket() {
try {
TempFile tempFile = tempFileManager.createTempFile();
return new RandomAccessFile(tempFile.getName(), "rw");
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
... | 1 |
public void testIsBefore_YM() {
YearMonth test1 = new YearMonth(2005, 6);
YearMonth test1a = new YearMonth(2005, 6);
assertEquals(false, test1.isBefore(test1a));
assertEquals(false, test1a.isBefore(test1));
assertEquals(false, test1.isBefore(test1));
assertEquals(false, t... | 1 |
@Override
public int compareTo(Edge e) {
return this.weight - e.getWeight();
} | 0 |
public void process() {
ArrayList<GroundItem> toRemove = new ArrayList<GroundItem>();
for (int j = 0; j < items.size(); j++) {
if (items.get(j) != null) {
GroundItem i = items.get(j);
if(i.hideTicks > 0) {
i.hideTicks--;
}
if(i.hideTicks == 1) { // item can now be seen by others
i.hi... | 7 |
private List<URI> getUrisInContext(RepositoryConnection connection, Resource context) throws RepositoryException {
List<URI> uris = new ArrayList<URI>();
// Get all triples in the context
RepositoryResult<Statement> statements = connection.getStatements(null, null, null, false, context);
... | 5 |
static void Algoritmo(MatingPool Pool, int Repeticiones)
{
while(Repeticiones > 0 && TieneSolucion)
{
ArrayList<Mochila> NuevaPoblacion = new ArrayList<>();
NuevosCandidatos.clear();
System.out.println("\nNUEVOS CANDIDATOS BASADOS EN EL P... | 8 |
public void placeGnome() {
try {
Graph country = graph;
if (graph2 != null) {
Object [] countryOptions = {graph.getName(), graph2.getName()};
String ans = (String) JOptionPane.showInputDialog(mapFrame, "To which country would you like to add a gnome?",
"Adding a gnome", JOptionPane.PLAIN_MESSAGE, ... | 9 |
public void buttonClicked(int ID)
{
switch (ID)
{
case 50:
updateCharClass();
break;
case 52:
updateThirdSkill();
break;
case 100:
game.beginGame(charClass, skill2, characterStr.count, characterDex.count, characterCon.count, characterInt.count, skill1control.count, skill2control.count, skill3c... | 5 |
private String useAtomVariables(String s, int frame) {
if (frame >= model.getTapePointer()) {
out(ScriptEvent.FAILED, "There is no such frame: " + frame + ". (Total frames: " + model.getTapePointer()
+ ".)");
return null;
}
int n = model.getAtomCount();
int lb = s.indexOf("%atom[");
int rb = s.inde... | 8 |
public static Suit valueOf(char c) {
switch (c) {
case 'S':
case 's':
return Spades;
case 'H':
case 'h':
return Hearts;
case 'D':
case 'd':
return Diamonds;
case 'C':
c... | 8 |
@Override
public void happens() {
// TODO: Change to ensure only explorers
ArrayList<Character> chars = Game.getInstance().getCharacters();
for(Character character: chars){
if(character.getCurrentRoom().getFloor() == Floor_Name.BASEMENT){
int rollResult = character.getTraitRoll(Trait.SANITY);
if((roll... | 5 |
public boolean[] arePasswordsInitialised() {
boolean[] arePasswordsInitialised = new boolean[4];
byte[] response = null;
try {
response = worker.getResponse(worker.select(DatabaseOfEF.MF.getFID()));
for (int i = 0; i < 4; i++) {
String binaryForm;
... | 3 |
public Block[][] createNewBoard() {
board = new Block[size][size];
Random r = new Random();
int start = 1;
int end = 18;
int numberOfTreasure = 3;
while (numberOfMines != 0 && numberOfTreasure != 0) {
for (int a = 0; a < size; a++) {
for (int b = 0; b < size; b++) {
int num = r.nextInt((en... | 9 |
public void spawn() {
Bubble bubble = (Bubble) getEntity();
if (bubble.type == BubbleType.Small) {
level.addEntityBack(bubble);
} else
if (bubble.type == BubbleType.Middle) {
if (new Random().nextBoolean()) {
level.addEntityPop(bubble);
... | 4 |
@Override
public String processCommand(String[] arguments)
throws SystemCommandException {
Election election = facade.getCurrentElection();
if (election == null)
throw new SystemCommandException("No current election set.");
String guid = facade.getCurrentUserGUID();
if (guid == null)
throw ne... | 5 |
public boolean currentlyPlacing() {
if (currentlyPlacing == null) {
return false;
}
return true;
} | 1 |
public static String fromUTF8ByteArray(byte[] bytes)
{
int i = 0;
int length = 0;
while (i < bytes.length)
{
length++;
if ((bytes[i] & 0xf0) == 0xf0)
{
// surrogate pair
length++;
i += 4;
... | 9 |
public TrayInteract( Controller ctrl, MainWindow main )
{
if (!SystemTray.isSupported())
{
// Tray not supported !
Logger.error("FATAL : Tray system not supported !");
System.exit(0);
}
this.ti_image = new ImageIcon("ressources/network.png")... | 4 |
@Override
public void render() {
super.render();
int indx = 0;
int offset = 0;
if(overflow() > 0) {
offset = overflow();
}
Iterator<String> it = inputHistory.iterator();
while(offset > 0) {
it.next();
offset--;
... | 3 |
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.