text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS... | 8 |
public String getFamilienaam() {
return familienaam;
} | 0 |
public ArrayList<String> gameInventory(){
ArrayList<String> gameInv = new ArrayList<String>();
String space =" ";
for(Player p: allLivingPlayers()){
gameInv.add(("* " + p.playerTag + " *").concat(space.substring(p.playerTag.length() + 4)));
for(Card c: p.inventory){
gameInv.add(c.nam... | 9 |
@Override
protected int onReadPacketHeader( ByteBuffer in )
{
if (in.remaining() < HEADER_SIZE)
{
return ON_READ_REWIND;
}
int magicNumber = in.getInt();
if (magicNumber != protocol.getMagicNumber())
{
return ON_READ_CLOSE;
... | 3 |
public int resistedCounter(Type primary, Type secondary) {
int counter = 0;
if (resistantTypes == null || resistantTypes.length ==0)
{
return 0;
}
for (int i = 0; i < resistantTypes.length; i++) {
if (resistantTypes[i].equalsTo(primary.showType()) || resis... | 5 |
private static void update(double time) {
if (Input.getKeyDown(Keyboard.KEY_ESCAPE)) {
switch (getGameState()) {
case DEAD:
break;
case LOADING:
break;
case MAIN_MENU:
break;
case PAUSED:
setGameState(GameState.PLAYING);
break;
case PLAYING:
setGameState(GameState.PAUSED);
... | 7 |
@Override
public void doAction(Player player, Grid grid) throws InvalidActionException {
if (player.getRemainingTurns() <= 0)
throw new InvalidActionException("The player has no turns left!");
Position currentPos = player.getPosition();
Position newPos = new Position(currentPos.getxCoordinate() + 1, curren... | 3 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(!super.tick(ticking,tickID))
return false;
if(affected==null)
return false;
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
MOB diseaser=invoker;
if(diseaser==null)
diseaser=mob;
if((!mob.amDead())&&((... | 8 |
public String toShowData(String rs)
{
String[] arr = rs.split(DMSHandler.SEPCHAR);
int len = arr.length;
String show = "";
--len;
for (int i = 0; i <= len; i++)
{
if (this.dimensions.get(i).equals(ADFormat.CITYNAME))
{
show += this.getCity(arr[i]);
}
else if (this.dimensions.get(i).equals(... | 8 |
private void insertSQLiteData() {
if (m_sqlTable == null) {
return;
}
SQLiteTestData data = new SQLiteTestData();
data.id = 0;
data.name = "SAM";
data.time = System.currentTimeMillis();
SQLiteTestData data1 = new SQLiteTestData();
data1.id = 1;
data1.name = "JAMES";
data1.time = System.curr... | 4 |
@Override
public int[] makeMove(final char[][] field) {
int[] move = new int[2];
String cellCode = input.next();
if (cellCode.equals("back")) {
move[0] = Player.CODE_TAKE_STEP_BACK;
} else if (cellCode.equals("exit")) {
move[0] = Player.CODE_EXIT;
} ... | 3 |
public static void main(String[] args) {
for (Tester test : tests) {
test.runTest();
}
} | 1 |
void init() throws IOException {
if(!initialized) {
char c1 = (char) super.read();
char c2 = (char) super.read();
char c3 = (char) super.read();
int v = super.read();
if(c1 != 'S' || c2 != 'N' || c3 != 'Z') {
throw new FormatViolationException("Illegal prefix in SNZ stream");
}
if(v != 1) {
... | 5 |
@Override
public void setPage(HelpViewer viewer) {
if(isDirectory){
String header = "<html><body><ul>";
String footer = "</ul></body></html>";
StringBuffer content = new StringBuffer();
File[] children = base.listFiles();
if((children != null)&&(children.length>0)){
for(int i=0;i<children.length;+... | 7 |
public int getIntCode(String key) {
if (key == "up") return up;
else if (key == "right") return right;
else if (key == "left") return left;
else if (key == "down") return down;
else if (key == "jump") return jump;
else return 0;
} | 5 |
private static File syncAssets(File assetDir, String indexName) throws JsonSyntaxException, JsonIOException, IOException {
Logger.logInfo("Syncing Assets:");
final File objects = new File(assetDir, "objects");
AssetIndex index = JsonFactory.loadAssetIndex(new File(assetDir, "indexes/{INDEX}.json... | 7 |
public void switchEtatBouttons(){
Carte carte1, carte2;
int val;
//Affiche ou efface le boutton Assurance
carte1 = d.main.getCarteDansMain(0);
if(carte1.getValeur() == 1 && choixAssurance == false && propAssurance == false){
boutonAssurance.... | 7 |
@Override
public void mouseReleased(MouseEvent e) {
int x = e.getX();
int y = e.getY();
if (x >= this.x && y >= this.y && x <= this.x + this.width && y <= this.y + this.height)
setState(ButtonState.HOVER);
else
setState(ButtonState.NORMAL);
} | 4 |
public boolean isEnabled()
{
return comp.isEnabled()
&& comp.getSelectedText()!=null;
} | 1 |
public void insertString(int i, String s, AttributeSet attributeset)
throws BadLocationException {
if (s == null || "".equals(s))
return;
String s1 = getText(0, i);
String s2 = getMatch(s1 + s);
int j = (i + s.length()) - 1;
if (isStrict && s2 == null) {
s2 = getMatch(s1);
j--;
} else ... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DateTime other = (DateTime) obj;
if (am != other.am)
return false;
if (day != other.day)
return false;
if (hour != other.hour)
retur... | 9 |
private void Initialize() {
//random int to use when setting the car
random = new Random();
//this is also used to restart the game, but it does the same thing
ResetPlayer();
//used for control
speedAccelerating = 2;
speedStopping = 1;
//used for "cross... | 0 |
private Class getPrimativeClass(Object obj)
{
if (obj instanceof XPath)
return XPath.class;
Class cl = obj.getClass();
if (cl == Double.class)
{
cl = double.class;
}
if (cl == Float.class)
{
cl = float.class;
}
else if (cl == Boolean.class)
{
cl = bo... | 9 |
private Monopoly(Loader loader) {
go = loader.getGo();
jail = loader.getJail();
playerHashMap = loader.getPlayerHashMap();
serverOperator = new ServerOperator(this, loader);
actions = new HashMap<Integer, HashMap<String, ActionThread>>();
//The thread will set the next player as active and will then wait f... | 6 |
public static boolean isDefined(String domain, String key)
{
if ( !config.containsKey(domain) )
return false;
if ( !config.get(domain).containsKey(key) )
return false;
return true;
} | 2 |
private void endFormals() {
if (seenFormalParameter) {
declaration.append('>');
seenFormalParameter = false;
}
} | 1 |
public void draw1(Graphics2D g2){
g2.setStroke(new BasicStroke(10f));
// int n = 20;
// if(n > particles.size()) n = particles.size();
for(int i = 0; i < particles.size(); i++){
int n = particles.size() - particles.get(i).age/50;
for(int j = 1; j < n; j++){
int k = (j+i) % particles.size();
g2.setCo... | 4 |
public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException {
subExpressions[0].dumpExpression(writer, 550);
writer.breakOp();
writer.print(" <=>");
if (allowsNaN)
writer.print(greaterOnNaN ? "g" : "l");
writer.print(" ");
subExpressions[1].dumpExpression(writer, 551);
} | 2 |
public void save() {
JSONObject json = toJson();
try {
File file = new File("rounds/" + System.currentTimeMillis() + ".json");
FileWriter fw = new FileWriter(file.getAbsolutePath());
fw.write(json.toString());
fw.close();
} catch (IOException ex) {
... | 1 |
@Override
public void run() {
while (!socket.isClosed()) {
DatagramPacket p = new DatagramPacket(new byte[10], 10);
try {
socket.receive(p);
}
catch (IOException e) {
continue;
}
Message m = new Message(... | 8 |
public boolean intersects(S2Loop b) {
// a->Intersects(b) if and only if !a->Complement()->Contains(b).
// This code is similar to Contains(), but is optimized for the case
// where both loops enclose less than half of the sphere.
if (!bound.intersects(b.getRectBound())) {
return false;
}
... | 8 |
public String getLabel() {
if (label == null)
label = "flow_" + addr + "_" + (serialno++) + "_";
return label;
} | 1 |
private void blitToComponent(Graphics gScreen) {
if (m_offscreen == null)
return;
do {
int returnCode = m_offscreen.validate(getGraphicsConfiguration());
if (returnCode == VolatileImage.IMAGE_RESTORED) {
// Contents need to be restored
renderOffscreen(); // restore contents
} else if (returnCod... | 4 |
@Override
public Value evaluate(Value... arguments) throws Exception {
// Check the number of argument
if (arguments.length == 1) {
// get Value
Value value = arguments[0];
// If numerical
if (value.getType().isNumeric()) {
return new Value(new Double(Math.tan(value.getDouble())));
}
if (val... | 4 |
public KeyState getMainState(){
return mainState;
} | 0 |
@Override
public void mouseClicked(MouseEvent e)
{
int x = e.getX();
int y = e.getY();
int oldSel = selectedObject;
for (NSMBObject obj : objects)
{
Rectangle or = getRectFor(obj);
if (or.contains(x, y))
... | 4 |
public static Stella_Object accessAbstractPropositionsIteratorSlotValue(AbstractPropositionsIterator self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Logic.SYM_LOGIC_SELECTION_PATTERN) {
if (setvalueP) {
self.selectionPattern = ((Cons)(value));
}
else {
... | 6 |
public static Sprite loadSprite(String url, int width, int height) {
File file = new File("res\\" + url);
Sprite sprite;
try {
sprite = new Sprite(ImageIO.read(new File("res\\" + url)), width, height);
System.out.println("Loaded: " + file.getAbsolutePath());
} catch (IOException e) {
sprite = Sprite.pl... | 1 |
public Music() {
try {
AudioInputStream audioIn = AudioSystem
.getAudioInputStream(new File("music/theme.wav"));
data = AudioSystem.getClip();
data.open(audioIn);
data.loop(Clip.LOOP_CONTINUOUSLY);
} catch(LineUnavailableException e) {
e.printStackTrace();
} catch(UnsupportedAudioFileException... | 3 |
public final void changeWait(int wait)
throws ArtistBiographyException {
if(wait < 100 || wait > 20000)
throw new ArtistBiographyException("The wait vale is not correct");
ArtistBiography.wait= wait;
} | 2 |
public int hashCode() {
int hash = 7;
hash = 73 * hash + (this.groupRule != null ? this.groupRule.hashCode() : 0);
hash = 73 * hash + (this.artifactRule != null ? this.artifactRule.hashCode() : 0);
hash = 73 * hash + (this.typeRule != null ? this.typeRule.hashCode() : 0);
hash = ... | 6 |
@EventHandler
public void onPressurePlateStep(PlayerInteractEvent e)
{
if (HyperPVP.getSpectators().containsKey(e.getPlayer().getName()) || HyperPVP.isCycling() || !HyperPVP.hasMatchBeenAnnounced()) {
if (e.getAction().equals(Action.PHYSICAL) && e.getClickedBlock().getType() == Material.STONE_PLATE) {
e.setC... | 8 |
public TurnOffCommand(Receiver receiver) {
this.receiver = receiver;
} | 0 |
private void rehashTable() {
if (keys == null) {
if (check && keyCount != 0) Kit.codeBug();
if (check && occupiedCount != 0) Kit.codeBug();
int N = 1 << power;
keys = new Object[N];
values = new int[2 * N];
}
else {
// Check... | 9 |
public static String CatchTitle(int n) {
InputStreamReader isReader= new InputStreamReader(MyMenu.class.getClassLoader().getResourceAsStream(path));
String title = null;
try (BufferedReader reader = new BufferedReader(isReader)) {
String line = reader.readLine(); // read the first line containing the descri... | 3 |
private boolean jj_2_71(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_71(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(70, xla); }
} | 1 |
public static double[] decode_exactly (String geohash){
double[] lat_interval = {-90.0 , 90.0};
double[] lon_interval = {-180.0, 180.0};
double lat_err = 90.0;
double lon_err = 180.0;
boolean is_even = true;
int sz = geohash.length();
int bsz = bits.length;
double latitude, longitude;
for (int i =... | 6 |
private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 56
replab0: while (true) {
v_1 = cursor;
lab1: do {
// (, line 56
// [, line 58
bra = cursor;
// substring, line 58
among_var = find_among(a_0, 3);
if (among_var == 0) {
break lab1;
}
// ], line 58
... | 8 |
PresenterFactory discover() {
Iterable<PresenterFactory> discoveredFactories = PresenterFactory.discover();
List<PresenterFactory> factories = StreamSupport.stream(discoveredFactories.spliterator(), false).
collect(Collectors.toList());
if (factories.isEmpty()) {
retu... | 2 |
private void btnReporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReporteActionPerformed
final int totalFilas = this.table_ticket.getRowCount();
if (totalFilas > 0) {
this.progress_bar.setVisible(true);
this.setCursor(Cursor.getPredefinedCursor(Cursor.... | 3 |
public String read(String fileName){
String data = "";
String line;
try {
BufferedReader reader = new BufferedReader(new FileReader(fileName));
while((line=reader.readLine())!=null){
data+=line;
}
} catch (FileNotFoundException e) {
this.plugin.logMessage("Unable to read from "+fileName+": "+e.... | 3 |
public void populateSongLists()
{
if(!playerLibrary.isEmpty()) {
titlesList.setListData(playerLibrary.getAllTitles().toArray());
artistList.setListData(playerLibrary.getAllArtists().toArray());
}
else {
titlesList.setListData(defaultList);
arti... | 1 |
public static Vector<Place> getPlacesDisponiblesFromZone (String numS, String date, int zone) throws BDException {
Vector<Place> res = new Vector<Place>();
String requete = "select norang, noplace, numZ from lesplaces where numz=" + zone + " MINUS select lestickets.norang, lestickets.noplace, numz from LesTickets, ... | 2 |
public GeocoderResponse parse(InputStream inputStream) throws IOException {
YaGeocoderHandler handler = new YaGeocoderHandler();
try {
parser.parse(inputStream, handler);
} catch (Exception e) {
throw new IOException("Failed to parse geocoder result: " + e.toString(), e);... | 1 |
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 |
@Override
public void onEnable () {
if(getConfig().getConfigurationSection("playerFreqs") != null){
Map<String, Object> configmap = getConfig().getConfigurationSection("playerFreqs").getValues(false);
for(Entry<String, Object> entry : configmap.entrySet()){
Double val = (Double)entry.getValue();
RadioPl... | 8 |
public void infinteLoop()
{
boolean quit = false;
ui.hello();
do
{
UserChoice userChoice = ui.userChoiceMenu();
switch(userChoice)
{
case ADDCARD: addCard(); break;
case MODIFYCARD: modifyCard(); break;
case DELCARD: delCard(); break;
case DISPLAYCARD: displayCard(); break;
case D... | 9 |
public void keyTyped(KeyEvent arg0) {
if (arg0.getKeyChar() == 's') {
panel_1.moveDown();
}
if (arg0.getKeyChar() == 'w') {
panel_1.moveUp();
}
if (arg0.getKeyChar() == 'a') {
panel_1.moveLeft();
}
if (arg0.getKeyChar() == 'd') {
panel_1.moveRight();
}
} | 4 |
private void parseData(String content, List<String>[] alldata) throws ExcelException {
boolean flag = false;
Matcher m = REG_AMT_WM_PT.matcher(content);
if (m.find()) {
String cur = m.group(1);
if (Constants.QUOTEBILL_CUR_AUD.equals(cur)) {
alldata[0].add(... | 7 |
private void deleteMail(int n) {
String response = "";
try {
sTrace.debug("Try DELE " + n + " Command");
writeToServer("DELE " + n);
response = readFromServer();
if (response.startsWith("-ERR")) {
sTrace.error("Could not delete Mail " + n);
} else if(response.startsWith("+OK")){
sTrace.debug(... | 3 |
public void handleCommand(Message message) {
if(!conn.conected()) return;
String body = message.getBody();
if(body.startsWith(prefix)){
body = body.substring(prefix.length());
}else{ //(message.getBody().startsWith(connection.getNick()){
body = body.substring(conn.getNick().length());
if(body.matches(... | 9 |
public boolean isKeyDown(int keyCode) {
if (keyCode > 0 && keyCode < 256) {
return keys [keyCode];
}
return false;
} | 2 |
public int getPrivs(Transaction trans, String username) throws SQLException, DatabaseException {
trans=new JDBCTransaction(createConnection());
Connection connection = ((JDBCTransaction)trans).getConnection();
Statement stmt=connection.createStatement();
int x = 0;
if(!validString(username))
throw ... | 7 |
public static List<Utterance> loadUtterances(String path) {
List<Utterance> goldUtterances = new LinkedList<Utterance>();
Scanner input = null;
try {
System.out.println("Loading utterances from " + path + " ...");
input = new Scanner(new File(path));
goldUtterances = new LinkedList<Utterance>();
// P... | 5 |
private Rectangle getRectangle(int x, int y, int w, int h, int location) {
switch (location) {
case SwingConstants.NORTH:
return new Rectangle(x + w / 2 - dist / 2, y, dist, dist);
case SwingConstants.SOUTH:
return new Rectangle(x + w / 2 - dist / 2, y + h - dist, dist, dist);
case SwingConstants.WE... | 8 |
public boolean healDebuffed(Player p){
int modifier = 0;
if(!healReduxImmune(p)){
if(p.status.containsKey(Card.carrionfeast)){
modifier -= 1;
}
if(p.status.containsKey(Card.wounded)){
modifier -= 1;
}
if(hallowHarm(p)){
for(Player player: allPlayersInArea(locationArea(p.location))){
... | 9 |
public static void main(String[] args) {
WordReader wordReader = new WordReader("dict.txt");
System.out.println(wordReader.getDictionary());
} | 0 |
private static int getMetaFromString(String idMeta) {
String data;
if(idMeta.contains(":")) {
String[] s = idMeta.split(":");
if(s.length < 2) {
data = idMeta.replace(":", "");
} else {
data = s[1];
}
} else {
... | 2 |
@Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
firstCharacterId = buf.readInt();
firstCharacterCurrentWeight = buf.readInt();
if (firstCharacterCurrentWeight < 0)
throw new RuntimeException("Forbidden value on firstCharacterCurrentWeight = " + fir... | 4 |
@EventHandler
public void onEntityInteract(PlayerInteractEntityEvent event) {
if (event.getRightClicked() instanceof StorageMinecart) {
Player player = event.getPlayer();
String playerName = player.getName();
if (Configuration.data.contains(playerName) && (Configuration.config.getBoolean("Deny Storage.e... | 9 |
public void showLine (ListElement line)
{
ListElement e = TopLine;
int h = Leading + Ascent;
int totalh = getSize().height - Descent;
if (Background == null) Background = getBackground();
int lines = 0;
while (lines < PageSize && e != null)
{
if (e == line) return;
h += Leading + Height;
e = e.n... | 6 |
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.ora... | 6 |
public Object saveOps() {
Stack state = new Stack();
int pos = currentLine.length();
while (currentBP.parentBP != null) {
state.push(new Integer(currentBP.breakPenalty));
/* We don't want parentheses or unconventional line breaking */
currentBP.options = DONT_BREAK;
currentBP.endPos = pos;
currentB... | 1 |
public String getRandCode() {
return randCode;
} | 0 |
public static String getColorFromMagnitudeAndPhase(final double magnitude, final double phase) {
if (magnitude <= 1D / Const.MAX_RGB) { return Const.BLACK; }
final double mag = Math.min(1D, magnitude);
final double pha = (phase < 0D) ? phase + Const.TAU : phase;
final double p = (pha * 6... | 8 |
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... | 5 |
public void updateAll(){
update();
for (GameObject child: children){
child.updateAll();
}
} | 1 |
@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 SiteBoundary)) {
return false;
}
SiteBoundary other = (SiteBoundary) object;
if ((this.featureID == null && oth... | 5 |
@SuppressWarnings("serial")
ControlPanel(Model model, ModelControl mc, AnimationControl ac) {
super(true);
this.mControl = mc;
this.aControl = ac;
stateField.setText(State.STOP.getText());
model.addStateChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
... | 6 |
public JSlider setSlider(JPanel panel, int orientation, int minimumValue,
int maximumValue, int initValue, int majorTickSpacing,
int minorTickSpacing) {
JSlider slider = new JSlider(orientation, minimumValue, maximumValue,
initValue);
... | 9 |
public <T extends Comparable<? super T>> int search(T[] array, T key) {
if (array == null)
throw new NullPointerException("argument array is null");
if (key == null)
throw new NullPointerException("argument key is null");
// Make sure every element is not null.
f... | 9 |
public View() {
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth = (int) dim.getWidth() / 2;
int screenHeight = (int) dim.getHeight() / 2;
setLocation(screenWidth/2, screenHeight/2);
container = this.getContentPane();
se... | 0 |
private void preloadCountryHistory() {
GenericObject hist;
String tag;
final GenericObject countries =
EUGFileIO.load(resolver.resolveFilename("common/countries.txt"), settings);
for (ObjectVariable def : countries.values) {
tag = def.varname... | 4 |
private static char[] getReplacementChars(char ch) {
char[] replacement = null;
if (ch == '"') {
replacement = QUOT_CHARS;
} else if (ch == '\\') {
replacement = BS_CHARS;
} else if (ch == '\n') {
replacement = LF_CHARS;
} else if (ch == '\r') {
replacement = CR_CHARS;
} else if (ch == '\t') {
... | 9 |
private void reduceHighestTrack(){
int[] highTrack=null;
int position=0;
//calcul the highest track
while(highTrack==null){
if(model.getThrone()[position]==family.getPlayer()){
highTrack=model.getThrone();
}else if (model.getCourt()[position]==family.getPlayer()){
highTrack=model.getCourt();
}e... | 6 |
public static void saveGame() {
try {
File save = new File(CFG.DIR, "saves/" + new SimpleDateFormat("'Spielstand' dd.MM.yyyy HH-mm-ss").format(new Date()) + ".save");
save.createNewFile();
JSONObject o = new JSONObject();
o.put("version", CFG.VERSION);
o.put("created", Game.currentGame.worldCre... | 4 |
public void setHeightWidthStartPosition(String height,String width,String startPosDescriptor) {
this.height=Integer.parseInt(height);
this.width=Integer.parseInt(width);
int p1=startPosDescriptor.indexOf(',');
int p2=startPosDescriptor.indexOf(',',p1+1);
... | 8 |
@Test
public void tenProcessos() {
SoSimProcess[] processes = new SoSimProcess[]{ new SoSimProcess(PcbColor.GRAY,1),
new SoSimProcess(PcbColor.GRAY,1),
new SoSimProcess(PcbColor.GRAY,1),
new SoSimProcess(PcbColor.GRAY,1),
new SoSimProcess(PcbColor.GRAY,1),
... | 3 |
public static void main(String [] args) {
//new MessageShower("Hello java!").showStars();
// MessageShower messageShower = new StarMessageShower("Hello hello Java!");
// messageShower.show();
StringListener stringListener = new StringListener();
showMessage(new NumberMessageShower... | 0 |
@Override
public Geometry getGeometry() {
if(geometry!=null){
return geometry;
}
render();
GeometryFactory gf = Helper.getGeometryFactory();
Geometry[] geometries = new Geometry[textPath.getNumberOfChars()];
LinkedList<Point> characterCentroids = new LinkedList<Point>();
for(int charnum=0; charnum<tex... | 6 |
@Override
public void writeTo(WordWriter out)
throws IOException {
int opword = opcode.getCode();
if(opcode.isBasic()) {
opword |= (valueA.evaluate() << 4) | (valueB.evaluate() << 10);
} else {
opword |= (valueA.evaluate() << 10);
}
out.writeW... | 4 |
public void invert() {
invertedBevoreMoves = 0;
List<SchlangenGlied> glieder = new ArrayList<SchlangenGlied>();
addAllGlieder(glieder);
while (glieder.size() > 1) {
SchlangenGlied firstGlied = glieder.get(0);
SchlangenGlied lastGlied = glieder.get(glieder.size() - 1);
Point tmpLocation = firstG... | 1 |
public void paint(Graphics g) {
g.drawString("MissileNum:" + Integer.toString(mls.size()), 50, 50);
g.drawString("Tanks Num:" + Integer.toString(tkEnemys.size()), 50, 70);
g.drawString("Bombs Num:" + Integer.toString(bombs.size()), 50, 90);
tk.draw(g);
for(int i=0; i<tkEnemys.size(); i++) {
tkEnemys.get(... | 4 |
private static Device getDevice (String portId)
throws IOException
{
try {
Device dev = HostFactory.getHost ().getDevice (portId);
if (isFX2 (dev))
return dev;
} catch (IllegalArgumentException e) {
}
System.err.println ("no such FX2 device: " + portId);
return null;
} | 2 |
public Worker getAvailableByActivityAndStatus ( int activityId , String status ) {
Connection con = null;
PreparedStatement statement = null;
ResultSet rs = null;
Worker worker = null;
try {
con = ConnectionManager.getConnection();
String searchQuery = "SELECT workers.id, workers.status, w... | 8 |
@Before
public void setUp() throws IOException {
outputStream = new ByteArrayOutputStream();
world4x4 = worldFactory.createWorld(cells4x4);
StringBuilder expected = new StringBuilder("");
for (int i = 0; i < world4x4.getWidth(); i++) {
for (int j = 0; j < world4x4.getHeight(); j++) {
expected.append(cel... | 4 |
@SuppressWarnings("unchecked")
private JPanel createPlaySelectPanel() {
JPanel productionNamePanel = new JPanel();
double size[][] = { { TableLayout.PREFERRED, 20, TableLayout.PREFERRED }, { 30, 30 } };
TableLayout layout = new TableLayout(size);
productionNamePanel.setLayout(layout);
productionNamePanel.ad... | 6 |
public BoardGameItem(Board board, Controller controller) {
super();
for(int i=0;i<4;i++) {
for(int j=0;j<4;j++) {
CaseItem b = new CaseItem(board.getCase(i,j));
board.getCase(i,j).addObserver(b);
b.addActionListener(controller);
cases.add(b);
b.setPreferredSize(new Dimension(ViewConstan... | 5 |
public void searchPacientebyProntuario() {
facesContext = FacesContext.getCurrentInstance();
requestContext = RequestContext.getCurrentInstance();
try {
listProntuario = genericDAO.searchObject(Prontuario.class,"prontuario",null, null,
new String[]{"cliente", "unidade", "pro... | 4 |
public int getDPadY() {
int povValue = joystick.getPOV();
if (povValue == 0 || povValue == 45 || povValue == 315){
return 1;
} else if (povValue == 90 || povValue == 270 || povValue == -1){
return 0;
} else {
return -1;
}
} | 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.