text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static boolean discoverMissingValues(ArrayList<LearningObject> learningSet, ArrayList<Attribute> attributes, ArrayList<ClassCategory> classes){
//apply algorithm if and only in only one attribute has missing values in learning set
//let the class become ordinary attribute
//new classes from attribute... | 7 |
private static boolean onlyDigits(String s) {
if (s == null || s.length() == 0) {
return false;
}
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c < '0' || c > '9') {
return false;
}
}
return true;
... | 5 |
public static byte[] gzip(String input) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream gzos = null;
try {
gzos = new GZIPOutputStream(baos);
gzos.write(input.getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace();
... | 3 |
public void uimsg(String msg, Object... args) {
if(msg == "p") {
text = Text.renderf(FlowerMenu.pink, "%d%%", (Integer)args[0]);
} else {
super.uimsg(msg, args);
}
} | 1 |
public void writeTwoBools(boolean[] tree, boolean[] message) throws IOException {
LinkedList<Boolean> boolList = new LinkedList<Boolean>();
for(boolean b : tree)
boolList.add(b);
for(boolean b : message)
boolList.add(b);
ArrayList<Byte> byteBuffer = new ArrayList<Byte>();
int length = tree.length +... | 8 |
public void mousePressed() {
Marker hitMarker = map.getFirstHitMarker(mouseX, mouseY);
if (hitMarker != null) {
pointedState = hitMarker.getProperties().get("NAME").toString();
for (int i = 0; i < climateArray.length; i++) {
if (hitMarker.getProperties().get("NAME").toString()
.equalsIgnoreCase(cl... | 5 |
public static void main(String[] args)
{
if (args.length == 1)
{
try
{
chargenTCP(args[0]);
}
catch (IOException e)
{
e.printStackTrace();
System.exit(1);
}
}
else... | 5 |
@Override
public Authentication attemptAuthentication(HttpServletRequest request,
HttpServletResponse response) throws AuthenticationException {
if (postOnly && !request.getMethod().equals("POST")) {
throw new AuthenticationServiceException("Authentication method not supported: " + re... | 6 |
public void go()
{
do
{
play();
} while(check());
turnInfo();
gameInfo();
} | 1 |
private static Class getClassMatchingAllChildren(OgnlContext context, Node[] _children) {
Class[] cc = getChildrenClasses(context, _children);
Class componentType = null;
for (int j = 0; j < cc.length; j++) {
Class ic = cc[j];
if (ic == null) {
componentTy... | 9 |
@Override
public void unInvoke()
{
if(canBeUninvoked())
{
if(affected instanceof MOB)
{
final MOB mob=(MOB)affected;
if((buildingI!=null)&&(!aborted))
{
amountMaking=amountMaking*(baseYield()+abilityCode());
if(messedUp)
commonEmote(mob,L("<S-NAME> ruin(s) @x1!",buildingI.name())... | 7 |
@EventHandler
public void EnderDragonHarm(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("EnderDr... | 6 |
public void addEffectsToGrid(List<Effect> effects) {
if (effects == null)
throw new IllegalArgumentException("Effects can't be null!");
for (Effect effect : effects) {
addEffectToGrid(effect);
}
} | 2 |
public void testGet() {
MonthDay test = new MonthDay();
assertEquals(6, test.get(DateTimeFieldType.monthOfYear()));
assertEquals(9, test.get(DateTimeFieldType.dayOfMonth()));
try {
test.get(null);
fail();
} catch (IllegalArgumentException ex) {}
tr... | 2 |
public double[][] Dmxm(double a[][], double b[][]) {
double w;
double c[][] = new double[3][3];
TRACE("Dmxm");
/* Multiply into scratch matrix */
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
w = 0.0;
for (int k = 0; k < ... | 3 |
public void getBytes(int len, int off, byte buf[]) { // readBytes
for (int i = off; i < off + len; i++) {
buf[i] = payload[offset++];
}
} | 1 |
public static void main(String[] args) {
if(args.length != 2) {
System.err.println("Syntax: RemoteControl <target IP> <command>");
System.exit(1);
}
String ip = args[0];
String cmd = args[1];
checkIP(ip);
// Send the command to the other s... | 9 |
public String stSendEmailWithCaptcha(int dataId,int ExpVal,String flow )
{
int actVal=1000;
String returnVal=null;
hm.clear();
hm=STFunctionLibrary.stMakeData(dataId, "Email");
String action = hm.get("Action");
STCommonLibrary comLib=new STCommonLibrary();
Vector<String> xPath=new Vec... | 9 |
public String getFromDate() {
return fromDate;
} | 0 |
public void download() {
// This is the core web/download i/o code...
InputStream input = null;
StringBuilder contents = null;
try {
URL url = new URL(urlString);
URLConnection connection = url.openConnection();
// Set connect() to throw an IOException
// if connection does not succeed in this m... | 6 |
@Override
public String execute() {
if (databaseContext.table == null) {
return "no table";
}
try {
Storeable storeable = ((DataBase) databaseContext.table).putStoreable(arguments.get(1), jsonStr);
if (storeable == null) {
return "new";
... | 3 |
@Override
public void initializeEdge() {
// TODO Auto-generated method stub
super.initializeEdge();
double dist = startNode.getPosition().distanceTo(endNode.getPosition());
//System.out.println("Distancia na edge: "+dist);
if(dist < 399){
setParam(0.001f, 0.24f, 11.f);
return;
}
if(dist >= 399 &... | 7 |
public static Texture2D load2DTexture(URI uri) {
BufferedInputStream bis = null;
ByteBuffer texCoords = null;
try {
File file = new File(uri);
//Idiot checking
if(!file.exists() || !file.isFile()) {
System.err.println("File doesn't exist or was not a File, aborting!");
return null;
}
... | 3 |
public static void shop(Character character, Scanner console) throws FileNotFoundException {
System.out.println();
character.getInventoryManager().printInventory(); //////////
System.out.println("Welcome to the shop. Feel free to browse.");
System.out.print("Would you like to buy, sell, or exit? ");
Scanner n... | 9 |
public void windowClosed(WindowEvent e) {
System.out.println("Die Anwendung wurde geschlossen...");
} | 0 |
public static void main(String[] args) {
ArrayList<Card> cardsAvalible = addCards();
ArrayList<Card> randDeck;
double trials = 500;
double avgTurns;
double bestAvgTurns = 20;
while(true){
Deck d1 = new Deck();
d1.randomDeck((ArrayList<Card>) cardsAvalible.clone());
randDeck = d1.getCard... | 3 |
protected void writeData(XMLStreamWriter writer, Grid<?> s) throws XMLStreamException {
writer.writeStartDocument();
writer.writeStartElement("VTKFile");
writer.writeAttribute("type", "ImageData");
writer.writeStartElement("ImageData");
writer.writeAttribute("WholeExtent", "0 " + (s.getRange(0)) + " 0 " + (s.... | 9 |
public Measurement[] getModelMeasurements() {
List<Measurement> measurementList = new LinkedList<Measurement>();
measurementList.add(new Measurement("model training instances",
trainingWeightSeenByModel()));
measurementList.add(new Measurement("model serialized size (bytes)",
... | 7 |
private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
Editor e = new Editor();
if (!(txCodigo.getText().equals("")) || (txCodigo.getText().equals(null))){
e.setId_editor(Integer.parseInt(txCodigo.getText()));
}
... | 7 |
public String command(final CommandSender sender, Command command, String[] args) {
sender.sendMessage(Formatting.replaceAmpersand(plugin.getString(Language.IMPORT_LOADING)));
try {
BufferedReader banlist = new BufferedReader(new FileReader("banned-players.txt"));
String p;
... | 8 |
public void disable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (!isOptOut()) {
configuration.set("opt-out"... | 2 |
public static List<Class<?>> processJarfile(String jarPath) {
List<Class<?>> classes = new ArrayList<Class<?>>();
JarFile jarFile;
try {
jarFile = new JarFile(jarPath);
// get contents of jar file and iterate through them
Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreE... | 9 |
private double[] calculateSocialVelocity(int particle, double r2) {
double[] socialVelocity = new double[position[particle].length];
int nBest = neighbourhood.neighbourhoodBest(particle);
for(int k = 0; k < socialVelocity.length; k++){
socialVelocity[k] = socialConstant * r2 * (personalBest[nBest][k] - positio... | 1 |
private void timeMove(double voltage, double seconds) {
long milis = (long)(seconds * 1000);
long time = System.currentTimeMillis();
while (System.currentTimeMillis() < time + milis) {
drive.GoForward(voltage);
if (System.currentTimeMillis() - time > 10)
try {
Thread.sleep(10);... | 3 |
public void setPrpEstado(String prpEstado) {
this.prpEstado = prpEstado;
} | 0 |
public static void main(String[] args) {
try {
if (args.length > 0) {
List<HashMap> responses = GoEuroClient.getInfo(args[0]);
String csvFileName = "output.csv";
if (args.length > 1)
csvFileName = args[1];
System.ou... | 3 |
public void render(Vector2 pos, Vector2 dim)
{
switch(renderType)
{
case SOLID:
Renderer.drawRect(pos, dim, color, alpha);
break;
case TEX:
if(tex != null)
{
if(tex.isLinearScaling() != linearScaling)
tex.setLinearScaling(linearScaling);
if(tex.isRepeat() != repeat)
tex.setRepeat(... | 9 |
public void blinkparticle() {
if (untouchable > 0) {
if (blink > 15 && blink <= 30) {
setImage(invin);
}
else if (blink >= 0 && blink <= 15) {
setImage(empty);
}
}
else if (untouchable == 0) {
getWorld()... | 6 |
public void makeflavor() {
fo.clear();
Coord c = new Coord(0, 0);
Coord tc = gc.mul(cmaps);
for (c.y = 0; c.y < cmaps.x; c.y++) {
for (c.x = 0; c.x < cmaps.y; c.x++) {
Tileset set = sets[tiles[c.x][c.y]];
if (set.fla... | 5 |
public Osoba getOsoba(int index) {
return data.get(index);
} | 0 |
public <T> Collection<T> filter(Collection<T> collection, Predicate<T> predicate){
ArrayList<T> temp = new ArrayList<T>();
for(T t : collection){
if(predicate.evaluate(t)){
temp.add(t);
}
}
return temp;
} | 2 |
private void startMatrix() {
if (!timer1.isRunning()) {
timer1.start();
timer2.start();
}
} | 1 |
private static void printIt2(ParseResult<Token, DataBlock> v6) {
if(!v6.isSuccess()) {
print("oh noes, parsing failed: ");
print("tokens left: " + v6.getRestTokens().size());
LList<Token> toks = v6.getRestTokens();
int i = 0;
for(Token t : toks) {
if(i > 20) break;
print(t.type + ", " + t.value... | 3 |
@Override
public void fetch() {
Thread fetcher = new FetcherThread();
fetcher.start();
} | 0 |
private static <T> T[] toObjectArray(Object array) {
if (!array.getClass().getComponentType().isPrimitive())
return (T[]) array;
int length = Array.getLength(array);
Object[] ret = new Object[length];
for(int i = 0; i < length; i++)
ret[i] = Array.get(array, i);
... | 2 |
public static String getWebClassesPath() {
String path = WebUtils.class.getProtectionDomain().getCodeSource()
.getLocation().getPath();
return path;
} | 0 |
public boolean keyExists(String key) {
try {
return (this.containsKey(key)) ? true : false;
} catch (Exception ex) {
return false;
}
} | 2 |
public static double runATrial(int patientIDToLeaveOut) throws Exception
{
BufferedReader reader = new BufferedReader(new FileReader(new File(ConfigReader.getChinaDir()
+ File.separator + "phylum_taxaAsColumnsLogNorm_WithMetadataNonRare.txt")));
reader.readLine();
File outFile = new File(ConfigReader... | 6 |
public synchronized UUID bind( InetAddress address,
int port,
//Map<String,BasicType> bindSettings
Environment<String,BasicType> bindSettings
)
throws IOException,
GeneralSecurityException {
if( bindSettings.get(Constants.CONFIG_SERVER_PROTOCOL) == null )
bindSettings.put( ... | 4 |
@Override
public FileHandle openFile(String path, boolean read, boolean write)
throws PathNotFoundException, AccessDeniedException, NotAFileException {
File open = getFile(path);
if (!open.exists())
throw new PathNotFoundException(path);
if (!open.isFile())
throw new NotAFileException();
if (write ... | 6 |
@Override
public void paint(Graphics g) {
super.paint(g);
player.draw(g);
Font font = new Font("Courier New", Font.PLAIN, 32);
g.setFont(font);
g.setColor(Color.WHITE);
Graphics2D g2d = (Graphics2D) g;
FontRenderContext frc = g2d.getFontRenderContext();
... | 8 |
public ProtocolSignUp(String username, int port) {
mUserName = username;
mPort = port;
} | 0 |
public static void start() throws Exception {
_poolManger = ServiceManager.getServices().getRequiredService(
ITicketPoolManager.class);
// 在disruptor启动之前打开日志
openJournal();
startDisruptor();
} | 0 |
private Object getAdditionParameterInfo(byte type, String additionalInfo) {
Object returnValue = additionalInfo;
if(type==Query.CONSECUTIVE_MONTH) {
try {
returnValue = Integer.parseInt(additionalInfo);
} catch(NumberFormatException e) {
System.err.println("Illegal parameter for ConsecutiveMonth: " + ... | 8 |
public void combine(String IP_PORT,String apiKey){
DBService dbService = new DBService();
HashMap data = null;
if(this.link.contains("tiaoshi")){
PageTiaoshi pageTiaoshi = new PageTiaoshi();
data = pageTiaoshi.getInfo(this.link);
}
FileService fileService ... | 7 |
public void revive(){
if(this.estaDestruido()){
setDestruido(false);
}
} | 1 |
public void removeDisciplina(String codigo)
throws DisciplinaInexistenteException {
boolean teste = false;
for (Disciplina e : disciplina) {
if (e.getCodigo().equals(codigo)) {
disciplina.remove(e);
teste = true;
break;
}
}
if (teste == false) {
throw new DisciplinaInexistenteException("... | 3 |
public void updateUI(String tableName)
{
if (model != null)
{
table.setName(tableName);
System.out.println("------- TablePanel UpDate Initiated ---------");
/* get the data from the database and load it into the table model */
/* when data is loaded into the data model... | 7 |
public void renderPlayer (int xp, int yp, Sprite sprite) {
xp -= xOffset;
yp -= yOffset;
for (int y = 0; y < 16; y++) {
int ya = y + yp;
for (int x = 0; x < 16; x++) {
int xa = x + xp;
if (xa < -16 || xa >= width || ya < 0 || ya >= height) break;
if (xa < 0) xa = 0;
int... | 8 |
@Override
public Rectangle getCellRect(int row, int column, final boolean includeSpacing) {
final Rectangle sRect = super.getCellRect(row, column, includeSpacing);
if ((row < 0) || (column < 0) || (getRowCount() <= row)
|| (getColumnCount() <= column)) {
return sRect;
}
final CellSpan cellAtt = (CellSp... | 9 |
public boolean isSubtype(ConcreteType that) {
if (rawType.desc.equals(RawType.coreBottom))
return true;
SuperType[] myGenericArgsForThat = rawType.superGenerics.get(that.rawType);
if (myGenericArgsForThat == null)
return false; // the raw types don't even fit
//... | 9 |
public Item getSpecificItem(Quality q, String name){
ArrayList<ItemInfo> list = null;
if (q == Quality.COMMON){
list = ipx.getListOf(Quality.COMMON);
}
else if (q == Quality.UNCOMMON){
list = ipx.getListOf(Quality.UNCOMMON);
}
else if (q == Quality.RARE){
list = ipx.getListOf(Quality.RARE)... | 7 |
public static void main(String[] args) {
final int value = 1000;
Map<Integer, String> firstDigit = new HashMap(10);
firstDigit.put(0,"");
firstDigit.put(1,"one");
firstDigit.put(2,"two");
firstDigit.put(3,"three");
firstDigit.put(4,"four");
firstDigit.put(... | 7 |
@Override
public void run(final String... args) {
final CommandLine line = parseArguments(args);
final String destinationFolder = line.getOptionValue(FOLDER_SHORT, System.getProperty("user.dir"));
// FIXME: Have some way to add Mp3Metadata for individual songs/artists
if (line.hasOption(SONG_SHORT)) {
for ... | 6 |
protected boolean canChange(int value){
Controller c = gui.getController();
if (centerCause(c.getX1(), c.getX2(), value, c.getY2(), c.getR1(), c.getR2())){
return true;
}
else{
showCenterWarning();
return false;
}
} | 1 |
public void start()
{
synchronized (optOutLock)
{
// Did we opt out?
if (isOptOut())
{
return;
}
// Begin hitting the server with glorious data
taskId = plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable()
{
private boolean firstPost = true;
public ... | 4 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
FrameLogo frame = new FrameLogo();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
try {
Clip sonido = AudioSystem.getClip();
File a = new ... | 5 |
public Emage buildEmage(Timestamp lastEmageCreationTime, long windowSizeMS) {
filterPointQueueByWindow(windowSizeMS);
this.pointQueue.addAll(this.pointStream.getAndClearNewPointsQueue());
Iterator<STTPoint> pointIterator = this.pointQueue.iterator();
GeoParams geoParams = this.pointStream.getGeoPar... | 8 |
@Override
public void run() {//Is called only once with thread.start()
long beforeTime, timeDiff, sleep;
beforeTime = System.currentTimeMillis();
while(inGame){
repaint();
try {
checkCollision();
} catch (Exc... | 4 |
public static DaysOfWeekEnumerationx fromValue(DayTypeEnumeration v) {
for (DaysOfWeekEnumerationx c: DaysOfWeekEnumerationx.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v.toString());
} | 2 |
public void run()
{
// システム情報取得
String str = System.getProperty("os.name");
mOSName = str;
str = System.getProperty("os.arch");
mOSArch = str;
str = System.getProperty("os.version");
mOSVersion = str;
str = System.getProperty("user.name");
mUserName = str;
DebugLog("user name:" + str);
DebugLo... | 9 |
public static SettingsWindow getInstance() {
if (instance == null)
instance = new SettingsWindow();
return instance;
} | 1 |
private void calculateMinesTouched(int coordX, int coordY) {
if (cellArray[coordX][coordY].type != Cell.CellType.MINE) {
int startingValueX = -1;
int startingValueY = -1;
int endingValueX = 1;
int endingValueY = 1;
int nbOfMinesTouched = 0;
if (coordX == 0) {
startingValueX = 0;
} else if (... | 8 |
private void configureComponents()
{
minimumSize = new Dimension(100, 60);
preferredSize = new Dimension(200, 60);
maximumSize = new Dimension(3000, 60);
notesButton = new JButton("");
notesButton.setIcon(new ImageIcon("images/Notes.jpg"));
notesButton.setToolTipText("Click this ... | 7 |
public Transferencia(Cuenta destino, String concept, float importe){
super(concept, importe);
this.tipo = "transferencia";
this.destino = destino;
} | 0 |
public boolean loadLastLevel(Component parentComponent, boolean selectMode) {
String str = editorSettings.getLastLevelFileName();
if(!selectMode && (str == null || str.trim().length() == 0)){
return false;
}
if(str == null || str.trim().length() == 0){
return loadLevel(parentComponent);
}
File select... | 9 |
private void populate()
{
Random rand = Randomizer.getRandom();
field.clear();
int Number_of_foxes = 0;
int Number_of_rabbits = 0;
int Number_of_korenwolfs = 0;
for(int row = 0; row < field.getDepth(); row++) {
for(int col = 0; col < field.getWidth(); col+... | 7 |
public ArrayList<MatchScheduling> scheduleSemiFinals() throws SQLException
{
ArrayList<MatchScheduling> matches = new ArrayList();
ArrayList<Team> s1Teams = new ArrayList();
ArrayList<Team> s2Teams = new ArrayList();
for (int k = 0; k <= 1; k++)
{
int homeTea... | 5 |
void compress(int init_bits, OutputStream outs) throws IOException {
int fcode;
int i /* = 0 */;
int c;
int ent;
int disp;
int hsize_reg;
int hshift;
// Set up the globals: g_init_bits - initial number of bits
g_init_bits = init_bits;
// Set up the necessary values
clear_flg = false;
n_bits =... | 9 |
final public ASTProgram Start() throws ParseException {
/*@bgen(jjtree) Program */
ASTProgram jjtn000 = new ASTProgram(JJTPROGRAM);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
Expression();
jj_consume_token(0);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
... | 9 |
public PartC getPartC() {
return partC;
} | 0 |
public ArrayList<Prestamos> getById(Prestamos p){
PreparedStatement ps;
ArrayList<Prestamos> rows = new ArrayList<>();
try {
ps = mycon.prepareStatement("SELECT * FROM Prestamos WHERE id=?");
ps.setInt(1, p.getId());
ResultSet rs = ps.executeQuery();
... | 4 |
public boolean checkState() throws Exception
{
boolean result = false;
this.input = new FileInputStream(this.device.getAbsolutePath());
this.output = new FileOutputStream(this.device.getAbsolutePath());
this.output.flush();
Thread.sleep(this.MAX_INTERVAL * 3);
Sys... | 4 |
public static DatabaseTestHelper getInstance(){
if(instance == null){
instance = new DatabaseTestHelper();
}
return instance;
} | 1 |
@Override
public NewCharNameCheckResult newCharNameCheck(String login, String ipAddress, boolean skipAccountNameCheck)
{
final boolean accountSystemEnabled = CMProps.isUsingAccountSystem();
if(((CMSecurity.isDisabled(CMSecurity.DisFlag.NEWPLAYERS)&&(!accountSystemEnabled))
||(CMSecurity.isDisabled(CMSecurity.... | 9 |
public static void main(String[] args) {
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=AdventureWorks;integratedSecurity=true;";
// Declare the JDBC objects.
Connection con = null;
Statem... | 7 |
private static DateModel<?> createModelFromValue(Object value) {
if (value instanceof java.util.Calendar) {
return new UtilCalendarModel((Calendar) value);
}
if (value instanceof java.util.Date) {
return new UtilDateModel((java.util.Date) value);
}
if (val... | 4 |
public MyList filter(ListFilter lf) {
MyList newlist = new MyList();
Iterator it = iterator();
while(it.hasNext()) {
Object o = it.next();
if (lf.test(o)) newlist.add(o);
}
return newlist;
} | 2 |
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 main(String[] args) throws InterruptedException, IOException{
while (true)
{
System.out.print("Input: ");
BufferedReader getInput = new BufferedReader(new InputStreamReader(System.in));
String Input = getInput.readLine();
if (Input.equals("Ping"))
{
System.out.println("Pong");
... | 7 |
@Test
public void testTorbenGusevAlgorithm() throws Exception {
PrintStream out = System.out;// new PrintStream(new File("results.txt"));
// Note: Uncomment opCount and loopCount counters in HistogramBasedMedianFinder class to get statistics
boolean warmUp = false;
// Note: Change nRanges from 2 to 100 wit... | 8 |
private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 6; i++) {
JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
jj_la = p.arg;
jj_lastpos = jj_scanpos = p.first;
switch (i) {
... | 9 |
public Integer[] getSelected() {
ArrayList<Integer> selectedIndex = new ArrayList<Integer>();
for(int i = 0; i < selected.size(); ++i) {
if(selected.get(i)) {
selectedIndex.add(i);
}
}
return (Integer[]) selectedIndex.toArray();
} | 2 |
@Override
public void makePeace(boolean includePlayerFollowers)
{
final MOB myVictim = victim;
setVictim(null);
for (int f = 0; f < numFollowers(); f++)
{
final MOB M = fetchFollower(f);
if ((M != null) && (M.isInCombat()) && (includePlayerFollowers || M.isMonster()))
M.makePeace(true);
}
if (my... | 7 |
public Map<Integer, Double> getValueProbsForID(int id, boolean topicCreation) {
Map<Integer, Double> terms = null;
if (id < this.docList.size()) {
terms = new LinkedHashMap<Integer, Double>();
Map<Integer, Double> docVals = this.docList.get(id);
for (Map.Entry<Integer, Double> topic : docVals.entrySet()) {... | 6 |
@Override
protected void done() {
try {
//System.out.println("loaded image");
image.setIcon(get());
} catch (InterruptedException ex) {
System.out.println(ex);
} catch (ExecutionException ex) {
System.out.println(ex);
}
} | 2 |
public void actionPerformed(ActionEvent e) {
Locale locale = Locale.getDefault();
Date date = new Date(e.getWhen());
String s = DateFormat.getTimeInstance(DateFormat.SHORT, locale).format(date);
if (!model.isEmpty()) {
model.clear();
}
if (e.getID() == ActionEvent.ACTION_PERFORMED) {
model.addEleme... | 6 |
@Override
public final void run() {
// Reset, Job Object Data
this.failureObject = null;
this.returnObject = null;
this.finished = false;
this.success = false;
// ---------------------- EXECUTION ---------------------- //
System.out.println("[JOB] Execution of Job -> " + this.jobName);
Object job... | 4 |
public boolean contains(Temporal temporal) {
if (null == temporal) return false;
if (this == temporal) return true;
if (isTimeInstance()) {
return temporal.isTimeInstance() ? startTime == temporal.startTime : false;
} else {
if (temporal.isTimeInstance()) return !(startTime > temporal.startTime || tempora... | 7 |
protected static Ptg calcEOMonth( Ptg[] operands )
{
try
{
GregorianCalendar startDate = getDateFromPtg( operands[0] );
int inc = operands[1].getIntVal();
int mm = startDate.get( Calendar.MONTH ) + inc;
int y = startDate.get( Calendar.YEAR );
int d = startDate.get( Calendar.DAY_OF_MONTH );
if( mm... | 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.