text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Square move(PieceDirection direction, int diff) {
switch (direction) {
case Back:
return this.moveBack(diff);
case Front:
return this.moveFront(diff);
case Left:
return this.moveLeft(diff);
case LeftBack:
... | 8 |
private static String printClusterStats(Clusterer clusterer,
String fileName)
throws Exception {
StringBuffer text = new StringBuffer();
int i = 0;
int cnum;
double loglk = 0.0;
int cc = clusterer.numberOfClusters();
... | 8 |
private void add(E e) {
Rect rect = e.getAABB();
int beginx = (int) (rect.x - rect.w2) / width;
int beginy = (int) (rect.y - rect.h2) / height;
int endx = (int) (rect.x + rect.w2) / width;
int endy = (int) (rect.y + rect.h2) / height;
//Vec2i pos = new Vec2i(0, 0);
... | 4 |
private boolean isCorrectTarget(Placeable currentEnemy) {
if (tower.getLastTarget() != null || !isInRange(currentEnemy)) { // if no last target skip below and return
if (attackData.isRememberOldTarget()) { //if it does not care about keeping track of old target
if (tower.getLastTarge... | 6 |
public static void tulostaYhteydet(Sitsit sitsit) {
System.out.println("\n" + "Yhteydet" + "\n");
Hakemisto<Sitsaaja, Hakemisto> kaikkiYhteydet = sitsit.palautaYhteydet();
int moneskoYhteys = 0;
int moneskoSitsaaja = 0;
int moneskoyhteydellinen = 0;
for (Vektori<Sitsaaja... | 5 |
public HttpPlayer() {
client = new DefaultHttpClient();
} | 0 |
public void testRemoveManyWithNulling() {
RingBufferSeqno<Integer> buf=new RingBufferSeqno<>(10, 0);
for(int i: Arrays.asList(1,2,3,4,5,6,7,9,10))
buf.add(i, i);
List<Integer> list=buf.removeMany(true, 3);
System.out.println("list = " + list);
assert list != null && l... | 7 |
public void testEmptyClass () {
FieldAccess access = FieldAccess.get(EmptyClass.class);
try {
access.getIndex("name");
fail();
} catch (IllegalArgumentException expected) {
// expected.printStackTrace();
}
try {
access.get(new EmptyClass(), "meow");
fail();
} catch (IllegalArgumentException e... | 4 |
public String getNombre() {
return nombre;
} | 0 |
public int Run()
{
char c = 0;
System.out.println("Please enter a command:");
do{
try {
c = (char) System.in.read();
if ( CurrentRoom.Options.get(c)!=null){
//CurrentRoom.Options.get(c).runCommand(c);
DoTheOption(c);
System.out.println("Please enter a command:");
... | 3 |
float getZ(int x) {
return x * 2.0f;
} | 0 |
public String readUrl(String urlString) throws Exception {
BufferedReader reader = null;
try {
URL url = new URL(urlString);
reader = new BufferedReader(new InputStreamReader(url.openStream()));
StringBuffer buffer = new StringBuffer();
int read;
... | 2 |
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_UP) { //Presiono flecha arriba 1
direccion = 1;
buenoMov = false;
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) { //Presiono flecha abajo 2
direccion = 2;
buenoMov = fal... | 4 |
@Override
public void run() {
double unproccessedSeconds = 0;
long lastTime = System.nanoTime();
double secondsPerTick = 1 / 60.0;
int tickCount = 0;
while (running) {
long now = System.nanoTime();
long passedTime = now - lastTime;
lastTime = now;
if (passedTime < 0) {
passedTime = ... | 8 |
@Override
public void visitIincInsn(final int var, final int increment) {
if (currentBlock != null) {
if (compute == FRAMES) {
currentBlock.frame.execute(Opcodes.IINC, var, null, null);
}
}
if (compute != NOTHING) {
// updates max locals
... | 7 |
public int[] getDecomposition()
{
return myDecomposition;
} | 0 |
@Override
public void mouseReleased(MouseEvent e)
{
if (e.getButton() == MouseEvent.BUTTON1)
{
if (down)
{
if (Hub.simWindow.loadGenesButton.isChecked())
loadGenes(file.getName());
else if (Hub.simWindow.deleteGenesButton.isChecked()
&& J... | 5 |
private void Run()
{
isRunning = true;
int frames = 0;
long frameCounter = 0;
final double frameTime = 1.0 / FRAME_CAP;
long lastTime = Time.GetTime();
double unprocessedTime = 0.0;
while(isRunning)
{
boolean render = false;
long startTime = Time.GetTime();
long passedTime = st... | 6 |
public boolean accept(File dir, String name){
File f = new File(dir.getAbsolutePath() + name);
BufferedReader br = null;
String s = null;
try {
br = new BufferedReader(new FileReader(f));
while((s=br.readLine())!=null ){
if(pattern.matcher(name).matches() == true)
return true;
}
} catch (Fi... | 4 |
public static ArrayList<Double> averageChunks(List<Double> ary,
int numChunks) {
ArrayList<Double> result = new ArrayList<Double>();
double chunkSize = ((double) ary.size()) / (double) numChunks;
int start = 0; // index of start of current chunk
double bound = 0; // decimal value of upper bound for current c... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Point other = (Point) obj;
if (lat == null) {
if (other.lat != null)
return false;
} else if (!lat.equals(other.lat))
return false;
... | 9 |
static void checkSyntax(String attrName, Expr value) throws InvalidAttributeValueException, IllegalArgumentException {
if (value.type == Expr.ERROR) {
throw new IllegalArgumentException(attrName + ": syntax error, unable to parse the value");
} else if (value.type == Expr.STRING) {
checkAttribute(attrName, ((... | 8 |
public Packet read(short id, ByteBuffer buf) {
try {
/*short id = buf.getShort();
short len = buf.getShort();
ByteBuffer data = buf.slice();
data.limit(len);
buf.position(len);*/
Class<? extends Packet> packetClass = packetMapping.get((int)id);
if (packetClass == null) throw new IllegalArgumentE... | 4 |
public void save() {
try {
sql.Query.save(this);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
} | 2 |
public boolean hayLugarEnPlan (int id_padre, String codigo_plan_padre){
boolean haylugar = false;
try {
r_con.Connection();
ResultSet rs = r_con.Consultar("select COUNT(*) from "+nameTable+" where pc_id_padre="+id_padre);
rs.next();
int futuroHijo = rs.getI... | 6 |
@Override
public void paintComponent(Graphics g) {
Graphics2D graph = (Graphics2D) g;
graph.setBackground(new Color(1, 0, 0));
graph.clearRect(0, 0, this.getWidth(), this.getHeight());
if (entityList != null) {
for (Entity e : entityList) {
int eCenterX = Math.round(e.getxPos()) - xPos;
int eCenter... | 5 |
@Override
public String execute() throws Exception {
try {
Map session = ActionContext.getContext().getSession();
setUser((User) session.get("User"));
Criteria ucri = myDao.getDbsession().createCriteria(Campaign.class);
ucri.setMaxResults(100);
all... | 3 |
public void transform(JavaMethod javaMethod) {
String shortName = javaMethod.getName();
String fullName = javaMethod.getQualifiedName();
String parameterName = javaMethod.getQualifiedSignature();
if (!javaMethod.isStatic() && (INSTANCE_METHODS.contains(shortName) || INSTANCE_METHODS.contains(fullName) || INSTAN... | 9 |
public int getWallDecorationUid(int z, int x, int y) {
GroundTile groundTile = groundTiles[z][x][y];
if (groundTile == null || groundTile.wallDecoration == null) {
return 0;
} else {
return groundTile.wallDecoration.uid;
}
} | 2 |
public void fireKeyEvent(KeyEvent event) {
processKeyEvent(event);
} | 0 |
public ClientGUI() {
try {
UnicastRemoteObject.exportObject(this, 0);
mInstance = this;
} catch(RemoteException ex) {
System.out.println(ex.getMessage());
}
mUserName = "";
mUserPass = "";
mMessageWindows = new HashMap<String, MessageWindow>();
mListWindow = new UserListWindow(this);
} | 1 |
public Type intersection(Type type) {
if (type == tError)
return type;
if (type == Type.tUnknown)
return this;
Type top, bottom, result;
bottom = bottomType.getSpecializedType(type);
top = topType.getGeneralizedType(type);
if (top.equals(bottom))
result = top;
else if (top instanceof ReferenceTy... | 6 |
@Test
public void insertTest() {
final int n = 10_000;
Array<Integer> seq = emptyArray();
for(int i = 0; i < n; i++) seq = seq.snoc(i);
assertEquals(n, seq.size());
for(int i = 0; i <= n; i++) {
final Array<Integer> seq2 = seq.insertBefore(i, n);
assertEquals(Integer.valueOf(n), seq2... | 4 |
@Override
public void setLoadStatus(double d) {
if (d >= 0 && d <= 1)
loadStatus = d;
} | 2 |
@Override
public void executeTask() {
System.out.println(this.getClass().getSimpleName() + " EXECUTING");
if (m_ServerSocket == null) {
try {
m_ServerSocket = new ServerSocket(PORT);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
do {
String ... | 6 |
public RootPane getRootPane() {
if (rootPane == null) {
rootPane = createRootPane();
if (rootPane.getState() != this) {
throw new IllegalStateException("rootPane.getState() != this");
}
}
return rootPane;
} | 2 |
public static OS getPlatform() {
String osName = System.getProperty("os.name").toLowerCase();
if (osName.contains("win")) return OS.windows;
if (osName.contains("mac")) return OS.macos;
if (osName.contains("solaris")) return OS.solaris;
if (osName.contains("sunos")) return OS.solaris... | 6 |
private boolean checkPngEncodingSupport() {
String encodings = System.getProperty("video.snapshot.encodings");
return (encodings != null) && (encodings.indexOf("jpeg") != -1);
} | 1 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if((mob.isMonster())&&(mob.isInCombat()))
return Ability.QUALITY_INDIFFERENT;
final Room R=mob.location();
if(R!=null)
{
for(final Enumeration<Ability> a=R.effects();a.hasMoreElements();)
{
final Ability ... | 7 |
private void renderUnits(Graphics g){
if (settings.isDisplayAllPaths()){
for (int i = 0; i < world.getPlayer().getUnits().size(); i ++){
Unit u = world.getPlayer().getUnits().get(i);
int speed = u.getMaxMovement();
for (int j= 0; j< u.getPath().size(); j ++){
Color color = j == 0 ? PathGenerato... | 8 |
public void deathAni()
{
switch (aniNum)
{
case 0:
sprt = imgD1.getImage();
if(Game.tickCount2 == game.DELAY){
aniNum = 1;
}
break;
case 1:
sprt = imgD2.getImage();
if(Game.tickCount2 == game.DELAY){
aniNum = 2;
}
break;
case 2:
sprt = imgD5.getImage();
if... | 7 |
public String getUserId() {
return userId;
} | 0 |
public int nbMaxCercle (){
Coord dim = this.env.getDimension();
int[] dist = new int[4];
dist[0] = this.coord.distance(Coord.NULL);
dist[1] = this.coord.distance(new Coord(dim.x, 0));
dist[2] = this.coord.distance(new Coord(0, dim.y));
dist[3] = this.coord.distance(dim);
int gdist = 0;
for(int i = 0... | 2 |
protected long packChildren(String destination, long parentDirOffset, long nextAddrOffset) {
long currentOffset = nextAddrOffset;
Iterator<VDKInnerDirectory> it = getChildren().iterator();
List<VDKInnerDirectory> directoryList = new ArrayList<VDKInnerDirectory>();
while (it.hasNext()) {
VDKInnerDirector... | 5 |
public static void main(String[] args) {
Treap<Integer> t;
Random rand = new Random();
double sommeLog = 0.0;
int sommeHauteur = 0;
for (int j = 0; j < 100; j++) {
for (int nombreElement = 1; nombreElement < 100; nombreElement++) {
t = new Treap<>();
... | 4 |
public void readFeat(String path) throws IOException {
FileInputStream is = null;
DataInputStream dis = null;
try{
is = new FileInputStream(path);
dis = new DataInputStream(new BufferedInputStream(is));
int frames = (dis.readInt())/39;
//System.out.println(frames);
feat = new float[frames][39];
... | 5 |
@SuppressWarnings("unchecked")
public synchronized long generateRelationId(String key, List<Long> ids, List<String> types, List<String> roles, List<String[]> tags, List<String> shapesId){
Long id = null;
if (totalRelations.get(key) == null)
totalRelations.put(key, new ConcurrentHashMap<RelationOsm, Long>());
... | 5 |
public boolean lisaaTunnusPari(Tunnus tunnus1, Tunnus tunnus2) {
for (TunnusPari tunnusPari : getTunnusParit()) {
if ((tunnusPari.getTunnus1().equals(tunnus1) || tunnusPari.getTunnus2().equals(tunnus1))
&& (tunnusPari.getTunnus1().equals(tunnus2) || tunnusPari.getTunnus2().equals... | 6 |
@Override
public void run() {/**/} | 0 |
static int longestPalSubstr(char[] str)
{
int maxLength = 1; // The result (length of LPS)
int start = 0;
int len = str.length;
int low, high;
// One by one consider every character as center point of
// even and length palindromes
for (int i = 1; i < len;... | 9 |
public MOCOM_Comparator(int col, boolean decreasing_order) {
this.col = col;
if (decreasing_order) {
order = -1;
} else {
order = 1;
}
} | 1 |
public boolean batchFinished() throws Exception {
if (getInputFormat() == null) {
throw new IllegalStateException("No input instance format defined");
}
if (m_removeFilter == null) {
// establish attributes to remove from first batch
Instances toFilter = getInputFormat();
int[] at... | 9 |
private void setMine(int mineNum){
unknowArea = this.ROWS * this.COLS - mineNum;
Random random = new Random();
int count = 0;
//初始化并放入MineField
for(int i = 0;i<cas.length;i++){
for(int j = 0;j<cas[i].length;j++){
cas[i][j] = new CurrentArea();
cas[i][j].setVx(i);
cas[i][j].setVy(j);
cas[... | 9 |
private void jLabelAceptarMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelAceptarMouseReleased
try {
//Asigna en variables los jTextField
String nombreCancion = jTextFieldNombre.getText().trim();
String nombreAlbum = jTextFieldAlbum.getText().trim();
... | 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 Cliente)) {
return false;
}
Cliente other = (Cliente) object;
if ((this.id == null && other.id != null) || (thi... | 5 |
public String getSpeech() {
return speech;
} | 0 |
private String translateTransitions(STS sts, Object translatedEntity) {
String translation = "";
Set<Set<Transition>> transitionGroups = new HashSet<Set<Transition>>();
for (State state : sts.getStates()) {
// System.out.println("Looking at state " + state);
Set<Transition> transitions =
sts.getTrans... | 7 |
@Override
public boolean wipeTable(String table) {
Statement statement = null;
String query = null;
try {
if (!this.checkTable(table)) {
this.writeError("Error at Wipe Table: table, " + table + ", does not exist", true);
return false;
}
statement = connection.createStatement();
query = "DELET... | 5 |
public void calculateTotalsW() {
for (double w : consumptionWatt)
systemConsumptionW += w;
systemConsumptionW=Math.round(systemConsumptionW*100)/100000.0;
} | 1 |
public void updateIO(Elem tek)
{
for(int i = 0; i < inputNo; i++)
inputNodes[i].setActivation(tek.X[i]);
for(int i = 0; i < outputNo; i++)
outputNodes[i].setYAccuali(tek.actualY[i]/scale);
} | 2 |
public int GetTime()
{
return TIME;
} | 0 |
public void step() {
Grid<Actor> gr = getGrid();
ArrayList<Actor> actors = new ArrayList<Actor>();
for (Location loc : gr.getOccupiedLocations())
actors.add(gr.get(loc));
for (Actor a : actors) {
// only act if another actor hasn't removed a
if (a.getGrid() == gr)
... | 3 |
public String[] getOptions() {
int i;
Vector result;
String[] options;
File file;
result = new Vector();
options = super.getOptions();
for (i = 0; i < options.length; i++)
result.add(options[i]);
if (getOutputClassification())
result.add("-classification");
if (getRe... | 7 |
private static History HistoryObject(ResultSet rs) {
History newHistory = null;
try {
newHistory = new History(rs.getInt(rs.getMetaData().getColumnName(1)),
rs.getString(rs.getMetaData().getColumnName(2)),
rs.getS... | 1 |
public void gananciaDelDia(){
for (int len = ventas.size(), i = 0; i < len; i++) {
Venta unaVenta = ventas.get(i);
ganancias+= unaVenta.prenda.precioFinal();
}
System.out.println("Las ganancias del dia son:" +ganancias);
} | 1 |
private final void addUser(String channel, User user) {
channel = channel.toLowerCase();
synchronized (_channels) {
Hashtable users = (Hashtable) _channels.get(channel);
if (users == null) {
users = new Hashtable();
_channels.put(channel, users);
... | 1 |
@Override
public void calculate(Loan loan)
{
if (loan.getCalculationWanted() == CalculationAction.MONTHLY_PAYMENT)
{
// increment the payment number
loan.setPaymentNumber(loan.getPaymentNumber() + 1);
// only perform the monthly paym... | 4 |
@Test
public void testReadCluster() throws UnsupportedEncodingException {
System.out.println("extractFile");
boolean expResult = true;
boolean result = false;
f32Extractor.openFAT(new File(PATH));
f32Extractor.searchFAT32Element();
byte[] actualArr = f32Extra... | 2 |
public MainForm(String[] args) {
initComponents();
try {
List<QueryDefinition> queries = Settings.getInstance().getQueries();
for(QueryDefinition query : queries) {
this.addServiceTab(query);
}
} catch (Exception e) {
logger.error("Error loading tabs.", e);
... | 2 |
public void Update(ArrayList<Sprite> targets) {
checkLives();
arrowtimer++;
if (arrowtimer > 200) {
arrowtimer = 0;
if (target == Window.blankSprite) {
for (int i = 0; i < 4; i++) {
try {
target = targets.get(num - i);
boolean tmoving = target.moving;
double di... | 9 |
*/
protected int scoreTradeOutcome(ResourceSet tradeOutcome)
{
int score = 0;
ResourceSet tempTO = tradeOutcome.copy();
if ((ourPlayerData.getNumPieces(PlayingPiece.SETTLEMENT) >= 1) && (ourPlayerData.hasPotentialSettlement()))
{
while (tempTO.contains(Game.SETTLEMEN... | 9 |
public void testResetAfterTimeout() {
try {
final CyclicBarrier start = new CyclicBarrier(3);
final CyclicBarrier barrier = new CyclicBarrier(3);
for (int i = 0; i < 2; i++) {
Thread t1 = new Thread(new Runnable() {
public void run() {
... | 9 |
public static int discrete(double[] a) {
double EPSILON = 1E-14;
double sum = 0.0;
for (int i = 0; i < a.length; i++) {
if (a[i] < 0.0) throw new IllegalArgumentException("array entry " + i + " is negative: " + a[i]);
sum = sum + a[i];
}
if (sum > 1.0 + EP... | 7 |
private void save(String litraV,String oximaV){
/*
* apothikeuei ta stoixia sthn vash elegxei an apothikeutikan kai emfanizei minima epituxia i apotuxias antistoixa
*/
String query="insert into anefodiasmoi(litra,oxima_id) values(?,?)"; //dhmiourgia query
try {
con.pS=con.conn.prepareStatement(query);
con.pS... | 2 |
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteract(PlayerInteractEvent event) {
Player p = event.getPlayer();
if (!p.isOp()) return;
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
if (p.getItemInHand().getType() == Material.CARROT_STICK) {
... | 9 |
public static void doPagination(String table, String where, Class clazz, HttpServletRequest request, HttpServletResponse response) {
try {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
if ((request.getParameter("page") != null) &&... | 9 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try
{
String methodType = request.getPara... | 8 |
public void write(int i, byte abyte0[]) throws IOException {
if (closed)
return;
if (hasIOError) {
hasIOError = false;
throw new IOException("Error in writer thread");
}
if (buffer == null)
buffer = new byte[5000];
synchronized (this) {
for (int l = 0; l < i; l++) {
buffer[buffIndex] = abyt... | 6 |
protected void filter()
{ // if we are in the comment state
if(state.equals(State.COMMENT))
{ // if we are just entering this state
if(comment == null)
{ // The token is supposed to be a comment.
// We keep a reference to it and set the count to one
comment = (TComment) token;
... | 9 |
public void remove( BKnoop<E> aChild ) {
if( aChild == null )
throw new IllegalArgumentException(
"Argument is null" );
if( !isChild( aChild ) )
throw new IllegalArgumentException(
"Argument is geen kind" );
if( aChild == leftChil... | 3 |
@DBCommand
public boolean leave(CommandSender sender, Iterator<String> args) {
if(!sender.hasPermission("db.leave")) {
sender.sendMessage(ChatColor.RED + "You don't have permission to use this command!");
return true;
}
if(!(sender instanceof Player)) {
se... | 3 |
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
try {
reload();
} catch (IOException ex) {
logger.log(level.ERROR, "Error while loading devices! Stack trace will be printed to console...");
JOptionPane.sh... | 1 |
private JButton getBoton() {
if (boton == null) {
boton = new JButton();
boton.setText("Anular");
boton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
int[] res;
String[] anulaciones;
int selec=0;
boolean b;
for... | 9 |
public boolean peutSupprimer(Utilisateur utilisateur) {
return utilisateur != null && (utilisateur.equals(getAuteur()) || utilisateur.getRole().getValeur() >= Role.Moderateur.getValeur());
} | 2 |
public static boolean libraryCompatible( Class libraryClass )
{
if( libraryClass == null )
{
errorMessage( "Parameter 'libraryClass' null in method" +
"'librayCompatible'" );
return false;
}
if( !Library.class.isAssignableFrom( librar... | 3 |
protected void updateView(String machineFileName, String input, JTableExtender table) {
ArrayList machines = this.getEnvironment().myObjects;
Object current = null;
if(machines != null) current = machines.get(0);
else current = this.getEnvironment().getObject();
if(current in... | 5 |
public TMConfiguration(State state, TMConfiguration parent, Tape[] tapes, AcceptanceFilter[] filters) {
super(state, parent);
this.myTapes = tapes;
myFilters = filters;
} | 0 |
public Player2ColorSelectMenu(Game game, JFrame frame, int stateToNotShow) {
super(game, frame);
this.stateToNotShow = stateToNotShow;
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
header = new JLabel(" Player 2: Choose Color");
header.setFont(smallFont);
blackBu... | 8 |
@Override
public AttributeValue getExampleAttributeValue(Example e) {
int playerToken = e.getResult().currentTurn;
int height = e.getBoard().height; // 6
int width = e.getBoard().width; // 7
int numTokensCountingFor = 2; // checking for 2 in a row
int countOfTokensEncounteredVertically = 0; // counter
/... | 6 |
public void Guerra() {
General.Reclutar(exerc1, pantalla);
General.Reclutar(exerc2, pantalla);
Formacio(exerc1);
Formacio(exerc2);
while (exerc1.size() != 0 && exerc2.size() != 0) {
if (General.Acorrer(exerc1, pantalla) == exerc1.size() && !exerc1.get(0).getTipus().equals("Mag")) {
General.Perdre(ex... | 6 |
@SuppressWarnings("unused")
public boolean eval(LinkedHashMap<Variable,Value> row, JTextArea console) throws TypeException{
boolean result = true;
LinkedHashMap<Variable,Value> localvar = new LinkedHashMap<Variable,Value> ( row);
Iterator<Statement> i = statement.iterator();
while (i.hasNext() && result) {
... | 6 |
@Subscribe
public void when( ApplicationEvent applicationEvent )
{
eventNotified = true;
} | 0 |
@Override
public void recoverPhyStats()
{
super.recoverPhyStats();
if(mode!=null)
switch(mode)
{
case STUN:
phyStats().setDamage(1);
break;
case NORMAL:
case MAIM:
case KILL:
case LASER:
case SONIC:
break;
case DISINTEGRATE:
case DISRUPT:
phyStats().setDamage(1+(phyStats().damage()... | 9 |
public int getPlacesBooked(Booking b) {
DiningHall dh = b.getDiningHall();
int countBookings = 0;
Iterator<Booking> iter;
iter = bookings.iterator();
while (iter.hasNext()) {
Booking booking = iter.next();
if (booking.getDiningHall().equals(dh)
&& (booking.getDate().compareTo(b.getDate()) == 0)) {
... | 3 |
public void setFullScreen(boolean f) {
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice dev = env.getDefaultScreenDevice();
this.setBackground(Color.BLACK);
if (f) {
this.setResizable(false);
this.removeNotify();
... | 2 |
public void setNom(String value) {
nom = value;
} | 0 |
public SpellGroup getSpellGroup(String NAME)
{
SpellGroup grpStore;
for (int i=0;i<vctSpellGroups.size();i++)
{
grpStore = (SpellGroup)vctSpellGroups.elementAt(i);
if (NAME.equalsIgnoreCase(grpStore.strName))
{
return grpStore;
}
}
try
{
grpStore = new SpellGroup(NAME);
RandomAccessFi... | 7 |
public void draw(Graphics g)
{
if (!settings.isActive())
{
if (drawingImage.getWidth() != size.x || drawingImage.getHeight() != size.y)
{
drawingImage = new BufferedImage(size.x, size.y, BufferedImage.TYPE_INT_ARGB);
}
G... | 8 |
public void replaceSeq(String newSeq) {
if (newSeq.length() != seq.length()) throw new RuntimeException("Cannot replace by a sequence with different length: Operation not supported!");
seq = newSeq;
// Invalidate some tags
for (int i = 0; i < tags.length; i++) {
if (tags[i].startsWith("MD:Z:")) tags[i] = nu... | 4 |
public void run()
{
ItemStack[] p1OfferedItems = p1inv.getOwnItems();
ItemStack[] p2PendingItems = p2inv.getOthersItems();
if (!Arrays.equals(p1OfferedItems, p2PendingItems)) {
p2inv.setPendingItems(p1OfferedItems);
try {
cancelAccept(p2);
} catch (PlayerNotFoundExeption excepti... | 4 |
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.