text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void run() {
if(seconds == 0){
ArenaSetupEvent event = new ArenaSetupEvent(a);
Bukkit.getServer().getPluginManager().callEvent(event);
new ArenaSetupRunnable(plugin, 40, a);
for(String s : a.getPlayers()){
Bukkit.getPlayerExact(s).teleport(a.getSpawn());
}
Bukkit.getScheduler().cancelTask... | 4 |
public void visitTypeInsn(final int opcode, final String type) {
Type t = Type.getObjectType(type);
switch (opcode) {
case Opcodes.NEW:
anew(t);
break;
case Opcodes.ANEWARRAY:
newarray(t);
break;
case Opcodes.CHECKCAST:
checkcast(t);
break;
case Opcodes.INSTANCEOF:
instanceOf(t);
bre... | 4 |
@Override
public void receive(Object message) {
if (!(message instanceof String)) {
log.severe("Unknown message format. Can't receive information");
return;
}
MACKInformation info = MACKProtocolFactory
.parseMessage((String) message);
if (info == null) {
log.severe("Message was invalid");
retur... | 5 |
public void sendMessage(String message, String playerName)
{
for (Player p : server.players)
if(p.username == playerName)
p.sendMessage(message);
} | 2 |
public void addAccount(BankAccount account) throws IllegalArgumentException {
if (! canHaveAsAccount(account))
throw new IllegalArgumentException();
accounts.add(account);
} | 1 |
@Override
public void keyPressed(KeyEvent e) {
dir = e.getKeyCode();
if (previousKey == dir && doubleCount == 1 && (dir == KeyEvent.VK_LEFT || dir == KeyEvent.VK_RIGHT)) {
incr = STDINCR * 2;
endTime = System.currentTimeMillis();
if (endTime - startTime < 200) {
... | 9 |
public void writeProperties() {
List<Display> displays = defaultDisplayPane.getOpenDisplays();
//First see if we the location of the user properties file is in
//the props file itself
String propsPath = props.getProperty("this.path");
String fileSep = System.getProperty("file.separa... | 8 |
public void reverseNotes() {
final ArrayDeque<String> headReversed = new ArrayDeque<>();
final ArrayDeque<AbcEvent> notesReversed = new ArrayDeque<>();
int lineIdx = 0;
boolean head = true;
while (lineIdx < lines.size()) {
final String line = lines.get(lineIdx++);
if (notesRaw.get(0) == line) {
brea... | 9 |
private void init(AppAction a, final String iconKey, boolean showText) {
enablePlasticWorkaround = UIManager.getLookAndFeel().getClass().getName().startsWith("com.jgoodies.looks.plastic.");
setAction(a);
addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
... | 9 |
@Override
public void initializeClass()
{
super.initializeClass();
for(final Enumeration<Ability> a=CMClass.abilities();a.hasMoreElements();)
{
final Ability A=a.nextElement();
if(A!=null)
{
final int level=CMLib.ableMapper().getQualifyingLevel(ID(),true,A.ID());
if((!CMLib.ableMapper().getDefa... | 9 |
public LocalDate getDate() {
return this._date;
} | 0 |
public static boolean isPrime(int x) {
if (x == 2) {
return true;
}
if (x % 2 == 0 || x == 1) {
return false;
}
for (int i = 3; i * i <= x; i += 2) {
if (x % i == 0) {
return false;
}
}
return true;
} | 5 |
private double calculateTheta(Ball b1, Ball b2) {
// TODO Auto-generated method stub
double theta = 0;
double xComp = b1.x - b2.x;
double yComp = b1.y - b2.y;
if(xComp > 0) {
theta = Math.atan(yComp/xComp);
return theta;
}else if(xComp < 0){
theta = Math.atan(yComp/xComp) + Math.PI;
return thet... | 6 |
private static int getNumberOfColumns(Alignment layoutMap) {
List<Integer> keys = new ArrayList<Integer>(layoutMap.keySet());
Collections.sort(keys);
int columnsNum = 0;
for(int key : keys) {
Read current = layoutMap.get(key);
int minusOffset = columnsNum;
if (current.getOffset() <= columnsNum) {
m... | 3 |
private LocationProfile parseToLatestReview(Document document,
String contextPath) throws CitysearchException {
LocationProfile response = null;
if (document != null && document.hasRootElement()) {
Element locationElm = document.getRootElement().getChild(LOCATION);
if (locationElm != null) {
response =... | 7 |
public void testSetPeriod_RP2() {
MutablePeriod test = new MutablePeriod(100L, PeriodType.millis());
try {
test.setPeriod(new MutablePeriod(11, 12, 13, 14, 15, 16, 17, 18));
fail();
} catch (IllegalArgumentException ex) {}
assertEquals(0, test.getYears());
... | 1 |
@Override
public int compareTo(Edge<V, E> e2) {
if(e2 == null)
return -1;
int labelComparision = getLabel().compareTo(e2.getLabel());
if(labelComparision!=0)
return labelComparision;
Vertex<V,E> destination1 = getDestination();
Vertex<V,E> destination2 = e2.getDestination();
if(destination1 == null &... | 8 |
protected static boolean implementsAllIfaces(ClassInfo clazz,
ClassInfo[] ifaces, ClassInfo[] otherIfaces) {
big: for (int i = 0; i < otherIfaces.length; i++) {
ClassInfo iface = otherIfaces[i];
if (clazz != null && iface.implementedBy(clazz))
continue big;
for (int j = 0; j < ifaces.length; j++) {
... | 5 |
public String syncRequest(String url, String httpMethod, OauthKey key,
List<QParameter> listParam, List<QParameter> listFile)
throws Exception {
if (url == null || url.equals("")) {
return null;
}
OAuth oauth = new OAuth();
StringBuffer sbQueryString = new StringBuffer();
String oauthUrl = oauth.get... | 5 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
public void addFrameElementWithIDRef(String frameElementName, String idref) {
//TODO: check
FrameElement frameElement = frameElements.get(frameElementName);
if(frameElement==null){
frameElement = new FrameElement(frameElementName);
}
frameElement.addIdRef(idref);
frameElements.put(frameElementName, frame... | 1 |
private int getEquipment(int fish) {
if (fish == 317) //shrimp
return 303;
if (fish == 335) //trout + salmon
return 309;
if (fish == 337) //lobs
return 301;
if (fish == 361)//tuna
return 311;
if (fish == 7944)//monks
return 303;
if (fish == 383)//sharks
return 311;
if (fish == 389)//mant... | 8 |
public Server() {
//Creating window
addWindowListener(this);
JTextArea serverLog = new JTextArea();
JScrollPane scrollPane = new JScrollPane(serverLog);
add(scrollPane, BorderLayout.CENTER);
setSize(300,300);
setTitle("Battleships Server");
setVisible(true);
try {
//Server Socket on por... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
GenericTreeNode<?> other = (GenericTreeNode<?>) obj;
... | 8 |
public void rotate_all(Draw panel, int angulo, Color bg_color){
Ponto ref = new Ponto(panel.getWidth()/2,panel.getHeight()/2);
circulos_desenhados_aux = new LinkedList<Circulo>();
circulos_desenhados_aux.addAll(ctrCirculo.circulos_desenhados);
for (Circulo c : circulos_desenhados_aux) {
figura_selecion... | 8 |
private void parseArray(String[] nodesList) {
if (nodesList == null || nodesList.length < 1) {
throw new IllegalArgumentException("nodesList is null or empty");
}
if (node0 == null) {
node0 = parseNodeString(nodesList[0]);
}
nodesMap = new LinkedHashMap<... | 8 |
private ByteBuffer generateStandardHeaderResponse(HTTPRequest request, HTTPStatus status, Map<HTTPHeader,String> headers, DataBuffers response) throws HTTPException
{
final StringBuilder str=new StringBuilder("");
final String overrideStatus = headers.get(HTTPHeader.Common.STATUS);
if(overrideStatus != null)
... | 7 |
private String getValidityResult(final String s) {
String res = "";
boolean isValid = true;
if ((s.length()<5) || (s.length()>10)) {
return MSG_FAIL;
}
if (s.contains(" ")) {
return MSG_FAIL;
}
if (!s.matches(".*[0-9].*")) {
return MSG_FAIL;
}
if (!s.matches(".*[A-Z].*")) {
re... | 7 |
public void loadFile(String name)
{
try
{
/** create the file object */
File file = new File(name);
/** if the object is a directory */
if (file != null && file.isDirectory())
{
/** get the list of files in the directory */
... | 7 |
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block clickedBlock = event.getClickedBlock();
if (protectableBlock(clickedBlock)) {
if (event.getPlayer().getI... | 6 |
public RenderingEngine getRenderingEngine() {
return renderingEngine;
} | 0 |
private void donneDirection (){
Coord dir = this.curent.coord.sous(this.forum.coord);
this.pointCercle = this.cible;
final int D = 0, B = 1, G = 2, H = 3;
if(dir.y > 0){ //BAS
rotation = this.cercle % 2 == 0 ? D : G;
}
else if(dir.y < 0){ //HAUT
rotation = this.cercle % 2 == 0 ? G : D;
}
else if(d... | 7 |
public static boolean sendFiles(ArrayList<File> alFilesToSend, String FTP_Address, int FTP_Port, PrintWriter pwOut, String FTP_SERVER_TYPE)
{
try
{
if ((alFilesToSend == null) || (alFilesToSend.size() < 1))
{
return false;
}
File fle = null;
double steps = 0.0D;
t... | 8 |
public void randomlyInitializeParams()
{
//initializes the initial state parameters
double dsum = 0;
probinit = new double[numstates];
for (int ni = 0; ni < probinit.length; ni++)
{
probinit[ni] = theRandom.nextDouble();
dsum += probinit[ni];
}
for (int ni = 0; ni < probinit.length; ni++)
{
... | 9 |
String readLineWithNewline() {
// mth 2004 10 17
// for now, I am going to put in a hack here
// we have some CIF files with many lines of '#' comments
// I believe that for all formats we can flush if the first
// char of the line is a #
// if this becomes a problem then we will need to adjust
while (ich... | 8 |
public int sqrtBetter(int x) {
if (x < 0) {
return -1;
}
if (x == 0) {
return 0;
}
int i = 0;
int j = x;
while (i < j) {
int m = (j - i) / 2 + i;
int m1 = x / (m + 1);
int m2 = x / (m + 1 + 1);
if (m + 1 == m1) {
return m + 1;
}
if (m + 1 + 1 == m2) {
r... | 8 |
@Override
public void update(SondageReponse obj) {
PreparedStatement pst = null;
try {
pst = this.connect().prepareStatement("update SondageReponse set id_sondage=?, choix=?, nombreChoix=? where id=? ;");
pst.setInt(1, obj.getId_sondage());
pst.setInt(2, obj.getCh... | 3 |
public static INIFile parseFile(ArrayList<String> contents){
INIFile file = new INIFile();
INISection section = null;
for(String line : contents){
//String line = data.replaceAll("\\s", "");
if(isLine(line) == false){
continue;
}
... | 6 |
public static Node circularNode(Node head) {
Node slow = head;
Node fast = head;
while(fast != null && fast.next != null) {
slow = slow.next;
fast = fast.next.next;
if(slow == fast)
break;
}
if(fast == null || fast.next == null) {
System.out.println("No loop exists in the Linked List!");
re... | 6 |
@Override
public void execute(ArrayList signature) {
String variableName = (String) signature.get(1);
String value = (String) signature.get(2);
if (variableName.equals(COMMAND_ENCODING)) {
Preferences.ENCODINGS.add(value);
if (VERBOSE) {
System.out.println(new StringBuffer().append(" Adding encodin... | 3 |
public ShaderResource()
{
this.program = glCreateProgram();
this.refCount = 1;
if ( program == 0 )
{
System.err.println( "Shader creation failed: Could not find valid memory location in constructor" );
System.exit( 1 );
}
uniforms = new HashMap<String, Integer>();
uniformNames = new ArrayList<Str... | 1 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Set<MOB> h=properTargets(mob,givenTarget,false);
if(h==null)
{
mob.tell(L("There doesn't appear to be anyone here worth making invisible."));
return false;
}
if(!super.invoke(mob,c... | 7 |
public String TypeTamGiac(){
if(IsTamGiac()==1){
if((a==b)&&(b==c)){
return"TG_DEU";
}
else{
if((a==c)||(a==b)||(b==c)){
return "TG_CAN";
}
if((a*a+b*b==c*c)||(a*a+c*c==b*b)||(b*b+c*c==a*a))
return "TG_VUONG";
}
}
return "NULL";
} | 9 |
public void randomWalkBioData(String[] seedNames, int nArtists, int nRelated,
String delimiter) throws EchoNestException, FileNotFoundException {
PrintWriter pw_names = new PrintWriter("data/artistNames.txt");
for(String seedName : seedNames) {
appearedArtists = new HashSet<String>(nArtists);
List<A... | 9 |
private boolean canHaveAsWall(Wall newW) {
if (newW == null) return false;
if(!grid.getElementsOnPosition(newW.getPosition()).isEmpty())
return false;
for(Wall wall: getAllWallsOnGrid()){
for (Position newWp : newW.getPositions()) {
for (Position wp : wall.getPositions()) {
if (Math.abs(newWp.xC... | 7 |
void handleRead() throws IOException, NoSuchAlgorithmException {
this.buffer.rewind();
int bytesRead = -1;
try {
bytesRead = this.socketChannel.read(this.buffer);
} catch(Exception ex) {}
if (bytesRead == -1) {
close();
} else if (bytesRead > 0) {
this.buffer.rewind();
if (!this.handshakeComp... | 4 |
public Estimator getEstimator() {
switch (this) {
case CHEN:
return new Chen();
case EOM_LEE:
return null; // TODO: Eom-Lee incomplete!!!
case LOWER_BOUND:
return new LowerBound();
case SCHOUTE:
return new Schoute();
case VAHEDI:
return new Vahedi();
case VOGT:
return new Vogt();
case ... | 7 |
boolean selfTest()
{
int k,j,i;
// loop for all the prefixes of the tree source string
for ( k=1; k<length; k++ )
{
// loop for each suffix of each prefix
for ( j=1; j<=k; j++ )
{
// search for the current suffix in the tree
int len = k-j+1;
char[] test = n... | 4 |
IdentServer(PircBot bot, String login) {
_bot = bot;
_login = login;
try {
_ss = new ServerSocket(113);
_ss.setSoTimeout(60000);
}
catch (Exception e) {
_bot.log("*** Could not start the ident server on port 113.");
return;
... | 1 |
public void addByte(final int i) {
if (ClassEditor.DEBUG) {
System.out.println(" " + codeLength + ": " + "byte " + i);
}
// The bytecode array is represented as a linked list of
// ByteCells. This method creates a new ByteCell and appends it
// to the linked list.
final ByteCell p = new ByteCell();
... | 1 |
public ImageFrameEssence getDensity(ImageFrame if1) {
// 2-D boolean array
pixChecked = new boolean[if1.getWidth()][if1.getHeight()];
for(int i=0; i<if1.getWidth(); i++) {
for(int j=0; j<if1.getHeight(); j++) {
pixChecked[i][j] = false;
}
}
//int area = pixAreaItr(5, 5, if1.getRar());
//System.ou... | 9 |
public void loadComponents() {
// initialize all non-disabled components
for(String component: registeredComponents.keySet()) {
if(!registeredComponents.get(component).disabled) {
try {
registeredComponents.get(component).instance = registeredComponents.get(component).clazz.newInstance();
}
catc... | 3 |
public void preloadImage(String name) {
BufferedImage img = null;
if (window.imgs.containsKey(name)) {
img = window.imgs.get(name);
} else {
try {
img = ImageIO.read(window.getClass().getResource(name));
window.imgs.put(name, img);
} catch (final IOException e) {
throw new RuntimeException("R... | 2 |
private void tableClicked(MouseEvent e) {
boolean isSelected = false;
JTable table = (JTable) source;
if (SwingUtilities.isRightMouseButton(e) || e.isPopupTrigger()) {
int row = table.rowAtPoint(e.getPoint());
int[] rows = table.getSelectedRows();
for(int i = 0; i < rows.length; i++) ... | 7 |
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 |
public static void initLocale(ResourceBundle localebundle) {
if (localebundle == null) {
throw new IllegalArgumentException();
}
GUIStrings.locale = localebundle;
} | 1 |
private int getUserId(String name) {
for (int i = 0; i < users.size(); i++) {
User user = users.get(i);
String nameTest = " " + user.getName() + " ";
if (nameTest.contains(name) && name.contains(nameTest)) {
return i;
}
}
return -... | 3 |
protected void createMoreParticles(ParticleEmitter emitterDetails, float x, float y) {
int particlesToCreate = Helpers.randomBetween(emitterDetails.minimumParticles, emitterDetails.maximumParticles);
for (int i = 0; i < particlesToCreate && emitterDetails.currentParticles.size() < emitterDetails.maximumTotalParticl... | 3 |
@Override
public void run()
{
byte[] receiveData = new byte[1024];
while(true)
{
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
try {
serverSocket.receive(receivePacket);
} c... | 2 |
public ArrayList<Category> getAllCategory() {
ArrayList<Category> ret = new ArrayList<Category>();
Connection conn = null;
Statement st = null;
ResultSet rs = null;
try {
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&password=123456");
st=conn.createStatement();
... | 6 |
public static String numberToString(Number number)
throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
... | 6 |
private void createActionPanel() {
JPanel panel = new JPanel();
cancel = new JButton("Cancel");
cancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
Main main = (Main) GameSettingsPanel.this.getTopLevelAncestor();
main.displayMatch();
}
}... | 2 |
public ReferenceType createReferenceType() {
return new ReferenceType();
} | 0 |
private ItemStack getItemStackBackwards(Item item) {
int ID = item.getID();
ItemStack stack;
for (int i = items.size() - 1; i >= 0; i--) {
stack = items.get(i);
if (stack.getItemInStackID() == ID && stack.getAmount() <= stack.getMaxStackSize())
return sta... | 3 |
private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 70
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 70
... | 8 |
private boolean move(PaletteEntry entry, boolean up) {
int index = getChildren().indexOf(entry);
if (index < 0) {
// This container does not contain the given palette entry
return false;
}
index = up ? index - 1 : index + 1;
if (index < 0 || index >= getChildren().size()) {
// Performing the move ope... | 9 |
public static Object conversion_t( Object source, Class<?> targetClass ) throws InstantiationException, IllegalAccessException {
Class<?> sourceClass = source.getClass();
Field[] sFields = sourceClass.getDeclaredFields();
Object oOut = targetClass.newInstance();
/* On parcourt chaque attribut */
for ( ... | 8 |
@Override
protected void paintEvent(QPaintEvent e)
{
Set<core.Point> visible = mission.getActivePlayer().getVisible();
QPainter painter = new QPainter(this);
QImage image = new QImage(tmap.length, tmap[0].length, Format.Format_RGB32);
int rgb;
Set<core.Point> ommit = new HashSet<core.Point>();
for (... | 8 |
public void highlightTargets() {
int index;
for (BoardCell target : targets) {
index = calcIndex(target.getRow(), target.getCol());
cells.get(index).setColor(Color.RED);
}
repaint();
} | 1 |
public static void load() {
// extract a default config
if(!fileConfig.exists()) {
MCNSAEssentials.getInstance().saveResource("items.yml", false);
}
// load items from a config file
try {
yamlConfig.load(fileConfig);
}
catch (Exception e) {
e.printStackTrace();
}
// get our items config... | 3 |
public int getFirstID(){
return first_city.getID();
} | 0 |
public void GenerateSTM(UOIGUI gui){
Random rndm = new Random();
String[] columns = {"StaticMesh","Tag","Layer","bOverrideLightMapRes","OverriddenLightMapRes","bUsePrecomputedShadows",
"LightingChannels","Location","Rotation","Scale"};
Object[][] data = new Object[Integer.parseInt(gui.getStmCountField().ge... | 9 |
public static byte[] decrypt(byte[] in,byte[] key){
int i;
byte[] tmp = new byte[in.length];
byte[] bloc = new byte[16];
Nb = 4;
Nk = key.length/4;
Nr = Nk + 6;
w = generateSubkeys(key);
for (i = 0; i < in.length; i++) {
if (i > 0 && i % 16 == 0) {
bloc = decryptBloc(bloc);
System.arr... | 4 |
public World(int w, int h, float scale) {
screen = new Screen(this, w, h, scale);
new Tile();
tiles = new Tile[worldSize * worldSize][layers];
for (int i = 0; i < tiles.length; i++) {
tiles[i][0] = Tile.grassTile;
tiles[i][1] = Tile.airTile;
}
for (int i = 0; i < tiles.length; i++) {
if (rand... | 8 |
public LocStack() {
init();
} | 0 |
public CycList<CycList<E>> combinationsOf(int n) {
if (!isProperList) {
throw new RuntimeException(this + " is not a proper list");
}
if (this.size() == 0 || n == 0) {
return new CycList<CycList<E>>();
}
return combinationsOfInternal(new CycList<E>(this.subList(0, n)),
new Cy... | 3 |
public ArrayList<String> getFileNames(){
System.out.println("Getting all files with reads per transcripts counts. Files names finish with " + fnamePattern);
ArrayList<String> fileNames = new ArrayList<String>();
File dir = new File(dirName);
for (File ch : dir.listFiles()) {
if ... | 5 |
Point3f getMin() {
if (min == null)
min = new Point3f();
if (list.isEmpty()) {
min.set(0, 0, 0);
return min;
}
Object3D c = list.get(0);
if (c != null) {
min.x = c.getMinX();
min.y = c.getMinY();
min.z = c.getMinZ();
}
synchronized (list) {
int n = count();
if (n > 1) {
for (in... | 8 |
public int hashCode(){
return mKey.hashCode();
} | 0 |
public static boolean isJarURL(URL url) {
String protocol = url.getProtocol();
return (URL_PROTOCOL_JAR.equals(protocol) ||
URL_PROTOCOL_ZIP.equals(protocol) ||
URL_PROTOCOL_WSJAR.equals(protocol) ||
(URL_PROTOCOL_CODE_SOURCE.equals(protocol) && url.getPath().contains(JAR_URL_SEPARATOR)));
} | 4 |
public boolean hasCard(int value, int suite) {
for (Card card : hand) {
if (card.value == value && card.suite == suite) {
return true;
}
}
return false;
} | 3 |
public void release(int num)
{
if(num >= 0 && num < seat.length)
{
seat[num] = false;
System.out.printf("%d seat is now available.",num);
}
else
{
System.out.println("invalid seat number.");
}
} | 2 |
private void startGameLoad(int delay){
SchedulerManager.registerSingle(delay, new Runnable(){
public void run(){
if(MapData.areNewMapsToLoad()){
if(MapData.loadMapsFromConfig()) BetweenMapsRuntime.start();
else{
if(MapData.loadMapsFromConfig()) BetweenMapsRuntime.start();
else SchedulerM... | 3 |
@Override
protected void updateShareRates (){
for (int i = 0; i < availableShare.size(); i++){
if (availableShare.get(i) != null){
updateShareRate(availableShare.get(i));
}
}
flag++;
} | 2 |
private void nextYear(Team team, PlayerPtrVector allPlayers, Positions posi) {
int nofPlayers = 0;
Player player = getNextSeasFirst(allPlayers, team);
while (player != null) {
nofPlayers++;
if (player.getNation() != team.getNation()) {
posi.nofForeigners++;
}
if (player.getPosition().getPosID() ==... | 7 |
public ServiceMethod getMethod(String name) {
ServiceMethod method = this.methods.get(name);
if(method == null) {
for(Map.Entry<String, ServiceMethod> entry : this.methods.entrySet()) {
String n = entry.getKey();
if(name.endsWith(n)) {
method = entry.getValue();
break;
}
}
}
re... | 3 |
public MAdministrador(Administrador admin) {
setModal(true);
initComponents();
if(!(admin == null)){
edtUserName.setEnabled(false);
edtUserName.setText(admin.getNombre());
jtxtPass.setText(admin.getPassword());
jlbPass.setText("Nueva Contraseña");
... | 1 |
public Set<Pair<T,T>> getAllPairs(Set<T> that)
{ Set<Pair<T,T>> allPairs;
if(that!=null)
{ if(this.next==null && that.next==null)
{ allPairs=new Set(new Pair(this.a,that.a),null);
}
else if(this.next!=null && that.next==null)
{ allPairs=new Set(new Pair(this.a,that.a),this.next.getA... | 7 |
private Layer redraw(final int z) {
final ArrayList<Sprite.Part> parts = new ArrayList<Sprite.Part>();
Sprite.Drawer drw = new Sprite.Drawer() {
public void addpart(Sprite.Part p) {
if (p.z == z)
parts.add(p);
}
};
for (Sprite s... | 9 |
@Override
public double distance(ItemBoundable a, ItemBoundable b) {
Geometry g1 = (Geometry) a.getItem();
Geometry g2 = (Geometry) b.getItem();
//and a lot of faster this way with envelope dist instead of geometry dist
double distance = g1.getEnvelopeInternal().centre().distance(g2.getEnvelopeInter... | 2 |
void draw(Graphics g) {
int hs = 8;
setBbox(point1, point2, hs);
boolean selected = (needsHighlight() || sim.plotYElm == this);
double len = (selected || sim.dragElm == this) ? 16 : dn-32;
calcLeads((int) len);
setVoltageColor(g, volts[0]);
if (selected)
g.setColor(selectColor);
drawThickLine(g, point1, le... | 8 |
@Override
public void updateLong() {
super.updateLong();
if(generationTimerEnd == 0) {
resetGenerationTimer();
}
if(generationTimerEnd <= System.currentTimeMillis() && this.isActivated()) {
placeableManager.playerAddItem("Iron", 1);
... | 3 |
public static long nextMonth(long month) {
return month + countDayInMonth(month) * DAY_LENGTH;
} | 0 |
public void itemExpanded(TreeItem item){
super.itemExpanded(item);
if(item instanceof DatabaseTreeItem){
DatabaseTreeItem dataItem = (DatabaseTreeItem) item;
DataEditorTreeItem data = (DataEditorTreeItem) dataItem.editorData;
data.expanded = true;
}
... | 3 |
public void f() {
System.out.println("public f()");
} | 0 |
private String assemblePath(List list) {
if (list == null) {
return null;
}
StringBuffer buf = new StringBuffer();
if (this.is_absolute_path && (path != null && path.length() > 0)) {
buf.append(PATH_DELIM);
}
for (int i = 0; i < list.size(); i++) {
String segment = (String) list.get(i);
... | 7 |
@Override
public void actionPerformed(ActionEvent e) {
try {
if (e.getSource() == this.view.getJbErrorLift()) {
Shared.getInstance().getLock().lock();
Shared.getInstance().setFlagliftAndNotify(Flag.RED);
} else if (e.getSource() == this.view.getJbError... | 8 |
public static String makeTesnseEomi(String preword, String endword) {
if(preword==null||preword.length()==0) return endword;
if(endword==null||endword.length()==0) return preword;
if(endword.charAt(0)=='ㅆ') {
return preword.substring(0,preword.length()-1)+
MorphUtil.makeChar(preword.charAt... | 9 |
public void create(Openchatroom entity) {
EntityManager em = PersistenceManager.createEntityManager();
try {
em.getTransaction().begin();
em.persist(entity);
em.getTransaction().commit();
} finally {
if (em.getTransaction().isActive())
em.getTransaction().rollback();
em.close();
}
} | 1 |
@Override
public void doGet(SimpleServletRequest request, SimpleServletResponse response)
{
try
{
response.setMimeType(MIMEType.All.html.getType());
final File pageFile=new File("web.log");
if((!pageFile.exists()) || (!pageFile.canRead()) || (pageFile.length() > Integer.MAX_VALUE))
throw HTTPExceptio... | 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.