text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void down() {
if ((currentRow + rowOffset) < grid.getNumRows() - 1) {
if (grid.getLineLength(currentRow + rowOffset + 1) <= currentCol
+ colOffset) {
if (colOffset > grid.getLineLength(currentRow + rowOffset + 1)) {
colOffset = grid.ge... | 5 |
public static void Checkout(Patient currentP,PatientProfilePage profileP){
ArrayList<Integer> prescriptions= new ArrayList<Integer>();
ArrayList<Integer> unpaid= new ArrayList<Integer>();
int Pid= currentP.getPid();
Prescription bean= new Prescription();
bean.setPid(Pid);
prescriptions= DatabaseProcess.g... | 3 |
public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException {
select = visitor.optimize(select, contextItemType);
adoptChildExpression(select);
regex = visitor.optimize(regex, contextItemType);
adoptChildExpression(regex);
flags = visitor... | 9 |
private void findStraight() {
boolean inStraight = false;
int rank = -1;
int count = 0;
for (int i = Card.NO_OF_RANKS - 1; i >= 0 ; i--) {
if (rankDist[i] == 0) {
inStraight = false;
count = 0;
} else {
if (!inStraig... | 7 |
private void checkReceived() {
OnDemandRequest onDemandRequest;
synchronized (aClass19_1370) {
onDemandRequest = (OnDemandRequest) aClass19_1370.popFront();
}
while (onDemandRequest != null) {
waiting = true;
byte buf[] = null;
if (clientIn... | 4 |
public static Employee getEmployeeFromDatabaseById(Integer paramId){
String id = null;
String name = null;
String surname = null;
String dateOfBirth = null;
String salary = null;
String salarytype = null;
Employee employee = null;
try {
resul... | 4 |
public static void main(String[] args) throws Exception {
String tmpStr;
String filename;
DataSource source;
Instances data;
int classIndex;
Capabilities cap;
Iterator iter;
if (args.length == 0) {
System.out.println(
"\nUsage: " + Capabilities.class.getName()
+ ... | 9 |
public void reloadItems(Client c) {
for(GroundItem i : items) {
if(c != null){
if (c.getItems().tradeable(i.getItemId()) || i.getName().equalsIgnoreCase(c.playerName)) {
if (c.distanceToPoint(i.getItemX(), i.getItemY()) <= 60) {
if(i.hideTicks > 0 && i.getName().equalsIgnoreCase(c.playerName)) {
... | 8 |
public Month getMonthStored()
{
return monthStored;
} | 0 |
public void registriereFeature(Feature feature)
{
if(feature instanceof TickListener)
_tickListeners.add((TickListener) feature);
if(feature instanceof BefehlAusgefuehrtListener)
_befehlAusgefuehrtListeners
.add((BefehlAusgefuehrtListener) feature);
if(feature instanceof RaumGeaendertListener)
_kon... | 4 |
public static RedisBigTableKey inflate(byte[] inflate)
{
boolean rowFinished = false;
boolean cfFinished = false;
List<Byte> rowBytes = new ArrayList<Byte>();
List<Byte> cfBytes = new ArrayList<Byte>();
List<Byte> cqBytes = new ArrayList<Byte>();
for (byte b : inflate)
{
if (!rowFinished && b == Utils... | 7 |
public int getTailleX() {
return tailleX;
} | 0 |
@Override
public boolean reachesDestination(Packet p) {
// TODO Auto-generated method stub
Iterator<Edge> edgeIt = p.origin.outgoingConnections.iterator();
GenericWeightedEdge e;
while(edgeIt.hasNext()){
e = (GenericWeightedEdge) edgeIt.next();
if(e.endNode.equals(p.destination)){
etxLink = e.getEtx(... | 3 |
public ModifierMatcher forceAccess(int accessModif, boolean andAbove) {
if (andAbove) {
if (accessModif == Modifier.PRIVATE)
return this;
if (accessModif == 0)
return this.and(Modifier.PRIVATE, 0);
ModifierMatcher result = this.and(Modifier.PUBLIC, PUBLIC);
if (accessModif == Modifier.PROTECTED)
... | 6 |
protected void calcRepulsion()
{
int vertexCount = vertexArray.length;
for (int i = 0; i < vertexCount; i++)
{
for (int j = i; j < vertexCount; j++)
{
// Exits if the layout is no longer allowed to run
if (!allowedToRun)
{
return;
}
if (j != i)
{
double xDelta = cellLoca... | 9 |
static void afficheFiltre()
{
//On crée un nouveau filtre
Filter filtre = new Filter()
{
//On défini les propriétés du filtre à l'aide
//de la méthode matches
public boolean matches(Object ob)
{
//1 ère vérification : on vérifie que les objets
//qui seront fi... | 8 |
public Dimension getMaxDimension() {
int width = 0;
int height = 0;
for(int i=0; i<images.length; i++) {
ImageIcon tempIcon = new ImageIcon(images[i]);
if(tempIcon.getIconWidth() > width) {width = tempIcon.getIconWidth();}
if(tempIcon.getIconHeight() > height) {height = tempIcon.getIconHeight()... | 3 |
private String getBase64File() {
try {
// return "/9j/4AAQSkZJRgABAQEASABIAAD//gBDRmlsZSBzb3VyY2U6IGh0dHA6Ly9jb21tb25zLndpa2ltZWRpYS5vcmcvd2lraS9GaWxlOlJvb25leV9DTC5qcGf/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKC... | 1 |
public boolean isOver(){
if (length < Time.getTime() - start){
start = -1;
return true;
}
return false;
} | 1 |
public boolean actualizar(String tabla, String campos, String[] valores, String clausula) {
String[] camp = campos.split(",");
int max = camp.length;
String c;
String query = "UPDATE " + tabla + " SET ", aux = "";
if (clausula == null) {
c = "1";
} else {
... | 4 |
public boolean canShot(MyObject obj, XY xy, int maxDistance) {
MyObject aim = MODEL.getBoard().get(xy);
if (aim == null) {
MODEL.showError("Нельзя стрелять по пустой клетке!");
return false;
}
if (aim instanceof Tower) {
MODEL.showError("Нельзя стрелят... | 8 |
public static void main(String[] args) {
// Selection Sort
int[] nums = { 8, 2, 5, 6, 1, 9, 10 };
System.out.println("Initial array: " + Arrays.toString(nums));
for (int i = 0; i < nums.length - 1; i++) {
for (int j = i + 1; j < nums.length; j++) {
if (nums[i] > nums[j]) {
int iVal = nums[i... | 3 |
public static boolean isValid(String cardNumber) {
cardNumber = cardNumber.replace(" ", "");
cardNumber = cardNumber.replace("-","");
String reversedNumber = new StringBuilder(cardNumber).reverse().toString();
char [] reversedDigitArray = reversedNumber.toCharArray();
/*
temporarily holds a single di... | 9 |
private void fieldUpdate(){
if (running && field != null)
{
}
} | 2 |
public XSLVariableDeclaration bindVariable(StructuredQName qName) {
NodeInfo curr = this;
NodeInfo prev = this;
// first search for a local variable declaration
if (!isTopLevel()) {
AxisIterator preceding = curr.iterateAxis(Axis.PRECEDING_SIBLING);
while (true) {... | 9 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((color == null) ? 0 : color.hashCode());
result = prime * result
+ ((dateOfIssue == null) ? 0 : dateOfIssue.hashCode());
result = prime * result + ((model == null) ? 0 : model.hashCode());
result = prime ... | 5 |
public void setProfile( Profile p ) {
for ( Map.Entry<Achievement, JCheckBox> entry : generalAchBoxes.entrySet() ) {
String achId = entry.getKey().getId();
JCheckBox box = entry.getValue();
box.setSelected(false);
for ( AchievementRecord rec : p.getAchievements() )
if ( rec.getAchievementId().equal... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ImovelDoCorretor other = (ImovelDoCorretor) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
... | 6 |
public Object nextEntity(char ampersand) throws JSONException {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (Character.isLetterOrDigit(c) || c == '#') {
sb.append(Character.toLowerCase(c));
} else if (c == ';') {
... | 5 |
public static int Str2Int(String str)
{
if (str == null || "".equals(str))
return 0;
return Integer.parseInt(str);
} | 2 |
public double getLuck() {
return luck;
} | 0 |
public Object invokeConstructor()
{
Class[] types = c.getParameterTypes();
Object[] values = new Object[types.length];
for (int i = 0; i < types.length; i++)
{
values[i] = makeDefaultValue(types[i]);
}
if (types.length > 0... | 4 |
public int compare(Entity e0, Entity e1) {
if (e1.y < e0.y) return +1;
if (e1.y > e0.y) return -1;
return 0;
} | 2 |
@Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
try {
generateQuotes();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
} | 2 |
public String toString() {
String tempString = "";
for (Vertex v : adjMap.keySet()) {
for (Vertex w : this.getAdjacentVertices(v)) {
tempString += v + "-" + w + "\n";
}
}
return tempString;
} | 2 |
public void send(int clientId, Message msg) {
System.out.println("Sending message to client " + clientId + ": \"" + msg.encode() + "\"");
try {
server.send(clientId, msg.encode());
} catch (CouldNotSendPacketException e) {
System.out.println("Could not send message to client " + clientId + ": " + e.getMessa... | 1 |
private String next(String string) {
//Primeiro cria o vetor de maximos e o de presencas, que eh igual no inicio
int max[] = new int[26];
int presencas[] = new int[26];
int maxIdx = -1;
for ( int i = 0; i < string.length(); i++ ) {
char chr = string.charAt(i);
int idx = ord(chr);
max[idx]++;
prese... | 9 |
private void showResultVisualization() {
int[] serviceCandidatesPerClass =
new int[serviceClassesList.size()];
for (int i = 0; i < serviceClassesList.size(); i++) {
serviceCandidatesPerClass[i] =
serviceClassesList.get(i).
getServiceCandidateList().size();
}
if (algorithmVisualization != null) {... | 8 |
public Schema.Player match(Schema.Player source) {
for ( Map.Entry<String, String> id : source.id.entrySet()) {
Schema.Player p = find(id.getKey(), id.getValue());
if (null != p) {
return p;
}
}
return PLAYER_NOT_FOUND;
} | 2 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
public String reverseWordsII(String s) {
if (s == null || s.length() == 0)
return "";
s = s.trim();
int l = 0, r = 0;
StringBuilder sb = new StringBuilder();
while (r <= s.length()) {
if (r == s.length()) {
sb.insert(0, ' ');
... | 7 |
public void validate(){
if (getUserName()==null||getUserName().length()==0) {
addFieldError("userName", "用户名不能为空");
}else {
LoginRegisterInfo info=new LoginRegisterInfo();
list=info.queryInfo("userName", getUserName());
UserInfoPO ui=new UserInfoPO();
for (int i = 0; i < list.size(); i++) {
ui... | 9 |
@Override
public void draw(List<Row> rows, ViewEventArgs args, int from){
if (from >= rows.size()){
from = 0;
}
this.setRows(rows);
//System.out.println("Scrollable: from: " + from + " rows: " + this.getRows().size());
this.document.draw(rows, args, from);
//System.out.println("AFTER: at decorator:... | 1 |
@Override
public String getColumnName(int column){
switch (column){
case 0:
return COLUMN1;
case 1:
return COLUMN2;
case 2:
return COLUMN3;
case 3:
return COLUMN4;
case 4:
return COLUMN5;
case 5:
return COLUMN6;
case 6:
return COLUMN7;
case 7:
return COLUMN8;
case 8:
retu... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ClienteTelefone other = (ClienteTelefone) obj;
if (descricao == null) {
if (other.descricao != null)
return false;
} else if (!descricao... | 9 |
public static void test_3a(){
try{
System.out.println("\n\nTestCase-3A\n\n");
TestNetwork n=new TestNetwork(4,4,2);
Paxos p=new Paxos(n);
p.runPaxos();
n.change_DPmode(-1,1);
for(int i=0;i<10;i++) //Block the channel of all processes
n.block_channel(i, 1);
Thread.sleep(500);
... | 5 |
private void jButtonQuitterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonQuitterActionPerformed
//Récupération de la méthode contrôleur 'quitter'
this.ctrl.quitter();
}//GEN-LAST:event_jButtonQuitterActionPerformed | 0 |
void readProteinFile() {
proteinByTrId = new HashMap<String, String>();
if (proteinFile.endsWith("txt") || proteinFile.endsWith("txt.gz")) readProteinFileTxt();
else if (proteinFile.endsWith(SnpEffPredictorFactoryGenBank.EXTENSION_GENBANK)) readProteinFileGenBank();
else readProteinFileFasta();
} | 3 |
@Override
public boolean contains(Object element)
{
Node currentNode = firstNode;
boolean elementIsInSet = false;
while (currentNode != null)
{
if (element.equals(currentNode.element))
{
elementIsInSet = true;
break;
} else
{
currentNode = currentNode.nextNode;
}
}
return eleme... | 2 |
public String operandsToString(){
String str = new String();
for(double operand: operandStack){
str = str + (operand + " ");
}
return str;
} | 1 |
private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
// TODO add your handling code here:
String str="";
Juego j = new Juego();
List Plata = new ArrayList();
str = this.jTextField23.getText();
if(Biblio.contain... | 3 |
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender.hasPermission("NEC.fbroadcast") || sender.isOp() || sender instanceof BlockCommandSender || sender instanceof ConsoleCommandSender) {
if(command.getName().equalsIgnoreCase("FBroadcast")) {
if(arg... | 7 |
private static int partition(long arr[], byte[] values, int sizeOf, int left, int right)
{
int i = left, j = right;
long tmp;
long pivot = arr[left + random.nextInt(right - left + 1)];
byte[] valueTemplate = new byte[sizeOf];
while (i <= j) {
while (arr[i] < pivo... | 4 |
public PostParameter[] getParameters() throws WeiboException{
List<PostParameter> list= new ArrayList<PostParameter>();
Class<Query> clz=Query.class;
Field[] fields=clz.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
String fieldName=field.getName();
String firstLetter = fi... | 3 |
public String getName()
{
String returnString = type.toString();
returnString = returnString.replace('_',' ');
if ((effect1 == Effect.TM || effect1 == Effect.HM) && type != Type.REDBULL)
{
returnString = returnString + " " + mNo;
}
returnString = returnString + " x" + amount;
return returnString;
} | 3 |
public int removeBuddy(String username, String buddyname){
try {
String host = "localhost";
socket = new Socket(host, 2001);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintWriter(socket.getOutputStream(), true)... | 4 |
public byte[] getInfoHash() {
return this.infoHash.array();
} | 0 |
void executeSystemCmd(String cmd) {
try {
Process p = Runtime.getRuntime().exec(SystemUtils.IS_OS_WINDOWS ? "cmd /C " + cmd : cmd);
// OutputStream out = p.getOutputStream();
// out.write(cmd.getBytes());
// out.flush();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputSt... | 7 |
public FenetreTaillePixel(){
// saisiePixel=new JTextField("",20);
System.out.println("nouvelleee size: "+ConnexionTaillePixel.getArrayy().size());
System.out.println("nouvelleee size2: "+nomShape1.size());
// this.connexion=connexion;
if(FenetreTaillePixel.nomShape1.size()==0){
FenetreTaillePixel.nom... | 8 |
public Placeable loadInitialTownHall(int x) {
int mapY = 0;
Placeable placeable = null;
mapY = findFloor(x);
placeable = new Cabin(this, registry, "Placeables/Placed/Cabin", "Placeables/Placed/Cabin", x, mapY, Placeable.State.Placed);
registerPlaceable(placeable);
if (g... | 3 |
public Block getBlock(int x, int z) {
// starting at the top of the map and going down
for(int y = maxHeight - 1; y > 0; y--) {
// if the block reached is visible
if(isBlockSolid(blocks[x][y][z])) {
// h models the first block after all water is traversed
int h = y;
if(blocks[x][y][z] == 8 || blo... | 8 |
public static void main(String[] args) {
System.out.println(Arrays.toString(new int[] {1, 2, 3}));
System.out.println(fill(new ArrayList<String>()));
System.out.println(fill(new LinkedList<String>())); // Queue
System.out.println(fill(new HashSet<String>()));
System.out.println(fill(new TreeSet<String>(... | 0 |
public static void main(String[] args) {
// run 10 simulations of chicken growth and fox hunting
for (int count = 0; count < 10; count++) {
ParkerPaulFox foxy = new ParkerPaulFox(); // fox that hunts chickens
ArrayList<ParkerPaulChicken> chickens = new ArrayList<ParkerPaulChick... | 5 |
@Override
public double evaluate(int[][] board) {
int r1 = 0;
for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board[i].length-1; j++) {
if(board[i][j] < board[i][j+1]) {
r1++;
}
}
}
return r1;
... | 3 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public void register(final MessageListener listener) {
listeners.add(listener);
} | 0 |
public void validaComponentePreencheSetor() {
String item = jLabelPeca.getText().trim();
int indice = item.indexOf("-", 4);
item = item.substring(0, indice - 1);
TelaConsultaComponentes tela = new TelaConsultaComponentes(null, true, item.trim(), jFTComponente, jLabelDescricaoComponente... | 9 |
@Override
public Collidable pointCollides(int x, int y)
{
// Negates the transformation
Point negatedPoint = negateTransformations(x, y);
// Returns the object if it collides with the point
// Circular objects react if the point is near enough
if (this.collisiontype == CollisionType.CIRCLE)
{
if (He... | 5 |
public void transfer(Account from, Account to, int amount) {
boolean fromLock = false;
boolean toLock = false;
try {
while (!fromLock || !toLock) {
fromLock = from.getLock().tryLock(
(long) (Math.random() * 1000), TimeUnit.MILLISECONDS);
... | 3 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (request.getHeader("Referer") == null)
response.sendRedirect("error.jsp?m=404");
else {
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
HttpSession... | 7 |
public double calculateClusterDistance(Cluster cluster1, Cluster cluster2) {
Instance instance1, instance2;
double distance = 0, tempDist = 0;
for (int i = 0; i < cluster1.size(); i++) {
instance1 = cluster1.get(i);
for (int j = 0; j < cluster2.size(); j++) {
instance2 = cluster2.ge... | 3 |
public void adjustBeginLineColumn(int newLine, int newCol) {
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin) {
len = bufpos - tokenBegin + inBuf + 1;
} else {
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
}
int i = 0, j = 0, k = 0;
int nextColDiff = 0, columnDiff = 0;
while (i < l... | 6 |
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
if (!(e.getAction() == Action.RIGHT_CLICK_BLOCK)) return;
if (e.getClickedBlock().getState() instanceof Sign) {
Sign s = (Sign) e.getClickedBlock().getState();
Player p = e.getPlayer();
if (s.getL... | 9 |
public void addQueueIfTooMuchClients(){
Queue addedQueue = null;
int listSize = queueList.size();
boolean permissionToOpenQueue = false;
boolean clientMigration = true;
if(simulationTime == 60) {
queueList.add(queueNr2);
for(int i = 0; i < queueNr... | 5 |
@Override
public void messageReceived() {
Message received = Comms.receiveMessage();
if (received != null) {
try {
Request request = (Request) received;
Alerter.getHandler().info(
"Received " + request.getClass().getSimpleName() + " from "
+ request.getSource().getHostAddress());
// ... | 2 |
@Override
public Component getListCellRendererComponent(JList<? extends MessageLevel> jlist, MessageLevel e, int i, boolean isSelected, boolean hasFocus) {
//JLabel label = new JLabel(e.getMessage());
JLabel label = (JLabel) cellRenderer.getListCellRendererComponent(jlist, e.getMessage(), i, hasFocu... | 5 |
public void keyPressed(KeyEvent e) {
int keyCode = e.getKeyCode();
if (keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_W) {
up.toggle(true);
} else if (keyCode == KeyEvent.VK_DOWN || keyCode == KeyEvent.VK_S) {
down.toggle(true);
} else if (keyCode == KeyEvent.VK_LEFT || keyCode == KeyEvent.VK_A) {
... | 9 |
private static String convertToneNumber2ToneMark(final String pinyinStr)
{
String lowerCasePinyinStr = pinyinStr.toLowerCase();
if (lowerCasePinyinStr.matches("[a-z]*[1-5]?"))
{
final char defautlCharValue = '$';
final int defautlIndexValue = -1;
char un... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Vector3 other = (Vector3) obj;
if (Float.floatToIntBits(x) != Float.floatToIntBits(other.x))
return false;
if (Float.floatToIntBits(y) != Fl... | 6 |
private int getCommentsNum(File file) {
if (!file.exists()) {
return 0;
}
try {
int comments = 0;
String currentLine;
BufferedReader reader = new BufferedReader(new FileReader(file));
while ((currentLine = reader.readLine()) != null) {
if (currentLine.startsWith("#")) {
comments++;
... | 4 |
private void processSecurityResultMsg() {
vlog.debug("processing security result message");
int result;
if (cp.beforeVersion(3, 8) && csecurity.getType() == Security.secTypeNone) {
result = Security.secResultOK;
} else {
if (!is.checkNoWait(1)) return;
result = is.readU32();
}
... | 7 |
public static Date min(Date... dates) {
if(dates != null && dates.length > 0) {
Date minDate = dates[0];
for (Date date : dates) {
if(date.before(minDate)) {
minDate = date;
}
}
return minDate;
}
return null;
} | 4 |
@Override
public int checkScore(){
if(score1 == 2){
return 1;
}
else if(score2 == 2) {
return 2;
}
else {
return 0;
}
} | 2 |
@Override
public Query<TElement> toQuery() {
return new Query<TElement>(this._source);
} | 0 |
private void setListener() {
cfBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
LookAndFeel look = UIManager.getLookAndFeel();
try {
UIManager.setLookAndFeel(UIManager
.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | Instantiat... | 6 |
public void check(){
String[] inputWords = parser.parse(this.textPane.getText());
if (inputWords == null){
JOptionPane.showMessageDialog(new JFrame(), this.errorConsole.getText(), "Error", JOptionPane.ERROR_MESSAGE);
return;
}
SpellCheckResult[] scResults = new S... | 6 |
public String lire(){
String t="";
try{
t = bf.readLine();
}catch(IOException io){
System.out.println("echec de lecture");
io.printStackTrace();
}
if(debug) { if(!t.equals("")) {System.out.println("Lecture TCP: " + t);} }
return t;
} | 3 |
public String menuOptions()
{
System.out.println();
System.out.println("Menu: ");
System.out.println("\tFind a course in the Program of Study (find)");
System.out.println("\tAdd a course to the Program of Study (add)");
System.out.println("\tRemove a course from the Program of Study (remove)");
System.out.... | 9 |
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// Draw Background
g2d.drawImage(BG, 0, 0, null);
tm.Draw(g2d);
... | 5 |
public void update() {
xa = 0;
ya = 0;
randommovement();
if (anim < 60)
anim++;
else {
anim = 0;
}
// xa++;
// ya++;
if (xa != 0 || ya != 0) {
walking = true;
move(xa, ya);
} else {
walking = false;
}
if (hit) {
if (anim2 < 60)
anim2++;
else {
anim2 = 0;
hit =... | 5 |
public void commit() throws DatabaseManagerException {
try {
if( conn == null || conn.isClosed() || conn.getAutoCommit() == true ) {
throw new IllegalStateException("Transaction not valid for commit operation.");
}
conn.commit();
} catch(SQLException e) {
throw new DatabaseManagerException("Error co... | 4 |
private WarMachine platziereWarMachine(WarMachine newWarMachine) {
boolean invalidInput = true;
String input = null;
Koordinate platzKoordinate = null;
Ausrichtung platzAusrichtung = null;
while (invalidInput) {
try {
input = eingabe.getUserInput();
} catch (Exception e) {
e.printStackTrace();... | 6 |
public void setTeacher1(Teacher1 teacher1) {
this.teacher1 = teacher1;
} | 0 |
public void saveFile(FoodFileBean file) throws Exception{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "insert into foodfile values(foodfile_fileid_seq.nextval,?,?,?,?)";
try {
conn = getConnection();
pstmt = conn.prepareStatement(sql);
pstmt.setString... | 8 |
static final Class142_Sub27_Sub22 method1194(byte byte0, int i) {
Class142_Sub27_Sub22 class142_sub27_sub22 = (Class142_Sub27_Sub22) Class142_Sub21.aClass90_3575.method905(i);
if (byte0 >= -51) {
return null;
}
if (class142_sub27_sub22 != null) {
return class142_s... | 5 |
public static void dfs(int index, int ultimo, String cad) {
if (res)
return;
if (maxStep == index - 1) {
} else {
for (int i = 1; i <= arr.length; i++) {
if (i != ultimo) {
int c[] = new int[ arr.length ];
int temp[] = new int[ arr.length ];
c = arr;
/*
* for (int j = 0; j < ... | 8 |
public float getSize()
{
return this.size;
} | 0 |
@Override
public void train(Matrix features, Matrix labels) {
if (features.getNumRows() != labels.getNumRows()) {
throw new MLException("Features and labels must have the same number of rows.");
}
if (filterInputs) {
Matrix matrix = trainAndTransform(features);
... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof Card))
return false;
Card other = (Card) obj;
if (cardType != other.cardType)
return false;
if (name == null) {
if (other.name != null)
return false;
} else i... | 7 |
@Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_LEFT:
dir_left = true;
break;
case KeyEvent.VK_RIGHT:
dir_right = true;
break;
case KeyEvent.VK_UP:
dir_up = true;
break;
case KeyEvent.VK_DOWN:
dir_down = true;
break;
case KeyEvent.VK_SPACE:
... | 6 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.