text stringlengths 14 410k | label int32 0 9 |
|---|---|
protected void containerItemSwappingLogic(){
//put stack from one inventory to another
if(secondairyInventory != null)
if(KeyHandler.isValidationKeyPressed())
if(isNotPlayerInventory() && secondairyInventory != null){
System.out.println(slot_index);
if(secondairyInventory.getStackInSlot(slot_index)... | 8 |
public void extractConfig(final String resource, final boolean replace) {
final File config = new File(this.getDataFolder(), resource);
if (config.exists() && !replace) return;
this.getLogger().log(Level.FINE, "Extracting configuration file {1} {0} as {2}", new Object[] { resource, CustomPlugin... | 4 |
@Override
public void initProvider(Plugin plugin)
{
this.plugin = plugin;
this.configFile = new File(plugin.getDataFolder(), "mods.yml");
this.config = YamlConfiguration.loadConfiguration(this.configFile);
if (!this.configFile.exists())
{
this.plugin.getLogger().warning("No... | 4 |
public void testPlus_int() {
Weeks test2 = Weeks.weeks(2);
Weeks result = test2.plus(3);
assertEquals(2, test2.getWeeks());
assertEquals(5, result.getWeeks());
assertEquals(1, Weeks.ONE.plus(0).getWeeks());
try {
Weeks.MAX_VALUE.plus(1);
... | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GroupData other = (GroupData) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
ret... | 6 |
public boolean DiagonalSuperior()
{
boolean validar=false;
for (int i = 1; i < matrizA.length; i++) {
for (int j = 1; j < i; j++) {
if(matrizA[i][j]==0)
{
validar=true;
}
else
{
va... | 3 |
public void printMapping() {
Logger log = Bukkit.getServer().getLogger();
for (Entry<String, Subcommand> ent : cmdMap.entrySet()) {
log.info(ent.getKey() + " : " + ent.getValue());
}
} | 1 |
@SuppressWarnings("unchecked")
private ArrayList<String> getUniversityShortNames(
HashMap<String, Object> map) {
ArrayList<Object> ids = (ArrayList<Object>) map.get("partnerIds");
ArrayList<String> result = new ArrayList<String>();
for (Object id : ids) {
Object uni = universities.get(id);
if (uni == nu... | 3 |
public void FillColumn(int columna){ //llenado automatico por columna
for(int y = 0;y<14;y++){ //revisa en una columna desde abajo hacia arriba
String colorpresente = this.blocks[columna][y].getColor(); //obtiene color
if (colorpresente.equals("-") ){ //significa que esta en blanco...hay que reemplazar color
... | 9 |
private boolean confirm() {
if (!checkAndSetUid(uidField.getText(), pageComboBox, dialog))
return false;
String s = scriptArea.getText();
if (s != null && !s.trim().equals("")) {
if (!checkBraceBalance(s)) {
JOptionPane.showMessageDialog(dialog, "Unbalanced balances are found.", "Menu text-script pair e... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
HasherTable<K, V> h = (HasherTable<K, V>) obj;
Set<Entry<K, V>> otherSet = h.entrySet();
for (Entry<... | 4 |
public static void main(String... args) throws IOException, DateFormatException, URISyntaxException {
String load = "";
Replacer r = null;
System.out.println("\nYou've just run LogAnalyst v1.0");
if (args.length == 0) {
System.out.println("Default configuration is loaded, si... | 9 |
public boolean checkOut(Book b, Timestamp startTime, int cardNumber, int idNumber) throws Exception {
if(b == null || b.getCurrentQuantity() == 0){
return false;
}
Connection connect = null;
Statement statement = null;
ResultSet resultSet = null;
PreparedStatement preparedStatement = null;
try... | 8 |
private void loadDatFile() throws IOException {
BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(inputFile), "GBK"));
String data = null;
int index = 0;
while ((data = br.readLine()) != null) {
// 第一行不要,是中文
if (in... | 4 |
public int size() {
return this.instances.size();
} | 0 |
public Expression simplify() {
Expression expr = simplifyAccess();
if (expr != null)
return expr.simplify();
expr = simplifyString();
if (expr != this)
return expr.simplify();
return super.simplify();
} | 2 |
private static void reconcileHints(GC gc, int applied, int hints) {
int changes = hints ^ applied;
if ((changes & XOR_MASK) != 0) {
gc.setXORMode((hints & XOR_MASK) != 0);
}
// Check to see if there is anything remaining
changes &= ~XOR_MASK;
if (changes != 0) {
if ((changes & INTERPOLATION_MASK) !=... | 9 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
Outliner.documents.addTreeSelectionListener(this);
setEnabled(false);
} | 0 |
@Override
protected void reduce(Text key, Iterable<Text> values, Context context)
throws IOException, InterruptedException {
System.out.println(HeaderType.valueOf(
key.toString().trim().replaceAll("\\ ", "")).toString());
switch (HeaderType.valueOf(
key.toString().trim().replaceAll("\\ ", "")).toS... | 8 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final EmbeddedType other = (EmbeddedType) obj;
if (this.schema != other.schema && (this.schema == null || !this... | 5 |
public void initRenderTargets(int[] attachments) {
if (attachments == null)
return;
int[] drawBuffers = new int[id.length];
boolean hasDepth = false;
for (int i = 0; i < id.length; i++) {
if (attachments[i] == GL_DEPTH_ATTACHMENT) {
drawBuffers[i... | 8 |
public void setCalle(String calle) {
addressCompany.setCalle(calle);
} | 0 |
public CFGToPDALLConverter() {
} | 0 |
public void draw(Graphics2D g) {
for(
int row = rowOffset;
row < rowOffset + numRowsToDraw;
row++) {
if(row >= numRows) break;
for(
int col = colOffset;
col < colOffset + numColsToDraw;
col++) {
if(col >= numCols) break;
if(map[row][col] == 0) continue;
... | 5 |
public ActivityItemProperties addActivityItem(ActivityItem actItem) {
// get the dimensions for the component
Dimension activityItemDimens = new Dimension(actItem.getActivityItemDimensions().width,
actItem.getActivityItemDimensions().height) ;
// calculate the ... | 5 |
private int jjMoveStringLiteralDfa5_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(3, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(4, active0);
return 5;
}
switch(curChar)
{
case 88:
... | 9 |
private JMenu getFileMenu(boolean webstart){
JMenu file = new JMenu("File");
file.setMnemonic('f');
JMenuItem newImageItem = new JMenuItem("New");
newImageItem.setMnemonic('n');
ActionListener newImage = new ActionListener() {
@Override
public void action... | 7 |
@Command(aliases = {"list", "l"}, usage = "[page]", flags = "", desc = "Lists all ports", help = "Lists all JumpPorts", min = 0, max = 1)
@CommandPermissions("jumpports.list")
@Console
public static void list(CommandContext args, CommandSender sender)
throws CommandException {
List<JumpP... | 6 |
public static String string2UnicodeNumber(String s) {
try {
StringBuffer out = new StringBuffer("");
StringBuffer temp = null;
StringBuffer number = null;
byte[] bytes = s.getBytes("unicode");
for (int i = 2; i < bytes.length - 1; i += 2) {
temp = new StringBuffer("&#");
number = new StringBuff... | 3 |
public int contains(String std) {
String anterior;
NodoListaDiccionario aux = ultimo;
//Mira si esta std o su anterior
if(std.length()>4) {
while(aux!=null) {
anterior= std.substring(std.length()-2);
if(aux.getPalabra().equals(std))
return aux.getIndex();
else if(aux.getPalabra().equals(a... | 6 |
private long parseTime(String timeString)
{
long result = 0;
if (classicTime)
{
String[] time = timeString.split(timeDelimiter);
//HOUR, MINUTE, SECOND, MILLISECOND
result = Integer.parseInt(time[0]);
result *= 60; //now in minutes
... | 4 |
private void printPath( String file ) {
fileCount++;
if ( file == null ) {
System.out.println( fileCount + ". MyBatis configuration already exists." );
return;
}
System.out.println( fileCount + ". " + file );
} | 1 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 6 |
public void setTime(int h, int m, int s) {
if((h>=0 && h<24) && (m>=0 && m<60) &&
(s>=0 && s<60)) {
hour = h;
minute = m;
second = s;
}
else
throw new IllegalArgumentException(
... | 6 |
private boolean jj_3_10() {
if (jj_3R_28()) return true;
return false;
} | 1 |
@Override
public void execute() {
seq(new WalkToSegment(0, 8));
seq(new WalkToSegment(-1, 8));
seq(new WalkToSegment(36, 16));
seqMove(new OverworldInteract(5));
seq(new SkipTextsSegment(4)); // pewter skip text
for (int i=0;i<36;i++) {
seqMove(new PressButton(Move.LEFT), 0);
}
for (int i=0;i<100;i+... | 4 |
public static void updateCommandeClient(int idcommandeclient, int identreprise,int idinterlocuteur, Date datecommandeclient,String referencecommandeclient,Float totalhtcommandeclient,Float totalttccommandeclient, Float remisecommandeclient) throws SQLException {
String query = "";
try {
q... | 1 |
public void mouseDown(MouseEvent me) {
guiUsedMouseDown = false;
if (getWindows().mouseDown(me)) {
guiUsedMouseDown = true;
return;
}
int chx = (-getWorld().getScreenX()) + lastmx;
int chy = (-getWorld().getScreenY()) + lastmy;
chx /= 50;
chy /= 50;
if (chx < PavoHelper.getGameWidth(getWorld().ge... | 8 |
public static byte [] generate() {
// create ethernet header
byte [] packet = HeaderGenerator.generateRandomEthernetHeader();
int eProto =
ArrayHelper.extractInteger(packet, ETH_CODE_POS, ETH_CODE_LEN);
// figure out what type of packet should be encapsulated after the
// newly generated et... | 5 |
@Override
public boolean isObstacle(Element e) {
if (e instanceof Player)
return true;
return false;
} | 1 |
public AngryFriend() {
JFrame frame = new JFrame("Start Angry Game");
frame.setLocationRelativeTo(null);
frame.setMinimumSize(new Dimension(300, 400));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (... | 8 |
public List<PfamToGoMapping> parse() throws IOException {
final String error = ForesterUtil.isReadableFile( getInputFile() );
if ( !ForesterUtil.isEmpty( error ) ) {
throw new IOException( error );
}
final BufferedReader br = new BufferedReader( new FileReader( getInputFile()... | 9 |
public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null) return false;
if (obj.getClass() != this.getClass()) return false;
Picture that = (Picture) obj;
if (this.width() != that.width()) return false;
if (this.height() != that.height()) return... | 8 |
public SaltAlgorithmIdentifierType createSaltAlgorithmIdentifierType() {
return new SaltAlgorithmIdentifierType();
} | 0 |
public void InputSymbol(int input){
for (int i = 0; i < mStates.size(); ++i)
if (mStates.get(i).mUsed && mTransitions.containsKey(mStates.get(i))){
List<Transition> temp = mTransitions.get(mStates.get(i));
for (int j = 0; j < temp.size(); ++j){
if (temp.get(j).mInput == input){
List<StateNFA> te... | 7 |
public static String showCommandHistory(boolean direction) {
String cmd = "";
if (!lastCommands.isEmpty()) {
cmd = lastCommands.pop().toString();
}
return cmd.trim();
} | 1 |
public static int countNeighbours(boolean [][] world, int col, int row){
int total = 0;
total = getCell(world, col-1, row-1) ? total + 1 : total;
total = getCell(world, col , row-1) ? total + 1 : total;
total = getCell(world, col+1, row-1) ? total + 1 : total;
total = getCell(world, col-1, row ) ? total + 1... | 8 |
void fdump(int _depth, Instruction i, boolean clone) {
final String label = i.getByteCode().getName();// InstructionHelper.getLabel(i, false, false, false);
if (i instanceof CloneInstruction) {
fdump(_depth, ((CloneInstruction) i).getReal(), true);
} else {
if (_depth == 0) {
... | 8 |
public int compare(String o1, String o2)
{
String s1 = (String)o1;
String s2 = (String)o2;
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length)
{
... | 8 |
public void setSenha(String senha) {
this.senha = senha;
} | 0 |
private static ApparentPlace createApparentPlace(JPLEphemeris ephemeris,
int kBody) {
MovingPoint planet = null;
if (kBody == JPLEphemeris.MOON)
planet = new MoonCentre(ephemeris);
else
planet = new PlanetCentre(ephemeris, kBody);
EarthCentre earth = new EarthCentre(ephemeris);
MovingPoint sun = ... | 2 |
public Parser(Scanner scanner)
{
this.scanner = scanner;
this.error = new ErrorReport();
initSymbolTable();
} | 0 |
Coordinate calcRelativePosition(final Subject subject) {
Coordinate abs = calcAbsPosition(subject);
if (abs.x == 0) {
return abs;
}
final double scale = getRadiusScale(subject);
return new Coordinate(abs.x * scale, abs.y * scale);
} | 1 |
public JPanel getUsertileImageframeMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.usermenuImageframeMenu;
} | 1 |
@Override
public Object evaluate(DeferredObject[] arguments) throws HiveException {
List<?> value_array = arrayOI.getList(arguments[0].get());
List<?> index_array = (List<?>)converter.convert(arguments[1].get());
if (value_array == null || index_array == null) {
return null;
}
// Avoid usi... | 8 |
public Stmt lastStmt() {
final ListIterator iter = stmts.listIterator(stmts.size());
while (iter.hasPrevious()) {
final Stmt s = (Stmt) iter.previous();
if (s instanceof LabelStmt) {
continue;
}
return s;
}
return null;
} | 2 |
public void addSelectionListener(ConfigurationSelectionListener listener) {
selectionListeners.add(listener);
} | 0 |
public static Fst<Pair<Character, Character>> formTo(CharSequence in,
CharSequence out) {
Fst<Pair<Character, Character>> bla = new Fst<>();
if (in.length() == 0) {
bla.addState(StateFlag.ACCEPT, StateFlag.INITIAL);
return bla;
}
State previous = null;
for (int i = 0; i < in.length(); i++) {
St... | 4 |
public String getLocationpath(String xpathExpression){
if (xpathExpression.contains("/")){
int pos = xpathExpression.indexOf("/");
return xpathExpression.substring(pos);
}else{
return xpathExpression;
}
} | 1 |
protected Family findFamily(String xref) {
xref = xref.substring(1, xref.length() - 1);
if (isDebugging())
System.out.print(">>> Looking for family " + xref + " ... ");
Family family = (Family)getObjectByXref(xref);
if (family != null && isDebugging())
System.out.println("found " + family);
... | 5 |
private double calcMLat () {
double add = 0;
for (int i = 0; i < nbrPoints; i++) {
add = add + positions.get(i).getLatitude();
}
double result = add / nbrPoints;
return (result);
} | 1 |
public void dispatchCommand(String command) {
if (command == null || command.isEmpty())
throw new IllegalArgumentException("The coommand cannot be null or empty");
String[] args = command.split("\\s+");
String cmd = args[0];
args = StringUtils.removeFirstArg(args);
for (CommandHandler c : _commands) {
... | 4 |
private Combination<Colors> generateTargetCombination() {
List<Token<Colors>> targetTokens = new ArrayList<Token<Colors>>();
targetTokens.add(new Token<Colors>(Colors.R));
targetTokens.add(new Token<Colors>(Colors.O));
targetTokens.add(new Token<Colors>(Colors.Y));
targetTokens.add(new Token<Colors>... | 0 |
@Override
public void execute() throws MojoExecutionException {
NodeJsMojoBase.NodeInstallInformation info = super.run(filter);
if (info == null) {
return;
}
for (Task task : tasks) {
try {
if (task.watch) {
addWatchForTask(task);
}
} catch (IOException ex) {
throw new MojoExecution... | 7 |
private void button2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button2ActionPerformed
if (order1code2tf.getText().equals("1001"))
{
o1c2destf.setText("Chicken Nugget");
}
if (order1code2tf.getText().equals("1002"))
{
o1c2des... | 9 |
public static int getDeltaX(int dir)
{
if(dir == LEFT || dir == UP_LEFT || dir == DOWN_LEFT)
return -1;
if(dir == RIGHT || dir == UP_RIGHT || dir == DOWN_RIGHT)
return 1;
return 0;
} | 6 |
public Date getDate() {
return date;
} | 0 |
private void saveAsCSV(final File csvFile, final CSVManager csvManager) {
if(csvFile == null) {
JOptionPane.showMessageDialog(
null, "Fehler in DataViewFrame.saveAsCSV: es wurde keine CSV-Datei übergeben.", "Fehlermeldung", JOptionPane.ERROR_MESSAGE
);
return;
}
if(csvManager == null) {
JOptionPa... | 9 |
public ResultSet preencherTabela(String Departamento) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_TODOS_PR... | 6 |
public static void bottomUpRuleInduction(List examples, boolean simplifyRuleP) {
{ List positive = List.newList();
List negative = List.newList();
List allPositive = null;
List allNegative = null;
List rules = List.newList();
Symbol concept = ((TrainingExample)(examples.first())).conce... | 9 |
public TuringMachineFrame(String title, boolean status, TuringMachine model, TuringMachineMenuPanel view0, TuringMachineLoadPanel view1, TuringMachineStartPanel view2, TuringMachineTransitionPanel view3, TuringMachineInputPanel view4, TuringMachineSimulationPanel view5){
super(title);
isChild = status;
aTuring... | 6 |
public int clockSequence() {
if (version() != 1) {
throw new UnsupportedOperationException("Not a time-based UUID");
}
if (sequence < 0) {
sequence = (int)((leastSigBits & 0x3FFF000000000000L) >>> 48);
}
return sequence;
} | 2 |
public Status getStatus() {
int state = alGetSourcei(source, AL_SOURCE_STATE);
switch (state) {
case AL_PLAYING:
return Status.Playing;
case AL_STOPPED:
return Status.Stopped;
case AL_PAUSED:
return Status.Paused;
... | 3 |
@BeforeTest
@Parameters("browser")
public void setUp(String browser) throws Exception
{
if(browser.equalsIgnoreCase("firefox"))
{
app.driver = new FirefoxDriver();
}
else if(browser.equalsIgnoreCase("chrome"))
{
System.setProperty("webdriver.... | 2 |
void parseMisc() throws java.lang.Exception
{
while (true) {
skipWhitespace();
if (tryRead("<?")) {
parsePI();
} else if (tryRead("<!--")) {
parseComment();
} else {
return;
}
}
} | 3 |
public static void loadVocab()
{
System.out.print("Enter the absolute path to where your vocab file will be created.\n >");
String input;
while (true)
{
input = Game.scanner.nextLine();
file = new File(input);
if (file.exists())
break;
else
System.out.println("File not found!");
}
tr... | 7 |
protected void recompute() {
// System.out.println("pnCal::recompute: " + yy + ":" + mm + ":" + dd);
if (mm < 0 || mm > 11)
throw new IllegalArgumentException("Month " + mm
+ " bad, must be 0-11");
clearDayActive();
calendar = new GregorianCalendar(yy, mm, dd);
// Compute how much t... | 9 |
public static void nodeToBlockArray( RSTNode n, int nx, int ny, int nsize, BlockStack[] blockStacks, int bx, int by, int bw, int bh, int bo ) {
if( nx >= bx + bw || nx + nsize <= bx || ny >= by + bh || ny + nsize <= by ) return;
switch( n.getNodeType() ) {
case BLOCKSTACK:
int rx = nx - bx;
int ry = ny - by... | 8 |
private static Object getGtkStyle(Object styleFactory, JComponent component, String regionName) throws Exception {
Class<?> regionClass = Class.forName("javax.swing.plaf.synth.Region");
Field field = regionClass.getField(regionName);
Object region = field.get(regionClass);
Class<?> styleFactoryClass = styleFact... | 3 |
protected DVD readDVD() throws Exception {
if ( mainReadHandle == null ) {
throw new Exception("Read Handle is null.");
}
Read in = mainReadHandle;
if ( !in.nextLine().isEmpty()) {
throw new Exception("Read Error.");
}
if ( !in.nextLine().equals("DVDObjectB")) {
throw new Exception("Read Error.");
... | 7 |
public Grid(String name) {
mapName = name;
String fileName = new File("").getAbsolutePath() + "\\readIn\\"
+ mapName + ".txt";
try {
FileReader file = new FileReader(fileName);
Scanner in = new Scanner(file);
gridX = in.nextInt();
gridY = in.nextInt();
in.nextLine();
textGrid = new char[grid... | 7 |
private void loadIniFile() {
if (this.inifile.exists()) {
try {
this.ini = new Ini(this.inifile);
} catch (InvalidFileFormatException e) {
System.out.println("Config.ini Fehler");
} catch (IOException e) {
System.out.println("Config.ini Fehler");
}
} else {
try {
this.createIniFile();... | 6 |
@Override
public void mouseDragged(MouseEvent e) {
if (activeMove != null) {
activeX = e.getX();
activeY = e.getY();
} else {
activeX = -1;
activeY = -1;
}
BufferedImage copyImage = new BufferedImage(lastImage.getWidth(), lastImage.getH... | 1 |
void autoFillName(String input, KeyEvent e){
try{
int pos = ((JTextField)e.getSource()).getCaretPosition();
if(pos > 0){
boolean whiteflag = false;
String crumb = "";
String left = input.substring(0,pos);
if(left.indexOf(" ")!=-1){
crumb = input.sub... | 6 |
public static void loadLibraryFromJar(String path) throws IOException {
if (!path.startsWith("/")) {
throw new IllegalArgumentException("The path to be absolute (start with '/').");
}
// Obtain filename from path
String[] parts = path.split("/");
String filename = (parts.length > 1) ? parts[... | 9 |
public Iterable<Periodical> findPeriodicals(SearchFilter filter) {
Statement stmt = null;
List<Periodical> periodicals = new LinkedList<Periodical>();
try {
stmt = con.createStatement();
String constraints = "";
for (String attributeName : filter.getAttributeNames()) {
constraints += attributeName + ... | 5 |
public boolean isLive() {
if(x > Parameter.FRAME_WIDTH || x < 0 || y < 0 || y > Parameter.FRAME_HEIGHT) {
bLive = false;
sv.mls.remove(this);
}
return bLive;
} | 4 |
public static boolean verifyCellContent(UIObject obj, int rowIndex, int columnIndex, String content){
boolean contentPresent = false;
WebElement element = action(obj);
List<WebElement> rows = element.findElements(By.tagName("tr"));
for(int r=0;r<rows.size();r++){
if(r==rowIndex){
List<WebElement> columns... | 5 |
private void readFile() {
if (audioFileSpecified) {
try {
this.is = AudioSystem.getAudioInputStream(this.file);
byte[] tmp = new byte[(int) this.duration * this.sampleSize];
this.is.read(tmp);
this.is.close();
ByteArrayI... | 8 |
public double getPrecio() {
return precio;
} | 0 |
public static Class[] getClassesIn(String _package, boolean recursive) throws URISyntaxException, ClassNotFoundException {
List<Class> classes = new Vector<>();
String s = (_package.replace('.', '/'));
if (!s.startsWith("/"))
s = "/" + s;
if (!s.endsWith("/"))
s +... | 8 |
private synchronized void checkCompleted(){
for(int i = 0; i < this.blockOffsets.length; i++){
if(!blocks.containsKey(this.blockOffsets[i])){
return;
}
}
if(this.isValid()){
this.completed = true;
this.data = new byte[this.length];
for(int key : this.blocks.keySet()){
Block b = this.blocks.... | 6 |
public static byte[] decodeImage(BufferedImage img) {
//convert image to byte array
byte[] bImg = getBytes(img);
//offset definieren voor later
int offset = 32;
//retrieve lengths from the first bytes. 0-> 31 bits
int length = 0;
for (int i = 0; i < offset; i++... | 4 |
@EventHandler(priority = EventPriority.NORMAL)
public void onBlockBreak(BlockBreakEvent event) {
if (event.getPlayer() != null) {
if (!event.getPlayer().isOp()
&& event.getBlock().getType() != Material.LEAVES) {
event.setCancelled(true);
}
}
} | 3 |
public void switcher(){
switch(scene){
case 0:
scene++;
break;
case 1:
scene++;
break;
case 2:
scene++;
break;
case 3:
scene++;
break;
case 4:
gsm.setState(GameStateManager.LEVEL1STATE);
}
} | 5 |
public static void main(String args[]) throws Exception {
List<Module> list = new ArrayList<Module>();
Module m1 = new Module(1);
Module m2 = new Module(1);
Module m5 = new Module(2);
Module m3 = new Module(1);
Module m4 = new Module(2);
Module m6 = new Module(3);
list.add(m1);
list.add(m2);
list.ad... | 7 |
@Override
public void setTimelineEvent(){
KeyFrame kf = new KeyFrame(Duration.millis(10), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent){
time+=1;
switch(switchInt){
case 1... | 8 |
public void render(Screen screen) {
if (getDir() == 0)
sprite = Sprite.spider_up;
if (getDir() == 1)
sprite = Sprite.spider_right;
if (getDir() == 2)
sprite = Sprite.spider_down;
if (getDir() == 3)
sprite = Sprite.spider_left;
if (dead)
sprite = Sprite.spider_dead;
screen.renderItem(x - 16, y... | 9 |
@Override
public void setPhone(String phone) {
super.setPhone(phone);
} | 0 |
@Override
public ColorRGB shade(Raytracer tracer, HitInfo hit) {
ColorRGB totalColor = ColorRGB.BLACK;
for (Light light: hit.getWorld().getLights()) {
Vector3 lightPos = light.Sample();
Vector3 inDirection = lightPos.minus(hit.getHitPoint()).normalized();
double diffuseFactor = inDirection.dot(hit.getN... | 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.