text stringlengths 14 410k | label int32 0 9 |
|---|---|
public final boolean isPruned() { return pruned; } | 0 |
public static void main(String[] args){
int primeCount =0;
int i = 0;
while(true){
if(isPrime(i)){
primeCount++;
if(primeCount ==10001){
break;
}
}
i++;
}
System.out.println(i);
} | 3 |
public void start_run_single(int n){
Random ran = new Random();
jade.math.ExponentialDistribution disp = new jade.math.ExponentialDistribution();
disp.setFallOff(0.5);
jade.math.ExponentialDistribution ext = new jade.math.ExponentialDistribution();
ext.setFallOff(10);
double cur_disp = 0.5;
double cur_ext... | 8 |
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Kurs());
} | 0 |
public static void main(String[] args)
{
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 10; j++)
{
System.out.print("Богдан" + " ");
}
System.out.println();
}
} | 2 |
public void setCp(String cp) {
this.cp = cp;
} | 0 |
static int findASolution(double[][][] graph, int[] assigned) throws Exception {
//loop: while there are still tasks that need to be assigned
//1. pick new unassigned task randomly
//2. assign that task to an agent using "action choice rule"
// init capacities
double[] capacities = new double[NUM_AGENTS];
... | 9 |
private void openStream(final String param){
String appended = zybezUrl.concat(param);
try {
zybez = new URL(appended);
urlConnection = zybez.openConnection();
urlConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1... | 2 |
public void setType(int type) {
this.type = type;
//set color
switch (Math.abs(type)) {
case 1:
inner1 = new Color(215, 15, 55);
inner2 = new Color(254, 78, 113);
backgroundColor = new Color(247, 32, 57);
left = new Colo... | 8 |
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block b = event.getClickedBlock();
if ((b.getType() == Material.SIGN_POST) || (b.getType() == Material.WALL_SIGN)) {
... | 4 |
public boolean isWrapperFor(Class<?> iface) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
} | 1 |
private static String getISBNFromTitle(BufferedReader reader, VideoStore videoStore, String title) throws
SQLException {
int choice;
LinkedList<Pair<String, String>> whereClauses = new LinkedList<Pair<String, String>>();
whereClauses.add(new Pair<String, String>("Title LIKE ?", '%' +... | 4 |
public static void main(String args[]) throws Exception
{
Socket socket = new Socket("127.0.0.1",6868);
//启动读写线程
new ClientInputThread(socket).start();
new ClientOutputThread(socket).start();
} | 0 |
private void markSubroutines() {
BitSet anyvisited = new BitSet();
// First walk the main subroutine and find all those instructions which
// can be reached without invoking any JSR at all
markSubroutineWalk(mainSubroutine, 0, anyvisited);
// Go through the head of each subrout... | 1 |
@Override
public int compareTo(PrioritizedTask o) {
//复写此方法进行任务执行优先级排序
// return priority < o.priority ? 1 :
// (priority > o.priority ? -1 : 0);
if(priority < o.priority)
{
return -1;
}else
{
if(priority > o.priority)
... | 2 |
public static void waitComment(String msg){
java.util.StringTokenizer st = new java.util.StringTokenizer(msg, " \t\n", true);
String sWrapped = "";
int lineLen = 0;
int crStop = 70;
while( st.hasMoreTokens() ){
String tok = st.nextToken();
if( lineLen == 0 && (tok.startsWith( " " ... | 6 |
@Override
public void setString( String s ) {
if( s.length() == 0 )
s = "[]";
else{
if( Character.isWhitespace( s.charAt( 0 ) ) || Character.isWhitespace( s.charAt( s.length()-1 ) )){
s = "[" + s + "]";
}
else if( s.charAt( 0 ) == '[' &... | 5 |
public String getCity() {
return City;
} | 0 |
public Player[] getWinners() {
int winner = -1;
Player players[] = this.players;
for(int i = 0; i < players.length && winner < 0; ++i) {
Player p = players[i];
if( p.equals( this.getBestPlayerBet() ) ) {
winner = i;
}
}
int winnerTeammate = 0;
int loser = 0;
int loserTeammate = 0;
if... | 8 |
public void addFamData(String entry, Family ind)
{
String delim = "[ ]+";
String[] tokens = entry.split(delim);
String tag = tokens[1];
int month = 1;
if(tag.equalsIgnoreCase("HUSB"))
{
ind.setHusb(tokens[2]);
}
else if(tag.equalsIgnoreCase("WIFE"))
{
ind.setWife(tokens[2]);
}
else if(ta... | 9 |
public void notifyUserListChanged() {
try {
for(String user : _userStore.keySet()) {
System.out.println("user: "+user);
_userStore.get(user).updateUserList(getBuddies(user));
}
} catch (RemoteException e) {
System.out.println("Error: " + e.getMessage());
}
} | 2 |
public static ArrayList<String> readFile (String path) {
try {
BufferedReader reader = new BufferedReader(new FileReader(new File(path)));
ArrayList<String> contents = new ArrayList<String>();
String data = "";
while((data = reader.readLine()) != null){
... | 2 |
public int getFormat() {
return format;
} | 0 |
public Tile[][] getNewWorld(int width, int height) {
MapGenerator g = new MapGenerator(seed);
int[][] mapData = g.generateWorld(width/10, height/10);
width = mapData.length * 10;
height = mapData[0].length * 10;
//Resets the spawn points.
this.resetSpawnPoints();
//Create grass everywhere.
Tile[][... | 8 |
public static boolean setDebugging(String debuggingString) {
if (debuggingString.length() == 0 || debuggingString.equals("help")) {
usageDebugging();
return false;
}
StringTokenizer st = new StringTokenizer(debuggingString, ",");
next_token: while (st.hasMoreTokens()) {
String token = st.nextToken().i... | 5 |
public char nextClean() throws JSONException {
for (;;) {
char c = this.next();
if (c == 0 || c > ' ') {
return c;
}
}
} | 3 |
@Test
@TestLink(externalId = "T1")
public void testSuccessExternal() {
assertTrue(true);
} | 0 |
public static void main(String[] args){
String str = "0123456789";
long w, sum = 0;
String temp = "";
while(true){
w = Long.parseLong(str);
//System.out.println(w);
if(Integer.parseInt(str.substring(1,4))%2==0){
if(Integer.parseInt(str.substring(2,5))%3==0){
if(Integer.parseInt(str.subs... | 9 |
private void addRoad(Tile temp, Point position)
{
MapObject obj = new Road(temp, sfap.objSize, this.TILE_SIZE, position);
if (Collision.noCollision(grid, obj.getStartPos(), obj.getEndPos()))
{
if (!Collision.intersects(obj.getPlace(), gridBoundary))
{
this.mapObjects.add(obj);
for (int index = 0; i... | 4 |
protected List<Integer> getAllPrimes() {
boolean[] sito = new boolean[MAX_X];
for (int i = 1; i < sito.length; i++) {
sito[i] = true;
}
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < sito.length; i++) {
if (sito[i]) {
int i1 = i + 1;
list.add(i1);
int x = 2;
in... | 4 |
protected BeardTemplateReferences extract(String tpl) {
BeardTemplateReferences result = new BeardTemplateReferences () ;
int len = tpl.length(), i;
String tag = null;
char character;
for (i = 0; i < len; i++) {
character = tpl.charAt(i);
if (tag != nul... | 6 |
private OccurrenceReport getTotalOccurencesOnPage(String editorText,
boolean isCaseSensitive, String searchingText, int currentSearchingPosition) {
int lastSearchingPosition = -1;
int cnt = 0;
OccurrenceReport report = new OccurrenceReport();
if (!isCaseSensitive) {
editorText = editorText.toLowerCase... | 4 |
public void testWithPeriodAfterStart3() throws Throwable {
Period per = new Period(0, 0, 0, 0, 0, 0, 0, -1);
Interval base = new Interval(TEST_TIME_NOW, TEST_TIME_NOW);
try {
base.withPeriodAfterStart(per);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
private List<Cubie> getFaceCubies(Face face) {
List<Cubie> cubes = null;
switch(face) {
case FRONT:
cubes = this.getFrontFaceCubes();
break;
case LEFT:
cubes = this.getLeftFaceCubes();
break;
case TOP:
cubes = this.getTopFaceCubes();
break;
case RIGHT:
cubes = this.getRightFa... | 6 |
protected void initDefaultCommand() {
// This command makes the shooter automatically time out if no command
// uses it for 5 seconds
CommandGroup timeout = new CommandGroup("Time out shooter");
timeout.addSequential(new DoNothing(),5);
timeout.addSequential(new SpinDown());
... | 0 |
private void checkCollision() {
Player p = null;
List<Minion> badguys = new ArrayList<Minion>();
for(Entry<Client, Entity> entry : clientEntityPairs){
Entity e = entry.getValue();
if(e instanceof Player){
p = (Player) e;
} else if (e instanceof Minion){
badguys.add((Minion) e);
}
}
for(... | 9 |
public boolean loadImage() {
try {
img = ImageIO.read(new File(filename));
}
catch (IOException e) {
img = null;
return false;
}
return true;
} | 1 |
public URL find(String classname) {
if(this.classname.equals(classname)) {
String cname = classname.replace('.', '/') + ".class";
try {
// return new File(cname).toURL();
return new URL("file:/ByteArrayClassPath/" + cname);
}
catch ... | 2 |
public final static void quietSleep(int milliSeconds) {
if (milliSeconds <= 0) {
return;
}
if (Config.getDebug()) {
int min = Math.round(milliSeconds / 60000);
int sec = Math.round((milliSeconds / 1000) % 60);
Output.println("Sleep for " + min + ":" + sec + " (" + milliSeconds
+ ")", Output.DEB... | 3 |
@SuppressWarnings("unchecked")
String getStringValue(Object obj, int k) {
if ((obj instanceof ArgHolder<?>)
&& ((ArgHolder<?>) obj).getType().equals(String.class)) {
return ((ArgHolder<String>) obj).getValue();
} else if (obj instanceof String[]) {
return ((String[]) obj)[k];
} else {
... | 5 |
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals(ok.getActionCommand())){
try {
String selectedType = (String) typeOfEdges.getSelectedItem();
Configuration.setEdgeType(selectedType);
String selectedTransModel = (String) selectedTransmissionModel.getSelectedItem();
if... | 8 |
@Override
public void draw(Graphics g) {
g.setColor(Color.BLACK);
g.fillRect(0, 0, width, height);
g.setColor(new Color(50, 50, 50));
g.drawLine(100, 100, 400, 100);
g.drawLine(100, 250, 400, 250);
g.drawLine(100, 400, 400, 400);
for (int x = 0; x < 300; x++) {... | 7 |
public void startServer() {
while(!shutdown) {
try {
clientSocket = new SocketManager(serverS.accept());
if(serviceList.size() < userLimit) {
Service service = new Service(clientSocket, ip);
serviceList.add(service);
new Thread(service).start();
} else {
clientSocket.Escribir("599 E... | 4 |
public void keyPressed(KeyEvent key){
switch (key.getKeyCode()){
case KeyEvent.VK_UP:
player.moveY(-1);
break;
case KeyEvent.VK_LEFT:
player.moveX(-1);
break;
case KeyEvent.VK_RIGHT:
player.moveX(1);
break;
case KeyEvent.VK_DOWN:
player.moveY(1);
break;
case KeyEvent.VK_E:
coll... | 6 |
@Override
public void valueChanged(ListSelectionEvent e) {
// TODO Auto-generated method stub
} | 0 |
public FileSender(int packageSize, String destinationIpAddress,
String fileName, int destinationPort, int verbose) {
this.packageSize = packageSize;
this.destinationIpAddress = destinationIpAddress;
this.fileName = fileName;
this.destinationPort = destinationPort;
this.verbose = verbose;
} | 0 |
@SuppressWarnings("rawtypes")
protected boolean isEnum(Class clazz, Object obj) {
if (!clazz.isEnum()) {
return false;
}
for (Object constant : clazz.getEnumConstants()) {
if (constant.equals(obj)) {
return true;
}
}
return ... | 3 |
public void circle(double x, double y, double r) {
if (r < 0) throw new RuntimeException("circle radius can't be negative");
double xs = scaleX(x);
double ys = scaleY(y);
double ws = factorX(2*r);
double hs = factorY(2*r);
if (ws <= 1 && hs <= 1) pixel(x, y);
else... | 3 |
@Test
public void MultiNOTTest() {
int num_bits = 4;
Node reg = new MultiNOT(num_bits);
ConstantNode in[] = new ConstantNode[num_bits];
for (int i = 0; i < num_bits; i++) {
in[i] = new ConstantNode(true);
in[i].connectDst(0, reg, i);
}
for (int i = 0; i < num_bits; i++) {
in[i].propagate();
}... | 9 |
private void go (Checker checker) {
if (dontScan) {
return;
}
if (init(checker)) {
if (checker != null) {
checker.enqueueNotify(25, null);
}
if (findBeans((checker))) {
if (checker != null) {
chec... | 7 |
private byte[] readASCII(byte[] data, int start, int end) {
// each byte of output is derived from one character (two bytes) of
// input
byte[] o = new byte[(end - start) / 2];
int count = 0;
int bit = 0;
for (int loc = start; loc < end; loc++) {
char c = (c... | 8 |
@Override
public boolean remove(Object o)
{
if (o != null) {
int i = index(o.hashCode());
synchronized (table[i]) {
Node<E> p = table[i], n = p.next;
while (n != null) {
if (n.element == o || n.element.equals(o)) {
p.next = n.next;
return true;
}
p = n;
n = n.next;
... | 4 |
private String getHtmlForAction(WikiContext context, String action, String title)
throws ChildContainerException, IOException {
if (action.equals("view") || // editable
action.equals("viewparent") || // view parent version read only
action.equals("viewrebase")) { // view r... | 8 |
public void writeMatchObjectSimple(MatchObject NEW) throws FileNotFoundException {
// Create a new TeamLabelObject and add the elements to it.
matchReader read = new matchReader();
ArrayList<MatchObject> NAME;
try {
NAME = (ArrayList<MatchObject>)read.readMa... | 3 |
public PowerUp(int type, double x, double y){
this. type = type;
this.x = x;
this.y = y;
if(type == 1){
color1 = Color.PINK;
r =3;
}
if(type == 2){
color1 = Color.YELLOW;
r =3;
}
if(type == 3){
color1 = Color.YELLOW;
r =5;
}
if(type == 4){
color1 = Color.WHITE;
r =3;
}
... | 4 |
private void throwExceptionIfNodeDoesntBelongToTree(Object node) {
boolean result = false;
if (node instanceof GenericTreeNode) {
GenericTreeNode<? extends PropertyChangeSupporter> ttn = (GenericTreeNode<? extends PropertyChangeSupporter>) node;
while (!result && ttn != null) {... | 6 |
public static void main(String[] args) {
int x = 1;
x += 1;
System.out.println(x); // 2
x *= 2;
System.out.println(x); // 4
x -= 3;
System.out.println(x); // 1
x /= 4;
System.out.println(x); // 0
float y = 1f;
y += 1;
System.out.println(y); // 2.0
y *= 2;
System.out.println(y); // 4.0
y -= 3;
System.o... | 0 |
private Set<Integer> findGivenValueInRow(int value, int startPoint, int numberOfFinds) {
Set<Integer> valueLocations = new HashSet<Integer>();
int foundNumber = 0;
int element = (this.getSize() * this.getSize());
if (startPoint < element) {
//startPoint--;
} else {
startPoint--;
}... | 9 |
public void run(){
try{
boolean done = false;
while(!done){
done = true;
for(int y = 0 ; y < 9; y++){
System.out.println("");
for(int x = 0; x < 9; x++){
String value = this.field[y][x].toStr... | 5 |
@Test
public void test_isGameOver() {
assertNotNull(game);
assertEquals(false, game.isGameOver());
} | 0 |
public static StopPlaceTypeEnumeration fromValue(String v) {
for (StopPlaceTypeEnumeration c: StopPlaceTypeEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} | 2 |
@Column(name = "FES_ID_POS")
@Id
public Integer getFesIdPos() {
return fesIdPos;
} | 0 |
public boolean getBoolean(int index) throws JSONException {
Object o = get(index);
if (o.equals(Boolean.FALSE) ||
(o instanceof String &&
((String) o).equalsIgnoreCase("false"))) {
return false;
} else if (o.equals(Boolean.TRUE) ||
... | 6 |
public static void main(String[] args) {
ArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>();
lists.add(new ArrayList<Integer>());
lists.add(new ArrayList<Integer>());
setReader();
int row = 1;
ArrayList<Integer> newList = lists.get(row%2);
ArrayList<Integer> oldList = lists.get... | 4 |
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(this != Block.stairSingle) {
super.onBlockAdded(var1, var2, var3, var4);
}
int var5 = var1.getBlockId(var2, var3 - 1, var4);
int var6 = var1.getBlockMetadata(var2, var3, var4);
int var7 = var1.getBlockMetadat... | 3 |
public double[] backpropogate(double[] protosigma){
if (protosigma.length != neurons.size()){
throw new RuntimeException("Neurons size does not match!");
}
for (int i = 0; i < protosigma.length; i++){
neurons.get(i).backpropogate(protosigma[i]);
}
double[] result = new double[entryPoints.size()];
fo... | 3 |
@Before
public void setUp(){
for(int i = 0; i < 20; i++){
if(i % 2 == 0){
solutionFitness.put(i, (double)i * 2);
}else{
solutionFitness.put(i, (double) i);
}
}
classUnderTest.setSolutionFitness(solutionFitness);
} | 2 |
SpecialistWorkType getSpecialistWorkType(){
double t = nextRand();
if ( t < 0.8 )
return SpecialistWorkType.PRESCRIBE;
else
return SpecialistWorkType.HOSPITALIZE;
} | 1 |
public static boolean markAsExplicitAssertionP(Justification self) {
if (((Keyword)(Logic.$EXPLANATION_STYLE$.get())) == Logic.KWD_BRIEF) {
if (self.inferenceRule == Logic.KWD_PRIMITIVE_STRATEGY) {
{ Keyword testValue000 = ((PrimitiveStrategy)(self)).strategy;
if ((testValue000 == Logic.KWD... | 6 |
private String createId(ArrayList<Rod> currentRodList, ArrayList<Rod> possibilitiesLeft) {
StringBuilder id = new StringBuilder();
for(Rod rod : currentRodList) {
id.append(rod.getIndex());
}
id.append(":");
for(Rod rod : possibilitiesLeft) {
id.append(rod.getIndex());
}
return id.toString();
} | 2 |
public List<Key> getSecretKeys()
{
try
{
Pattern keyIDPattern = Pattern.compile("sec\\s+\\w+/(\\w+)\\s+.*");
Pattern uidPattern = Pattern.compile("uid\\s+(\\S+[^<>]*\\S+)\\s+<([^<>]*)>.*");
List<Key> ret = new LinkedList<>();
List<String> list = new LinkedList<String>();
list.add("--list-secret-ke... | 9 |
@Test
public void testGetS2() {
System.out.println("getS2");
PickUp instance = new PickUp(6,9);
int expResult = 9;
int result = instance.getS2();
assertEquals(expResult, result);
} | 0 |
public void doFlat() {
switch (ai.getDirection()) {
case LEFT:
setAnimation(new String[]{"goombaFlatLeft"});
break;
case RIGHT:
setAnimation(new String[]{"goombaFlatRight"});
break;
}
setDead(true);
} | 2 |
public void saveProperties() {
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(this.file);
this.properties.store(outputStream, "MaintenanceServer Properties");
} catch (IOException e) {
MaintenanceServer.LOGGER.warning("Failed ... | 3 |
private Matrix4f GetParentMatrix()
{
if(m_parent != null && m_parent.HasChanged())
m_parentMatrix = m_parent.GetTransformation();
return m_parentMatrix;
} | 2 |
public static void main(String[] args) {
final int n = 9;
System.out.print("*| ");
for (int i = 1; i <= 9; i++){
System.out.print(i+" ");
}
System.out.print("\n-+-");
for (int i = 1; i <= 9; i++){
System.out.print("--");
}
for (int i = 1; i <= n; i++){
System.out.print("\n"+i+"|");
for (int ... | 4 |
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
JFileChooser fichero = new JFileChooser();
int opcion = fichero.showOpenDialog(this);
if(opcion == JFileChooser.APPROVE_OPTION)
{
this.jTextField3.setText(fichero.g... | 1 |
public Map<String, Long> getCounterMap() {
return counterMap;
} | 6 |
@Override
public void paintBorder(Component component, Graphics gc, int x, int y, int width, int height) {
Color color = gc.getColor();
if (mLeftThickness > 0) {
gc.setColor(mLeftColor);
gc.fillRect(x, y, mLeftThickness, height);
}
if (mRightThickness > 0) {
gc.setColor(mRightColor);
gc.fillRect(x ... | 4 |
public void testRoot3() {
setTree(new TreeNode("dummy"));
Map refcounts = Collections.synchronizedMap(new HashMap());
refcounts.put(new TreeNode("leaf1"), new Integer(1));
refcounts.put(new TreeNode("root1"), new Integer(0));
refcounts.put(new TreeNode("leaf2"), new Integer(1));
... | 7 |
public static double gammaMode(double mu, double beta, double gamma) {
if (beta <= 0.0D) throw new IllegalArgumentException("The scale parameter, " + beta + "must be greater than zero");
if (gamma <= 0.0D) throw new IllegalArgumentException("The shape parameter, " + gamma + "must be greater than zero");
double mo... | 3 |
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_UP) { //Presiono flecha arriba 1
direccion = 1;
buenoMov = true;
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) { //Presiono flecha abajo 2
direccion = 2;
buenoMov = true;
} els... | 4 |
private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteBtnActionPerformed
try {
connectDb();
int selectedRow = questionTable.getSelectedRow();
rowID = (questionTable.getModel().getValueAt(selectedRow, 1).toString());
int e... | 4 |
private void substracTrackButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_substracTrackButtonMouseClicked
// TODO add your handling code here: Resta una pista del calendario.
//Habilita o deshabilita el boton substract(<<)si el calendario esta vacio.
if (substracTrackButton.... | 2 |
public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[15];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 4; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if... | 8 |
@Test
public void unEnrollsStudentToActivity() {
Student s = null;
Activity a = null;
try {
s = familyService.findStudent(1);
a = activityService.find(1);
} catch (InstanceNotFoundException e) {
fail("Activity not exists");
}
activityService.enrollmentStudentInActivity(s, a);
activityService.un... | 1 |
private void createMinimap() {
Graphics2D mapGraphics = null;
int mapWidth = (map.getWidth() * map.getTileWidth());
int mapHeight = (map.getHeight() * map.getTileHeight());
minimap = new BufferedImage(mapWidth, mapHeight, BufferedImage.TYPE_INT_ARGB);
mapGraphics = (Graphics2D) ... | 4 |
public boolean suspend(User toSuspend, Date until){
if(isSuspended(toSuspend)) return false;
Suspended sus = new Suspended(toSuspend, until);
this.suspendedUsers.add(sus);
save();
return true;
} | 1 |
private void fillTransitions() {
transitions = new int[template.getAnswerGroups().size()];
for (int i = 0; i < template.getAnswerGroups().size(); i++) {
AnswerGroup answerGroup = template.getAnswerGroups().get(i);
int j = i + 1;
if (j >= template.getAnswerGroups().s... | 7 |
public static void removeSelected() {
if (Main.selectedId != -1 && !Main.getSelected().locked) {
RSInterface rsi = Main.getInterface();
if (rsi.children != null) {
int index = getSelectedIndex();
rsi.children.remove(index);
rsi.childX.remove(index);
rsi.childY.remove(index);
}
UserInterfac... | 3 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... | 7 |
public UserlistPreview(SkinPropertiesVO skin, JPanel parent) {
if ((skin == null) || (parent == null)) {
IllegalArgumentException iae = new IllegalArgumentException("Wrong parameter!");
throw iae;
}
this.skin = skin;
this.parent = parent;
} | 2 |
public void handleSlider(JSlider source){
if(source.getValueIsAdjusting()){
int delay = source.getValue();
if(delay > 0){
aTimer.setDelay(100*(11-delay));
if(aTimer.isRunning()){
aTimer.restart();
}
}
... | 3 |
public LRParseTableDerivationPane(GrammarEnvironment environment) {
super(new BorderLayout());
Grammar g = environment.getGrammar();
augmentedGrammar = Operations.getAugmentedGrammar(g);
if(augmentedGrammar == null) return;
JPanel right = new JPanel(new BorderLayout());
// right.setLayout(new BoxLayo... | 2 |
private boolean isOverridden(ProgramElementDoc pgmdoc, String level) {
Map<?,String> memberLevelMap = (Map<?,String>) memberNameMap.get(getMemberKey(pgmdoc));
if (memberLevelMap == null)
return false;
String mappedlevel = null;
Iterator<String> iterator = ... | 7 |
@Override
public int myResource()
{
if(lastResourceTime!=0)
{
if(lastResourceTime<(System.currentTimeMillis()-(30*TimeManager.MILI_MINUTE)))
setResource(-1);
}
if(myResource<0)
{
if(resourceChoices()==null)
setResource(-1);
else
{
int totalChance=0;
for(int i=0;i<resourceChoices(... | 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 void setTipoInteres(float tipoInteres) {
if (tipoInteres > 100
|| tipoInteres < 0) {
return;
}
this.tipoInteres = tipoInteres;
} | 2 |
public String annaSeuraava(){
if (tila == KertausmaatinTila.TYHJA){
arvoSeuraavaKerrattavaRivi();
}
return kertaaTama(moneskoRivi);
} | 1 |
public void map_click_ntf(int x, int y, int btn, int mod) {
Gob pgob;
synchronized (glob.oc) {
pgob = glob.oc.getgob(playergob);
}
if (pgob == null)
return;
Coord mc = pgob.position();
Coord offset = new Coord(x, y).mul(tileSize);
mc = mc.add(offset);
wdgmsg("click", JSBotUtils.getCenterScreenCoor... | 1 |
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.