text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String fullMap(){
String map = "";
for (int i = 0; i < 15; i++){
for (int j = 0; j < 11; j++){
if (rooms[i][j] != null)
if (i == currentY && j == currentX)
map += "[*]";
else
map += rooms[i][j];
else
map += " ";
}
map += "\n";
}
return map;
} | 5 |
private void save(String nameV,String surnameV,String usernameV,String passV,String oximaV,String action){
/*
* apothikeuei ta stoixia i tis allages sthn vash kai emfanizei ta katallhla minimata
*/
String query;
if(action.equals("insert"))
query="insert into odigoi(onoma,eponimo,username,password,oxima) ... | 5 |
@Override
public void Volum (double n) {
this.volume=this.hight*this.hight*this.hight*n;
this.hight = Math.pow(volume , 1/3);
} | 0 |
public void setExpAux(List<?> list)
{
for(PExpAux e : this._expAux_)
{
e.parent(null);
}
this._expAux_.clear();
for(Object obj_e : list)
{
PExpAux e = (PExpAux) obj_e;
if(e.parent() != null)
{
e.parent()... | 4 |
public static void createHeap(int[] heap) {
for (int i = heap.length - 1; i >= 0; i--) {
adjustHeap(heap, i, heap.length);
}
} | 1 |
protected Behaviour getNextStep() {
if (
safePoint == null || actor.aboard() == safePoint ||
safePoint.pathType() == Tile.PATH_BLOCKS
) {
safePoint = nearestHaven(actor, null) ;
priorityMod *= 0.5f ;
if (priorityMod < 0.25f) priorityMod = 0 ;
}
if (safePoint == null) {
... | 5 |
public static void initCraftableStats()
{
if (!blockStatsInitialized || !itemStatsInitialized)
{
return;
}
HashSet hashset = new HashSet();
IRecipe irecipe;
for (Iterator iterator = CraftingManager.getInstance().getRecipeList().iterator(); iterator.hasNe... | 7 |
@Override
public int write(String path, Object fh, boolean isWritepage,
ByteBuffer buf, long offset) throws FuseException {
FileHandle handle = (FileHandle)fh;
if (handle == null)
return Errno.EBADSLT;
if (handle.hasClosed)
return Errno.EBADSLT;
if (!handle.write)
return Errno.EACCES;
handle.isEm... | 5 |
public void testSetBufferLength() {
ByteArrayBuilder builder = new ByteArrayBuilder();
byte[] testdata = new byte[777];
for(int i=0;i<testdata.length;i++) {
testdata[i] = (byte)i;
}
builder.clear();
for(int i=0;i<testdata.length;i++) {
assertEquals(i, builder.length());
builder.append(testdata[i])... | 9 |
public synchronized int available()
throws IOException
{
int avail = super.available();
int unencoded = precount - prepos + in.available();
if (encoder.getEncoder().getVbr()) {
switch (mode) {
case 0: // Narrowband
// ogg header size = 27 + packetsPerOggPage
// count ... | 8 |
public static ValidationResult okIfNull(String s) {
return s == null ? ok() : error(s);
} | 1 |
public void printPatronymicStr(String enteredPatronymic, boolean lineSeparator) {
if (lineSeparator) {
System.out.printf("Patronymic: %s\n", enteredPatronymic);
} else {
System.out.printf("Patronymic: %s", enteredPatronymic);
}
} | 1 |
private String checkParen() {
holdPos = pos;
String paren = line.substring( pos );
int i = paren.indexOf( ")" );
if ( i == -1 ) {
increment();
paren = "Error: '(' must have an ending ')' present on the same line.";
}
lastPos = holdPos;
ret... | 1 |
public void statisticsReport(final String outFilename, final boolean postfix) {
final String o = outFilename;
final String xmlstats = outFilename + ".xml";
final File f = new File(o);
int i = 1;
for (final ParseErrorDataPoint e : this.listErrorDataPoints) {
... | 7 |
public static void getResponses() throws IOException {
responses = new ArrayList<String>();
try {
int counter = 0;
CoordinatorGUI.textArea.append("Waiting for response from nodes..." + "\n" + "\n");
responseSocket.setSoTimeout(5000);
while (counter < nodes... | 8 |
@Override
public void run(){
while(true){
try {
JSONObject o = read();
if(o == null){
throw new IOException("Client disconnected");
}
connection.input(o);
}
catch (IOException e){
//globalClientList.remove(connection);
Debug.warn("Disconnect from " + connection.getIp() + ". "
... | 6 |
public static void main(String[] args) throws Exception {
Handler h = new FileHandler(System.getProperty("user.dir") + File.separatorChar + "log.txt", true);
h.setFormatter(new SimpleFormatter());
logger.setUseParentHandlers(false);
logger.addHandler(h);
try {
logge... | 8 |
public float[] findMinMaxHeights() {
float[] minmax = new float[2];
float currentMin, currentMax;
currentMin = heightData[0][0];
currentMax = heightData[0][0];
for (int i = 0; i < imageHeight; i++) {
for (int j = 0; j < imageWidth; j++) {
if (heightD... | 4 |
public boolean isEmpty(){
int i = 0;
int i2 = 0;
int i3 = 0;
while(i < blocks.length){
while(i2 < blocks[i].length){
while(i3 < blocks[i][i2].length){
if(blocks[i][i2][i3] != null)return false;
i3++;
}
... | 4 |
@Override
public boolean canBeLearnedBy(int job) {
int jid = job;
int skillForJob = id / 10000;
if (job < 1000) {
if (jid / 100 != skillForJob / 100 && skillForJob / 100 != 0) { // wrong job
return false;
}
} else {
if (jid / 1000 != skillForJob / 1000 && skillForJob / 1000 != 0) { // wrong jo... | 7 |
private static ArrayList<String> getWordsFromComposite(Composite composite) {
ArrayList<String> allWords = new ArrayList<>();
Iterator<Component> itBook = composite.iterator();
while (itBook.hasNext()) {
// абзацы + код
Component compBook = itBook.next();
if (... | 7 |
private void calculateScreenPosition(int x, int height, int y) {
if (x < 128 || y < 128 || x > 13056 || y > 13056) {
spriteDrawX = -1;
spriteDrawY = -1;
return;
}
int z = getFloorDrawHeight(plane, y, x) - height;
x -= cameraPositionX;
z -= cameraPositionZ;
y -= cameraPositionY;
int sineHorizontal... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
int returnVal = fileChooser.showOpenDialog(tulip.Tulip.mainFrame);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
... | 3 |
public void similarFiles(double threshold) {
for (int i = 0; i < size; i++)
for (int j = i + 1; j < size; j++) {
double d = calculateResemblance(resemblances[i], resemblances[j], b);
if (d > threshold)
System.out.println(
"Resemblance between file\n" +
" " + urls[i] +"\... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || obj.getClass() != ConvertiblePair.class) {
return false;
}
ConvertiblePair other = (ConvertiblePair) obj;
return this.sourceType.equals(other.sourceType) && this.targetType.equals(other.targetType);
} | 4 |
boolean union(int u, int v) {
if ((u = set(u)) == (v = set(v)))
return false;
if (rnk[u] < rnk[v]) {
set[u] = v;
} else {
set[v] = u;
if (rnk[u] == rnk[v])
rnk[u]++;
}
return true;
} | 3 |
public void trainLive(Sample s)
{
// lc*=0.9999f;
//clear the network
this.prepare();
//do a run through with the current values
process(s);
//make an array of output errors
float[] outputErrors = new float[s.outs.size()];
//calculate output errors
for(int i =0; i <outputErrors.length; i++... | 7 |
public static BufferedImage brightness(BufferedImage input, double factor) {
BufferedImage result = new BufferedImage(input.getWidth(), input.getHeight(), input.getType());
for (int i = 0; i < result.getWidth(); i++) {
for (int j = 0; j < result.getHeight(); j++) {
Color ... | 5 |
public List<Park> getParkList() {
return parkList;
} | 0 |
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
} | 1 |
public String getDefaultName() {
switch (((IntegerType) getHint()).possTypes) {
case IT_Z:
return "bool";
case IT_C:
return "c";
case IT_B:
case IT_S:
case IT_I:
return "i";
default:
throw new alterrs.jode.AssertError(
"Local can't be of constant type!");
}
} | 5 |
private void allocaAcqua(int numeroCelle) { // Testato da popolaMappa
Coord tempCoord = null;
HashSet<Coord> mySet = new HashSet<Coord>();
Iterator<Coord> itCoord = null;
do {
tempCoord = CommonUtils.getNewRandomCoord(getLatoDellaMappa());
} while (!isCellaTerra(tempCoord));
mySet.add(tempCoord);
HashS... | 9 |
public boolean withdraw (int amount) {
if (amount < 0) {
System.out.println ("Cannot withdraw negative amount.");
return false;
} else if (this.myBalance > amount) {
this.myBalance=this.myBalance-amount;
return true;
}else if (thi... | 4 |
private static int runToInputHiOrLoR(Gameboy gbL, Gameboy gbR, int limit, int joypadInputAdd) {
int initialSteps = gbR.stepCount;
int add = runToAddressR(limit, gbL, gbR, joypadInputAdd);
while (true) {
if (add == 0 || gbR.stepCount - initialSteps > limit)
return 0;
int lastVframe = gbR.... | 5 |
public static void main(String[] args)
{
StringDigraph sg = new StringDigraph(args[0], args[1]);
System.out.println(args[0] + "\n" + sg);
Topological top = new Topological(sg.G());
System.out.println("Scheduling order");
System.out.println("----------------");
for (int v : top.order())
System.out.print... | 1 |
@Override
public boolean verifier() throws SemantiqueException {
super.verifier();
if(gauche.isBoolean())
GestionnaireSemantique.getInstance().add(new SemantiqueException("Expression gauche du modulo est booléenne, arithmétique attendue ligne:"+line+" colonne:"+col));
if... | 3 |
public Node<T> getNode(int x) {
if (this.length != 0 && x < this.length) {
Node<T> ele = _head;
for (int i = 0; i < x; i++)
ele = ele.getNext();
return ele;
}
return null;
} | 3 |
public Image isolate(Image im, int width, int height, int color)
{
// Color: 0 = red, 1 = green, 2 = blue, 3 = alpha
int pix[] = JIPTUtilities.getPixelArray(im);
int size = pix.length;
for(int i = 0; i < size; i++)
{
int alpha = (pix[i] >> 24) & 0xff;
... | 5 |
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
setDirty();
} | 0 |
private void loadConfiguration(String company, String product, Map<String, Object> userOptions, String[] extraOptionsList) {
optionsList = ArrayUtils.addAll(new String[]{"scheme", "host", "port", "user_agent"}, extraOptionsList);
options = new HashMap<String, Object>();
env = (String)userOptio... | 9 |
public static boolean isPrime(int n) {
// Here, 2 is prime
if(n == 2) return true;
//check if n is a multiple of 2
if (n%2==0) return false;
//if not, then just check the odds
for(int i=3;i*i<=n;i+=2) {
if(n%i==0)
return false;
}
return true;
} | 4 |
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... | 6 |
@Override
protected EntityManager getEntityManager() {
return em;
} | 0 |
public void handleAttack() {
target = addrField.getText();
numThreads = (int) threadSlider.getValue();
udpflood.setTarget(target);
udpflood.setThreads(numThreads);
if (udpflood.isRunning()) {
attackBtn.setText("Start Attack");
udpflood.stop();
}
... | 1 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int[][] arr = new int[3][3];
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
arr[i][j] = sc.nextInt();
}
... | 9 |
public int characterAt(int at) throws JSONException {
int c = get(at);
if ((c & 0x80) == 0) {
return c;
}
int character;
int c1 = get(at + 1);
if ((c1 & 0x80) == 0) {
character = ((c & 0x7F) << 7) | c1;
if (character > 0x7F) {
... | 8 |
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 |
@Override
public T build(Map<Class<?>, ClassBuilder<?>> how) {
T o = null;
try {
o = this.underConstruction.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
return o;
} | 3 |
public void set(Object object, Object value)
{
try
{
if (m_method != null)
{
m_method.invoke(object, value);
}
else
{
m_field.set(object, value);
}
}
catch (IllegalArgumentException ex)
{
throw new ParameterException(ex);
}
catch (IllegalAccessException ex)
{
throw new P... | 5 |
public void run() {
while (countDown-- > 0) {
System.out.print(status());
Thread.yield();
}
} | 1 |
public static void modifyAccountTypes(List<Account> accountList, AccountTypes accountTypes){
if(!accountList.isEmpty()) {
boolean singleMove;
if (accountList.size() == 1) {
singleMove = true;
} else {
int option = JOptionPane.showConfirmDialog(... | 9 |
public static void toggleCommentInheritanceText(Node currentNode, JoeTree tree, OutlineLayoutManager layout) {
CompoundUndoablePropertyChange undoable = new CompoundUndoablePropertyChange(tree);
toggleCommentInheritanceForSingleNode(currentNode, undoable);
if (!undoable.isEmpty()) {
undoable.setName("Toggle C... | 1 |
public void test_toParser() {
DateTimeFormatterBuilder bld = new DateTimeFormatterBuilder();
try {
bld.toParser();
fail();
} catch (UnsupportedOperationException ex) {}
bld.appendLiteral('X');
assertNotNull(bld.toParser());
} | 1 |
private void handle_color(String[] cmd) {
String oldc;
int c;
if (cmd.length == 1) { // Print only the palette
print_palette();
return;
}
if (cmd.length != 2) {
cliprint("Wrong parameter count. See \\help for details." + VT100.crlf);
return;
}
try {
c = Integer.parseInt(cmd[1]);
} catch... | 7 |
public ArrayList<Annotation> createAnnotationArrayListByTicket(int ticketId) {
ArrayList<Annotation> result = new ArrayList<Annotation>();
ResultSet rs = null;
PreparedStatement statement = null;
try {
statement = conn.prepareStatement("select * from Annotations where TicketID_FK=? order by CreatedOn ASC"... | 6 |
public static void insertStock( int idarticle, int stock,int stockmin,int stockmaxi,Date datemaj,Float marge, Float ttc ) throws SQLException {
String query="";
try {
query = "INSERT INTO STOCK (ID_ARTICLE,STSTOCK,STMINI,STMAXI,STDATEMAJ,STMARGE,STTTC ) VALUES (?,?,?,?,?,?,?);... | 1 |
public static int executeProgram(String[] cmd, File workingDir, StreamMonitor inputStream, StreamMonitor errStream) {
logger.trace("Executing '"+explode(cmd)+"' with working dir '"+workingDir.getAbsolutePath()+"'.");
int exitVal;
try {
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd, null, ... | 4 |
public MapLayer getLayer(int i) {
try {
return layers.get(i);
} catch (ArrayIndexOutOfBoundsException e) {
}
return null;
} | 1 |
private void initPrintWriter(StringBuilder sb) {
Log.info("Entities = " + getData().getEntities().size());
final boolean huge = getData().getEntities().size() > 800;
sb.append("digraph unix {");
for (String s : dotStrings) {
sb.append(s);
}
sb.append("bgcolor=\"" + getAsHtml(getData().getSkinParam().ge... | 8 |
public static void run(RobotController myRC)
{
rc = myRC;
RobotType t = rc.getType();
try
{
if (t == RobotType.SOLDIER)
{
Soldier.soldierCode(rc);
}
else if(t == RobotType.HQ)
{
HQ.hqCode(rc);
}
else if(t == RobotType.GENERATOR || t == RobotType.SUPPLIER)
{
Supplier.supplie... | 6 |
@Override
public boolean retainAll(Collection<?> c) {
// TODO Auto-generated method stub
return false;
} | 1 |
private int[][] getLay(int numberLay) {
int lay[][] = new int[HEIGHT][HEIGHT];
for (int i = 0; i < HEIGHT; i++) {
for (int j = 0; j < HEIGHT; j++) {
lay[i][j] = yCbCr[i][j][numberLay];
}
}
return lay;
} | 2 |
private void createDragObjects(CategoryType kat) {
ArrayList<Player> tmpPlayer = player.getPlayer(kat); //ArrayListe mit den Playern
String tmpTitle;
ImageLabel tmpLabel;
ArrayList<String> tmpObjectPath = null;
int posCoordinate = 0;
if (kat == CategoryType.BASS) {
tmpObjectPath = this.bassObjectPath;... | 6 |
public int getStartingY(int index) {
if(index == 0) {
return 0;
}
if(index == 1) {
return 0;
}
if(index == 2) {
return 200;
}
return 0;
} | 3 |
private void createContent(WritableSheet sheet) throws WriteException,
RowsExceededException {
// Write a few number
for (int i = 1; i < 10; i++) {
// First column
addNumber(sheet, 0, i, i + 10);
// Second column
addNumber(sheet, 1, i, i * i);
}
// Lets calculate the sum of... | 2 |
public TransformsType createTransformsType() {
return new TransformsType();
} | 0 |
public int largestRectangleArea(int[] height) {
int max = 0;
if(height.length ==0) return 0;
int[] nh = Arrays.copyOf(height, height.length+1);
nh[height.length] = 0;
Stack<Integer> large = new Stack<Integer>();
for(int i=0; i<nh.length; i++)
{
... | 8 |
private static String normalizeCondition(String variable, String operator, String content) {
String normalCondition = "";
content = content.toLowerCase();
if (content.contains(" * ")) {
normalCondition = "\"" + variable + "\".match(/\\b" + content.replace(" * ", "\\b.*\\b") + "\\b/) !== null";
}
else... | 8 |
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Move other = (Move) obj;
if (x1 != other.x1) {
return false;
}
if (x2 != other.x2) {
return false;
}
... | 7 |
public void draw(Graphics g, ImageObserver io){
if(waittime > 0){
waittime = waittime - 1;
return;
}
g.drawImage(bimage1, char_x, char_y, io);
char_x = char_x - 4;
if(char_x < -48){
syutsugen();
}
if(spkey == true){
speed = speed - 0.15;
}else{
speed = speed + 0.15;
}
if(speed >... | 5 |
static long readVLong(DataInput in) throws IOException {
byte b = in.readByte();
if (b >= 0) return b;
long i = b & 0x7FL;
b = in.readByte();
i |= (b & 0x7FL) << 7;
if (b >= 0) return i;
b = in.readByte();
i |= (b & 0x7FL) << 14;
if (b >= 0) return i;
b = in.readByte();
i |= ... | 8 |
private static int[] mergeSort(int[] A, int l, int r){
if(r-l<1) return new int[]{A[r]};
int mid = (l+r)/2;
int[] leftSorted = mergeSort(A, l, mid);
int[] rightSorted = mergeSort(A, mid+1, r);
return merge(leftSorted,rightSorted);
} | 1 |
private void jBListarIncidentesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBListarIncidentesActionPerformed
// TODO add your handling code here:
int barrio = combo_barrio_reporte.getSelectedIndex();
if (barrio != 0) {
Barrio codigobarrio = controlador.busca... | 6 |
LineScanner(String text) {
int c = 0;
data = new ArrayList<String>();
String tmp = "";
lineCount = 1;
current = 0;
while (c < text.length()) {
tmp = tmp + Character.toString(text.charAt(c));
if (text.charAt(c) == 0x... | 3 |
private int divide(int startIndex, int endIndex) {
int optimalIndex = getOptimalIndex(startIndex, endIndex);
int pivot = a[optimalIndex];
swap(optimalIndex, endIndex);
int marker = startIndex;
for (int i = startIndex; i < endIndex; i++) {
if (a[i] <= pivot) {
... | 2 |
public void testSetInterval_RInterval2() {
MutableInterval test = new MutableInterval(TEST_TIME1, TEST_TIME2);
try {
test.setInterval(new MockBadInterval());
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
private static char mul (int a, char b) {
int inda = (a < 0) ? (a + 256) : a;
int indb = (b < 0) ? (b + 256) : b;
if ( (a != 0) && (b != 0) ) {
int index = (LogTable[inda] + LogTable[indb]);
char val = (char)(AlogTable[ index % 255 ] );
return val;
}
else
return 0;
} // mul | 4 |
public static String readString() {
String line = null;
try {
BufferedReader is = new BufferedReader(new InputStreamReader(
System.in));
line = is.readLine();
} catch (NumberFormatException ex) {
System.err.println("Not a valid number: " + ... | 2 |
public static void main(String[] args)
{
// default values
int portNumber = 27886;
String serverAddress = "localhost";
String username = "Anonymus";
// depending of the number of arguments provided we fall through
switch(args.length)
{
// > java Client username portNumber serverAddress
case 3:
... | 9 |
static String[] flavorSet(int n) {
// Force it to be positive & within bounds:
n = Math.abs(n) % (flav.length + 1);
String[] results = new String[n];
int[] picks = new int[n];
for (int i = 0; i < picks.length; i++)
picks[i] = -1;
for (int i = 0; i < picks.length; i++) {
retry: while (true) {
int t... | 5 |
@Override
public boolean isUserError() {
if (getCategory() == 1)
return true;
else if (getCategory() == 3 && getCode() == 52)
return true;
else
return false;
} | 3 |
private boolean passCards(PinochlePlayer from, PinochlePlayer to, List<Card> cards) {
boolean result = false;
try {
List<Card> fromCards = new ArrayList<Card>(from.getCurrentCards());
List<Card> toCards = new ArrayList<Card>(to.getCurrentCards());
System.out.println("from Old : " + fromCards);
Syst... | 2 |
public static long m68ki_get_sr() {
return ((((m68k_cpu.t1_flag != 0) ? 1 : 0) << 15)
| (((m68k_cpu.t0_flag != 0) ? 1 : 0) << 14)
| (((m68k_cpu.s_flag != 0) ? 1 : 0) << 13)
| (((m68k_cpu.m_flag != 0) ? 1 : 0) << 12)
| (m68k_cpu.int_mask << 8)
... | 9 |
protected void process(double[][] B, int att, int pos, BitSet C, double[][] D)
{
if (!isCanonical(B, D, att) || (C.cardinality() < minSup) ) return;
if (Main.printResult)
System.out.println("Closed " +toStringPattern(D) + " --- " + toStringBitSet(C));
closedCount++;
for (int i = att; i < attCount; i++... | 9 |
public synchronized void reset() {
for(int i = 0; i < receivedPackets.length; i++)
receivedPackets[i] = null;
receivedPacketHistoryInt = 0;
lastReceivedPacketIndex = -1;
lastReceivedPacketSequenceNumber = Packet.SEQUENCE_NUMBER_NOT_APPLICABLE;
for(int i = 0; i < sentPackets.length; i++)
sentPackets[i] ... | 2 |
@Override
public void run() {
while (_model.isRunning()) {
long beginTimeMillis, timeTakenMillis, timeLeftMillis;
beginTimeMillis = System.currentTimeMillis();
if(_model.isResetGame()){
resetHard();
for (Ball b : balls) {
... | 8 |
public void flipCard(int row, int col){
if (prevSelectedCardRow == -1 && prevSelectedCardCol == -1){
prevSelectedCardRow = row;
prevSelectedCardCol = col;
cards[row][col].setShowing(true);
updateButtons();
}
else if ( prevSelectedCardRow !... | 4 |
@Override
public Object visitUnaryExprAST(UnaryExprAST ast, Object o) throws CompilationException
{
int constmt = findCon(ast.parent.line);
System.out.println("Parent line "+ ast.parent.line + " " + constmt);
String res = "";
if(ast.opType == UnaryExprAST.LOGICAL_NOT)
{
if(... | 9 |
public boolean isActive(int t){
//this function figures out whether the overlap score of this column
//is among the top DesiredLocalActivity-percent of its neighbor
//if it is set it active, if not remain inactive
if(overlap>0){
int tie=1;
int ahead=0;
for(Column c : neighbor){
if(c.overlap > this... | 7 |
public void setEquipa(Collection<String> equipas, String cod_competicao) {
DAOTorneio.setEquipa(equipas, cod_competicao);
for (String a : equipas) {
Collection<Jogador> jogadores = this.getEquipa().get(a).getJogadores();
if (jogadores != null) {
for (Jogador jog :... | 3 |
private boolean computeCell(int col, int row) {
boolean liveCell = getCell(col, row);
int neighbours = countNeighbours(col, row);
boolean nextCell = false;
if (neighbours < 2)
nextCell = false;
if (liveCell && (neighbours == 2 || neighbours == 3))
nextCel... | 7 |
private static String getServerIP(int port) throws HeadlessException {
BufferedReader in = null;
try {
// ip = InetAddress.getLocalHost().getHostAddress() + ":" + port;
// Connect to website containing IP address.
URL whatismyip = new URL("http://api.exip.org/?call=ip... | 3 |
public void addMatch()
{
Players players = new Players();
Scanner scan = new Scanner(System.in);
Player resultPlayer = null;
while (resultPlayer == null)
{
System.out.println("Wybierz pierwszego gracza:");
firstPlayer = scan.nextInt();
try {
resultPlayer = players.getPlayer(firstPlayer);
... | 9 |
public void setjButtonNext(JButton jButtonNext) {
this.jButtonNext = jButtonNext;
} | 0 |
public static HashMap<String, String> readJSON(String line)
{
return null;
} | 0 |
public void mouseDragged(MouseEvent e) {
performDragScrollIfActive(e);
Tile tile = mapViewer.convertToMapTile(e.getX(), e.getY());
if (tile != null &&
(e.getModifiers() & MouseEvent.BUTTON1_MASK) == MouseEvent.BUTTON1_MASK) {
// only perform the goto for the left mouse ... | 6 |
private void testHelper_method_unknownAnchor_shouldFail(MethodToTest method)
{
final IMutableMolecule UNKNOWN_ANCHOR = mock(IMutableMolecule.class);
switch (method)
{
case changeMoleculeEnergyLevel:
moleculeMediator.changeMoleculeEnergyLevel(UNKNOWN_ANCHOR, VALID_POSITION, VALID_ENERGY_CHANGE_AMOUNT);
br... | 7 |
@Test
public void testUpdate() {
fail("Not yet implemented");
} | 0 |
public void moveRight() {
setDirection(90);
for (TetrisBug tb : blocks){
tb.setDirection(90);
}
if (rotationPos==0){
if (blocks.get(0).canMove() && blocks.get(2).canMove()) {
blocks.get(2).move();
move();
blocks.get(0).move();
blocks.get(1).move();
}
}
if (rotationPos =... | 8 |
void radf2(final int ido, final int l1, final float in[], final int in_off, final float out[], final int out_off, final int offset) {
int i, ic, idx0, idx1, idx2, idx3, idx4;
float t1i, t1r, w1r, w1i;
int iw1;
iw1 = offset;
idx0 = l1 * ido;
idx1 = 2 * ido;
for (in... | 7 |
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.