text stringlengths 14 410k | label int32 0 9 |
|---|---|
private boolean salvarXml() throws IOException{
boolean status;
File f = new File("xmls/", renavam+".xml");
if(f.exists())
f.delete();
status = f.createNewFile();
FileWriter x = new FileWriter(f, true);
x.write("<?xml version = \"1.0\" encod... | 1 |
public void testWithEndMillis_long2() {
Interval test = new Interval(TEST_TIME1, TEST_TIME2);
try {
test.withEndMillis(TEST_TIME1 - 1);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public OTUltra(Main_Window caller, String reader_port) {
super(caller, reader_port);
myself = this;
this.caller = get_caller();
this.m_port = get_port();
connected = false;
processed = 0;
expected = 0;
Logger("Ultra opening !");
serial = new SerialIF(this.caller, myself, m_port, 0); //Configure se... | 4 |
public InputStream getThumbnailInputStream() {
if(playlist!=null)
return super.getThumbnailInputStream();
String url="";
if(album!=null)
url=album.getCoverURL();
if(artist!=null)
url=artist.getCoverURL();
if(url.length()==0)
return super.getThumbnailInputStream();
try {
return downloadAnd... | 5 |
public ArrayList<Vehicle> VehiclesForFranchise( int FranID)
throws UnauthorizedUserException, BadConnectionException, DoubleEntryException
{
/* Variable Section Start */
/* Database and Query Preperation */
PreparedStatement statment = null;
ResultSet result... | 8 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((elseIfs == null) ? 0 : elseIfs.hashCode());
result = prime * result + ((exp1 == null) ? 0 : exp1.hashCode());
result = prime * result + ((stateSeq1 == null) ? 0 : stateSeq1.hashCode());
result = prime * resu... | 4 |
public void keyPressed(int k) {
switch(k){
case KeyEvent.VK_ENTER:
select();
break;
case KeyEvent.VK_UP:
currentChoice--;
if (currentChoice == -1){
currentChoice = options.length - 1;
}
break;
case KeyEvent.VK_DOWN:
currentChoice++;
if (currentChoice == options.length){
currentCh... | 5 |
public void volcarDatos(ArrayList<Libros> libros){
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
while(model.getRowCount()>0)model.removeRow(0);
for(Libros l : libros){
Object[] fila = {
l.getCodigolibro(),
l.getNombrelibro(),
... | 2 |
@Override
public void actionPerformed(ActionEvent ae) {
String comando = ae.getActionCommand();
switch (comando) {
case "Depositar":
if (!Base.hasConnection()) {
Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/quiniela", "tecpro", "tecpro");... | 6 |
private ParkManage(){
} | 0 |
public void mouseClicked(MouseEvent e) {
//if the mouse was left clicked on
//the node then
if (m_clickAvailable) {
//determine if the click was on a node or not
int s = -1;
for (int noa = 0; noa < m_numNodes;noa++) {
if (m_nodes[noa].m_quad == 18) {
//then is on the screen
... | 9 |
public void setCoordTransform(AffineTransform coordTransform) {
this.coordTransform = coordTransform;
} | 0 |
public boolean equals(Object par1Obj)
{
if (!(par1Obj instanceof NBTBase))
{
return false;
}
NBTBase nbtbase = (NBTBase)par1Obj;
if (getId() != nbtbase.getId())
{
return false;
}
if (name == null && nbtbase.name != null || na... | 7 |
protected void processRuleBlock(String block, Engine engine) throws Exception {
BufferedReader reader = new BufferedReader(new StringReader(block));
String line;
RuleBlock ruleBlock = new RuleBlock();
engine.addRuleBlock(ruleBlock);
while ((line = reader.readLine()) != null) {
... | 7 |
@Override
public boolean execute(CommandSender sender, String identifier,
String[] args) {
String titleName = args[1];
String titleId = args[0];
if (sender instanceof Player) {
try {
if (DBManager.idExist(titleId)) {
sender.sendMessage("This id already exist.");
return false;
}
if (D... | 5 |
private MineOS(){} | 0 |
private void setQuorums()
{
HashMap<FileServerInfo, Integer> servers = new HashMap<FileServerInfo, Integer>();
for(FileServerInfo f : serverIdentifier.values())
{
servers.put(f, (int) f.getUsage());
}
servers = (HashMap<FileServerInfo, Integer>) sortByComparator(servers);
int quorumSize = Math.round(s... | 5 |
private boolean saveAll(UserScore userScore) throws SQLException {
PreparedStatement insertUserStmt = null;
PreparedStatement selectStmt = null;
PreparedStatement insertScoreStmt = null;
int result = 0;
try {
int playerId = getPlayerById(userScore.getUserName());
... | 6 |
@Override
public MultiLabelOutput inferenceProcedure(Instance instance)
throws Exception {
Instance tempInstance = DataUtils.createInstance(instance,
instance.weight(), instance.toDoubleArray());
Comparator<LabelCombinationExtended> probabilityComparator = new Comparator<LabelCombinationExtended>() {
... | 9 |
public boolean valid() {
if (! super.valid()) return false ;
if (driven != null) {
if (driven.destroyed()) return false ;
if (! driven.canPilot(actor)) return false ;
}
//
// TODO: Put the passenger-delivery schtick into a different class. It's
// making a mess of things here.
... | 8 |
public int[] createTileArray2(int numTiles)
{
arrTiles = new int[numTiles];
arrTilesCount = new int[numTiles];
int halfTiles = numTiles / 2;
int c = 0;
try
{
// First set of tiles
for (int n = 0; n < (halfTiles); n++)
{
arrTiles[n] =... | 3 |
public int doSalary(int sal){
if(this.salary != null)
return this.salary.doSalary(sal);
return sal;
} | 1 |
public static boolean isValid(String content){
if(content != null && !content.isEmpty() && !content.equals("") && !content.equals("[false]") && !content.equals("null") && content.length() != 0 && content.length() < 500){
return true;
} else {
return false;
}
} | 7 |
@EventHandler
public void EnderDragonSpeed(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble("EnderD... | 6 |
public static void main (String args[]) throws Exception
{
String hostname = HOSTNAME;
int port = PORT;
int timeToSleep = TIME_TO_SLEEP;
if(args.length > 0) {
List<String> argList = Arrays.asList(args);
if(argList.contains("-h")) {
int indexOf = argList.indexOf("-h");
... | 5 |
public static List<Mensalidade> getListaMensalidadeEmAberto(String nome, Date data){
List<Mensalidade> lista = new ArrayList();
Connection conn = Conexao.getConexao();
PreparedStatement stmt = null;
ResultSet rs = null;
Mensalidade mens = null;
try {
... | 9 |
public void setMinus(TMinus node)
{
if(this._minus_ != null)
{
this._minus_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... | 3 |
public String[] ReadTargetPHPFileData() {
String[] FaultTypeOperators = null;
int count = 0;
Statement s = null;
ResultSet rs = null;
// Adapted from http://developers.sun.com/docs/javadb/10.2.2/ref/rrefclob.html
try {
if ((conn = setConn()) != null) {
... | 4 |
@Override
public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException {
List paramList1 = new ArrayList<>();
List paramList2 = new ArrayList<>();
StringBuilder sb = new StringBuilder(UPDATE_QUERY);
String ... | 1 |
private List<String> createCommand() throws MojoExecutionException {
List<String> cmd = new ArrayList<String>();
cmd.add(getCommandPath("createdb"));
if (host != null) {
cmd.add("-h");
cmd.add(host);
}
if (port != null) {
cmd.add("-p");
... | 6 |
@Override
public PreparedStatement prepare(String query) {
//Connection connection = null;
PreparedStatement ps = null;
try
{
//connection = open();
ps = connection.prepareStatement(query);
return ps;
} catch(SQLException e) {
if(!e.toString().contains("not return ResultSet"))
this.writeError... | 2 |
public static Node getNormalizedNode(String normalized){
if (normalized == "01"){
return new Node("NOTYPE",0);
}
else {
Node resultat = new Node("NOTYPE",0);
ArrayList<String> filsName = new ArrayList<String>();
int cut = 0;
int debutCut = 0, finCut = 0;
for (int i = 1; i<normalized.length(); i... | 8 |
private void selectSQLiteData() {
if (m_sqlTable == null) {
return;
}
ResultSet selectAll = m_sqlTable.select("*");
if (selectAll == null || countResults(selectAll) != 3) {
log("selectSQLiteData selectAll Failed!");
}
ResultSet selectSam = m_sqlTable.select("*", "name='SAM'");
if (selectSam ==... | 5 |
private JTreeNode<T> convertList( JTreeNode<T> current, boolean isLeft){
if(current == null){
return null;
}
JTreeNode<T> left = convertList(current.getLeftNode(), true);
JTreeNode<T> right = convertList(current.getRightNode(), false);
if(left!=null && right==null){
left.setRightNode(current);
cur... | 8 |
public static void main(String[] args) {
Integer philosophersAmount = 5;
Integer hungryAmount = 2;
Integer chairAmount = 5;
Integer runtime = 30; //in s
Table tisch = new Table(chairAmount);
List<Philosopher> philosophers = new ArrayList<Philosopher>();
List<Thread> philosopherThreads = new ArrayList<Th... | 6 |
public void sendFile(String localFileName, String fileOnServer) throws IOException {
File file = new File(rootFolder, localFileName);
if(! file.exists()) {
throw new FileNotFoundException("File " + localFileName + " not found in the root folder " + rootFolder.getAbsolutePath());
}
if(file.isDirectory()... | 8 |
public boolean move(String input) {
// logically what is happening is this variable starts out false,
// gets changed to true if the player moved successfully, then is
// send back and it tells the program if the player has moved or not.
boolean moved = false;
switch (input) {
case "north":
moved = playe... | 6 |
public void chargerLivraisons(String adresse)
{
this.vueAppli.afficherCurseurAttente();
try
{
if (this.itineraireInitial != null)
{
ParserXML livraisonParser= new ParserXML(adresse,TypeFichier.LIVRAISONS);
Pair<NoeudItineraire,ArrayList<PlageHoraire> > dataLIvr =
livraisonParser.genererLivr... | 4 |
@Override
public void documentRemoved(DocumentRepositoryEvent e) {} | 0 |
public int getSoundNarration()
{
return soundNarration;
} | 0 |
private String munecoBasico(){
String muneco = "";
if(intentos == 5){
muneco = muneco + " O ";
}
if(intentos == 4){
muneco = muneco + " O <BR>"+
" / <BR>";
}
if(intentos == 3){
muneco = muneco + " O <BR>"+
" /| <BR>";
}
if(intentos == 2){
muneco = mun... | 6 |
public static void info(String msg){
if(Settings.debug) System.out.println(info+" "+msg.trim());
} | 1 |
private void writeChars( int db, int ln, String sc )
{
RandomAccessFile f = ( db==0 ? fdbf : db==1 ? ffpt : fcdx );
int l = sc.length();
int ml = Math.min(ln,l);
try { f.writeBytes( (l==ml ? sc : sc.substring(0,ml)) ); }
catch (IOException e) { e.printStackTrace(); }
if(ln>l)
{
String s = new String(... | 6 |
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
if (!localName.equals(BuilderProperties.getString("root_element"))) { //$NON-NLS-1$
if (parserFactory.hasDevice(localName)) {
devices.add(currentParser.getDevice());
currentParser = null;
}
}
... | 2 |
public static void checkAutoBroadcastConfigYAML() {
File file = new File(path + "AutoBroadcast/config.yml");
if(!file.exists()) {
try {
file.createNewFile();
FileConfiguration f = YamlConfiguration.loadConfiguration(file);
f.set("Interval.Hours", 0);
f.set("Interval.Minutes", 0);
f.set("Inter... | 2 |
public String addIngredient() {
if (ingredient != null) {
try {
restClientBean.getIngredientClient().createIngredient(ingredient);
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
} | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ProductBrand other = (ProductBrand) obj;
if (!Objects.equals(this.szBrandId, other.szBrandId)) {
... | 3 |
@Override
public void doAction(Player player, Grid grid) throws InvalidActionException {
if (player.getRemainingTurns() <= 0)
throw new InvalidActionException("The player has no turns left!");
Position currentPos = player.getPosition();
Position newPos = new Position(currentPos.getxCoordinate(), currentPos... | 2 |
@Test
public void testQueryOrder() throws FileNotFoundException{;
int count = 0;
for (Player p : myGame.getPlayers()){
if (count == 0){
assertEquals(p.getName(), "Test name");
count++;
}
else if (count == 1){
assertEquals(p.getName(), "Elessar Telcontal");
count++;
}
else if (count == 2){
as... | 7 |
public static long parseTimeInterval(String str) {
try {
int len = str.length();
char suffix = str.charAt(len - 1);
String numstr;
long mult = 1;
if (Character.isDigit(suffix)) {
numstr = str;
} else {
numstr... | 7 |
public final void reset() {
this.taskPool.addTask(new Runnable() {
@Override
final public void run() {
for (final DropTargetContainer<?, ?, ?> target : AbcMapPlugin.this.targets) {
target.clearTargets();
}
}
});
this.trackMap.clear();
this.instrumentToTrack.clear();
} | 4 |
public String getFoundKey(){
return _key + "Found?";
} | 0 |
private void updatePropertyEditor_selected() {
HashSet<Vertex> selectedVertices = spm.getSelectedVertices();
HashSet<Edge> selectedEdges = spm.getSelectedEdges();
int numOfSelectedVertices = selectedVertices.size();
int numOfSelectedEdges = selectedEdges.size();
//if there was ... | 8 |
private void queryForTileBars(){
//TODO: BUGS EVERYWHERE IF THIS ISN'T RESET TOOK ME 5 HOURS TO FIGURE THIS OUT
selectedChapters = new ArrayList<>();
for(int i = 0;i < repository.size();i++){
selectedChapters.add(new ArrayList<Integer>());
}
//Reset all buttons text to the Magnify text.
for(int i = 0;... | 6 |
public Onderwerp(final logic.Onderwerp onderwerp, final Spel spel) {
setOpaque(false);
setBorder(null);
setLayout(new MigLayout("", "[123px:176.00,grow,fill]", "[40.00][100px:149.00:100px,grow,fill]"));
try {
JLabel lblSteden = new JLabel(onderwerp.getNaam());
lblSteden.setHorizontalAlignment(SwingConstan... | 1 |
public static String wrapper(String data){
return "<html>"+
head()+
"<body>"+
"<table id=\"hor-minimalist-b\">"+
thead()+
data+
"</table>"+
"</body>"+
"</html>";
} | 0 |
public MoveTest() {
} | 0 |
private void profile(String hostname, String jobId, boolean needMetrics, int sampleMapperNum, int sampleReducerNum) {
SingleJobProfiler profiler = new SingleJobProfiler(hostname, jobId, needMetrics, sampleMapperNum, sampleReducerNum);
job = profiler.profile();
finishedConf = job.getJobConfiguration();
new... | 8 |
private void extractFileContent() throws Exception{
int first_frame, num_frames, looping_frames, frames_per_second; //data from file
int end_frame;
String description = "";
for( int i = 0; i < lines.size(); i++){
String line = lines.get(i);
line = line.trim();
if( line.len... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Variable other = (Variable) obj;
if (rang != other.rang)
return false;
return true;
} | 4 |
public void testRemoveAllTCollection() {
int element_count = 20;
TIntList other = new TIntLinkedList();
for ( int i = 0; i < element_count; i++ ) {
other.add( i );
}
TIntList list = new TIntLinkedList( 20 );
for ( int i = 0; i < element_count; i++ ) {
... | 6 |
private ListNode findMid(ListNode head){
ListNode oneStep = head;
ListNode twoStep = head;
while(oneStep.next != null && twoStep.next != null && twoStep.next.next != null){
twoStep = twoStep.next;
if(twoStep == null){
break;
}
twoStep = twoStep.next;
... | 4 |
public void jump() {
if (jumped == true && jumpLimit == false) {
speedY += JUMPSPEED2;
jumpLimit = true;
}
if (jumped == false) {
speedY = JUMPSPEED;
jumped = true;
}
} | 3 |
private void hybrid(int ch, int gr)
{
int bt;
int sb18;
gr_info_s gr_info = (si.ch[ch].gr[gr]);
float[] tsOut;
float[][] prvblk;
for(sb18=0;sb18<576;sb18+=18)
{
bt = ((gr_info.window_switching_flag !=0 ) && (gr_info.mixed_block_flag !=0) &&
(sb18 < 36)) ? 0 : gr_info.block_type;
... | 6 |
public Point move( String move ) {
Point moveCoords = new Point();
switch( move ) {
case "NORTH":
moveCoords.x = 0;
moveCoords.y = -1;
break;
case "EAST":
moveCoords.x = 1;
moveCoords.y = 0;
break;
case "SOUTH":
moveCoords.x = 0;
moveCoords.y = 1;
break;
case "WEST":
moveCoords... | 5 |
private void fillBoxes() {
for (int i = -20; i <= 20; i++) {
cmbYear.addItem(calendar.get(Calendar.YEAR) + i);
}
for (int j = 1; j <= 12; j++) {
cmbMonth.addItem(j);
}
cmbYear.setSelectedItem(year);
cmbMonth.setSelectedItem(month);
cmbYear.... | 2 |
@FXML
protected void doubleClickPlaySelectedSong(MouseEvent mouseEvent) throws Exception {
if (mouseEvent.getButton().equals(MouseButton.PRIMARY)) {
if (mouseEvent.getClickCount() == 2) {
playSong();
}
//todo list index change
}
} | 2 |
public boolean equals(Object o) {
Association other = (Association) o;
return (this.PID.equals(other.PID) && this.QID.equals(other.QID))
|| (this.PID.equals(other.QID) && this.QID.equals(other.PID));
} | 3 |
private void cmbBoxAgeLimitActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_cmbBoxAgeLimitActionPerformed
{//GEN-HEADEREND:event_cmbBoxAgeLimitActionPerformed
switch (cmbBoxAgeLimit.getSelectedIndex())
{
case 0:
switchLimitation = 0;
break;... | 8 |
public ArrayList<Boolean> solve()
{
double iterations = Math.pow(2,varCount); //2^varCount
double start = System.currentTimeMillis();
int tenth = (int) iterations/10;
for(int i = 0; i<(iterations);i++)
{
if(i%tenth == 0)
{
System.... | 3 |
public static void setLookAndFeel(){
try {
// Set System L&F
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch (UnsupportedLookAndFeelException e) {
// handle exception
}
catch (ClassNotFoundException e) {
// handle except... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
City other = (City) obj;
if (cityName == null) {
if (other.cityName != null)
return false;
} else if (!cityName.equals(other.cityName))
... | 6 |
public void actionPerformed(ActionEvent e) {
if (sound != null) {
sound.play();
}
} | 1 |
void flip() {
System.out.println("Flip trangle");
} | 0 |
public static void main(String[] args) throws InterruptedException {
MailUtil.sendMailSynchron("test", "这是一个测试", "289048093@qq.com",true);
Thread.sleep(5000);
} | 0 |
@Override
public void handleAttribute(final char[] buffer, final int nameOffset, final int nameLen,
final int nameLine, final int nameCol, final int operatorOffset, final int operatorLen,
final int operatorLine, final int operatorCol, final int valueContentOffset,
final int value... | 8 |
private void factor() {
int n = LU.numRows();
// Internal CRS matrix storage
int[] colind = LU.getColumnIndices();
int[] rowptr = LU.getRowPointers();
double[] data = LU.getData();
// Find the indices to the diagonal entries
int[] diagind = findDiagonalIndices(n... | 7 |
public static void initView(JToolBar toolbar,
final BuilderController controller) {
toolbar.add(new JButton(new TooltipAction("Hint",
"Adds one transition.") {
public void actionPerformed(ActionEvent e) {
controller.hint();
}
}));
toolbar.add(new JButton(new TooltipAction("Complete",
"Adds a... | 0 |
public ChoiceQuest()
{
super(QuestType.CHOICEQUEST);
goTo="";
} | 0 |
public ClientHanldler(Socket client) {
this.client = client;
} | 0 |
public NickAlreadyInUseException(String e) {
super(e);
} | 0 |
private boolean searchDownForNextSupersetNode( Node node, K key, Object[] ret ) {
while( true ) {
// Descend left subtree if it might have superset node.
if( node.mLeft != null && mComp.compareMaxes( key, node.mLeft.mMaxStop.mKey ) <= 0 ) {
node = node.mLeft;
... | 8 |
private BattleSelector newBattleSelector(List<BotList> initialBattles,
final ChallengeConfig challenge, final String challenger,
final Map<String, ScoreError> errorMap) {
final LinkedList<BotList> battleList = Lists.newLinkedList(initialBattles);
return new BattleSelector() {
@Override
p... | 9 |
@Override
public void mark(int boardPosition, Cell[] cellBoard, int rows, int columns) throws IllegalMark {
//Find the row.
int boardPositionRow = boardPosition / columns;
//Find the column.
int boardPositionColumn = boardPosition % columns;
//Positi... | 3 |
public static Picture readPictureFromTga(String path) throws Exception {
File f = new File(path);
if (!f.exists()) {
throw new IllegalArgumentException("File at " + path + " does not exist. " + f.getAbsolutePath());
}
FileInputStream in = new FileInputStream(f);... | 9 |
public Pedido insertar(Pedido pedido) throws DAOExcepcion {
System.out.println("PedidoDAO: insertar()");
String query = "INSERT INTO pedido (id_usuario,fecha,estado,total) VALUES (?,?,?,?)";
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {... | 8 |
void mouseWheel(long time, int rotation, int modifiers) {
if (!viewer.getAwtComponent().hasFocus())
return; // XIE
hoverOff();
timeCurrent = time;
// Logger.debug("mouseWheel time:" + time + " rotation:" + rotation + " modifiers:" + modifiers);
if (rotation == 0)
return;
if ((modifiers & BUTTON_MODIFI... | 8 |
public void draw(){
background(255);
fill(0);
for(int i = 0; i < 5; i++){
threads[(int) alpha[i]].draw();
if(threads[i].getLinha().getAlpha() == 0){
nextLine();
System.out.println("AQUI");
}
}
} | 2 |
@Override
public double predict(int userID, int movieID) {
double rating = 0;
ArrayList<Double> sim = new ArrayList<Double>();
ArrayList<Double> rat = new ArrayList<Double>();
ArrayList<Double> avg = new ArrayList<Double>();
HashMap<Integer, Double> tempHashMap = similarities.get(userID);
//Fill the a... | 6 |
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 |
private void jbRechercheActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbRechercheActionPerformed
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
} catch (ClassNotFoundException ex) {
JOptionPane jOErreur = new JOptionPane("Driver... | 9 |
public void update() {
player.update();
player.checkAttack(enemies);
player.checkCoins(coins);
finish.update();
finish.checkGrab(player);
bg.setPosition(tileMap.getx(), 0);
tileMap.setPosition(
GamePanel.WIDTH / 2 - player.getx(),
GamePanel.HEIGHT / 2 - player.gety());
if(player.i... | 6 |
private void addMTWCs(MTWData data, int x, int y, int dx, int dy) {
// Create set of tuples with coordinates - with annoying syntax
Set<Tuple<Integer, Integer>> set = new HashSet<Tuple<Integer, Integer>>();
// Trace in the given direction and it's opposite direction
Tuple... | 5 |
private void get(Player cmdSender, String... args) {
for (String arg : args)
switch (arg) {
case CMD_ARG_GETOPS:
cmdSender.chat("List of Operators:");
for (OfflinePlayer player : getServer().getOperators())
cmdSender.cha... | 9 |
@RequestMapping("salvarProduto")
public ModelAndView salvarProduto(Produto produto,
@RequestParam(value = "grupoDoProduto") String[] grupoDoProduto,
@RequestParam(value = "temaDoProduto") String[] temaDoProduto,
HttpServletRequest request) {
ModelAndView mav = new ModelAndView("redirect:admin");
if (adm... | 3 |
void insert(RedBlackNode z)
{
RedBlackNode y = nil;
RedBlackNode x = root;
while(x != nil)
{
y = x;
if(z.key.compareTo(x.key) < 0)
x = x.left;
else
x = x.right;
}
z.parent = y;
if(y == nil)
root = z;
else if(z.key.compareTo(y.... | 4 |
private void waitForThread() {
if ((this.thread != null) && this.thread.isAlive()) {
try {
this.thread.join();
} catch (final InterruptedException e) {
plugin.getLogger().log(Level.SEVERE, null, e);
}
}
} | 3 |
public void listPlugins(CommandSender sender, String[] args) {
if (args.length > 1) {
sender.sendMessage(pre + red + tooMany);
return;
}
StringBuilder list = new StringBuilder();
List<String> pluginList = new ArrayList<String>();
for (Plugin pl : Bukkit... | 5 |
public ViewUserLogin()
{
setTitle("Login");
setLayout(new GridLayout(3,2));
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
u=new JLabel("Username");
p=new JLabel("Password");
uname=new JTextField(20);
pass=new JPasswordField(20);
login=new JButton("Login");
cancel=n... | 3 |
public static void loadAccounts() {
try {
accounts.clear();
File accountsFile = new File(Configuration.ACCOUNTS_DIR + File.separator + "Accounts.txt");
if (!accountsFile.exists()) {
accountsFile.createNewFile();
return;
}
S... | 5 |
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.