text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args) throws IOException {
BufferedReader buf = new BufferedReader(
new InputStreamReader(System.in));
String line = "";
StringBuilder sb = new StringBuilder();
int f = 0;
d: do {
BigInteger aux = new BigInteger("0");
line = buf.readLine();
if(line==null || line.l... | 4 |
private static String getCitedBy(Element e) {
Elements fl = e.getElementsByClass(THSIS_CITIEDBY_CLASS);
String text = fl.select("a[href]").first().text();
// 查找文本中包含的数字
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(text);
String citedBy = "0";
while (matcher.find()) {
cit... | 1 |
public String generateRandomFarg()
{
int fargCode = new Random().nextInt(3);
String farg = null;
switch(fargCode)
{
case 0:
farg = "röd";
break;
case 1:
farg = "blå";
break;
case 2:
farg = "gul";
break;
default:
farg = null;
break;
}
return farg;
} | 3 |
private void setScaledImage(Image background, String key) {
if (background != null) {
float iw = background.getWidth(this);
float ih = background.getHeight(this);
float pw = getWidth(); //panel width
float ph = getHeight(); //panel height
if (pw < iw || ph < ih) {
... | 6 |
public List<Event> getEvents(String artistName) throws IOException, EncoderException {
String data = client.getData(artistName);
return !(data == null || data.isEmpty()) ? dataHandler.parsJsonToEvents(data) : null;
} | 2 |
public static void print(byte type, String msg) {
if (!systemShow && type == system)
return;
if (!loadShow && type == error)
return;
if (!debugShow && type == debug)
return;
if (type == system) {
System.out.print("[System]: ");
}
if (type == error) {
System.out.print("[Error]: ");
}
if ... | 9 |
public ViewRestaurant(String str) {
super();
this.setLayout(null);
this.name = str;
// Title
JLabel title = new JLabel(str, JLabel.CENTER);
title.setBounds(200, 0, 700, 50);
title.setFont(title.getFont().deriveFont(32f));
this.add(title);
// Back button
btn1 = new JButton("Back");
btn1.setBounds... | 5 |
private ActionListener createInviteListener() {
// create a dialog to let user input ip, port and invitation type
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
PeerStatus status = LocalInfo.getPeerStatus();
if... | 5 |
public static MethodType tMethod(String signature) {
int hash = signature.hashCode();
Iterator iter = methodHash.iterateHashCode(hash);
while (iter.hasNext()) {
MethodType methodType = (MethodType) iter.next();
if (methodType.getTypeSignature().equals(signature))
return methodType;
}
MethodType meth... | 2 |
@Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
final String rest=CMParms.combine(commands,1);
Environmental target=mob.location().fetchFromRoomFavorMOBs(null,rest);
if((target!=null)&&(!target.name().equalsIgnoreCase(rest))&&(rest.length()<4))
... | 7 |
@Override
public void actionPerformed(ActionEvent arg0) {
String actionName = arg0.getActionCommand();
String serviceName = null;
String user = null;
if (column == 1) {
user = ((String) table.getValueAt(row, column)).split("\\s+")[0];
serviceName = (String) table.getValueAt(row, column - 1);
} else {
... | 7 |
@EventHandler
public void onEntityExplode (final EntityExplodeEvent event){
if (!plugin.isEnabled()) return;
if (event.isCancelled()) return;
for (Block block : event.blockList()){
if (plugin.blockListener.relevantSign(block)){ // Have no Player to offer here...
event.setCancelled(true);
plugin.... | 4 |
final public void Expression() throws ParseException {/*@bgen(jjtree) #ConditionalNode( false) */
SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTCONDITIONALNODE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
Sequence();
} catch (Throwable jjte000) {
if (jjtc000) {
... | 8 |
public double[] columnSums(){
double[] sums = new double[this.numberOfColumns];
for(int i=0; i<this.numberOfColumns; i++){
sums[i] = 0.0;
for(int j=0; j<this.numberOfRows; j++){
sums[i] += this.matrix[j][i];
}
}
... | 2 |
public void testQuardraticParabolaEquation() {
Point[] points = new Point[] { new Point(3, 0), new Point(-3, 0),
new Point(0, 6) };
QuadraticParabolaEquation equation = QuadraticParabolaEquation
.newInstance(points);
assertEquals(6, equation.getY(0), 0);
} | 0 |
public void adicionaTurma(int numero) throws TurmaJaExisteException {
for (Turma t: this.turmas){
if (t.getNumero() == numero){
throw new TurmaJaExisteException("Já existe a turma de número:"+numero);
}
}
Turma t = new Turma(this, numero);
this.turmas.add(t);
} | 2 |
public void update(Node rootNode, Camera cam, Nifty nifty, HashMap<String, StreetInfo> streetInfoMap){
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
currentTime = sdf.format(cal.getTime());
Ray ray;
Collis... | 7 |
public void destroy(String id) throws NonexistentEntityException, RollbackFailureException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Roles roles;
try {
roles = em.getReference(Roles.cl... | 5 |
public MOB getElligibleOfficer(Law laws,
Area myArea,
MOB criminal,
MOB victim)
{
final Room R=criminal.location();
if(R==null)
return null;
if((myArea!=null)&&(!myArea.inMyMetroArea(R.getArea())))
return null;
MOB M=getElligibleOfficerHere(laws,myArea,R,criminal,victim);... | 8 |
public boolean checkGoal(State state) {
for (int k = 0; k < state.getData().size(); k++) {
for(int m = 0; m < state.getData().get(k).size(); m++) {
if (state.getData().get(k).get(m).equals("$") || state.getData().get(k).get(m).equals(".")) {
return false;
}
}
}
endTime = System.nanoTime();
... | 5 |
public Behaviour jobFor(Actor actor) {
if (actor.isDoing(Delivery.class, null)) return null ;
if (stage >= STAGE_BOARDING) {
final Action boardAction = new Action(
actor, this,
this, "actionBoard",
Action.STAND, "boarding "+this
) ;
boardAction.setPriority(stage ==... | 5 |
private void ConsultarTorneio_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ConsultarTorneio_ButtonActionPerformed
int i=0;
Collection<String> marcador = a.getMelhorMarcadores(Torneio_ComboBox.getSelectedItem().toString());
if (marcador != null) {
for (Stri... | 2 |
public void disable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (!isOptOut()) {
configuration.set("opt-out"... | 2 |
public void newTrack() {
int theId = lookForBlankId();
int newMatchesSize = Math.max(theId + 1, highestId() + 1);
int[] matches = new int[newMatchesSize];
for (int i = 0; i < matches.length; i++)
matches[i] = 0;
Track newTrack = new Track(theId, "", "", 1, 0, 0, 0, 0, 0, "", matches);
for (int i = 0; i <... | 4 |
private void iteracja_rekrystqalizacja() {
double p = this.gestosc_dyslokacji(this.itr);
double psr = p/(double)this.tabSizeX*this.tabSizeY;
for (int i = 0; i <= this.tabSizeX - 1; i++) {
for (int j = 0; j <= this.tabSizeY - 1; j++) {
if (this.P[i][j].prev==0) {
this.P[i][j].p += this.pij(70, 120, ps... | 4 |
public byte[] decoding(byte[] data) {
int bufLen = data.length - (data.length + 7 ) / 8 ;
ByteBuffer buf = ByteBuffer.allocate(bufLen);
for(int i = 0; i != data.length; i++) {
if ((i + 1) % 8 != 0 && i + 1 != data.length) {
convertByte = data[i + 1];
... | 3 |
public void disol(int... overlays) {
for (int ol : overlays)
visol[ol]--;
} | 1 |
private JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new JButton();
jButton1.setText("BACK");
jButton1.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent event) {
jButton1MouseMouseClicked(event);
}
});
}
return jButton1;
} | 1 |
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 |
@SuppressWarnings("unchecked")
public static void openURL(String prompt, String url)
{
String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Mac OS")) {
Class fileMgr = Class.forName("com.apple.eio.FileManager");
Method openURL = ... | 7 |
public IVPBoolean greaterThanOrEqualTo(IVPNumber num, Context c, HashMap map, DataFactory factory) {
IVPBoolean result = factory.createIVPBoolean();
map.put(result.getUniqueID(), result);
boolean resultBoolean = false;
if(getValueType().equals(IVPValue.INTEGER_TYPE) && num.getValueType().equals(IVPValue.INTEGER... | 5 |
public String encrypt(String str) {
if(StringUtils.isEmpty(str)) throw new IllegalArgumentException("String for encrypt is null");
digester.update(str.getBytes());
byte[] hash = digester.digest();
StringBuffer hexString = new StringBuffer();
for(int i = 0; i < hash.length; i++) {
if((0xff & hash[i]) ... | 3 |
protected SecuredPriorityBean getPriority(SecuredTaskTriggerBean task) throws GranException {
String impactUDFName = KernelManager.getFind().findUdf(INCIDENT_IMPACT_UDFID).getCaption();
String urgencyUDFName = KernelManager.getFind().findUdf(INCIDENT_URGENCY_UDFID).getCaption();
String urgency =... | 5 |
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int p = Integer.parseInt(st.nextToken())-1;
String... | 7 |
private <T> Class<?> createProxyClass(Class<?> mockedType, Class<?>...interfaces) {
if (mockedType == Object.class) {
mockedType = ClassWithSuperclassToWorkAroundCglibBug.class;
}
Enhancer enhancer = new Enhancer() {
@Override
@SuppressWarnings("unche... | 7 |
public void update(Observable o, Object arg) {
for (Element<Light> e : _lightElements) {
System.out.print("Light at (" + e.i + "," + e.j + "): ");
System.out.println(e.x.getColor());
}
for (Element<VehicleAcceptor> e : _roadElements) {
for (Vehicle d : e.x.getCars()) {
... | 3 |
@Override
public String getMobile() {
return super.getMobile();
} | 0 |
public boolean canMoveDown(){
int emptyRowsFromBottom=0, j, i;
// check for field boundaries
for(j=(t.getySize()-1);j>0;j--){
if(!t.rowIsEmpty(j)){
break;
}
emptyRowsFromBottom++;
}
if((t.getPosY()+t.getySize()-emptyRowsFromBottom)>(p.getySize()-1)){
return false;
}
// check for o... | 8 |
public QueueInterface<String> calculate()
throws DAIllegalArgumentException, DAIndexOutOfBoundsException {
if (displayText != "")
displayTextTop.addLast(displayText);
if (displayTextTop.getSize() > 2) {
QueueInterface<String> deque = new DynamicArray<String>();
while (displayTextTop.getSize() > 0) {
... | 3 |
public static FieldNode getLocalField(String name, String desc, ClassNode cn) {
for (FieldNode fn : cn.fields) {
if ((name == null || fn.name.equals(name)) && (desc == null || fn.desc.equals(desc)))
return fn;
}
return null;
} | 5 |
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == userPrivateMessageItem) {
String toUser = usersOnlineList.getSelectedValue();
openChatWindow(toUser, getUserIdByName(toUser), true);
} else if(e.getSource() instanceof JButton) {
closeTab(((JButton) e.getSource()).getActionCommand(... | 2 |
public void setParameter(String key, String value) {
String[] values = parameters.get(key);
if (values == null) {
parameters.put(key, new String[]{value});
} else {
String[] result = new String[values.length + 1];
result[0] = value;
for (int i = 0... | 2 |
private static void writeConstructors(final ClassEditor ce,
final DataOutputStream dos) throws IOException {
// Sort constructors by their signatures
final SortedSet sorted = new TreeSet(new Comparator() {
public int compare(Object o1, Object o2) {
MethodEditor me1 = (MethodEditor) o1;
MethodEditor m... | 4 |
public VueSalle(ListUserPanel a, int nbPlaces){
matriceSalle = ListeMatriceSalle.getMatriceSalle(nbPlaces);
listUserPanel = a;
setHeight("100%");
setWidth("100%");
setStyleName("vueSalle");
flextable = new FlexTable();
flextable.clear();
flowpanel = new FlowPanel();
flextable.setWidget(1, 0, flowpane... | 5 |
public void fastClicked()
{
WindowStack ws = WindowStack.getLastInstance();
System.out.println(ws);
if (ws != null) {
WindowFast fast = new WindowFast();
ws.push(fast);
}
} | 1 |
@Override
public void testFailure(Failure failure) {
setFailedOrIgnoredForFailureOrAssumptionFailure(failure, TestState.failed);
} | 0 |
public void mouseExited(MouseEvent e)
{
if(e.getButton() == MouseEvent.BUTTON1)
{
mouseActions.left();
}
else if(e.getButton() == MouseEvent.BUTTON3)
{
mouseActions.right();
}
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Card other = (Card) obj;
if (rank != other.rank)
return false;
if (suit != other.suit)
return false;
return true;
} | 5 |
private JToggleButton getButton(int tool)
{
switch (tool)
{
case TOOL_EYEDROPER:
return eyedropper;
case TOOL_LINE:
return line;
case TOOL_OVAL:
return oval;
case TOOL_PAINT_BUCKET:
return... | 8 |
public Direction getTurnDirection(Direction current, boolean isRightTurn) {
Direction result = Direction.N;
if (current != null) {
switch (current) {
case N:
if (isRightTurn) {
result = Direction.E;
} else {
... | 9 |
private List<String> getProperties(Class<?> clazz) {
List<String> properties = new ArrayList<String>();
Iterable<Field> fields = filter(
Arrays.asList(clazz.getDeclaredFields()),
new Predicate<Field>() {
@Override
public boolean apply(Field input) {
return !Modifier.isStatic(input.getModifi... | 6 |
public void placeEntrance() {
boolean valid = false;
while (valid == false) {
double r1 = Math.random(); // X or Y wall
double r2 = Math.random(); // 0 or Last
Random rn = new Random();
int row = rn.nextInt(grid.length - 2) + 1;
if (r1 > 0.5) ... | 8 |
public boolean isNormalMove(Piece piece, Field from, Field to) {
return piece.canMove(this.window.board, from, to);
} | 0 |
private static void checkSchedule(){
@SuppressWarnings("unused")
long newCurrentTime;
while(!dataReceived)
{
dataReceived = ic.mm.dataRec();
edSchedSel = ic.mm.editSchedSelected();
schedSetupSel = ic.mm.InitSetupSelected();
l... | 9 |
public void addResults(Test test, UUID batchId, Boolean persist) {
if(persist!=null){
Config config = Config.getInstance();
String dburl = "jdbc:mysql://" + config.configProperties.getProperty("db.hostname") + ":" + config.configProperties.getProperty("db.port") + "/" + config.config... | 4 |
public static NSpace getSpace(String context) {
try {
return (NSpace)CONTEXT_CACHE_MODULE.get(new NSpaceKey(context), () -> new NSpace(context));
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
} | 1 |
public void addListenerHistButton(final JButton histButton){
histButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
URL urlButton = new URL(histButton.getText());
System.out.println("histButton: "... | 4 |
public void recalcColumnWidths()
{
JTableHeader header = this.getTableHeader();
TableCellRenderer defaultHeaderRenderer = null;
if (header != null)
defaultHeaderRenderer = header.getDefaultRenderer();
TableColumnModel columns = this.getColumnModel();
TableModel... | 6 |
private void fillAttrAndOpe(Parse parse , Model model){
for(Classe e : model.getClasse()){
e.cld(model);
final String x = e.getIdentifier();
final Object[] at = e.getArrayAttribut().toArray();
final Object[] mt = e.getArrayOperation().toArray();
for(int k=0;k<e.getArrayAttribut().size();k++) {
... | 6 |
public int getFirstMsgIndex(List<JournalEntry> journal, String from, String to, String subj)
{
from = DB.injectionClean(from);
to = DB.injectionClean(to);
subj = DB.injectionClean(subj);
if(journal==null)
return -1;
for(int i=0;i<journal.size();i++)
{
final JournalEntry E=journal.get(i);
if((fr... | 8 |
public Repo(String dir) throws IOException {
RepositoryBuilder rb=CoffeeGit.gerRepositoryBuilder();
File fileDir=new File(dir);
repo=rb.setGitDir(fileDir)
.readEnvironment()
.findGitDir()
.build();
String[] gitDirList=fileDir.list();
boolean initFlag=false;
for(int i=0;(!initFlag)&&i<gitDirLi... | 5 |
public static void saveConfigurationValue(OutputStream stream, Stella_Object value) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(value);
if (Surrogate.subtypeOfStringP(testValue000)) {
{ StringWrapper value000 = ((StringWrapper)(value));
stream.nativeStream.print(value000.wra... | 6 |
public String getNewPlayer() {
int player = getPlayerNum();
if (player == 0) return "Player1";
else if (player == 1) return "Player2";
else return "Observer";
} | 2 |
private String Complement(String binaryString)
{
StringBuilder complementBuilder = new StringBuilder(binaryString);
for(int i = 0; i < binaryString.length(); ++i)
{
char flip = binaryString.charAt(i) == '0' ? '1' : '0';
complementBuilder.setCharAt(i, flip);
}
return complementBuilder.toString();
... | 2 |
private ArrayList<Spire> deleteDoubles(ArrayList<Spire> l) {
ArrayList<Spire> temp = l;
int reps = 0;
for (int i = 0; i < temp.size(); i++) {
for (int e = 0; e < temp.size(); e++) {
if (temp.get(e).equals(temp.get(i)) && e != i) {
reps++;
... | 6 |
final boolean method1414(int i) {
if (((OpenGlToolkit) aHa_Sub2_2511).aBoolean7820
&& ((OpenGlToolkit) aHa_Sub2_2511).aBoolean7783
&& aClass337_2513 == null) {
Class242 class242
= (WidgetVariable.method3249
(35632, 121, aHa_Sub2_2511,
"uniform float rcpRelief;\nuniform vec2 sampleSize;\nuni... | 6 |
public static void sink(int row) {
game.fallTimer.stop();
int lines = 0;
try {
lines = game.gameGrid.collapseAbove(row);
}
catch (Exception e) {
e.printStackTrace();
}
// Give bonus points for consecutive line removals
if (lines == 0) {
game.consecutive = 1;
}
else {
++game.consecu... | 5 |
public void run()
{
Socket sckOut = null;
InetSocketAddress isaTmp = null;
try
{
sckOut = new Socket();
sckOut.bind
(
new InetSocketAddress
(
EzimNetwork.localAddress
, 0
)
);
isaTmp = new InetSocketAddress
(
this.addr
, this.port
);
sckOut.connect(isaTmp,... | 4 |
protected final void addEnd(final String name) {
try {
h.endElement("", name, name);
} catch (SAXException ex) {
throw new RuntimeException(ex.toString());
}
} | 1 |
public void save(Member transientInstance) {
log.debug("saving Member instance");
try {
Session session = getSession();
Transaction tr = session.beginTransaction();
session.save(transientInstance);
tr.commit();
session.flush();
session.close();
log.debug("save successful");
} catch (RuntimeEx... | 1 |
public static void main(String[] args) {
File f = new File("registro.txt");
BufferedReader reader = null;
int mayor = 0, actual = 0;
String[] valor = null;
try {
reader = new BufferedReader(new InputStreamReader(
new FileInputStream(f)));
String line = reader.readLine();
while (line != null) {
... | 6 |
public int getInt(int index) throws JSONException {
Object o = get(index);
return o instanceof Number ?
((Number)o).intValue() : (int)getDouble(index);
} | 1 |
public void addSymbol(String lispPackage, String value) {
if (lispPackage.equals(""))
arguments.add("'" + value);
else
arguments.add("'" + lispPackage + "::" + value);
} | 1 |
public static Venue[] findAll() throws SQLException {
ResultSet resultSet = Data._findAll(Venue.class.getSimpleName());
ArrayList<Venue> rtn = new ArrayList<Venue>();
int i=0;
for(i=0; resultSet.next();i++) {
Venue iVenue = new Venue();
iVenue.id = resultSet.getLong("id");
iVenue.name = resultSet.getSt... | 1 |
public Node getBack() {
Node node = head.previous;
if (node == head) {
current = null;
return null;
} else {
current = node.previous;
return node;
}
} | 1 |
public void setBackground(Path img) throws IOException {
if (FileUtil.control(img)) {
FileUtil.copyFile(img, this.imageDir.resolve(Constants.SKIN_BG_NAME), false);
this.backgroundImgChanged = true;
this.imgBackground = this.imageDir.resolve(Constants.SKIN_BG_NAME);
}... | 1 |
public void sql_change_appointment_info(int choice) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Statement s = GUI.con.createStatement();
if(choice == 1)
{
s.executeUpdate ("UPDATE appointments SET Title =... | 7 |
private void generateMap(String[] layout) {
String line;
for ( int r = 0; r < GameConstants.WORLDSIZE; r++ ) {
line = layout[r];
for ( int c = 0; c < GameConstants.WORLDSIZE; c++ ) {
char tileChar = line.charAt(c);
String type = "error";
if ( tileChar == '.' ) { type = Ga... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (null == obj) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Description eq = (Description)obj;
if (!super.equ... | 6 |
public boolean isGestureOk() {
return gestureOk;
} | 0 |
public static DefaultCell averagedCell(List<Measurement> measurements) {
Point2D.Double averagedCellTowerPos = averagedCellTowerPosition(measurements);
DefaultCell averageCell = new DefaultCell(averagedCellTowerPos, 0.0, 120.0);
double vectorAngle = 0.0;
List<Measurement> maxMeasurementsThatFit = ne... | 4 |
@Override
public double execute(Date start, Date end) {
int duration = TimeCalculator.duration(start, end);
duration = duration % this.countUnit > 0 ? duration / this.countUnit
+ 1 : duration / this.countUnit;
double price = this.pricePerUnit * duration;
return DecimalCleaner.round(price, 3);
} | 1 |
private int getNextProgramCharDistance(String line, int i) {
boolean inComment = false;
int remainingCharNum = line.length() - i;
int charDistance = 1;
for (charDistance = 1; charDistance < remainingCharNum; charDistance++) {
int ch = line.charAt(i + charDistance);
if (inComment) {
if (line.regionMat... | 8 |
@Override
public MediaTag load(RandomAccessFile raf, String versions)
throws IOException {
if(raf.length()<42) {
// definitely not FLAC
return null;
}
byte b[]=new byte[4];
raf.seek(0L);
MediaFileUtil.read_sure(raf,b);
if(!(new ... | 9 |
@Override
public String toString()
{
String cardString = "";
if ( this.number == 1 )
{
cardString += "Ace";
}
else if ( this.number == 11 )
{
cardString += "Jack";
}
else if ( this.number == 12 )
{
cardString += "Queen";
}
else if ( this.number == 13 )
{
cardString += "King";
}
... | 7 |
public void validar() throws InvalidIDException {
try {
if(cuit==null) throw new NullPointerException("Null CUIT given");
if(cuit.toString().length()!=11) throw new IndexOutOfBoundsException("Invalid CUIT length:"+cuit.toString().length()+"must 11 digits");
sexo = cuit / (long) Math.pow(10, 9);
dni = cuit... | 9 |
public static Spell getWaterSpell(int i)
{
switch (i)
{
default:
case 0:
return new Waterbending();
case 1:
return new WaterbendingFreeze();
case 2:
return new WaterSpout();
case 3:
... | 7 |
@EventHandler(priority = EventPriority.HIGH)
public void join(PlayerJoinEvent event) {
if (plugin.config.usedbtomanageXP) {
String playername;
Player player = event.getPlayer();
double XP = plugin.getTOTALXP(player);
double XPneu = XP;
playername =... | 9 |
public void setImage() {
if (harbor == "havencolission") {
setImage(new GreenfootImage("havencolission.png"));
}
if (harbor == "havenfooter") {
setImage(new GreenfootImage("havenfooter.png"));
}
if (harbor =="rightbalk") {
setImage(new... | 5 |
@Override
/*
* Method to find the shortest possible route between two nodes in the graph
* using the Breadth-First Search Algorithm. Returns: ArrayList of Nodes in
* order which they should be traversed in order to reach destination.
*/
public ArrayList<Node> findRoute(Node sourceNode, Node destinationNode) {... | 9 |
public int right(int graus) {
if (graus <= 340) { //limite de elevação 270º
if (graus < 10) {
right = "!00" + graus + "R*";
System.out.println("RIGHT = " + right);
arduino.enviaDados(right);
} else if (graus >= 10 && graus < 100) {
... | 4 |
private static boolean downloadDependency(String dep) {
switch(dep) {
case "jinput":
case "lwjgl":
case "lzma":
case "slick-util":
try {
Files.copy(Paths.get(dependencyURLs + "\\" + dep + ".jar"), Paths.get(workPath + "\\deps\\" + dep + ".jar"));
return true;
} catch (IOException e) {
e.pri... | 7 |
@Override
public void componentResized(ComponentEvent e) {
// TODO Auto-generated method stub
//System.out.println("resized in MainFrame");
Position.setSize(this.getWidth(), this.getHeight());
} | 0 |
public void setAge(int age) {
this.age = age;
} | 0 |
public void piirraRuutu(Ruutu ruutu, Graphics graphics) {
Elementti elementti=ruutu.getRuudussa();
if (elementti==null) {
}
else if ("liukuhihna".equals(elementti.tyyppi())){
piirraLiukuhihna(graphics,ruutu,elementti.getGrafiikkaluku());
} else if ("kuoppa".equals(ele... | 8 |
public void setOptions(String[] options) throws Exception {
String tmpStr;
tmpStr = Utils.getOption('P', options);
if (tmpStr.length() != 0)
setPruningMethod(
new SelectedTag(Integer.parseInt(tmpStr), TAGS_PRUNING));
else
setPruningMethod(
new SelectedTag(PRUNING_NONE, TAGS_PRUNIN... | 7 |
public int onMouseClick(Point mousePos)
{
if( gameresult != -2) // it is shown the game result, when users clicks, make new game
{
if( gameresult == GV.PLAYER_ONE)
{
player1.gamesWon++;
}
else if( gameresult == GV.PLAYER_TWO)
{
player2.gamesWon++;
}
board.initialize();
gameres... | 9 |
protected void drawBars(Graphics2D g) {
if (!isValuesFilled()) {
return;
}
double barStep = (getWidth() - (leftChartMargin + FIRST_BAR_LEFT_MARGIN)* 2) / getValues().length;
double xTopLabel;
double xBottomLabel;
int x;
int y;
int w;
int h;
Value value;
double realBarW... | 7 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((bairro == null) ? 0 : bairro.hashCode());
result = prime * result + ((cep == null) ? 0 : cep.hashCode());
result = prime * result + ((cidade == null) ? 0 : cidade.hashCode());
result = prime * result
+ (... | 6 |
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 |
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.