text stringlengths 14 410k | label int32 0 9 |
|---|---|
private String introduceUser(String input)
{
String userQuestion = "";
if (getChatCount() < 4)
{
if (getChatCount() == 0)
{
myUser.setUserName(input);
userQuestion = "How many girls have you kissed?";
}
else if (getChatCount() == 1)
{
try
{
myUser.setGirlsKissed(Integer.parse... | 9 |
private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed
String text = txtBuscar.getText().toString();
LibrosCRUD libro = new LibrosCRUD(MyConnection.getConnection());
ArrayList<Libros> listado = new ArrayList<>();
Libros l = null... | 6 |
public SingleTreeNode treePolicy() {
SingleTreeNode cur = this;
while (!cur.state.isGameOver() && cur.m_depth < ROLLOUT_DEPTH)
{
if (cur.notFullyExpanded()) {
return cur.expand();
} else {
SingleTreeNode next = cur.uct();
... | 3 |
public static void createClusters(final PrintWriter writer,
final PgSchema oldSchema, final PgSchema newSchema,
final SearchPathHelper searchPathHelper) {
for (final PgTable newTable : newSchema.getTables()) {
final PgTable oldTable;
if (oldSchema == null) {
... | 8 |
@EventHandler(priority=EventPriority.MONITOR)
void onInventoryClick(InventoryClickEvent event) {
if (event.getInventory().getTitle().equals(name)) {
event.setCancelled(true);
int slot = event.getRawSlot();
if (slot >= 0 && slot < size && optionNames[slot] != null) {
... | 6 |
private void createQuizSlide(Attributes attrs) {
quizSlide = new QuizSlide(quizSlideDef);
// loop through all attributes, setting appropriate values
for (int i = 0; i < attrs.getLength(); i++) {
if (attrs.getQName(i).equals("id"))
quizSlide.setId(Integer.valueOf(attrs.getValue(i)));
else if (attrs.getQN... | 5 |
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 fe... | 8 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuilder sb = new StringBuilder();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
public void testStackArray(){
while(!stk.isEmpty()){
System.out.println(stk.pop());
}
} | 1 |
public void renderLayer(Graphics g, ArrayList<Task> lastLayer, ArrayList<Task> currentLayer, int currentX, int currentY) {
// renders layers after the first layer;
if (currentLayer.isEmpty()) {
// this later is empty, this is the end
// close it off
for (Task current ... | 9 |
public ShapeConstru(SimpleFeature f, String tipo) {
super(f, tipo);
shapeId = "CONSTRU" + super.newShapeId();
// Para agrupar geometrias segun su codigo de masa
codigoMasa = ((String) f.getAttribute("MASA")).replaceAll("[^\\p{L}\\p{N}]", "")+"-";
this.poligons = new ArrayList<LineString>();
// ... | 4 |
public void serialize(ByteBuffer buffer) {
_LOGGER.log(Level.FINE, "Serializing response: " + _status + "/" + _errorCode);
buffer.clear();
buffer.putInt(_status);
if(_status != STATUS_OK) {
buffer.putInt(_errorCode);
return;
} else if(_message != null) {
... | 4 |
public Praying getPraying(String name) {
if(prayings.contains(name)) return null;
for(Praying p : prayings)
if(p.getName().equalsIgnoreCase(name))
return p;
return null;
} | 3 |
public void arrange(int iterationCounter){
Collections.sort(books);
BookNode bi, bj;
float vx, vy, vLen;
if(books.size()>1){
for(int i=0; i<books.size();i++){
bi=books.get(i);
for(int j=i+1;j<books.size();j++){
if(i!=j){
bj = books.get(j);
float dx = bj.getX() - bi.getX();
... | 7 |
public void startAuction(){
if((super.getOutputPort() == null) || super.getAuctionID() == -1){
System.err.println(this.get_name() +
"Error starting the auction. " +
"The output port used by the auction is null or" +
"the auctioneer's ID was not provided!");
return;
}
... | 3 |
private void writeIndexKeys() {
String mapperName = table.getDomName() + "Dao";
StringBuilder sb = new StringBuilder();
for ( IndexNode node : table.getIndexList() ) {
String methodName = "readByIndex" + toTitleCase( node.getIndexName());
String param = "";
for(... | 3 |
public FastqBuilder withSequence(final String sequence) {
if( sequence == null ) { throw new IllegalArgumentException("sequence must not be null"); }
if( this.sequence == null ) {
this.sequence = new StringBuilder(sequence.length());
}
this.sequence.replace(0, this.sequence.length(), sequence);
return this... | 2 |
final Interface18_Impl3 method3855(Class304 class304, int i, int i_54_,
float[] fs, boolean bool, int i_55_,
int i_56_, int i_57_) {
try {
anInt9890++;
if (i_56_ != 2)
((NativeOpenGlToolkit) this).aMapBuffer9913 = null;
if (!aBoolean9926 && (!Class192.method1436(60, i)
|| !... | 8 |
public static void main(String[] args){
int max = 0;
for(int i=1;i<100;i++){
for(int j=1;j<100;j++){
int dSum = digitSum(power(i, j));
if(dSum>max) max = dSum;
}
}
System.out.println(max);
} | 3 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TarifasParqueaderosPK)) {
return false;
}
TarifasParqueaderosPK other = (TarifasParqueaderosPK) object;
if ((th... | 9 |
public static int getInt(byte[] b, int offset) {
if (isBlank(b)) {
throw new IllegalArgumentException("blank byte array.");
}
if (offset < 0) {
throw new IllegalArgumentException("invalid array offset:" + offset + ".");
}
int out = b[0] < 0 ? -1 : 0;
for (int l = b.length - offset, i = l < INTEGER_BYT... | 5 |
static protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenB... | 9 |
@Override
public TheaterSeatsReplyMessage seatsRequest(int clientID, int theaterID) throws RemoteException{
TheaterSeats seats = null;
TheaterSeatsReplyMessage reply = null;
seats = cache.getTheaterSeats(theaterID);
if(seats == null){
//Creates a communication channel between this and the DBServer
... | 6 |
public ArrayList<Cell> convert(String s){
//create the cell list to populate
ArrayList<Cell> cellList = new ArrayList<Cell>();
//break the string into the words
//for now force to lower case
s.toLowerCase();
String [] words = s.split(" ");
//for the words in
for (int i=0 ; i < words.length; i++){... | 5 |
void mesajGeldi(String mesaj) throws Exception, Throwable{
System.out.println(mesaj);
JSONObject json = new JSONObject(mesaj);
String tip = json.get(MESAJ_TIPI).toString();
switch (tip) {
case MT_GUC_ACIK:
gucAc(json);
... | 6 |
@Override
public void execute() {
Logger.getInstance().info("Executing method " + getMethod());
try {
rawExecutionResult = Arietta.rpc.callMethod(getMethod(), getParams());
if (rawExecutionResult == null) {
Logger.getInstance().error("Got null result for " +... | 4 |
public void updateP2(String stats)
{
p2.setText(stats);
} | 0 |
public static boolean isNumber(int c) {
return isDigit(c) || c == '-' || c == '+' || c == '.';
} | 3 |
String createDotString(String... dotStrings) {
final StringBuilder sb = new StringBuilder();
double nodesep = getHorizontalDzeta();
if (nodesep < getMinNodeSep()) {
nodesep = getMinNodeSep();
}
final String nodesepInches = SvekUtils.pixelToInches(nodesep);
// System.err.println("nodesep=" + nodesepInche... | 8 |
public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, Graphics2D g2d) {
final UEllipse shape = (UEllipse) ushape;
g2d.setStroke(new BasicStroke((float) param.getStroke().getThickness()));
if (shape.getStart() == 0 && shape.getExtend() == 0) {
final Shape ellipse = new Ellipse2D.... | 7 |
@Override
public void update(Observable o, Object arg) {
if (arg instanceof WorldState) {
WorldState worldState = (WorldState) arg;
switch (worldState) {
// When the timer hit 0
case TIME_OVER:
timeOver();
break;
// Set when the player has 0 health and 0 shield etc. IE, dead.
case PLAY... | 4 |
public void saveStats(BlackjackGui gui) {
switch(gui.numPlayers) {
case 1: p1wins = players.get(0).getWins(); p1losses = players.get(0).getLosses();
p1won = players.get(0).getMoneyWon(); p1lost = players.get(0).getMoneyLost();
p1money = players.get(0).getMoney();
try {
File file1... | 6 |
private void buyCompany(int id, HttpServletResponse response, RequestContext rc) throws IOException, SQLException {
int requesterId = rc.getId();
int compNum = UserManager.countCompanies(requesterId);
long reregTax = CompanyManager.companyCost(compNum + 1);
if(reregTax != -1) {
... | 5 |
public void newRandomConnection(Neuron neuron){
try{
for(int i=0;i<neurons.size();i++)
neurons.get(i).findDepth();
}catch(StackOverflowError e){
System.out.println("There was a stack overflow because of findDepth :: SpeciationNeuralNetwork");
new CMDTe... | 8 |
public void Guerra() {
General.Reclutar(exerc1, pantalla);
General.Reclutar(exerc2, pantalla);
Formacio(exerc1);
Formacio(exerc2);
while (exerc1.size() != 0 && exerc2.size() != 0) {
if (General.Acorrer(exerc1, pantalla) == exerc1.size()) {
Formacio(exerc1);
}
if (General.Acorrer(exerc2, panta... | 4 |
private static void register(Class<? extends Packet> packet) {
try {
short id = packet.getField("ID").getShort(null);
if(id < 0)
System.err.println("Packet ID undefined: " + packet.getSimpleName());
else if(packetTypes.containsKey(id))
System.err.println("Duplicate Packet ID: " + packet.getSimpleNa... | 4 |
public boolean setINodeParam(String resource_id, String inode_id, String paramKey, String paramValue)
{
boolean isUpdated = false;
int count = 0;
try
{
while((!isUpdated) && (count != retryCount))
{
if(count > 0)
{
... | 6 |
public static int insertMstxSort(String sort) {
int result = 0;
int sid = getMaxNumber("mstx_sort");
updateMaxNumber(8);// 将该字段值加1
Connection con = DBUtil.getConnection();
PreparedStatement pstmt = null;
try {
pstmt = con.prepareStatement("insert into mstx_sort(sid,info_sort) values(" + sid + ", '" + so... | 5 |
private void connectTo(AbstractUnit next, int posConn){
if(selected instanceof IMultipuleOutputUnit){
Object result = JOptionPane.showInputDialog(
tulip.Tulip.mainFrame,
"Which connection?",
PropagatorUnit.lastConnectedUnit
);
... | 6 |
@Override
public Class getColumnClass(int column) {
Class returnValue;
if ((column >= 0) && (column < getColumnCount())) {
if (getValueAt(0, column) == null) {
return String.class;
}
returnValue = getValueAt(0, column).getClass();
} else {
... | 3 |
@Override
public void messageReceived(Message msg) {
/**
* same as GridScheduler
*/
if(msg instanceof ControlMessage){
ControlMessage controlMessage = (ControlMessage)msg;
// resource manager wants to join this grid scheduler
// when a new RM is added, its load is set to Integer.MAX_VALUE to ma... | 4 |
public void resume_ingress() {
for (ConnectionProcessor pipe : pipes) {
pipe.resume_ingress();
}
} | 1 |
public BrickFireplace(TextGame _game) {
super("Brick Fireplace", "");
this.game = _game;
this.addAction(new ActionInitial("hit") {
@Override
public Result execute(Actor actor) {
if (((Player) actor).getLocation().hasOne("brick fireplace")) {
return new ResultPartial(true, " -- With what? "... | 7 |
public void setPass(String pass) {
this.pass = pass;
} | 0 |
private void newFileInProject() {
FileDialog dialog;
if (isCurrentItemLocal())
dialog = new FileDialog(shell, FileDialog.Mode.SAVE, getCurrentTreeDir());
else
dialog = new FileDialog(shell, FileDialog.Mode.SAVE, getCurrentTreeSym());
ArrayList<SymitarFile> files = dialog.open();
if (files.size() > 0)... | 9 |
public List<POMInfo> searchMatchingPOMsIgnoreVersion(Dependency dependency) {
List<POMInfo> result = new ArrayList<POMInfo>();
POMInfo pom = searchMatchingPOM(dependency);
if (pom != null) {
result.add(pom);
return result;
}
for (POMInfo testPom : resolve... | 3 |
private void updateEnvironment(Graphics g) {
// see if application is paused
if (running) {
drawFood(g);
drawFeeders(g);
// loop through all food and feeders
for (Food fd : FoodCollection.getFoods()) {
// make sure the food is still active
... | 7 |
static Color getReligionColor(String religion) {
religion = religion.toLowerCase();
Color ret = relColorCache.get(religion);
if (ret == null) {
for (GenericObject group : religions.children) {
for (GenericObject rel : group.children) {
... | 5 |
@Override
public void update(int deltaTicks)
{
int mouseX = Mouse.getX();
int mouseY = Mouse.getY();
if (mouseX > this.position.x - this.size.x / 2 &&
mouseX < this.position.x + this.size.x / 2 &&
mouseY > this.position.y - this.size.y / 2 &&
... | 9 |
public ByteVector putByteArray(final byte[] b, final int off, final int len)
{
if (length + len > data.length) {
enlarge(len);
}
if (b != null) {
System.arraycopy(b, off, data, length, len);
}
length += len;
return this;
} | 2 |
public BoGenerator( Table table ) {
super( table );
boName = table.getDomName() + "Bo";
filePath = "src/main/java/" + packageToPath() + "/bo/" + boName + ".java";
for ( Column column : table.getColumns() ) {
if ( column.isKey() ) {
keyColumns.add(column);
... | 2 |
@Override
public void run() {
int frec = 100;
try {
keep_going = true;
//Creamos los sockets para la transmisión de información.
control_sck = new Socket(CONTROL_HOST, CONTROL_PORT);
data_sck = new Socket(DATA_HOST, DATA_PORT);
//Creamo... | 5 |
public static boolean compareSubstringBare(String ion, int ii){
boolean test = false;
if(IonicRadii.ions1[ii].indexOf(ion)>-1||IonicRadii.ions2[ii].indexOf(ion)>-1||IonicRadii.ions3[ii].indexOf(ion)>-1||IonicRadii.ions4[ii].indexOf(ion)>-1||IonicRadii.ions5[ii].indexOf(ion)>-1||IonicRadii.ions6[ii].inde... | 6 |
private boolean check() {
if (N == 0) {
if (first != null) return false;
}
else if (N == 1) {
if (first == null) return false;
if (first.next != null) return false;
}
else {
if (first.next == null) return false;
}
... | 8 |
public void initReferees()
{
// create file reader and referee program object
FileReader refereesFileReader = null;
refereeProgram = new RefereeProgram();
try
{
try
{
// initialise file reader using RefereesIn.txt
refereesFileReader = new FileReader(refereesInFile);
// create new Scanner u... | 3 |
public static void main(String[] args) throws Exception {
Options plumeOptions = new Options(
TestIsolationDataGenerator.usage_string,
TestIsolationDataGenerator.class);
plumeOptions.parse_or_usage(args);
// Display the help screen.
if (showHelp) {
... | 7 |
public Grafic(final String title, JPanel fondo, double plotWindowTime) {
super(title);
this.plotWindowTime=plotWindowTime;
final CombinedDomainXYPlot plot1 = new CombinedDomainXYPlot(new NumberAxis("Time"));
final CombinedDomainXYPlot plot2 = new CombinedDomainXYPlot(new NumberAxis(... | 3 |
public boolean satisfies(ArrayList<Boolean> b)
{
for(Clause c: clauses)
{
//since a formula is a conjuction, if one clause returns
//false, the whole formula is false.
if(!(c.satisfies(b)))
return false;
}
return true;
} | 2 |
public static void main(String[] args){
try{
ThreadPoolExecutor executor = new ThreadPoolExecutor(30, 30, 1,
TimeUnit.SECONDS, new LinkedBlockingQueue());
List<Future<Boolean>> futures = new ArrayList<Future<Boolean>>(9000);
// 发送垃圾邮件, 用户名假设为4位数字
for(int i=1000; i<10000; i++){
futures.add(executo... | 5 |
public final WaiprParser.inval_return inval() throws RecognitionException {
WaiprParser.inval_return retval = new WaiprParser.inval_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token set68=null;
CommonTree set68_tree=null;
try {
// Waipr.g:61:7: ( ( ID | NUMBER | TEXT ) )
// Wai... | 4 |
public static void main(String[] args) throws FileNotFoundException {
System.out.println(new File(".").getAbsolutePath());
Scanner inputFile = new Scanner(new File(".\\src\\hashMap\\inputFile.txt"));
HashMap2 hashMap = new HashMap2(SIZE);
JFrame frame = new JFrame("Hash Map");
JPanel grid = new JPanel(new Gri... | 3 |
public void addTask(Task task){
StringBuilder update = new StringBuilder("insert into tasks(reporter,assignee,`status`,description,priority,`completion`,start_date,deadline,title) values(");
if(task.getReporter()!=null && task.getReporter().getUserName()!=null)
update.append("\""+task.getReporter().getUserName(... | 9 |
public static MiscellaneousReasonEnumeration fromString(String v) {
if (v != null) {
for (MiscellaneousReasonEnumeration c : MiscellaneousReasonEnumeration.values()) {
if (v.equalsIgnoreCase(c.toString())) {
return c;
}
}
}
throw new IllegalArgumentException(v);
} | 3 |
void bedIterate() {
// Open file
BedFileIterator bfi = new BedFileIterator(inFile, config.getGenome());
bfi.setCreateChromos(true); // Any 'new' chromosome in the input file will be created (otherwise an error will be thrown)
for (Variant bed : bfi) {
try {
// Find closest exon
Markers closestMarker... | 5 |
public void run() {
while (!stop) {
try {
File f = Main.encontrados.take();
System.out.println(f.getCanonicalPath());
} catch (InterruptedException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | 2 |
@SuppressWarnings("unchecked")
public static ListTag fromNBTTag(NBTTagList base)
{
Type type = Tag.fromNBTTag(base.get(0)).getClass();
List<Tag> list = new ArrayList<>();
for (int i = 0; i < base.size(); i++)
{
list.add(Tag.fromNBTTag(base.get(i)));
}
return new ListTag((Class<? extends Tag>) type.g... | 2 |
public void startDocumentInternal() throws org.xml.sax.SAXException
{
if (m_needToCallStartDocument)
{
super.startDocumentInternal();
m_needToCallStartDocument = false;
if (m_inEntityRef)
return;
m_needToOutputDocTypeDecl = true;
... | 9 |
public void setHistorialClinicoidHistorialClinico(Historialclinico historialClinicoidHistorialClinico) {
this.historialClinicoidHistorialClinico = historialClinicoidHistorialClinico;
} | 0 |
public int loadStripImages(String fnm, int number)
/*
* Can be called directly, to load a strip file, <fnm>, holding <number>
* images.
*/
{
String name = getPrefix(fnm);
if (imagesMap.containsKey(name)) {
System.out.println("Error: " + name + "already used");
return 0;
}
// load the images into a... | 4 |
public void testAdd2() {
RunArray<Font> runArray = new RunArray<Font>();
int i;
// Add 10 fonts for first 100 characters
for (i = 0; i < 10; i++) {
if (i % 2 == 0) {
assertEquals(i, runArray.addRun(i * 10, 10, fontA));
} else {
assertEquals(i, runArray.addRun(i * 10, 10, fontB));
}
}
// Ver... | 9 |
public void showSet(String name, Player controller, double amount, boolean console)
{
Player online = iConomy.getBukkitServer().getPlayer(name);
if (online != null) {
name = online.getName();
}
Account account = iConomy.getAccount(name);
if (account != null) {
Holdings ho... | 6 |
public CheckResultMessage checkJ04(int day) {
return checkReport.checkJ04(day);
} | 0 |
public boolean chargeIt(double price){
if (price + balance > (double)limit)
return false;
balance +=price;
return true;
} | 1 |
private void KeyboardPanelPressed(final JPanel jPanel) {
if (!new ArrayList(Arrays.asList(jPanel.getComponents())).isEmpty()) {
return;
}
for (final Component comp : KeysPanel.getComponents()) {
if (comp instanceof JToggleButton) {
JToggleButton keyButton ... | 5 |
public ChartHandle createChart( String name, WorkSheetHandle wsh )
{
if( wsh == null )
{
// this is a sheetless chart - TODO:
}
/* a chart needs a supbook, externsheet, & MSO object in the book stream.
* I think this is due to the fact that the referenced series are usually stored
* in the fashon 'She... | 6 |
private String getPrecedence(String op1, String op2){
String multiplicativeOps = "*/%";
String additiveOps = "+-";
if ((multiplicativeOps.indexOf(op1) != -1) && (additiveOps.indexOf(op2) != -1))
return op1;
else if ((multiplicativeOps.indexOf(op2) != -1) && (additiveOps.indexOf(op1) != -1))
return o... | 6 |
private String getInput(){
@SuppressWarnings("resource")
Scanner scanner = new Scanner(System.in);
String userInput;
do{
System.out.print("Enter your move [WASD?]: ");
userInput = scanner.nextLine();
userInput = userInput.trim().substring(0, 1);
if(VALID_KEYS.contains(userInput.toUpperCase())){
... | 4 |
@Override
public boolean activate() {
return Game.isLoggedIn() && Players.getLocal().isInCombat() || initialized;
} | 2 |
private void home(Value v) throws Exception {
if(isSpilled(v)) {
// then this value has been spilled, the value is
// currently in t1, insert the spill code now
// if the color is less than 0, it is 'spilled', but
// doesn't need to be put into a home since it is... | 2 |
@EventHandler
public void touchytouchy(PlayerInteractEntityEvent event)
{
Player player = (Player)event.getPlayer();
Entity rightclick = event.getRightClicked();
if(rightclick instanceof Player)
{
Player rightclicked = (Player)rightclick;
if(plugin.isActivated(player.getName()))
{
if(player.getI... | 8 |
public void buy(MapleClient c, int itemId, short quantity) {
if (quantity <= 0) {
AutobanManager.getInstance().addPoints(c, 1000, 0, "Buying " + quantity + " " + itemId);
return;
}
MapleShopItem item = findById(itemId);
if (item != null && item.getPrice() > 0) {
if (c.getPlayer().getMeso() >= item.ge... | 7 |
public JSONObject toJSONObject(JSONArray names) throws JSONException {
if (names == null || names.length() == 0 || length() == 0) {
return null;
}
JSONObject jo = new JSONObject();
for (int i = 0; i < names.length(); i += 1) {
jo.put(names.getString(i), this.opt(i... | 4 |
@Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
try {
TrendBar bar = doneBars.take();
trendBarDao.addTrendBar(bar);
} catch (InterruptedException e) {
executorService.shutdown();
Thread.cu... | 2 |
@Override
public boolean onPointerMove(int mX, int mY, int mDX, int mDY) {
PhysicsComponent pc = (PhysicsComponent)actor.getComponent("PhysicsComponent");
float X = pc.getX();
float Y = pc.getY();
if(mX < placementAreaX) {
X = placementAreaX;
}
el... | 4 |
public CeremonialAxe() {
this.name = Constants.CEREMONIAL_AXE;
this.attackScore = 9;
this.attackSpeed = 14;
this.money = 1500;
} | 0 |
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
switch (e.getKeyCode()) {
case 37:
GUI.scrollBothPaneH("dec", 30);
break;
case 39:
GUI.scrollBothPaneH("inc", 30);
break;
case 38:
GUI.s... | 4 |
private void p_bookingPage(){
p_bookingPane = new JPanel();
p_bookingPane.setBackground(SystemColor.activeCaption);
p_bookingPane.setLayout(null);
if (patient!=null){
db.showBookingPat(PBT_model,patient.getHKID());
}
PBL_choose_model.removeAllElements();
PBT_date.setValue(null);
JLabel lbl_Bookin... | 6 |
@Test
public void testLoadingCards() {
// Test loading cards
ArrayList<Card> cards = testBoard.getCards();
// check total number of cards
Assert.assertEquals(cards.size(), 21);
// check number of types of cards
int numberOfWeaponCards = 0;
int numberOfRoomCards = 0;
int numberOfPersonCards = 0;
for... | 8 |
public boolean isNaN(){
boolean test = false;
if(this.magnitude!=this.magnitude || this.phaseInDeg!=this.phaseInDeg)test = true;
return test;
} | 2 |
public void runScript(String serverUrl, String userId, ScriptName scriptName) {
Thread thread = null;
switch (scriptName) {
case opUsPg:
OpenPageScript openPageScript = new OpenPageScript(serverUrl,
userId, this);
thread = new Thread(openPageScript);
break;
case addRes:
AddResScript addResSc... | 6 |
public static void main(String[] args){
try {
//prompt for IP address
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter server's IP");
String ip = reader.readLine();
if(!ip.trim().equals("")){
server_ip = ip;
}
//connect to server
Stri... | 7 |
public static void main(String[] args)
{
JFrame frame = new JFrame();
frame.setSize(1280, 768);
frame.setTitle("BulletTester");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Random r = new Random();
ArrayList<Bullet> bulletList = new ArrayLis... | 7 |
public static void main(String[] args) {
Demo01 demo = new Demo01();
demo.method_b(b);
} | 0 |
public Type[] exceptions() {
final ConstantPool cp = editor.constants();
final int[] indices = methodInfo.exceptionTypes();
final Type[] types = new Type[indices.length];
for (int i = 0; i < indices.length; i++) {
types[i] = (Type) cp.constantAt(indices[i]);
}
return (types);
} | 1 |
public int run (String[] args) throws Exception {
for(int i = 0; i < args.length; i++){
System.out.println(i + " : " + args[i]);
}
if (args.length < 2) {
System.err.printf("Usage: %s [generic options] <d> <maxDimensions> <dataSets> <key> <input> <input2?> <output> <prevrun?> \n",
getClass().getSimpleN... | 7 |
public Gesture(PersistentCanvas c, Color o, Color f, Point p, Panel l, boolean gesture) {
super(c, o, f);
panel = l;
type = 1;
thickness = 2;
shape = new GeneralPath();
((GeneralPath) shape).moveTo(p.x, p.y);
firstpoint = p;
isGesture = gesture;
... | 1 |
protected void convertMapsToSections(Map<?, ?> input, ConfigurationSection section) {
for (Map.Entry<?, ?> entry : input.entrySet()) {
String key = entry.getKey().toString();
Object value = entry.getValue();
if (value instanceof Map) {
convertMapsToSections((... | 8 |
public boolean remove(String name) {
Connection conn = null;
PreparedStatement ps = null;
try
{
conn = iConomy.getiCoDatabase().getConnection();
ps = conn.prepareStatement("DELETE FROM " + Constants.SQLTable + " WHERE username = ? LIMIT 1");
ps.setString(1, name);
ps.executeUpdat... | 5 |
public void readFile(String filename) throws FileNotFoundException, IOException, InvalidUserException {
Scanner scanner = new Scanner(new File(filename));
fw = new FileWriter(new File(fileWriterName));
while (true) {
String s = scanner.nextLine();
if (s.contains("EXIT"))... | 3 |
static LinkedList copyAll(LinkedList list, ConstPool cp) {
if (list == null)
return null;
LinkedList newList = new LinkedList();
int n = list.size();
for (int i = 0; i < n; ++i) {
AttributeInfo attr = (AttributeInfo)list.get(i);
newList.add(attr.copy(... | 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.