text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void createSpriteGroup() {
BALLS_GROUP = new SpriteGroup("balls");
BARRIERS_GROUP = new SpriteGroup("barriers");
RACKET_GROUP = new SpriteGroup("racket");
BOUNDARYS_GROUP = new SpriteGroup("boundarys");
BALLS_GROUP.clear();
BARRIERS_GROUP.clear();
RACKET_GR... | 4 |
private void createGUI() {
if(panel != null) {
panel.removeAll();
panel.revalidate();
panel.repaint();
}
setTitle("Persoon aanmaken");
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setSize(500, 300);
... | 4 |
public static NBTList fromList(List<?> args)
{
final NBTList list = new NBTList(args.size());
for (Object arg : args)
{
final NamedBinaryTag tag = NBTParser.wrap(arg);
if (tag != null)
{
list.addTag(tag);
}
}
return list;
} | 3 |
public void open(Player player) {
InventoryLayout layout = layouter.getLayout(this, selections);
int slots = 0;
for (List<Selection> column : layout.getLayout()) {
if (column.size() > slots) {
slots = column.size();
}
}
slots *= 9;
... | 5 |
private static String readUrl(String urlstr) throws Exception {
BufferedReader reader = null;
try {
URL url = new URL(urlstr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getRespons... | 3 |
public static int countLeavesAtLevel(TreeNode<Integer> t, int level) {
if (t == null || level < 0) {
return 0;
}
/* at the specific level */
if (level == 0) {
if (t.right == null && t.left == null) {
return 1;
} else {
return 0;
}
} else {
return countLeavesAtLevel(t.left, level - 1)
... | 5 |
@Column(name = "item_id")
@Id
public int getItemId() {
return itemId;
} | 0 |
private void onHotkeySequenceProgressed() {
if(mHotkeySequenceCandidates != null) {
if(mHotkeySequenceCandidates.size() == 1 &&
mHotkeySequenceCandidates.get(0).getFirst().getNext() == null) {
// There is only one candidate left and it has no further
// hotkeys in the sequence, publish this and res... | 7 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnReproducir) {
reproducirMedio();
} else if (e.getSource() == btnSiguiente) {
siguiente();
} else if (e.getSource() == btnAnterior) {
anterior();
} else if (e.getSource() == btnDetener) {
detener();
} else if (e.getSour... | 8 |
@Test
public void testLengthFirst(){
int len = 2;
calc = new DataCalc(inData, numberOfPoints);
calc.createDataSet(0);
outData = calc.getStructureIn();
Assert.assertTrue(outData.getLength(0) == len);
} | 0 |
public void update(Level level, int x, int y, int z, Random rand) {
if(!level.growTrees) {
int var6 = level.getTile(x, y - 1, z);
if(!level.isLit(x, y, z) || var6 != DIRT.id && var6 != GRASS.id) {
level.setTile(x, y, z, 0);
}
}
} | 4 |
@Override
public boolean onStanza(XMLStreamReader parser) throws XMLStreamException {
if(!parser.getLocalName().equals("iq")) return false;
String stanzaId = parser.getAttributeValue(null, "id");
if(!iqStanzaIds.contains(stanzaId)) return false;
iqStanzaIds.remove(stanzaId);
parser.nextTag();//Skip ... | 8 |
public void SetScreen(NetworkGameScreen screen){
this.screen = screen;
synchronized (this) {
notify();
}
} | 0 |
private static void method493(Stream buffer, char arg1[][], byte arg2[][][]) {
for (int chars = 0; chars < arg1.length; chars++) {
char ac1[] = new char[buffer.getUnsignedByte()];
for (int k = 0; k < ac1.length; k++) {
ac1[k] = (char) buffer.getUnsignedByte();
}
arg1[chars] = ac1;
byte byteArray[][... | 4 |
public void load(MCDObjet mcdobject)
{
this.mcdobject = mcdobject;
if (mcdobject instanceof MCDEntite)
setTitle( Utilities.getLangueMessage (Constantes.MESSAGE_ENTITE) + "...");
else if (mcdobject instanceof MCDAssociation)
setTitle( Utilities.getLangueMessage (Const... | 2 |
@EventHandler(priority = EventPriority.NORMAL)
public void onSignChange(SignChangeEvent event){
Player p = event.getPlayer();
for(int i = 0; i<event.getLines().length; i++){
if(event.getLine(i).toLowerCase().contains("[sortal]") || event.getLine(i).toLowerCase().contains(plugin.signContains)){
if(event.getP... | 5 |
public void gainXp(int xpGain){
gameSaved = false;
careerKills++;
if(currentForm == -1) shipXp+=xpGain;
else if (currentForm == 0){ fireFormXp+=xpGain;}
else if (currentForm == 1){ lightningFormXp+=xpGain;}
else if (currentForm == 2){ windFormXp+=xpGain;}
System.out.println("Ship XP: " +shipXp);
System.out.pr... | 8 |
@Override
public void registerSubCommands()
{
CommandBuilder<InvokableMethod> builder = getManager().getProviderManager().getBuilder(InvokableMethod.class);
for (Method method : ParametricBuilder.getMethods(this.getClass()))
{
CommandBase command = builder.buildCommand(this, ... | 2 |
@Override
public void offeringClicked(OffRec offering, boolean toKill) {
CourseRec course = offering.getCourse();
selectCourse(course);
if (toKill && offering.getStatus() != Status.NO) {
offering.setStatus(Status.NO);
try {
courseModel.saveStatusFile();
} catch (IOException e) {
JOptionPane.s... | 3 |
private void stelSpelIn(){ //geeft alle ingegeven opties en waarden door aan de controller
try{
spel.resetSpel();
spel.setLevel((String) levelCB.getSelectedItem());
try{
spel.setMaxWind(Integer.parseInt(maxWindInput.getText()));
} catch(NumberForma... | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
final Door other = (Door) obj;
if (this.location != other.location && (this.location == null || !this.location.equals(other.location))) ret... | 6 |
private void dfs(Graph<?> G, Object v) {
this.marked.put(v, true);
this.id.put(v, initId);
for (Object temp : G.getAdjacentVertices(v)) {
if (!marked.get(temp)) {
dfs(G, temp);
}
}
} | 3 |
protected static FastVector merge(Sequence seq1, Sequence seq2, boolean oneElements, boolean mergeElements) {
FastVector mergeResult = new FastVector();
//merge 1-sequences
if (oneElements) {
Element element1 = (Element) seq1.getElements().firstElement();
Element element2 = (Element) seq2.getEl... | 9 |
public void acceptSettings(ModelSettings settings) {
if (settings.getInit() == InitType.no) {
while (Vertex.initialSet.size() > 0)
Vertex.initialSet.first().setInitial(0);
}
if (settings.getInit() == InitType.one) {
while (Vertex.initialSet.size() > 1)
... | 4 |
public GraphPreferencesDialog(GUI parent){
super(parent, "Preferences", true);
GuiHelper.setWindowIcon(this);
this.parent = parent;
JPanel cp = new JPanel();
cp.setLayout(new BorderLayout());
cp.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
JPanel visualDetails = new JPanel();
visualDetail... | 5 |
public void createList() {
list.setVisible(false);
listScroller.setVisible(false);
list = null;
listScroller = null;
list = new JList<Object>(parser.getConstructList().toArray());
list.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() ==... | 4 |
@Override
protected void setStatementParameters(PreparedStatement preparedStatement, WhereClause whereClause) throws IOException {
int index = 0;
for (WhereConstraint constraint : whereClause.getWhereConstraints()) {
for (Object parameter : constraint.getParameters()) {
if (parameter == null) {
... | 9 |
public void Interface() {
int buffersize = 1024;
char stdInbuffer[] = new char[buffersize];
BufferedReader stdIn = new BufferedReader(new InputStreamReader(
System.in)); // makes reading from keyboard/shell ready
// 1. read from keyboard
// 2. send to Server
// 3. catch server answer
// 4. start ... | 4 |
public void checkTripleBuffer()
{
if (tripleBuffer != null)
{
if (tripleBuffer.getWidth() != getWidth()
|| tripleBuffer.getHeight() != getHeight())
{
// Resizes the buffer (destroys existing and creates new)
destroyTripleBuffer();
}
}
if (tripleBuffer == null)
{
createTripleBuffer(g... | 4 |
public List<String> orderList(List<String> listStr) {
List<String> orderedList = new ArrayList<String>();
for(String s : listStr) {
if(s.contains("AIRFIELD")) {
orderedList.add(s);
}
}
for(String s : listStr) {
if(s.co... | 7 |
@RequestMapping(value = "/speaker-object/{id}", method = RequestMethod.GET)
@ResponseBody
public SpeakerObjectResponse speakerObject(
@PathVariable(value = "id") final String idStr
) {
Boolean success = true;
String errorMessage = null;
Speaker speaker = null;
Lo... | 1 |
@Test
public void containTest(){
int[] b = new int[10];
Arrays.fill(b,0);
Assert.assertArrayEquals((int[])d.getFromKit(0),b);
} | 0 |
private void pelaajaRivi(String string) {
if(string.charAt(1) != ' ') {
return;
}
ArrayList<Integer> koordinaatit = stringKoordinaateiksi(string);
ArrayList<Piste> pisteet = muutaPisteiksi(koordinaatit);
taso.asetaPelaajanAlkusijainti(pisteet.get(0));
} | 1 |
@Override
public int compare(Object o1, Object o2)
{
Chunk chunk = (Chunk)o1;
Chunk other = (Chunk)o2;
if(chunk.visible || !other.visible)
{
if(other.visible)
{
float sqDist = chunk.distanceSquared(player);
float otherSqDist = other.distanceSquared(player);
if(sqDist == otherSqDist)
{
... | 5 |
public boolean getIgnoreCase(int i) {
return ((Boolean) this.ignoreCases.get(i)).booleanValue();
} | 0 |
private void calculatorButtonListeners() {
calculatorButton.addMouseMotionListener(genericMouseMotionListener);
calculatorButton.addMouseListener(new MouseListener() {
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouse... | 4 |
private void loadFromSubdirectory(File dir, String baseName) {
logger.info("Loading in subdir " + dir
+ " with basename " + baseName);
int baseNameLength = baseName.length();
File[] files = dir.listFiles();
logger.info("Le listing : " + files);
//for (int i = 0; i < files.length; i++) {
for (File... | 5 |
public Object get(String atrName) {
Object ret = null;
if (atrName.equals(LABEL)) {
ret = g.getLabel();
} else if (atrName.equals(DIRECTED)) {
ret = g.isDirected();
} else if (atrName.equals(ZOOM)) {
ret = g.getZoom();
} else if (atrName.equals... | 9 |
private void newWorkSpace(){
Main.setFileBase(null);
Main.setStructureBase(null);
listDataOut = null;
// setDataBase(dataBase);
setDataBase();
int mainTableRowCount = modelMainTable.getRowCount();
int resultTableRowCount = modelResultTable.getRowCount();
... | 2 |
private static Staff parseInitialDataStaff(Document doc, Address restAddress){
NodeList ChefList = doc.getElementsByTagName("Chef");
ArrayList<MockChef> RestChefs= new ArrayList<MockChef>();
for (int j = 0; j < ChefList.getLength(); j++) {
Node ChefNode = ChefList.item(j);
if (ChefNode.getNodeType() == Node... | 4 |
public BreakBlock(BreakableBlock breaksBlock, boolean needsLabel) {
this.breaksBlock = (StructuredBlock) breaksBlock;
breaksBlock.setBreaked();
if (needsLabel)
label = breaksBlock.getLabel();
else
label = null;
} | 1 |
private SecuredMessageTriggerBean followLinksProblem(SecuredMessageTriggerBean message) throws GranException {
String text = message.getDescription();
SecuredTaskBean task = message.getTask();
EggBasket<SecuredUDFValueBean, SecuredTaskBean> refs = AdapterManager.getInstance().getSecuredIndexAdap... | 6 |
public static void initBlocks() {
for (int y = 0; y < blocks.length; y++) {
for (int x = 0; x < blocks[0].length; x++) {
// System.out.println((x * Configuration.TILE_DIMENSION.width) +
// " " + (y * Configuration.TILE_DIMENSION.height));
if ((y * Configuration.TILE_DIMENSION.height) < (6 * Configurati... | 9 |
public void postOrderIterative(Node head) {
if (head == null) {
return;
}
LinkedList<Node> stack = new LinkedList<Node>();
stack.push(head);
while (!stack.isEmpty()) {
Node next = stack.peek();
boolean finishedSubtrees = (next.right == head |... | 8 |
private boolean increment(boolean[] input, int startPos, int endPos) {
// Obtém o tamanho da entrada.
int length = (endPos - startPos) + 1;
// O incremento para resolver a nossa questão do trabalho sempre será 1,
// mas para que o código ficasse genérico, fizemos o array de incremento
// com o me... | 9 |
public static void handleEvent(int eventId)
{
if(eventId == 1)
{
System.out.println("Level one selected");
}
else if(eventId == 2)
{
System.out.println("Level two selected");
}
else if(eventId == 3)
{
System.out.println("Level three selected");
}
else if(eventId == 4)
{
... | 5 |
protected void setupMap(String mapName)
{
Logger.log("Loading map: " + mapName);
map = MapLoader.loadMap(mapName);
List<Entity> entities = new ArrayList<Entity>(0);
for (ITileObject tile : map)
{
if (tile instanceof RenderMapTile)
addComponent((RenderMapTile) tile);
else if (tile instanceof Chara... | 5 |
@Override
public void process(HashMap data) {
String event = (String) data.get($EVENT$);
String nick = (String) data.get($NICK$);
String channel = (String) data.get($TARGET$);
if (event.equals("JOIN")) {
dataList.JoinNick(nick, channel);
} else if (event.equals("PART")) {
dataList.PartNick(nick, dataL... | 9 |
public static void main(String[] args) {
character.Character character = CharacterFactory.create().buyCharacter(Constants.CHARACTER_ASSASSIN);
System.out.println(character.toString());
//character = CharacterFactory.getCharacter("mage");
//System.out.println(character.toString());
//character = Charact... | 0 |
public void estadoDelimitadores() {
char del = Token[contador];
int deli = del;
if (deli == 59) {
listaDeTokens.add("Delimitador Ponto e vírgula: "+del + ": linha: " + linha2);
}
if (deli == 44) {
listaDeTokens.add("Delimitador vírgula: "+del + ": linha: "... | 8 |
public void probaVector() {
// TODO Auto-generated method stub
double sSquare = 0;
probaVector = new double[level];
for(int i=0; i<level; i++){
double[] coeff = getCoefficients(i+1);
Vector vec = new Vector(coeff);
sSquare = sSquare + Math.pow(vec.getNorm(),2);
}
for(int i=0; i... | 3 |
private void deleteSelectedDuplicate() {
for (int i=0; i<fileCheckBoxArray.size(); i++) {
ArrayList<JCheckBox> tmpCheckBoxArray = fileCheckBoxArray.get(i);
ArrayList<File> tmpFileDuplicateArray = fileDuplicateArray.get(i);
for (int j=0; j<tmpCheckBoxArray.size(); j++) {
if (tmpCheckBoxArray.get(j).isSele... | 6 |
public static final int getDirectBufferByteOffset(Buffer buffer) {
if (buffer == null) {
return 0;
}
if (!(buffer instanceof ByteBuffer)) {
if (!(buffer instanceof FloatBuffer)) {
if (buffer instanceof IntBuffer) {
return buffe... | 8 |
public static Class primitiveTypeFor(Class wrapper) {
if (wrapper == Boolean.class) return Boolean.TYPE;
if (wrapper == Byte.class) return Byte.TYPE;
if (wrapper == Character.class) return Character.TYPE;
if (wrapper == Short.class) return Short.TYPE;
if (wrapper == Integer.class... | 9 |
@Override
public void windowClosing(WindowEvent e) {
Forme forme = (Forme) o;
Toolkit.getDefaultToolkit().beep();
int rep = JOptionPane.showConfirmDialog(forme, "Voulez-vous vraiment quitter ?", "Quitter", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (rep == JOptionPa... | 1 |
public List findByRegip(Object regip) {
return findByProperty(REGIP, regip);
} | 0 |
@Override
public boolean equals(Object obj) {
if (super.equals(obj)) {
IntArrayTag o = (IntArrayTag) obj;
return ((data == null && o.data == null) || (data != null && data.equals(o.data)));
}
return false;
} | 4 |
private String getStockImage(Element categories, String contextPath)
throws CitysearchException {
if (imageMap == null) {
getImageMap();
}
String imageURL = null;
if (categories != null && imageMap != null) {
List<Element> categoryList = categories.getChildren(CATEGORY);
int size = categoryList.size... | 8 |
@Override
public void update(Observable o, Object arg) {
switch (arg.toString()) {
case "reinitialiser":
this.initialisation();
this.labelInstructionsJoueur.setText("Vous pouvez déplacer vos bateaux sur la grille de droite.");
... | 7 |
public static int SalvarAssistec(bAssisTec bObj) throws ClassNotFoundException, SQLException {
int ret;
Connection conPol = conMgr.getConnection("PD");
if (conPol == null) {
throw new SQLException("Numero Maximo de Conexoes Atingida!");
}
try {
call = conP... | 3 |
public void setSomeStrArray(String[] someStrArray) {
this.someStrArray = someStrArray;
} | 0 |
public int compare(String o1, String o2)
{
String s1 = (String)o1;
String s2 = (String)o2;
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length)
{
... | 8 |
public static ByteBuffer serializedWriteBuffer(Class<?> c, Object targetObj) throws InstantiationException, IllegalAccessException, IOException{
ByteBuffer buffer = ByteBuffer.allocate(_defaultByteSize);
Output out = null;
_kryoMap.get().register(c);
int retry = 10;
while(retry-- != 0){
logger.... | 8 |
public HttpResponse safeExecute(HttpHost target, HttpUriRequest request) throws IOException {
if (target == null) {
target = determineTarget(request);
}
try {
return getHttpClient().execute(target, request);
} catch (NullPointerException e) {
// this ... | 6 |
private Method findMethodFor(String propertyName, Class<?> clazz) {
for (Method m : clazz.getMethods()) {
if (m.getName().equalsIgnoreCase("set" + propertyName)) {
return m;
}
}
return null;
} | 3 |
public static void main(String[] args) {
args = new String[] {"LiveVarsClass"};
Scene.v().setSootClassPath(Scene.v().defaultClassPath()+":res");
Options.v().set_src_prec(Options.src_prec_java);
Options.v().set_output_format(Options.output_format_jimple);
//add process-dirs
File fld = n... | 7 |
@Test
public void testCheckCIMsNValidatedCIMsCTNode() {
Set<String> states;
// Not empty state set
states = new TreeSet<String>();states.add("p1_1");states.add("p1_2");
CTDiscreteNode nodeP1 = new CTDiscreteNode("p1",states);
states = new TreeSet<String>();states.add("p2_1");states.add("p2_2");states.add(... | 7 |
public List<Pessoa> buscar(Pessoa filtro) throws Exception {
try {
String sql = "select * from pessoa ";
String where = "";
if (filtro.getNome().length() > 0) {
where = "nome like '%" + filtro.getNome() + "%'";
}
/* if (filtro.getVal... | 8 |
private BigInteger readBignumBody(final boolean shouldBeNegative)
throws IOException {
int length = readInt();
if (trace == API_TRACE_DETAILED) {
debugNote("readBignumBody shouldBeNegative=" + shouldBeNegative + " length=" + length);
}
byte[] b = new byte[length];
for (int i = length... | 4 |
@Override
public int compareTo(Employee emp) {
//let's sort the employee based on id in ascending order
//returns a negative integer, zero, or a positive integer as this employee id
//is less than, equal to, or greater than the specified object.
return (this.id - emp.id);
} | 0 |
public static ArrayList<ArrayList<Double>> stringToFreqs(String string) {
ArrayList<ArrayList<Double>> v = new ArrayList<ArrayList<Double>>();
Scanner scn = new Scanner(string);
while (scn.hasNext()) {
ArrayList<Double> notes = new ArrayList<Double>();
String str = scn.next();
boolean contained = false;
... | 6 |
private static int findLargestIndex(char[] n, int range, int starting){
int index = starting;
char max = n[starting];
for(int i=starting+1;i<starting+range;i++){
if(i>=n.length) break;
if(n[i]>max){
max=n[i];
index=i;
}
}
return index;
} | 3 |
public void add(int item)
{
if (capacity > 0 && item >= capacity)
return;
if (item < min) {
min = item;
countmin = 0;
}
if (item == min)
countmin += 1;
if (item > max) {
max = item;
countmax = 0;
}
if (item == max)
countmax += 1;
n += 1;
sum += item;
sqrsum += item * item;
if (item >= 0 && item... | 9 |
private void closeSesion() {
if (session != null && session.isOpen())
session.close();
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Permesso other = (Permesso) obj;
if (nome == null) {
if (other.nome != null)
return false;
} else if (!nome.equals(other.nome))
retur... | 6 |
public void ApplySequence(BufferedWrapper bw, float ratio)
{
int which = 0;
int[] order = GetOrder();
GSR gsr = new GSR();
for (int i : order)
{
switch (i)
{
case GS: //grayscale
Filters.GrayScaleStatic(bw);
break;
//========================================... | 9 |
private static Map<String, Object> serializePrimitive(Object primitive) {
Map<String, Object> data = new HashMap<String, Object>();
if (primitive instanceof Integer)
data.put("T", "I");
else if (primitive instanceof Long)
data.put("T", "J");
else if (primitive ins... | 8 |
private Color getFore(LoggingEvent event, boolean selected) {
if(selected) {
return this.base.getForeground();
}
final Level lvl = event.getLevel();
switch(lvl.toInt()) {
case Level.DEBUG_INT: {
return Util.blend(this.bas... | 7 |
public void convertAndCompareGedcom(File file) {
ModelParser parser = new ModelParser();
parser.setErrorHandler(this);
TreeParser treeParser = new TreeParser();
treeParser.setErrorHandler(this);
GedcomWriter writer = new GedcomWriter();
try {
hasError = false;
log... | 7 |
public void updateElevatorPointer() {
if (Math.sqrt(Math.pow(mouse.xPos - buttonX, 2) + Math.pow(mouse.yPos - (panelTop + panelHeight / 3), 2)) < buttonR && currentLevel != 5) { // over up button
elevatorPointer = ep_UP;
} else if (Math.sqrt(Math.pow(mouse.xPos - buttonX, 2) + Math.pow(mouse... | 9 |
public final String toDSML(HPDInstanceModel hpd, HPDClientConfig config) {
String baseDNOffset = new String();
String dsmlScope = new String();
switch (getSearchScope()) {
case AllEntities:
//Do Nothing for the offset, but the depth needs to be 2 levels
... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ManutencaoModel other = (ManutencaoModel) obj;
if (!Objects.equals(this.reqModelo, other.reqModelo)) {
... | 3 |
@Test
public void testAstarTree() throws IOException{
HashMap<String,String[]> fromTo = new HashMap<String,String[]>();
fromTo.put("results_wolfeb_178816527_178816525_0_astar.txt", new String[]{"178816527", "178816525"});
fromTo.put("results_wolfeb_330767681_178817851_0_astar.txt", new String[]{"330767681", "... | 6 |
@EventHandler
public void SlimeWaterBreathing(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.getSlimeConfig().getDouble("Slime.Wat... | 6 |
public void visitEnd() {
if (state != CLASS_TYPE) {
throw new IllegalStateException();
}
state = END;
if (sv != null) {
sv.visitEnd();
}
} | 2 |
public boolean isPiece(Position pos){
return !isEmpty(pos) && (!(getPiece(pos) instanceof King));
} | 1 |
public static OOXMLElement parseOOXML( XmlPullParser xpp, Stack<String> lastTag )
{
ArrayList<Gd> gds = null;
try
{
int eventType = xpp.getEventType();
while( eventType != XmlPullParser.END_DOCUMENT )
{
if( eventType == XmlPullParser.START_TAG )
{
String tnm = xpp.getName();
if( tnm.eq... | 7 |
private void resize() {
size = getSkinnable().getWidth() < getSkinnable().getHeight() ? getSkinnable().getWidth() : getSkinnable().getHeight();
width = getSkinnable().getWidth();
height = getSkinnable().getHeight();
if (width > height) {
width = 1 / (ASPECT_RATIO / heigh... | 9 |
public Texture loadImage(String filename) {
try
{
return TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/res/" + filename + ".png"));
} catch (FileNotFoundException e)
{
System.err.println("File: '" + filename + "' was not found.");
} catch (IOException e)
{
System.err.print... | 2 |
private void writeFin(String user, int glID, String resName,
double cost, double cpu, double clock,
boolean header)
{
if (trace_flag == false) {
return;
}
// Write into a results file
FileWriter fwriter = null;
... | 5 |
public TelaAdministrador() {
initComponents();
setLocationRelativeTo(null);
//
// u.getUsuario(u.usuario);
// if (u.getTipo_usuario() == 1) {
// JB_Vender1.setVisible(false);
// }
JB_Novo_Evento.getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.get... | 8 |
@Override
public int hashCode() {
int hash = 0;
hash += (idPrueba != null ? idPrueba.hashCode() : 0);
return hash;
} | 1 |
public static ArrayList<Integer> ordenar(ArrayList<Integer> lista) {
boolean ordenado = false;
int tamanho = lista.size() - 1;
while(ordenado == false) {
ordenado = true;
for(int i = 0; i < tamanho; i++) {
if(lista.get(i) > lista.get(i + 1)) {
int aux = lista.get(i);
lista.set(i, lista.... | 3 |
private boolean jj_3R_23() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_24()) {
jj_scanpos = xsp;
if (jj_3R_25()) {
jj_scanpos = xsp;
if (jj_3R_26()) {
jj_scanpos = xsp;
if (jj_3R_27()) {
jj_scanpos = xsp;
if (jj_3R_28()) {
jj_scanpos = xsp;
if (jj_3R_29()) return true;
... | 6 |
@Override
public void writeWord(long addr, int data) {
int regaddr;
regaddr = (int) (addr & getAddressMask(LEN_WORD_BITS));
switch (regaddr) {
case REG_SCCTRL:
//do nothing
break;
case REG_SCPeriphID0:
case... | 9 |
public static final void EnterCS(final int playerid, final MapleClient c) {
final CashShopServer cs = CashShopServer.getInstance();
final CharacterTransfer transfer = cs.getPlayerStorage().getPendingCharacter(playerid);
if (transfer == null) {
c.getSession().close();
ret... | 7 |
public static boolean zmq_socket_monitor(SocketBase s_, final String addr_, int events_) {
if (s_ == null || !s_.check_tag ()) {
throw new IllegalStateException();
}
return s_.monitor (addr_, events_);
} | 2 |
public boolean isScramble(String s1, String s2) {
int l1 = s1.length();
int l2 = s2.length();
if (l1 != l2)
return false;
if (s1.equals(s2))
return true;
int i;
int sum1, sum2;
for (i = 0, sum1 = 0, sum2 = 0; i < l1; i++) {
sum1 += s1.charAt(i) - 'a';
sum2 += s2.charAt(i) - 'a';
}
if (sum1... | 9 |
public static Date addDay(Date date, int day) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, day);
return calendar.getTime();
} | 0 |
public CommandListener(){
CommandList commands = new CommandList();
String inputString;
while(true) {
Scanner sc = new Scanner(System.in);
inputString = sc.nextLine(); // you could swith it with nextInt(), nextFloat() etc based on yoir need
if(inputS... | 9 |
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.