text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void doDownload(HttpRequest request, long contentLength, OutputStream clientOut)
{
cout = clientOut;
SpeedThread speedThread = new SpeedThread(this);
buffer = new CircularDownloadBuffer(bufferSize);
// Also write the request out to a file
BufferedOutputStream fileOut ... | 9 |
public synchronized void makeimages ()
// create images and repaint, if ActiveImage is invalid.
// uses parameters from the BoardInterface for coordinate layout.
{
Dim = getSize();
boolean c = GF.getParameter("coordinates", true);
boolean ulc = GF.getParameter("upperleftcoordinates", true);
boolean lrc = GF.... | 7 |
public ResultSet GrabRow()
{
try
{
ResultSet Result = Statement.executeQuery(ClassQuery);
while(Result.next())
{
return Result;
}
}
catch(SQLException E)
{
Grizzly.WriteOut(E.getMessage());
return null;
}
return null;
} | 2 |
public static void shoot() {
// pellet created
if (gunRoll == 1){
if(Data.ammo > 0){
Data.p_list.add(new Pellet(x_gunpos + Data.x_adjust_gun, y_gunpos, 0, VELOCITY_Y));
Data.ammo -= 1;
}
} else if (gunRoll == 2){
if(Data.ammo > 0){
shootDouble();
Data.ammo -= 2;
}
}
if (gunR... | 8 |
public void YCC_to_RGB(int count)
{
if((ncolors != 3)||parent.isRampNeeded())
{
throw new IllegalStateException("YCC_to_RGB only legal with three colors");
}
while(count-- > 0)
{
final int y = parent.data[offset];
final int b = parent.data[offset +... | 9 |
private Genetics[] makeNewGenetics(Genetics oldGen) {
System.out.println("makeNewGenetics() is running");
Genetics gen1 = new Genetics(oldGen);
Genetics gen2 = new Genetics(oldGen);
Random r = new Random();
// OBS inte s�ker p� att detta blir helt r�tt.
// f�rst har vi ett tal mella... | 6 |
public static void insertCommercial(int idservice, String nom, String prenom, String adresse1, String adresse2 ) throws SQLException {
String query;
try {
query = "INSERT INTO COMMERCIAL (ID_VILLE,COMMNOM,COMMPRENOM,COMMADRESSE1,COMMADRESSE2) VALUES (?,?,?,?,?) ";
PreparedSt... | 1 |
public final void show() {
StackPane parentRoot = (StackPane) ((Stage) stage.getOwner())
.getScene().getRoot();
parentRoot.getChildren().add(mask);
stage.show();
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
StatefulContext other = (StatefulContext) obj;
if (id != other.id)
return false;
return true;
} | 4 |
public void runGame()
{
WorldGUI view = new WorldGUI(world);
for(int rounds=0; rounds<1000; rounds++){
for(int i = 0; i<127; i++){//127 ants per team in the game?
step(i, Colour.RED);
step(i, Colour.BLACK);
}
//refresh/update representation here
if(rounds%15 == 0){
view.update(cellsToUpdat... | 6 |
public void writeBoolean(boolean v)
throws IOException {
if (trace == API_TRACE_DETAILED) {
Log.current.println("writeBoolean = " + v);
}
if (v) {
writeSymbol(CycObjectFactory.t);
}
else {
writeSymbol(CycObjectFactory.nil);
}
} | 2 |
private static String hashPieces(File source)
throws NoSuchAlgorithmException, IOException {
MessageDigest md = MessageDigest.getInstance("SHA-1");
FileInputStream fis = new FileInputStream(source);
StringBuffer pieces = new StringBuffer();
byte[] data = new byte[Torrent.PIECE_LENGTH];
int read;
while ((... | 1 |
protected void setUDPOptionsEnabled(boolean enabled)
{
lb_udpBufferSize.setEnabled(enabled);
udpBufferSize.setEnabled(enabled && lb_udpBufferSize.isSelected());
udpBufferSizeUnit.setEnabled(enabled && lb_udpBufferSize.isSelected());
lb_udpPacketSize.setEnabled(enabled);
udpPacketSize.setEnabled(enabled && l... | 9 |
protected int countNeighbours(int col, int row) {
int total = 0;
total = getCell(col-1, row-1) ? total + 1 : total;
total = getCell( col , row-1) ? total + 1 : total;
total = getCell(col+1, row-1) ? total + 1 : total;
total = getCell(col-1, row ) ? total + 1 : total;
total = getCell(col+1, row ) ? total +... | 8 |
void setExampleWidgetAlignment () {
int alignment = 0;
if (leftButton.getSelection ()) alignment = SWT.LEFT;
if (centerButton.getSelection ()) alignment = SWT.CENTER;
if (rightButton.getSelection ()) alignment = SWT.RIGHT;
label1.setAlignment (alignment);
label2.setAlignment (alignment);
label3.setAlignme... | 3 |
public static void initialize(ParseMode mode) {
System.out.println("started");
props = new Properties();
if (mode == ParseMode.POS) {
props.put("annotators", "tokenize, ssplit, pos");
} else if (mode == ParseMode.WORD_TOKENIZE) {
props.put("annotators", "tokenize, ssplit");
} else if (mode == ParseMo... | 3 |
@Override
public boolean execute(SimpleTowns plugin, CommandSender sender, String commandLabel, String[] args) {
final Localisation localisation = plugin.getLocalisation();
if (!(sender instanceof Player)) {
sender.sendMessage(localisation.get(LocalisationEntry.ERR_PLAYER_ONLY_COMMAND))... | 7 |
private void scavenge()
{
Thread thread = Thread.currentThread();
ClassLoader old_loader = thread.getContextClassLoader();
try
{
if (_handler==null)
return;
ClassLoader loader = _handler.getClassLoader();
if (loader!=nu... | 9 |
@Override
public void update(GameContainer gc, StateBasedGame game, int delta) throws SlickException {
super.update(gc, game, delta);
player.update(gc, game, delta);
map.update(gc, game, delta);
if(gc.getInput().isKeyPressed(Input.KEY_D)) {
if(((Game) game).isDebug()) ((Game) g... | 3 |
public void fillUnobstructedArea(Graphics g, int pixelsize)
{
g.setColor(Color.green);
for (int i = 0; i < gui.getWidth(); i += pixelsize)
for (int j = 0; j < gui.getHeight(); j += pixelsize)
if (!AngleElimination.isObstructed(new Vertex(i+pixelsize/2, j+pixelsize/2)))
... | 3 |
@Override
public boolean show() {
if (!getTab().open())
return false;
final WidgetChild list = Widgets.get(EMOTE_WIDGET, EMOTE_LIST);
if (list == null || !list.visible())
return false;
final WidgetChild emote = list.getChild(childId);
return Widgets.scroll(emote, Widgets.get(EMOTE_WIDGET, EMOTE_SCROLLB... | 5 |
private void handleAdjustShooterAngle(PlayerAdjustShooterAnglePacket packet) {
ClientPlayer player = getPlayer(packet.name);
if (player != null) {
player.setShooterAngle(packet.angle);
}
} | 1 |
public void mouseReleased(MouseEvent e) {
if (!b.isEnabled()) return;
if (b instanceof javax.swing.JButton) {
b.setBorder(inactive);
b.setBorderPainted(false);
}
} | 2 |
public void updateSprite(int currentState) {
switch (currentState) {
case 0: currentSprite.set(new Sprite(Art.player[2][0])); currentSprite.flip(true, false); break;
case 1: currentSprite.set(new Sprite(Art.player[2][0])); break;
case 2: currentSprite.set(new Sprite(Art.player[1][0])); break;
case 3: currentS... | 4 |
public boolean isSelected(){
return selected;
} | 0 |
public void fecharConexao(){
try
{
if(c != null)
c.close();
if(stmt != null)
stmt.close();
if(rs != null)
rs.close();
}
catch (SQLException ex)
{
Logger.getLogger(TrackingNumberWatcher... | 4 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
} | 1 |
void notifyListeners(Object created, Page modified, Object deleted) {
Page root = null;
if (created != null) root = findRoot(created);
else if (modified != null) root = findRoot(modified);
else if (deleted != null) root = findRoot(deleted);
else throw new RuntimeException("Root w... | 7 |
@EventHandler
public void PlayerPoison(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getPlayerConfig().getDouble("Player.Poison.D... | 6 |
public void neglectDeath(Player p, Entity animal ){
if(this.willDie && this.getAge() < 120){
p.getWorld().createExplosion(animal.getLocation().getX(), animal.getLocation().getY(), animal.getLocation().getZ(), (float)0, false, false);
animal.remove();
animalUtility au = new animalUtility(plugin);
this.anim... | 5 |
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return Long.valueOf(getId());
case NAME:
return getName();
case PRICE:
return Integer.valueOf(getPrice());
}
throw new IllegalStateException();
} | 3 |
public int getDistance(String after) {
if (ignoreSize)
after = StringSizeConverter.getFullString(after);
int[][] cost = new int[before.length() + 1][after.length() + 1];
for (int i = 0; i < cost.length; i++)
cost[i][0] = i;
for (int i = 0; i < cost[0].length; i++)
cost[0][i] = i;
int eq;
for (int ... | 5 |
protected void fireTreeNodesInserted(Object source, TreePath path,
int[] childIndices, Object[] children) {
// Guaranteed to return a non-null array
Object[] listeners = this.listenerList.getListenerList();
TreeModelEvent e = null;
// Process the listeners last to first, notifying
// those that are interested... | 3 |
public static void main(String args[])
throws java.io.IOException {
char ch;
char answer = 'K';
System.out.println("I'm thinking of a letter between A and Z.");
System.out.print("Can you guess it?: ");
ch = (char) System.in.read(); //read ch... | 2 |
private Inventory solveExhaustivelyRecursively(int indexOfNextItem, int remainingCapacity, ArrayList<Double> result, int value) {
if (indexOfNextItem >= items.size()) {
return new Inventory(this, result, value);
}
Item nextItem = items.get(indexOfNextItem);
result.add(0.0);... | 3 |
public void deleteUser(User user) {
try {
beginTransaction();
session.delete(user);
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
closeSession();
}
} | 1 |
public static void main(String[] args) {
System.out.println("Starting.");
System.out.flush();
final Semaphore sem = new Semaphore(0);
for (int i = 0; i < 10; i++) {
System.out.println("Queing proc " + i);
System.out.flush();
final int threadNum = i;
getDefaultPool().execute(new R... | 3 |
public Cuenta getDestino(){
return this.destino;
} | 0 |
public List validate() {
String error;
if(!isNameValidate()) {
error = "Name is not valid.";
validateErrors.add(error);
}
if(!isSurnameValidate()) {
error = "Surname is not valid.";
validateErrors.add(error);
}
if(!isBirt... | 6 |
private String readStringUTF8(byte[] remainingData, int stringIdx) throws IOException {
// skip the length, will usually be 0x1A1A
// int strLen = readUInt16(remainingData, stringIdx);
// the length here is somehow weird
int strLen = readUInt8(remainingData, stringIdx + 1);
stringIdx += 2;
String str = new ... | 0 |
@Test
public void testTimeStep_DAILY2_period() throws Exception {
printDebug("----------------------------");
printDebug("DAILY with Period Range: " + this.toString());
printDebug("----------------------------");
CSTable t = DataIO.table(r, "obs");
Assert.assertNotNull(t);
... | 1 |
@Override
public void layoutContainer(final Container target) {
final Dimension d = target.getSize();
final Insets insets = target.getInsets();
// preferred layout size for Image5dCanvas
final Dimension prefCanvasSize = new Dimension(d);
contentBounds.x = insets.left;
contentBounds.y = insets.top;
//... | 9 |
public void lancer() {
System.out.println("lancement du serveur ...");
String[] serveursIP = { "http://checkip.amazonaws.com/", "http://icanhazip.com/", "http://curlmyip.com/",
"http://www.trackip.net/ip" };
for (String servIP : serveursIP) {
try {
URL whatismyip = new URL(servIP);
BufferedReade... | 9 |
@Override
public void update(Stage stage) {
updateFleeRange();
ArrayList<Actor> actors = new ArrayList<Actor>();
actors = PropQuad.get().getActors(fleeRange);
if(!actors.isEmpty()) {
if(actors.size() > 1) {
Actor target = getClosestTarget(actors);
if(target != null) {
source.getAI().setTarge... | 3 |
public static int[] generateRandomIntArray(int size, boolean allowsDuplicate, int min, int max)throws ArrayIndexOutOfBoundsException {
if(countNumbersInRange(min, max) < size) {
throw new ArrayIndexOutOfBoundsException();
}
int randArr[] = new int[size];
int randNum = MathUtils.generateRandomNumb(min, max);
... | 6 |
public void encrypt(InputStream in, OutputStream out)
throws IOException
{
byte inbuf[] = new byte[8];
byte outbuf[] = new byte[8];
boolean done = false;
while (!done) {
int n = readn(in, inbuf, 8);
if (n < 8) {
done = true;
int m = n;
while (n < 7)
inbuf[n++] = 0;
inbuf[n++] = (byte) (... | 3 |
public static void quicksort(Comparable[] a, int lo, int hi) {
if (lo < hi) {
int pivotIndex = lo;
Comparable pivot = a[pivotIndex];
a[pivotIndex] = a[hi];
a[hi] = pivot;
int i = lo - 1;
int j = hi;
do {
do {
i++;
}
while (a[i].compareTo(pivot) < 0);
do {
j--;
... | 6 |
@Override
public void startSetup(Attributes atts) {
String id = atts.getValue(A_ID);
setCommand(id);
Outliner.prefs.addPreference(id, this);
} | 0 |
public void enqueue(E e)
{
if (e == null) return;
Node u = new Node(e);
if (tail != null) tail.setNext(u);
tail = u;
if (isEmpty())
head = tail;
size++;
} | 3 |
private void replacedata( boolean repl )
{
if(isReadOnly()) return;
try { fdbf.seek( recordpos() ); } catch (IOException e) {}
writeChars(0,1,(repl && deleted ? "*" : " "));
for(int i=0;i<fcount;i++) replacefielddata(i);
update_key();
getfieldsValues();
} | 5 |
public boolean containsAttribute(String locationpath){
if (locationpath.contains("@") || locationpath.contains("attribute::")){
return true;
}else{
return false;
}
} | 2 |
public ArrayList<String> readFile(String arg) {
String thisLine;
ArrayList<String> fileToRead = new ArrayList<String>();
try {
//BufferedReader to scan in the file
BufferedReader buffy = new BufferedReader(new FileReader(arg));
while((thisLine = buffy.readLine()) != null && !thisLine.substring(0... | 3 |
protected static Ptg calcINTRATE( Ptg[] operands )
{
if( operands.length < 4 )
{
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "calcINTRATE" );
try
{
GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].getValue() );
GregorianCalendar... | 8 |
public int getProcessMode() {
return processMode;
} | 0 |
@Override
public String toString() {
String name = getName();
String append = "";
if(name != null && !name.equals("")) {
append = "(\"" + this.getName() + "\")";
}
return "TAG_Float" + append + ": " + value;
} | 2 |
public void popEntriesSymbolTable(int numberToRemove) {
symbolTable.popEntries(numberToRemove);
} | 0 |
@Override
public void actionPerformed(ActionEvent e) {
JTextField rowField = new JTextField("", 5);
JTextField colField = new JTextField("", 5);
JPanel myPanel = new JPanel();
myPanel.add(new JLabel("Rows:"));
myPanel.add(rowField);
myPanel.add(Box.createHorizontalStrut(15)); // a spacer
myPanel.add(new... | 6 |
private void swim(int k) {
while (k > 1 && greater(k / 2, k)) {
exch(k, k / 2);
k = k / 2;
}
} | 2 |
public float getY() {
return y;
} | 0 |
public Model getRotatedModel()
{
if(desc == null)
return null;
Model model = method450();
if(model == null)
return null;
super.height = model.modelHeight;
if(super.anInt1520 != -1 && super.anInt1521 != -1)
{
SpotAnim spotAnim = SpotAnim.cache[super.anInt1520];
Model model_1 = spotAnim.getModel(... | 8 |
boolean isMatch(String str, int i, String pat, int j, Map<Character, String> map, Set<String> set) {
// base case
if (i == str.length() && j == pat.length()) return true;
if (i == str.length() || j == pat.length()) return false;
// get current pattern character
char c = pat.char... | 9 |
public int getCount(ArrayList<FilterBean> hmFilter) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getCount("empresa", hmFilter);
oMysql.desconexion();
return pages;
} catch (Exception e) {
throw n... | 1 |
public void keyPressed(KeyBindingEvent keyBindingEvent) {
//Only toggle state when not on the gamescreen
if (!keyBindingEvent.getScreenType().equals(ScreenType.GAME_SCREEN)) {
return;
}
SpoutPlayer sPlayer = keyBindingEvent.getPlayer();
if(sPlayer.hasPermission("playerplus.use")) {
new Texture... | 2 |
public DocumentAttributesPanel getDocumentAttributesPanel() {
return this.attPanel;
} | 0 |
@EventHandler
public void PlayerNausea(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getPlayerConfig().getDouble("Player.Nausea.D... | 6 |
private void startSimulation() throws InterruptedException {
start = System.currentTimeMillis();
SimpleDirectedWeightedGraph<Node, DefaultWeightedEdge> swg = createMapGraph();
Queue<Node> pathForVehicle = getPathForVehicle(vehicle, swg, null);
if(pathForVehicle.isEmpty()) {
removeTemporaryStreets();
... | 8 |
private void extractFile(String name) {
File actual = new File(getDataFolder(), name);
if (!actual.exists()) {
InputStream input = getClass().getResourceAsStream("/Default_Files/" + name);
if (input != null) {
FileOutputStream output = null;
try
{
output = new FileOutputStream(ac... | 8 |
public static int[][] TerrainLoad() {
int[][] map= new int[320][240];
String filePath = "src/map.lvl";
Scanner scanner = null;
try {
scanner = new Scanner(new File(filePath));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int i=0;
int j=0;
while... | 3 |
private boolean verificaQteAulaHorario(String anoletivo, Date datageracao) {
Boolean resp = false;
int ocorrmath = 0;
int idmat = 0;
List<Integer> idmatprof = new ArrayList<>();
for (int i = 0; i < erroperiodo.size(); i++) {
try {
List<HorarioAulaBeans... | 9 |
private void callSetter(HashMap<String, String> headerToFieldMap, T instance, Method method,
CSVMapperSetterMethod annotation, Class<?> parameterType) {
Class<?> wrapperType;
if (parameterType.isPrimitive()) {
wrapperType = wrapperMap.get(parameterType);
... | 5 |
public Record findById(java.lang.Integer id) {
log.debug("getting Record instance with id: " + id);
try {
Record instance = (Record) getSession().get(
"com.oj.hibernate.daoNdo.Record", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
} | 1 |
public static void saveImage(BufferedImage img, File output) throws IOException {
output.delete();
final String formatName = "png";
for (Iterator<ImageWriter> iw = ImageIO.getImageWritersByFormatName(formatName); iw.hasNext();) {
ImageWriter writer = iw.next();
ImageWriteParam writeParam = writer.... | 3 |
private static void createAndShowGUI() {
//Check the SystemTray support
if (!SystemTray.isSupported()) {
System.out.println("SystemTray is not supported");
return;
}
final PopupMenu popup = new PopupMenu();
final TrayIcon trayIcon =
new Tra... | 8 |
public void generateNotes() throws InvalidChordException {
// If this is the first chord of the song, treat it differently.
if (prevBeat == null) {
generateFirstChord();
return;
}
// Until all the rules are followed, continue generating combinations.
int tries = 0;
boolean notesFollowAllRules = fal... | 6 |
protected boolean checkCoverage() {
int i;
int n;
int[] count;
Range r;
String attrIndex;
SubspaceClusterDefinition cl;
// check whether all the attributes are covered
count = new int[getNumAttributes()];
for (i = 0; i < getNumAttributes(); i++)... | 7 |
@BeforeClass
public static void setUpClass() {
} | 0 |
private void fixColUp() {
turnLeft();
while (frontIsClear()) {
if (noBeepersPresent()) {
putBeeper();
}
move();
}
if (noBeepersPresent()) {
putBeeper();
}
turnRight();
} | 3 |
public static String classPackageAsResourcePath(Class<?> clazz) {
if (clazz == null) {
return "";
}
String className = clazz.getName();
int packageEndIndex = className.lastIndexOf('.');
if (packageEndIndex == -1) {
return "";
}
String packageName = className.substring(0, packageEndIndex);
return p... | 3 |
public static void main(String[] args) {
if (args.length < 1 || args.length >1){
System.out.println("Error: incorrect arguments");
}
else {
//Object to hold word information for given web pages.
WebPages webPage = new WebPages();
//Commands from in... | 9 |
@Override
public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
{
final java.util.Map<String,String> parms=parseParms(parm);
final String last=httpReq.getUrlParameter("FACTION");
if(parms.containsKey("RESET"))
{
if(last!=null)
httpReq.removeUrlParameter("FACTION");
return "... | 8 |
@Override
public void run() {
while(true) {
while(queueOfMessages.peekFirst() != null) {
String s = queueOfMessages.removeFirst();
Iterator<Client> iteratorOfClients = listOfClients.iterator();
while(iteratorOfClients.hasNext()) {
... | 6 |
@Override
public ArrayList<Object> show(int id) {
conn = new SQLconnect().getConnection();
ArrayList<Object> tns = new ArrayList<Object>();
try {
String sql = "select * from eventnodes where display = 'true' and owner = "+ id + ";";
Statement st = (Statement) conn.createStatement(); // 创建用于执行静态sql语句的Sta... | 2 |
protected void appendLabel(final Label l) {
String name = (String) labelNames.get(l);
if (name == null) {
name = "L" + labelNames.size();
labelNames.put(l, name);
}
buf.append(name);
} | 1 |
private void drawExits(Graphics g){
g.setColor(exitColor);
//int size = this.getWidth() / 10;
int xPos = 0;
int yPos = 0;
int width = 0;
int height = 0;
for (Relative_Direction dir: room.getAbsoluteExits()){
//Relative_Direction dir = room.convertAbsoluteDirectionToRoomRelativeDirection(exit);
... | 5 |
@Override
public void setValue(Object o) {
// TODO support setting (by pushing properties to parent)
throw new UnsupportedOperationException("Not supported yet.");
} | 0 |
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
}
return true;
} catch (InvalidConfigurationExcept... | 4 |
public void learn(String learn) {
char c;
String name = "";
for (int i = 0; i < learn.length(); i++) {
c = learn.charAt(i);
switch (c) {
case '(':
if (name.length() > 0)
startElement(name);
name = "";
break;
case ')':
if (name.length() > 0)
startElement(name);
name = "";
... | 9 |
public String toString() {
if (isFree)
return "FREE";
else if (isInvalid)
return "INVALID-CONSTANT";
else if (name != null)
return name;
else
return "[CycConstant: " + guid.toString() + "]";
} | 3 |
private Double calculateExpressionValue() throws MalformedParenthesisException, InvalidOperandException, MalformedTokenException, MalformedDecimalException {
if(this.expressionList==null) {
tokenize();
}
//Magic happens here (i.e. PEMDAS)
performParentheticalExpressionEvaluation();
performExponenti... | 1 |
@Override
public void onMoveTick(int x, int y, Game game) {
SinglePlayerGame spg = (SinglePlayerGame) game;
if (filterByID(spg.getSquareNeighbors(x, y, 1), juggernaut.id).isEmpty()) {
Location loc = spg.getFirstSquareNeighborLocation(x, y, 2, zombie.id);
spg.moveEntity(x, y, ... | 2 |
private void dealtDamage(int getX, int getY, int getWidth, int getLength, int getTime, int getDelay, double getDamage, int applyForce)
{
if (character.equals("P1"))
{
if (direction)
{
getWorld().addObject(new P1AttackArea(getX + x, y + getY,getWidth,getLength,... | 4 |
public Type getSubType() {
if ((clazz == null && ifaces.length == 1) || ifaces.length == 0)
return tRange(this, tNull);
/*
* We don't implement the set of types, that are castable to some of the
* given classes or interfaces.
*/
throw new alterrs.jode.AssertError(
"getSubType called on set of cla... | 3 |
static CommandLine doCommandLineParsing(String[] args) {
/*
* Lese Kommandozeilenargumente ein
*/
Option sourceFileOpt = new Option("s", "sourceFile", true,
"Die Ausgangsdatei");
sourceFileOpt.setRequired(true);
Option destFileOpt = new Option("d", "destFile", true, "Die ... | 1 |
public boolean isComplexNotOfMiddle() {
return (truthTable[0] == true) && (truthTable[1] == true) &&
(truthTable[2] == false) && (truthTable[3] == false) &&
(truthTable[4] == true) && (truthTable[5] == true) &&
(truthTable[6] == false) && (truthTable[7] == false);
} | 7 |
private EncryptedCard encryptEncCard(EncryptedCard card)
throws InvalidKeyException, IllegalBlockSizeException,
BadPaddingException {
if (e == null) {
System.err
.println("Cannot encrypt when using decrypting constructor RSAService(gp, gq, gd)");
return null;
}
EncryptedCard encCard = new Encr... | 1 |
public void visit(int version, int access, String name, String signature,
String superName, String[] interfaces) {
this.className = name;
super.visit(version, access, remapper.mapType(name), remapper
.mapSignature(signature, false), remapper.mapType(superName),
interfaces == null ? null : remapper.mapTyp... | 1 |
private void resetElements() {
// remove ParameterChangeListeners on editable elements to prevent memory leaks
if (nt != null)
nt.removeParameterChangeListener(this);
if (pl != null)
pl.removeParameterChangeListener(this);
if (ws != null)
ws.removeParameterChangeListener(this);
if (ck != null)
ck... | 9 |
private void meetingMenu(int meetingJoined) throws IOException, ClassNotFoundException {
String opt = "";
while (!("0".equals(opt))) {
System.out.println("Welcome to the meeting, " + username_logged + "!\n");
System.out.println("Please select one of the following options (0 to qu... | 9 |
public static void main(String[] args) {
Round round;
do {
round = new Round();
Square square = new Square();
round.hello();
IPlayer player1 = new Human();
IPlayer player2;
if (round.getTypeOfGame() == '2') {
play... | 9 |
private static void removeIsomorphicPieceOrientations()
{
for(int x = 0; x < p.size(); x++)
{
for(int y = 0; y < p.get(x).size(); y++)
{
if(p.get(x).get(y) != null)
{
for(int z = y+1; z < p.get(x).size(); z++)
{
if(p.get(x).get(z) != null)
{
if(p.get(x).get(y).equals(p.ge... | 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.