text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void loadAll() throws IOException
{
//xstream
XStream xstream = new XStream();
xstream.alias("configuration", Configuration.class);
xstream.alias("domain", Domain.class);
xstream.alias("mimeType", MimeType.class);
try
{
this.element = this.loadFromFile(xstream);
}
catch (IOException ioEx... | 3 |
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 boolean Reset(String ticket, String lastName) throws Exception {
try {
//Load the MySQL driver
Class.forName("com.mysql.jdbc.Driver");
//Setup the connection with the database
conn = DriverManager.getConnection("jdbc:mysql://" +dbHost+ ":" +dbPort+ "/" +dbName, dbUser, dbPass);
//Create s... | 4 |
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
BasketItem other = (BasketItem) obj;
if (getRecordId() == null) {
if (other.getRecordId() != null)
return false;
} else if (!getRecordId().equals(o... | 9 |
public void actionPerformed(ActionEvent e) {
Grammar g = environment.getGrammar(UnrestrictedGrammar.class);
if (g == null)
return;
ChomskyPane cp = new ChomskyPane(environment, g);
environment.add(cp, "Test", new CriticalTag() {
});
environment.setActive(cp);
} | 1 |
public List<NamedEntity> getNamedEntities(String text)
throws NamedEntityExtractorException{
ArrayList<NamedEntity> entities = new ArrayList<NamedEntity>();
/*
* please refer to the stanford-ner package documentation to find out
* what this is all about
*/
List<List<CoreLabel>> labeledSen... | 6 |
private static File getOutputDir() {
File file = new File(properties.getProperty("usecase.outputdir") + "/pandemie");
if (!file.mkdirs() && !file.exists()) {
throw new RuntimeException("Fail to create output directory at " + file);
}
return file;
} | 2 |
void endParagraph() {
finishWord();
if (!_endnote) {
if (!_firstPar && _fill) {
writeBlankLines();
}
_firstPar = false;
if (_fill) {
processPhil();
} else {
emitLine(_wordLine, _firstLine
... | 7 |
void schedule(long delay, TimeUnit delayUnits) {
if (mKey != null) {
synchronized (PENDING) {
if (!PENDING.add(mKey)) {
mWasCancelled = true;
return;
}
}
}
EXECUTOR.schedule(this, delay, delayUnits);
} | 2 |
public CmdAddExecutor(SimpleQueues plugin) {
this.plugin = plugin;
} | 0 |
public static void inputCommand(){
System.out.println("\n0:Add 1:All 2:Search 3:Delete 9:EXIT ");
Scanner scCommand = new Scanner(System.in);
System.out.print("=>");
String inputCommand = scCommand.next();
if(inputCommand.equals("0")){
System.out.println("Action: new contact");
System.out.pr... | 5 |
public World(int width) {
// Create the squares
squares = new Square[width][width];
for (int x = 0; x < width; x++) {
for (int y = 0; y < width; y++) {
squares[x][y] = new Square();
}
}
setUp(width);
// Place the agent
// If the entire world is full of obstacles, this loop runs forever
while (... | 4 |
public static void setLogForName(final String str) {
if (str.equalsIgnoreCase("Normal logs -> Normal planks")) {
plankSet = 1;
} else if (str.equalsIgnoreCase("Oak logs -> Oak planks")) {
plankSet = 2;
} else if (str.equalsIgnoreCase("Teak logs -> Teak planks")) {
plankSet = 3;
} else if (str.equalsIgn... | 4 |
public void updateType() {
if (!isVoid())
updateParentType(subExpressions[0].getType());
} | 1 |
public boolean pollin (int index) {
if (index < 0 || index >= this.next)
return false;
return items [index].isReadable();
} | 2 |
public synchronized void stop() //Use synchronized when stopping thread
{
if(running)
{
running = false;
try {
gameThread.join();
}
catch (InterruptedException ex) {
System.out.println(ex.getMessage());
}
... | 2 |
public void updateConfigureButtonState() {
if (comboBox.getModel().getSelectedItem().equals("Contestant")) {
if (lblIpVerification.getText().equals("Valid IP Address"))
btnConfigure.setEnabled(true);
else
btnConfigure.setEnabled(false);
} else
btnConfigure.setEnabled(true);
} | 2 |
public void bulkLoad(IndexPair[] pairs, int offset, int length) {
if (length > capacity) {
throw new RuntimeException("Cannot write " + length
+ " elements to a block of size " + capacity);
}
if (length == 0) {
return;
}
OutputStream out = null;
try {
out = new BufferedOutputStream(new FileOut... | 6 |
public static Point getResolution(int i) {
if (i == 16) {
//full screen
return new Point(0, 0);
} else {
String resString = (String) resolutions.get(i);
String[] resParts = resString.split("x");
Point res = null;
if (resParts.length... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
if (!(obj instanceof BtcPeer))
return false;
BtcPeer other = (BtcPeer) obj;
if (networkAddress == null) {
if (other.networkAddress != nul... | 7 |
public String getNome()
{
return this.nome;
} | 0 |
@Override
public boolean hasNext() {
if (index < array.length) {
return true;
} else {
return false;
}
} | 1 |
public Hashtable<String, Integer> getShortestPaths(Vertex node)
{
_distances = new Hashtable<String, Integer>();
_predecessors = new Hashtable<String, Vertex>();
_unoptimizedNodes = new ArrayList<Vertex>(_nodes);
for(Vertex vertex : _nodes)
{
_distances.put(vertex.toString(), Integer.MAX_VALUE);
}
... | 7 |
private boolean jj_3R_50() {
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(9)) {
jj_scanpos = xsp;
if (jj_scan_token(19)) {
jj_scanpos = xsp;
if (jj_scan_token(26)) {
jj_scanpos = xsp;
if (jj_scan_token(24)) {
jj_scanpos = xsp;
if (jj_scan_token(28)) {
jj_scanpos = xsp;
... | 7 |
protected DiscountStrategy(double price, int copies) {
this.price = price;
this.copies = copies;
} | 0 |
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
ProxyKey key = mappings.get(method);
Class<?> type = method.getReturnType();
if (key != null) {
if (type == void.class) {
setValue(args, key);
... | 9 |
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Manifest")
public JAXBElement<ManifestType> createManifest(ManifestType value) {
return new JAXBElement<ManifestType>(_Manifest_QNAME, ManifestType.class, null, value);
} | 0 |
protected IQueueServiceListener[] getQueueServiceListenersByJob(IJob job){
IQueueServiceListener[] allWithoutJobID = getQueueServiceListeners();
IQueueServiceListener[] result = allWithoutJobID;
if (listenerByJobs.containsKey(job.getJobId()) && listenerByJobs.get(job.getJobId()) != null){
IQueueServiceListe... | 4 |
public TableView(int height) {
entries = new ArrayList<Item>();
listeners = new HashSet<SymbolSelectionListener>();
showFrequencies = true;
final String[] header = { "Symbol", "Codeword", "Frequency" };
tableModel = new AbstractTableModel() {
@Override
public String getColumnName(int col) {
return ... | 9 |
protected String getNewThreadName(String base_name, String addr, String cluster_name) {
StringBuilder sb=new StringBuilder(base_name != null? base_name : "thread");
if(use_numbering) {
short id;
synchronized(this) {
id=++counter;
}
sb.appen... | 9 |
@EventHandler
public void WitherHarm(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.getZombieConfig().getDouble("Wither.Harm.Dodge... | 7 |
public int compare(Node arg0, Node arg1) {
if(arg0.f > arg1.f)
return 1;
else if(arg0.f < arg1.f)
return -1;
return 0;
} | 2 |
}
// -----------------------------------------------------------------------
@Override
public DateTimeValueRange range(DateTimeField field) {
if (field instanceof ChronoField) {
ChronoField f = (ChronoField) field;
if (f.isDateField()) {
switch (f) {
case DAY_OF_MONTH:
... | 9 |
public static void nameGame(String inputName)
{
int i = 0;
while (inputName.charAt(i) != 'u' && inputName.charAt(i) != 'e'
&& inputName.charAt(i) != 'o' && inputName.charAt(i) != 'a'
&& inputName.charAt(i) != 'i')
{
i++;
}// while
String tempName = inputName.subst... | 5 |
public static Rule_dirLocal parse(ParserContext context)
{
context.push("dirLocal");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>();
... | 7 |
static void difference(Class<?> superset, Class<?> subset) {
System.out.print(superset.getSimpleName() + " extends "
+ subset.getSimpleName() + ", adds: ");
Set<String> comp = Sets.difference(methodSet(superset),
methodSet(subset));
comp.removeAll(object); // Don't show 'Object' methods
System.out.print... | 2 |
private void printNode(Node n)
{
boolean goLeft = false, goRight = false;
System.out.print("Node: " + n.hashCode());
if (n.value != null)
{
System.out.println("\tValue: " + n.value);
}
if (n.leftChild != null)
{
System.out.println(" Left Child: " + n.lef... | 5 |
public void change(){
bu1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Clink and Select");
JFileChooser chooser = new JFileChooser();
if(jb1.isSelected()){
FileNameExtensionFilter filter = new FileNameExtensionFilt... | 6 |
public void onBlockPlaced(World par1World, int par2, int par3, int par4, int par5)
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
int var7 = var6 & 8;
var6 &= 7;
if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2))
{
var6 = 4;
... | 8 |
public void copyTo(TicketQueryArgs other)
{
other._action = this._action;
other._count = this._count;
other._date = this._date;
other._departureStation = this._departureStation;
other._destinationStation = this._destinationStation;
other._seatType = this._seatType;
other._sequence = this._sequence;
oth... | 0 |
public boolean authenticate()
{
try
{
listServerIds();
return true;
}
catch (Exception e)
{
return false;
}
} | 1 |
@Override
public void run() {
for (int i = from; !Thread.interrupted() && done.getCount() > 0
&& i < to; i++) {
BigInteger exp = new BigInteger(Integer.toString(i));
BigInteger gbx1 = gB.modPow(exp, p);
for (int k = 0; k < xx.length; k++) {
BigInteger val = xx[k].get(gbx1);
if (val != nu... | 5 |
@Override
protected Post instanceFromResultSet(ResultSet rs, Set<Enum> selectedFields) throws SQLException {
boolean allFields = selectedFields == null || selectedFields.isEmpty();
long id = rs.getLong("id");
return new Post(id,
allFields || selectedFields.contains(Post._Fields.title) ? rs.getString... | 9 |
private static HashMap<Integer, User> buildUsersFromJsonData(String path) {
HashMap<Integer, User> userMap = new HashMap<Integer, User>();
JSONParser parser = new JSONParser();
try {
Object obj = null;
try {
obj = parser.parse(new FileReader(path));
} catch (org.json.simple.parser.ParseExcepti... | 6 |
public boolean addHeightOffset(Location spawnLoc, int playerHeight, int heightRange)
{
if (heightOffset == 0)
return true;
if (!RandomLocationGen.findSafeY(spawnLoc, playerHeight + heightOffset, heightRange, requirements == null || requirements.requireOpaqueBlock))
return false;
Block b = spawnLoc.getBl... | 6 |
final void method1716(boolean bool) {
anInt5864++;
if (method1735(bool)) {
if (((Class348_Sub51) ((Class239) this).aClass348_Sub51_3136)
.aClass239_Sub25_7271.method1830((byte) -97)
&& !Class151.method1210((byte) -94, ((Class348_Sub51)
(((Class239) this)
.aClass348_Sub51_3136))
... | 8 |
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
//System.out.println("Debug Grid Status: " + DRAW_DEBUG_GRID);
if(DRAW_DEBUG_GRID == true)
{
int gridX = 0;
while(gridX < canvasWidth)
{
Line2D xLine = new Line2D.Double(gridX, 0, gridX, ca... | 3 |
@Override
public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state)
{
Rectangle temp = state.getRectangle();
int x = temp.x;
int y = temp.y;
int w = temp.width;
int h = temp.height;
String direction = mxUtils.getString(state.getStyle(),
mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_E... | 3 |
public void sortList(){
Collections.sort(dataEntries, new Comparator<String[]>() {
@Override
public int compare(String[] o1, String[] o2) {
String[] obj1 = o1[0].split(":");
String[] obj2 = o2[0].split(":");
if(Integer.parseInt(obj1[0]) > Integer.parseInt(obj2[0])){
return 1;
} else if(Int... | 6 |
public String findLargestPalindrome(String string) {
if (string.length() > 2) {
char[] carr = string.toCharArray();
int maxPalindromeLength = Integer.MIN_VALUE;
int globalBegin = 0;
int globalEnd = 0;
for (int i=3; i<carr.length; i++) {
... | 7 |
public void open()
throws DBException
{
if (null != jdbc) return;
if (!location.isDirectory())
throw new DBException("There is no valid " + this);
Throwable status = new RuntimeException("No database names have been configured");
Logger log = log();
for (int legacyIndex = 0; DB_NAMES.length > legacyInde... | 8 |
public void addPatron(Patron p) {
Connection conn =null;
PreparedStatement pSt=null;
// If p is null, do nothing
if (p == null)
return;
try {
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&password=123456");
String insert = "INSERT INTO Patron(cardNumber... | 5 |
public List<String[]> getMounts() {
List<String[]> list = new ArrayList<>();
String mount, mountpoint, mounttype, opts;
for (String m : getMountLines()) {
mount = m.substring(0, m.indexOf(" on "));
mountpoint = m.substring(m.indexOf(" on ") + 4, m.indexOf(" type "));
mounttype = m.substring(m.indexOf(" ... | 5 |
private void parseMessage(Message msg) throws IllegalArgumentException {
try {
COMMAND cmd = msg.getCommand();
switch(cmd) {
case A:
addReplaceFile(msg.getCommand(), msg.isLastMessage(), msg.getFilename(), msg.getDataLength(), msg.getData());
break;
case C:
setCircumference(msg.getDataAsInt())... | 9 |
private AbstractInsnNode[] makeResult(int start, int end) {
int startIndex = 0;
int endIndex = -1;
for (int i = 0; i < offsets.length - 1; i++) {
int offset = offsets[i];
if (offset == start)
startIndex = i;
if ((offset < end) && (offsets[i + 1] >= end)) {
endIndex = i;
break;
}
}
if (... | 5 |
public void configureAction(Map<String, Object> config) {
if (config == null) {
this.task = null;
this.gruntFile = null;
this.page = null;
} else {
this.task = (String) config.get(Activator.KEY_TASK);
this.gruntFile = (IFile) config.get(Activator.KEY_FILE);
this.page = (IWorkbenchPage) config.get(... | 1 |
public void testWithFieldAdded_DurationFieldType_int_5() {
LocalTime test = new LocalTime(10, 20, 30, 40);
try {
test.withFieldAdded(DurationFieldType.days(), 6);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
protected void authenticateUser() throws LoginException {
if (!(_currentRealm instanceof RestRealm)) {
String msg = sm.getString("restlm.badrealm");
throw new LoginException(msg);
}
final RestRealm restRealm = (RestRealm)_currentRealm;
// A JDBC user mus... | 5 |
private static char[] collectVersionFromCompare( String mvdName,
int v1, int v2, ChunkState unique, char[] original )
throws Exception
{
String vId1 = Integer.toString(v1);
String vId2 = Integer.toString(v2);
String[] args0 = {"-c","compare","-m",mvdName,"-v",vId1,
"-w",vId2,"-u",unique.toString()};
... | 3 |
@Override
public boolean equals(Object obj) {
if (obj instanceof Bounds) {
Bounds other = (Bounds) obj;
return getRotation() == other.getRotation()
&& getScale() == other.getScale()
&& getHeight() == other.getHeight()
&& getWidth() == other.getWidth()
&& get(Edge.TOP_LEFT).equals(other.get... | 8 |
public SearchInvoicesResponse(Map<String, String> map, String prefix) {
if( map.containsKey(prefix + "responseEnvelope" + ".timestamp") ) {
String newPrefix = prefix + "responseEnvelope" + '.';
this.responseEnvelope = new ResponseEnvelope(map, newPrefix);
}
if( map.containsKey(prefix + "count") ) {
thi... | 9 |
public DetalleRegistro(Ticket ticket, java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
tipos = new ComboModelTipo();
monedas = new ComboModelMoneda();
estados = new ComboModelEstado();
tipo_paxs = new ComboModelTipoPax();
posiciones ... | 2 |
public boolean hasEffect(SkillEffect effect){
for (SkillEffect e: skillEffects) {
if(e == effect) return true;
}
return false;
} | 2 |
public static void PrintSeparator(char ch)
{
switch(ch){
case '_':
System.out.println("___________________________________________________________________________");
break;
case '-':
System.out.println("---------------------------------... | 3 |
public static ArrayList<SchoolBean> view(String id){
Connection con=DBConnection.getConnection();
SchoolBean sb=new SchoolBean();
ArrayList<SchoolBean> list=new ArrayList<SchoolBean>();
if(con==null)
return null;
try {
Statement pt=con.createStatement();
ResultSet rs=pt.executeQuery("select * from s... | 3 |
public CreditsRenderer()
{
try
{
}
catch (Exception e1)
{
}
} | 1 |
public static Color checkColour(JTextPane pane)
{
AttributeSet attributes = pane.getInputAttributes();
if (attributes.isDefined(StyleConstants.Foreground))
{
return (Color) attributes.getAttribute(StyleConstants.Foreground);
}
if (attributes.isDefined(CSS.Attribute.COLOR))
{
String s = attributes.g... | 2 |
public void setGoal(int x, int y) {
if (x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
return;
// Free old position
if (this.goalPos != null) {
this.field[goalPos.y][goalPos.x] = FieldType.FREE.ordinal();
}
this.goalPos = new Point(x, y);
... | 5 |
private int parseInt(String s,int i){
String sub=s.substring(i);
char current=sub.charAt(0);
String num=String.valueOf(current);
/* on parcourt la sous-chaine jusqu'a sortir de celle-ci ou de
l'entier, lequel des 2 se produit en premier*/
int j=1;
for(j=1;j<sub.length() && Character.isDigit(current);)... | 5 |
private static void loadFile() throws FileNotFoundException {
File inputFile = new File("topscore.txt");
Scanner inputScanner = new Scanner(inputFile);
String topscore = "";
while (inputScanner.hasNextLine())
topscore += inputScanner.nextLine();
// Separating high score file in names and scores
boolea... | 6 |
private static HashMap<String, ArrayList<String>> BuildMedList() throws Exception {
HashMap<String,String> stopwords = LoadStopWords(stopwordPath);
HashMap<String,ArrayList<String>> medList = new HashMap<String,ArrayList<String>>();
File medFile = new File("NICTA/atc_20130403.txt");
BufferedReader reader = new... | 4 |
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 Sequencer getSequencer() {
return sequencer;
} | 0 |
private boolean validParameters(String[] parameters) {
boolean validParameters = true;
for (int i = 0; parameters != null && i < parameters.length && validParameters; i++) {
String brackets = "";
int arraySeparationIndex = parameters[i].indexOf("[");
if (arraySeparationIndex >= 0) {
br... | 9 |
public Section(int x, int y, Minesweeper game) {
this.x = x;
this.y = y;
this.game = game;
int chance = new Random().nextInt(100);
if (chance < ratio)
bomb = true;
if (!bomb) {
chance = new Random().nextInt(100);
if (chance < 10)
... | 3 |
@Override
public String execute() throws Exception {
try {
Map session = ActionContext.getContext().getSession();
user = (User) session.get("User");
Criteria ucri = myDao.getDbsession().createCriteria(Campaign.class);
ucri.add(Restrictions.like("campaignName... | 3 |
public static void registerEntities() {
for (CustomEntityType entity : values())
a(entity.getCustomClass(), entity.getName(), entity.getID());
// BiomeBase#biomes became private.
BiomeBase[] biomes;
try {
biomes = (BiomeBase[]) getPrivateStatic(BiomeBase.class, ... | 9 |
public void run() {
long lastTime = System.nanoTime();
double nsPerTick = 1000000000D / 60D;
long lastTimer = System.currentTimeMillis();
double delta = 0;
init();
log.info("_WIDTH = " + _WIDTH);
log.info("_HEIGHT = " + _HEIGHT);
log.info("_SCALE = " + _SCALE);
if (Fullscreen) log.info("_SIZE = wid... | 6 |
public GrapheEntreLivraisons(int nbVertices, int[][] cost) {
this.nbVertices = nbVertices;
int tempMaxCost = -1;
int tempMinCost = Integer.MAX_VALUE;
succ = new ArrayList<ArrayList<Integer>>();
for(int i=0 ; i<nbVertices ; i++) {
for(int j=0 ; j<nbVertices ; j++) {
if(cost[i][j] > tempMaxCost) {
... | 8 |
public boolean verify() {
if(this.getServer_ip() == null || this.getServer_ip().length()<1) return false;
if(this.getId().length()<1) return false;
if(this.getApiUser().length()<1) return false;
if(this.getApiToken().length()<1) return false;
if(this.getMysqlDump().length()<1) re... | 8 |
public By getBy(String locator) {
By by;
if(locator.startsWith("//"))
by = By.xpath(locator);
else if(locator.startsWith("class="))
by =By.className(locator.replace("class=", ""));
else if(locator.startsWith("css="))
by = By.cssSelector(locator.replace... | 8 |
@Override
public V getObject(K key) {
if (ramCache.containsKey(key)) {
return ramCache.getObject(key);
}
if (hardDiskCache.containsKey(key)) {
K tMinKey = ramCache.getMinFrequencyKey();
int tMinFrequency = ramCache.getFrequency(tMinKey);
int fr... | 3 |
public String getTurnPlayerName(){
return board.getIsBattingFirstTurn() ? playerAName : playerBName;
} | 1 |
public static RiverDB readCSV (String fName) {
RiverDB riverDB = new RiverDB ();
LabeledCSVParser lcsvp = null;
try {
lcsvp = new LabeledCSVParser(
new CSVParser(
new FileReader( fName )
)
);
try {
while(lcsvp.getLine() != null){
/*
System.out.pr... | 5 |
@Override
public void componentResized(ComponentEvent event) {
if (gamePanel.getGraphics() != null) {
final BufferStrategy b = that.gamePanel.getBufferStrategy();
if (b != null) {
myPen.simplePen.pen = (Graphics2D) b.getDrawGraphics();
}
SimpleGraphics.this.onResize(myPen);
}
} | 2 |
public void setComposition(String composition) {
this.composition = composition;
} | 0 |
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 detail... | 6 |
@Override
public void addUser() {
try {
credentials = new BufferedWriter(new FileWriter("credentials", true));
credentials.write(this.username);
credentials.newLine();
credentials.write(this.password);
credentials.newLine();
credentials... | 2 |
public Tile getTile(int x, int y) {
if (x < 0 || y < 0 || x >= width || y >= height) return Tile.voidTile;
if (tiles[x + y * width] == 0xff00FF00) return Tile.grass;
if (tiles[x + y * width] == 0xffFFFF00) return Tile.flower;
if (tiles[x + y * width] == 0xff7F7F00) return Tile.rock;
return Tile.voidTile;
} | 7 |
public static byte[] genCRC16(byte[] data) {
int crc = 0x0000;
for (byte b : data) {
crc = (crc >>> 8) ^ table[(crc ^ b) & 0xff];
}
return checksumToByteArray(crc);
} | 1 |
public void immediatelyRenewLease() {
logger.finest("immedidately renewing the lease");
interrupt();
try {
// give time for Cyc to renew the lease
sleep(250);
} catch (InterruptedException e) {
}
} | 1 |
protected synchronized CtMember.Cache getMembers() {
CtMember.Cache cache = null;
if (memberCache == null
|| (cache = (CtMember.Cache)memberCache.get()) == null) {
cache = new CtMember.Cache(this);
makeFieldCache(cache);
makeBehaviorCache(cache);
... | 2 |
public boolean hasServerConfig() {
return ((url != null && !url.isEmpty()) && (apiKey != null && !apiKey.isEmpty()));
} | 3 |
public void showCharList(char start, char end){
if(start <= end){
for(char i = start; i <= end; i++){
System.out.println(i);
}
}
else{
for(char i = end; i <= start; i++){
System.out.println(i);
}
}
} | 3 |
public void setModeleJComboBoxLabo(DefaultComboBoxModel modeleJComboBoxLabo) {
this.modeleJComboBoxLabo = modeleJComboBoxLabo;
} | 0 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanelProjeto = new javax.swing.JPanel();
lblNome = new javax.swing.JLabel();
lblDescriscao = new javax.swing.JLabel();
btnCad... | 2 |
public void registerPom(File file, POMInfo pomInfo) throws DependencyNotFoundException {
dep2info.put(pomInfo.getThisPom(), pomInfo);
unresolvedPoms.put(file, pomInfo);
POMInfo parentPOM = superPom;
try {
if (pomInfo.getParent() != null && !pomInfo.getParent().isSuperPom()) ... | 8 |
@Override
public void actionPerformed(final ActionEvent e) {
if (e.getSource() instanceof JButton) {
final JButton button = (JButton) e.getSource();
if (button == bestMove) {
getBestMove();
} else if (button == tilesInHand) {
requestLetters... | 6 |
public String getFullAlias() {
if (pack.parent == null)
return getAlias();
else
return pack.getFullAlias() + "." + getAlias();
} | 1 |
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
float scaleX = 10f;
float scaleY = 10f;
Image image = null;
switch (imageCb.getSelectionIndex()) {
case 0:
image = GraphicsExample.loadImage(device, GraphicsExample.class, "home_na... | 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.