text stringlengths 14 410k | label int32 0 9 |
|---|---|
private Handshake(ByteBuffer data, ByteBuffer infoHash, ByteBuffer peerId, boolean isObfuscated) {
this.data = data;
this.infoHash = infoHash;
this.peerId = peerId;
this.isObfuscated = isObfuscated;
} | 0 |
private void setUpListener(final JScrollPane contents) {
changeListButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if(pageListShowing==true){
setUpButtonImage(changeListButton,"ChangePageButton.png");
pageListShowing=false;
listModel.cl... | 3 |
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_... | 9 |
public Object getValueFor(int[] position, int crosstabDataIndex){
Object result = null;
boolean allPositionsAreEqual = true;
if(position != null){
//iterate over dataList
for (IntermediateTotalInfo totalInfo : totalsDataList) {
int[] positionRelativeToHeader = totalInfo.getPositionRelativeToHeader... | 8 |
public void paintComponent(Graphics gfx) {
super.paintComponent(gfx);
Graphics2D g = (Graphics2D) gfx;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setPaint(Color.blue);
//Draw all the lines
for(int i = 0; i < (items.le... | 7 |
public void addFload(int n) {
if (n < 4)
addOpcode(34 + n); // fload_<n>
else if (n < 0x100) {
addOpcode(FLOAD); // fload
add(n);
}
else {
addOpcode(WIDE);
addOpcode(FLOAD);
addIndex(n);
}
... | 2 |
@Test
public void canRetrieveCellFromCoordinates() {
for (int x = 0, size = sudoku.getGridLength(); x < size; x++)
for (int y = 0; y < size; y++)
sudoku.setCellValue(x, y, x * 100 + y);
for (int i = 0, sudokuSize = sudoku.getSudokuSize(); i < sudokuSize; i++) {
... | 5 |
public String getMatchingStartExpression(String text) {
String matchedExpression = null;
int expressionCount = getExpressionCount();
for (int i = 0; i < expressionCount; i++) {
// Look for a matching Expression
String currentExpression = getExpression(i);
boolean isMatchingExpression = text.startsWith... | 2 |
private boolean sort()
{
// Obter pontuações
String contents = toString();
if(contents == null)
return false;
String[] scoresArr = contents.split( Util.EOL ); // Array de pontuações
int[] scoresVals = new int[ scoresArr.length ]; // Array com valores
String[][] scoresNomes = new String[ scoresArr.leng... | 7 |
private void compareDistances(int edge) {
System.out.println("edge: " + edge);
d.msDelay(3000);
if (edge == 1) {
if (turnLeft()) {
Sputnik.robotMap.setPosition(new Node(0, 4));
Sputnik.robotMap.setHeading(1);
}
else {
Sputnik.robotMap.setPosition(new Node(3, 4));
Sputnik.robotMap.setHea... | 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 Validator<ResourceModel> getValidator() {
return new Validator<ResourceModel>() {
@Override
public Set<ConstraintViolation> validate(ResourceModel item) {
Set<ConstraintViolation> constraints = new HashSet<ConstraintViolation>();
Map<String, Resour... | 8 |
@Override
public String getHdfs() {
//return "hdfs://192.168.178.41:8020";
return "hdfs://192.168.43.180:9000";
} | 0 |
public void visit_ifgt(final Instruction inst) {
if (longBranch) {
final Label tmp = method.newLabel();
addOpcode(Opcode.opc_ifle);
addBranch(tmp);
addOpcode(Opcode.opc_goto_w);
addLongBranch((Label) inst.operand());
addLabel(tmp);
} else {
addOpcode(Opcode.opc_ifgt);
addBranch((Label) inst.... | 1 |
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
switch(columnIndex) {
case 0: return competition.getRaces().get(rowIndex).getNumber();
case 1: return competition.getRaces().get(rowIndex).getJogger().getName();
case 2: return (competition.getStartTime() != null) ? new SimpleDateFormat("dd... | 9 |
public int DBCount(String journal, String from, String to)
{
if(journal==null)
return 0;
journal = DB.injectionClean(journal);
from = DB.injectionClean(from);
to = DB.injectionClean(to);
synchronized(journal.toUpperCase().intern())
{
int ct=0;
DBConnection D=null;
try
{
D=DB.DBFetch(... | 9 |
public static String read(final InputStream is) {
final char[] buffer = new char[2048];
final StringBuilder out = new StringBuilder();
try {
Reader in = null;
try {
in = new InputStreamReader(is, "UTF-8");
while (true) {
int rsz = in.read(buffer, 0, buffer.length);
if (rsz < 0)
break... | 4 |
public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
for(int var6 = 0; var6 < 64; ++var6) {
int var7 = var3 + var2.nextInt(8) - var2.nextInt(8);
int var8 = var4 + var2.nextInt(4) - var2.nextInt(4);
int var9 = var5 + var2.nextInt(8) - var2.nextInt(8);
... | 3 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
for(int x = 0; x< IConfig.LARGEUR_CARTE;x++ ){
for(int y = 0; y< IConfig.HAUTEUR_CARTE;y++ ){
this.mapGraph[x][y].repaint();
}
}
} | 2 |
public static int searchSign(Block block) {
Set<BlockFace>
signFaces =
EnumSet.of(BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH);
for (BlockFace face : signFaces) {
Block relativeBlock = block.getRelative(face);
if (relativeBlock.getType() == Material.WALL_SIGN) {
... | 4 |
public boolean controlarRegistros(){
try {
r_con.Connection();
ResultSet rs=r_con.Consultar("select pc_fecha_cierre,pc_fecha_impresion_diario,pc_fecha_inicio from parametros_contables");
rs.next();
Fechas fechas=new Fechas();
String fechaCierre... | 6 |
private static void handleAcceptOffer(SerializableAcceptOffer pack) {
// send to the seller for which the offer was accepted the confirmation
Server.loggerServer.info("[Server] Received accept offer packet");
String seller;
List<String> refusedSellers = new ArrayList<String>();
SelectionKey key = Server.regi... | 2 |
public static Date getLastDayOfTheMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
lastDay, 0, 0, 0);
return calendar.getTime();
} | 0 |
@SuppressWarnings("static-method")
protected StdImage getIcon(Row row, Column column, boolean selected, boolean active) {
Object data = row.getData(column);
return data instanceof StdImage ? (StdImage) data : null;
} | 1 |
public LegalMovesIterator(Board b) {
switch (b.turn()) {
case WHITE:
_pieces = b._whiteSetMap.keySet().iterator();
break;
case BLACK:
_pieces = b._blackSetMap.keySet().iterator();
break;
default:
... | 3 |
@Test
public void testFullTextSearch_on_a_field() {
ReadResponse resp = factual.fetch(TABLE,
new Query().field("name").search("Fried Chicken"));
for (String name : resp.mapStrings("name")) {
assertTrue(name.toLowerCase().contains("frie")
|| name.toLowerCase().contains("fry")
... | 3 |
private void save(File file)
{
BufferedWriter writer = null;
try
{
try
{
file.getParentFile().mkdir();
file.createNewFile();
writer = new BufferedWriter(new FileWriter(file));
for(int row = 1; row < countRows + 1; row++)
{
StringBuild... | 5 |
public static Config unserialize(){
Config config = null;
try {
File file = new File(CONFIG_FILE_NAME);
if(!file.exists()) return null;
FileInputStream fileIn = new FileInputStream(CONFIG_FILE_NAME);
ObjectInputStream objectIn = new ObjectInputStream(file... | 3 |
@Override
public void actionPerformed(ActionEvent e) {
// if we're not in a totally-maximized state
// [which would make this all pointless] ...
if (!Outliner.desktop.isMaximized()) {
// grabaholda the topmost doc
OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouche... | 1 |
@Test
public void test_something() throws IOException, InterruptedException {
final Map<String, String> server_script = new HashMap<String, String>();
server_script.put("foo", "bar");
final int port =9247;
StringTrafficker st = new StringTrafficker(port,
... | 0 |
public void updateUser() {
if (id != null) {
PreparedStatement st = null;
String q = "UPDATE users SET email = ?, first_Name = ?, last_name = ? ";
if (!StringUtil.isBlank(password)) {
q += ",password = MD5(?)";
}
q += "WHERE id = ?";
... | 6 |
public static boolean isInteger(String line){
for(int i = 0; i < line.length(); i++){
char element = line.charAt(i);
if(isNumber(element) == false){
if(i == 0 && element == '-' && line.length() > 1){
continue;
}
return ... | 5 |
public void listInfo(Intersection closest, JTextArea textOutput) {
Set<Integer> roadIds = new HashSet();
double lat = closest.getLatitude();
double lon = closest.getLongitude();
ArrayList<String> roadNames = new ArrayList<String>();
for (Segment seg : segments) {
if ((seg.getNodeID1().getID() == closest.ge... | 7 |
public int getK() {
return k;
} | 0 |
@Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
if(!CMProps.getBoolVar(CMProps.Bool.EMAILFORWARDING))
{
mob.tell(L("This feature is not activated."));
return false;
}
String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : "";
... | 9 |
public void setMed_depotLegal(String med_depotLegal) {
this.med_depotLegal = med_depotLegal;
} | 0 |
public PlacesList<Place> placesForUser(int placeType, String woeId, String placeId, String threshold, Date minUploadDate, Date maxUploadDate,
Date minTakenDate, Date maxTakenDate) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
PlacesList<Place> place... | 9 |
public Object clone() {
Automaton a;
// Try to create a new object.
try {
// I am a bad person for writing this hack.
// if (this instanceof TuringMachine)
// a = new TuringMachine(((TuringMachine) this).tapes());
// else
a = (Automaton) getClass().newInstance();
} catch (Throwable e) {
// Well... | 6 |
public int getHandValue() {
int value = 0;
for (int i = 0; i < this.hand.size(); i++) {
value += this.hand.get(i).getNumValue();
}
if(value > 21 && hasAce) {
for(int i = 0; i < aceIndex; i++) {
value = value - 10;
if(value <= 21)
break;
}
}
return value;
} | 5 |
public static int tipoInterseccion(int u1, int v1, int u2, int v2, int x1, int y1, int x2, int y2)
{
int res;
int a1,a2,b1,b2,c1,c2,dd;
double xx,yy;
res = -1; // cuando uno de los segmentos es un punto
// res := 0 cuando son paralelas pero no colineales (no se intersectan)
// re... | 8 |
public TestDaoGenerator( Table table ) {
super( table );
this.daoName = "Test" + table.getDomName() + "Dao";
filePath = "src/test/java/" + packageToPath() + "/dao/" + daoName + ".java";
for( Column col : table.getColumns() ){
if ( col.isKey() ){
param += toJav... | 2 |
private void chargerListeLabo() throws DaoException {
List<Labo> desLabos = daoLabo.getAll();
getVue().getModeleJComboBoxLabo().removeAllElements();
for (Labo unLabo : desLabos) {
getVue().getModeleJComboBoxLabo().addElement(unLabo);
}
} | 1 |
public EvolvingGraph readEvolvingGraph () throws FileNotFoundException {
Schedule sched;
String u, v;
int source, dest, cost, numsched;
int aux = 0;
File f = new File (filename);
EvolvingGraph graph = new EvolvingGraph(0);
graph.setMaxTime(0);
Scanner sc = new Scanner (f);
sc.nextInt();
int edges =... | 7 |
private void buildQueue(LinkedList<BTPosition<T>> ll,
ArrayList<BTPosition<T>> al) {
BTPosition<T> c;
while (!ll.isEmpty()) {
c = ll.poll();
if (c.getLeft() != null)
ll.add(c.getLeft());
if (c.getRight() != null)
ll.add(c.getRight());
al.add(c);
}
} | 3 |
private Comparator<Row> comparatorFromOrderCriteria(OrderCriteria criteria){
Integer columnIndex = header.findByCellValue(criteria.getColumnName()).getCellIndex();
Comparator<Row> natural = (e1, e2) -> e1.getCellByIndex(columnIndex).getCellValue().
compareTo(e2.getCellByIndex(columnInde... | 1 |
private VillageDoorInfo getVillageDoorAt(int par1, int par2, int par3)
{
Iterator var4 = this.newDoors.iterator();
VillageDoorInfo var5;
do
{
if (!var4.hasNext())
{
var4 = this.villageList.iterator();
VillageDoorInfo var6;
... | 6 |
public DiscoveredClient getClientForUsername(String username)
{
synchronized(threadLock)
{
Iterator<DiscoveredClient> it = getClients().iterator();
while ( it.hasNext() )
{
DiscoveredClient thisClient = it.next();
if ( thisClient.getUsername().equals(username) )
return thisClient;
}
}
... | 2 |
public static int computeFieldSize(final FieldDescriptorLite<?> descriptor,
final Object value) {
WireFormat.FieldType type = descriptor.getLiteType();
int number = descriptor.getNumber();
if (descriptor.isRepeated()) {
if (descriptor.isPacked()) {
int data... | 7 |
public void shoot(){
if(shoot && BulletTimer == 0){
Bullet b = new Bullet(); // Creates a new bullet;
b.setBullet(1, 6 + xShip + ship.getWidth() / 8, window.getHeight() - ship.getHeight() / 2); // Sets bullet's Parameters
bullets.add(b); // adds to array
BulletTi... | 6 |
public static int[] toIntArray(Integer[] data)
{
int[] result = new int[data.length];
for (int i = 0; i < data.length; i++)
{
result[i] = data[i].intValue();
}
return result;
} | 1 |
public void sendEndActions(){
JSONObject o = new JSONObject();
try {
o.put("message", "endactions");
sendMessage(o);
} catch (JSONException e){}
catch (IOException e){
Debug.error("Error writing to graphics: " + e.getMessage());
}
} | 2 |
private void paintScreen() {
Graphics g;
try {
g = this.getGraphics();
if ((g != null) && (dbImage != null)) {
g.drawImage(dbImage, 0, 0, null);
}
// Sync the display on some systems.
// (on Linux, this fixes event queue proble... | 3 |
private int berekenSchotRichting(double hoekRad, double kracht, double windSnelheid, double zwaartekracht, Orientatie tankRichting){ //testen in welke richting het schot gaat, returnt 0 wanneer rechtop, -1 wanneer links en 1 wanneer rechts
if((int)Math.round(Math.pow((kracht * Math.cos(hoekRad) + windSnelheid),... | 5 |
@Override
public List<Cell> createCells(Line rawLine) {
String line = rawLine.getRawLine();
int lengthOfLine = rawLine.numberOfCharakters();
int charaktersRead = 0;
while (true) {
char workingCharakter = line.charAt(charaktersRead);
Symbol symbol = new Symbol(... | 6 |
private void calculateNextGeneration() {
//// Prepare selection algorithms
crossSelector.updateSpeciments(population);
transferSelector.updateSpeciments(population);
mutationSelector.updateSpeciments(population);
//// Reproduce species
int speci... | 4 |
public static double[][] readTransitionProbHDFS(String directory, int number_reducers, FileSystem fs) {
int number_of_lines = findNumberOfLinesHDFS(directory, "transition-r-", number_reducers, fs);
double[][] transition_prob = new double[number_of_lines][number_of_lines];
try {
for(int i = 0; i<number_reducer... | 7 |
public void removePush() {
if (condStack != null)
cond = condStack.mergeIntoExpression(cond);
thenBlock.removePush();
if (elseBlock != null)
elseBlock.removePush();
} | 2 |
public Imagen getImagenMR(int windowCenter, int windowWidth) {
Imagen imgObj = new Imagen();
int alto = rasterDicom.getHeight();
int ancho = rasterDicom.getWidth();
int minX = rasterDicom.getMinX();
int minY = rasterDicom.getMinY();
imgObj.setFormato("P2");
imgObj... | 6 |
private void setColorBenchmarks() {
findExtremes();
this.tempRangesHigh = new long[4];
tempRangesHigh[1] = (HIGH_TEMP + MAX_TEMP) >>> 1; // mid-point
tempRangesHigh[0] = (HIGH_TEMP + tempRangesHigh[1]) >>> 1; // lower quartile
tempRangesHigh[2] = (MAX_TEMP + tempRangesHigh[1]) >>... | 0 |
public static void initializeCoefficients() {
N = 0;
postProb = 0.0;
// Create window to store old samples
if (Settings.agingFlag == Settings.windowAge) {
oldSamples = new double[Settings.windowSize][2];
}
// Set all scaling coefficients to 0
Transform.scalingCoefficients = new double[Transform.s... | 3 |
@Override
public void run() {
while (true) {
String message = produce();
try {
if (message.contains("Await receipt")) {
System.out.println("transfer done");
queue.transfer(message); // blocks if there is no matching take() pendi... | 3 |
public IPPacket processPacket(IPPacket packet, int direction) {
long now = 0;
try {now = System.nanoTime();} catch (Exception e) {}
if (direction == DIRECTION_IN) {
int offset = packet.getIPHeaderByteLength();
int len = packet.getIPPacketLength() - offset;
byte[] esp = packet.getDataUnprotected();
... | 9 |
final void method3049(ByteBuffer class348_sub49, int i, int i_0_) {
anInt9179++;
int i_1_ = i;
while_152_:
do {
do {
if (i_1_ != 0) {
if ((i_1_ ^ 0xffffffff) != -2) {
if ((i_1_ ^ 0xffffffff) == -3)
break;
break while_152_;
}
} else {
anInt9176 = class348_sub49.getShort();
... | 6 |
public boolean isReference() {
return !special && (clazz == null || !clazz.isPrimitive());
} | 2 |
public void run() {
writer.println("PLAY "+name);
writer.flush();
while(!socket.isClosed()){
try {
String response = reader.readLine();
if(response.equals("WAIT"))
System.out.println("Esperando al otro jugador...");
else if(response.startsWith("VERSUS")){
String name = response.s... | 9 |
public static Factory get(Class<? extends ASTNode> type, Class<?> argType) {
if (type == null) {
return null;
}
try {
final Method method = type.getMethod(Parser.kFactoryName,
new Class<?>[] { argType });
return new Factory() {
protected ASTNode make0(Object args) throws Exception {
return ... | 9 |
public void setFirst(T newValue) { first = newValue; } | 0 |
private static boolean getNext( int[] num, int n, int r ) {
int target = r - 1;
num[target]++;
if ( num[target] > ((n - (r - target)) + 1) ) {
while ( num[target] > ((n - (r - target))) ) {
target--;
if (target < 0) {
break;
... | 5 |
private void createRandomTestSuite(final int i)
{
StroopTest stroopTest = stroopTestProvider.getActiveStroopTest();
if (stroopTest != null)
{
// FIXME send event + add MainWindow where null
int choice = JOptionPane.showConfirmDialog(null,
"Wenn Sie einen neuen Test anlegen wird der Alte gel"+oe+"scht... | 7 |
public void operation() {
if (mComponent != null) {
mComponent.operation();
}
} | 1 |
@Override
public void transit(StateMachineEvent<EventType> event) throws InvalidEventException {
Future<?> future = threadPoolFacade.process(new FSMTransitionTask(threadPoolFacade, event,true), syncRunnableProducer);
try {
future.get();
} catch (InterruptedException ex) {
... | 8 |
public ItemType getItemType(TypeHierarchy th) {
boolean isSchemaAware = true;
try {
isSchemaAware = getExecutable().isSchemaAware();
} catch (NullPointerException err) {
// ultra-cautious code in case expression container has not been set
if (!th.getConfigurat... | 9 |
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 void run() {
try {
InputStream is = socket.getInputStream();
while (true) {
BufferedReader buffer = new BufferedReader(new InputStreamReader(is));
String str = buffer.readLine();
System.out.println("received msg from server:" + str);
}
} catch (IOExc... | 2 |
public void update(Observable obs, Object arg) {
if (obs instanceof WeatherData) {
WeatherData weatherData = (WeatherData)obs;
float temperature = weatherData.getTemperature();
temperatures.add(temperature);
int count = temperatures.size();
if (count ... | 5 |
public void montarJanelaEditar() {
tratadorEventosEditar = new TratadorEventosEditar(acessoBanco, this);
painelPrincipal = new JPanel();
MigLayout migLayout = new MigLayout("wrap 3");
painelPrincipal.setLayout(migLayout);
botoes.add(botaoCancelar);
botoes.add(botaoSalvar);
try {
MaskFormatter maskar... | 3 |
public Vector getOddCycle( Bipartition b ) {
//For each vertex, traverse the graph until an endpoint is reached or until a cycle is found.
//Keep track of the path to the original vertex and the distance. If the distance is odd, print out the
//odd cycle.
Vector path = new Vect... | 9 |
private void generateIsland(float y, int minSize, int maxSize) {
gen = new IslandGenerator(minSize, maxSize, y);
gen.start();
while (gen.finishedIsland == null) {
lastProgress = new Float(progress);
progress = (gen.progress / factor) + progressBefore;
if (progress != lastProgress) {
try {
... | 3 |
public static double commonBaggageWeight( PassengerTrain train ){
double res = 0;
for ( RailwayVehicle it : train ){
if ( it instanceof PassengerCar ){
PassengerCar pCar = (PassengerCar)it;
res+= pCar.getBaggageWeight();
}
}
return res;
} | 2 |
public static Object loadObject(String file_name) {
ObjectInputStream ois;
try {
ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(new File(file_name))));
Object object = ois.readObject();
ois.close();
return object;
} catch (IOException e) {
System.err.println("Error loading:... | 2 |
public String getSelectedNote() {
String selectedNote = null;
int row = table.getSelectedRow();
if(row!=-1)
{
if(table.getValueAt(row, 0)!=null) {
selectedNote = table.getValueAt(row, 0).toString();
}
if(table.getValueAt(row, 1)!=null) {
selectedNote = table.getValueAt(row, 1).toString();
... | 3 |
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 |
public static ArrayList<MediaCopy> searchMediaByID(String ID){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<MediaCopy> media = new ... | 5 |
public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception
{
HashMap<String, HashMap<String, Integer>> map =
new HashMap<String, HashMap<String,Integer>>();
BufferedReader reader = filePath.toLowerCase().endsWith("gz") ?
new BufferedReader(new InputStreamReader(
... | 6 |
public static File[] filterImagesFromFolder (File[] folder)
{
List<File> files = new ArrayList<File>();
File[] listOfImages = null;
int i=0;
try{
for(File file:folder)
{
if(file.getName().endsWith(".jpg")||file.getName().endsWith(".jpeg")||file.getName().endsWith(".png")
|| file.getName().endsW... | 9 |
private void canSeeNothingAction() {
switch (this.getType()) {
case "Goalie" : //MP- If you can see the ball, face it
if (canSeeBall) {
turnTowardBall();
} else if (canSeeOpponentGoal) {//MP- If you can't see the ball, face the oppo... | 7 |
public static BufferedImage applyGaussianBlur(final BufferedImage image, final int filterRadius, final float alphaFactor, final boolean useOriginalImageAsDestination) {
if (filterRadius < 1) {
throw new IllegalArgumentException("Illegal filter radius: expected to be >= 1, was " + filterRadius);
}
float[] kern... | 8 |
public Economy getEconomy() {
if (econHook == null) {
throw new NullPointerException("Economy was called but hasn't been setup!");
}
return econHook;
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ChunkSQL other = (ChunkSQL) obj;
if (worldName == null) {
if (other.worldName != null)
return false;
} else if (!worldName.equals(other.... | 8 |
public static ArrayList<Student> chgGradeMenu(ArrayList<Student> inList){
int choice = 0;
do {
System.out.println("What would you like to do: \n 1) Change Grade \n 2) Switch Classes \n 3) return to main menu");
Scanner userinput = new Scanner(System.in);
choice = userinput.nextInt();
... | 4 |
public Tile (int id, Sprite[] sprites, int levelColour) {
this.tileID = (byte)id;
if(tiles[id] != null) {throw new RuntimeException("Duplicate tile id on " + id);}
this.sprites = sprites;
this.levelColour = levelColour;
tiles[id] = this;
spriteID = random.nextInt(sprites.length);
System.out.println(sprite... | 1 |
public List<ExtendedEntityType> getIndividualMobs()
{
List<ExtendedEntityType> types = new ArrayList<ExtendedEntityType>();
if (mobMaximums != null)
{
for (int i = 0; i < mobMaximums.length; ++i)
{
if (mobMaximums[i] != Short.MAX_VALUE)
{
types.add(ExtendedEntityType.valueOf(i));
}
}... | 7 |
protected final short get_reduce(int state, int sym)
{
short tag;
short[] row = reduce_tab[state];
/* if we have a null row we go with the default */
if (row == null)
return -1;
for (int probe = 0; probe < row.length; probe++)
{
/* is this entry labeled with our Symbol or... | 4 |
private static Object toAnnoType(Annotation anno, ClassPool cp)
throws ClassNotFoundException
{
try {
ClassLoader cl = cp.getClassLoader();
return anno.toAnnotationType(cl, cp);
}
catch (ClassNotFoundException e) {
ClassLoader cl2 = cp.getClass().g... | 1 |
@Override
public void mouseClicked(MouseEvent e) {
//Afficher le contenu de la pioche ouverte
if ( e.getSource() == this.openPick && tileViewer == null && !this.selected.hasSelection()) {
this.tileViewer = this.openPick.viewTiles();
if (this.tileViewer != null) {
this.add(tileViewer, 0);
this.client.... | 8 |
private void initializeTetrominoes() {
tetromino = bag.draw();
next = new LinkedList<>();
for (int i = 0; i < PREVIEW_COUNT; i++) {
next.add(bag.draw());
}
if (nextTetrominoesChangedListener != null)
nextTetrominoesChangedListener.onNextTetrominoesChanged(next);
} | 2 |
public static ArrayList<BookCopy> searchBookByISBN(String iSBN){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<BookCopy> books = new... | 5 |
final void method1716(boolean bool) {
if (((Class239) this).aClass348_Sub51_3136.method3425(-82))
((Class239) this).anInt3138 = 0;
anInt5904++;
if ((((Class348_Sub51) ((Class239) this).aClass348_Sub51_3136)
.aClass239_Sub24_7235.method1820(-32350)
^ 0xffffffff)
== -1)
((Class239) this).anInt3... | 5 |
public byte[] readBytesReverse(int amount, ValueType type) {
byte[] data = new byte[amount];
int dataPosition = 0;
for (int i = buffer.readerIndex() + amount - 1; i >= buffer.readerIndex(); i--) {
int value = buffer.getByte(i);
switch (type) {
case A:
value -= 128;
break;
case C:
... | 4 |
@Override
public void add(Difference difference) {
if(ignorePaths == null) {
list.add(difference);
} else {
String pathA = trimNonXmlElements(difference.getPathA());
String pathB = trimNonXmlElements(difference.getPathB());
if (ignorePaths.contains(pat... | 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.