text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
LineWidget lineOne = new LineWidget(shell, LineDirection.Horizontal, 50, 5, 10);
lineOne.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Li... | 2 |
@Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_ENTER){
String text = input.getText();
data.setLastLine(text);
if (response){
data.setText(text + "\n" +data.getText());
}
... | 7 |
protected void compareDatasets(Instances data1, Instances data2)
throws Exception {
if (!data2.equalHeaders(data1)) {
throw new Exception("header has been modified\n" + data2.equalHeadersMsg(data1));
}
if (!(data2.numInstances() == data1.numInstances())) {
throw new Exception("number of instan... | 8 |
@Override
public void setResponseRemoteCallObject(IRemoteCallObject rco) {
response = rco;
} | 0 |
final protected void update(){
if(createWhen()){
list.add(create());
}
for(int i=0;i<list.size();i++){
SingleObject bl=list.get(i);
if(inRange(bl)){
whenCrash();
}
if(removeWhen(bl)){
list.remove(bl);
i--;
}
}
for(int i=0;i<list.size();i++){
SingleObject bl=list.get(i);
... | 5 |
public void setIP(String ip) {
clientIP = ip;
} | 0 |
private int minmax(Color p, Board b, int d, int cutoff,
ArrayList<Integer> moves) {
bestSoFar = Integer.MIN_VALUE;
moves.clear();
if (d == 0) {
return staticEval(p, b);
}
for (int move = 0; move < b.size() * b.size(); move += 1) {
if (b.isLegal... | 7 |
public static ArrayList<BillItem> listBillItems(int billID) {
String query = "SELECT *"
+ "FROM `billItem`"
+ "WHERE `billItem`.`billId` = '%d';";
ArrayList<BillItem> listOfBillItems = new ArrayList<>();
DBA dba = Helper.getDBA();
try {
Resul... | 3 |
private int setStats(int idx, int value){
int bonus = 0;
this.stats[idx] += value;
if(stats[idx] < 0){
bonus = stats[idx];
stats[idx] = 0;
}else if(stats[idx] > getMaxStats(idx)){
bonus = stats[idx] - maxStats[idx];
stats[idx] = maxStats[idx];
}
return bonus;
} | 2 |
private final Path getPathFunc(final String[] names, int offset) {
Path p = this;
for (int i = offset; i < names.length; ++i) {
final String name = names[i];
final PathReference pWeak;
if (name.startsWith(".")) {
if (name.equals(".")) {
continue;
} else if (name.equals("..")) {
if (p.pare... | 8 |
public void moveRight(){
switch (polygonPaint) {
case 0:
line.moveRight();
repaint();
break;
case 1:
curv.moveRight();
repai... | 7 |
@SuppressWarnings("unchecked")
public Class<Mapper<Writable, Writable, Writable, Writable>> loadClass ()
throws IOException, ClassNotFoundException {
/* Load Jar file */
String jarFilePath = this.task.getJarEntry().getLocalPath();
JarFile jarFile = new JarFile(jarFilePath);
Enumeration<JarEntry> e = jarF... | 4 |
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
//System.out.println(localName+" "+qName);
if (qName.equalsIgnoreCase("layer")) {
rightLayer = true;
}
else if (qName.equalsIgnoreCase("srs")) {//Odotetaan että XML-documentiss... | 8 |
private int checkHeight(BTPosition<T> current) {
if (current == null)
return 0;
int leftH = checkHeight(current.getLeft());
if (leftH == -1)
return -1;
int rightH = checkHeight(current.getRight());
if (rightH == -1)
return -1;
int diff = leftH - rightH;
if (Math.abs(diff) > 1)
return -1;
... | 4 |
public void sendInitiatedNotification() {
for (long uid : this.aWaitingId)
{
JointAppointmentInitiated notification =
new JointAppointmentInitiated(this);
Notification.add(uid, notification);
}
} | 1 |
public int getequal2(String newtitle) {
try{
@SuppressWarnings("resource")
ObjectInputStream osi = new ObjectInputStream(new FileInputStream("bookcollection.txt"));///óϾ , Ͼ׳ϴ° ҽ߰
this.setBookCount(osi.readInt());
collectionb.clear();
for( int i= 0; i< this.getBookCount();i++){
Book ms = (Book)osi... | 4 |
public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[59];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 0; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if... | 9 |
public void appendValue(String value) throws NoSuchMethodException {
try {
String currentValue = getValue();
setValue((currentValue == null ? "" : currentValue) + value);
} catch (NoSuchMethodException e) {
// try "add"
try {
Method method = target.getClass().... | 4 |
private void calculate() {
int termLength, payFreq;
loanScheduleTableModel.setRowCount(0);
// set PDL paydown amount
try {
String aprStr = aprTextField.getText();
calculator.setInstallAPR(Double.parseDouble(aprStr));
} catch (NullPointerException npe) {
... | 7 |
public void setFechaConstru(long fechaConstru) {
if (this.fechaConstru > fechaConstru)
this.fechaConstru = fechaConstru;
} | 1 |
public TableModel Update() {
String columnNames[] = { "Lib Classe","Liste Filiere"};
DefaultTableModel defModel = new DefaultTableModel();
defModel.setColumnIdentifiers(columnNames);
SequenceController seq_classe= new SequenceController();
seq_classe.CreateSequence("SEQ_CLASSE")... | 4 |
public void tick() {
entities.removeAll(removeList);
snake.removeEntities(removeList);
for (Entity entity : entities) {
((EntityBody) entity).tick();
Random r = new Random();
int vx = r.nextInt(30)-15;
int vy = r.nextInt(30)-15;
snake.particles.create(entity.x, entity.y,vx,vy, Color.WHITE);
}... | 2 |
void output(int code, OutputStream outs) throws IOException {
cur_accum &= masks[cur_bits];
if (cur_bits > 0)
cur_accum |= (code << cur_bits);
else
cur_accum = code;
cur_bits += n_bits;
while (cur_bits >= 8) {
char_out((byte) (cur_accum & 0xff), outs);
cur_accum >>= 8;
... | 8 |
public static boolean propertyEqualsAsBoolean(PropertyContainer container, String key, boolean test_value) {
if (container != null) {
try {
boolean value = getPropertyAsBoolean(container, key);
return value == test_value;
} catch (NullPointerException npe) {
return false;
}
} else {
throw ne... | 2 |
static public String repair(String input) {
int cast = 0;
if( input.length() == 3) {
char num1 = '\0', num2 = '\0';
char c = '\0';
for(int i = 0; i < input.length(); i++) {
char temp = input.charAt(i);
if(Character.isDigit(temp)) {
if( num1 == '\0') {
num1 = temp;
cast++;
}
... | 8 |
public boolean intervalContainsGeometry(RoadGeometry section, int beginning, int end) {
for (int i = beginning; i <= end; i++) {
if (stakes.get(section).contains(i)) {
return true;
}
}
return false;
} | 2 |
public String[] promptKeyboardInteractive(String destination,
String name,
String instruction,
String[] prompt,
boolean[] echo) {
Container ... | 4 |
public static boolean date(int h, int m) {
String hh, mm;
if (h == 0) {
if (m < 10)
return true;
else {
mm = m + "";
return mm.charAt(0) == mm.charAt(1);
}
} else if (h < 10) {
hh = h + "";
mm = format(m);
return hh.charAt(0) == mm.charAt(1);
}
hh = format(h);
mm = format(m);
... | 3 |
public boolean equals(final Object duration) {
if (duration == this) {
return true;
}
if (duration instanceof Duration) {
return compare((Duration) duration) == DatatypeConstants.EQUAL;
}
return false;
} | 2 |
public void write_single(short address, short msg) throws IOException {
if ((this.mode==0) || (this.mode==SET_MODE_I2C_SERIAL)) this.set_mode(SET_MODE_I2C_100);
byte[] data=new byte[3];
data[0]=(byte)RW_SINGLE;
data[1]=(byte)address;
data[2]=(byte)msg;
byte[] result = this.sendAndRec... | 4 |
void clear () {
checked = grayed = false;
texts = null;
textWidths = new int [1];
fontHeight = 0;
fontHeights = null;
images = null;
foreground = background = null;
displayTexts = null;
cellForegrounds = cellBackgrounds = null;
font = null;
cellFonts = null;
cached = false;
super.setText ("");
super.setIm... | 3 |
public static String readDecodedString(LittleEndianAccessor llea) {
int strLength;
byte b = llea.readByte();
if (b == 0x00) {
return "";
}
if (b >= 0) {
// UNICODE BABY
if (b == 0x7F) {
strLength = llea.readInt();
} else {
strLength = (int) b;
}
if (strLength < 0) {
log.error... | 8 |
public Entity getEntityByClass(String className){
for(Class<?> c : entitys){
if(c.getName().equals(className)){
try {
return (Entity) c.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
}
try {
Class<?> c = Class.forName(className);
if(Entity.class.isAssignabl... | 7 |
@SuppressWarnings("unchecked")
public boolean isInitialized() {
// Check that all required fields are present.
for (final FieldDescriptor field : getDescriptorForType().getFields()) {
if (field.isRequired()) {
if (!hasField(field)) {
return false;
}
}
}
// Check ... | 9 |
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if(this.codCliente <= 0){
errors.add("Errores", new ActionMessage("error.codigo.cliente.no.valido"));
}
if(this.codMedida <= 0){
er... | 7 |
public String toString() {
return this.getPrefix() + this.getNick();
} | 0 |
private static double[] getSupportPoints(int lineNumber, double[] lowPrices) {
double[] sPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 999999999;
for(int j=-28;j<=0;j++){
if((i+j>=0) && (i+j<lineNumber-1) && lowPrices[i+j]<pr... | 5 |
@Override
public void broadcast(AIPlayer p, gamelogic.PublicGameBoard board) {
String message = "5/" + p.getID() + ",";
BoardCoordinate c = _target.location();
int v = -1;
boolean exp = board.isExpanded();
int nv = (exp)? NUM_VERTICES_EXP:NUM_VERTICES;
Map<Integer, List<Integer>> x_gr = (exp)? X_GROUPS_EXP... | 9 |
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 int nEquipa(String cod_competicao){
try {
int i=0;
Statement stm = conn.createStatement();
ResultSet rs = stm.executeQuery("SELECT cod_equipa FROM EquipaCampeonato where cod_competicao='"+cod_competicao+"'");
for (; rs.next(); i++);
... | 2 |
public void remover(InstituicaoSubmissao instituicaosubmissao) throws Exception
{
String sql = "DELETE FROM instituicaosubmissao WHERE id = ?";
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setLong(1, instituicaosubmissao.getId());
stmt.executeUpdate();
... | 1 |
private void compileParameters() throws IllegalArgumentException, IllegalAccessException, MalformedLayarRequestException {
Field[] fields = LayarGetPOIsRequest.class.getFields();
for (Field f : fields) {
String fName = f.getName();
Class fClass = f.getType();
if(parameters.containsKey(fName)) {
String[... | 6 |
public void testWithFieldAdded_unknownField() {
YearMonth test = new YearMonth(2004, 6);
try {
test.withFieldAdded(DurationFieldType.hours(), 6);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public Aluno pesquisaAlunoPelaMatricula(String matricula)
throws AlunoInexistenteException {
Aluno alunoAchado = null;
for (Aluno e : alunos) {
if (e.getMatricula().equals(matricula)) {
alunoAchado = e;
break;
}
}
if (alunoAchado != null) {
return alunoAchado;
} else {
throw new AlunoI... | 3 |
@Override
public void valueChanged(ListSelectionEvent event) {
if (!event.getValueIsAdjusting()) {
ListSelectionModel lsm = (ListSelectionModel) event.getSource();
if (lsm.isSelectionEmpty() == false) {
try {
int selectedRow = lsm.getMinSelectionIndex();
// da in der Tabelle die Autosortierung ... | 3 |
final void method3049(ByteBuffer class348_sub49, int i, int i_39_) {
while_209_:
do {
try {
anInt9384++;
if (i_39_ == 31015) {
int i_40_ = i;
do {
if ((i_40_ ^ 0xffffffff) != -1) {
if ((i_40_ ^ 0xffffffff) != -2) {
if (i_40_ == 2)
break;
break while_209_;
}
... | 8 |
public int findBomb(int startIndex, int stopIndex) {
startIndex=(startIndex+LANDNUM)%LANDNUM;
stopIndex=(stopIndex+LANDNUM)%LANDNUM;
if(startIndex>stopIndex){
for(int i=startIndex;i<LANDNUM;i++){
LandForm tempLandForm=(LandForm)landList.get(i);
if(temp... | 7 |
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length < 1) {
showHelp(sender);
return true;
}
String[] newArgs = new String[args.length - 1];
for (int i = 1; i < args.length; i++) {
newArgs[i - 1] = args[i];
}
AbstractCommand com... | 6 |
public static int Compare(NaturalNumber n, NaturalNumber m)
{
int i, comparison;
if(n.size != m.size)
{
/* the longer one is not necessarily the greater, if the
difference is all leading zeroes -- scan the excess: if there
is a nonzero digit, then the longer one is the greater, else
proc... | 7 |
public boolean defilerTemps(Joueur j)
{
/* Methode qui compare le temps du systeme au temp de jeu d'un joueur.
* Met fin à la partie si le temps de jeu est ecoule. */
// MAJ temps
boolean fini = false;
do
{
try
{
Thread.sleep(1000);
j.setTempsEcoule(j.getTempsEc... | 8 |
private void bfs(Graph G, int s)
{
Queue<Integer> q = new LinkedList<Integer>();
q.add(s);
marked[s] = true;
while (!q.isEmpty())
{
adjCount[s]++;
int v = q.remove();
for (int w : G.adj(v))
if (!marked[w])
{
edgeTo[w] = v;
marked[w] = true;
distTo[w] = distTo[v] + 1;
... | 5 |
protected String getJSONBaseString() {
StringBuilder json = new StringBuilder();
if(this.getId()!=null)
json.append("\"id\":").append(JSONObject.quote(this.getId())).append(",");
json
.append("\"type\":\"").append(this.getType()).append("\"," )
.append("\"text\":").append(JSONObject.quote(this.getText())... | 8 |
public void advance() {
if (location == null) {
location = new Location(map.start[0], map.start[1]);
grid.add(location, this);
}else if(health <= 0) {
kill();
}else{
if(step > speed) {
step = 0;
Location l... | 5 |
public void putRecent(String f) {
// Trim from back end if too long
while (recentNames.size() > maxRecentFiles - 1) {
recentNames.remove(recentNames.size()-1);
}
// Move filename to front: Remove if present, add at front.
if (recentNames.contains(f)) {
recentNames.remove(f);
}
recentNames.add(0, f);... | 3 |
public ArrayList<ArrayList<String>> readData() throws IOException {
ArrayList<ArrayList<String>> datas = new ArrayList<ArrayList<String>>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String str = "";
while (!(str = reader.readLine()).equals("")) {
... | 2 |
public static void main(String[] args) {
FilePrompt.filePrompt();
} | 0 |
public Question(String question,String a,String b,int i){
if(i > 1){
i = 1;
}
formattedQuestion = question;
answers = new String[2];
answers[0] = a;
answers[1] = b;
answer = i;
} | 1 |
@Override
public void mouseClicked(MouseEvent event) {
if(event.getClickCount()==2){
int linha = janela.getTabelaContatos("todos").getSelectedRow();
System.out.println("Linha selecionada foi "+linha);
} else if (event.getClickCount()==1){
}
} | 2 |
private void onIncorrect()
{
isCorrect = false;
dispose();
} | 0 |
public static void moveAll() {
Map map = Map.getInstance();
Random rand = new Random();
int num = 0;
for (Party enemy : list) {
num = rand.nextInt(10);
if(num == 0 && map.moveParty(enemy, Direction.NORTH))
enemy.move(Direction.NORTH);
else if(num == 1 && map.moveParty(enemy, Direction.SOUTH... | 9 |
private void setField(FieldDictionary dictionary, OMMFieldEntry fentry, FidDef fiddef,
boolean ripple, boolean add)
{
FieldValue field = getValue(fiddef.getName());
if (field == null)
{
if (add)
{
short type = fentry.getDataType();
... | 9 |
public JSONObject putOnce(String key, Object value) throws JSONException {
if (key != null && value != null) {
if (this.opt(key) != null) {
throw new JSONException("Duplicate key \"" + key + "\"");
}
this.put(key, value);
}
return this;
} | 3 |
private void hazardCheckLine(int p,Point2D.Double p1,Point2D.Double p2) {
int h = 0;
Point2D.Double pointIntersect;
Line2D.Double lineR = new Line2D.Double();
lineR.setLine(p1, p2);
while (h < main.map.hazards) {
h++;
MapHazard hz = main.map.ge... | 8 |
private void printSemiIfNeed(JsNode node) {
if (!(node instanceof JsFunction) &&
(node instanceof JsLiteral ||
node instanceof JsInvocation ||
node instanceof JsArrayAccess ||
node instanceof JsBinaryOperation ||
node instanceof JsUnaryOperation ||... | 8 |
private static A convert(String regex) {
List<String> groups = splitAndGroup(regex);
A curr = new A();
if (groups.size() > 1) {
for (String s : groups) {
A tmp = convert(s);
curr.stateNames.addAll(tmp.stateNames);
curr.transitionsForState.putAll(tmp.transitionsForState);
curr.addTransition(cur... | 9 |
public static void compileJarAssetsFile(String prjCompileDir, String prjGameName, String prjDir) {
File selectedFile = new File(prjCompileDir + File.separator + prjGameName.toLowerCase() + ".assets.jar");
File content = new File(prjDir);
File[] files = content.listFiles();
assert files !... | 8 |
public boolean equals(Object obj)
{
if (!(obj instanceof JavaAdapterSignature))
return false;
JavaAdapterSignature sig = (JavaAdapterSignature) obj;
if (superClass != sig.superClass)
return false;
if (interfaces != sig.interfaces) {... | 9 |
public MainFrame(User user) {
super(JGSystem.NAME);
this.user = user;
this.DEFAULT_MAIN_FRAMESIZE = new Dimension(1024, 768);
this.PREFERRED_PANEL_SIZE = new Dimension(1024-5-25, 768-25-25);
this.setSize(this.DEFAULT_MAIN_FRAMESIZE);
this.setMaximumSize(this.DEFAULT_MAIN_FRAMESIZE);
this.setLayout(new Bor... | 1 |
private void genTextMaps(){
Session session = sessionFactory.openSession();
session.beginTransaction();
Query q1 = session.createQuery("from Intro_learn");
@SuppressWarnings("unchecked")
List<Intro_learn> list_intro = q1.list();
Intro_learn intro = new Intro_learn();
String introduction;
text_cls tc;... | 9 |
final public NodeToken ValueExpansion() throws ParseException {
Token value;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VALUE_IDENTIFIER_T:
value = jj_consume_token(VALUE_IDENTIFIER_T);
break;
case NOT_IMPLEMENTED_T:
value = jj_consume_token(NOT_IMPLEMENTED_T);
break;
case ... | 8 |
private PDestination(String whereTo) {
label = whereTo;
} | 0 |
public static void createWindow(int width, int height, String title)
{
Display.setTitle(title);
try
{
Display.setDisplayMode(new DisplayMode(width, height));
// DisplayMode displayMode = null;
// DisplayMode[] modes = Display.getAvailableDisplayModes();
//
// for (int i = 0; i < modes.leng... | 1 |
@Override
public void update() {
super.update();
boolean doUpdate = !gameController.getIsMasterPaused();
HUD hud = null;
for (int i = 0; i < huds.size(); i++) {
hud = huds.get(i);
if (doUpdate || hud.getName().equals("Pause") || hud.getName().equals("Tutori... | 6 |
private MetadataEntry getUserMetadata(GoogleDocs googleDocs) throws ServiceException
{
DocsService docsService = new DocsService("spring-social-google-docs/1.0");
docsService = googleDocs.setAuthentication(docsService);
try
{
return docsService.getEntry(new URL(METADATA_... | 3 |
public ArrayList<String> getAllArtists()
{
ArrayList<String> songArtists = new ArrayList<>();
//Run through each song and get artist, set in array
for (Song s : songList)
{
songArtists.add(s.getArtist());
}
//Return array of artists
... | 1 |
@Override
public double train(Collection<_Doc> trainSet) {
ArrayList<_Doc> graph = new ArrayList<_Doc>();
String lastItemID = null;
for(_Doc d:trainSet) {
if (lastItemID == null)
lastItemID = d.getItemID();
else if (lastItemID != d.getItemID()) {
if (graph.size()>10)//otherwise the graph is too ... | 5 |
public static void main(final String[] args) {
parseArgs(args);
/* load icons */
for (final Command c : Command.values()) {
final ImageIcon image = loadIcon("/genetic/res/"
+ c.toString()
+ ".png");
COMMAND_ICONS.put(c, image);
}
... | 3 |
@Test
public void testGetMarker() {
System.out.println("getMarker");
Mark instance = new Mark(6,9);
int expResult = 6;
int result = instance.getMarker();
assertEquals(expResult, result);
} | 0 |
public void setItemId(int itemId) {
this.itemId = itemId;
} | 0 |
@Test
public void depthest11opponent3()
{
for(int i = 0; i < BIG_INT; i++)
{
int numPlayers = 4; //assume/require > 1, < 7
Player[] playerList = new Player[numPlayers];
ArrayList<Color> factionList = Faction.allFactions();
playerList[0] = new Player(chooseFaction(factionList), new SimpleAI());
... | 5 |
@SuppressWarnings({ "deprecation", "static-access" })
public void loadInventory() {
try {
Connection conn = MineAuction.db.getConnection();
PreparedStatement ps = conn
.prepareStatement("SELECT * FROM ma_items WHERE playerID=? ORDER BY qty ASC LIMIT 54");
// Prepare statement
int playerID = Databas... | 9 |
public static boolean isBlankRow(Row row) {
Iterator<Cell> iterator = row.iterator();
boolean isBlankRow = true;
while (iterator.hasNext()) {
Cell curCell = iterator.next();
if (curCell.getCellType() != Cell.CELL_TYPE_BLANK) {
isBlankRow = false;
break;
}
}
return isBlankRow;
} | 2 |
public static void main(String[] args) throws Exception{
if(ClientModel.isMac()){
System.setProperty("com.apple.mrj.application.apple.menu.about.name","Enigma");
System.setProperty("apple.laf.useScreenMenuBar", "false");
}
splash.setVisible(true);
Mode mode=Mode.NORMAL;
if(args.len... | 8 |
public static void main(String[] args) throws IOException {
StringBuilder out = new StringBuilder();
l = new Cube[223]; // Pre calculate
int cont = 0;
long a = 0;
double a_3 = 0, aux;
for (int i = 2; i <= 199; i++)
for (int j = i; j <= 199; j++)
if (p3(i) + p3(j) <= LIMIT)
for (int k = j; k <= 1... | 7 |
public Collection<String> getCatNos() throws SQLException
{
if (catnos == null || catnos.size() == 0)
catnos = GetRecords.create().getCatNos(number);
return catnos;
} | 2 |
@SuppressWarnings("unchecked")
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
String serviceName = (String) table.getValueAt(row, column - 1);
HashMap<String, String> userStatusAssoc;
User user = instanceGUI.getUser();
// Check if a t... | 4 |
public int getHora() {
return hora;
} | 0 |
public boolean operate(Boolean boolean1, Boolean boolean2) {
boolean b1 = (java.lang.Boolean) boolean1;
boolean b2 = (java.lang.Boolean) boolean2;
return b1 && b2;
} | 1 |
public void startDownloading(ThreadPoolExecutor executorService) {
if (this.started) throw new IllegalStateException("Cannot start download job that has already started");
this.started = true;
if (this.allFiles.isEmpty()) {
//Launcher.getInstance().println("Download job '" + this.name + "' skipped as... | 3 |
@SuppressWarnings("incomplete-switch")
/* package */void processInputMessage (BitTorrentMessage msg) {
assert msg != null;
switch (msg.getMessageType()) {
case HANDSHAKE_START:
HandShakeStart hss = (HandShakeStart) msg;
remoteFlags.or(hss.getFlags());
... | 8 |
public Map<String,Object> getMapObject(){
Map<String, Object> desc = new LinkedHashMap<String, Object>();
if ( format_ != null ) desc.put("format",format_);
if ( name_ != null ) desc.put("name",name_);
if ( subscribe_ != null ) desc.put("subscribe",subscribe_);
if ( visibility_ != null ) desc.put("visibility"... | 8 |
@Override
public void mouseExited(MouseEvent e) {
switch (((JButton) (e.getSource())).getText()) {
case "Start":
break;
case "Turn":
break;
case "Move":
break;
case "Shoot":
break;
cas... | 7 |
public ClientConnectionProperties(ClientDavParameters clientDavParameters) throws ConnectionException {
super(
null,
null,
clientDavParameters.getUserName(),
clientDavParameters.getUserPassword(),
clientDavParameters.getCommunicationParameters().getSendKeepAliveTimeout(),
clientDavParameters.g... | 7 |
public static void main(String[] args) {
if(args.length < 1) {
System.out.println("Erreur : vous devez spécifier un jeu à lancer");
System.exit(1);
}
if(args[0].equals("diaballik")) {
new Diaballik(false);
}
else if(args[0].equals("diaballik_va... | 6 |
public void login() throws Throwable {
char[] pword_onChar = passwordField.getPassword();
String pword = "";
for (char k : pword_onChar) {
pword += k;
}
Users user = new Users();
Integer auth = new Integer(user.login(textField.getText(), pword));
System.out.println(auth);
if (textField... | 3 |
public static ArrayList <RecipeData> loadData() {
File load = new File("resources/files/RecipeData/");
Gson loader = new Gson();
ArrayList <RecipeData> res = new ArrayList <RecipeData>();
for (File f : load.listFiles()) {
BufferedReader br = null;
FileReader fi = null;
try {
fi = new FileReader(f);... | 8 |
private void updateNodeColours(){
if(armyColours)
{
for(Node N : network)
{
if(N.id != clicked)
{
D.getGraphPanel().setNodeColorNoRepaint(N.id, Color.getHSBColor(colourMap.get(((GossipicoFAB)N.getFAB(0)).beacon.A), 1f, 1f));
... | 5 |
public void visitCallMethodExpr(final CallMethodExpr expr) {
if (expr.receiver == from) {
expr.receiver = (Expr) to;
((Expr) to).setParent(expr);
} else {
for (int i = 0; i < expr.params.length; i++) {
if (expr.params[i] == from) {
expr.params[i] = (Expr) to;
((Expr) to).setParent(expr);
... | 3 |
private void set(String id, String in) {
if (id.equals(MovieShowColumn.HOUSE_ID)) {
house_id = in;
}
else if (id.equals(MovieShowColumn.SHOWING_ID)) {
showing_id = in;
}
else if (id.equals(MovieShowColumn.MOVIE_ID)) {
movie_id = in;
}
... | 8 |
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(System.out);
String line;
TreeSet<String> set = new TreeSet<String>();
while ((line = br.readLine()) != null) {
... | 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.