text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setTextCursorsBlank() {
for(slideMediaObject object: mediaObjects){
if(object.getStartTime() <= count){
if(object.isText()){
JPanel textPanel = (JPanel)object.getComponent(0);
textPanel.getComponent(0).setCursor(GUI.blankCursor);
}
}
}
} | 3 |
protected void interrupt() {
logger.info(Thread.currentThread().getName() + " is interrupted");
if (!Thread.currentThread().isInterrupted()) {
Thread.currentThread().interrupt();
}
ThreadGroup root = Thread.currentThread().getThreadGroup();
Thread[] thds = new Thread[root.activeCount()];
int nthds = root... | 3 |
@EventHandler
public void CaveSpiderResistance(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.getCaveSpiderConfig().getDouble("Cav... | 6 |
public void registerScore(Object[] args)
{
int score = (Integer)args[0];
int level = (Integer)args[1];
String name = (String)JOptionPane.showInputDialog(
null,
"Please enter your name for the highscore list:",
"High score",
JOptionPane.INFORMATIO... | 3 |
public DFAEqualityAction(FiniteStateAutomaton automaton,
Environment environment) {
super("Compare Equivalence", null);
this.environment = environment;
/*
* putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke (KeyEvent.VK_R,
* MAIN_MENU_MASK+InputEvent.SHIFT_MASK));
*/
} | 0 |
private String getLanguage(HashMap<String, Object> map) {
@SuppressWarnings("unchecked")
ArrayList<String> langs = (ArrayList<String>) map.get("primaryLanguages");
if (langs == null || langs.isEmpty()) return null;
if (langs.size() > 1)
System.err.println("Multiple primary languages " + map);
return langs.... | 3 |
private Time getTimeFromFields() {
int activityId = getSelectedActivity().getIdActivity();
Calendar startTimeCal = getStartTimeFromFields();
Calendar endTimeCal = getEndTimeFromFields();
Timestamp startTime = null;
Timestamp endTime = null;
long duration = -1;
if (startTimeCal != null) {
startTime = ne... | 4 |
private static Vertex getNext(List<Vertex> vertices, Vertex already)
{
List<Vertex> possi = new ArrayList<Vertex>(vertices.size());
for (int i = 0; i < vertices.size(); i++) {
if ((vertices.get(i).getPathsCount() == 0 || vertices.get(i).getPathsCount()%2 != 0) && already.getId() != vertices.get(i).getId() && !a... | 9 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
Consultar_Label = new javax.swing.JLabel();
TabbedPane = new javax.swing.JTabbedPane();
Equipa_Panel = new javax.swing.JPanel();
... | 4 |
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.jtattoo.plaf.graphite.GraphiteLookAndFeel");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStack... | 4 |
@Command(command = "demote",
aliases = {"de"},
arguments = {"target player[s]"},
description = "demotes the target player[s]",
permissions = {"demote"},
consoleOnly = true)
public static boolean demoteFromConsole(CommandSender sender, String targetPlayer) throws EssentialsCommandException {
// make su... | 3 |
@Override
public DrawableItem duplicate() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} | 0 |
public Document getDocument() {return this.doc;} | 0 |
public void move(int x, int y){
if(alive && !hasCollision(this.x+x*speed, this.y+y*speed)){
this.x += x*speed;
this.y += y*speed;
}
} | 2 |
protected void setCurrentState(final StateEnum state, final boolean enterInitialState, final C context) {
execute(new Runnable() {
@Override
public void run() {
if (!enterInitialState) {
StateEnum prevState = context.getState();
if ... | 2 |
public void create(String personId, String name, String password) {
this.setPersonId(personId);
this.setName(name);
this.setPassword(password);
} | 0 |
public String toString() {
String print = "";
Binomialnode x = root;
while (x != null) {
print = print + x.printTree(0);
x = x.sibling;
}
return print;
} | 1 |
public static boolean getGuildInvites(String[] args, CommandSender s){
//Various checks
if(Util.isBannedFromGuilds(s) == true){
//Checking if they are banned from the guilds system
s.sendMessage(ChatColor.RED + "You are currently banned from interacting with the Guilds system. Talk to your server admin if you... | 5 |
public boolean checkUsername(String username)
{
if(username.isEmpty())
return false;
for(char c : username.toLowerCase().toCharArray())
{
int tmp = c;
if(!(tmp > 96 && tmp < 123) || tmp==230 || tmp==248 || tmp==229) // Checking username letters
return false;
}
return true;
} | 7 |
private static int packet_get_nb_frames(byte[] packet) {
int count = 0;
if (packet.length < 1) {
return -1;
}
count = packet[0]&0x3;
if (count==0)
return 1;
else if (count!=3)
return 2;
else if (packet.length<2)
retu... | 4 |
public void setActiveLayer(int i) {
if (i < 0 || i >= layers.size()) {
return;
}
activeLayer = i;
curLayer = layers.get(i);
callListenersLayerChange();
} | 2 |
@Override
public void acceptDraggableObject(DraggableObject object)
{
if(object instanceof DraggableObjectEntity)
{
DraggableObjectEntity fileobj = ((DraggableObjectEntity)object);
if(fileobj.uuid != null)
{
if(!fileobj.uuid.trim().equals(""))
{
setData(editor.getMap().getEntityList().getEnt... | 3 |
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public void addTravelTrip(TravelTrip travelTrip) {
travelTripDao.register(travelTrip);
} | 0 |
@ChattingAnnotation(feature="None", type="Method")
public void buzz() {
final int lX = f.getLocationOnScreen().x;
final int lY = f.getLocationOnScreen().y;
System.out.println(lX + "+" + lY);
try {
for (int i = 0; i < 20; i++) {
Thread.sleep(10);
f.setLocation(lX, lY + 5);
Thread.sleep(10);
f... | 2 |
@SuppressWarnings("unchecked")
public Extensions deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
JsonObject o = json.getAsJsonObject();
Extensions extensions = new Extensions();
for (Map.Entry<String, JsonElement> entry : o.entrySet()) {
... | 3 |
public void clickChooseCharacters(Scanner kb, ArrayList<MainMenuHeroSlot> heroies) {
System.out.println("You have already chosen your characters");
} | 0 |
public static void main(String[] args) {
int i, j; // Initialize local variable i
Scanner input = new Scanner(System.in);
System.out.println("\nEnter lenght of first array: "); // allow user
// input
int SIZE = input.nextInt();
int[] array = new int[SIZE];
System.out.println("\nEnter ele... | 6 |
@Override
public int getGrade(Node<T> n) {
if (safety && !contains(n)) {
throw new NodeNotFoundException();
} else if (n == null) {
return 0;
}
int c = 0;
Iterator<Node<T>> children = children(n);
while (children.hasNext()) {
children.next();
c++;
}
return c;
} | 4 |
private boolean isHorizontallyOccupied(HantoCell from, HantoCell to){
boolean isOccupied = true;
if (to.getX() < from.getX()){
for (int i = from.getX() - 1; i > to.getX(); i--){
if (findCell(i, to.getY()) == null){
isOccupied = false;
break;
}
}
} else {
for (int i = from.getX() + 1;... | 5 |
public void findSweetSpots()
{
int x,y;
for(y=0;y<matrix.length;y++)
{
for(x=0;x<matrix[y].length;x++)
{
if(matrix[y][x]==matrixMax)
{
pathRek(x,y,"");
}
}
}
} | 3 |
public boolean collision(double x, double y) {
boolean solid = false;
for (int c = 0; c < 4; c++) {
double xt = (x - c % 2 * 16) / 16;
double yt = (y - c / 2 * 16) / 16;
int ix = (int) Math.ceil(xt);
int iy = (int) Math.ceil(yt);
if (c % 2 == 0) ix = (int) Math.floor(xt);
if (c / 2 == 0) iy = (int... | 4 |
@Test
public void testSimple() {
final long[] times = new long[51];
final long target_median = 90;
final long margin_of_error = 10;
final Properties config = new Properties();
config.setProperty("median_latency", "" + target_median);
final Filter f = new WanFilter(new... | 1 |
public final int getNameCount() {
return this.filename == null ? 0 : this.dirs == null ? this.filename
.equals("/") ? 0 : 1 : this.dirs.length + 1;
} | 3 |
public QRDecomposition (Matrix A) {
// Initialize.
QR = A.getArrayCopy();
m = A.getRowDimension();
n = A.getColumnDimension();
Rdiag = new double[n];
// Main loop.
for (int k = 0; k < n; k++) {
// Compute 2-norm of k-th column without under/overflow.
double n... | 8 |
@Override
public Element generateDataElement(LauncherAction action) {
JavaAppDesc desc = (JavaAppDesc)action.getLaunchDesc();
org.w3c.dom.Element e = createInitialElement(desc);
//Main Class
e.setAttribute("main-class", desc.getMainClass());
//Arguments
String... | 8 |
private long persistLegal(Legal legal, String table) throws SQLException {
Connection connection = null;
PreparedStatement preparedStatement = null;
String insertSQL = "INSERT INTO " + table
+ "(bank_account,TIN,company_name,company_address) VALUES"
+ "(?,?,?,?)";
try {
connection = provider.getCo... | 4 |
public static byte[] hexToBytes(String str) {
if (str == null) {
return null;
} else if (str.length() < 2) {
return null;
} else {
int len = str.length() / 2;
byte[] buffer = new byte[len];
for (int i = 0; i < len; i++) {
buffer[i] = (byte) Integer.parseInt(
str.substring(i * 2, i * 2 + 2... | 3 |
private void setDoubleDown() {
switch(playerTurn) {
case(1):
if (canPlayer1DD) {
canPlayer1DD = false;
dd.setVisible(true);
}
else
dd.setVisible(false);
break;
case(2):
if (canPlayer2DD) {
canPlayer2DD = false;
dd.setVisible(true);
}
else
dd.setVisible(false);
... | 8 |
private void getPoints() {
Random rd = new Random();
int chance;
for (int i = -this.radius; i < this.radius; i++) {
for (int j = -this.radius; j < this.radius; j++) {
chance = rd.nextInt(100) - Math.abs(i - j) - Math.abs(i + j) - Math.abs(i) - Math.abs(j) + radius;
... | 3 |
public boolean DestructPlugin(Session Session, String Name)
{
int Count = Plugins.size();
for(HabboPlugin Plugin : Plugins)
{
try
{
if (Plugin.GrabName().equalsIgnoreCase(Name))
{
Grizzly.WriteOut(Plugin.GrabName() + " has been destructed by " + Session.GrabHabbo().Username);
Pl... | 3 |
public void addOpdrachtenFromFileToDB() {
con = createConnection();
ResultSet rs = null;
try {
List<Opdracht> opdrachtenLijst = leesOpdrachtenVanBestand();
for (Opdracht opdr : opdrachtenLijst) {
pst = con
.prepareStatement("select idOpdrachtSoorten from opdrachtsoorten where OpdrachtSoortenNaam... | 9 |
@Override
public Screen respondToInput(KeyEvent key) {
char c = key.getKeyChar();
Item[] items = this.player.getInventory().getItems();
if (letters.indexOf(c) > -1 && items.length > letters.indexOf(c) && items[letters.indexOf(c)] != null && isAcceptable(items[letters.indexOf(c)])) {
return use(items[letters.i... | 5 |
public void remove(Object o) {
for (int i = 0; i < size(); i++) {
if (list.get(i).getReturnValue().equals(o)) {
list.remove(i);
}
}
} | 2 |
public void initPublishSubscriber(final int periodMs){
Thread thread = new Thread() {
public void run() {
PortReadingResult or;
// check if the observer is still there
// we have no more than 1 observer
while(countObservers()>0){
try {
or = readData();
while(or.getStatus() == Outp... | 5 |
public ListNode removeNthFromEnd(ListNode head, int n)
{
if (n < 1) {
throw new IllegalArgumentException("n cannot be smaller than 1");
}
if (head == null) {
return null;
}
int headStartCounter = 0;
ListNode remove = null;
for (ListNode lead = head; lead != null; lead = lead.next)
{
if (hea... | 7 |
private int compareAddresses( InetAddress first,
InetAddress second ) {
if( first.equals(second) )
return 0; // equal
byte[] bytesA = first.getAddress();
byte[] bytesB = second.getAddress();
if( bytesA.length != bytesB.length )
return bytesA.length - bytesB.length; // not equal
int cmp;
for(... | 4 |
public static void handleEnableAsyncMetadataReply(HTSMsg msg, HTSPClient client) {
Collection<String> requiredFields = Arrays.asList(new String[]{});
if (msg.keySet().containsAll(requiredFields)){
//TODO
} else if (msg.get("error") != null){
//TODO
} else{
System.out.println("Faulty reply");
}
} | 2 |
@Override
public void run() {
String str;
while(isConected){
try {
str = in.readLine().replace(";;", "\n");
request = (Map<String, Object>) yaml.load(str);
ActionDispatch.analize(request);
} catch (Exception e) {
// TODO Автоматически созданный блок catch
e.printStackTrace();
}
}... | 2 |
public boolean isVerticalCombo(int x, int y, Orb[][] arr) {
int verCount = 0;
for (int j = 1; ((y + j) < Y && arr[y + j][x] != null)
&& arr[y][x].color == arr[y + j][x].color; j++)
verCount++;
for (int j = -1; ((y + j) >= 0 && arr[y + j][x] != null)
&& arr[y][x].color ... | 7 |
public static void outLog(String data){
// BatchOS.outLog(data, true);
} | 0 |
public boolean isValidField(char row, byte column)
{
if(row >= 97 && row <= 104 && column <= 7 && column >= 0)
{
return true;
}
return false;
} | 4 |
@Override
public Vector3 color(Scene scene, Ray ray) {
Vector3 color = defaultColor;
Collision collision = trace(scene, ray);
if (collision != null) {
Vector3 collisionPoint = ray.getFrom().add(ray.getDirection().multiply(collision.getDistance()));
... | 5 |
* @param options
* @return Demon
*/
public static Demon defineDemon(String name, Cons options) {
{ Demon demon = Demon.newDemon();
PropertyList plist = PropertyList.newPropertyList();
Cons conslist = Stella.NIL;
Demon olddemon = null;
boolean activateP = false;
{ Stella_Object... | 6 |
public boolean deleteRow(int row) {
if (row < 0 || row > data.size() - 2)
return false;
data.remove(row);
fireTableRowsDeleted(row, row);
return true;
} | 2 |
public void leavePercentageOutSplit(String filename, int percentage, boolean random) {
List<UserData> trainLines = new ArrayList<UserData>();
List<UserData> testLines = new ArrayList<UserData>();
Set<Integer> indices = new HashSet<Integer>();
int currentUser = -1, userIndex = -1, userSize = -1;
for (int i = 0... | 8 |
private static void processWorkflowDirectory(final File workflowsDirectory, final Map<File, AnalysisData> processedWorkflows) {
final File workflowReportFile = new File(workflowsDirectory, "report.xml");
if (workflowReportFile.exists() && workflowReportFile.isFile()) {
//System.out .println("Azotyzing: " + workf... | 4 |
private static void playRound() {
battles++;
if (hands[0].handSize() == 0 || hands[1].handSize() == 0) {
gameOver = true;
} else {
for (int i = 0; i < hands.length; i++) {
stacks[i].put(hands[i].get());
}
compareStacks();
System.out.println("Player 0 has " + hands[0].handSize() + " Player 1 has... | 3 |
public String saveConfigSectionWithComments(ConfigurationSection section, boolean depth) {
StringBuilder builder = new StringBuilder();
for (Iterator<Map.Entry<String, Object>> i = section.getValues(false).entrySet().iterator(); i.hasNext();) {
Map.Entry<String, Object> entry = i.next();
... | 7 |
public void setFontProperties(Properties fontProperties)
throws IllegalArgumentException {
String errorString = "Error parsing font properties ";
try {
fontList = new ArrayList<Object[]>(150);
Enumeration fonts = fontProperties.propertyNames();
String name... | 5 |
public static void removeOpponentCaptures(Board board, int opponent, int x, int y) {
int boardSize = board.boardSize;
if (x > 0) {
removeIfCaptured(board, opponent, x - 1, y);
}
if (x < boardSize - 1) {
removeIfCaptured(board, opponent, x + 1, y);
}
if (y > 0) {
removeIfCaptured(board, opponent, x,... | 4 |
private DrivingLicense(PersonName driversName, Date dateOfBirth,
LicenseNumber licenseNumber, Date dateOfIssue, boolean isFullLicense){
if (driversName.toString().isEmpty())
throw new IllegalArgumentException("The drivers name is null");
this.driversName = driversNam... | 4 |
private ArraySchema parseArraySchema(JsonNode rawSchema, URL schemaLocation) {
ArraySchema result = new ArraySchema();
JsonNode rawItems = rawSchema.get("items");
if (rawItems != null) {
result.setItems(parse(rawItems, schemaLocation));
}
JsonNode rawMinItems = rawSch... | 3 |
public String layer_string()
{
switch (h_layer)
{
case 1:
return "I";
case 2:
return "II";
case 3:
return "III";
}
return null;
} | 3 |
private DisplayMode getBestDisplayMode() {
DisplayMode[] program_displays = { new DisplayMode(640 , 480, DisplayMode.BIT_DEPTH_MULTI, DisplayMode.REFRESH_RATE_UNKNOWN),
new DisplayMode(800 , 600, DisplayMode.BIT_DEPTH_MULTI, DisplayMode.REFRESH_RATE_UNKNOWN),
... | 9 |
@Override
public boolean exportFile(String name, String path, Pattern pattern) {
try{
System.out.println("test 1" + pattern);
FileWriter fw = new FileWriter("" + path + "\\name" + ".txt");
PrintWriter pw = new PrintWriter(fw);
pw.println("patNam_" + pattern.ge... | 5 |
private String getClassLocation() {
final Class cls = getClass();
URL result = null;
final String clsAsResource = cls.getName().replace('.','/').concat(".class");
final ProtectionDomain pd = cls.getProtectionDomain();
// java.lang.Class contract does n... | 5 |
public XYSeriesCollection createFinalRobustnessDataset(Map<Integer, List<Double>> robustnessHistory) {
final XYSeriesCollection dataset = new XYSeriesCollection();
List<SummaryStatistics> sumValues = new LinkedList<>();
SummaryStatistics meanRobustness = new SummaryStatistics();
for (Int... | 9 |
public void setDetermineImageNumber(boolean newValue)
{
determineNumberOfImages = newValue;
} | 0 |
public void init(String cifra_de_bloco, String padding_str) {
try {
//Algoritmo de criptografia/modo de operacao de cifra de bloco/preenchimento
ecipher = Cipher.getInstance(cifra_de_bloco + "/" + this.mode + "/"+padding_str); //classe para criptografia
dcipher = Cipher.getI... | 5 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return super.okMessage(myHost,msg);
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS))
&&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL)
&... | 9 |
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
servletResponse.setContentType("text/html");
String path = ((HttpServletRequest) servletRequest).getRequestURI();
//If not in a prote... | 8 |
public void addFreq(String word) {
if (mFreq < Integer.MAX_VALUE) mFreq++;
if (Character.isUpperCase(word.charAt(0))) mCapitalFreq++;
} | 2 |
public void run(CommandSender sender, String[] args) {
if(args.length == 0) {
sender.sendMessage(ChatColor.RED + "You didn't enter a group.");
return;
}
String g = args[0];
if(args.length < 2) {
if(SettingsManager.getInstance().getGroup(g) != null) {
if(SettingsManager.getInstance().getGroup(... | 9 |
public static void main(String args[]){
String keyPairs[];
String keys[];
HashTable tbl=new HashTable();
long start=System.currentTimeMillis();
BufferedReader br = null;
BufferedReader br1 = null;
try {
String sCurrentLine;
String inputLine ="";
br = new BufferedReader(new FileReader("E:/In... | 6 |
public void addPerso(String nomType, String nom, int age) throws ClassePersonnageManquanteException {
Personnage nouveauPerso;
// On fait des "if" car le switch case avec String n'est pas accepté
if(nomType.equals("Mage")) {
nouveauPerso = new Mage(nom, age);
this.addPersonnage(nouveauPerso);
} else if(no... | 4 |
public static String escape(String string) {
char c;
String s = string.trim();
StringBuffer sb = new StringBuffer();
int length = s.length();
for (int i = 0; i < length; i += 1) {
c = s.charAt(i);
if (c < ' ' || c == '+' || c == '%' ... | 6 |
private void startFactory() {
try {
this.factory = factoryClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
} | 1 |
@Test
public void validationNegativeWithStringTest() {
view.getNumberOfPointsTextField().setText("aaa");
view.getNumberOfPointsTextField().getInputVerifier().verify(view.getNumberOfPointsTextField());
assertFalse(view.getDrawButton().isEnabled());
} | 0 |
public int GetRunAnim(int id)
{
if(id == 4151) // whip
{
return 1661;
}
if(id == 8447) // cat toy
{
return 1661;
}
if(id == 6818) // bow-sword
{
return 744;
}
if(id == 4734 || id == 837) // karils x bow
{
return 2077;
}
if(id == 4153) // maul
{
return 1664;
}
if(id == 1419) // scythe
{
return 1664;
}
if(id == 7449) //... | 8 |
private static CycFormulaSentence makeCycLSentence(String query, CycAccess access) {
try {
return CycLParserUtil.parseCycLSentence(query, true, access);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | 1 |
private double getExpectedScore() {
double expected = 0;
for (int i = 0; i < NFRUIT; i++) {
expected += (mExpDistrib[i] * mPreferences[i]);
}
expected*=bowlSize;
return expected;
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TwoCitiesSolution other = (TwoCitiesSolution) obj;
if (A == null) {
if (o... | 9 |
private void findInfo() {
String line = "";
try {
while( (line = buffer.readLine()) != null) {
if( line.contains(name) ) {
while( line.contains(" ") ) {
line = line.substring(line.indexOf(" ")+1);
}
this.infoClass.setName(line.substring(0, line.length()-1));
}
else if( line.... | 8 |
public void mouseMoved(MouseEvent e) {
} | 0 |
public final int getMethodIndex(String originalName, Class[] argTypes)
throws NoSuchMethodException
{
Method[] mthds = getReflectiveMethods();
for (int i = 0; i < mthds.length; i++) {
if (mthds[i] == null)
continue;
// check name and parameter types m... | 4 |
public void majInfos() {
int i;
int nb;
try {
i = territoire.getOccupant().getJoueur().getIndice();
}
catch (Exception e) {
i = Game.JOUEUR_BACKGROUND.length - 1;
}
nb = territoire.getNbUnite();
if( territoire.getOccupant() != null && territoire.getOccupant().isEnDeclin() ){
tx.setBack... | 3 |
public void setAspect(String s) throws ADataException{
if (s == null) throw new ADataException();
if (!(isValidAspect(s) || s.equals(DOUBT))) throw new ADataException();
this.aspect = s;
} | 3 |
boolean SOUTHdiagnoalHasCraftedBlock(Location startLocation)
{
boolean res = false;
// Check SOUTH 45 degrees =========================================================
// Check if there is a valid crafted ceiling block in 45 degrees upwards to the player within given distance
Location check... | 3 |
@Override
public void mouseClicked(MouseEvent e)
{
if (SwingUtilities.isLeftMouseButton(e))
{
if (e.getComponent().equals(circle))
{
square.setSelected(false);
ground.setSelected(false);
if (circle.isSelected())
... | 7 |
private void doExchangeBasket() throws InterruptedException {
int memberCount = otapiJNI.OTAPI_Basic_Basket_GetMemberCount(assetID);
boolean bSure = true;
if (otapiJNI.OTAPI_Basic_GetNym_TransactionNumCount(serverID, nymID) < (2+memberCount)) {
bSure = Helpers.getTransactionNumbers... | 7 |
private Server serverStart(int firstPort) throws IOException {
int port, tries;
if (firstPort < 0) {
port = FreeCol.getDefaultPort();
tries = 10;
} else {
port = firstPort;
tries = 1;
}
logger.finest("serverStart(" + firstPort + ") ... | 6 |
@Override
public Object getValueAt(int row, int col)
{
{
ProductionOrder po = Porder.get(row);
switch (col)
{
case 0:
return po.getID();
case 1:
return po.getPOrder();
case 2:
... | 6 |
public String strStr(String haystack, String needle) {
if (haystack == null || haystack.length() == 0) {
if (needle == null || needle.length() == 0) {
return haystack;
}
return null;
}
char[] s = haystack.toCharArray(), p = needle.toCharArray()... | 9 |
public void start() {
try {
preStartup();
running = true;
long lr = System.currentTimeMillis();
long lu = lr;
while (isRunning()) {
boolean updated = false;
if (shouldUpdate(lu)) {
int d = (int) (Syst... | 6 |
public static double asec(double a){
if(a<1.0D && a>-1.0D) throw new IllegalArgumentException("asec argument (" + a + ") must be >= 1 or <= -1");
return Math.acos(1.0/a);
} | 2 |
@Override
protected List< ? extends Component> createBrickComponents() {
List<Component> components = new ArrayList<Component>();
JPanel wrapper = new JPanel();
String tooltip = getTooltip();
// label
if ( control.getLabel() != null ) {
label = new JLabel();
... | 8 |
@Override
public final int getCounterwidth() {
return (int)Math.ceil(Calc.log(getMax()+1,2));
} | 0 |
private void load() {
// Load main model, if file is present
boolean haveOldData = false;
File file = settings.getStaticFile();
try {
FileInputStream reader = new FileInputStream(file);
XmlModelAdapter xml = new XmlModelAdapter();
xml.readModel(reader, model);
reader.close();
haveOldData = true;
... | 5 |
private void deleteTeam()
{
clear();
System.out.println("Delete Team:");
System.out.println();
try
{
int matchCount = matchmgr.showCount();
int teamCount = teammgr.showCount();
int maxMatchID = matchmgr.maxMatchId();
ArrayList<... | 3 |
@Override
public void dispose() {
display.dispose();
while(display.isCreated()) {
try {
Thread.sleep(100);
} catch(final InterruptedException e) {
}
}
stop();
super.dispose();
System.exit(0);
} | 2 |
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.