text stringlengths 14 410k | label int32 0 9 |
|---|---|
@BeforeClass
public static void setUpBeforeClass() {
try {
String localTestProperty = System
.getProperty(BookStoreConstants.PROPERTY_KEY_LOCAL_TEST);
localTest = (localTestProperty != null) ? Boolean
.parseBoolean(localTestProperty) : localTest;
if (localTest) {
CertainBookStore store = new C... | 3 |
public Medicine findMedicine(int id) {
String query = "SELECT * FROM `medicine` WHERE `id` = %d LIMIT 1;";
Utils.DBA dba = Helper.getDBA();
Medicine m = new Medicine();
try {
ResultSet rs = dba.executeQuery(String.format(query, id));
rs.next();
m.setID... | 1 |
public static long convertUnitToOrigByte(String unitByte) {
if (isEmpty(unitByte)) return 0;
unitByte = unitByte.toUpperCase();
// , 제거
unitByte = unitByte.replace(",", "");
String regx = "^\\p{Digit}+(K|KB|M|MB|G|GB)?$";
if (!unitByte.matches(regx)) return 0;
long origByte = parseLong(stra... | 8 |
public boolean func_48647_a(PathEntity par1PathEntity)
{
if (par1PathEntity == null)
{
return false;
}
else if (par1PathEntity.points.length != this.points.length)
{
return false;
}
else
{
for (int var2 = 0; var2 < t... | 6 |
private void register() {
if (brokerUrl == null
|| registryId == null
|| (System.currentTimeMillis() - lastRegistered > 10 * 1000)) {
Response response = null;
if(getType().equals("producer")){
response = Announce.callAsProducer(getLocation());
} else {
response = Announce.callAsConsumer(regi... | 9 |
@Override
public void mouseMoved(MouseEvent event) {
if (isEnabled()) {
Row rollRow = null;
try {
boolean local = event.getSource() == this;
int x = event.getX();
int y = event.getY();
Row rowHit;
Column column;
Cursor cursor = Cursor.getDefaultCursor();
if (overColumnDivider(x) !... | 7 |
public void setType(Type otherType) {
Type newType = otherType.intersection(type);
if (type.equals(newType))
return;
if (newType == Type.tError && otherType != Type.tError) {
GlobalOptions.err.println("setType: Type error in " + this
+ ": merging " + type + " and " + otherType);
if (parent != null)
... | 6 |
public void changeCellType(int x, int y, CellType selectedMode, boolean delete) {
Cell cell = getCell(x, y);
switch (selectedMode) {
case FOOD:
if (cell.getType().equals(CellType.FOOD)) {
cell.setType(CellType.SPACE);
} else {
cell.setType(CellType.FOOD);
}
break;
case ANTHILL:
C... | 8 |
private void sendData( String message )
{
try // send object to server
{
output.writeObject( "CLIENT>>> " + message );
output.flush(); // flush data to output
System.out.println( "\nCLIENT>>> " + message );
} // end try
catch ( IOException ioException )
{
... | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Vector3f vector3f = (Vector3f) o;
if (Float.compare(vector3f.x, x) != 0) return false;
if (Float.compare(vector3f.y, y) != 0) return false;
... | 6 |
Pakkit(Plugin plugin) {
this.plugin = plugin;
final String serverPackage = this.plugin.getServer().getClass().getPackage().getName();
final String version = serverPackage.substring(serverPackage.lastIndexOf('.') + 1);
try {
this.craftPlayer = Class.forName(serverPackage + ".e... | 9 |
* @param output
*/
public static void translateLoomFile(String input, String output) {
{ Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();
Object old$PrintprettyP$000 = Stella.$PRINTPRETTYp$.get();
try {
Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
Native.s... | 9 |
public void UpdateLevelConditions() {
if (TimeMet() && TimePrimary) {
if (RequiredMet()) {
gameCondition = 2;
}
gameCondition = 3;
return;
} else if (RequiredMet()) {
gameCondition = 2;
} else if (p.health < 0) {
gameCondition = 3;
} else if (AnySecondaryMet()) {
gameCondition = 2;
} ... | 6 |
public void loadFromFile(File f) {
try {
ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(f));
Osoba osoba = null;
while((osoba = (Osoba) inputStream.readObject()) != null){
data.addElement(osoba);
}
inputStream.close();
fireTableDataChanged();
} catch (FileNotFoundExc... | 5 |
public static void writeAverageMetrics(String outputFile, int k, double size, boolean calcTags, boolean endLine) {
try {
FileWriter writer = new FileWriter(new File("./data/metrics/" + outputFile + "_avg.txt"), true);
BufferedWriter bw = new BufferedWriter(writer);
double recall = recallSum / size;
double... | 4 |
public FillFrame(DataStore DS) {
this.ds = DS;
this.setBounds(100, 100, 450, 300);
this.pane = new JPanel();
this.setContentPane(pane);
pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
JLabel lblTraitementDesErreurs = new JLabel("Traitement des erreurs :");
lblTraitementDesErreurs.setAlignment... | 3 |
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 |
public RowUndoSnapshot(Row row) {
mParent = row.getParent();
mOpen = row.isOpen();
mChildren = row.canHaveChildren() ? new ArrayList<>(row.getChildren()) : null;
} | 1 |
public Boolean dropGraph(String graphURI) {
this.dropGraphs.add(graphURI);
if(this.autoCommit){
//TODO ändern!!!
this.beginTransaction();
Boolean ret = this.commit();
this.endTransaction();
if(ret){
this.dropGraphs.clear();
}
return ret;
}
return null;
} | 2 |
public static int[][] loadColors(String filename) throws FileNotFoundException{
int[][] colors = new int[COLORDEPTH][3];
if (filename.equals("")){
return null;
}
File colorFile = new File("src" + File.separator + "mnd" + File.separator + filename);
if(!colorFile.exists()){
System.out.print("I... | 5 |
public VuePraticiens(CtrlAbstrait ctrlA) {
super(ctrlA);
initComponents();
} | 0 |
public void setB(float b) {
this.b = b;
} | 0 |
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
if(subMenu){
if(menuSelect==0)
if(newFileMenu)
if(l.mouseSelect(244, 170, 152, 28))
if(Mouse.isButtonDown(0))
sbg.enterState(1);
}
gc.setFullscreen(Main.fullScreen);
AppGameContainer appgc = (App... | 5 |
public Object get(int index) throws JSONException {
Object object = this.opt(index);
if (object == null) {
throw new JSONException("JSONArray[" + index + "] not found.");
}
return object;
} | 1 |
private ExtendedModInfo examinePathForMod(IDirectory dir) {
String path = dir.getPath();
String modMainFile = findModMainClassFilePath(dir);
if(modMainFile == null) {
return null;
}
if(!dir.exists(modMainFile.replace('.', '/'))) {
log.err("Directory[" + dir.getPath() + "] does not contain ... | 8 |
private Padding10() {
} | 0 |
private static JComponent[] copy(JComponent[] c) {
JComponent[] newArray = new JComponent[c.length];
for (int a = 0; a < c.length; a++) {
newArray[a] = c[a];
}
return newArray;
} | 1 |
public void run() {
setSizeField();
array = new ButtonArray(field.sizeField);
setBounds(500, 300, 500, 500);
this.setLayout(new GridLayout(field.sizeField, field.sizeField, 5, 5));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
field.initField();
Check check = ne... | 2 |
public boolean getBoolean(String key) throws JSONException {
Object o = get(key);
if(o==null) return false;
if (o.equals(Boolean.FALSE) ||
(o instanceof String &&
((String)o).equalsIgnoreCase("false"))) {
return false;
} else if (o.equals(Bool... | 7 |
public void visitTryCatchBlock(
final Label start,
final Label end,
final Label handler,
final String type)
{
buf.setLength(0);
buf.append(tab2).append("TRYCATCHBLOCK ");
appendLabel(start);
buf.append(' ');
appendLabel(end);
buf.append... | 1 |
public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... | 7 |
public int search(char[] word) {
int i, j, k;
ST_NODE tmpnode = new ST_NODE();
ST_NODE rnode = null;
int child;
byte cs;
for (i = 0, j = 0; j < word.length && i < this.search_end; i++) {
if (word[j] == this.search_word[i])
j++;
else break;
}
this.search_end = i;
if (this.search_end == 0 ) ... | 9 |
public static long arrayPositiveElementsSum(long[]array){
long sum = 0L;
for(long i:array)if(i>0)sum += i;
return sum;
} | 2 |
@SuppressWarnings("unused")
public static void main(String[] args) throws Exception {
long lall = 0, tall = 0;
int[] efforts = {1, 50, 100};
for(int effort : efforts) {
for(File f : new File("resources/testdata/").listFiles()) {
RandomAccessFile raf = new RandomAccessFile(f, "r");
byte[] data = n... | 3 |
public int CheckSmithing(int ItemID, int ItemSlot) {
boolean GoFalse = false;
int Type = -1;
if (IsItemInBag(2347) == false) {
sendMessage("You need a "+GetItemName(2347)+" to hammer bars.");
return -1;
}
switch (ItemID) {
case 2349: //Bronze Bar
Type = 1;
break;
case 2351: //Iron Bar
... | 8 |
private void unfilterPaeth(byte[] curLine, byte[] prevLine) {
final int bpp = this.bytesPerPixel;
int i;
for(i=1 ; i<=bpp ; ++i) {
curLine[i] += prevLine[i];
}
for(int n=curLine.length ; i<n ; ++i) {
int a = curLine[i - bpp] & 255;
int... | 8 |
private SceneObject getAt(final Tile tile) {
final SceneObject[] locations = SceneEntities.getLoaded(tile);
return locations.length > 0 ? locations[0] : null;
} | 1 |
public static void main(String[] args){
int[] dimension = {30,1,40,10,25};
// method 1
int min = CMMNo(dimension);
System.out.println(min);
// method 2
int[][] array = new int[dimension.length-1][dimension.length-1];
String[][] sequence = new String[dimension.length-1][dimension.length-1];
for(int i =... | 3 |
public void update(Avatar player, Map map, long gameTime) {
if (!isOutOfScreen) {
if (!canFall) {
Rectangle2D rectplayer = new Rectangle2D.Float(player.getX(),
player.getY(), 18, 18);
Rectangle2D thisrect = new Rectangle2D.Float(x - 1, y - 1, 19,
19);
if (rectplayer.intersects(thisrect)) {
... | 6 |
public static boolean withinRange(int objectType, int objectX, int objectY, int playerX, int playerY, int atHeight)
{
if(objectSizes.size() == 0)
loadObjectSizes();
int sizeX = 1;
int sizeY = 1;
if(objectSizes.get(objectType) != null)
{
sizeX = objectSizes.get(objectType)[0];
sizeY = objectSizes.get... | 5 |
public void run() {
// signal that this thread has started
threadStarted();
while (!isInterrupted()) {
// get a task to run
Runnable task = null;
try {
task = getTask();
}
catch (Int... | 4 |
private static void modRest(int decisio){
int opcio = 0;
while( opcio != 7 ) {
opcio = 0;
if(decisio == 1)System.out.println(" Indica el tipus de restriccio a modificar ");
if(decisio == 2)System.out.println(" Indica el tipus de restriccio a esborrar ");
Sy... | 9 |
public void onUserLogout(NetworkSharedUser user) {
if(thisUser == null) return;
if(privateChats.get(user.getId()) != null) {
privateChats.get(user.getId()).userDisconnected(user.getName());
}
globalChat.addText(user.getName() + " has logged out.");
model.removeElement(user.getName());
} | 2 |
private void doWalk(Ant ant) {
//set reachable and shuffle it
ACOUtil.changeReachable(reachable, 0);
ACOUtil.shuffleArray(reachable, rand);
ant.setWorkUnitIndex(0, reachable[0]);
for (int step = 1; step < indexes.length; step++) {
//1]
int previousIndex = ant.getWorkUnitIndex(step-1);
//2] comput... | 7 |
protected static boolean isWrapperClass(String name) {
return name.equals("java.lang.Integer")
|| name.equals("java.lang.Long")
|| name.equals("java.lang.Short")
|| name.equals("java.math.BigInteger")
|| name.equals("java.math.BigDecimal")
|| name.equals("java.lang.Float")
|| name.equals("java... | 9 |
public void update(){
if(speedX <0){
centerX += speedX;
}
if(speedX ==0 || speedX < 0){
bg1.setSpeedX(0);
bg2.setSpeedX(0);
}
if(centerX<=200 && speedX > 0){
centerX += speedX;
}//end scrolling else
if(centerY + speedY >=GROUND){
centerY = GROUND;
}
if(jumped==true){
speedY+=1;
if(centerY+sp... | 9 |
protected void paintComponent(Graphics g) {
if (isOpaque()) {
Dimension size = getSize();
g.setColor(getBackground());
g.fillRect(0, 0, size.width, size.height);
}
int stepSize = 0;
int cDist = 0;
int rDist = 0;
for (int vectorIndex =... | 9 |
protected int sync_header(byte [] stream){
int offset = 0;
for(; offset < stream.length; offset++)
if(stream[offset] == -1 &&
((stream[offset+1] & 0xf0) >>> 4)
== 0xf && (stream[offset+1]&0xf ) != 0xf)
break;
return of... | 4 |
public static String loadFile(String filePath)
{
String result = "";
FileInputStream inputStream = null;
DataInputStream dataInputStream = null;
StringBuilder stringBuilder = new StringBuilder();
String charset = "";
try
{
inputStream = new FileInputStream(filePath);
String line = "";
byte[] arr... | 7 |
public int findFreeNumSmallMemory(File file, final int blocksCount, final int blockSize) throws IOException {
final int vector_item_size = 32; //because we use int
int freeBlock;
if ((freeBlock = findFreeBlock(file, blocksCount, blockSize)) != -1) {
//find free num in block: read from file
int... | 8 |
public boolean removeVertex(final City city) {
int index = getIndex(city);
if (index < 0) {
return false;
} else {
cities[index] = null;
}
for (int i = 0; i < edges.length; i++) {
if (i == index) {
edges[index] = new int[edges[i... | 5 |
private static boolean isLocalMax(double[] frequencyData, int i) {
if (i - 1 < 0 || i + 1 >= frequencyData.length)
return false;
double left = frequencyData[i - 1];
double mid = frequencyData[i];
double right = frequencyData[i + 1];
if (right < mid && mid > left)
return true;
return false;
} | 4 |
private Color getPColor(Player p){
if(p instanceof White ){
return Color.WHITE;
}
else if(p instanceof Green){
return Color.GREEN;
}
else if(p instanceof Peacock){
return Color.BLUE;
}
else if(p instanceof Plum){
return Color.pink;
}
else if(p instanceof Scarlett){
return Color.RED;
}... | 5 |
private void fillHighScore(){
scores = Database.DatabaseInstance.fillTopScores(singlePlayer);
for(ScoreUser score : scores){
usernameLabel = new JLabel(score.getUserName());
usernameLabel.setForeground(Color.white);
toReturnPanel.add(usernameLabel);
scoreLabel... | 4 |
public void setActivityType(ActivityTypes activityType) {
this.activityType = activityType;
} | 0 |
public boolean isExpired() {
return expired;
} | 0 |
private void parseRest(String measureDefinition) {
for (int i = 1; i < measureDefinition.length(); i++) {
switch(measureDefinition.charAt(i)) {
case 't':
beats.add(SongEvent.TITLE_CARD);
break;
case '.':
beats.add(SongEvent.REST);
break;
case '-':
beats.add(SongEvent.HOLD);
break;
... | 4 |
public void initXML() {
vermilionCascadeNotebook.initDataDir();
File dataFile = new File(VCNConstants.WORK_FILE_PATH);
boolean isExistDataFile = dataFile.isFile();
if (!isExistDataFile) {
GeneralUtils.clearTree(vermilionCascadeNotebook.getTree());
TreeItem iItem = new VCNTreeItem(vermilionCascadeNoteb... | 1 |
public void gainItem(int id, int quantity) {
if (quantity >= 0) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
IItem item = ii.getEquipById(id);
MapleInventoryType type = InventoryConstants.getInventoryType(id);
if (!MapleInventory... | 5 |
public RdpPacket_Localised receive(Rdp rdpLayer) throws RdesktopException,
IOException, CryptoException, OrderException {
int sec_flags = 0;
RdpPacket_Localised buffer = null;
while (true) {
int[] channel = new int[1];
GWT.log("new receive at MCS");
buffer = McsLayer.receive(channel, rdpLayer);
GWT... | 7 |
public static double queryFoilGain(Cons rule, double utility, List coveredPos, List coveredNeg) {
{ int p = 0;
int n = 0;
double result = 0.0;
{ TrainingExample example = null;
Cons iter000 = coveredNeg.theConsList;
for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
... | 7 |
@EventHandler(ignoreCancelled = true)
public void handle(BlockBreakEvent event) {
Player player = event.getPlayer();
GameSession session = plugin.getGameManager().getGameSessionOfPlayer(
player);
if (session == null) {
return;
}
if (!(session.isStarted()) && !(session.isAdmin(player))) {
event.setC... | 5 |
boolean doubledUp( String token, String mergedCell, FragList cell )
{
if ( token.equals(mergedCell) )
{
if ( cell.fragments.size()==1 )
{
Atom a = cell.fragments.get(0);
if ( a instanceof Fragment )
{
Fragmen... | 5 |
public void insert(A a) {
assert a != null;
Match m = findMatch(a);
if (m.matchFound) {
m.node.contents = a;
splay(m.node);
} else {
Node parent = m.node;
Node newNode = new Node(a);
if (m.smallerThanNode) {
parent.setLeft(newNode);
} else {
paren... | 2 |
@Override
public List<Entry<String, List<?>>> getValue() {
List<Entry<String, List<?>>> ret = new ArrayList<>();
for(ParseOption<?> p : optionList) {
ret.add(new ArgsEntry<String, List<?>>(p.getShortOption(), p.getValue()));
}
return ret;
} | 5 |
private static void PriorityQueueMenu(PriorityQueue<Integer> PriorityQueue){
System.out.println("What do you want to do ?");
System.out.println("1) Dequeue");
System.out.println("2) Enqueue");
System.out.println("3) Print");
System.out.println("Enter your option");
try{
choose = in.nextInt();
switch ... | 6 |
public void focusLost(FocusEvent e) {
Debug.print("Focus changed on: " + e.getSource());
if(e.getSource() == txtName) {
// this is where we have lost focus, so now we need to populate the data
// See if we can find the Fermentable
Fermentable temp = new Fermentable();
temp.setName(txtName.getText());
... | 8 |
private ImageIcon getTexture(int id, int x, int y) {
switch (id) {
case 1:
field = new ImageIcon("Images/textures/Gras-Erde.png");
Rectangle rec = new Rectangle(x, y, dimension, dimension);
World.fieldColList.add(rec);
break;
case 2:
field = new ImageIcon("Images/textures/Erde.png");
break;
ca... | 4 |
void reportDetail(String date, BufferedWriter bw) {
List<Map<String, Object>> maps = getPersist().readMapList(Sql.get("report-detail.sql"), date);
for (Map<String, Object> map : maps) {
String supplierCode = map.get("suppliercode").toString();
String supplierName = map.get("name"... | 2 |
public boolean canSendNextPacket() {
if (timeStampNow - lastZeroWindow > getTimeOutMicros() && lastZeroWindow != 0 && maxWindow == 0) {
log.debug("setting window to one packet size. current window is:" + currentWindow);
maxWindow = MAX_PACKET_SIZE;
}
boolean windowNotFull = !isWondowFull();
boolean burstF... | 9 |
public static BufferedImage[] loadMultiImage(String s, int x, int y, int subImages) {
BufferedImage[] ret;
try {
final BufferedImage spritesheet = ImageIO.read(Images.class.getResourceAsStream(s));
ret = new BufferedImage[subImages];
for (int i = 0; i < subImages; i++)
ret[i] = spritesheet.getSubimag... | 2 |
public static void main(String args[]){
//crear un arreglo con frutas que me gusten
String frutas []={"kiwi", "mango", "sandia", "caña", "platano"};
for(String x:frutas){
System.out.println(x);
}
} | 1 |
public Vector<Object> subarray_as_Vector(int start, int end){
if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1));
Vector<Object> vec = new Vector<Object>(end-start+1);
for(int i=start; i<=end; i++)vec.addElement(array... | 2 |
public TransactionSet twoItemSubsets(TransactionSet candidSet, double minSupportLevel, TransactionSet transSet) {
//System.out.println("2 ItemSubsets starting");
//System.out.println("Starting ItemSet to make 2 item subsets");
TransactionSet allSubsets = new TransactionSet();/*New subset of transactions to ret... | 3 |
public void setArenaState(ArenaState state) {
this.arenastate = state;
} | 0 |
@Override
public HandshakeBuilder postProcessHandshakeResponseAsServer(
Handshakedata request, HandshakeBuilder response) throws Exception {
response.put("Upgrade", "websocket");
response.put("Connection", request.getFieldValue("Connection")); // to
// respond
// to
... | 1 |
@Override
public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) {} | 0 |
public String[] obtenerRespuestasCorrectas(int tamaño){
String csvFile = "dataset/diabetes_prueba_resultados.csv";
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
String respuestas [] = new String [tamaño];
int contador = 0;
try {
br = new BufferedReader(new FileReader(csvFile))... | 6 |
public HashMapStats(){
stats = new HashMap<StatType, Stat>(8);
} | 0 |
private JPanel createRoadtypeBox(String roadtypeString, boolean selected) {
JPanel roadTypeBoxPanel = new JPanel(new FlowLayout(0));
JCheckBox box = new JCheckBox(roadtypeString);
box = setLabelFont(box);
box.setSelected(selected);
box.addItemListener(new ItemListener() {
public void itemStateChanged(ItemE... | 8 |
public String getConfigPath(String filename) {
if (eng.isApplet()) return null;
File jgamedir;
try {
jgamedir = new File(System.getProperty("user.home"), ".jgame");
} catch (Exception e) {
// probably AccessControlException of unsigned webstart
return null;
}
if (!jgamedir.exists()) {
// try to ... | 9 |
@Override
public Object intercept(Invocation invocation) throws Throwable {
MappedStatement ms = (MappedStatement) invocation.getArgs()[0];
Object parameterObject = invocation.getArgs()[1];
final Configuration configuration = ms.getConfiguration();
final StatementHandler handler = co... | 7 |
public ConnectionLabelConfiguration( String id ) {
if( id == null ) {
throw new IllegalArgumentException( "id must not be null" );
}
this.id = id;
} | 1 |
private int[] getBaseEncoding(String encodingName) {
if (encodingName.equals("MacRomanEncoding")) {
return FontSupport.macRomanEncoding;
} else if (encodingName.equals("MacExpertEncoding")) {
return FontSupport.type1CExpertCharset;
} else if (encodingName.equals("WinAnsiE... | 3 |
private void setLookAndFeel() {
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/... | 6 |
@Test
public void determineHighestStraight_whenHandContainsTto7FourCardStraight_returnsNull() {
assertNull(findHighestStraight(nonStraightFiveFlush()));
} | 0 |
protected Behaviour getNextStep() {
if (eventsVerbose && begun()) {
I.sayAbout(actor, "NEXT COMBAT STEP "+this.hashCode()) ;
}
//
// This might need to be tweaked in cases of self-defence, where you just
// want to see off an attacker.
if (isDowned(target)) { // TODO: This might need ... | 9 |
public void visitTypeInsn(final int opcode, final String type) {
minSize += 3;
maxSize += 3;
if (mv != null) {
mv.visitTypeInsn(opcode, type);
}
} | 1 |
public void run() {
DCPU cpu = new DCPU();
this.display = ((VirtualMonitor)new VirtualMonitor().connectTo(cpu));
this.keyboard = ((VirtualKeyboard)new VirtualKeyboard(new AWTKeyMapping()).connectTo(cpu));
new VirtualClock().connectTo(cpu);
new VirtualFloppyDrive().connectTo(cpu);
new VirtualSlee... | 8 |
public int endElement(String name) throws MiniXMLException {
if (name == null)
throw new MiniXMLException(MiniXMLException._MXMLE_AE_UKNOWN_END_TOKEN);
if (name.compareToIgnoreCase(getName()) != 0)
throw new MiniXMLException(MiniXMLException._MXMLE_AE_UKNOWN_END_TOKEN);
int state = oState.getStateID();
oS... | 3 |
public static int decodeAnimationBytes( byte prgsection[], int offset, CHREditorModel modelRef) {
int cnt = 0;
int numAnimations = prgsection[offset + cnt] & 0xFF; cnt++;
int animDuration = prgsection[offset+cnt] & 0xFF; cnt++;
int animGrid[][] = new int[numAnimations][animDuration]... | 6 |
protected Item getPoison(MOB mob)
{
if(mob==null)
return null;
if(mob.location()==null)
return null;
for(int i=0;i<mob.location().numItems();i++)
{
final Item I=mob.location().getItem(i);
if((I!=null)
&&(I instanceof Drink)
&&(((((Drink)I).containsDrink())
&&(((Drink)I).liquidType()==RawM... | 8 |
public void deleteTable(byte[] table)
{
boolean isSystemTable = ForemanConstants.TableIdentifier.getIdentifierFromName(table) != null;
if (tableExists(table) && !isSystemTable)
{
instance.hdel(ForemanConstants.TableIdentifier.TABLE.getId(), table);
Set<byte[]> keys = instance.hkeys(table);
for (byte[] k... | 4 |
public boolean append(E element) {
if (lastPos == array.length - 1 || array.length == 0) {
changeCapacityBy(1);
if (array.length == 1) {
return setElement(0, element);
}
}
if (array.length > 0 && lastPos == 0 && array[lastPos] == null) {
... | 6 |
public void update(boolean up, boolean down, boolean left, boolean right, Dimension d) {
//check for movment
if(up){
this.setPlayerY(this.getPlayerY()-4);
}
else if(down){
this.setPlayerY(this.getPlayerY()+4);
}
if(left){
this.setPlayerX(this.getPlayerX()-7);
}
else if(right){
this.setPlay... | 8 |
protected static void createDescriptor()
{
try
{
InputStream descriptorStream = RtgParseControllerGenerated.class.getResourceAsStream(DESCRIPTOR);
InputStream table = RtgParseControllerGenerated.class.getResourceAsStream(TABLE);
boolean filesystem = false;
if(descriptorStream == null... | 9 |
@Override
public void keyPressed(int key, char character, GUIComponent component) {
switch (key) {
case (Keyboard.KEY_ESCAPE) : this.deactivate(500); break;
case (Keyboard.KEY_1) : suiteSelected(Card.CLUBS); break;
case (Keyboard.KEY_2) : suiteSelected(Card.DIAMONDS); bre... | 5 |
public void ENTER() {
if (atTitle) {
atTitle = !atTitle;
inTransition = !inTransition;
Pikachu = PikaDance1;
num = 0;
gameTimer.setDelay(25);
} else if (gamestarted && !inMenu && movable && !inBattle && !walking && !inDialog) {
SE.p... | 7 |
public void rowEventListener(RowEditEvent e) {
try {
PersonasDTO personasDTO = (PersonasDTO) e.getObject();
if (txtGenero == null) {
txtGenero = new InputText();
}
txtGenero.setValue(personasDTO.getGenero());
if (txtPrimerApellido ==... | 9 |
@Override
public Competicao get(Object key) {
try {
Competicao al = null;
Statement stm = conn.createStatement();
String sql = "SELECT Competicao.*,Torneio.* FROM Torneio,competicao WHERE Torneio.Cod_Torneio='" + (String) key + "'and competicao.cod_competicao=torneio.cod_... | 5 |
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.