text stringlengths 14 410k | label int32 0 9 |
|---|---|
private boolean checkStartBuffer() {
int a,count=0,o;
// Check for 21 true bits in the first 44 bits
for (a=0;a<44;a++) {
if (startBuffer[a]==true) count++;
}
if (count!=21) return false;
count=0;
// Check the 70 bit session keys are almost the same
for (a=0;a<70;a++) {
if (startBuffer[a+44]!=star... | 9 |
private boolean hasRowWithNumber(int number) {
for (Row row : rows) {
if (row.getNumber() == number) {
return true;
}
}
return false;
} | 2 |
public void setPlayerTitle(Player p, String title, boolean save)
throws UnknownTitleException {
String confPath = "players." + p.getName();
if (title.equalsIgnoreCase("none")) {
p.setDisplayName(p.getName());
if (save) {
fastTitles.getConfig().set(confPath, null);
}
} else {
String titleFormat ... | 4 |
public float GetDensity(String location){
float density = 0f;
WAQuery query = engine.createQuery();
query.setInput(location+" population density");
try {
WAQueryResult queryResult = engine.performQuery(query);
if (queryResult.isError()) {
} else if (!queryResult.isSu... | 9 |
@Override
public void update(int mouseX, int mouseY, boolean pressed)
{
super.update(mouseX, mouseY, pressed);
if(this.btnResume.wasClicked())
Game.instance.setCurrentGui(null);
if(this.btnNewGame.wasClicked())
{
Game.instance.world = new World();
Game.instance.setCurrentGui(null);
}
if(this.b... | 5 |
public static void SS() throws IOException{
int timeblock = 5;
BufferedReader r = new BufferedReader (new InputStreamReader(System.in));
while (timeblock > 0){
System.out.println("What would you like to do right now?");
if (timeblock >= 3)
{
System.out.println("1. Study");
System.out.printl... | 7 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Tile other = (Tile) obj;
if (this.x != other.x) {
return false;
}
if (this.y ... | 4 |
public static long getScaleFactorDecimal(final String scaleUnit) {
if(scaleUnit == null) throw new IllegalArgumentException("Ihre Präfix-Angabe ist ungültig. " + scaleUnit);
if(scaleUnit.length() == 0) return 1;
switch(scaleUnit.toLowerCase().charAt(0)) {
case 'h':
return 100;
case 'k':
return 1000;... | 9 |
public void move(int shipx, int shipy){
if(getxCoord() < shipx+30){
this.setImageIcon(finImage1R);
setxCoord(getxCoord() + speed);
}
if(getxCoord() > shipx+30){
this.setImageIcon(finImage1);
setxCoord(getxCoord() - speed);
}
if(get... | 4 |
public void setBlockLocation(SelectMode selectMode, Location location)
{
switch (selectMode)
{
case FirstBlock:
{
RegionManager manager = RegionManager.getInstance();
manager.addRegion(player.getUniqueId(), new Region());
getNew... | 2 |
public void findGames(ArrayList<Game> games)
{
String name;
String path = ".";
String fileName;
File folder = new File(path);
File[] listOfFiles = folder.listFiles();
for(int i = 0; i < listOfFiles.length; i++)
{
if(listOfFiles[i].isFile())
... | 6 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double a, b, c;
double i;
String str;
System.out.println("This program will sort from lowest to highest 3 numbers.");
System.out.print("Please enter your first number: ");
... | 3 |
public String getEncoding() {
if (internalIn2 == null) return null;
return internalIn2.getEncoding();
} | 1 |
public int numDecodings(String s) {
if (s == null || s.length() == 0 || s.charAt(0) == '0') {
return 0;
}
int[] number = new int[s.length() + 1];
number[0] = 1;
number[1] = 1;
int tmp;
for (int i = 2; i <= s.length(); i++) {
// 检查当前字符是不是'0'
tmp = Integer.parseInt(s.substring(i - 1, i));
if (tm... | 7 |
private static void startStatCollector(String host, int port, final Connector connector) {
connector.setStatsOn(true);
logger.fine("Starting stats collector: " + host + ":" + port);
GangliaStat statCollector = new GangliaStat(host, port, 30, 60);
statCollector.addMetric(new StatReporter("os_cs_keys_regist... | 2 |
private Object handleSubn(Object tos, String id, String ref) {
if (tos instanceof Header && ref != null && ((Header)tos).getSubmissionRef() == null) {
((Header)tos).setSubmissionRef(ref);
return new Object(); // placeholder
}
else if (tos instanceof Header && ref == null && ((Header)... | 9 |
private void addCadenaOperador(String string) {
if (INICIO) {
if (maxCaracteres()) {
if (!ordenSecuencia()) {
if (!string.isEmpty()) {
if (cadenaCalculo.isEmpty()) {
cadenaCalculo = string;
... | 5 |
public HashMap<String,HashMap<String,String>> getFriendships(){
HashMap<String,HashMap<String,String>> friendships = new HashMap<String,HashMap<String,String>>();
HashMap<String,String> buddies = new HashMap<String,String>();
Statement st;
ResultSet rs;
String query;
query = "SELECT * FROM friends";
try{
... | 2 |
final int importBinary(XMLElement elem, int offs, ByteBuffer buf, String fieldName)
throws XMLImportException
{
if (elem == null || elem.isNullValue()) {
offs = buf.packI4(offs, -1);
} else if (elem.isStringValue()) {
String hexStr = elem.getStringValue();
... | 9 |
public Layer getParentLayer() {
return parentLayer;
} | 0 |
private boolean isBlocked(float x, float y) {
boolean blocked = false;
float tweakedX = x + 4;
float tweakedY = y + 8 + mapY;
int rowCount = genX / blockSize;
int startY = (Math.round(mapY / blockSize))* rowCount + 1;
int endY = (Math.round((mapY + screenHei... | 7 |
public void finishTag() throws TagParserException
{
// System.out.print("NT"+this.mLD());
TagNode container = this.containerStack.peek();
TagNode tag = this.temporaryTag;
// Parse the Attributes if there are any.
if(this.literalBuffer.length() > 0)
{
// Though before we do so,check if th... | 6 |
public MoveResult endOfMoveChecker(MoveResult battleResult)
{
MoveResult result = battleResult;
boolean redCanMove = false;
boolean blueCanMove = false;
if (result.getStatus() == OK) //If someone has not already won
{
for (PieceLocationDescriptor piece: pieceHandler.getRedPieces())
{
if (canMov... | 9 |
private String checkIfInBounds(Point p) {
int borderSize = 25;
// right side
if (p.x >= this.getWidth() - borderSize && p.x <= this.getWidth()) {
// is in right side
return "right";
} else if (p.x >= 0 && p.x <= borderSize) {
// is in left side
return "left";
} else if (p.y >= 0 && p.y <= 10) {
... | 8 |
public char deleteItem() {//since previous is already in the Links, switching the code around allows for a Queue implementation fairly trivially
char temp;
if (stack) {//this is the stack implementation, which is the assignment
if (isEmpty()) throw new EmptyStackException();
temp ... | 6 |
public void mousePressed(MouseEvent e) {
// click, moved from mouseClicked due
// to problems with focus and stuff
if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) {
Point p = e.getPoint();
CPArtwork artwork = controller.getArtwork();
int layerIndex = getLayerNb(p);
if (layerIndex >= 0 &... | 6 |
public void stop(String sourcename) {
if (sourcename == null || sourcename.equals("")) {
errorMessage("Sourcename not specified in method 'stop'");
return;
}
if (midiSourcename(sourcename)) {
midiChannel.stop();
} else {
Source mySource = sourceMap.get(sourcename);
if (mySource != null)
mySou... | 4 |
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource() == bp.getExit())
{
System.exit(0);
}
if(ae.getSource() == bp.getFight())
{
}
if(ae.getSource() == bp.getEndTurn())
{
engine.endTurn();
System.out.println("Turn Ending ...");
ep.addText("\nCash on hand: " + engine.getTaxes());
... | 3 |
public static int getHeightItr(Node root){
//Write your code here
if(root == null) {
return 0;
}
int height = 0;
Queue<Node> children = new LinkedList<Node>();
children.add(root);
while(true) {
int childCount ... | 6 |
public static ArrayList<Rating> getTestSet(String file) {
ArrayList<Rating> testset = new ArrayList<Rating>();
InputStream fis = null;
BufferedReader br;
try {
fis = new FileInputStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
br = new ... | 3 |
public static Account constructAccountObject(String username) {
ResultSet result = accessAccount(username);
Account account = null;
try {
result.next();
String uname = result.getNString(1);
String pass = result.getNString(2);
int employee_id = result.getInt(3);
String employee_name = result.getNStr... | 6 |
private CalcState work(CalcState state) {
CalcState bestState = state;
for (int point2 = state.point1 + 1; point2 < conf.numPoints; point2++) {
Point p2 = new Point(Main.xFromPoint(point2), Main.yFromPoint(point2));
StringBuilder s = new StringBuilder();
s.append(M... | 5 |
private void testInstanceRange_X(int range) {
((TimeSeriesTranslate)m_Filter).setInstanceRange(range);
Instances result = useFilter();
// Number of attributes and instances shouldn't change
assertEquals(m_Instances.numAttributes(), result.numAttributes());
assertEquals(m_Instances.numInstances() - M... | 7 |
private void createTables(){
try{
con = DriverManager.getConnection(dbURL2);
st = con.createStatement();
// for loop iterate over all elements in the array and create the tables
for (String h : c){
String insert = "CREATE TABLE \"ME\"."+ h + "(CountryCode VARCHAR(5) NOT N... | 2 |
public void move(int xa, int ya) {
if (xa != 0 && ya != 0) {
move(xa, 0);
move(0, ya);
return;
}
if (xa < 0) dir = 3;
if (ya < 0) dir = 0;
if (xa > 0) dir = 1;
if (ya > 0) dir = 2;
if (light(xa, ya, dir)) {
xa /= 2;
ya /= 2;
}
if (!collision(xa, ya)) {
x += xa;
y += ya;
}
} | 8 |
public String pickUp(Room room)
{
if(room instanceof ItemRoom)
{
ItemRoom ir = (ItemRoom) room;
boolean bool = true;
for(int i = 0; i < 6 && bool; i++)
{
if(inv[i] == null)
{
inv[i] = ir.getItem();
this.lastSlotUsed = i;
bool = false;
... | 5 |
private static boolean getUsedVersions(SSAUConstructorSparseEx ssa, VarVersionPair var, List<VarVersionNode> res) {
VarVersionsGraph ssuversions = ssa.getSsuversions();
VarVersionNode varnode = ssuversions.nodes.getWithKey(var);
HashSet<VarVersionNode> setVisited = new HashSet<>();
HashSet<VarVersion... | 8 |
private synchronized void updateScore(double counter, int color, int i) {
// score how interesting this point is
if (smart_random_points_score[color][i] > 0)
smart_random_points_score[color][i] = 0.5 * counter + 0.5
* smart_random_points_score[color][i];
else
smart_random_points_score[color][i] = count... | 9 |
public static int[] bufferStringChunkUTF8(CharSequence s, int start, byte[] byteBuffer) throws IOException {
int bufferPos = 0;
int stringPos = start;
while (stringPos < s.length()) {
char ch = s.charAt(stringPos);
int encodingSize = utf8EncodingSize(ch);
if (... | 5 |
public int getX(){
return xPos;
} | 0 |
public Rule[] Scan(String fileName)
{
try
{
InputStream inputStream = getClass().getClassLoader().getResourceAsStream(fileName);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
ArrayList<String> tempLines = new ArrayList<String>();
String line = "";
while((line = ... | 4 |
public boolean startDragComponent(Point p) {
clearDragState();
// which component is dragged ?
for(int i = 0; i < getTabCount(); i++) {
Rectangle tabbounds = getBoundsAt(i);
if(tabbounds != null && tabbounds.contains(p)) {
draggedDockable = (SingleDockableContainer) getComponentAt(i);
if(i > 2 && i... | 9 |
private int spareBonus(Frame [] frame, int thisIndex, int frameNum) {
if (thisIndex < 9 && thisIndex + 1 > frameNum)
return -1;
return frame[thisIndex + 1].first;
} | 2 |
void run(){
int N = 150000;
Scanner sc = new Scanner(System.in);
boolean[] p = new boolean[N];
Arrays.fill(p, true);
List<Integer> l = new ArrayList<Integer>();
p[0]=p[1]=false;
for(int i=2;i<N;i++){
if(p[i]){
l.add(i);
for(int j=i+i;j<N;j+=i)p[j]=false;
}
}
for(;;){
int n = sc.nextIn... | 9 |
private static void writeTo(String outputFileName, ArrayList<String> lines)
throws IOException {
PrintWriter writer;
if (outputFileName == null) {
throw new IOException("No file has been loaded.");
}
writer = new PrintWriter(new FileOutputStream(outputFileName));... | 2 |
public Production getProductionForTransition(Transition transition) {
FSATransition trans = (FSATransition) transition;
State toState = trans.getToState();
State fromState = trans.getFromState();
String label = trans.getLabel();
String lhs = (String) MAP.get(fromState);
String rhs = label.concat((String) M... | 0 |
public Piece.TypePiece askPromotion(ChessGame G){
String L = null;
Piece.TypePiece type = Piece.TypePiece.P;
System.out.println("Write the piece you want(one character) :");
System.out.println("\"P\" : Pawn");
System.out.println("\"B\" : Bishop");
System.out.println("\"N\" : Knight");
System.out.println("... | 7 |
private static int[] merge(int[] left, int[] right) {
// Lengths of both lists
int leftLength = left.length;
int rightLength = right.length;
int[] result = new int[leftLength + rightLength];
// Sets of indexes
int idx = 0;
int leftIdx = 0;
int rightIdx = 0;
// Goes through both lists (as long as th... | 7 |
public Song removeSong(String path) {
if(path == null || path.equals(""))
return null;
Song result= this.songMap.remove(path);
return result;
} | 2 |
static public DalcSong getInstance() {
if (m_instance == null) {
m_instance = new DalcSong();
}
return m_instance;
} | 1 |
@After
public void tearDown() {
} | 0 |
private ConvertiblePair getRequiredTypeInfo(Object converter) {
return ((Converter<?, ?>) converter).getConvertibleType();
} | 2 |
@Override
public long clean(long bytesToClean) {
if (isEmptyStorage()) return 0;
long cleanedBytes = 0;
for (Map.Entry<FileTime, File> fileEntry : cachedFiles.entrySet()) {
try {
final File oldFile = fileEntry.getValue();
final long fileSize = old... | 6 |
@Before
public void setUp() {
this.p = new Piste(0, 0);
this.e = new Este(0, 0, 10, 10);
this.t = new Taso();
} | 0 |
private static int loadShader(String path, int type)
{
StringBuilder source = new StringBuilder();
try
{
BufferedReader reader = new BufferedReader(new FileReader(path));
String line;
while ((line = reader.readLine()) != null)
{
... | 3 |
void append(DNSIncoming that)
{
if (this.isQuery() && this.isTruncated() && that.isQuery())
{
if (that.numQuestions > 0) {
if (Collections.EMPTY_LIST.equals(this.questions))
this.questions = Collections.synchronizedList(new ArrayList(that.numQuestions)... | 9 |
public PassengerTrain buildPassengerTrain() throws OutOfRangeException {
PassengerTrain res = new PassengerTrain();
res.clear();
Random rand = new Random();
res.add(new Locomotive.Creator().setHorsePowers(4400).setModel("ES44C4").setEngine("GEVO-12")
.setTonsWeight(126).setHeight(4.588).setComfortPerc... | 1 |
private OBJIndex ParseOBJIndex(String token)
{
String[] values = token.split("/");
OBJIndex result = new OBJIndex();
result.SetVertexIndex(Integer.parseInt(values[0]) - 1);
if(values.length > 1)
{
if(!values[1].isEmpty())
{
m_hasTexCoords = true;
result.SetTexCoordIndex(Integer.parseInt(value... | 3 |
private void outputErrorDialog(JTextPane pane){
Scanner fileScanner;
System.out.println("Default Output Error File Path: " + outputErrorFilePath);
try {
if(!outputErrorFilePath.contains("src/")){
outputErrorFilePath = "src/" + outputErrorFilePath;
}
fileScanner = new Scanner(new FileInputStream(outpu... | 3 |
public Double aStarSearch(Vertex[] vertices, int start, int goal) {
PriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();
vertices[start].gScore = 0.0;
vertices[goal].isGoal = true;
vertexQueue.add(vertices[start]);
while (!vertexQueue.isEmpty()) {
Vertex current = vertexQu... | 7 |
private void drawtile(GOut g, Coord tc, Coord sc) {
Tile t;
try {
t = getground(tc);
// t = gettile(tc).ground.pick(0);
g.image(t.tex(), sc);
// g.setColor(FlowerMenu.pink);
// Utils.drawtext(g, Integer.toString(t.i), sc);
if (Config.tileAA) {
for (Tile tt : gettrans(tc)) {
g.image(tt.te... | 3 |
public SEccl(String arg, Int i) {
i.incr(); /* skip over '[' */
if (i.get()>=arg.length())
throw new RESyntaxException("pattern ends with [");
if (arg.charAt(i.get()) == RE.NEGCCL) {
negate = true;
i.incr();
}
// Expand the range
doDash(arg, i);
if (arg.charAt(i.get()) != RE.CCLEND)
throw... | 3 |
public void loadConfigFiles() {
try {
loadRoomConfig();
loadBoardConfig();
cellXSize = (BOARDDIMENSIONX)/numColumns;
cellYSize = (BOARDDIMENSIONY)/numRows;
} catch (BadConfigFormatException b) {
new BadConfigFormatException(b.getMessage());
} catch (FileNotFoundException e) {
new BadConfigFormat... | 2 |
void passf2(int ido, int l1, final double cc[], double ch[], final double wtable[], int offset, int isign)
/*isign==+1 for backward transform*/
{
int i, k, ah, ac;
double ti2, tr2;
int iw1;
iw1 = offset;
if(ido<=2)
{
for(k... | 4 |
private Manufacturer(int id, String name) {
this.id = (byte) id;
this.name = name;
} | 0 |
@SuppressWarnings("rawtypes")
public void setValidator(Validator validator) {
this.validator = validator;
} | 0 |
public void bombbrick(int c, int r) {
// The number of bricks removed (the effectiveness of the bomb) depends on level
int remove;
if (level == 1)
remove = 2;
else
remove = 1;
// Makes bricks invisible
for (int i = c - remove; i <= c + remove; i++) {
for (int j = r - remove; j <= r + remove; ... | 7 |
public void addDefault(String node, String value) {
boolean flag = false;
this.pattern = Pattern
.compile("^<node=\"([-_a-zA-Z,._\\/0-9]{1,})\">([-a-zA-Z,._\\/0-9\\s]{1,})<\\/node>");
String tmp = "";
for (String line : this.getConfigFileLines()) {
this.matcher = this.pattern.matcher(line);
if (this.m... | 4 |
protected void setWindowSize(int _width, int _height) {
this.width = _width;
this.height = _height;
updateAspectRatio();
} | 0 |
private static void readHeader(ObjectInputStream ois, int[] header) throws IOException
{
for(int i = 0; i < 128; i++)
{
header[i] = ois.readInt();
}
textLength = ois.readInt();
} | 1 |
public OBJModel(String fileName)
{
m_positions = new ArrayList<Vector3f>();
m_texCoords = new ArrayList<Vector2f>();
m_normals = new ArrayList<Vector3f>();
m_indices = new ArrayList<OBJIndex>();
m_hasTexCoords = false;
m_hasNormals = false;
BufferedReader meshReader = null;
try
{
meshReader = ne... | 9 |
protected void Update(double timeDelta)
{
m_elapsedTime = (m_currentTime - m_startTime) / 1000.0f;//time, in seconds, since creation of GameForm
m_currentFPS = Math.floor(1000.0 / timeDelta);//estimated FPS at this instant in time, rounded down
if (IsKeyTriggered(KeyEvent.VK_F11))//toggle fullscreen
{
m_... | 4 |
void updateCamera() {
if (KeyInput.isKeyDown(Keyboard.KEY_UP )) pushCamera(-1, 1) ;
if (KeyInput.isKeyDown(Keyboard.KEY_DOWN )) pushCamera( 1, -1) ;
if (KeyInput.isKeyDown(Keyboard.KEY_RIGHT)) pushCamera( 1, 1) ;
if (KeyInput.isKeyDown(Keyboard.KEY_LEFT )) pushCamera(-1, -1) ;
//if (KeyInput.isK... | 5 |
public void visit_freturn(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} | 1 |
public int getInt(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number ? ((Number) object).intValue()
: Integer.parseInt((String) object);
} catch (Exception e) {
throw new JSONException("JSONArray[" ... | 2 |
@Override
public String toString()
{
return String.format( "annotatedWith(%s)", this.annotationType.getName() );
} | 0 |
public void actionPerformed(ActionEvent e)
{
try
{
if (e.getActionCommand().equals("Scout"))
{
//Creates an instance of the scout frame
ScouterScreen a = new ScouterScreen();
//Hide the page
this.setVisible(fa... | 9 |
public void backTrack() {
boolean tmpCounter = false, skipCounter = false;
for(int i = closedNodes.size()-1; i >= 0; i--) {
skipCounter = false;
for (Node tmpDead : deadEndList) {
if((closedNodes.get(i).compareTo(tmpDead))==1){
skipCounter = true;
break;
}
}
if(skipCounter==false) {
... | 9 |
public boolean pass(int[] bowl, int bowlId, int round,
boolean canPick,
boolean musTake) {
counter++;
if(counter==1){
for(int i=0;i<12;i++){
bowSize+=bowl[i];
}
//update(bowSize*6);
}
update(bowl,bowlId,round);
... | 8 |
public void updateTarget(Target moveTarget) {
final Target oldTarget = trueTarget ;
this.trueTarget = moveTarget ;
if (trueTarget != oldTarget) {
if (verbose) I.sayAbout(mobile, "...TARGET HAS CHANGED: "+trueTarget) ;
path = null ; stepIndex = -1 ; return ;
}
else if (inLocus(nextStep())... | 4 |
public void run ()
{
while (directory_prefix != null) {
// No matter how we learn that something may have
// changed, we do the same thing to figure out
// exactly what changed: scan usbdevfs
scanForDevices(matchUSBvendorID,matchUSBproductID);
//while (scan ())
// continue;
try {
... | 2 |
static public void main(String args[]) throws Exception {
if (args.length <= 0) {
System.err.println("Usage: java MultiPortEcho port [port port ...]");
System.exit(1);
}
int ports[] = new int[args.length];
for (int i = 0; i < args.length; ++i) {
port... | 2 |
@Override
public void setAccounting(Accounting accounting) {
counterParties = (CounterParties)accounting.getBusinessObject(CounterParties.COUNTERPARTIES);
statements = (Statements)accounting.getBusinessObject(Statements.STATEMENTS);
accounts=accounting==null?null:accounting.getAccounts();
journals=accounting==... | 2 |
public Help() {
setTitle("AYUDA");
setIconImage(Toolkit.getDefaultToolkit().getImage(Help.class.getResource("/InterfazGrafica/Images/1416396005_FAQ.png")));
setBounds(10, 50, 836, 739);
setLocationRelativeTo(rootPane);
setModal(true);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBackgro... | 0 |
private void parse() throws MalformedUriException, MalformedDomainException {
int colon = string.lastIndexOf(':');
if (string.charAt(0) == '[') {
int bracket = string.indexOf(']');
if (bracket < 0)
throw new MalformedUriException(string, "Unmatched escape bracket ... | 9 |
private void doGenBackbonesHelper(String runName, int numMutable, int strandMut[][], double theta, double alpha,
int numSteps, Backbone bb, double initFi[], double initPsi[], PrintStream logPS, int curRes){
if (curRes==numMutable){//we have a full backbone conformation, so output
outputBB(logPS, numMutable,... | 9 |
public static boolean check_variable_name_repeat(Variable_table variable_table, String name) {
for (int i = 0; i < variable_table.variable_name.size(); i++) {
if (variable_table.variable_name.get(i).toString().equals(name)) {
return false;
}
}
return true;... | 2 |
public void date() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMM");
try {
Date date = dateFormat.parse(monthDate);
Calendar cal = Calendar.getInstance();
cal.setTime(date);
maxDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.add(Calendar.MONTH, -1);
lastMaxDay = cal.getActua... | 1 |
public Job(int id, int tempoDeProcessamento, int requisicoesES, int acessoArquivos, int instanteDeChegada, ArrayList<Arquivo> arquivos) {
this.id = id;
this.instanteDeChegada = instanteDeChegada;
this.tempoDeProcessamento = tempoDeProcessamento;
this.requisicoesES = requisicoesES;
this.acessoArquivos = acesso... | 8 |
public static boolean areCompatiable(Width lhs, Width rhs) {
return lhs == rhs || (lhs == Width.ScalarDouble && rhs == Width.Quad)
|| (lhs == Width.Quad && rhs == Width.ScalarDouble)
|| (lhs == Width.ScalarSingle && rhs == Width.Long)
|| (lhs == Width.Long && rhs == Width.ScalarSingle);
} | 8 |
@Override
public boolean createGame(Date date, Member memberOne, Member memberTwo) {
Game game = new Game(date, memberOne, memberTwo);
List<Game> games = getAllGames();
games.add(game);
try {
serializeObjectToXML("Games.xml", games);
} catch (Exception e) {
// TODO Auto-generated catch block
e.... | 1 |
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 b... | 8 |
public String decodeData(List<Integer> data) {
wbDecoding = new HashMap<Integer, String>();
wbEncoding = new HashMap<String, Integer>();
StringBuffer rv = new StringBuffer();
List<StringBuffer> cache = new LinkedList<StringBuffer>();
int nextIndex = 256;
for (int i : data) {
if (i < 256) {
wbEn... | 7 |
public void unpauseAll(){
if (paused.size() == 0) return;
// Continue all paused sounds:
for (Map.Entry<String, Integer> entry : paused.entrySet()){
if (entry.getValue() > 0){
// Sound was looping for n-times:
sounds.get(entry.getKey()).getAudioClip().... | 4 |
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> classes = new HashSet<Class<?>>();
classes.add(RouteRestService.class);
//::::::::::::::::::::::::::::::::
//:: Setting the Property classes
//::::::::::::::::::::::::::::::::
DBProperties.setProperties();
RouteProperties.setProperties();
Adm... | 3 |
static public String ParseSrcPos() {
if (str.charAt(0) != '(' || str.charAt(str.length() - 1) != ')') {
return null;
}
if (str.length() >= 3) {
String srcpos = str.subSequence(1, 4).toString();
if (ParsePosition.IsPos(srcpos)) {
str = str.subSequence(4, str.lengt... | 6 |
public boolean hasNoJumps() {
return successors.size() == 0 && predecessors.size() == 0;
} | 1 |
public void fusionLayers() {
if (fusionArea.isEmpty()) {
return;
}
mergeOpacityBuffer(curColor, false);
fusion.clear(fusionArea, 0x00ffffff);
boolean fullAlpha = true, first = true;
for (CPLayer l : layers) {
if (!first) {
fullAlpha = fullAlpha && fusion.hasAlpha(fusionArea);
}
if (l.visi... | 6 |
public final void listaDeTipos() throws RecognitionException {
try {
// fontes/g/CanecaSemantico.g:339:2: ( ^( TIPOS_ ( tipo )* ) )
// fontes/g/CanecaSemantico.g:339:4: ^( TIPOS_ ( tipo )* )
{
match(input,TIPOS_,FOLLOW_TIPOS__in_listaDeTipos1125); if (state.failed... | 9 |
public String[] parseMessage(Message msg){
return msg.getContent().split(":");
} | 0 |
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.