text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void clear()
{
try
{
prefs.clear();
} catch (Exception e)
{
}
} | 1 |
public static float base_score(boolean player, GameState gs) {
if (player) {
int resources = 0;
for (int i = 0; i < gs.getResourceTypes(); i++) {
resources += gs.getResources(i);
}
float score = resources*RESOURCE;
for(Unit u:gs.getMyUnits()) {
score += u... | 7 |
public RoomCell(int row, int col, String init) {
super(row, col);
if (init.length()==1){
doorDirection = DoorDirection.NONE;
}else{
room = false;
if(init.charAt(1)=='U'){doorDirection = DoorDirection.UP;
//System.out.println("Door direction is up " + row + " " + col);
} else if(init.charAt(1)=='D')... | 5 |
@Test
public void testGetMessageMultipleSubscribers() {
try {
int noOfSubscribers = 2;
final AtomicInteger msgCount = new AtomicInteger(0);
final String message = "TestMessage-testGetMessage_MultipleSubscribers";
final CountDownLatch gate = new CountDownLatch(noOfSubscribers);
final Message expected =... | 3 |
public static void main(String[] args) {
String filename = args[0];
String separator = args[1];
In in = new In(filename);
ST<String, Queue<String>> st = new ST<String, Queue<String>>();
ST<String, Queue<String>> ts = new ST<String, Queue<String>>();
while (in.hasNextLi... | 9 |
private void updateEnemyPositions() {
nextRow = 0;
for(int i = 0; i < enemys.length; i++) {
for(int j = 0; j < enemys[i].length; j++) {
if(!enemys[i][j].isAlive()) {
continue;
}
//Update all positions and if one reaches the bound the variable is set
nextRow |= enemys[i][j].move(ENEMY_MOVEMEN... | 7 |
private void WriteRemoteConf() throws RemoteException{
if(null == localConfPath || "" == localConfPath){
throw new RemoteException("local localConfPath is not correct.please set SetConfpathWithName()");
}
try {
if(!CanCommitFile()){
throw new RemoteException("the remote ... | 4 |
private void requestBidInfos(TACConnection conn) {
Bid bid;
int bidID;
try {
for (int i = 0; i < NO_AUCTIONS; i++) {
bid = bids[i];
if (bid != null && ((bidID = bid.getID()) != Bid.NO_ID)
&& !quotes[i].isAuctionClosed()) {
TACMessage msg = new TACMessage("bidInfo");
msg.setParameter("bidI... | 5 |
public Row cancelColumn(final int index,
final Row otherrow,
final BigInteger useModulus)
{
// special case: our col[index] is already zero:
if (this.isColumnZero(index))
{
return this;
... | 6 |
void enviarJugada(PartidaChip partida, InetAddress ip, int puerto) {
try {
Socket cli = new Socket(ip, puerto);
System.out.println("[]-->Enviando: " + partida.getMensaje() + " a "
+ ip);
ObjectOutputStream flujo_objetos = new ObjectOutputStream(
cli.getOutputStream());
flujo_objetos.writeObjec... | 1 |
int getSize(){
int size = 8;
if(value != 0)
{
cw.newUTF8("ConstantValue");
size += 8;
}
if((access & Opcodes.ACC_SYNTHETIC) != 0
&& (cw.version & 0xffff) < Opcodes.V1_5)
{
cw.newUTF8("Synthetic");
size += 6;
}
if((access & Opcodes.ACC_DEPRECATED) != 0)
{
cw.newUTF8("Deprecated");
size += 6... | 8 |
@Test
public void testRoomSetConstructorBadInput() {
try {
Room r2 = new Room(null); //null test
fail("IllegalArgumentException was expected");
}
catch (IllegalArgumentException e){
//exception expected
}
try {
Room r2 = new Room(s); //empty set test
fail("IllegalArgumentException was expected... | 2 |
void chooseAction(HttpServletRequest request, HttpServletResponse response,
HttpSession session, String query, ActionsController a)
throws ServletException, IOException, SQLException {
switch (request.getParameter("action")) {
case "details":
int postId = Integer.parseInt(request.getParameter("id"));
a... | 9 |
public static void main(String args[]){
GenericsType<String> g1 = new GenericsType<String>();
g1.set("Pankaj");
GenericsType<String> g2 = new GenericsType<String>();
g2.set("Pankaj");
GenericsType<Integer> g3 = new GenericsType<Integer>();
g3.set(10);
Generics... | 0 |
@Override
protected void setColoredExes() {
ParametricCurve ermit = new ErmitCurve(allex);
coloredEx = ermit.Calculation();
} | 0 |
public void link() {
synchronized (ui) {
if (parent.lchild != null)
parent.lchild.next = this;
if (parent.child == null)
parent.child = this;
this.prev = parent.lchild;
parent.lchild = this;
}
} | 2 |
public int getAnturium() {
return anturium;
} | 0 |
public String cd(String to) {
String name = FilenameUtils.concat(currentDirectory, to);
File file = new File(name);
if (file.exists() && file.isDirectory()) {
currentDirectory = name;
log.warn(name);
return null;
}
return "Directory not found";... | 2 |
public static void setupRace(int raceID) {
Player player = new Player();
switch (raceID) {
case 1:
player.setRace(RaceTypes.GOBLIN);
break;
case 2:
player.setRace(RaceTypes.ELF);
break;
case 3:
player.setRace(RaceTypes.DWARF);
break;
case 4:
player.setRace(RaceTypes.HUMAN);
bre... | 7 |
public static HashMap<String, MetadataTSVParser> getMap() throws Exception
{
HashMap<String, MetadataTSVParser> map = new LinkedHashMap<String, MetadataTSVParser>();
BufferedReader reader = new BufferedReader(new FileReader(new File(ConfigReader.getMbqcDir() +
File.separator + "metadata" + File.separator +... | 6 |
private void calcSize()
{
this.getSize().setWidth(this.ItemSize.getWidth() * this.DisplayItems);
this.getSize().setHeight(this.ItemSize.getHeight());
this.Matrix.clear();
for(int x = 0; x < this.DisplayItems; x++)
{
Rectangle rect = new Rectangle(x * this.getItem... | 1 |
public TerritoryAi(GoAiGame game1)
{
game = game1;
squares = new HashSet<Square>();
} | 0 |
@Test
public void testCheckValidWorld() throws Exception {
System.out.println("checkValidWorld");
World instance = new World();
instance.readInWorld("1.world");
boolean expResult = true;
boolean result = instance.checkValidWorld();
assertEquals(expResult, result);
... | 0 |
@Test
public void boardSize8KingAndRook() {
Map<String, Integer> figureQuantityMap = new HashMap<>();
figureQuantityMap.put(KING.toString(), 2);
figureQuantityMap.put(ROOK.toString(), 2);
int dimension = 8;
assertThat("all elements are not present on each board",
... | 6 |
public JsonMap getMap(String key) {
Object value = get(key);
if (value instanceof JsonMap) {
return (JsonMap) value;
}
return new JsonMap();
} | 1 |
@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (args.length == 1 && args[0].equalsIgnoreCase("help")) {
showHelp(sender);
return true;
}
if (args.length == 1 && args[0].equalsIgnoreCase("list")) ... | 6 |
private void removeDeadParticles() {
for (int particleIndex = 0; particleIndex < particleArray.length; particleIndex++) {
if (particleArray[particleIndex] != null) {
if (particleArray[particleIndex].isParticleAlive() == false) {
particleArray[particleIndex] = null... | 3 |
@Override
protected void placeWord(int row, int col) throws FillWordException {
if (row < 0 && col < 0 && swaps < swapLimit
&& (-row > board.length)) {
// Swap the word and deduct the points.
System.out.println("Grow board, discard word " + wordToPlay
... | 9 |
private static boolean validateBinaryInput(String input) {
int n = input.length();
for (int i = 0; i < n; i++)
if (input.charAt(i) != '0' && input.charAt(i) != '1')
return false;
return true;
} | 3 |
public Slot getCellContaining(GUIComponent component) {
for (int r = 0; r < grid.getNumRows(); r++) {
for (int c = 0; c < grid.getNumColumns(); c++) {
if (cells[r][c].getComponent() == component) {
return cells[r][c];
}
}
}
... | 3 |
public Color getColor() {
Color returnColor = new Color(255, 255, 255);
switch (this) {
case RED:
returnColor = Color.RED;
break;
case YELLOW:
returnColor = Color.YELLOW;
break;
case GREEN:
returnColor = Color.GREEN;
break;
case BLUE:
returnColor = Color.BLUE;
break;
d... | 4 |
public List<T> mapRersultSetToObject(ResultSet rset) throws SQLException, NoSuchColumnLabel {
List<T> output = new ArrayList<T>();
ResultSetMetaData rsmd = rset.getMetaData();
try {
while(rset.next()){
T bean;
bean = clazz.newInstance();
for( int i=rsmd.getColumnCount(); i >= 1; i-... | 4 |
@Override
public void mouseMove(MouseEvent e) {
if(this.getMouseListener() != null)
{
this.getMouseListener().MouseMove(this, e);
}
} | 1 |
@Override
public void run(){
try{
System.out.println("HireWorkerServer is waiting for new workers on the port: "+this.portNum);
while(running){
Socket workerSocket = serverSocket.accept();
System.out.println("worker: "+workerSocket.getInetAddress()+":... | 3 |
private void optFormat(final CommandLine cmd) {
if (cmd.hasOption(OPT_FORMAT)) {
final String formatOption = cmd.getOptionValue(OPT_FORMAT);
if ("tree".equalsIgnoreCase(formatOption)) {
options.setOutputFormat(OutputFormat.TREE);
} else if ("xml".equalsIgnore... | 6 |
private static void drawSink(Display d)
{
int max = 10;
int max_iter = 50;
/* Complex t = new Complex(0,0);
Color current = new Color(d,0,0,0);*/
int X = WIDTH/2;
int Y = HEIGHT/2;
for (int y = -Y; y < Y; ++y)
{
for (int x = -X; x < X; ++x)
{
Complex z = new Complex (x*0.005,y*0.005);
Com... | 5 |
public double getDouble(String key) throws JSONException {
Object object = this.get(key);
try {
return object instanceof Number ? ((Number) object).doubleValue()
: Double.parseDouble((String) object);
} catch (Exception e) {
throw new JSONException("JS... | 2 |
protected double[] freqCountsForAggNodesStrategy(double[] instance,
Attribute classAtt) throws Exception {
double[] counts = new double[classAtt.numValues()];
if (m_childNodes.size() > 0) {
// collect the counts
for (TreeNode c : m_childNodes) {
if (c.getPredica... | 7 |
public DisponibleAreas() {
setIconImage(Toolkit.getDefaultToolkit().getImage(DisponibleAreas.class.getResource("/InterfazGrafica/Images/areas.png")));
setTitle("\u00C1REAS DISPONIBLES");
setBounds(10, 50, 623, 741);
setLocationRelativeTo(null);
setModal(true);
getContentPane().setLayout(new BorderLayout());... | 0 |
public static Double getDouble(Object obj){
if(obj == null) return null;
try {
Double i = Double.parseDouble(obj.toString());
return i;
}
catch(Exception e){
return null;
}
} | 2 |
private List<Command> getMatchingCommands(String arg) {
List<Command> result = new ArrayList<Command>();
for (Entry<String, Command> entry : commands.entrySet()) {
if (arg.matches(entry.getKey())) {
result.add(entry.getValue());
}
}
return... | 2 |
@Override public int hashCode() {
int result;
long temp;
result = hitPoints;
result = 31 * result + pixelSpeed;
result = 31 * result + dmgToBase;
result = 31 * result + gold;
result = 31 * result + (alive ? 1 : 0);
result = 31 * result + (active ? 1 : 0);
result = 31 * result + (board != null ? board.hashCode(... | 4 |
@Override
public int compare(Fetcher f1, Fetcher f2) {
return f1.getRequestWrapper().getPriority()
- f2.getRequestWrapper().getPriority();
} | 0 |
public Configuration loadEmbeddedConfig(final String resource) {
final YamlConfiguration config = new YamlConfiguration();
final InputStream defaults = this.getResource(resource);
if (defaults == null) return config;
final InputStreamReader reader = new InputStreamReader(defaults, Custo... | 3 |
public void createCustomer(String name, String address, String postnr,
String by, String email, String nr)
{
if (name != null && address != null && postnr != null && by != null
&& email != null && nr != null)
{
Customer c = new Customer(name, address, postnr, ... | 6 |
public static boolean extractFile(File zip, File output, String fileName) throws IOException, InterruptedException {
if (!zip.exists() || fileName == null) {
return false;
}
ZipFile zipFile = null;
try {
zipFile = new ZipFile(zip);
ZipEntry entry = z... | 7 |
boolean anyResultMatches(String transcriptId, Variant seqChange, List<ChangeEffect> resultsList, boolean useSimple, StringBuilder resultsSoFar) {
boolean ok = false;
for (ChangeEffect chEff : resultsList) {
String resStr = chEff.toStringSimple(!useSimple);
if (verbose) System.out.println(seqChange + "\t'" + r... | 6 |
private void parseArguments(String[] args)
{
if (args.length > 0)
{
config.set("username", args[0]);
if (args.length > 1)
{
config.set("password", args[1]);
if (args.length > 2)
{
String ip = args... | 4 |
@Override
public List<Vehicule> getVehicules() throws BadResponseException {
List<Vehicule> vehicules = new ArrayList<Vehicule>();
JsonRepresentation representation = null;
// R�cup�ration de la liste des Vehicules
Representation repr = serv.getResource("intervention/" + interId
+ "/vehicule", null);
... | 2 |
private int checkBeatOutOfBounds(){
if (beat.getBounds().contains(0, BEAT_START_Y)){
return 0;
}
if (beat.getBounds().contains(WIDTH, BEAT_START_Y)){
return 1;
}
return 2;
} | 2 |
public void setPanel(AnalysePanel panelCurrent) {
if (this.panelCurrent != null)
center.remove(this.panelCurrent);
center.add(BorderLayout.CENTER, panelCurrent);
center.revalidate();
center.repaint();
this.panelCurrent = panelCurrent;
} | 1 |
public void compExecTime() {
double newExeTime;
double newCost;
dEval = 0;
dTime = 0;
dCost = 0;
for (int i = 0; i < iClass; i++) {
newExeTime = 0;
// System.out.print("Cost[" + i + "]");
for (int j = 0; j < iSite; j++) {
if (dmAlloc[i][j] != -1) {
if (dmAlloc[i][j] < 1) {
newExeTime... | 8 |
@Override
public boolean execute(final CommandSender sender, final String[] split) {
if (sender instanceof Player) {
if (MonsterIRC.getHandleManager().getPermissionsHandler() != null) {
if (!MonsterIRC.getHandleManager().getPermissionsHandler()
.hasCommand... | 6 |
public void visitLabelStmt(final LabelStmt stmt) {
if (stmt.label() != null) {
println(stmt.label());
}
} | 1 |
private Location findTarget()
{
Field field = getField();
List<Location> adjacent = field.adjacentLocations(getLocation());
Iterator<Location> it = adjacent.iterator();
while(it.hasNext()) {
Location where = it.next();
Object animal = field.getObjectAt(where);... | 7 |
public PosController() {
} | 0 |
private ArrayList<String> getWordsFromFile(String fileName) {
ArrayList<String> wordsList = new ArrayList<String>();
try {
BufferedReader rd = new BufferedReader(new FileReader(fileName));
while (true) {
String line = rd.readLine();
if (line == null) {
break;
}
wordsList.add(line... | 3 |
private boolean checkSelf() {
boolean isValid = true;
if (parent != null) {
if (!parent.isExistentInCli() && isExistentInCli()) {
selfErrorMessage +="Option " + getName() + " not allowed, "
+ "if option " + parent.getName() + " not present. ";
... | 9 |
@Override
protected void layoutPlotChildren() {
if (getData() == null) {
return;
}
for (int seriesIndex = 0; seriesIndex < getData().size(); seriesIndex++) {
XYChart.Series<Number, Number> series = getData().get(seriesIndex);
I... | 9 |
@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 Medicamentos)) {
return false;
}
Medicamentos other = (Medicamentos) object;
if ((this.idmedicamentos == null &... | 5 |
public void doDamage(LivingThing oo) {
double hpDamage;
double strengthDamage;
double intelligenceDamage;
double dexterityDamage;
double speedDamage;
double manaDamage;
double baseXpDamage;
double remainingHp;
double remainingStrength;
double remainingIntelligence;
double remainingDexterity;
dou... | 5 |
public static void main (String args[]) {
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e0) {
try {
UIMan... | 7 |
@Override
public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
super.update(container, game, delta);
if (alive) {
if (World.tickCount % 30 == 0) {
energyTick();
}
if (energy <= 0 ... | 7 |
public Object getValueAt(int row, int col) {
if(null == data)
return null;
if(col>=columnNames.length || col<0 || row<0)
return null;
return data[row][col];
} | 4 |
public boolean intersectCube(double minX, double minY, double minZ,
double maxX, double maxY, double maxZ) {
return this.minX < maxX && this.maxX > minX && this.minY < maxY
&& this.maxY > minY && this.minZ < maxZ && this.maxZ > minZ;
} | 5 |
private void parseConfLine(SBConfig conf, String str) {
// Parse the config line.
String delim = "[ ]";
String [] tokens = str.split(delim);
List<String> list = new ArrayList<String>();
for(String s : tokens) {
if(s != null && s.length() > 0) {
list.add(s);
}
}
... | 8 |
private static Class<?> findMainClass(Iterable<Class<?>> classes)
{
// find a public class with public static main method
for (Class<?> clazz : classes)
{
int modifiers = clazz.getModifiers();
if (Modifier.isPublic(modifiers))
{
Method mainMethod = findMainMethod(clazz);
if (mainMethod != null)
... | 9 |
public static HttpServletRequest listPatients(HttpServletRequest request) {
Models.DatabaseModel.Patient patient = new Models.DatabaseModel.Patient();
ArrayList<Models.DatabaseModel.Patient> patients = patient.listAllPatients();
for (Models.DatabaseModel.Patient thisPatient : patients) {
... | 1 |
public Team getTeam(){
if(this == RED) return Team.RED;
else if(this == BLUE) return Team.BLUE;
else if(this == NOTCHOSEN) return null;
else{
Random r = new Random();
if(r.nextBoolean()) return Team.RED;
return Team.BLUE;
}
} | 4 |
public String getCitedIDList(int queryid) {
String idList = "";
String query = "select distinct citationid from dblpcitation where indexid="
+ queryid + " order by citationid asc";
ResultSet rsSet = null;
rsSet = sqLconnection.Query(query);
try {
while (rsSet.next()) {
int id = rsSet.getInt("citati... | 2 |
protected CtClass createCtClass(String classname, boolean useCache) {
// accept "[L<class name>;" as a class name.
if (classname.charAt(0) == '[')
classname = Descriptor.toClassName(classname);
if (classname.endsWith("[]")) {
String base = classname.substring(0, classna... | 6 |
@Override
public void run() {
try {
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
out.println("Ingrese operacion (SUMAR, RESTAR, MULTIPLICAR, DIVIDIR)");
... | 6 |
@Override
public int compareTo (@SuppressWarnings("NullableProblems") JavaInfo o) {
if (o.major > major)
return -1;
if (o.major < major)
return 1;
if (o.minor > minor)
return -1;
if (o.minor < minor)
return 1;
if (o.revision > r... | 8 |
public List<List<Integer>> levelOrderBottom(TreeNode root) {
if (root == null)
return new ArrayList<>();
Queue<TreeNode> queue = new LinkedList<>();
Stack<ArrayList<Integer>> finalStack = new Stack<>();
queue.add(root);
int last = 1;
int current = 0;
... | 6 |
@Override
@RequestMapping(value = "/beers/{id}", method = RequestMethod.DELETE)
@ResponseBody
@Transactional
public BeerResponse delete(@PathVariable("id") Long id) {
Beer beer = persistenceService.delete(Beer.class, id);
return BeerResponse.createBeerResponse(beer);
} | 0 |
@Override
public void keyReleased(KeyEvent e)
{
//The code of the released Key
int key = e.getKeyCode();
//The direction
Direction direction = null;
//We check each keycode and relate a direction to it
if(key == e.VK_UP)
... | 5 |
private TreeSet<Connectable> recursiveDFS(Connectable damOrRiver, TreeSet<Connectable> completedIndexs, TreeSet<Connectable> tmpList){
if(completedIndexs.contains(damOrRiver)){
if(tmpList != null)
completedIndexs.addAll(tmpList);
return completedIndexs; // If it has already been solved, stop
}
if(damOrR... | 7 |
public double messageNode2Factor(int factor, int node, int value) {
double result = 1.0;
result *= messageFactor2Node(node, node, value);
if (factor == potentials.chainLength() + node && factor > potentials.chainLength() + 1) {
// right factor f' -> n -> f && this is not the second node
result *= messag... | 4 |
public void changedServerPswd(boolean psw_set){
togglePassword(psw_set);
if(psw_set){
// When password is first loaded set fake text
serv_pswd.setText("fake");
passChanged=false;
} else {
serv_pswd.setText("");
}
} | 1 |
public double getProportion(String oldUnit, String newUnit)
{
double result = 0;
double numerador = 0;
double denominador = 1;
if(oldUnit.equalsIgnoreCase("Hours"))
{
numerador = 1;
}
else if(oldUnit.equalsIgnoreCase("Days"))
{
numerador = 24;
}
else if(oldUnit.equalsIgnoreCase("Months"))
... | 8 |
private void packtiles(Collection<Tile> tiles, Coord tsz) {
int min = -1, minw = -1, minh = -1;
int nt = tiles.size();
for (int i = 1; i <= nt; i++) {
int w = Tex.nextp2(tsz.x * i);
int h;
if ((nt % i) == 0)
h = nt /... | 7 |
public void setCode(String code) {
this.code = code;
} | 0 |
private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) {
int rounds, i, j;
int cdata[] = (int[])bf_crypt_ciphertext.clone();
int clen = cdata.length;
byte ret[];
if (log_rounds < 4 || log_rounds > 31)
throw new IllegalArgumentException ("Bad number of rounds");
rounds = 1 << log_rounds;
... | 7 |
public boolean handleMaterialAcceleration(AxisAlignedBB par1AxisAlignedBB, Material par2Material, Entity par3Entity)
{
int var4 = MathHelper.floor_double(par1AxisAlignedBB.minX);
int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D);
int var6 = MathHelper.floor_double(par1AxisAli... | 8 |
@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 CleasingTagsHtml)) {
return false;
}
CleasingTagsHtml other = (CleasingTagsHtml) object;
if ((this.id == null &... | 5 |
private ParsedExpression parseShell(String shell) {
Assert.notNull(shell, "Shell must not be null");
Set<String> namedParameters = new HashSet<String>();
ParsedExpression parsedShell = new ParsedExpression(shell);
char[] shellChars = shell.toCharArray();
int namedParameterCount = 0;
// int unnamedParamete... | 7 |
public void actionPerformed(ActionEvent e) {
if (e.getSource() == display) {
} else if (e.getSource() == ok) {
this.setVisible(false);
this.dispose();
} else if (e.getSource() == resize) {
gridPanel.initFonts();
chineseExample.setFont(gridPanel.get... | 9 |
private float blockWeight(final Block block) {
int depth = cfg.loopDepth(block);
if (depth > RegisterAllocator.MAX_DEPTH) {
return RegisterAllocator.MAX_WEIGHT;
}
float w = 1.0F;
while (depth-- > 0) {
w *= RegisterAllocator.LOOP_FACTOR;
}
return w;
} | 2 |
private KmeansLogger()
throws LogException {
KmeansLogger.log= Logger.getLogger(KmeansLogger.class.getName());
FileHandler fh= null;
try {
fh = new FileHandler("LogKmeans " + new Date().toString());
KmeansLogger.log.addHandler(fh);
KmeansLogger.log.setUseParentHandlers(false);
} catch... | 3 |
private void drawMenu() {
if (interfaceNumber == 0) {
bufferGraphics.drawImage(imageMap.get("missionBackground"), 0, 0, this);
drawButtonsFromList(pathwayMissionButtons);
} else if (interfaceNumber == 11) {
bufferGraphics.drawImage(imageMap.get("chooseBackground"), 0, 0, this);
drawButtonsFromList(choos... | 4 |
public void update()
{
if (!blnLoaded)
{
return;
}
int x,
y,
i,
i2;
x=0;
y=0;
for (i=0; i<=numMapImages; i++)
{
gD_p.drawImage(imgMapPalette,
x*intImageSizePalette,y*intImageSizePalette,
(x+1)*intImageSizePalette,(y+1)*intImageSizePalette,
i*intImageSizePalette,0,
... | 8 |
protected Integer calcBPB_ReservedSecCnt() throws UnsupportedEncodingException {
byte[] bTemp = new byte[2];
for (int i = 14;i < 16; i++) {
bTemp[i-14] = imageBytes[i];
}
BPB_ReservedSecCnt = byteArrayToInt(bTemp);
System.out.println("Количество секторов в Reserved re... | 1 |
private boolean selectCommitMethod(Object obj,int reservID,int src,int tag)
{
boolean flag = true;
try
{
// A case where a reservation only has 1 Gridlet
Gridlet gridlet = (Gridlet) obj;
if (checkGridlet(gridlet))
{
( (ARPolicy)... | 7 |
public String getDateEmbauche() {
return dateEmbauche;
} | 0 |
@EventHandler
public void Nicks(AsyncPlayerChatEvent e) {
Player p = e.getPlayer();
String name = p.getName();
String nick = NicknamesConfig.getNicknames().getString(name);
// To avoid an NPE being thrown
if(nick != null) p.setDisplayName(nick + ChatColor.RESET);
} | 1 |
private void drawSolutionProgress(Graphics2D g2)
{
if (numSolutions == 0)
{
return;
}
//System.err.println("---- " + currentHelp1Counter + " / " + numSolutions);
if (HelpParadigm.Classic.equals(slateComponent.getSlateSettings().getHelpParadigm()))
{
// Draw circular progress of number of soluti... | 7 |
public void setName(String name) {
this.name = name;
} | 0 |
public SubgroupPanel() {
super();
setCellRenderer(new SymmetryListCellRenderer());
setSelectionBackground(SymmetryChooser.SelectionBackground);
setBackground(Color.WHITE);
addListSelectionListener(new ListSelectionListener() {
@SuppressWarnings("unchecked")
@Override
public voi... | 5 |
public void enterLoop() {
_mainFrame.dispose();
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
while(true) {
try {
if(r.ready()) {
String s = r.readLine();
if(s.equals("exit")) {
_server.kill();
System.out.println("Good Bye");
System.exit(0);
} els... | 8 |
private String safe (String src) {
StringBuffer sb = new StringBuffer ();
for (int i = 0; i < src.length (); i++) {
char c = src.charAt (i);
if (c >= 32 && c < 128) {
sb.append (c);
} else {
sb.append ("<" + (int) c + ">");
... | 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.