text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void connect() throws NotConnectedException, IOException,
AuthenticationNotSupportedException, FtpIOException,
FtpWorkflowException {
setConnectionStatusLock(FTPConnection.CSL_INDIRECT_CALL);
socketProvider = new SocketProvider();
//... | 6 |
public void execute() {
String commandWithArgs;
System.out.println("Enter some command: ");
while (true) {
try {
commandWithArgs = br.readLine();
String result = executeCommand(commandWithArgs);
System.out.println(result);
... | 3 |
private Point generateDoor(Room room, Direction direction) {
switch (direction) {
case NORTH:
return new Point(generator.nextInt(room.getWidth() - 3) + 1, 0);
case SOUTH:
return new Point(generator.nextInt(room.getWidth() - 3) + 1, room.getHeight() - 1);
case EAST... | 4 |
public void setHit(){
if(hit)return;
hit = true;
animation.setDelay(70);
if(dx > 0 || dx < 0){
dx = 0;
}
if(dy > 0 || dy < 0){
dy = 0;
}
} | 5 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txt_num_estado = new javax.swing.JTextField();
txt_num... | 1 |
public void visit( DataVisitor visitor ){
visitor.visit( this );
for( Data<?> data : this ){
data.visit( visitor );
}
} | 2 |
public void paddleBounce(float center) {
velX *= -1;
velY += (getCenterY() - center) * DAMPING;
if (velY > MAX_SPEEDY)
velY = MAX_SPEEDY;
else if (velY < -MAX_SPEEDY)
velY = -MAX_SPEEDY;
} | 2 |
public long GetLargestPrimeFactor(long maxValue) {
if (knownPrimes.size() > 0) {
if (maxValue < (knownPrimes.get(knownPrimes.size() - 1))) {
for (int knowPrimeIndex = knownPrimes.size() - 1; knowPrimeIndex > 0; knowPrimeIndex--) {
if ((knownPrimes.get(knowPrimeInd... | 8 |
private static void addImgToXmlData(String data) {
try {
File fXmlFile = new File(path);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuild... | 5 |
private Receiver(ClientDavParameters parameters, List subscriptionInfos) throws Exception {
connection = new ClientDavConnection(parameters);
connection.connect();
connection.login();
DataModel dataModel = connection.getDataModel();
Iterator infoIterator = subscriptionInfos.iterator();
while(infoIterator.h... | 7 |
public LifeFrame nextFrame() {
LifeFrame next = new LifeFrame(new String[frame.height()][frame.width()]);
for (int i = 0; i < frame.height(); i++) {
for (int j = 0; j < frame.width(); j++) {
LifePosition lifePosition = new LifePosition(i, j);
if (shouldALive(l... | 3 |
private boolean isItemStackEqual(ItemStack par1ItemStack)
{
return this.stackSize != par1ItemStack.stackSize ? false : (this.itemID != par1ItemStack.itemID ? false : (this.itemDamage != par1ItemStack.itemDamage ? false : (this.stackTagCompound == null && par1ItemStack.stackTagCompound != null ? false : this... | 6 |
public static boolean presaPossibile(ICard card, List<ICard> tableCards, List<ICard> presa)
{
List<List<ICard>> possibiliPrese = getPrese(card, tableCards);
for(List<ICard> subp : possibiliPrese){
boolean equalsPresa = true;
if(subp.size() != presa.size())
equalsPresa = false;
if(equalsPresa)
for(... | 6 |
private Path writeToPatchContent() throws Exception {
if (getPatchMap().containsKey(etag)) {
return Files.write(getPath(), getPatchMap().get(etag));
}
return Files.write(getPath(), "default content".getBytes());
} | 1 |
public double[] prob(int[] ps, int pos) {
double[] p = new double[4];
double[] scores = new double[4];
for (int i = 0; i < windowsize; i++) {
if (i != whalf || true) {
scores[0] += matrix[0][ps[pos]][ps[pos + i - whalf]][i];
scores[1] += matrix[1][ps[pos]][ps[pos + i - whalf]][i];
scores[2] += matr... | 9 |
public static ExpressionParser createExpressionParser(ExpressionType type) {
switch (type) {
case SQL:
return SQL_PARSER;
case CACHE_KEY:
return KEY_PARSER;
case MONGO_SHELL:
return SHELL_PARSER;
default:
return null;
}
} | 3 |
public void hit() {
hp--;
switch(hp) {
case 0: this.color = Color.black; break;
case 1: this.color = Color.yellow; break;
case 2: this.color = Color.orange; break;
case 3: this.color = Color.blue; break;
case 4: this.color = Color.red; break;
}
} | 5 |
protected void passBaton(ServletRequest req, ServletResponse resp) {
if (nextFilter != null) {
nextFilter.doFilter(req, resp);
}
} | 1 |
int parse(String s) {
if (parseOne(s)) return 1;
if (parseTwo(s)) return 2;
if (parseThree(s)) return 3;
if (parseFour(s)) return 4;
if (parseFive(s)) return 5;
if (parseSix(s)) return 6;
if (parseSeven(s)) return 7;
if (parseEight(s)) return 8;
if... | 9 |
private int updateBeteckning() {
int res = 0;
if (!Validate.tfEmpty(tfBeteckning) && Validate.notOverSize(tfBeteckning)) {
try {
String query = "update spelprojekt set beteckning='" + tfBeteckning.getText() + "' where sid=" + selectedSpelprojekt;
DB.update(que... | 3 |
public Norm containsNormBelief(Belief blf, NormType nt)
{
for ( Norm norm: getAllRestrictNorms().values() )
{
Belief b = norm.getNormResource().getBelief();
if ( b!=null && b.getName().equalsIgnoreCase(blf.getName()) && norm.getNormType() == nt && norm.isActive() )
{
return norm;
}
}
return nu... | 5 |
public void enderman(Boolean mode){
if (mode != null){
enderman = mode;
}else{
enderman = true;
}
} | 1 |
public static void FESVoDistanceFrequency (int src)
{
// sorted sets for x and y values:
TreeSet<Integer> setX = new TreeSet<Integer>();
TreeSet<Integer> setY = new TreeSet<Integer>();
for (GeoTag tag : DATA.keySet()){
if (tag.sourceID == src){
se... | 8 |
public void paint(Graphics graphics) {
Graphics2D g = (Graphics2D) graphics;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
for (DrawableItem item : it... | 2 |
public ShipComponent(ArrayList<Double> stat, String shipType, int team)
{
try{
music = AudioSystem.getAudioInputStream(new File("CylonProjectile.wav"));
clip = AudioSystem.getClip();
clip.open(music);
}catch (UnsupportedAudioFileException|IOException|LineUnavaila... | 7 |
@Override
public void afterReturning(Object returnValue, Method method,
Object[] args, Object target) throws Throwable {
log.debug("method ends:" + method);
} | 0 |
private void calculateChanges() {
// Collection pcs = prices.values();
TreeSet<Float> dates = new TreeSet<Float>(PRICES.keySet());
// float[][] asArray = new float[dates.size()][dbSet.length];
// allocate variables
float[] startPrices = null;
float[] endPrices;
Iterator<Float> datadays = dates.iterator();... | 2 |
private Animation createLimpioAnim(Image img1, Image img2, Image img3, Image img4,
Image img5, Image img6,Image img7, Image img8, Image img9, Image img10, Image img11, Image img12,
Image img13, Image img14,Image img15, Image img16, Image img17) {
Animation anim = new Animation();
... | 0 |
public Grammar getLambdaProductionlessGrammar(Grammar grammar, Set lambdaSet) {
Grammar g = new ContextFreeGrammar();
g.addProductions(getProductionsToAddToGrammar(grammar, lambdaSet));
return g;
} | 0 |
public static void printMaxInWindow(int[] A, int windowSize) {
Deque<Integer> queue = new LinkedList<Integer>();
int i = 0;
while (i < windowSize) {
if (queue.isEmpty() || A[queue.getLast()] > A[i])
queue.add(i++);
else
queue.removeLast();
}
while (i < A.length) {
System.out.print(A[que... | 8 |
public Value naryOperation(final AbstractInsnNode insn, final List values)
throws AnalyzerException
{
if (insn.getOpcode() == MULTIANEWARRAY) {
return newValue(Type.getType(((MultiANewArrayInsnNode) insn).desc));
} else {
return newValue(Type.getReturnType(((Metho... | 1 |
private void CommandNewLibrary(Class<?> classArgs) {
initialized(SET, false);
String headerMessage = "Initializing ";
if (soundLibrary != null) {
currentLibrary(SET, null);
// we are switching libraries
headerMessage = "Switching to ";
soundLibrary.cleanup();
soundLibrary = null;
}
message(hea... | 9 |
public ClientReceivingSubscription(
final boolean isLocal,
final long applicationId, final long userId, final boolean drain, final boolean delayed, final boolean delta, final int state, final int conState) {
_local = isLocal;
_applicationId = applicationId;
_userId = userId;
_drain = drain;
_dela... | 7 |
public void mousePressed(MouseEvent e) {
dragStartScreen = e.getPoint();
dragEndScreen = null;
} | 0 |
public Object remove(int index) {
Object value;
// This method also checks that the index is valid (the queue is not
// empty)
index = getIndex(index);
value = queueData[index];
if (index == first) {
// This is the most common case for a queue
queueData[first] = null;
first = ... | 5 |
private void closeTextInFile()
{
try{
if (in != null) {in.close();}
if (inputStreamReader != null) {inputStreamReader.close();}
if (fileInputStream != null) {fileInputStream.close();}
}
catch(IOException e){
//ignore error while trying to close the file
//could lo... | 4 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String)object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.... | 6 |
private Rectangle copyRectangle(Rectangle from, Rectangle to) {
if (to == null) {
to = new Rectangle();
}
to.x = from.x;
to.y = from.y;
to.width = from.width;
to.height = from.height;
return to;
} | 1 |
private boolean isDifficulty(String cmd) {
for (GameDifficulty gD : GameDifficulty.values()) {
if (cmd.equalsIgnoreCase(gD.getName())) {
if (gD != GameDifficulty.CUSTOM) {
Minesweeper.getInstance().getOptionPanel().setDifficulty(gD);
Minesweepe... | 3 |
public String toString() {
// Fourni les codes couleur et l'indication des familles
String s = "";
String s1;
String s2;
for (int i = 0; i < 8; i++) {
s1 = "";
s2 = "";
for (int j = 0; j < 8; j++) {
s1 += matrix[i][j] + " ";
s2 += (matrixb[i][j] ? 1 : 0) + " ";
}
s += s1 + " ... | 3 |
void run(){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), T = sc.nextInt(), S = sc.nextInt();
int[] a = new int[n], b = new int[n];
for(int i=0;i<n;i++){
a[i] = sc.nextInt(); b[i] = sc.nextInt();
}
int[][] dp = new int[n][T+1];
for(int j=b[0];j<=T;j++){
dp[0][j] = dp[0][j-1];
if(!(j-... | 9 |
public void testConstructor_ObjectStringEx5() throws Throwable {
try {
new LocalTime("T10:20:30.040+04:00");
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
private void destroy(int x, int y) {
int mouseX = x;
int mouseY = y;
int rowCount = genX / blockSize;
int startY = (Math.round(mapY / blockSize))* rowCount + 1;
int endY = (Math.round((mapY + screenHeight) / blockSize) - 1)* rowCount;
if(startY < 0) startY = 0;
if(endY > map.length) endY ... | 8 |
@Override
public void addProgram(Program program) {
Double currentFitness = 0.0;
if(program.getFitness() == null) fitnessFunction.computeFitness(program);
currentFitness = program.getFitness();
int index = 0;
while (index < programs.size() && currentFitness > fitness.get(index)) {
index++;
}
this.pro... | 3 |
@Override
public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) {
if (e.getDocument() == null) {
setEnabled(false);
} else {
setEnabled(true);
}
} | 1 |
public List<Speaker> findSpeakersByHallEventId(final Long hallEventId) {
return new ArrayList<Speaker>();
} | 0 |
public static String[] getYMLConfig(String fileName) throws IOException{
String[] str = new String[2] ;
JarFile jarFile = new JarFile (fileName) ;
JarEntry jarEntry = jarFile.getJarEntry( StaticValue.JAR_YMLFILE ) ;
//Read .yml File
InputStream input = jarFile.getInputStream(jarEntry) ;
InputStrea... | 3 |
Class358(int[] is, int[] is_1_, int[] is_2_, float[][] fs) {
try {
((Class358) this).anIntArray4414 = is_2_;
((Class358) this).aFloatArrayArray4412 = fs;
((Class358) this).anIntArray4415 = is_1_;
((Class358) this).anIntArray4416 = is;
} catch (RuntimeException runtimeexception) {
throw Class3... | 5 |
public void mousePressed(MouseEvent e) {
boolean drag = dragNormal || dragPrecise;
if (!drag && (e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) {
dragNormal = true;
mouseSelect(e);
}
if (!drag && (e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) {
dragPrecise = true;
dragPreciseX = e.getPoint().... | 5 |
void trim() {
while(white()) { skip(); }
while (!eof() && curr() == '#') {
while(!eof() && curr() != '\n') { skip(); }
while(white()) { skip(); }
}
} | 6 |
public static void square(double x, double y, double r) {
if (r < 0) throw new RuntimeException("square side length can't be negative");
double xs = scaleX(x);
double ys = scaleY(y);
double ws = factorX(2*r);
double hs = factorY(2*r);
if (ws <= 1 && hs <= 1) pixel(x, y);
... | 3 |
@Override
public int altaDepartamento(Departamento departamento)
{
departamento.setIdDepartamento(-1);
EntityManager em = null;
EntityManagerFactory ef = null;
try
{
ef = Persistence.createEntityManagerFactory("MerkaSoftPU");
em = ef.cre... | 5 |
private Float searchRgb(int[] rgb) throws InterpException
{
for (Section paletteSection : sections)
{
if (paletteSection.inSection(rgb))
{
return paletteSection.process(rgb, true);
}
}
int diff = 0;
while (diff < 5)
{
diff++;
for (Section paletteSection : sections)
{
if (paletteS... | 5 |
@Override
public void keyPressed(int k) {
if(k == KeyEvent.VK_LEFT) player.setLeft(true);
if(k == KeyEvent.VK_RIGHT) player.setRight(true);
if(k == KeyEvent.VK_UP) player.setUp(true);
if(k == KeyEvent.VK_DOWN) player.setDown(true);
if(k == KeyEvent.VK_Z) player.setPummeling();
} | 5 |
private boolean isPlaying() {
return client.getSession() != null && client.getSession().getState() == ClientSession.State.PLAYING;
} | 1 |
private void heapifyAlaspain(int aloitusSolmu) {
int vasen = vasen(aloitusSolmu);
int oikea = oikea(aloitusSolmu);
if (taulukko[aloitusSolmu] == null) return;
if( oikea >= taulukko.length && vasen >= taulukko.length )
return;
if (taulukko[oikea] == null && taulukko[vasen] == null)
... | 9 |
public static double getScoreTopology(Graph[] g, Vector<String>[] seed)
{
int i=0, j=0, k=0;
double scoreTopology=0.0;
for(i=0;i<seed.length;i++)
{
for(j=i+1;j<seed.length;j++)
{
double scorePair=0.0;
for(k=0;k<seed[i].size();k++)
{
double[] mapSource=getAdiacMap(g[i],seed[i],seed... | 3 |
public List<Trip> getTripsByUser(User user) throws UserNotLoggedInException {
List<Trip> tripList = new ArrayList<Trip>();
User loggedUser = UserSession.getInstance().getLoggedUser();
boolean isFriend = false;
if (loggedUser != null) {
for (User friend : user.getFriends()) {
if (friend.equals(loggedUser)... | 4 |
public ArrayList getAnswers() {
ArrayList collectedAnswers = new ArrayList<String>();
for (int i = 0; i < table.getModel().getRowCount(); i++) {
collectedAnswers.add(tableModel.getValueAt(i, 0));
}
return collectedAnswers;
} | 1 |
public void run()
{
ArrayList<String> arrayAll = new ArrayList<>();
int fileServerSocketPort= 7000+ClientMain.myID_Num;
arrayAll=SQLiteView.viewAllContentInCDB();
System.out.println(">>>>>>>>>> CheckTheThroughput Start!!! <<<<<<<<<<");
for(String provider : arrayAll)
{
if(provider.split("@Sta... | 4 |
private static boolean isDoublePalindrome(int n){
return isPanlindrome(Integer.toBinaryString(n)) && isPanlindrome(Integer.toString(n));
} | 1 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
int row = jTable1.getSelectedRow();
int opc = select.getSelectedIndex();
jLabel2.setText("");
if (vendas_nao_avaliadas.size() > 0 && opc == 1 && row != -1) {
Venda v = (Venda) vendas_nao_avaliadas.... | 9 |
public void start() {
Parameters params = view.setParameters();
while (!params.checkIfParamsCorrect()) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
EvaluatedLens lens = new Eva... | 9 |
public void endGame(){
exit=true;
} | 0 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
public void setSymtab(Symtab st) {
if (f != null)
f.setSymtab(st);
else if (sd != null) {
Symtab structTable = new Symtab();
sd.setSymtab(st, structTable);
boolean isNew = st.enter(sd.getStructName(),
new SymtabEntry(sd.getStructName(), "struct",
structTable));
if (!isNew)
Main.error(... | 3 |
public Path(City a, City b){
first_city = a;
second_city = b;
} | 0 |
static private int jjMoveStringLiteralDfa0_0()
{
switch(curChar)
{
case 40:
return jjStopAtPos(0, 15);
case 41:
return jjStopAtPos(0, 16);
case 42:
return jjStopAtPos(0, 13);
case 43:
return jjStopAtPos(0, 11);
case 45:
return jjStopAtPos(... | 8 |
public static int dehexchar(char c) {
if(c >= '0' && c <= '9') {
return c - '0';
}
if(c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if(c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
private void diffDesc(int what, ArrayList<Change> list, DescRec rec,
HashMap<String, Object> map) {
if (map == null) {
System.out.println("Category '" + rec.getId() + "' is used but no longer listed");
return;
}
// Name or description changed?
String b = (String) map.get("name");
if (Change.fieldChan... | 3 |
private synchronized int flipBuffers()
{
if(!closed) {
synchronized (buffer) {
// wait until
while(buffer.size() <= 0) {
try {
buffer.wait();
}
catch (InterruptedException exc) {
// ignore it
}
if(!closed) return -1;
}
// reset read buffer with buff... | 4 |
public void describeBehaviour(Description d) {
if (applied != null) {
///if (stage == STAGE_TRANSPORT) super.describedByStep(d) ;
if (! super.describedByStep(d)) d.append("Treating") ;
d.append(" ") ;
d.append(patient) ;
d.append(" for ") ;
d.append(applied) ;
}
else if (... | 4 |
protected int myEndif(StringBuffer s, int i, String[] lastFoundMacro)
{
int endifsToFind = 1;
for (; i < s.length(); i++)
{
if (s.charAt(i) == '@')
{
final String foundMacro = parseFoundMacro(s, i, lastFoundMacro, true);
if ((foundMacro != null) && (foundMacro.length() > 0))
{
if (foundMac... | 7 |
private boolean isDragOk( final java.io.PrintStream out, final java.awt.dnd.DropTargetDragEvent evt )
{ boolean ok = false;
// Get data flavors being dragged
java.awt.datatransfer.DataFlavor[] flavors = evt.getCurrentDataFlavors();
// See if any of the flavors are a file ... | 7 |
public void writeExampleFiles() {
File dataFolder = getDataFolder();
File configFile = new File(dataFolder, "config.yml");
if (!configFile.exists()){
String content = ConfigUtil.fetchResource(SimpleTreasure.class, "resources/default.yml");
if (content != null){
if (ConfigUtil.writeFile(configFile, conte... | 8 |
@Override
public void actionPerformed(ActionEvent e)
{
switch(e.getActionCommand().charAt(0))
{
case 'u':
{
if(!TextUpload.upload(frame.text.getText())) break;
}
case 'c':
{
frame.dispose();
break;
}
}
} | 3 |
public static void addPrestigeTree(String prestige) {
BlankTree bt = new BlankTree();
//we do not allow multiple of the same tree
for(ClassTree ct : takenPrestigeTrees){
if(ct.getPrestige().equals(prestige))
return;
}
//find the first tree that is blank and replace the blank tree with our new cl... | 4 |
@Override
public boolean isValide(String antwoord) {
String delimiter = ";";
String[] tempAntwoord = antwoord.split(delimiter);
String[] tempJuistAntwoord = super.getAntwoord().split(delimiter);
if (tempJuistAntwoord.length > 1) {
if (!antwoord.contains(delimiter)) {
this.valideerTekst = "Het antwoor... | 5 |
public static void main(String[] args) {
int[] onesLen = new int[ONES.length];
int[] teensLen = new int[TEENS.length];
int[] tensLen = new int[TENS.length];
for (int i = 0; i < 10; i++) {
onesLen[i] = ONES[i].length();
teensLen[i] = TEENS[i].length();
... | 9 |
private void readAttribute( int index, Annotation[][] annotations, ConstantPool cp, ClassInputStream in )
throws IOException {
String name = cp.utf( in.uint16bit() );
int length = in.int32bit();
if ( "Code".equals( name ) ) {
CodeAttribute code = CodeAttribute.read( cp, in );
codes[index] = code.code();
... | 9 |
public static void init() {
if (!loaded) {
try {
metronomeTick = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream(FilePaths.METRONOME_TICK));
metronomeBell = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream(FilePaths.METRONOME_BELL));
noteF5 = AudioLoader.getAudio("WAV"... | 3 |
public void paintComponent(Graphics g) {
super.paintComponent(g);
for (MyLine line : lines) {
line.draw(g);
}
for (MyRectangle rectangle : rectangles) {
rectangle.draw(g, rectangle.getFilled());
}
for (MyOval oval : ovals) {
oval.draw(g,... | 3 |
@Override
public void train(Matrix features, Matrix labels, int k) throws Exception {
double[][] adjacencyMatrix = initializeAdjacencyMatrix(features);
String[] clusterNames = new String[features.rows()];
for (int i = 0; i < features.rows(); i++) {
clusterNames[i] = i + "";
}
// Change this t... | 6 |
private void renderDeck(Graphics2D g) {
Queue<Card> deck = game.getDeck();
Card topCard = deck.size() == 0 ? null : deck.peek();
double x = X_BOARD_OFFSET;
double y = DECK_Y;
g.setColor(Color.white);
g.drawString(deck.size() + " cards in deck", (float) x, (float) y - 1)... | 3 |
public static void quickSortNativeVector(edu.isi.stella.Stella_Object[] vector, int start, int end, java.lang.reflect.Method predicate) {
for (;;) {
{ int length = end - start;
Stella_Object splitelement = null;
Stella_Object element = null;
int lowcursor = start;
int highcurso... | 9 |
private boolean jj_3R_25() {
if (jj_scan_token(ARRAY)) return true;
if (jj_scan_token(OF)) return true;
if (jj_scan_token(INTEGER_LITERAL)) return true;
return false;
} | 3 |
public void setVariableA(String s)
{
A = s;
} | 0 |
@Override
public void follows(Hero hero) {
Random random = new Random();
if (random.nextInt(3)>0) {
if (hero.getX() == super.getX()) {
if (hero.getY()>super.getY()) {
super.setDirection(Direction.DOWN);
} else if (hero.getY()<super.getY... | 7 |
public set Intersection(set FirstSet, set SecondSet) {
//Make a new set
set ThirdSet = new set();
//Cycle through the first array and compare to the second
//to see what's in the first and the second
//add those elements to the third array
for (int i = 0; i < FirstSet.st... | 3 |
public void removeIncomingLink(Link l) {
Iterator<Link> iter = getIncomingLinks().iterator();
while (iter.hasNext()) {
if (iter.next().getLinkID() == l.getLinkID()) {
iter.remove();
}
}
} | 2 |
public void close() {
this.vue.setVisible(false);
} | 0 |
public boolean checkCollision(int uid, float x,float y){
Actor a;
// Comprobamos que este dentro del escenario
if (Math.sqrt((x*x)+(y*y))>radius) {
return true;
}
// Comprobamos que no este chocando con otro actor
for (Map.Entry entry : actores.entrySet... | 6 |
public void setCorrect(int attempts) {
if (attempts != 1) {
handler.getDataHandler().negateCorrect();
System.out.println("Negating attempts");
}
handler.getDataHandler().getAnswered().add(handler.getDataHandler().getFrame().getNumber());
handler.getDataHandler().g... | 4 |
@Test
public void findEstudentInActiviteTest() throws InstanceNotFoundException {
Activity a = activityService.find(0);
for (Student s : a.getStudents()) {
activityService.unEnrollsStudentToActivity(s, a);
}
Student s = familyService.findStudent(0);
activityService.enrollmentStudentInActivity(s, a);
as... | 1 |
public boolean reduceMemory(int reductionPolicy) {
int numToDo = 0;
synchronized (leastRectlyUsedLock) {
int lruSize = leastRecentlyUsed.size();
if (reductionPolicy == MemoryManagerDelegate.REDUCE_AGGRESSIVELY) {
numToDo = lruSize * 75 / 100;
} else if... | 6 |
ExecuteInfo multipleRuns(){ //the process which is called by the main function of SingleSourceKDiverseShortPath
long timeStart = System.currentTimeMillis();
int numItr = 0;
long maxHeap = 0;
long timeToReadMem = 0;
Random aRandom = new Random();
while(numNodesFoundKDivPath < numNodes){
int numDele... | 9 |
@Override
public int hashCode() {
int result = username != null ? username.hashCode() : 0;
result = 31 * result + (password != null ? password.hashCode() : 0);
result = 31 * result + personId;
return result;
} | 2 |
public JSONObject optJSONObject(int index) {
Object o = opt(index);
return o instanceof JSONObject ? (JSONObject)o : null;
} | 1 |
private void initStatusListFontMenu(Color bg) {
this.statustextListPanel = new JPanel();
this.statustextListPanel.setBackground(bg);
this.statustextListPanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
String initFontTmp = this.skin.getStatustextFont();
int initFontSi... | 7 |
public UserModel getUserByUserId(String userId) {
if (userId == null || userId.trim().isEmpty()) return null;
String hql = "from UserModel where userId = :userId";
List<UserModel> list = entityManager.createQuery(hql).setParameter("userId", userId).getResultList();
if (list == null || l... | 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.