text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static boolean isValid(ParsingTreeNode node) {
if ((node == null)
||(node.getSymbol() == null)) {
return false;
}
if (node.getSymbol() instanceof NonTerminal) {
if (node.hasChildren()) {
for (int i = 0; i < node.getChildrenCount(); i... | 6 |
public boolean isFileNameUnique(String filename) {
for (int i = 0, limit = openDocuments.size(); i < limit; i++) {
if (PlatformCompatibility.areFilenamesEquivalent(filename, getDocument(i).getFileName())) {
return false;
}
}
return true;
} | 2 |
public void levelCompleted() {
if ( level.targets == 0 ) {
long diff = (System.nanoTime() - start_time) / 1000000;
JOptionPane.showMessageDialog(Game.this,
"steps: " + steps + "\n" + diff + " ms.");
current_level++;
if ( current_l... | 3 |
public void showNet() {
for (int i = 0; i < this.connection.length; i++) {
if (this.computers[i].isInfected()) {
System.out.println("PC № " + (++i) + " - is Infected");
i--;
} else {
System.out.println("PC № " + (++i) + " - is Safe");
... | 2 |
private Expression notStatement( List<Expression> args, String caller ) {
if ( args.size() != 1 ) {
System.err.println("not expected exactly one argument and got " + args.size() );
return new Void();
}
// returns the logical inverse
if ( args.get(0).show(defSubst,... | 2 |
void extractBase(String b) {
String b2 = extract(b, "href");
if (b2 != null) {
try {
base = new URL(base, b2);
} catch (MalformedURLException e) {
// e.printStackTrace();
}
}
} | 2 |
public ArrayList<ArrayList<Integer>> pathSumItr(TreeNode root, int sum) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
// DFS
ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();
if (root == null)
return re... | 8 |
public void preprocess4LabelledLDA(boolean entire,char delimiter){
BufferedReader br = null;
BufferedWriter bw = null;
String inFile = this.homeFolder + "/"+ L_BUG_TOPIC_ENTIRE_NAME;
String outFile = this.homeFolder + "/" + L_BUG_TOPIC_FILE_NAME;
try{
if(!new File(inFile).exists()){
throw new Excepti... | 7 |
@Override
public void apply(ImageView view, Study study) {
for(Image i : study.getImages()) {
BufferedImage origImg = i.getImageData();
BufferedImage img = new BufferedImage(origImg.getColorModel(), origImg.copyData(null), origImg.isAlphaPremultiplied(), null);
... | 3 |
public int getTapeHead() {
return tapeHead;
} | 0 |
public boolean similar(Object other) {
try {
if (!(other instanceof JSONObject)) {
return false;
}
Set<String> set = this.keySet();
if (!set.equals(((JSONObject)other).keySet())) {
return false;
}
Iterator<St... | 9 |
final void removeSuccs() {
if (succs == null)
return;
if (succs instanceof Instruction[]) {
Instruction[] ss = (Instruction[]) succs;
for (int i = 0; i < ss.length; i++)
if (ss[i] != null)
ss[i].removePredecessor(this);
} else
((Instruction) succs).removePredecessor(this);
succs = null;
} | 4 |
public void stateUpdated(BasicPlayerEvent e) {
if(oldStatus != getStatus())
{
for (MusicPlayerListener listener : listeners) {
listener.statusChanged(getStatus());
}
oldStatus = getStatus();
}
} | 2 |
public Collection<GameObject> getObjectsOfType(Class<?> gameObjType) {
cleanDeadObjects();
ArrayList<GameObject> resultList = new ArrayList<GameObject>();
for (GameObject obj : this.getGameObjects()) {
if (gameObjType.isInstance(obj))
resultList.add(obj);
}
return resultList;
} | 3 |
private static void equipItem() {
int heroChoice = 0;
int choice = 0;
String name = "";
while(choice != 4)
{
System.out.println("Please choose what hero you would like to change equipment on(Enter the hero number).\n"
+ "4). Or Exit.");
printHeroList();
try{
heroChoice = kb.nextInt();
... | 7 |
private void updateGunHeading() {
if (currentCommands.getGunTurnRemaining() > 0) {
if (currentCommands.getGunTurnRemaining() < Rules.GUN_TURN_RATE_RADIANS) {
gunHeading += currentCommands.getGunTurnRemaining();
radarHeading += currentCommands.getGunTurnRemaining();
if (currentCommands.isAdjustRadarForG... | 8 |
public void renderPreview(ShapeRenderer shapeRenderer) {
shapeRenderer.begin();
for (int side = 0; side < 6; ++side) {
if (side == 0) {
shapeRenderer.normal(0F, 1F, 0F);
}
if (side == 1) {
shapeRenderer.normal(0F, -1F, 0F);
... | 7 |
public static void main(String[] args) {
if (DEBUGGING) {
// Display the command line args.
System.out.println("Starting with args:");
for (int i = 0; i < args.length; i++) {
System.out.println(i + ":" + args[i]);
}
}
// Get the... | 3 |
public void wordChars(int low, int hi) {
if (low < 0)
low = 0;
if (hi >= ctype.length)
hi = ctype.length - 1;
while (low <= hi)
ctype[low++] |= CT_ALPHA;
} | 3 |
private static final String nameToID(final String mdName) {
if (Registry.SHA_HASH.equalsIgnoreCase(mdName)
|| Registry.SHA1_HASH.equalsIgnoreCase(mdName)
|| Registry.SHA160_HASH.equalsIgnoreCase(mdName)) {
return "0";
} else if (Registry.MD5_HASH.equalsIgnoreCase(mdName)) {
... | 9 |
public void execute() {
System.out.println("Called FirstStrategy.execute()");
} | 0 |
public NormalDistribution(double mean,double standardDeviation, long SEED)
{
super(mean, standardDeviation,SEED);
//initialize the queue for output
q=new LinkedList();
this.SEED = SEED;
//getDistribution(0.5);
//getDistribution();
} | 0 |
public void handleRequest(HttpRequest req) {
// TODO: handle the failed requests, returning error responses.
HttpRequestHeader hdr = (HttpRequestHeader) req.getHeader();
if (Cache.isCachable(hdr)) {
//proxy.logger.info("URL "+hdr.getURL()+" is cachable");
CachableHttpObject obj = proxy.cache.get(hdr);
i... | 8 |
void print(Node t, int n, boolean p)
{
if (p)
{
this.ifFunc(t);
if (isFunc)
{
if (t.getCdr() != null)
{
t.getCar().print(-n, false);
System.out.println();
printDefine(t.ge... | 5 |
public boolean isBlocked(Location loc1, Location loc2) {
int r1 = loc1.row;
int c1 = loc1.col;
int r2 = loc2.row;
int c2 = loc2.col;
int dx = r2 - r1;
int dy = c2 - c1;
// trivial move?
if ((dx == 0) && (dy == 0))
return false;
int mdx = Math.abs(dx);
int mdy = Math.abs(dy);
// cute test:
... | 8 |
protected Matrix add_(Matrix m, Matrix destination) {
if (!isSameLength(m))
throw new IndexOutOfBoundsException("mxn do not equal this matrix");
for (int i = 1; i <= this.m; i++) {
for (int j = 1; j <= this.n; j++) {
destination.insert(i, j, this.get(i, j) + m.get(i, j));
}
}
return destination;
} | 3 |
private void luoKomponentit(Container container) {
setPiirtoalusta(new Piirtoalusta(pelaaja,kamera));
container.add(piirtoalusta);
} | 0 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Person)) return false;
Person person = (Person) o;
if (age != person.age) return false;
if (!name.equals(person.name)) return false;
return true;
} | 4 |
protected void addMod() {
if(modsList.getSelectedValue()==null){
con.log("Log","please select a mod to add first");
}
else if(profileList.getSelectedValue()==null){
con.log("Log","please select a profile before adding a mod");
}else
{ //No problems, lets go
String str = modsList.getSelectedValue().t... | 3 |
private static String js_substring(Context cx, String target,
Object[] args)
{
int length = target.length();
double start = ScriptRuntime.toInteger(args, 0);
double end;
if (start < 0)
start = 0;
else if (start > length)
... | 8 |
public void setColumn(int y, String values) {
if (y < matrix[0].length && matrix.length == ((values.length() / 2) + 1)) {
for (int i = 0; i < matrix.length; i++) {
matrix[i][y] = Integer.parseInt(values.substring(i * 2, i * 2 + 1));
}
}
} | 3 |
private void generateMaze()
{
System.out.println();
System.out.println("Generating maze");
System.out.println("===============");
Stack<IMazeCell> cellStack = new Stack<IMazeCell>();
int visitedCells = 0;
IMazeCell currentCell = chooseOriginCell();
mazeStruc... | 3 |
@Override
public PeerReference replace(String failedPath, RepairIssue[] issues) {
Host[] failedHosts = new Host[issues.length];
for (int i = 0; i < issues.length; i++) {
failedHosts[i] = Deserializer.deserializeHost(issues[i].failedPeer);
}
Host localhost = delegate_.repl... | 1 |
public void testWithTime_int_int_int() {
DateTime test = new DateTime(TEST_TIME1 - 12345L, BUDDHIST_UTC);
DateTime result = test.withTime(12, 24, 0, 0);
assertEquals(TEST_TIME1, result.getMillis());
assertEquals(BUDDHIST_UTC, result.getChronology());
test = new DateTime(... | 1 |
@Override
public Data assembleOperand(List<String> operandParts) {
//All operand part arrays will contain 3 parts: label, DATA declaration, and operand value
String label = operandParts.get(0).substring(0, operandParts.get(0).length() -1); //Trim semicolon from label
lookupTable.put(label, operandAddressPointer)... | 1 |
public void start() {
thread = new Thread(this);
thread.setName("Playback");
thread.start();
} | 0 |
public Class getColumnClass(int columnIndex) {
// Devuelve la clase que hay en cada columna.
switch (columnIndex)
{
case 0:
// La columna cero contiene el pid del proceso, que es
// un Entero
return Integer.class;
case 1:
... | 3 |
public void setStatus(String status) {
this.status = status;
} | 0 |
private List<ICard> getSet(List<ICard> list) {
LinkedList<ICard> setList = new LinkedList<ICard>();
if (list.size() >= NUMBEROFSETCARDS) {
for (ICard cardOne : list) {
for (ICard cardTwo : list) {
if (!cardOne.equals(cardTwo)) {
for (ICard cardThree : list) {
if (proveIfIsASet(cardOne, ca... | 8 |
private JLabel createPiece(int row, int col){
JLabel piece = new JLabel();
piece.setPreferredSize(new Dimension(50,50));
board_[7-row][col] = piece;
if (isManipulable_){
System.out.println("Panel has been added with InputListener");
piece.addMouseListener(new UserInputListener());
System.out.println("A... | 9 |
public void cargarListaBorrar(){
try{
r_con.Connection();
String puntoVenta=combo_pto_venta.getSelectedItem().toString();
ResultSet rs=r_con.Consultar("select tc_codigo,tc_descripcion,vxc_numero "
+ "... | 6 |
public static void main(String[] args){
mongoDB();
System.out.println("connected");
ArrayList<BasicDBObject> myList = new ArrayList<BasicDBObject>();
////////////////////////////////////////////////////
BasicDBObject query1 = new BasicDBObject("hashtags.text", "gameofthrones");
BasicDBObject query2 = new Ba... | 8 |
@Override
public int compareTo(Object arg0)
{
if (arg0 instanceof WeightedCellSorter)
{
if (weightedValue > ((WeightedCellSorter) arg0).weightedValue)
{
return 1;
}
else if (weightedValue < ((WeightedCellSorter) arg0).weightedValue)
{
return -1;
}
}
return 0;
} | 3 |
@Basic
@Column(name = "LOG_POS_ID")
public int getIdPos() {
return idPosLogEnt;
} | 0 |
private void PrintToFile(String output,String filename){
try
{
FileWriter fstream = new FileWriter(filename, true); //true tells to append data.
BufferedWriter out = new BufferedWriter(fstream);
out.write(output);
out.close();
}
catch (Exception e)
{
System.err.println("Error: " + e.get... | 1 |
@Override
public boolean truncate(String table) {
Statement statement = null;
String query = null;
try {
if (!this.isTable(table)) {
this.writeError("Table \"" + table + "\" does not exist.", true);
return false;
}
statement = connection.createStatement();
query = "DELETE FROM " + table + ";"... | 5 |
static long getIntLimit(final int factor)
{
if (factor >= LIMITS.length)
{
return 1;
}
else
{
return LIMITS[factor];
}
} | 1 |
boolean setY(int y) {
if (y < height)
this.y = y;
return y < height;
} | 1 |
private CommucObj doDistrDACSSlave(CommucObj cObj) {
long startTime = System.currentTimeMillis();
//boolean ligPresent = cObj.ligPresent;
//Setup the molecule system
Molecule m = new Molecule();
m = setupMolSystem(m,cObj.params,cObj.strandPresent,cObj.strandLimits);
RotamerSearch rs = (Rotam... | 8 |
private static void lsonejob(String jobId, AbstractMap<String, JobStatus> jobStatusTbl) {
System.out.println("--------------------------------");
System.out.println("Job Name: " + jobStatusTbl.get(jobId).jobName);
System.out.println("Job ID: " + jobId);
System.out.println("Number of mapper tasks in total: " + ... | 5 |
public float getB() {
return b;
} | 0 |
public Map<String, Object> toConfigurationNode() {
Map<String, Object> output = new LinkedHashMap<String, Object>();
output.put("group", group);
if (subgroups != null && subgroups.size() != 0) {
output.put("subgroups", subgroups);
}
if (permissions != null && permissions.size() != 0) {
Map<String, List<... | 9 |
private SelectionTransition findTransitionContaining(IWorkbenchPartReference activePart) {
for (SelectionTransition transition : transitions) {
if(transition.has(activePart)) {
return transition;
}
}
return null;
} | 2 |
public boolean terminateWrapperP() {
{ Wrapper self = this;
if ((self == Stella.NULL_LONG_INTEGER_WRAPPER) ||
((self == Stella.NULL_FLOAT_WRAPPER) ||
((self == Stella.NULL_STRING_WRAPPER) ||
((self == Stella.NULL_MUTABLE_STRING_WRAPPER) ||
((self == Stella.NULL_C... | 7 |
@SuppressWarnings("unchecked")
public AliasedMethodTable(Map<E, Double> elementsToWeight) {
if (requireNonNull(elementsToWeight, "elementsToWeight is null").size() == 0) {
throw new IllegalArgumentException("elementsToWeight is empty");
}
elements = (E[]) elementsToWeight.keySet(... | 8 |
public static String getFileNameFromPathName(String pathNameString) {
File file = new File (pathNameString) ;
if (file == null) {
return null ;
} else {
return file.getName() ;
} // end else
} // end method trimOffAnyFileExtension | 1 |
public Socket getSocket() {
return serverSide;
} | 0 |
public void loadBinaryProblem(String filename) {
String row;
ArrayList<Integer> classes = new ArrayList<Integer>();
ArrayList<FeatureNode []> examples = new ArrayList<FeatureNode []>();
try {
BufferedReader r = new BufferedReader(ne... | 4 |
public boolean setBossClass(String classname) {
HeroClass hc = hr.getClassManager().getClass(classname);
if (hc == null) {
return false;
}
this.bossclass = hc;
return true;
} | 1 |
public String getCuenta() {
return cuenta;
} | 0 |
public static void executeSqlFile(String path) throws SQLException, IOException, ClassNotFoundException {
Class.forName("org.postgresql.Driver");
Connection connection = null;
connection = DriverManager.getConnection(
Configuration.getJdbcString(), Configuration.user, Configurati... | 1 |
public static void main(String[] args) {
// TODO code application logic here
Scanner teclado = new Scanner(System.in);
System.out.println("Digite el # de impresiones que desea ver");
Ejercicio1 oEjercicio1=new Ejercicio1((Integer.parseInt(teclado.nextLine())));
System.out.print(o... | 6 |
public String getChildElementXML() {
StringBuilder buf = new StringBuilder();
buf.append("<query xmlns=\"http://jabber.org/protocol/bytestreams\"");
if (this.getType().equals(IQ.Type.SET)) {
if (getSessionID() != null)
buf.append(" sid=\"").append(getSessionID()).app... | 9 |
private static boolean ArePermutations(long n1, long n2) {
char[] n1Chars = Long.toString(n1).toCharArray();
char[] n2Chars = Long.toString(n2).toCharArray();
if (n1Chars.length != n2Chars.length) {
return false;
}
for (int i = 0; i < n1Chars.length; i++) {
... | 7 |
public void drawBoard() {
String s = " ";
for (int i = 0; i < locations.length; i++) {
s += String.format("%2d", i);
}
s += "\n ";
for (int i = 0; i < locations.length; i++) {
s += " _";
}
s += "\n";
for (int y = 0; y < locations[0].length; y++) {
for (int x = 0; x < locations.length; x++) {
... | 6 |
public String getRequestUncached(String path)
{
URL url;
StringBuilder content = new StringBuilder();
try
{
url = new URL(BaseURL + path);
HttpsURLConnection con = (HttpsURLConnection)url.openConnection();
String OAuth =
String.format
(
"OAuth oauth_token=\"%s\", oauth_client_id=\"%s\",... | 4 |
@Override
public String endSection(Marker marker) {
if (marker == null) {
return super.endSection(marker);
} else if (marker instanceof VcfEntry) {
// Ignore other markers (e.g. seqChanges)
if (vcfEntries != null) vcfEntries.add((VcfEntry) marker);
return super.endSection(marker);
}
return null;
} | 3 |
public void quit() {
dispose();
} | 0 |
public AutocompleteJCBCategory() {
super();
setEditable(true);
Component c = getEditor().getEditorComponent();
if (c instanceof JTextComponent) {
final JTextComponent tc = (JTextComponent) c;
tc.getDocument().addDocumentListener(new DocumentListener() {
... | 6 |
@Override
public boolean equals( Object other ) {
if ( other == this ) {
return true;
}
if ( !( other instanceof TShortList ) ) return false;
if ( other instanceof TShortArrayList ) {
TShortArrayList that = ( TShortArrayList )other;
if ( that.size... | 9 |
public void setNative(final boolean flag) {
if (this.isDeleted) {
final String s = "Cannot change a field once it has been marked "
+ "for deletion";
throw new IllegalStateException(s);
}
int mod = methodInfo.modifiers();
if (flag) {
mod |= Modifiers.NATIVE;
} else {
mod &= ~Modifiers.NATIV... | 2 |
private void initialize() {
Ant initialAnt = null;
if (this.initialIndividual != null) {
initialAnt =
(Ant) new Ant(initialIndividual.getPersonWorkLists());
} else {
initialAnt = new Ant();
}
//other initializations
rand = new Random();
indexes = new int[subProjectNumber*s... | 5 |
public void onPlayerChunkChange(ChunkyPlayer chunkyPlayer, ChunkyChunk toChunk, ChunkyChunk fromChunk) {
try {
if (Config.isDebugging()) {
Location loc = chunkyPlayer.getPlayer().getLocation();
//Logging.debug(chunkyPlayer.getName() + " x: " + loc.getX() + " z: " + l... | 9 |
private void func_27332_a(int var1) {
if(13 == var1) {
this.field_27337_b = 0;
++this.field_27340_c;
this.field_27339_d = true;
} else {
if(10 == var1 && !this.field_27339_d) {
this.field_27337_b = 0;
++this.field_27340_c;
} else {
... | 3 |
public void setName(String name) {
this.name = name;
} | 0 |
void leftRotate(RedBlackNode x)
{
RedBlackNode y = x.right; // set y
x.right = y.left; // turn y's left subtree into x's right subtree
if(y.left != nil)
y.left.parent = x;
y.parent = x.parent; // link x's parent to y
if(x.parent == nil)
root = y;
else if (x == x.pare... | 3 |
@Override
public Boolean find(String login, String password) {
try {
connection = getConnection();
ptmt = connection.prepareStatement(QUERY_SELECT + " WHERE Login=? AND password=?;");
ptmt.setString(1, login);
ptmt.setString(2, password);
resultSet... | 5 |
@Override
public void pushAround(Position pos, Map map) {
// TODO Auto-generated method stub
if (map.getMapEach(pos.x - 1, pos.y + 1) == 0) {
Position tempPos = new Position();
tempPos.x = pos.x - 1;
tempPos.y = pos.y + 1;
stack.push(tempPos);
}
if (map.getMapEach(pos.x - 1, pos.y) == 0) {
Po... | 8 |
public static Collection<Document> parseLibraryTFIDF() throws FileNotFoundException {
Set<Document> result = new HashSet<Document>();
Map<String, Integer> docFrequency = new HashMap<String, Integer>();
for (String filename : LIBRARY){
Set<String> seenWords = new HashSet<String>();
String filePath = "data... | 5 |
protected void formDirectionList(SessionRequestContent request) throws ServletLogicException {
Criteria criteria = new Criteria();
User user = (User) request.getSessionAttribute(JSP_USER);
if (user != null) {
criteria.addParam(DAO_USER_LOGIN, user.getLogin());
ClientType ... | 7 |
protected void handleTOCEntry() throws IOException {
if (tocEntryLen == 0) {
if (tocEntryOffset >= BASE_ENTRY_LENGTH) {
if (getU16(0x00) != 0x4b50 || getU16(0x02) != 0x0201)
return;
tocEntryLen = BASE_ENTRY_LENGTH
+ getFileNameLength() + getU16(0x1e) + getU16(0x20);
if (tocEntryLen > t... | 8 |
private List<String> getPID(String programName) throws IOException {
logger.detailedTrace("Obtaining PIDs for " + programName);
Process process = new ProcessBuilder("wmic", "Path", "win32_process", "Where",
commandLike(programName), "Get", "Caption,", "ProcessId").start();
Buffe... | 5 |
private boolean checkCard(Scanner in)
{
System.out.println("Please enter your card information : ");
String inputBankID = in.next();
int inputCardID = Integer.parseInt(in.next());
currentCustomer = new CashCard(inputBankID, inputCardID);
if(inputBankID.equals(supportedBank.getBankID())
... | 4 |
private void reportProgress()
{
lastReport = Config.Now();
double perc = ((double)(reportTotal + reportNum) / (double)reportTarget) * 100;
if (perc > 100) perc = 100;
sendMessage(reportNum + " more chunks processed (" + (reportTotal + reportNum) + " total, ~" + Config.coord.format(perc) + "%" + ")");
reportT... | 2 |
public void setValidator(Validator<T> validator) {
this.validator = validator;
} | 0 |
public InetAddress getIP() {
InetAddress a = null;
try {
for (Enumeration<NetworkInterface> en = NetworkInterface
.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf
.getInetAddresses(); enumIpAddr.hasMoreE... | 8 |
public void updateTiles(Graphics g) {
for (int i = 0; i < Util.FULL_SIZE; i++) {
int y = i % Util.MAP_SIZE;
int x = i / Util.MAP_SIZE;
g.setColor(Color.BLACK);
if (tiles[i] == TileColor.SNAKE) {
g.setColor(Color.BLUE);
if(Snake.skipping)
g.setColor(Color.RED);
g.fillRect(x * Util.MAP_SIZE... | 8 |
public void loadBank(){
orderDataAccesor dataAccessOrder=new orderDataAccesor();
List<bank> bankList=new ArrayList();
DefaultTableModel orderDataTable=new DefaultTableModel();
Object[ ] columnNames=new Object[4];
Object[ ] fieldValues=new Object[4];
//Patient m... | 4 |
public ConfigurationSelectionEvent(ConfigurationPane configurationPane) {
super(configurationPane);
} | 0 |
private void handleWebSocketFrame(ChannelHandlerContext ctx, WebSocketFrame frame) {
// Check for closing frame
if (frame instanceof CloseWebSocketFrame) {
handshaker.close(ctx.channel(), (CloseWebSocketFrame) frame.retain());
return;
}
if (frame instanceof PingW... | 9 |
public void discoverChildren() {
int j=0;
for(int i=startIndex;i<list.length;i++) {
if(j>Gs.DisplayLimit) {
addChild(new GsMore(list,i,type));
break;
}
j++;
if(type.compareToIgnoreCase("songs")==0)
addChild(new GsPMSSong((GsSong)list[i]));
else if(type.compareToIgnoreCase("albums")==0)
... | 5 |
private void read() throws IOException {
for (;;) {
if (decoder.decode(readBuffer)) {
return;
}
readBuffer.compact(); // go to write mode
final int numBytesRead = readChannel.read(readBuffer);
if (numBytesRead == 0) {
throw new IllegalStateException("Ready zero (0) bytes from channel");
}
... | 4 |
public List<Booking> getAllBookings() throws SQLException
{
try (Connection con = connector.getConnection())
{
String sql =
"select CourtBooking.*, [Member/Booking].MemberId"
+ " from CourtBooking"
+ " Left Join [Member/Booking]"
+ " on Co... | 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 |
private void updateCurrentLogFile()
{
// get the log file name from the file system
File logFolder = new File(slateComponent.getLogDirectoryName());
File[] listOfLogFiles = logFolder.listFiles();
numLogFiles = listOfLogFiles.length;
if (numLogFiles == 0)
{
return;
}
if ((RotationParadigm.Boun... | 9 |
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
String JSONtext = "";
switch (command) {
case "chatmessage": // JTextField
try {
JSONtext = enc.encode(new Message(tg.chat.field.getText(),
tg.chat.userName));
tg.chat.field.setText("");
sendMessage(JSONtex... | 7 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Message message1 = (Message) o;
if (date != null ? !date.equals(message1.date) : message1.date != null) return false;
if (message != null ? !me... | 9 |
public void parseHCPout() {
in = new Scanner(System.in);
boolean success = false;
// Keep trying if file not found
while (!success) {
System.out.print("Awaiting NEOS output .txt file (or 000 to exit): ");
String NEOSfile = in.nextLine();
if (file.trim().equals("000")) {
System.out.println("Progra... | 6 |
@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 Usuario)) {
return false;
}
Usuario other = (Usuario) object;
if ((this.idUsuario == null && other.idUsuario !=... | 5 |
public void actionPerformed(ActionEvent event) {
if(event.getActionCommand().equals(ok.getActionCommand())){
if(singleNodePosition == null) try {
int num = Integer.parseInt(number.getText());
if(num <= 0){
throw new NumberFormatException();
}
AppConfig.getAppConfig().generateNodesDlgNumNodes =... | 5 |
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.