method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
e1567546-3120-46f1-8ee1-b113ad23e2ac | 8 | @Override
public Object getValueAt(int row, int column)
{
PeerStatEntry e = data.get(row);
switch(column)
{
case 0:
return e.ip;
case 1:
return e.path;
case 2:
return e.state;
case 3:
return formatByteCount(e.bytesIn);
case 4:
return formatByteCount(e.bytesOut);
case 5:
return e.duplicatePackets;
case 6:
return e.lostPackets;
case 7:
return e.receivedOutOfRange;
}
return null;
} |
312f0ed7-d0cd-4f5d-953f-59b8831ad2d8 | 0 | public String goToAdminOrdersList() {
this.retrieveAllOrders();
return "adminOrdersList";
} |
b271f892-3478-4d9d-b505-c80b9474af30 | 7 | public String nextString() throws IOException {
int p = peeked;
if (p == PEEKED_NONE) {
p = doPeek();
}
String result;
if (p == PEEKED_UNQUOTED) {
result = nextUnquotedValue();
} else if (p == PEEKED_SINGLE_QUOTED) {
result = nextQuotedValue('\'');
} else if (p == PEEKED_DOUBLE_QUOTED) {
result = nextQuotedValue('"');
} else if (p == PEEKED_BUFFERED) {
result = peekedString;
peekedString = null;
} else if (p == PEEKED_LONG) {
result = Long.toString(peekedLong);
} else if (p == PEEKED_NUMBER) {
result = new String(buffer, pos, peekedNumberLength);
pos += peekedNumberLength;
} else {
throw new IllegalStateException("Expected a string but was " + peek()
+ " at line " + getLineNumber() + " column " + getColumnNumber());
}
peeked = PEEKED_NONE;
return result;
} |
f96431da-101c-40b5-bdba-c52665eb730e | 4 | public char getNextChar() {
try {
//Leemos un caracter y seteamos a nuestra variable currentChar de objeto
setCurrentChar((char) pr.read());
//Sumamos 1 al caracter en la línea
setNumeroDeCaracterEnLinea(getNumeroDeCaracterEnLinea()+1);
//Si es un salto de línea sumamos a la línea y dejamos de nuevo en 0
//al caracter de la linea
if (getCurrentChar() == '\n') {
setNumeroDeLinea(getNumeroDeLinea()+1);
setNumeroDeCaracterEnLinea(0);
}
} catch (IOException e) {
setIsEOF(true);
Logger.getLogger(ArchivoHandler.class.getName()).log(Level.SEVERE, null, e);
} finally {
//Si el último caracter es un EOF entonces seteamos la variable de objeto isEOF
//y cerramos el archivo
if (getCurrentChar() == '\uffff') try {
setIsEOF(true);
pr.close();
} catch (IOException ex) {
Logger.getLogger(ArchivoHandler.class.getName()).log(Level.SEVERE, null, ex);
}
}
//Devolvemos el caracter recien leido
return getCurrentChar();
} |
76d1a716-6c9d-420a-98b4-7a8ebeb66819 | 7 | private void YearBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_YearBoxActionPerformed
int m = MonthBox.getSelectedIndex() + 1;
int y = YearBox.getSelectedIndex() + (Calendar.getInstance().get(Calendar.YEAR) - CountYears);
int n = m != 2 ? m > 7 ? 30 + m % 2 == 1 ? 0 : 1 : 30 + m % 2 : y % 4 == 0 && y % 100 != 0 || y % 400 == 0 ? 29 : 28;
Integer[] Days = new Integer[n];
for (int i = 1; i < n + 1; i++) {
Days[i - 1] = i;
}
DayBox.setModel(new DefaultComboBoxModel(Days));
}//GEN-LAST:event_YearBoxActionPerformed |
841e8885-04e8-4846-9488-065151861a5d | 5 | @Override
public Calisan getCalisan(HashMap<String, String> values) {
try {
String ad = values.get("ad");
String soyad = values.get("soyad");
String telefon = values.get("telefon");
String resimURL = values.get("resimURL");
String kullaniciAdi = values.get("kullaniciAdi");
String sifre1 = values.get("sifre1");
String sifre2 = values.get("sifre2");
int maas = Integer.parseInt(values.get("maas"));
String adres = values.get("adres");
int tip = Integer.parseInt(values.get("tip"));
if(kullaniciAdi.equals(""))
JOptionPane.showMessageDialog(null,
"Kullanıcı adı boş olamaz!", "Hata", JOptionPane.ERROR_MESSAGE);
else if(sifre1.length() < 4)
JOptionPane.showMessageDialog(null,
"Şifre en az 4 haneli olmalıdır", "Hata", JOptionPane.ERROR_MESSAGE);
else if(!sifre1.equals(sifre2))
JOptionPane.showMessageDialog(null,
"Şifreler uyuşmuyor!", "Hata", JOptionPane.ERROR_MESSAGE);
else if(maas < 0)
JOptionPane.showMessageDialog(null,
"Maaş bilgisi 0'dan küçük olamaz!", "Hata", JOptionPane.ERROR_MESSAGE);
else
return new Calisan(adres, maas, -1, ad, soyad, telefon,
kullaniciAdi, sifre1, tip, resimURL);
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(null, "Geçersiz alan. \n"
+ "Maaş alanı karakter içeremez!",
"Hata", JOptionPane.ERROR_MESSAGE);
}
return null;
} |
81822327-a33a-4140-8855-a7b177e04e0a | 4 | @Override
public SpellCheckResult check(String word) {
for (int j = 0; j < wordsInDictionary.length; j++) {
if (word.compareTo(wordsInDictionary[j]) == 0) {
return new SpellCheckResult();
} else if (word.compareTo(wordsInDictionary[j]) < 0) {
if (j == 0) {
return new SpellCheckResult(j, null, wordsInDictionary[j]);
}
return new SpellCheckResult(j, wordsInDictionary[j - 1], wordsInDictionary[j]);
}
}
return new SpellCheckResult(wordsInDictionary.length - 1, wordsInDictionary[wordsInDictionary.length - 1], null);
} |
ce159b83-15a7-4872-a617-e1ffd8d18eb6 | 9 | public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception {
if (splitted[0].equalsIgnoreCase("-1")) {
String playerName = splitted[1];
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps;
int done = 0;
int accountid = 0;
try {
ps = con.prepareStatement("SELECT accountid FROM characters WHERE name = ?");
ps.setString(1, playerName);
ResultSet rs = ps.executeQuery();
if (!rs.next()) {
ps.close();
mc.dropMessage("There are two many of these characters or the Character does not exist.");
}
accountid = rs.getInt("accountid");
mc.dropMessage("[Account ID Exists] Initating Unban Request");
done = 0;
ps.close();
} catch (SQLException e) {
mc.dropMessage("Account ID or Character fails to exist. Error : " + e);
}
try {
ps = con.prepareStatement("update accounts set greason = null, banned = 0, banreason = null, tempban = '0000-00-00 00:00:00' where id = ? and tempban <> '0000-00-00 00:00:00'");
ps.setInt(1, accountid);
int results = ps.executeUpdate();
if (results > 0) {
mc.dropMessage("[Untempbanned] Account has been untempbanned. Command execution is over. If still banned, repeat command.");
done = 1;
}
ps.close();
} catch (SQLException e) {
// not a tempba, moved on.
}
if (done != 1) {
try {
ps = con.prepareStatement("UPDATE accounts SET banned = -1, banreason = null WHERE id = " + accountid);
ps.executeUpdate();
ps.close();
done = 1;
mc.dropMessage("[Account Unbanned] ID: " + accountid);
mc.dropMessage("Macs and Ips will be unbanned when the person logs in");
} catch (SQLException e) {
mc.dropMessage("Account failed to be unbanned or banreason is unfound. Error : " + e);
}
}
if (done == 1) {
mc.dropMessage("Unban command has been completed successfully.");
} else if (done == 0) {
mc.dropMessage("The unban has epic failed.");
}
}
} |
70f3ced9-d37b-44b5-81eb-f84ef54f81ad | 2 | private static void handleSendOfferExceeded(SerializableOfferExceeded pack) {
List<String> sellers = pack.commandInfo;
SelectionKey key;
// reset list in pack (no longer needed)
pack.commandInfo = null;
// send "offer exceeded" packet to each seller still logged in
for (String seller : sellers) {
key = Server.registeredUsersChannels.get(seller);
if (key == null) {
Server.loggerServer.info("[Server] User " + seller + " is no longer" +
" logged in => no 'drop offer' message sent to him");
continue;
}
Server.sendData(key, pack);
}
} |
6fabc264-13ab-4023-91ad-d424f6336bef | 4 | void passf3(int ido, int l1, final double cc[], double ch[], final double wtable[], int offset, int isign)
{
final double taur=-0.5;
final double taui=0.866025403784439;
int i, k, ac, ah;
double ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
int iw1, iw2;
iw1 = offset;
iw2 = iw1 + ido;
if(ido==2)
{
for(k=1; k<=l1; k++)
{
ac=(3*k-2)*ido;
tr2=cc[ac]+cc[ac+ido];
cr2=cc[ac-ido]+taur*tr2;
ah=(k-1)*ido;
ch[ah]=cc[ac-ido]+tr2;
ti2=cc[ac+1]+cc[ac+ido+1];
ci2=cc[ac-ido+1]+taur*ti2;
ch[ah+1]=cc[ac-ido+1]+ti2;
cr3=isign*taui*(cc[ac]-cc[ac+ido]);
ci3=isign*taui*(cc[ac+1]-cc[ac+ido+1]);
ch[ah+l1*ido]=cr2-ci3;
ch[ah+2*l1*ido]=cr2+ci3;
ch[ah+l1*ido+1]=ci2+cr3;
ch[ah+2*l1*ido+1]=ci2-cr3;
}
}
else
{
for(k=1; k<=l1; k++)
{
for(i=0; i<ido-1; i+=2)
{
ac=i+(3*k-2)*ido;
tr2=cc[ac]+cc[ac+ido];
cr2=cc[ac-ido]+taur*tr2;
ah=i+(k-1)*ido;
ch[ah]=cc[ac-ido]+tr2;
ti2=cc[ac+1]+cc[ac+ido+1];
ci2=cc[ac-ido+1]+taur*ti2;
ch[ah+1]=cc[ac-ido+1]+ti2;
cr3=isign*taui*(cc[ac]-cc[ac+ido]);
ci3=isign*taui*(cc[ac+1]-cc[ac+ido+1]);
dr2=cr2-ci3;
dr3=cr2+ci3;
di2=ci2+cr3;
di3=ci2-cr3;
ch[ah+l1*ido+1]=wtable[i+iw1]*di2+isign*wtable[i+1+iw1]*dr2;
ch[ah+l1*ido]=wtable[i+iw1]*dr2-isign*wtable[i+1+iw1]*di2;
ch[ah+2*l1*ido+1]=wtable[i+iw2]*di3+isign*wtable[i+1+iw2]*dr3;
ch[ah+2*l1*ido]=wtable[i+iw2]*dr3-isign*wtable[i+1+iw2]*di3;
}
}
}
} |
0a1a86e5-097b-4e9c-9f33-76e40bed41b9 | 5 | private void raiseAlarm()
{
if (TimerPreferences.getInstance().getBoolean("mute", false))
{
System.out.println("Beeping");
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
try
{
//TODO this has to be changed because of the proprietary warnings...
InputStream in = new FileInputStream("beep.wav");
AudioStream audioStream = new AudioStream(in);
AudioPlayer.player.start(audioStream);
//new AePlayWave("beep.wav").start();
} catch (FileNotFoundException ex)
{
Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex)
{
Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
}
//resetSpinners();
setVisible(true);
setState(JFrame.NORMAL);
btnStart.setEnabled(true);
if ((timeDirection == 0) && (TimerPreferences.getInstance().getBoolean("timechange", false)))
{
timeDirection = 1;
} else
{
timer.stop();
btnCancel.setEnabled(false);
}
} |
d52f61b8-f206-4919-b593-88fca2833bcb | 7 | @PUT
@Path("/{idres}")
@Consumes(MediaType.LIBROS_API_RESENA)
@Produces(MediaType.LIBROS_API_RESENA)
public Resena updateResena(@PathParam("idres") String idres, Resena resena, @PathParam("idlibro") String idlibro) {
String username;
Connection conn = null;
Statement stmt = null;
String sql;
ResultSet rs;
try {
conn = ds.getConnection();
} catch (SQLException e) {
throw new ServiceUnavailableException(e.getMessage());
}
try {
stmt = conn.createStatement();
sql = "SELECT * FROM resenas WHERE idres='" + idres + "'";
rs = stmt.executeQuery(sql);
rs.next();
username = rs.getString("username");
} catch (SQLException e) {
throw new ResenaNotFoundException();
}
if (security.getUserPrincipal().getName().equals(username)) {
try {
stmt = conn.createStatement();
String update = null;
update = "UPDATE resenas SET resenas.texto ='"
+ resena.getTexto() + "'WHERE idres='" + idres + "'";
int rows = stmt.executeUpdate(update,
Statement.RETURN_GENERATED_KEYS);
if (rows != 0) {
sql = "SELECT resenas.*, users.name FROM users INNER JOIN resenas ON(idres= '"
+ idres + "' and users.username=resenas.username) ";
rs = stmt.executeQuery(sql);
if (rs.next()) {
resena.setIdres(rs.getInt("idres"));
resena.setIdlibro(rs.getInt("idlibro"));
resena.setUsername(rs.getString("username"));
resena.setName(rs.getString("name"));
resena.setFecha(rs.getDate("fecha"));
resena.setTexto(rs.getString("texto"));
resena.add(LibrosAPILinkBuilder.buildURIResenaId(uriInfo, "self",rs.getInt("idres"),idlibro));
}
} else
throw new ResenaNotFoundException();
} catch (SQLException e) {
throw new InternalServerException(e.getMessage());
} finally {
try {
stmt.close();
conn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} else {
}
return resena;
} |
50cf5ccc-b5e1-485e-b7d1-d921be47976d | 7 | public static void main(String[] args) {
Locale.setDefault(Locale.US);
Scanner s = new Scanner(System.in);
int valid = 0;
double sum = 0;
for(;;){
if(valid == 2){
System.out.println("novo calculo (1-sim 2-nao)");
double input = s.nextDouble();
if(input == 1){
valid = 0;
sum = 0;
}else if(input == 2){
break;
}
}else{
double score = s.nextDouble();
if(score < 0 || score > 10){
System.out.println("nota invalida");
}else{
valid++;
sum += score;
if(valid == 2){
System.out.printf("media = %.2f\n", sum / valid);
}
}
}
}
} |
4b7de367-93d1-4f28-8821-ca8538a6c424 | 8 | public final ExecResults executeImpl(ExecCommands newCommands) {
validateCommands(newCommands);
if (!isExecFinishedAndDisabled) {
// from robot to battle
commands.set(new ExecCommands(newCommands, true));
print(newCommands.getOutputText());
} else {
// slow down spammer
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
// If we are stopping, yet the robot took action (in onWin or onDeath),
// stop now.
if (battle.isAborted()) {
isExecFinishedAndDisabled = true;
throw new AbortedException();
}
if (isDead()) {
isExecFinishedAndDisabled = true;
throw new DeathException();
}
if (isHalt()) {
isExecFinishedAndDisabled = true;
if (isWinner) {
throw new WinException();
} else {
throw new AbortedException();
}
}
waitForNextTurn();
checkSkippedTurn();
// from battle to robot
final ExecCommands resCommands = new ExecCommands(this.commands.get(),
false);
final RobotStatus resStatus = status.get();
final boolean shouldWait = battle.isAborted()
|| (battle.isLastRound() && isWinner());
return new ExecResults(resCommands, resStatus, readoutEvents(),
readoutTeamMessages(), readoutBullets(), isHalt(), shouldWait,
isPaintEnabled());
} |
3d7344e5-dac6-4815-b8d5-1cb467648bd4 | 5 | public void startServer() {
if (!isStarted) {
isStarted = true;
try {
AddressProvider.host();
} catch (IOException ex) {
System.err.println("SERVER: Could not connect to swe.no. Only LAN connections possible.");
}
try {
server = Network.createServer(NetworkManager.GAME_NAME, NetworkManager.GAME_VERSION, NetworkManager.PORT, NetworkManager.PORT);
System.out.println("Starting server...");
server.start();
isConnected = true;
start();
addListeners();
} catch (IOException ex) {
System.err.println("SERVER: Could not create server. Check netowrk interface...");
} catch (KernelException e) {
try {
Thread.sleep(1000);
System.err.println("Port " + NetworkManager.PORT + " is probably bussy. I'll Increment by 1 and try again... ");
NetworkManager.PORT++;
startServer();
} catch (InterruptedException ex) {
Logger.getLogger(GameServer.class.getName()).log(Level.SEVERE, null, ex);
}
}
} else {
System.err.println("SERVER ERROR: Already one instance of GameServer is running.");
close();
}
} |
18ca6dd3-5382-488e-844f-a0fb94b15470 | 1 | public void cerrarSocket() {
try {
socketConServidor.close();
} catch (IOException e) {
e.printStackTrace();
}
} |
1a369fc7-fbfb-477c-ba81-342803ccc352 | 6 | private boolean saveToFile(String filePath) {
try {
FileOutputStream saveFile = new FileOutputStream(filePath);
ObjectOutputStream oos = new ObjectOutputStream(saveFile);
// BufferedOutputStream save = new BufferedOutputStream(oos);
oos.writeObject(bg.getPath());
HashMap<Neuron, List<Edge>> allNeurons = neuronListGraph.getAllNeurons();
for(Neuron n: allNeurons.keySet()){
n.removeListerner();
n.setCl(null);
}
for(Map.Entry<Line, Boolean> current:lines.entrySet()){
Line line = current.getKey();
line.prepareForSave();
}
filter=null;
try{
Image temp = bg.getBg();
bg.setBg(null);
oos.writeObject(neuronListGraph);
bg.setBg(temp);
}catch(NotSerializableException notInteresting){
//error pga bgimage.bg försöker sparas, fast det inte behövs.
}
// oos.writeObject(neuronListGraph.getPairs());
}catch(FileNotFoundException fnfe){
JOptionPane.showMessageDialog(win,"Kunde inte hitta filen, eller så har den fel rättigheter");
}catch (IOException ioe){
JOptionPane.showMessageDialog(win,"Något io problem"+ioe.getMessage());
ioe.printStackTrace();
}catch (NullPointerException npe){
npe.printStackTrace();
}
savedFilePath = filePath;
hasChanges = false;
return true;
} |
4c13125f-b578-41cc-bd65-32e8ff6735ad | 3 | protected GenericConverter getDefaultConverter(Class<?> sourceType, Class<?> targetType) {
return (targetType.isAssignableFrom(sourceType) ? NO_OP_CONVERTER : null);
} |
4b5bd896-2539-483f-858f-804afca43c7d | 8 | @Override
public void initResources() {
initialScreen = true;
bossLoaded = false;
myBarrierGroup = new SpriteGroup("barrier");
myPlayerGroup = new SpriteGroup("player");
myEnemyGroup = new SpriteGroup("enemy");
myProjectileGroup = new SpriteGroup("projectile");
myEnemyProjectileGroup = new SpriteGroup("enemy projectile");
myCompanionGroup = new SpriteGroup("companion");
// init boss
myBoss = new Boss();
try {
myBoss.load(this);
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
BossWeakPoints = myBoss.getSpriteGroup();
BossProjectiles = myBoss.getProjectiles();
// init background using the new Map class
myBackImage = getImage("resources/BackFinal.png");
myMap = new Map(myBackImage, getWidth(), getHeight());
myMap.setSpeed(10);
myBackground = myMap.getMyBack();
myPlayerGroup.setBackground(myBackground);
myBarrierGroup.setBackground(myBackground);
myEnemyGroup.setBackground(myBackground);
myCompanionGroup.setBackground(myBackground);
myProjectileGroup.setBackground(myBackground);
myEnemyProjectileGroup.setBackground(myBackground);
BossWeakPoints.setBackground(myBackground);
BossProjectiles.setBackground(myBackground);
//myShip = new Player(200, 2700, "resources/ship.png");
//myShip.setImage(getImage("resources/ship.png"));
//System.out.println("1");
start = new StartGUIUpdated(this);
// InvisibilityDecorator myInv = new InvisibilityDecorator(new SimplePowerUp(), myShip);
// myPowerUpDecorator = new CompanionDecorator(myInv, myShip);
//decCompanion = new ConstantlyMoveDecorator(new SimpleShip());
//intit weapons
Projectile p = new DamagingProjectile("resources/fire.png",myProjectileGroup,1);
p.setImage(getImage("resources/fire.png"));
ShotPattern s = new SinglePattern(-1);
myWeapon = new UnlimitedGun(300,p,s);
// init playfield
myPlayfield = new PlayField(myBackground);
// myPlayfield.add(myBoss);
myPlayfield.addGroup(myPlayerGroup);
myPlayfield.addGroup(myBarrierGroup);
myPlayfield.addGroup(myEnemyGroup);
myPlayfield.addGroup(myProjectileGroup);
//myPlayfield.addGroup(myCompanionGroup);
myPlayfield.addGroup(myEnemyProjectileGroup);
// myPlayfield.addGroup(BossProjectiles);
// myPlayfield.addGroup(BossWeakPoints);
myPlayfield.addCollisionGroup(myPlayerGroup, myBarrierGroup,
new PlayerBarrierCollision());
myPlayfield.addCollisionGroup(myProjectileGroup, myEnemyGroup, new ProjectileAnythingCollision());
myPlayfield.addCollisionGroup(myProjectileGroup, myBarrierGroup, new ProjectileAnythingCollision());
myPlayfield.addCollisionGroup(myEnemyProjectileGroup, myPlayerGroup, new ProjectileAnythingCollision());
myPlayfield.addCollisionGroup(myEnemyProjectileGroup, myBarrierGroup, new ProjectileAnythingCollision());
// myPlayfield.addCollisionGroup(BossWeakPoints, myProjectileGroup, new FireBossCollision());
// myPlayfield.addCollisionGroup(BossProjectiles, myPlayerGroup, new ProjectileAnythingCollision());
// load level data
//loadLevelData();
// initializing PlayerInfo
playerInfo = new PlayerInfo();
//HealthBar
myHealthBar = new HealthBar(myPlayer);
} |
82a8ecaa-61e3-462b-a60a-6c15caa51377 | 2 | public boolean insertaUsuario(String login, String pass, String nombre, String categoria) {
boolean res = false;
Statement statement;
ResultSet resultSet;
try {
Connection con = DriverManager.getConnection(connectString, user, password);
statement = con.createStatement();
resultSet = statement.executeQuery("SELECT * from agregaUsuario('" + nombre + "', "
+ "'" + login + "','" + pass + "'," + "'" + categoria + "'" + ");");
while (resultSet.next()) {
res = resultSet.getBoolean(1);
}
} catch (SQLException ex) {
System.err.println(ex.getMessage());
}
return res;
} |
2ebe8e73-2be9-4f72-a596-775b8e329b77 | 5 | void calculateInfluences(DetailedMovie detailedMovie, ArrayList<DetailedMovie> detailedMovieInfByList, ArrayList<DetailedMovie> detailedMovieInfList)
{
try
{
queryUtility.calculateInfluences(detailedMovie, detailedMovieInfByList, detailedMovieInfList);
}
catch (QueryEvaluationException ex)
{
Logger.getLogger(QueryInterface.class.getName()).log(Level.SEVERE, null, ex);
}
catch (RepositoryException ex)
{
Logger.getLogger(QueryInterface.class.getName()).log(Level.SEVERE, null, ex);
}
catch (MalformedQueryException ex)
{
Logger.getLogger(QueryInterface.class.getName()).log(Level.SEVERE, null, ex);
}
catch (InfluException ex)
{
Logger.getLogger(QueryInterface.class.getName()).log(Level.SEVERE, null, ex);
}
catch (JSONException ex)
{
Logger.getLogger(QueryInterface.class.getName()).log(Level.SEVERE, null, ex);
}
} |
86b5e939-326e-44e9-acf6-58241c8389e5 | 1 | @Override
public boolean equals(Object obj) {
if (obj instanceof Cell) {
return isAlive == ((Cell) obj).isAlive();
} else {
return false;
}
} |
fa2dd134-c29c-4363-a70c-c895e25bab16 | 9 | public List<Motorcycle> getAllMotorcycles()
{
List<Motorcycle> Motorcycles = new ArrayList<Motorcycle>();
try
{
ResultSet rs = getMotorcycleStmt.executeQuery();
while (rs.next())
{
Brand brand = null;
if (rs.getString("brand").equals("Honda"))
brand = Brand.Honda;
if (rs.getString("brand").equals("Suzuki"))
brand = Brand.Suzuki;
if (rs.getString("brand").equals("Aprillia"))
brand = Brand.Aprillia;
if (rs.getString("brand").equals("Ducati"))
brand = Brand.Ducati;
if (rs.getString("brand").equals("Yamaha"))
brand = Brand.Yamaha;
if (rs.getString("brand").equals("Kawasaki"))
brand = Brand.Kawasaki;
if (rs.getString("brand").equals("BMW"))
brand = Brand.BMW;
Motorcycles.add(new Motorcycle(brand,rs.getString("model"),rs.getInt("price"), rs.getInt("yearOfManufacture")));
}
}
catch (SQLException e)
{
e.printStackTrace();
}
return Motorcycles;
} |
11d139e1-3f65-4c08-bc24-1210c858f091 | 2 | boolean setSpeed(int speed) {
if (speed < 0 || speed > 16)
return false;
this.speed = speed;
return true;
} |
eac80567-901d-46da-b2ef-81d9c147af82 | 6 | @Override
public void startUp() {
if (waitingGameScreen == null) {
logger.error(new NullPointerException(),
Helpers.concat("Tried starting game without there being default game screen given.",
"Make sure to set it with setCurrentGameScreen(GameScreen gameScreen)"));
Runtime.getRuntime().exit(0xDEADBEEF);
}
stateManager = new StateManager("gameScreenmanagerStateManager");
// Called after a gamescreen has just been loaded. After it has faded
// in, it will change to a state which will check whether or not it
// needs to change the game screen again
stateManager.addPossibleState(new State("fadeIn") {
int alpha = 255;
@Override
public void logicUpdate(GameTime gameTime) {
transitionColor = new Color(((alpha -= transitionSpeed) << 24) | desiredTransitionColor, true);
if (alpha < transitionSpeed) {
transitionColor = null;
// change the alpha back to 255, for next time the game
// screen is changed
alpha = 255;
setTransitionStateName("checkWaitingGameScreen");
} else {
setTransitionStateName(getName());
}
}
});
// Called when a request is made to replace the current game screen. It
// will fade out first, and after fading out it will transition to a
// state which will actually replace the gamescreen
stateManager.addPossibleState(new State("fadeOut") {
int alpha;
@Override
public void logicUpdate(GameTime gameTime) {
if (alpha == 255)
alpha = 0;
transitionColor = new Color(((alpha += transitionSpeed) << 24) | desiredTransitionColor, true);
if (alpha >= 255) {
setTransitionStateName("changeCurrentGameScreen");
} else {
setTransitionStateName(getName());
}
}
});
// Called when there was a request to change the GameScreen, and the
// current waitingGameScreen is not null. This method will attempt to
// fire the GC when swapping game screens. This is where both the
// 'startUp' (for the waitingGameScreen) and 'cleanUp' (from the
// currentGameScreen) methods will be fired
stateManager.addPossibleState(new State("changeCurrentGameScreen") {
@Override
public void logicUpdate(GameTime gameTime) {
if (currentGameScreen != null) {
// Call the clean up for the current layer, IE remove events
// etc
currentGameScreen.cleanUp();
// Now is the best time to do GC. A well designed game
// shouldn't have to do GC much, but it's better to run it
// now rather than for it to be forcibly ran during an
// important part of the game
System.gc();
}
currentGameScreen = waitingGameScreen;
// Call the start up for the layer, register events, reset
// components etc
currentGameScreen.startUp(gameTime);
// / Remove the waiting game screen as it has been replaced
waitingGameScreen = null;
// fade in the screen now
setTransitionStateName("fadeIn");
}
});
// When in this state we busy check whether or not the waitinGameScreen
// is null, and if it is, we should go the fade out state, which will
// then eventually load the new gameScreen. We could possibly change
// into the fadeOut transition when setGameScreen is called... But I
// like this as it means that it will only consider a change game screen
// after the animation etc has completed, which I think will stop a lot
// of interface bugs (IE, user spam clicking a menu button)
stateManager.addPossibleState(new State("checkWaitingGameScreen") {
@Override
public void logicUpdate(GameTime gameTime) {
if (waitingGameScreen != null) {
setTransitionStateName("fadeOut");
} else {
setTransitionStateName(getName());
}
}
});
stateManager.setStartingState("changeCurrentGameScreen");
} |
e998841c-ac86-4142-9785-4a315174e0ed | 6 | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
buttonGroup2 = new javax.swing.ButtonGroup();
jDialog1 = new javax.swing.JDialog();
jPanel53 = new javax.swing.JPanel();
jPanel56 = new javax.swing.JPanel();
jLabel25 = new javax.swing.JLabel();
jPanel57 = new javax.swing.JPanel();
jLabel26 = new javax.swing.JLabel();
jLabel27 = new javax.swing.JLabel();
jLabel28 = new javax.swing.JLabel();
jLabel29 = new javax.swing.JLabel();
jPanel54 = new javax.swing.JPanel();
jLabel24 = new javax.swing.JLabel();
jPanel55 = new javax.swing.JPanel();
jButton11 = new javax.swing.JButton();
jButton10 = new javax.swing.JButton();
GeralPanel = new javax.swing.JPanel();
jPanel15 = new javax.swing.JPanel();
jLabel18 = new javax.swing.JLabel();
jPanel13 = new javax.swing.JPanel();
warningLabelGeral = new javax.swing.JLabel();
jPanel21 = new javax.swing.JPanel();
jButton3 = new javax.swing.JButton();
jPanel47 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jPanel7 = new javax.swing.JPanel();
jComboBox2 = new javax.swing.JComboBox();
jPanel14 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
try{
javax.swing.text.MaskFormatter dataIni = new javax.swing.text.MaskFormatter("##/##/####");
dataIni.setPlaceholderCharacter('_');
jTextField1 = new javax.swing.JFormattedTextField(dataIni);
}catch(Exception e){
}
jLabel3 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
try{
javax.swing.text.MaskFormatter dataFim = new javax.swing.text.MaskFormatter("##/##/####");
dataFim.setPlaceholderCharacter('_');
jTextField2 = new javax.swing.JFormattedTextField(dataFim);
}catch(Exception e){
}
jButton22 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jScrollPane18 = new javax.swing.JScrollPane();
jTable18 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jScrollPane19 = new javax.swing.JScrollPane();
jTable19 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jSeparator1 = new javax.swing.JSeparator();
BackupPanel = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
jPanel22 = new javax.swing.JPanel();
jLabel54 = new javax.swing.JLabel();
jPanel23 = new javax.swing.JPanel();
jButton24 = new javax.swing.JButton();
jPanel12 = new javax.swing.JPanel();
jLabel60 = new javax.swing.JLabel();
ClientePanel = new javax.swing.JPanel();
jPanel5 = new javax.swing.JPanel();
jLabel20 = new javax.swing.JLabel();
jPanel17 = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
jTextField6 = new javax.swing.JTextField();
try{
javax.swing.text.MaskFormatter CPF = new javax.swing.text.MaskFormatter("###.###.###-##");
CPF.setPlaceholderCharacter('_');
jTextField6 = new javax.swing.JFormattedTextField(CPF);
}catch(Exception e){
}
jLabel30 = new javax.swing.JLabel();
jPanel20 = new javax.swing.JPanel();
jPanel6 = new javax.swing.JPanel();
jButton2 = new javax.swing.JButton();
jPanel4 = new javax.swing.JPanel();
jScrollPane6 = new javax.swing.JScrollPane();
jTable13 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jScrollPane7 = new javax.swing.JScrollPane();
jTable14 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jScrollPane8 = new javax.swing.JScrollPane();
jTable15 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jLabel39 = new javax.swing.JLabel();
jLabel40 = new javax.swing.JLabel();
jLabel35 = new javax.swing.JLabel();
jLabel38 = new javax.swing.JLabel();
jLabel37 = new javax.swing.JLabel();
jLabel36 = new javax.swing.JLabel();
jLabel41 = new javax.swing.JLabel();
jLabel42 = new javax.swing.JLabel();
jButton4 = new javax.swing.JButton();
jPanel65 = new javax.swing.JPanel();
warningLabel = new javax.swing.JLabel();
FuncionarioPanel = new javax.swing.JPanel();
jPanel66 = new javax.swing.JPanel();
jLabel43 = new javax.swing.JLabel();
jPanel67 = new javax.swing.JPanel();
jLabel44 = new javax.swing.JLabel();
jTextField11 = new javax.swing.JTextField();
try{
javax.swing.text.MaskFormatter CPF = new javax.swing.text.MaskFormatter("###.###.###-##");
CPF.setPlaceholderCharacter('_');
jTextField11 = new javax.swing.JFormattedTextField(CPF);
}catch(Exception e){
}
jLabel45 = new javax.swing.JLabel();
jPanel68 = new javax.swing.JPanel();
jPanel69 = new javax.swing.JPanel();
jButton20 = new javax.swing.JButton();
jPanel70 = new javax.swing.JPanel();
jScrollPane16 = new javax.swing.JScrollPane();
jTable16 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jScrollPane17 = new javax.swing.JScrollPane();
jTable17 = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int vColIndex){
return false;
}
};
jLabel46 = new javax.swing.JLabel();
jLabel47 = new javax.swing.JLabel();
jLabel48 = new javax.swing.JLabel();
jLabel49 = new javax.swing.JLabel();
jLabel50 = new javax.swing.JLabel();
jLabel51 = new javax.swing.JLabel();
jLabel52 = new javax.swing.JLabel();
jButton21 = new javax.swing.JButton();
jPanel71 = new javax.swing.JPanel();
warningLabelFuncionario = new javax.swing.JLabel();
LimparPanel = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jPanel35 = new javax.swing.JPanel();
jLabel22 = new javax.swing.JLabel();
jPanel33 = new javax.swing.JPanel();
jPanel34 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
jPanel36 = new javax.swing.JPanel();
jLabel8 = new javax.swing.JLabel();
jTextField5 = new javax.swing.JTextField();
try{
javax.swing.text.MaskFormatter dataIni = new javax.swing.text.MaskFormatter("##/##/####");
dataIni.setPlaceholderCharacter('_');
jTextField5 = new javax.swing.JFormattedTextField(dataIni);
}catch(Exception e){
}
jLabel12 = new javax.swing.JLabel();
jTextField9 = new javax.swing.JTextField();
try{
javax.swing.text.MaskFormatter dataFim = new javax.swing.text.MaskFormatter("##/##/####");
dataFim.setPlaceholderCharacter('_');
jTextField9 = new javax.swing.JFormattedTextField(dataFim);
}catch(Exception e){
}
jButton7 = new javax.swing.JButton();
jPanel37 = new javax.swing.JPanel();
warningLimparHist = new javax.swing.JLabel();
Sumarizacao = new javax.swing.JPanel();
jPanel44 = new javax.swing.JPanel();
jLabel23 = new javax.swing.JLabel();
jPanel49 = new javax.swing.JPanel();
jPanel10 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel61 = new javax.swing.JLabel();
jLabel62 = new javax.swing.JLabel();
jPanel11 = new javax.swing.JPanel();
jLabel19 = new javax.swing.JLabel();
jLabel21 = new javax.swing.JLabel();
jLabel31 = new javax.swing.JLabel();
jLabel32 = new javax.swing.JLabel();
jLabel33 = new javax.swing.JLabel();
jLabel34 = new javax.swing.JLabel();
jLabel53 = new javax.swing.JLabel();
jLabel58 = new javax.swing.JLabel();
jLabel57 = new javax.swing.JLabel();
jLabel56 = new javax.swing.JLabel();
SairPanel = new javax.swing.JPanel();
jPanel28 = new javax.swing.JPanel();
jPanel29 = new javax.swing.JPanel();
jLabel14 = new javax.swing.JLabel();
jPanel30 = new javax.swing.JPanel();
jButton9 = new javax.swing.JButton();
BemVindoPanel = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jPanel27 = new javax.swing.JPanel();
jPanel38 = new javax.swing.JPanel();
jPanel45 = new javax.swing.JPanel();
RestorePanel = new javax.swing.JPanel();
jPanel16 = new javax.swing.JPanel();
jPanel72 = new javax.swing.JPanel();
jLabel55 = new javax.swing.JLabel();
jPanel73 = new javax.swing.JPanel();
jButton26 = new javax.swing.JButton();
jPanel18 = new javax.swing.JPanel();
jLabel59 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu6 = new javax.swing.JMenu();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem3 = new javax.swing.JMenuItem();
jMenuItem4 = new javax.swing.JMenuItem();
jMenuItem8 = new javax.swing.JMenuItem();
jMenu7 = new javax.swing.JMenu();
jMenuItem6 = new javax.swing.JMenuItem();
jMenu8 = new javax.swing.JMenu();
jMenuItem10 = new javax.swing.JMenuItem();
jMenuItem11 = new javax.swing.JMenuItem();
jMenu5 = new javax.swing.JMenu();
jMenuItem9 = new javax.swing.JMenuItem();
jDialog1.setTitle("Limpar Histórico");
jDialog1.setMinimumSize(new java.awt.Dimension(400, 230));
jDialog1.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel53.setLayout(new java.awt.GridLayout(2, 0));
jPanel56.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 20));
jLabel25.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jLabel25.setText("Período:");
jPanel56.add(jLabel25);
jPanel53.add(jPanel56);
jPanel57.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
jLabel26.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jLabel26.setText("De:");
jPanel57.add(jLabel26);
jLabel27.setText("01/01/2014");
jPanel57.add(jLabel27);
jLabel28.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jLabel28.setText("Até:");
jPanel57.add(jLabel28);
jLabel29.setText("31/12/2014");
jPanel57.add(jLabel29);
jPanel53.add(jPanel57);
jDialog1.getContentPane().add(jPanel53, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 400, 80));
jPanel54.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 15));
jLabel24.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel24.setText("Você tem certeza que deseja limpar o histórico?");
jPanel54.add(jLabel24);
jDialog1.getContentPane().add(jPanel54, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 90, 400, 40));
jButton11.setText("Voltar");
jButton11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton11ActionPerformed(evt);
}
});
jPanel55.add(jButton11);
jButton10.setText("Limpar");
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});
jPanel55.add(jButton10);
jDialog1.getContentPane().add(jPanel55, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 130, 400, 40));
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Menu Funcionário");
getContentPane().setLayout(new javax.swing.OverlayLayout(getContentPane()));
jPanel15.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 10));
jLabel18.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel18.setText("Histórico - Setor");
jPanel15.add(jLabel18);
warningLabelGeral.setForeground(new java.awt.Color(204, 0, 0));
jPanel13.add(warningLabelGeral);
jPanel21.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 9));
jButton3.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
jButton3.setText("Visualizar Avaliação");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jPanel21.add(jButton3);
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel2.setText("Período:");
jPanel47.add(jLabel2);
jPanel7.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione uma opção", "Avaliações Venda", "Avaliações Atendimento", "Avaliações Oficina" }));
jComboBox2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox2ActionPerformed(evt);
}
});
jPanel7.add(jComboBox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 10, -1, -1));
jLabel1.setText("De: ");
jPanel14.add(jLabel1);
jTextField1.setColumns(8);
jTextField1.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField1FocusGained(evt);
}
});
jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jTextField1KeyPressed(evt);
}
});
jPanel14.add(jTextField1);
jLabel3.setText("Até: ");
jPanel14.add(jLabel3);
jTextField2.setColumns(8);
jTextField2.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField2FocusGained(evt);
}
});
jTextField2.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jTextField2KeyPressed(evt);
}
});
jPanel14.add(jTextField2);
jButton22.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton22.setText("Buscar");
jButton22.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton22ActionPerformed(evt);
}
});
jPanel14.add(jButton22);
jButton1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton1.setText("Buscar Tudo");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jPanel14.add(jButton1);
jPanel9.setLayout(new javax.swing.OverlayLayout(jPanel9));
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable1.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable1FocusGained(evt);
}
});
jScrollPane1.setViewportView(jTable1);
jPanel9.add(jScrollPane1);
jTable18.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable18.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable18FocusGained(evt);
}
});
jScrollPane18.setViewportView(jTable18);
jPanel9.add(jScrollPane18);
jTable19.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable19.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable19FocusGained(evt);
}
});
jScrollPane19.setViewportView(jTable19);
jPanel9.add(jScrollPane19);
javax.swing.GroupLayout GeralPanelLayout = new javax.swing.GroupLayout(GeralPanel);
GeralPanel.setLayout(GeralPanelLayout);
GeralPanelLayout.setHorizontalGroup(
GeralPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel47, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(GeralPanelLayout.createSequentialGroup()
.addGap(301, 301, 301)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 392, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(155, Short.MAX_VALUE))
.addComponent(jSeparator1)
);
GeralPanelLayout.setVerticalGroup(
GeralPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(GeralPanelLayout.createSequentialGroup()
.addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(jPanel47, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(3, 3, 3)
.addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(2, 2, 2)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
getContentPane().add(GeralPanel);
BackupPanel.setLayout(new java.awt.GridLayout(4, 0));
jPanel8.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 15));
BackupPanel.add(jPanel8);
jPanel22.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 15));
jLabel54.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel54.setText("Deseja criar Backup dos Dados?");
jPanel22.add(jLabel54);
BackupPanel.add(jPanel22);
jButton24.setText("Criar");
jButton24.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton24ActionPerformed(evt);
}
});
jPanel23.add(jButton24);
BackupPanel.add(jPanel23);
jLabel60.setForeground(new java.awt.Color(51, 102, 0));
jPanel12.add(jLabel60);
BackupPanel.add(jPanel12);
getContentPane().add(BackupPanel);
jPanel5.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 20));
jLabel20.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel20.setText("Histórico - Cliente");
jPanel5.add(jLabel20);
jLabel9.setText("CPF do Cliente:");
jPanel17.add(jLabel9);
jTextField6.setColumns(11);
jTextField6.setToolTipText("Digite o CPF do cliente...");
jTextField6.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jTextField6KeyPressed(evt);
}
});
jPanel17.add(jTextField6);
jLabel30.setText("11 Dígitos");
jPanel17.add(jLabel30);
jPanel20.add(jPanel6);
jButton2.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
jButton2.setText("Confirmar");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel20.add(jButton2);
jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jTable13.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable13.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable13FocusGained(evt);
}
});
jScrollPane6.setViewportView(jTable13);
jTable14.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable14.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable14FocusGained(evt);
}
});
jScrollPane7.setViewportView(jTable14);
jTable15.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable15.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable15FocusGained(evt);
}
});
jScrollPane8.setViewportView(jTable15);
jLabel39.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel39.setText("Avaliações ");
jLabel40.setText("Vendas");
jLabel35.setText("Nome do Cliente:");
jLabel38.setText("12345678912");
jLabel37.setText("CPF:");
jLabel36.setText("Zé");
jLabel41.setText("Atendimento");
jLabel42.setText("Oficina");
jButton4.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton4.setText("Visualizar Avaliação");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(96, 96, 96)
.addComponent(jLabel40)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel41)
.addGap(213, 213, 213)
.addComponent(jLabel42)
.addGap(101, 101, 101))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jLabel37)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel38))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jLabel35)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel36)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addComponent(jLabel39)
.addGap(357, 357, 357))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addComponent(jButton4)
.addGap(311, 311, 311))))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jLabel39)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel35)
.addComponent(jLabel36))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel37)
.addComponent(jLabel38))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel40)
.addComponent(jLabel41)
.addComponent(jLabel42))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE)
.addComponent(jScrollPane7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addComponent(jButton4)
.addGap(64, 64, 64))
);
warningLabel.setForeground(new java.awt.Color(204, 0, 0));
jPanel65.add(warningLabel);
javax.swing.GroupLayout ClientePanelLayout = new javax.swing.GroupLayout(ClientePanel);
ClientePanel.setLayout(ClientePanelLayout);
ClientePanelLayout.setHorizontalGroup(
ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel65, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
ClientePanelLayout.setVerticalGroup(
ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ClientePanelLayout.createSequentialGroup()
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel65, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
getContentPane().add(ClientePanel);
jPanel66.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 20));
jLabel43.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel43.setText("Histórico - Funcionário");
jPanel66.add(jLabel43);
jLabel44.setText("CPF do Funcionário:");
jPanel67.add(jLabel44);
jTextField11.setColumns(11);
jTextField11.setToolTipText("Digite o CPF do Funcionário...");
jTextField11.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jTextField11KeyPressed(evt);
}
});
jPanel67.add(jTextField11);
jLabel45.setText("11 Dígitos");
jPanel67.add(jLabel45);
jPanel68.add(jPanel69);
jButton20.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
jButton20.setText("Confirmar");
jButton20.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton20ActionPerformed(evt);
}
});
jPanel68.add(jButton20);
jPanel70.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jTable16.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable16.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable16FocusGained(evt);
}
});
jScrollPane16.setViewportView(jTable16);
jTable17.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable17.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTable17FocusGained(evt);
}
});
jScrollPane17.setViewportView(jTable17);
jLabel46.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel46.setText("Avaliações ");
jLabel47.setText("Vendas");
jLabel48.setText("Nome do Funcionário:");
jLabel49.setText("12345678912");
jLabel50.setText("CPF:");
jLabel51.setText("Zé");
jLabel52.setText("Atendimento");
jButton21.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton21.setText("Visualizar Avaliação");
jButton21.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton21ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel70Layout = new javax.swing.GroupLayout(jPanel70);
jPanel70.setLayout(jPanel70Layout);
jPanel70Layout.setHorizontalGroup(
jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel70Layout.createSequentialGroup()
.addGap(178, 178, 178)
.addComponent(jLabel47)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 320, Short.MAX_VALUE)
.addComponent(jLabel52)
.addGap(188, 188, 188))
.addGroup(jPanel70Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel70Layout.createSequentialGroup()
.addGroup(jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel70Layout.createSequentialGroup()
.addComponent(jLabel50)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel49))
.addGroup(jPanel70Layout.createSequentialGroup()
.addComponent(jLabel48)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel51)))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel70Layout.createSequentialGroup()
.addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel70Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel70Layout.createSequentialGroup()
.addComponent(jLabel46)
.addGap(348, 348, 348))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel70Layout.createSequentialGroup()
.addComponent(jButton21)
.addGap(306, 306, 306))))
);
jPanel70Layout.setVerticalGroup(
jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel70Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jLabel46)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel48)
.addComponent(jLabel51))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel50)
.addComponent(jLabel49))
.addGap(15, 15, 15)
.addGroup(jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel47)
.addComponent(jLabel52))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel70Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE)
.addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
.addComponent(jButton21)
.addContainerGap())
);
warningLabelFuncionario.setForeground(new java.awt.Color(204, 0, 0));
jPanel71.add(warningLabelFuncionario);
javax.swing.GroupLayout FuncionarioPanelLayout = new javax.swing.GroupLayout(FuncionarioPanel);
FuncionarioPanel.setLayout(FuncionarioPanelLayout);
FuncionarioPanelLayout.setHorizontalGroup(
FuncionarioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel68, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel71, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel67, javax.swing.GroupLayout.DEFAULT_SIZE, 845, Short.MAX_VALUE)
.addComponent(jPanel66, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, FuncionarioPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel70, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
FuncionarioPanelLayout.setVerticalGroup(
FuncionarioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(FuncionarioPanelLayout.createSequentialGroup()
.addComponent(jPanel66, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel67, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel71, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel68, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel70, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(26, Short.MAX_VALUE))
);
getContentPane().add(FuncionarioPanel);
jPanel1.setLayout(new java.awt.GridLayout(5, 0));
jLabel22.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel22.setText("Limpar Histórico");
jPanel35.add(jLabel22);
jPanel1.add(jPanel35);
jPanel1.add(jPanel33);
jLabel7.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jLabel7.setText("Período:");
jPanel34.add(jLabel7);
jPanel1.add(jPanel34);
jLabel8.setText("De: ");
jPanel36.add(jLabel8);
jTextField5.setColumns(8);
jTextField5.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField5FocusGained(evt);
}
});
jTextField5.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jTextField5KeyPressed(evt);
}
});
jPanel36.add(jTextField5);
jLabel12.setText("Até: ");
jPanel36.add(jLabel12);
jTextField9.setColumns(8);
jTextField9.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextField9FocusGained(evt);
}
});
jTextField9.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jTextField9KeyPressed(evt);
}
});
jPanel36.add(jTextField9);
jButton7.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
jButton7.setText("Confirmar");
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
jPanel36.add(jButton7);
jPanel1.add(jPanel36);
warningLimparHist.setForeground(new java.awt.Color(204, 0, 0));
jPanel37.add(warningLimparHist);
jPanel1.add(jPanel37);
javax.swing.GroupLayout LimparPanelLayout = new javax.swing.GroupLayout(LimparPanel);
LimparPanel.setLayout(LimparPanelLayout);
LimparPanelLayout.setHorizontalGroup(
LimparPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 806, javax.swing.GroupLayout.PREFERRED_SIZE)
);
LimparPanelLayout.setVerticalGroup(
LimparPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(LimparPanelLayout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE))
);
getContentPane().add(LimparPanel);
jPanel44.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 20));
jLabel23.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel23.setText("Sumarização");
jPanel44.add(jLabel23);
jPanel49.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Média"));
jPanel10.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel4.setText("Atendimento:");
jPanel10.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, -1, -1));
jLabel5.setText("Vendas:");
jPanel10.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, 60, -1));
jLabel6.setText("Oficina:");
jPanel10.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 60, -1, -1));
jLabel10.setForeground(new java.awt.Color(0, 100, 0));
jLabel10.setText("nota");
jPanel10.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 20, -1, -1));
jLabel11.setForeground(new java.awt.Color(0, 100, 0));
jLabel11.setText("nota");
jPanel10.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 40, -1, -1));
jLabel13.setForeground(new java.awt.Color(0, 100, 0));
jLabel13.setText("nota");
jPanel10.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 60, -1, -1));
jLabel61.setText("Média Geral:");
jPanel10.add(jLabel61, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, -1, -1));
jLabel62.setForeground(new java.awt.Color(0, 100, 0));
jLabel62.setText("nota");
jPanel10.add(jLabel62, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 80, -1, -1));
jPanel49.add(jPanel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 30, 360, 160));
jLabel19.setText("Número avaliaçoes Venda");
jLabel21.setText("42");
jLabel31.setText("Número avaliações Atendimento");
jLabel32.setText("80");
jLabel33.setText("Número avaliações Oficina");
jLabel34.setText("122");
jLabel53.setText("Número de Avaliações Feitas:");
jLabel58.setText("80");
jLabel57.setText("Número de Avaliações Pendentes:");
jLabel56.setText("42");
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
jPanel11.setLayout(jPanel11Layout);
jPanel11Layout.setHorizontalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(jLabel57)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel56))
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(jLabel33)
.addGap(48, 48, 48)
.addComponent(jLabel34))
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(jLabel53)
.addGap(32, 32, 32)
.addComponent(jLabel58))
.addGroup(jPanel11Layout.createSequentialGroup()
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel31)
.addComponent(jLabel19))
.addGap(18, 18, 18)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel32)
.addComponent(jLabel21))))
.addContainerGap(58, Short.MAX_VALUE))
);
jPanel11Layout.setVerticalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addGap(27, 27, 27)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel19)
.addComponent(jLabel32))
.addGap(18, 18, 18)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel21)
.addComponent(jLabel31))
.addGap(18, 18, 18)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel33)
.addComponent(jLabel34))
.addGap(18, 18, 18)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel53)
.addComponent(jLabel58))
.addGap(18, 18, 18)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel56)
.addComponent(jLabel57))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel49.add(jPanel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 10, 260, 180));
javax.swing.GroupLayout SumarizacaoLayout = new javax.swing.GroupLayout(Sumarizacao);
Sumarizacao.setLayout(SumarizacaoLayout);
SumarizacaoLayout.setHorizontalGroup(
SumarizacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel44, javax.swing.GroupLayout.PREFERRED_SIZE, 806, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel49, javax.swing.GroupLayout.PREFERRED_SIZE, 806, javax.swing.GroupLayout.PREFERRED_SIZE)
);
SumarizacaoLayout.setVerticalGroup(
SumarizacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(SumarizacaoLayout.createSequentialGroup()
.addComponent(jPanel44, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(jPanel49, javax.swing.GroupLayout.PREFERRED_SIZE, 380, javax.swing.GroupLayout.PREFERRED_SIZE))
);
getContentPane().add(Sumarizacao);
SairPanel.setLayout(new java.awt.GridLayout(5, 0));
SairPanel.add(jPanel28);
jLabel14.setFont(new java.awt.Font("Tahoma", 1, 15)); // NOI18N
jLabel14.setText("Deseja voltar ao menu inicial?");
jPanel29.add(jLabel14);
SairPanel.add(jPanel29);
jButton9.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton9.setText("Confirmar");
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});
jPanel30.add(jButton9);
SairPanel.add(jPanel30);
getContentPane().add(SairPanel);
BemVindoPanel.setLayout(new java.awt.GridLayout(5, 0));
BemVindoPanel.add(jPanel2);
jLabel15.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel15.setText("Bem Vindo");
jPanel3.add(jLabel15);
jLabel16.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel16.setText("jLabel16");
jPanel3.add(jLabel16);
jLabel17.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel17.setText("!");
jPanel3.add(jLabel17);
BemVindoPanel.add(jPanel3);
BemVindoPanel.add(jPanel27);
BemVindoPanel.add(jPanel38);
BemVindoPanel.add(jPanel45);
getContentPane().add(BemVindoPanel);
RestorePanel.setLayout(new java.awt.GridLayout(4, 0));
jPanel16.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 15));
RestorePanel.add(jPanel16);
jPanel72.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 15));
jLabel55.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel55.setText("Deseja restaurar dados?");
jPanel72.add(jLabel55);
RestorePanel.add(jPanel72);
jButton26.setText("Restaurar");
jButton26.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton26ActionPerformed(evt);
}
});
jPanel73.add(jButton26);
RestorePanel.add(jPanel73);
jLabel59.setForeground(new java.awt.Color(0, 102, 0));
jPanel18.add(jLabel59);
RestorePanel.add(jPanel18);
getContentPane().add(RestorePanel);
jMenu6.setText("Histórico");
jMenu1.setText("Visualizar");
jMenuItem1.setText("Setor");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem1);
jMenuItem3.setText("Cliente");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem3);
jMenuItem4.setText("Funcionario");
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem4);
jMenu6.add(jMenu1);
jMenuItem8.setText("Limpar");
jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem8ActionPerformed(evt);
}
});
jMenu6.add(jMenuItem8);
jMenuBar1.add(jMenu6);
jMenu7.setText("Sumarização");
jMenuItem6.setText("Setor");
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu7.add(jMenuItem6);
jMenuBar1.add(jMenu7);
jMenu8.setText("Backup");
jMenuItem10.setText("Criar Backup");
jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem10ActionPerformed(evt);
}
});
jMenu8.add(jMenuItem10);
jMenuItem11.setText("Restaurar Backup");
jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem11ActionPerformed(evt);
}
});
jMenu8.add(jMenuItem11);
jMenuBar1.add(jMenu8);
jMenu5.setText("Sair");
jMenuItem9.setText("Logout");
jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem9ActionPerformed(evt);
}
});
jMenu5.add(jMenuItem9);
jMenuBar1.add(jMenu5);
setJMenuBar(jMenuBar1);
setSize(new java.awt.Dimension(822, 513));
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents |
a0733170-aee4-4f4f-bd10-411bc33cd601 | 9 | @Override
protected Expression unary() throws ParsingException {
Expression result;
if (tokens[position].equals(Lexeme.NOT.s)) {
position++;
result = new Not(unary());
return result;
}
if (tokens[position].equals(Lexeme.FOR_ALL.s)) {
position++;
Term var = null;
if (isLowercaseVariable(tokens[position])) {
var = new Term(tokens[position]);
position++;
} else {
throw new ParsingException("something wrong, you tried to parse " + tokens[position] + " as variable");
}
result = new ForAll(var, unary());
return result;
}
if (tokens[position].equals(Lexeme.EXISTS.s)) {
position++;
Term var;
if (isLowercaseVariable(tokens[position])) {
var = term();
} else {
throw new ParsingException("something wrong, you tried to parse " + tokens[position] + " as variable");
}
result = new Exists(var, unary());
return result;
}
if (tokens[position].equals(Lexeme.LEFT_P.s)) {
int backupPos = position;
try {
position++;
result = expr();
if (!tokens[position].equals(Lexeme.RIGHT_P.s)) {
StringBuilder sb = new StringBuilder();
for (String s : tokens) {
sb.append(s);
}
throw new ParsingException("you have unclosed brackets in expression " + sb.toString());
} else {
position++;
}
return result;
} catch (ParsingException e) {
position = backupPos;
return predicate();
}
}
return predicate();
} |
11d273bd-7704-4935-a96d-fa623556e02e | 6 | public void verticalFill()
{
int assignTileInt = 0;
switch (tileSet)
{
case INDOORS:
assignTileInt = assignTileIntIndoors;
break;
case OUTDOORS:
assignTileInt = assignTileIntOutdoors;
break;
}
int tileNum = currentArea[location.x][location.y];
for (int y = location.y; y<=getAreaHeight(); y++)
{
if (currentArea[location.x][y] == tileNum)
{
currentArea[location.x][y]=assignTileInt;
}
else
break;
}
for (int y = location.y-1; y>=0; y--)
{
if (currentArea[location.x][y] == tileNum)
{
currentArea[location.x][y]=assignTileInt;
}
else
break;
}
} |
0bbdbf34-6470-4a65-91d9-ad2c0dbd4418 | 4 | public synchronized void unregister(Cancelable current) {
TreeNode currentNode = findNodeInTaskTrees(current);
if (currentNode instanceof TreeNode) {
List currentChildren = currentNode.getChildren();
TreeNode currentParent = currentNode.getParent();
for (Iterator iter = currentChildren.iterator(); iter.hasNext(); ) {
Tree child = (Tree)iter.next();
child.getRoot().setParent(currentParent);
}
if (currentParent instanceof TreeNode) {
Tree.removeFromParentChildren(currentNode);
currentParent.getChildren().addAll(currentChildren);
} else {
removeFromTaskTrees(currentNode);
for (Iterator iter = currentChildren.iterator(); iter.hasNext(); ) {
addToTaskTrees((Tree)iter.next());
}
}
}
} |
2e4771f3-1bb5-4981-b017-ab3a999fde4b | 7 | private void output(String outputDir) {
File file = new File(outputDir + File.separatorChar + "objectsInAllDumps.md");
if (!file.getParentFile().exists())
file.getParentFile().mkdirs();
try {
PrintWriter writer = new PrintWriter(new FileWriter(file));
writer.println("## Heap Dump");
DecimalFormat format = new DecimalFormat(",###");
for (int i = 0; i < dumpFiles.size(); i++) {
writer.println("### Dump " + i + " ["
+ dumpFiles.get(i).getCounterName() + " = "
+ format.format(dumpFiles.get(i).getCounter()) + "]"
+ " name = " + dumpFiles.get(i).getFile().getName());
UserObjectsPerDump uDump = userObjsPerDumpList.get(i);
uDump.output(writer);
writer.println();
}
writer.println("### Framework objects");
if (!bufferObjs.isEmpty()) {
writer.println("#### SpillBuffer\n");
writer.println("| FrameworkObj \t| Inner object \t| shallowHeap \t| retainedHeap \t|");
writer.println("| :----------- | :----------- | -----------: | -----------: |");
for (BufferObject bufferObj : bufferObjs) {
writer.println(bufferObj);
}
writer.println();
}
writer.println();
writer.println();
if (!segments.isEmpty()) {
writer.println("#### Segments\n");
writer.println("| Location \t | FrameworkObj \t| Inner object \t| retainedHeap \t| taskId \t|");
writer.println("| :----------- | :----------- | :----------- | -----------: | -----------: |");
for (SegmentObj sObj : segments) {
writer.println(sObj);
}
writer.println();
}
writer.println();
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
67c57d6f-4038-4d5a-a2ec-eef0fca61f0b | 9 | private static posCounter errorPosition(String mm){
int i = 0; //iterator for loop
int pi = 0; //positions index number
int in = 0; //boolean for values inside pre array
int con = 0;//holder for converted atoi values
int pri = 0;//iterator for previous digit arra
posCounter count = new posCounter();
String pre = null;
//char pre[5];//previous digit characters array
char[] mis_match = mm.toCharArray();
for (i = 0; i < mis_match.length; i++){
if(isalpha(mis_match[i]) && in == 1 && pre != null){
con += Integer.parseInt(pre);
count.positions.add(con);
//positions[pi] = con;
con++;
//pi++;
count.numEvents++;
in = 0;
pre = null;
pri = 0;
}else if(isalpha(mis_match[i]) && in == 0){
count.positions.add(con);
//positions[pi] = con;
con++;
pi++;
}else if(isdigit(mis_match[i])){
if(pre == null){
pre = String.valueOf(mis_match[i]);
}else{
pre = pre + mis_match[i];
}
//pre[pri] = mis_match[i];
pri++;
in = 1;
}
}
if(pre != null){
con += Integer.parseInt(pre);
count.positions.add(con);
//con += atoi(pre);
//positions[pi] = con;
count.numEvents++;
pi++;
}
return count;
} |
1dcae9eb-9a6b-474f-aefa-4a23a25f6550 | 4 | private void ProcurarEquipa_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ProcurarEquipa_ButtonActionPerformed
try {
Equipa equipa = a.getEquipa(Escola_ComboBox1.getSelectedItem().toString(), Escola_ComboBox1.getSelectedItem().toString() + "-" + Equipa_ComboBox2.getSelectedItem().toString());
if (equipa != null) {
EquipaSelecionada_Label.setText(Equipa_ComboBox2.getSelectedItem().toString());
Jogadores_List2.setModel(new DefaultListModel());
DefaultListModel modelo = (DefaultListModel) Jogadores_List2.getModel();
for (Jogador c : a.getDAOEscola().get(Escola_ComboBox1.getSelectedItem().toString()).getJogadores(Escola_ComboBox1.getSelectedItem().toString() + "-" + Equipa_ComboBox2.getSelectedItem().toString())) {
modelo.addElement(c.getNome() + "-" + c.getDataNascimento());
}
}
for (Component component : DadosJogador_Panel.getComponents()) {
component.setEnabled(true);
}
DadosJogador_Panel.setEnabled(true);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, ex.getMessage(), "Erro!", JOptionPane.ERROR_MESSAGE);
}
}//GEN-LAST:event_ProcurarEquipa_ButtonActionPerformed |
118159e4-701b-4c4c-9557-74466a534c42 | 4 | static void setup(CommandLine line) throws NumberFormatException {
if (line.hasOption("array_id")) {
parameterNumber = Long.parseLong(line.getOptionValue("array_id"));
}
if (line.hasOption("database")) {
databaseStem = line.getOptionValue("database");
}
if (line.hasOption("db_hostname")) {
dbHostname = line.getOptionValue("db_hostname");
}
if (line.hasOption("db_port")) {
dbPort = line.getOptionValue("db_port");
}
} |
5bd695fc-fb3d-4439-83ab-d0072ce59549 | 8 | public void changeState(){
deltaTime = 0;
state = state.next();
//state.print();
switch (state) {
case KKMMM:
US.setLamps(true, true, false);
Barat.setLamps(true, false, false);
Timur.setLamps(true, false, false);
TU.setLamp(true);
stateTime = Main.time[0];
break;
case HHMMM:
US.setLamps(false, false, true);
Barat.setLamps(true, false, false);
Timur.setLamps(true, false, false);
TU.setLamp(true);
stateTime = Main.time[1];
break;
case MMMKM:
US.setLamps(true, false, false);
Barat.setLamps(true, false, false);
Timur.setLamps(true, true, false);
TU.setLamp(true);
stateTime = Main.time[2];
break;
case MMMHH:
US.setLamps(true, false, false);
Barat.setLamps(true, false, false);
Timur.setLamps(false, false, true);
TU.setLamp(false);
stateTime = Main.time[3];
break;
case MMKHH:
US.setLamps(true, false, false);
Barat.setLamps(true, true, false);
Timur.setLamps(false, false, true);
TU.setLamp(false);
stateTime = Main.time[4];
break;
case MMKHM:
US.setLamps(true, false, false);
Barat.setLamps(true, true, false);
Timur.setLamps(false, false, true);
TU.setLamp(true);
stateTime = Main.time[5];
break;
case MMHHM:
US.setLamps(true, false, false);
Barat.setLamps(false, false, true);
Timur.setLamps(false, false, true);
TU.setLamp(true);
stateTime = Main.time[6];
break;
case MMKKM:
US.setLamps(true, false, false);
Barat.setLamps(true, true, false);
Timur.setLamps(true, true, false);
TU.setLamp(true);
stateTime = Main.time[7];
break;
}
} |
08897ead-6377-4497-b248-77becb39a26c | 8 | public HttpResponse makeResponse(HttpRequest request, String rootDirectory, File file) {
// Handling PUT request here
boolean preexists = false;
if (file.exists()) {
preexists = true;
}
HttpResponse response = null;
if (file.getParentFile().exists() || file.getParentFile().mkdirs()) {
BufferedWriter writer = null;
try {
writer = new BufferedWriter( new FileWriter(file));
writer.write( request.getBody());
} catch (IOException e) {
response = HttpResponseFactory.create500InternalServerError(Protocol.CLOSE);
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
} else {
response = HttpResponseFactory.create500InternalServerError(Protocol.CLOSE);
}
// if nothing has gone wrong so far...
if (response == null) {
if (preexists) {
// Lets create 204 No Content response
response = HttpResponseFactory.create204NoContent(Protocol.CLOSE);
} else {
// Lets create 201 Created response
response = HttpResponseFactory.create201Created(null, Protocol.CLOSE);
}
}
return response;
} |
6a3fb67e-7f04-468f-be11-c098eb507a10 | 0 | public void setDirty() {
// EDebug.print("Change has come");
dirty = true;
} |
4e9b1f28-1924-4108-9f5c-f6085ac242a8 | 6 | @Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
int i1 = par1 - 1;
int j1 = par2 - 1;
int k1 = par3 + 2;
int l1 = par4 + 2;
int[] aint = this.parent.getInts(i1, j1, k1, l1);
int[] aint1 = IntCache.getIntCache(par3 * par4);
for (int i2 = 0; i2 < par4; ++i2)
{
for (int j2 = 0; j2 < par3; ++j2)
{
int k2 = aint[j2 + 1 + (i2 + 1) * k1];
this.initChunkSeed(j2 + par1, i2 + par2);
if (k2 == 0)
{
aint1[j2 + i2 * par3] = 0;
}
else
{
int l2 = this.nextInt(4);
byte b0;
if (l2 == 0)
{
b0 = 4;
}
else if (l2 <= 1)
{
b0 = 3;
}
else if (l2 <= 2)
{
b0 = 2;
}
else
{
b0 = 1;
}
aint1[j2 + i2 * par3] = b0;
}
}
}
return aint1;
} |
ac8dea9b-ad98-4962-89e1-bc302c5ac665 | 0 | public void setCode_lab(String code_lab) {
this.code_lab = code_lab;
} |
0b755928-c14b-49dd-bfdb-7da89d8effe5 | 3 | private void fillInElementsOnProjectList(int projectID){
listOfElements.clear();
if (projectID >=1){
try{
ResultSet elementsOnProjectListResultSet = null;
Statement statement;
statement = connection.createStatement();
elementsOnProjectListResultSet = statement.executeQuery("SELECT Element.elementID, Element.elementName, SetOFElements.ProjectID FROM Element INNER JOIN SetOFElements ON Element.[elementID] = SetOFElements.[elementID] WHERE ProjectID="+ projectID +";");
int elementID;
String elementName;
while(elementsOnProjectListResultSet.next())
{
elementID = elementsOnProjectListResultSet.getInt("elementID");
elementName = elementsOnProjectListResultSet.getString("elementName");
Element element = new Element(elementID,elementName);
listOfElements.add(element);
listElementsList.setListData(listOfElements);
ProjectElementsListCellRenderer renderer = new ProjectElementsListCellRenderer(); //custom cell renderer to display property rather than useless object.toString()
listElementsList.setCellRenderer(renderer);
}
}catch(SQLException err)
{
System.out.println("ERROR: " + err);
JOptionPane.showMessageDialog(null,"* Cannot connect to database! *");
System.exit(1);
}
}else{
listOfElements.clear();
listElementsList.setListData(listOfElements);
listElementsList.repaint();
}
} |
de5bbe06-5d59-4c7d-a82c-6bc9ccb7bdf8 | 8 | private boolean checkJpeg() throws IOException {
byte[] data = new byte[6];
while (true) {
if (read(data, 0, 4) != 4) {
return false;
}
int marker = getShortBigEndian(data, 0);
int size = getShortBigEndian(data, 2);
if ((marker & 0xff00) != 0xff00) {
return false; // not a valid marker
}
if (marker >= 0xffc0 && marker <= 0xffcf && marker != 0xffc4 && marker != 0xffc8) {
if (read(data) != 6) {
return false;
}
format = FORMAT_JPEG;
bitsPerPixel = (data[0] & 0xff) * (data[5] & 0xff);
width = getShortBigEndian(data, 3);
height = getShortBigEndian(data, 1);
return true;
} else {
skip(size - 2);
}
}
} |
b30d4f03-cff3-466a-b7f3-208657d8e7b2 | 1 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
Answer[] testans = new Answer[4];
int i = 0;
while (i <= 3)
{
testans[i] = new Answer("aa", false);
i++;
}
// Question q = new Question("What's the first letter repeated?", testans, 0);
// List<Question> quests = new ArrayList<Question>();
// Question q1 = new Question("Blah blabhah balhaha", testans, 0);
// quests.add(q);
// quests.add(q1);
// Quiz qz = new Quiz(quests);
Quiz qz = DbAccess.getQuizzes()[0];
qz.questionList = DbAccess.getQuizQuestions(qz.quizDBId);
QuizRunner qr = new QuizRunner(qz, usr);
}//GEN-LAST:event_jButton1ActionPerformed |
34bf64da-c743-41cc-820a-6ba2374e022d | 3 | @Override
public void updateIcon() {
if(isProperty()) {
if (isPropertyInherited()) {
setIcon(ICON_IS_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_PROPERTY);
}
} else {
if (isPropertyInherited()) {
setIcon(ICON_IS_NOT_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_NOT_PROPERTY);
}
}
} |
47c3496c-ed7f-44d1-9f34-0ea263752d4a | 4 | public static void main(String[] args){
Settings settings = new Settings();
File propFile =settings.getPropertiesFile();
boolean outcome = true;
if(propFile.exists()&&propFile.isFile()){
try{
propFile.delete();
} catch (Exception e){
System.err.println("Failed to clean up");
outcome=false;
}
}
InitDemoDB.initDB(settings.getSetting("homeDir")+settings.getSetting("databasePathExt")+settings.getSetting("databaseFileName"));
if(outcome) System.out.println("Cleanup Complete");
} |
a7d53d88-a5c8-4c10-9548-3030595f722b | 6 | public RdbToRdf(String dir) throws ClassNotFoundException {
if (!dir.endsWith("/")) {
dir = dir + "/";
}
File f = new File(dir);
if (!f.isDirectory()) {
f.mkdir();
}
dir = dir + "TDB/";
f = new File(dir);
if (f.isDirectory()) {
if (f.exists()) {
String[] myfiles = f.list();
if (myfiles.length > 0) {
for (int i = 0; i < myfiles.length; i++) {
File auxFile = new File(dir + myfiles[i]);
auxFile.delete();
}
}
f.delete();
}
}
f.mkdir();
model = TDBFactory.createModel(dir);
model.setNsPrefix("geo", Constants.NSGEO);
model.setNsPrefix("xsd", Constants.NSXSD);
} |
6f88e2fe-d38d-4a59-abc3-ad8b2217ca89 | 6 | @Override
public void validate() {
session = ActionContext.getContext().getSession();
User u1 = (User) session.get("User");
Criteria ucri = getMyDao().getDbsession().createCriteria(User.class);
ucri.add(Restrictions.eq("emailId", u1.getEmailId()));
ucri.add(Restrictions.eq("password", existpass));
ucri.setMaxResults(1);
if (existpass.isEmpty()) {
addActionError("Please Enter Existing Password");
} else if (ucri.list().isEmpty()) {
addActionError("Current password doesn't match please try again");
}
if (newpass.isEmpty()) {
addActionError("Please Enter New Password");
}
if (cfnewpass.isEmpty()) {
addActionError("Please Enter Confirm New Password");
} else if (!cfnewpass.equals(newpass) && !newpass.equals(cfnewpass)) {
addActionError("New Password & Confirm New Password Mismatch Please Enter Again");
}
} |
a3646750-158e-4900-8459-a6defed5f2dd | 0 | public static void main(String[] args) {
System.out.println(2147483647);
System.out.println(-2147483648);
System.out.println(9223372036854775807L);
System.out.println(-9223372036854775808L);
} |
edf1a3d0-b2f1-4216-aa33-0271bd99e2ad | 9 | @Override
protected Integer val00(Integer val) {
if(val<10) return 1;
if(val<20) return 2;
if(val<30) return 3;
if(val<40) return 4;
if(val<50) return 5;
if(val<60) return 6;
if(val<70) return 7;
if(val<80) return 8;
if(val<90) return 9;
return 10;
} |
3f84a133-a3ef-49d9-8cc0-5f0bfa8cd3b8 | 1 | @Test
public void populationRightSize(){
System.out.println(pop.getIndividuals().size());
while(pop.getNumberOfGenerations() < NUM_GEN){
pop.newGeneration();
assertEquals("population size", POP_SIZE, pop.getIndividuals().size());
}
} |
2d89a7e3-8d8d-46f8-b9bf-7a16106075c1 | 0 | public boolean isExpired()
{
return timeout<(System.currentTimeMillis()/1000L);
} |
38f7f85d-1ef0-4075-abb8-07ca88f87cb8 | 5 | public static String GetRegionInformation(String Region) {
String regionString = null;
Document doc;
File Xml = new File("Regions.xml");
try {
if (!Xml.exists()) {
System.out.println("- Extracting Region.xml...");
InputStream is = Tools.class.getClass().getResourceAsStream(
"/Regions.xml");
FileOutputStream out = new FileOutputStream(new File(
"Regions.xml"));
int read;
byte[] bytes = new byte[1024];
while ((read = is.read(bytes)) != -1) {
out.write(bytes, 0, read);
}
}
DocumentBuilderFactory dbFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder dBuilder;
dBuilder = dbFactory.newDocumentBuilder();
doc = dBuilder.parse(Xml);
doc.getDocumentElement().normalize();
NodeList nList = doc.getElementsByTagName(Region);
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
regionString = eElement.getElementsByTagName("Region")
.item(0).getTextContent();
}
}
} catch (ParserConfigurationException | SAXException | IOException e) {
logger.error(e.getClass() + " " + e.getMessage());
regionString = null;
}
return regionString;
} |
fd521b9a-887a-478f-a8dc-aaa58bc7fa9f | 0 | public int getRepeat() {
return repeat;
} |
74eaba77-6e40-46a0-ae61-db53e99437b6 | 0 | protected final void setAuthor(String author) {
this.author = author;
} |
fa429eef-0bef-4e81-ba7a-e1941b2b0b12 | 2 | public static void setWebRootPath(String webRootPath) {
if (webRootPath == null) {
return;
}
if (webRootPath.endsWith(File.separator)) {
webRootPath = webRootPath.substring(0, webRootPath.length() - 1);
}
PathKit.webRootPath = webRootPath;
} |
012d8c25-a683-4fdf-8360-5da526bc8fa3 | 5 | private Image unmarshalImage(Node t, String baseDir) throws IOException
{
Image img = null;
String source = getAttributeValue(t, "source");
if (source != null) {
if (checkRoot(source)) {
source = makeUrl(source);
} else {
source = makeUrl(baseDir + source);
}
img = ImageIO.read(new URL(source));
} else {
NodeList nl = t.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node node = nl.item(i);
if ("data".equals(node.getNodeName())) {
Node cdata = node.getFirstChild();
if (cdata != null) {
String sdata = cdata.getNodeValue();
char[] charArray = sdata.trim().toCharArray();
byte[] imageData = Base64.decode(charArray);
img = ImageHelper.bytesToImage(imageData);
// Deriving a scaled instance, even if it has the same
// size, somehow makes drawing of the tiles a lot
// faster on various systems (seen on Linux, Windows
// and MacOS X).
img = img.getScaledInstance(
img.getWidth(null), img.getHeight(null),
Image.SCALE_FAST);
}
break;
}
}
}
return img;
} |
6441a4f5-5c34-43b7-8b7c-8f8d6a1c2cfa | 3 | protected static OutputStream getStream(File file, int flags) throws IOException
{
OutputStream output = new FileOutputStream(file);
if ((flags & NBTSerializer.BUFFERED) != 0)
{
output = new BufferedOutputStream(output);
}
if ((flags & NBTSerializer.COMPRESSED) != 0)
{
output = new GZIPOutputStream(output);
}
if ((flags & NBTSerializer.BUFFERED2) != 0)
{
output = new BufferedOutputStream(output);
}
return output;
} |
63bcfe3f-b7cb-4a9c-a39f-e1159803b077 | 9 | public void run() {
try {
boolean running = true;
while (running) {
try {
String line = null;
while ((line = _breader.readLine()) != null) {
try {
_bot.handleLine(line);
}
catch (Throwable t) {
// Stick the whole stack trace into a String so we can output it nicely.
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
pw.flush();
StringTokenizer tokenizer = new StringTokenizer(sw.toString(), "\r\n");
synchronized (_bot) {
_bot.log("### Your implementation of PircBot is faulty and you have");
_bot.log("### allowed an uncaught Exception or Error to propagate in your");
_bot.log("### code. It may be possible for PircBot to continue operating");
_bot.log("### normally. Here is the stack trace that was produced: -");
_bot.log("### ");
while (tokenizer.hasMoreTokens()) {
_bot.log("### " + tokenizer.nextToken());
}
}
}
}
if (line == null) {
// The server must have disconnected us.
running = false;
}
}
catch (InterruptedIOException iioe) {
// This will happen if we haven't received anything from the server for a while.
// So we shall send it a ping to check that we are still connected.
this.sendRawLine("PING " + (System.currentTimeMillis() / 1000));
// Now we go back to listening for stuff from the server...
}
}
}
catch (Exception e) {
// Do nothing.
}
// If we reach this point, then we must have disconnected.
try {
_socket.close();
}
catch (Exception e) {
// Just assume the socket was already closed.
}
if (!_disposed) {
_bot.log("*** Disconnected.");
_isConnected = false;
_bot.onDisconnect();
}
} |
a9562b34-91f9-48d3-b7ad-09531e2aae50 | 7 | public void draw(Graphics g) {
int i, p;
for (i = 0; i != 2; i++) {
setVoltageColor(g, volts[nCoil1 + i]);
drawThickLine(g, coilLeads[i], coilPosts[i]);
}
int x = ((flags & FLAG_SWAP_COIL) != 0) ? 1 : 0;
drawCoil(g, dsign * 6, coilLeads[x], coilLeads[1 - x],
volts[nCoil1 + x], volts[nCoil2 - x]);
// draw lines
g.setColor(Color.darkGray);
for (i = 0; i != poleCount; i++) {
if (i == 0) {
interpPoint(point1, point2, lines[i * 2], .5,
openhs * 2 + 5 * dsign - i * openhs * 3);
} else {
interpPoint(point1, point2, lines[i * 2], .5,
(int) (openhs * (-i * 3 + 3 - .5 + d_position)) + 5 * dsign);
}
interpPoint(point1, point2, lines[i * 2 + 1], .5,
(int) (openhs * (-i * 3 - .5 + d_position)) - 5 * dsign);
g.drawLine(lines[i * 2].x, lines[i * 2].y, lines[i * 2 + 1].x, lines[i * 2 + 1].y);
}
for (p = 0; p != poleCount; p++) {
int po = p * 3;
for (i = 0; i != 3; i++) {
// draw lead
setVoltageColor(g, volts[nSwitch0 + po + i]);
drawThickLine(g, swposts[p][i], swpoles[p][i]);
}
interpPoint(swpoles[p][1], swpoles[p][2], ptSwitch[p], d_position);
//setVoltageColor(g, volts[nSwitch0]);
g.setColor(whiteColor);
drawThickLine(g, swpoles[p][0], ptSwitch[p]);
switchCurCount[p] = updateDotCount(switchCurrent[p],
switchCurCount[p]);
drawDots(g, swposts[p][0], swpoles[p][0], switchCurCount[p]);
if (i_position != 2) {
drawDots(g, swpoles[p][i_position + 1], swposts[p][i_position + 1],
switchCurCount[p]);
}
}
coilCurCount = updateDotCount(coilCurrent, coilCurCount);
drawDots(g, coilPosts[0], coilLeads[0], coilCurCount);
drawDots(g, coilLeads[0], coilLeads[1], coilCurCount);
drawDots(g, coilLeads[1], coilPosts[1], coilCurCount);
drawPosts(g);
setBbox(coilPosts[0], coilLeads[1], 0);
adjustBbox(swpoles[poleCount - 1][0], swposts[poleCount - 1][1]); // XXX
} |
058ee705-448f-4159-bc4d-e02df1369e27 | 4 | public void keyPressed(KeyEvent w) {
int code = w.getKeyCode();
if (code == KeyEvent.VK_A) {
i=0;
dx = -SPEED;
} else if (code == KeyEvent.VK_D) {
i=1;
dx = SPEED;
} else if (code == KeyEvent.VK_W) {
dy = -SPEED;
} else if (code == KeyEvent.VK_S) {
dy = SPEED;
}
} |
52970348-a8d3-497e-8b14-d326f780faef | 0 | public boolean equals(char c) {
return this.id == c;
} |
64cdf0e2-5954-4034-97bb-273eec73a380 | 5 | public static float convertSpeedUnitIndexToFactor(int index) {
switch (index) {
case 0:
return KPH;
case 1:
return MPH;
case 2:
return MPS;
case 3:
return KN;
case 4:
return KN;
default:
return KPH;
}
} |
92231099-552e-4804-9fda-5dcea60feef5 | 1 | public void addPatient(Patient2 newPatient) {
if (this.isLast) {
Patient2 first = nextPatient;
nextPatient = newPatient;
nextPatient.isFirst = false;
nextPatient.nextPatient = first;
this.isLast = false;
} else {
nextPatient.addPatient(newPatient);
}
} |
df1b8a52-0107-4a7c-a9c9-81d0253ea0e1 | 3 | public void paint(Graphics g) {
//Background
g.setColor(Color.black);
g.fillRect(0, 0, Run.window.getWidth(), Run.window.getHeight());
//
//Title
g.setFont(titleFont);
g.setColor(Color.white);
g.drawString(Run.TITLE, 50, 50);
//
//Buttons
g.setFont(buttonFont);
if (!hoveringStart) {
g.setColor(Color.gray);
} else {
g.setColor(Color.white);
}
g.drawString(startGameText, startGame.x, startGame.y - 10);
if (!hoveringOptions) {
g.setColor(Color.gray);
} else {
g.setColor(Color.white);
}
g.drawString(optionsText, options.x, options.y - 10);
if (!hoveringExit) {
g.setColor(Color.gray);
} else {
g.setColor(Color.white);
}
g.drawString(exitGameText, exitGame.x, exitGame.y - 10);
//
} |
b4867902-4f36-4f01-a279-18808fbfd2d2 | 2 | public AcyclicSP(EdgeWeightedDigraph G, int s)
{
distTo = new double[G.V()];
for (int i = 0; i < G.V(); i++)
distTo[i] = Double.POSITIVE_INFINITY;
distTo[s] = 0;
edgeTo = new WeightedDirectedEdge[G.V()];
Topological topological = new Topological(G.digraph());
for (Integer v : topological.order())
relax(G, v);
} |
6c8f7394-96ae-4fea-828f-d8ff1cc39ed6 | 4 | @Override
public void mouseReleased(MouseEvent event) {
if (isEnabled()) {
Row rollRow = null;
try {
rollRow = mRollRow;
if (mDividerDrag != null && allowColumnResize()) {
dragColumnDivider(event.getX());
}
mDividerDrag = null;
if (mSelectOnMouseUp != -1) {
mModel.select(mSelectOnMouseUp, false);
mSelectOnMouseUp = -1;
}
} finally {
repaintChangedRollRow(rollRow);
}
}
} |
5afeb251-726b-4fe7-90d0-03458b9177dc | 0 | public Date getNextDay(Date date) {
Calendar calendar = getStartOfDate(date);
calendar.add(Calendar.DAY_OF_MONTH, 1);
return calendar.getTime();
} |
0169d53e-50fe-4f18-8726-c90b8b06cea7 | 8 | public static boolean readConfig(String fileName,int nodeid) {
System.out.println("Reading config for"+nodeid);
nodeID=nodeid;
BufferedReader bReader = null;
int nodesCount=0;
try {
bReader = new BufferedReader(new FileReader(fileName));
String line = bReader.readLine();
boolean firstLine=true;
while(line!=null){
if(firstLine){
firstLine=false;
}else{
StringTokenizer st = new StringTokenizer(line, ",");
int nodeID=Integer.parseInt((String) st.nextElement());
String address=(String)st.nextElement();
int portNumber=Integer.parseInt((String) st.nextElement());
NodeDetails nodeObj=new NodeDetails(nodeID, portNumber, address);
mapNodes.put(nodeID,nodeObj);
mapNodesByAddress.put(address+String.valueOf(portNumber),nodeObj);
nodesCount++;
}
line = bReader.readLine();
if(line!=null && line.length()==0)
break;
}
totalNodes=nodesCount;
//System.out.println("Total Nodes"+totalNodes);
//All the Node info has been filled
if(mapNodes.containsKey(nodeID))
currentNode=mapNodes.get(nodeID);
else{
System.out.println("*********************************************************");
System.out.println("Please Supply the correct Process ID"+nodeid);
System.out.println("*********************************************************");
System.out.println("Exiting");
return false;
}
}catch (IOException e) {
e.printStackTrace();
System.out.println("*********************************************************");
System.out.println("Exception in reading config"+e.toString());
return false;
} finally {
try {
if (bReader != null)
bReader.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
return true;
} |
6eac5cb0-f1fb-4159-b310-4b90c95b34d4 | 4 | private void printAll(TreeNode root, TreeNode parent, Node parentNode, int i) {
Node p;
int parentPosition = getRectNextLeft(i);
if (root != null && parent == null) {
p = makeNode(String.valueOf(root.key), new Point(parentPosition, getRectNextTop(0)), Node.COLOR_PARENT, i);
} else {
p = parentNode;
}
if (root == null) {
p = makeNode("", new Point(parentPosition, getRectNextTop(0)), Node.COLOR_PARENT, i);
}
if (root != null) {
recursivePrint(root.left, parentPosition, null, p, i);
recursivePrint(root.right, parentPosition, null, p, i);
}
} |
2bd8d013-e82b-41a3-8acf-9243d7ab36a7 | 9 | public final static Entry<Integer,String> getNumberFollowedByString(final String str)
{
if((str==null)||(str.length()<2))
return null;
if(!Character.isDigit(str.charAt(0)))
return null;
int dex=1;
for(;dex<str.length();dex++)
if(Character.isLetter(str.charAt(dex)))
break;
else
if(!Character.isDigit(str.charAt(dex)))
return null;
if(dex>=str.length())
return null;
final int endNumber=dex;
for(;dex<str.length();dex++)
if(!Character.isLetter(str.charAt(dex)))
return null;
final Integer num=Integer.valueOf(s_int(str.substring(0,endNumber)));
final String rest=str.substring(endNumber);
return new Entry<Integer,String>()
{
@Override public Integer getKey() { return num;}
@Override public String getValue() { return rest;}
@Override public String setValue(String value) { return value;}
};
} |
eb6f2079-5cba-4fde-bfc9-a960544511bc | 8 | public RemoteConsoleServer(InputStream remoteClientIn, OutputStream remoteClientOut) {
this.remoteClientIn = remoteClientIn;
this.remoteClientOut = remoteClientOut;
inputStream = new FilterInputStream(remoteClientIn) {
private void checkRead() throws IOException {
if (available() == 0) {
if (passwordMode)
writer.write(ESCAPE + "P");
else
writer.write(ESCAPE + "R");
writer.flush();
}
}
public int read() throws IOException {
checkRead();
int result = super.read();
if (result == -1)
System.exit(0);
return result;
}
public int read(byte[] data) throws IOException {
checkRead();
int result = super.read(data);
if (result == -1)
System.exit(0);
return result;
}
public int read(byte[] data, int offset, int length) throws IOException {
checkRead();
int result = super.read(data, offset, length);
if (result == -1)
System.exit(0);
return result;
}
};
outputStream = new PrintStream(remoteClientOut, true);
try {
reader = new BufferedReader(new InputStreamReader(inputStream, "utf-8")) {
private void checkRead() throws IOException {
if (!ready()) {
if (passwordMode)
writer.write(ESCAPE + "P");
else
writer.write(ESCAPE + "R");
writer.flush();
}
}
public int read(char[] cbuf, int off, int len) throws IOException {
checkRead();
return super.read(cbuf, off, len);
}
};
writer = new PrintWriter(new OutputStreamWriter(outputStream, "utf-8"), true);
}
catch (UnsupportedEncodingException e) {
throw new Error(e);
}
setTextAttributes(Enigma.getSystemTextAttributes("attributes.console.default"));
} |
6d68aa58-66cb-4bd6-a958-8df9d8fd3f5e | 6 | @Override public void onInitSuccess(MidiAccess midiAccess) {
log("Web MIDI initialized.");
//list input ports
log("List of input ports:");
if (midiAccess.getInputs().size() == 0)
log("- (None)");
for (MidiInput mi : midiAccess.getInputs())
log("- " + mi.port.name);
//list output ports
log("List of output ports:");
if (midiAccess.getOutputs().size() == 0)
log("- (None)");
for (MidiOutput mo : midiAccess.getOutputs())
log("- " + mo.port.name);
log("Playing some notes on the first output port.");
MidiOutput out = midiAccess.getOutputs().get(0);
int[] notes = {0x45, 0x49, 0x4C};
for (int i = 0; i < notes.length; i++) {
out.send(new int[]{0x90, notes[i], 0x7f}, GwtWebMidi.getPerformanceNow() + (i+1) * 1000);
out.send(new int[]{0x80, notes[i], 0x7f}, GwtWebMidi.getPerformanceNow() + (notes.length+1) * 1000);
}
//listen for input events
if (midiAccess.getInputs().size() > 0) {
log("You can play some notes on the first MIDI input port now.");
midiAccess.getInputs().get(0).addListener(new MidiInputListener() {
@Override public void onMidiMessage(MidiMessageEvent event) {
log("* Received event: " + event);
}
});
}
} |
3eaf3cb3-2dbb-4720-adc1-29288aad237b | 6 | public void sendToPlayer (Player player, Location location, float offsetX,
float offsetY, float offsetZ, float speed, int count)
{
try
{
Object packet = nms_packet63WorldParticles.newInstance();
Reflection.setValue(packet, "a", name);
Reflection.setValue(packet, "b", (float) location.getX());
Reflection.setValue(packet, "c", (float) location.getY());
Reflection.setValue(packet, "d", (float) location.getZ());
Reflection.setValue(packet, "e", offsetX);
Reflection.setValue(packet, "f", offsetY);
Reflection.setValue(packet, "g", offsetZ);
Reflection.setValue(packet, "h", speed);
Reflection.setValue(packet, "i", count);
if (craftPlayer_getHandle == null)
{
craftPlayer_getHandle =
player.getClass().getMethod("getHandle", new Class[] {});
}
Object playerConnection =
Reflection.getValue(craftPlayer_getHandle.invoke(player),
"playerConnection");
if (playerConnection_sendPacket == null)
{
playerConnection_sendPacket =
playerConnection.getClass().getMethod("sendPacket",
nms_packet);
}
playerConnection_sendPacket.invoke(playerConnection, packet);
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
catch (InvocationTargetException e)
{
e.printStackTrace();
}
catch (NoSuchMethodException e)
{
e.printStackTrace();
}
catch (InstantiationException e)
{
e.printStackTrace();
}
} |
b0fcbb79-fc14-44b3-90e7-05f0df07782e | 7 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
unInvoke();
if(msg.source().playerStats()!=null)
msg.source().playerStats().setLastUpdated(0);
}
} |
e30b9c6f-1f92-42fc-aff5-07458eaa2f5e | 1 | ByteVector put12(final int b, final int s) {
int length = this.length;
if (length + 3 > data.length) {
enlarge(3);
}
byte[] data = this.data;
data[length++] = (byte) b;
data[length++] = (byte) (s >>> 8);
data[length++] = (byte) s;
this.length = length;
return this;
} |
69958e5a-367c-426b-9f43-e39d8d3f7e25 | 1 | public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException
{
//Step 1:获得dom解析器工厂(工作的作用是用于创建具体的解析器)
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
//Step 2:获得具体的解析器
DocumentBuilder db = dbf.newDocumentBuilder();
//Step 3:解析一个xml文件,获得Document对象(根节点)
Document document = db.parse(new File("students.xml"));
NodeList nodeList = document.getElementsByTagName("学生");
for(int i= 0 ;i < nodeList.getLength();i++)
{
Element element = (Element)nodeList.item(i);
String content= element.getElementsByTagName("姓名").item(0).getFirstChild().getNodeValue();
System.out.println("姓名:" + content);
content = element.getElementsByTagName("性别").item(0).getFirstChild().getNodeValue();
System.out.println("性别:" + content);
content = element.getElementsByTagName("年龄").item(0).getFirstChild().getNodeValue();
System.out.println("年龄:" + content);
}
} |
15411f48-ac5d-4cd7-86af-c5ce710bac77 | 5 | @Override
public void rewind()
{
switch( channelType )
{
case SoundSystemConfig.TYPE_NORMAL:
if( clip != null )
{
boolean rePlay = clip.isRunning();
clip.stop();
clip.setFramePosition(0);
if( rePlay )
{
if( toLoop )
clip.loop( Clip.LOOP_CONTINUOUSLY );
else
clip.start();
}
}
break;
case SoundSystemConfig.TYPE_STREAMING:
// rewinding for streaming sources is handled elsewhere
break;
default:
break;
}
} |
707c9360-f3c8-452e-aefe-d46302f3de30 | 5 | public int genHeat(Element e) {
Random r = new Random();
switch(e) {
case ICE:
return -r.nextInt(5);
case GAS:
return -r.nextInt(200);
case WATER:
return r.nextInt(20)-10;
case FIRE:
return r.nextInt(75);
case TERRA:
return r.nextInt(30);
default:
return 0;
}
} |
5393b527-a823-4b6c-9572-9eb4d44e1fd3 | 3 | @Override
public void print() {
System.out.println();
System.out.println("Matrix" + rows + "x" + cols);
System.out.println("-------------------------------------------------");
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
try {
System.out.printf("%8.3f ", this.getValue(i, j));
} catch (MatrixIndexOutOfBoundsException e) {
System.out.println("Error: " + e);
}
}
System.out.println();
}
} |
e6be1086-8665-4dbe-9d62-1537684e484f | 0 | public int pop() {
return runStack.remove(runStack.size() - 1);
} |
34ea7b9b-4c9c-491a-a75a-8c92857df5f1 | 5 | public double expectedOccurences(String s)
{
double prob = 1.0;
for (int i = 0; i < s.length(); i++)
{
switch (s.charAt(i))
{
case 'A':
prob *= props[0];
break;
case 'T':
prob *= props[1];
break;
case 'G':
prob *= props[2];
break;
case 'C':
prob *= props[3];
break;
default:
break;
}
}
return prob * (double) nucleoCount;
} |
04d174d9-247e-44fc-bfea-db9418e53ba2 | 7 | private SimpleNode findNodeABRI(SimpleNode node, final int value) {
SimpleNode ret = null;
if (this.root == null) {
throw new RuntimeException("Le noeud [" + this.min + "; " + this.max + "] est vide et ne contient donc pas " + value + " !");
}
if (node == null) {
throw new RuntimeException("Le noeud à rechercher ne peut pas être nul !");
} else if (value < node.getValue()) { // Si la valeur est inférieure à la valeur du noeud courant, on recherche dans le fils droit
if (node.getRightSon() != null) {
ret = findNodeABRI((SimpleNode) node.getRightSon(), value);
}
} else if (value > node.getValue()) { // Si la valeur est supérieure à la valeur du noeud courant, on recherche dans le fils gauche
if (node.getLeftSon() != null) {
ret = findNodeABRI((SimpleNode) node.getLeftSon(), value);
}
} else if (value == node.getValue()) {
ret = node;
}
return ret;
} |
cdee8a46-8a62-400b-9c6a-e3314fec78a9 | 2 | public static Usuarios sqlLeer(Usuarios usu){
String sql="SELECT * FROM usuarios WHERE idusuarios = '"+usu.getIdUsuario()+"' ";
if(!BD.getInstance().sqlSelect(sql)){
return null;
}
if(!BD.getInstance().sqlFetch()){
return null;
}
usu.setIdUsuario(BD.getInstance().getInt("idusuarios"));
usu.setUsuario(BD.getInstance().getString("usuario"));
//usu.setContraseña(BD.getInstance().getString("contrasena"));
usu.setIdCli(BD.getInstance().getInt("clientes_id"));
return usu;
} |
9d5802fb-9f02-492e-b616-157789d1fa09 | 9 | public void uimsg(String msg, Object... args) {
if (msg == "tabfocus") {
setfocustab(((Integer) args[0] != 0));
} else if (msg == "act") {
canactivate = (Integer) args[0] != 0;
} else if (msg == "cancel") {
cancancel = (Integer) args[0] != 0;
} else if (msg == "autofocus") {
autofocus = (Integer) args[0] != 0;
} else if (msg == "focus") {
Widget w = ui.widgets.get((Integer) args[0]);
if (w != null) {
if (w.canfocus)
setfocus(w);
}
} else if (msg == "curs") {
if (args.length == 0)
cursor = null;
else
cursor = Resource.load((String) args[0], (Integer) args[1]);
} else {
System.err.println("Unhandled widget message: " + msg);
}
} |
92abc1c1-4d50-4695-b8bd-e107423c88fb | 6 | @Override
public Object getValue() {
// find and assemble date appropriately depending on property at this node and type of parent
// TODO: behavior should be configurable via registry (see comment at top of file)
// VirtualDateNode may only be used for datatype VariablePrecisionTime
VariablePrecisionTime result=null;
Property parent=this.getParent().getNodeProperty();
if(parent.isTypeOf(MediaProperty.ID3V2TAG)) {
if(this.getNodeProperty().isTypeOf(MediaProperty.RELEASE_DATE)) {
result = getId3v2ReleaseDate();
} else if(this.getNodeProperty().isTypeOf(MediaProperty.RECORDING_DATE)) {
result = getId3v2RecordingDate();
}
} else if(parent.isTypeOf(MediaProperty.VORBISCOMMENTBLOCK)) {
if(this.getNodeProperty().isTypeOf(MediaProperty.RELEASE_DATE)) {
result = getVorbisReleaseDate();
} else if(this.getNodeProperty().isTypeOf(MediaProperty.RECORDING_DATE)) {
result = getVorbisRecordingDate();
}
}
// TODO: handle ORIGINAL DATE, other types of dates, user configurable, default/unknown?
return result;
} |
2477ade6-9d1a-402d-8a7b-42b35d92b845 | 6 | public AxisAlignedBB getAxisAlignedBB(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
if (par5 != 0 && par5 != this.blockID)
{
AxisAlignedBB var8 = Block.blocksList[par5].getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
if (var8 == null)
{
return null;
}
else
{
if (Facing.offsetsXForSide[par7] < 0)
{
var8.minX -= (double)((float)Facing.offsetsXForSide[par7] * par6);
}
else
{
var8.maxX -= (double)((float)Facing.offsetsXForSide[par7] * par6);
}
if (Facing.offsetsYForSide[par7] < 0)
{
var8.minY -= (double)((float)Facing.offsetsYForSide[par7] * par6);
}
else
{
var8.maxY -= (double)((float)Facing.offsetsYForSide[par7] * par6);
}
if (Facing.offsetsZForSide[par7] < 0)
{
var8.minZ -= (double)((float)Facing.offsetsZForSide[par7] * par6);
}
else
{
var8.maxZ -= (double)((float)Facing.offsetsZForSide[par7] * par6);
}
return var8;
}
}
else
{
return null;
}
} |
46caa741-715f-44e9-9eb7-da594a40fcf1 | 9 | private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
int answer;
int selectedRow;
switch (jTabbedPane1.getSelectedIndex()) {
case 0:
selectedRow = bookTable.getSelectedRow();
if (selectedRow == -1) {
JOptionPane.showMessageDialog(this,
"Some book must be selected!",
"Attention!", JOptionPane.WARNING_MESSAGE);
} else {
answer = JOptionPane.showConfirmDialog(this, "Do you want really delete the book",
"Delete", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (answer == 0) {
Book book = bookManager.findAllBooks().get(selectedRow);
bookManager.deleteBook(book);
}
}
break;
case 1:
selectedRow = readerTable.getSelectedRow();
if (selectedRow == -1) {
JOptionPane.showMessageDialog(this,
"Some reader must be selected!",
"Attention!", JOptionPane.WARNING_MESSAGE);
} else {
answer = JOptionPane.showConfirmDialog(this, "Do you want really delete the reader",
"Delete", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (answer == 0) {
Reader reader = readerManager.findAllReaders().get(selectedRow);
readerManager.deleteReader(reader);
}
}
break;
case 2:
selectedRow = readerTable.getSelectedRow();
if (selectedRow == -1) {
JOptionPane.showMessageDialog(this,
"Some borrowing must be selected!",
"Attention!", JOptionPane.WARNING_MESSAGE);
} else {
answer = JOptionPane.showConfirmDialog(this, "Do you want really delete the borrowing",
"Delete", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (answer == 0) {
Borrowing borrowing = borrowingManager.findAllBorrowing().get(selectedRow);
borrowingManager.deleteBorrowing(borrowing);
}
}
break;
default:
throw new IllegalArgumentException("TabbedPane wrong index.");
}
}//GEN-LAST:event_deleteButtonActionPerformed |
171afb10-23ac-43bd-a4e8-1f3ba6ae7f51 | 5 | @Override
public void learn(){
int examples = 0;
int max_neuron = Options.getOptions().getMaxNeurons();
while (( neurons.get(0).size() < max_neuron) && (examples < epochs) && !Options.getOptions().getStopped()) {
//We check the pause
checkPause();
//We print the current state
printState(new Object[]{examples, epochs, neurons.size(), max_neuron});
//We choose a new piece of data for the example
int index_data = (int) (Math.random()*Data.getData().size());
examples ++;
//We search for the two neurons which are the nearest of the piece of data
Neuron[] nearest = getNearest(index_data);
Neuron winner1 = nearest[0];
Neuron winner2 = nearest[1];
double distance_to_the_data = winner1.distance(Data.getData().get(index_data));
//We increase the error of the winner
int index_1 = neurons.get(0).indexOf(winner1);
erreurs.set(index_1, erreurs.get(index_1) + distance_to_the_data);
//We update the state of links
updateConnection(winner1, winner2);
//We approach the winner to the piece of data
winner1.setPoids(Options.getOptions().getWinnerDistGng(), Data.getData().get(index_data));
//We also approach its direct neighbors
for (Neuron neighbor : winner1.getNeighbors()) {
neighbor.setPoids(Options.getOptions().getNeighborhoodGng(), Data.getData().get(index_data));
}
//We delete wrong connections and neurons
deleteWrong();
//If it's time to, we add a new neuron
if ((examples % Options.getOptions().getTimeNew()) == 0)
addNewNeuron();
//We manage the speed
sleep();
world.change();
}
world.change();
} |
f998e909-61a9-43b8-9f24-8ea6c719c3ab | 5 | @Override
public boolean equals( Object obj ){
if( obj == this ){
return true;
}
if( obj == null || obj.getClass() != getClass() ){
return false;
}
CapabilityName<?> that = (CapabilityName<?>)obj;
return id.equals( that.id );
} |
25e8e919-8f25-4679-b647-7f20925315bd | 0 | public void setQuestion(Question question)
{
this.question = question;
notifyListeners();
} |
c35edd0f-f476-4942-8996-e9f503150fbf | 6 | @Override
public StringBuffer getOOXML( String catAxisId, String valAxisId, String serAxisId )
{
StringBuffer cooxml = new StringBuffer();
// chart type: contains chart options and series data
cooxml.append( "<c:bar3DChart>" );
cooxml.append( "\r\n" );
cooxml.append( "<c:barDir val=\"col\"/>" );
cooxml.append( "<c:grouping val=\"" );
if( is100PercentStacked() )
{
cooxml.append( "percentStacked" );
}
else if( isStacked() )
{
cooxml.append( "stacked" );
}
else if( cf.is3DClustered() )
{
cooxml.append( "clustered" );
}
else
{
cooxml.append( "standard" );
}
cooxml.append( "\"/>" );
cooxml.append( "\r\n" );
// vary colors???
// *** Series Data: ser, cat, val for most chart types
cooxml.append( getParentChart().getChartSeries().getOOXML( getChartType(), false, 0 ) );
// chart data labels, if any
//TODO: FINISH
//cooxml.append(getDataLabelsOOXML(cf));
if( !getChartOption( "Gap" ).equals( "150" ) )
{
cooxml.append( "<c:gapWidth val=\"" + getChartOption( "Gap" ) + "\"/>" ); // default= 0
}
int gapdepth = getGapDepth();
if( gapdepth != 0 )
{
cooxml.append( "<c:gapDepth val=\"" + gapdepth + "\"/>" );
}
cooxml.append( "<c:shape val=\"" + getShape() + "\"/>" );
// axis ids - unsigned int strings
cooxml.append( "<c:axId val=\"" + catAxisId + "\"/>" );
cooxml.append( "\r\n" );
cooxml.append( "<c:axId val=\"" + valAxisId + "\"/>" );
cooxml.append( "\r\n" );
if( getParentChart().getAxes().hasAxis( ZAXIS ) )
{
cooxml.append( "<c:axId val=\"" + serAxisId + "\"/>" );
cooxml.append( "\r\n" );
}
else
{// KSC: // KSC: appears to be necessary but very unclear as to why
cooxml.append( "<c:axId val=\"0\"/>" );
cooxml.append( "\r\n" );
}
cooxml.append( "</c:bar3DChart>" );
cooxml.append( "\r\n" );
return cooxml;
} |
a4ad09b6-2db9-45cc-9fa1-f4f9ff55f255 | 2 | @Override
public int hashCode(){
int res = 1;
int prime = 37;
for (RailwayVehicle it : this)
res = prime*res + (it==null ? 0 : it.hashCode());
return res;
} |
d928a065-5f3d-48c7-9788-e22f5eb3bf50 | 3 | public void endPatchRunStatement(ScriptExecutable pScriptExecutable, boolean pWasSuccess) {
try {
if(pScriptExecutable instanceof ScriptSQL){
ScriptSQL lScriptSQL = (ScriptSQL) pScriptExecutable;
Connection lConnection = mDatabaseConnection.getLoggingConnection();
CallableStatement lStatement = lConnection.prepareCall(SQLManager.getSQLByName(SQLManager.SQL_FILE_UPDATE_PATCH_RUN_STATEMENT));
lStatement.setString("status", pWasSuccess ? "COMPLETE" : "FAILED");
lStatement.setInt ("patch_run_id", mPatchRunId);
lStatement.setString("hash", lScriptSQL.getHash());
lStatement.executeUpdate();
lStatement.close();
lConnection.commit();
}
}
catch (SQLException e) {
throw new ExFatalError("Failed to end patch run statement", e);
}
} |
44811aae-0616-4455-bcdc-15084965353c | 2 | private void error(String error) {
synchronized (ui) {
if (this.error != null)
this.error = null;
if (error != null)
this.error = textf.render(error, java.awt.Color.RED);
}
} |
afb1d0de-a746-4ef7-b5d0-e1e30c106284 | 8 | public List<Class<?>> getClassesFromJar(File file, ClassLoader classLoader)
{
final List<Class<?>> classes = new ArrayList<Class<?>>();
try
{
final JarFile jarFile = new JarFile(file);
Enumeration<JarEntry> enumeration = jarFile.entries();
while (enumeration.hasMoreElements())
{
final JarEntry jarEntry = enumeration.nextElement();
if (jarEntry.isDirectory() ||
!jarEntry.getName().toLowerCase().trim().endsWith(".class"))
{
continue;
}
classes.add(classLoader.loadClass(jarEntry.getName().replace(".class", "").replace("/", ".")));
}
jarFile.close();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
return classes;
} |
8c9b6729-8758-4eda-b936-37297b882d3d | 5 | public Object [][] getDatos(){
Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String campos = colum_names[0];
for (int i = 1; i < colum_names.length; i++) {
campos+=",";
campos+=colum_names[i];
}
String consulta = ("SELECT cli_codigo,cli_nombre,cli_apellido,cli_fecha_nac,cli_cuit,loc_descripcion,cli_direccion,cli_calle,sfi_descripcion "+
"FROM clientes,localidades,situacion_frente_iva " +
"WHERE cli_localidad=loc_id and cli_sit_frente_iva=sfi_id "); //+
//" WITH (INDEX("+indices_tabla[numero_ordenamiento_elegido]+"))");
PreparedStatement pstm = r_con.getConn().prepareStatement(consulta);
ResultSet res = pstm.executeQuery();
int i = 0;
while(res.next()){
for (int j = 0; j < colum_names.length; j++) {
data[i][j] = res.getString(j+1);
}
i++;
}
res.close();
}
} catch(SQLException e){
System.out.println(e);
} finally {
r_con.cierraConexion();
}
return data;
} |
8a12b1d6-38ea-4cb1-b65c-02ce267fc627 | 5 | public String readFile(java.io.File file)
{
if(file.exists() && file.canRead())
{
JConsole c = new JConsole();
String data = "";
try
{
java.io.FileReader fs = new java.io.FileReader(file);
while(fs.ready())
{
data += (char)fs.read();
}
fs.close();
return data;
}
catch(java.io.FileNotFoundException ex)
{
c.writeLine(ex);
c.dispose();
return "";
}
catch(java.io.IOException ex)
{
c.writeLine(ex);
c.dispose();
return data;
}
}
return "";
} |
b511df6d-dcd6-4eeb-84d5-15594bb42001 | 0 | @AfterClass
public static void tearDownClass() {
} |
fe25a1cb-2c60-4dad-8cd1-cbb1f26be680 | 7 | public void visitIincInsn(final int var, final int increment) {
if (currentBlock != null) {
if (compute == FRAMES) {
currentBlock.frame.execute(Opcodes.IINC, var, null, null);
}
}
if (compute != NOTHING) {
// updates max locals
int n = var + 1;
if (n > maxLocals) {
maxLocals = n;
}
}
// adds the instruction to the bytecode of the method
if ((var > 255) || (increment > 127) || (increment < -128)) {
code.putByte(196 /* WIDE */).put12(Opcodes.IINC, var)
.putShort(increment);
} else {
code.putByte(Opcodes.IINC).put11(var, increment);
}
} |
517dc614-fb53-4b4c-a8b2-c32f094d1639 | 5 | private void doPaintBucketNoDia(int x, int y, int newCol, int currentCol)
{
// make sure it's on the image
if (x > -1 && y > -1 && x < this.getDrawingWidth()
&& y < this.getDrawingHeight() && this.getPoint(x, y) == currentCol)
{
this.drawPoint(x, y, newCol);
doPaintBucketNoDia(x - 1, y, newCol, currentCol);
doPaintBucketNoDia(x + 1, y, newCol, currentCol);
doPaintBucketNoDia(x, y - 1, newCol, currentCol);
doPaintBucketNoDia(x, y + 1, newCol, currentCol);
}
} |
e82f7437-49af-4077-8dc4-8dd12365552f | 7 | public static int getMaxNumber(String what) {
int result = 0;
Connection con = DBUtil.getConnection();
Statement st = null;
ResultSet rs = null;
try {
st = con.createStatement();
rs = st.executeQuery("select * from mstx_max");
rs.next();
result = rs.getInt(what);
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
if (st != null) {
st.close();
st = null;
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if (rs != null) {
rs.close();
rs = null;
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if (con != null) {
con.close();
con = null;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return result;
} |
b0fd3f7e-3014-47fb-8b29-2bbd86140505 | 5 | public GameResult play() {
while (true)
{
Player player = gameManager.getNextPlayer();
Move move = player.getMove(board);
try
{
gameManager.applyMove(move, player, turnNumber);
turnNumber += 1;
}
catch (UnknownPlayerException e)
{
System.out.println("Unknown player attempted to make a move.");
}
catch (InvalidMoveException e)
{
System.out.println(player.getName() + " attempted an invalid move.");
}
if (board.connectFour())
{
GameResult gameResult = new GameResult(player, gameManager.getMoveList(), board.getBoard());
return gameResult;
}
if (board.isFull())
{
return new GameResult(null, gameManager.getMoveList(), board.getBoard());
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.