This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def requestNumbers(): | |
str = input('Digite os números iniciais: ') | |
splitted = str.split(' ') | |
number1 = float(splitted[0]) | |
number2 = float(splitted[1]) | |
return [ number1, number2 ] | |
def preencher(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const { exec } = require('child_process'); | |
const tarPath = 'C:\\Windows\\System32\\tar.exe'; | |
const scriptDir = process.cwd(); | |
const sourceDir = scriptDir; | |
const destDir = path.join(scriptDir, 'compressed'); | |
if (!fs.existsSync(destDir)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author <a href="https://github.com/Yuhtin">Yuhtin</a> | |
*/ | |
import org.bukkit.configuration.ConfigurationSection; | |
import org.bukkit.configuration.file.FileConfiguration; | |
import org.bukkit.configuration.file.YamlConfiguration; | |
import java.io.File; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Getter | |
@AllArgsConstructor | |
public class Hitbox { | |
private final Location aa, ab; | |
public Hitbox(Player player) { | |
this.aa = player.getLocation().subtract(0.4, 0, 0.4); | |
this.ab = player.getLocation().add(0.4, 1.8, 0.4); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Employee { | |
private final int id; | |
private final String name; | |
private double salary; | |
public Employee(int id, String name, double salary) { | |
this.id = id; | |
this.name = name; | |
this.salary = salary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static HashMap<String, String> QUADRANTS = new HashMap<String, String>(){{ | |
put("1,1", "Q1"); | |
put("-1,1", "Q2"); | |
put("-1,-1", "Q3"); | |
put("1,-1", "Q4"); | |
}}; | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.println("Enter the number of products:"); | |
int products = scanner.nextInt(); | |
List<Product> productsList = new ArrayList<>(); | |
for (int i = 1; i <= products; i++) { | |
System.out.println("Insert Product #" + i + " code:"); | |
int code = scanner.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Collection<Chunk> getNearbyChunksGrid(Location location) { | |
val offset = new int[]{-1, 0, 1}; | |
val world = location.getWorld(); | |
val baseX = location.getChunk().getX(); | |
val baseZ = location.getChunk().getZ(); | |
val chunksAroundPlayer = new HashSet<Chunk>(); | |
for (val x : offset) { | |
for (val z : offset) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the main configuration file for Bukkit. | |
# As you can see, there's actually not that much to configure without any plugins. | |
# For a reference for any variable inside this file, check out the Bukkit Wiki at | |
# http://wiki.bukkit.org/Bukkit.yml | |
# | |
# If you need help on this file, feel free to join us on irc or leave a message | |
# on the forums asking for advice. | |
# | |
# IRC: #spigot @ irc.spi.gt | |
# (If this means nothing to you, just go to http://www.spigotmc.org/pages/irc/ ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class MaterialUtils { | |
public static ItemStack convertFromLegacy(String materialName, int damage) { | |
try { | |
return new ItemStack(Material.getMaterial(materialName), 1, (short) damage); | |
} catch (Exception error) { | |
Material material = Material.valueOf("LEGACY_" + materialName); | |
return new ItemStack(Bukkit.getUnsafe().fromLegacy(new MaterialData(material, (byte) damage))); | |
} |
NewerOlder