text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void createBankAccount(CommandSender sender, String name, String player)
{
Bank bank = iConomy.getBank(name);
if (!iConomy.hasAccount(player)) {
Messaging.send(sender, this.Template.color("error.bank.account.none"));
return;
}
Account account = iConomy.getAccount(player);... | 9 |
private void updateView() {
/* Siuntėjo/gavėjo grupė */
int index = 0;
if (textRadio.isSelected()) {
index = 1;
} else if (imageRadio.isSelected()) {
index = 2;
}
/* Pakeičiamas siuntėjas/gavėjas */
currentSender = senders[index];
... | 7 |
static final boolean method2354(LocationMode class364, int i) {
anInt3954++;
if (i != -1)
method2355(-93, (byte) 115, true, null, -92, -67, 6);
if (Class367_Sub8.aClass364_7361 != class364
&& Class26.aClass364_382 != class364
&& Class108.aClass364_1657 != class364
&& class364 != Class342.aClass36... | 5 |
public SingleTaskQueue(TaskExecutor<T> taskExecutor) {
this.taskExecutor = taskExecutor;
} | 0 |
public int getHealthyPeople() {
int persons = 0;
for (int i = 0; i < items.size(); i++) {
if (items.get(i) instanceof Person) {
if(! items.get(i).dying() ) persons++;
}
}
return persons;
} | 3 |
public boolean Step(int direction)
{
boolean result = super.Step(direction); // call Moveables Step
if(result) // Check if we were able to move?
{
client.setEye(this); //Update eye.
return true;
}
return false;// Otherwise return false
} | 1 |
public void demarrer(Client joueur) {
int choiceInt = -1;
boolean wrong = true;
System.out.println("Bienvenue dans l'hôtel\nQue voulez-vous faire?");
System.out.println("Votre solde est de " + joueur.soldeDuCompte + "€");
System.out.println("Bienvenue à l'hotel du Casino"
... | 9 |
private static void getCmdsPlayer(Player player) {
m.player(player, "&a____________[ &6DoOdy Commands &a]____________");
m.player(player, "&a____________[ &6Short: /dm, /duty &a]____________");
if (player.isOp() || player.hasPermission("doody.duty")) {
m.player(player, "&6/doody &bon &fTurns on Duty Mode.");
... | 9 |
public final boolean equals(Object par1Obj)
{
if (!(par1Obj instanceof LongHashMapEntry))
{
return false;
}
else
{
LongHashMapEntry var2 = (LongHashMapEntry)par1Obj;
Long var3 = Long.valueOf(this.getKey());
Long var4 = Long.valu... | 7 |
private void attack(){
if (attackTime >= attackSpeed && isHooked){
attackTime = 0;
int k = ms.getDmg();
int levelP = hookedPlayer.getInfo().getLevel();
int levelM = ms.getLevel();
float pierce = (levelM - levelP) * Balance.PIERCE_REDUCT;
if (pierce < 0){
pierce = 0;
}
float reduct = hooked... | 5 |
protected boolean isFinished() {
return _hasChanged && !Robot.tomahawk.isForward();
} | 1 |
public boolean canSellerLogout() {
String serviceName;
Set<String> services = this.matchingUsers.keySet();
Iterator<String> serviceIt = services.iterator();
HashMap<String, String> userStatuses;
while (serviceIt.hasNext()) {
serviceName = serviceIt.next();
if (!this.matchingUsers.isEmpty())... | 6 |
private void populate()
{
Random rand = Randomizer.getRandom();
field.clear();
for(int row = 0; row < field.getDepth(); row++) {
for(int col = 0; col < field.getWidth(); col++) {
if(rand.nextDouble() <= FOX_CREATION_PROBABILITY) {
Location loca... | 7 |
public static void main(String[] args) {
try{
System.out.println("Start time ms:" +System.currentTimeMillis());
if(args.length>=1){
min_support = Integer.parseInt(args[0]);
System.out.println("Using Min Support of "+min_support);
}
Vector<String> candidates = new Vector<String>();
MongoClient ... | 4 |
public static Mapper parseMapTask(String mapTaskDetailsJsp, boolean needMetrics) {
Document mapDetails = HtmlFetcher.getHtml(mapTaskDetailsJsp);
Element tr = null;
for(Element elem : mapDetails.getElementsByTag("tbody").first().children()) {
if(elem.child(2).text().equals("SUCCEEDED")) {
tr = elem;
... | 4 |
public static Object[][] getData(String csvFile) throws Exception {
int numberOfLines = countLines(new File(csvFile));
if (numberOfLines == -1) {
throw new Exception("File not found exception");
}
BufferedReader br = null;
String line = "", csvSplitBy = ",";
... | 7 |
public void advanceX(Direction direction) {
if(limitToScreenBounds) {
if(direction == Direction.LEFT) {
if((this.x - speed) < 0) {
// Prevent movement, object is at min screen bounds
return;
}
} else if(direction == Direction.RIGHT) {
if((this.x + speed) > (this.panelWidth - this.width)) {... | 7 |
private Class<?> compileSource0(String className, String sourceCode) throws Exception {
List<MemorySourceJavaFileObject> compUnits = new ArrayList<MemorySourceJavaFileObject>(1);
compUnits.add(new MemorySourceJavaFileObject(className + ".java", sourceCode));
DiagnosticCollector<JavaFileObject> diag = new Di... | 3 |
public static Map toMap(JSONObject json, String key) {
if (null == json) {
return null;
}
if (!StringUtils.isEmpty(key) && !json.has(key)) {
return null;
}
Map jsonMap = new HashMap();
JSONObject convertible = StringUtils.isEmpty(key) ? json
: (JSONObject) json.get(key);
Iterator keysIterator = ... | 5 |
public static String getFileHeader(InputStream is) {
byte[] b = new byte[28];
try {
is.read(b);
} catch (IOException e) {
LOGGER.info("InputStream Reading Error!");
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
LOGGER.info("InputStream Closing Error!"... | 3 |
private String getJSONString() throws UBLFetchException {
InputStream inputStream = null;
try {
inputStream = m_ublLocation.openStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder jsonStringBuilder = new StringBuild... | 4 |
@Override
public void actionPerformed(ActionEvent event) {
if ((event.getSource().equals(btnOk)) || (event.getSource().equals(btnCancel))) {
modalResult = (event.getActionCommand().equals("ok"));
setVisible(false);
}
} | 2 |
private Fraction reduce()
{
Fraction result = new Fraction();
int common = 0;
// get absolute values for numerator and denominator
int num = Math.abs(numerator);
int den = Math.abs(denominator);
// figure out which is less, numerator or denominator
if (num > den)
co... | 6 |
@Override
public void flush()
{
// Only a streaming source can be flushed, because only streaming
// sources have queued buffers:
if( channelType != SoundSystemConfig.TYPE_STREAMING )
return;
// determine how many buffers have been queued:
int queued ... | 5 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
@Override
public void addPropertyFilter(String key, PropertyFilter filter) {
PropertyFilterChain filter_chain = getPropertyFilterChain(key);
if (filter_chain == null) {
filter_chain = new PropertyFilterChainImpl();
setPropertyFilterChain(key, filter_chain);
}
filter_chain.addFilter(filter);
} | 1 |
private void createContent() {
content = new JEditorPane();
content.setContentType("text/html");
content.setEditable(false);
setNicerFont(content);
content.addHyperlinkListener( new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEven... | 3 |
private void treatmentPage(){
TTP_remark.setText(null);
TreatmentRec treatmentRec = new TreatmentRec(db,patient,doctorID);
if (patient != null){
patient.addTreatmentRec(treatmentRec);
TTP_remark.setText(patient.getTreatmentRec(patient.getTreatmentRecSize()-1).getCondition());
patient.getTreatmen... | 9 |
public static LayerBox getInstance() {
if (instance_ == null) instance_ = new LayerBox();
return instance_;
} | 1 |
public final Path getPath(final String titleMsg, final FileFilter filter,
final File initialDirectory) {
final JFileChooser chooser;
final JLabel title = new JLabel(titleMsg);
this.mainFrame.isAlwaysOnTop();
chooser = new JFileChooser(initialDirectory);
chooser.setDialogTitle(title.getText());
chooser.se... | 4 |
public static void listEmployees(EntityManager entityManager) {
TypedQuery<Employee> query = entityManager.createQuery(
"select e from Employee e", Employee.class);
List<Employee> resultList = query.getResultList();
entityManager.close();
for (Employee employee : resultList) {
System.out.println(employ... | 1 |
public void updateMenu() {
_highScoreInt.setText(String.valueOf(Fenetre._score.getHigh()));
_currentScoreInt.setText(String.valueOf(Fenetre._score.getCurrent()));
remove(_next);
remove(_credits);
if (Fenetre._level.nextLvlExist()) {
add(_next);
} else {
add(_credits);
}
} | 1 |
public static ArrayList<Song> initialDownload(String userName)
{
ArrayList<Song> allSongs=new ArrayList<Song>();
ArrayList<String> dates= new ArrayList<String>();
ArrayList<String> names= new ArrayList<String>();
ArrayList<String> artists = new ArrayList<String>();
Elements dateList;
Elements nameList;
E... | 5 |
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equalsIgnoreCase("polymorph Mad Cow") && npc != null && player != null)
{
if (MAD_COW_POLYMORPH.containsKey(npc.getNpcId()))
{
// remove the feed info from the previous mob
if (_FeedInfo.get(npc.getObjectId(... | 5 |
public static Point extractPoint(String buffer) {
int[] values = extractIntegers(buffer);
if (values.length == 2) {
return new Point(values[0], values[1]);
}
return null;
} | 1 |
private static Paint createButtonPaint(AbstractButton button, int lineBorderWidth, boolean isDarkColorScheme) {
boolean isPressed = button.getModel().isPressed();
Color topPressedColor = isDarkColorScheme ? WidgetBaseColors.DARK_ACTIVE_SELECTED_TOP_COLOR : WidgetBaseColors.LIGHT_ACTIVE_SELECTED_TOP_COL... | 6 |
private void goLeft(ColorPatch patch, int x, int y) {
if ( --x >= 0 ) {
Color color = pixel(x, y);
if ( isIncluded(x, y) ) {
if ( patch.getColor().distance(color, Color.RGB_DISTANCE) < tolerance ) {
patch.add(color);
goLeft(patch, x, y);
}
}
exclude(x, y);
}
} | 3 |
private void processKeyRelease(KeyEvent e) {
int keyCode = e.getKeyCode();
keys[keyCode] = false;
if (gameController.isNewCharacterOpen()) {
} else if (keyCode == Settings.buttonMoveLeft) {
keyLeftPressed = false;
if (!keyRightPressed) {
gameCont... | 9 |
public synchronized void clearAll() {
for (Key key : keys) {
key.clear();
}
} | 1 |
public static boolean generatorCollectionP(Stella_Object collection) {
if (((Boolean)(Logic.$REVERSEPOLARITYp$.get())).booleanValue() &&
(!Logic.closedTermP(collection))) {
return (false);
}
{ Surrogate testValue000 = Stella_Object.safePrimaryType(collection);
if (Surrogate.subtypeOfP(t... | 8 |
@Override
public String getPostalCode() {
return super.getPostalCode();
} | 0 |
@SuppressWarnings("deprecation")
public static boolean czyGraczMaItemy(String p) {
boolean czyMa = true;
Player pp = Bukkit.getPlayer(p);
if (!pp.getInventory().contains(new ItemStack(Material.DIAMOND, 64))) {
czyMa = false;
}
if (!pp.getInventory().contains(new ItemStack(Material.GOLD_INGOT, 64))) {
... | 8 |
public Document getDocument() {return this.doc;} | 0 |
public boolean shouldPaint(){
return myKeeper == null ? true: !myKeeper.sensitive;
} | 1 |
public void loadConfig() {
boolean bSaveFile = false;
if (m_Plugin.getDataFolder().exists() == false) {
m_Plugin.getDataFolder().mkdir();
}
File configFile = new File(m_Plugin.getDataFolder(), m_ConfigFile);
if (configFile.exists() == true) {
try {
... | 7 |
public static Object[] decodeValues(String str) throws DecodeException {
Object[] res;
int i=0;
int beginning = i;
while (str.charAt(i) != '>') {
i++;
}
String[] types = str.substring(beginning, i).split(":");
i++;
beginning = i;
... | 9 |
public void execute(DocumentMap dm) {
init(dm);
while (true) {
if ((limit != 0) && (candidates.size() == limit)) {
return;
}
candidate = indexGlobal.nextSubscript(candidate);
if (candidate.equals("")) {
break;
}
... | 7 |
@Override
public void execute(ByteStream stream) {
int i = 0;
while (true) {
if (this.amount >= 0 && i >= this.amount) {
break;
}
if (this.until != null) {
if (Arrays.equals(stream.readBytes(this.until.length),
this.until)) {
break;
} else {
stream.advance(-this.until.length);
... | 5 |
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 |
@Override
public ArrayList<String> getItems(String userId) {
System.out.println("Hello from SessionBean getItems");
ArrayList<String> items = new ArrayList<String>();
TypedQuery<Item> itemsByUserQuery = emgr.createNamedQuery(
"Item.findAllByUser", Item.class);
itemsByUserQuery.setParameter("userName", user... | 1 |
public boolean setTimer(Timer t) {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: setTimer() BEGIN");
}
m_timer = t;
if (test || m_test) {
System.out.println("FileManager :: setTimer() END");
}
return true;
} | 4 |
private final void method653() {
synchronized (this) {
for (int i = 0; i < anInt5387; i++) {
int i_629_ = anIntArray5356[i];
anIntArray5356[i] = anIntArray5312[i];
anIntArray5312[i] = -i_629_;
if (aClass360Array5360[i] != null) {
i_629_ = ((Class360) aClass360Array5360[i]).anInt4430;
((Class36... | 6 |
final boolean method2121(int i, Source source, int i_3_) {
anInt4745++;
if (i != 25625)
method2126((byte) -74);
if (i_3_ > anInt4739) {
method2126((byte) -36);
if (anInt4746 <= 0)
throw new RuntimeException("ARGH!");
OpenGL.glBindBufferARB(anInt4755, anInt4746);
OpenGL.glBufferDataARBa(anI... | 5 |
static public String ParseSrcPos() {
if (Pos == null) {
return null;
}
if (Pos.length() >= 3) {
String srcpos = Pos.subSequence(0, 3).toString();
if (ParsePosition.IsPos(srcpos)) {
Pos = Pos.subSequence(3, Pos.length()).toString();
return srcpos;
... | 5 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom);
if (Room == null)
{
return;
}
RoomItem Item = Room.GetItem(Main.DecodeInt());
if (Item == null)
{
... | 8 |
public void addAllNewProductionsToGrammar(Grammar oldGrammar,
Grammar newGrammar, VariableDependencyGraph graph) {
GrammarChecker gc = new GrammarChecker();
String[] variables = oldGrammar.getVariables();
for (int k = 0; k < variables.length; k++) {
String v1 = variables[k];
String[] dep = getDependencie... | 2 |
public static int is_periodic(String suc) throws ArrayIndexOutOfBoundsException{
int i, begin, end, beginAux, endAux, repetitions;
begin=0;
for (i = 1; i < suc.length(); i++) {
repetitions=1;
if (suc.charAt(0) == suc.charAt(i)){
end=i;
... | 8 |
public void setup( String filename ,METSMetadata gmd ) throws Exception {
super.setup( filename, gmd );
BufferedReader fin = new BufferedReader(new InputStreamReader( new FileInputStream( filename ) ) ) ;
String inchi1 = fin.readLine();
String inchi2 = fin.readLine();
fin.close();
if( inchi1 != null && inchi1... | 4 |
public void enterToDatabase(ArrayList<File> songs){
for(int i=0; i<songs.size(); i++){
File song = songs.get(i);
String artist = tagger.getArtist(song);
String title = tagger.getTitle(song);
String bpm = tagger.getBPM(song);
String album = tagger.getAlbum(song);
boolean badartist = true;
boolean ... | 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 |
public static void main(String[] args) throws Exception {
ExecutorService exec = Executors.newCachedThreadPool();
ServerSocket server = new ServerSocket(8080);
InputStream socketInput = new Socket("localhost", 8080).getInputStream();
exec.execute(new IOBlocked(socketInput));
exec.execute(new IOBlocked(System.... | 0 |
public GameMap getIndex(World world) {
for (GameMap map : this.maps.values()) {
if (map.getWorld() == world) {
return map;
}
}
return null;
} | 2 |
@Test
public void onKahdenPotenssiToimii() {
assertEquals(true, h.onKahdenPotenssi(4)
&& h.onKahdenPotenssi(16)
&& h.onKahdenPotenssi(25)
&& h.onKahdenPotenssi(36)
&& h.onKahdenPotenssi(49)
&& h.onKahdenPotenssi(64)
... | 7 |
public void setStatus(int status) {
Status = status;
} | 0 |
@Override
public void init()
{
super.init();
int offset = 0;
grbit = ByteTools.readInt( getByteAt( offset++ ), getByteAt( offset++ ), getByteAt( offset++ ), getByteAt(
offset++ ) );
short strLen = ByteTools.readShort( getByteAt( offset ), getByteAt( offset + 1 ) );
byte strGrbit = getByteAt( offset + 2... | 5 |
@Override
public Course deleteCourse(long courseId) {
for(int i = 0; i < courses.size(); i++){
if(courses.get(i).getId() == courseId){
return courses.remove(i);
}
}
return null;
} | 2 |
public static Stella_Object access_PLModuleFile_Slot_Value(PLModuleFile self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == GuiServer.SYM_GUI_SERVER_KBName) {
if (setvalueP) {
self.KBName = ((StringWrapper)(value)).wrapperValue;
}
else {
value = StringW... | 8 |
@Override
public void sort(int[] array) {
if (bucketCount <= 0) {
throw new IllegalArgumentException("Invalid bucket count");
}
if (array.length <= 1) {
return;
}
int high = array[0];
int low = array[0];
for (int i = 1; i < array.length... | 9 |
public void enviarConsulta(String db, String query) {
String queryJSON = QueryManager.crearQuery(db, query);
try {
socketConServidor = new Socket(servidor, puerto);
DataInputStream ois = new DataInputStream(
socketConServidor.getInputStream());
DataOutputStream oos = new DataOutputStream(
socketC... | 4 |
public void readOrders() {
String line;
if (fileName == null) {
System.err.println("No file name set for order list. Data read aborted.");
return;
}
try {
File file = new File(fileName);
Scanner scanner = new Scanner(file, "iso-8859-1");
... | 5 |
private static Player askSelectExistingPlayer(List<Player> selectedPlayers) {
System.out.println("Please select one of the existing players:");
List<Integer> selectedPlayerNumbers = new ArrayList<>();
for (Map.Entry<Integer, Player> entry : players.entrySet()) {
if (!selectedPlayers.... | 9 |
public Game() {// Constructor
UPF.f.addKeyListener(this);
UPF.f.requestFocusInWindow();
// Background
sBackground = new JLabel(new ImageIcon("resources/gameBKG.jpg"));
sBackground.setBounds(14, 46, 253, 445);
// Return to menu button
toMenu = new JButton("Menu");
toMenu.setFont(menuFont);
toMenu.se... | 5 |
public void doNext() {
CombatLog log;
int dmg;
double procChance;
Alteration voltaicSlash = engine.getPlayer().getAlterations().get("voltaicSlash");
MathTools math = new MathTools();
log = CombatLog.getInstance();
log.write(engine.getTimeStr() + this.getName() + " ");
dmg = engine.spellDamage(1.85,0.... | 8 |
private void itmMnuAtividadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itmMnuAtividadeActionPerformed
// Menu - Cadastro > ItemMenu - Atividade
UsuarioBO userBO = new UsuarioBO();
Usuario Encarregadoexistente = null;
try {
Encarregadoexistente = use... | 5 |
public static void main(String [] args){
List<Thread> threads= new ArrayList<Thread>();
/**
* 500 threads are created to perform this adding up
*/
for(int i=0; i<500; i++){
Runnable task=new MyRunnable(10000000L + i);
Thread worker=new Thread(task);
... | 4 |
public void doEvent(int eventNumber){
if(eventNumber >= MIN_DIALOG || eventNumber <= MAX_DIALOG){
displayNextDialog(eventNumber);
}else if(eventNumber == 101){
//do something
}else if(eventNumber >= 102 || eventNumber <= 110){
areaTransitionEvent(eventNumber);
}else if(eventNumber >= 111 || eventNumber... | 7 |
public boolean isSorted() {
int length = this.array.length, i;
length--;
for (i = 0; i < length; i++) {
if (this.array[i].compareTo(this.array[i + 1]) < 0
|| this.array[i].equals(this.array[i + 1])) {
continue;
} else {
... | 4 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public Value get(Key key) {
Node current = root;
int cmp = key.compareTo((Key) root);
while (current != null) {
if (cmp > 0) {
current = root.right();
} else if (cmp < 0) {
current = root.left();
} else {
return (Value) current.getValue();
}
}
return null;
} | 3 |
protected Method getAccessor(Object obj, Field field, boolean isGetter)
{
String name = field.getName();
name = name.substring(0, 1).toUpperCase() + name.substring(1);
if (!isGetter)
{
name = "set" + name;
}
else if (boolean.class.isAssignableFrom(field.getType()))
{
name = "is" + name;
}
else... | 8 |
private void assignPosToPif() {
int index = 0;
for (pif p : PIF) {
int pos = 0;
if (p.code == 0) {
pos = getSTPosition(p.token, identifiersST);
pif n = new pif();
n.code = p.code;
n.token = p.token;
n.positionST = pos;
PIF.set(index, n);
} else if (p.code == 1) {
pos = getSTPos... | 3 |
private void verifyNodeBasics(Attributes attributes) {
/* id="7263630a-3284-4f46-8137-eef38adb5649"
* nameResId="@string/keyboard"
* description="Created by Menny Even Danan"
* index="1"
*/
String id = attributes.getValue("id");
if ( id == null... | 5 |
public void resizeAll()
{
File[] files = new File(inputDirectory).listFiles();
for (int i = 0; i < files.length; i++)
{
try
{
if (files[i].getName().endsWith(".jpg"))
{
resize(files[i]);
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
} | 3 |
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse resl)
{
HttpSession session = req.getSession();
LogonForm user = (LogonForm) session.getAttribute("user");
if(user != null )
{
session.removeAttribute("user");
session.invalidate();
r... | 1 |
final public boolean delete(final K key) {
int index = computeHash(keyData(key)) % size ;
if (index < 0) index += size ;
if (table[index] == null)
return false ;
Entry <K, V> link = table[index] ;
if (link.next == null) {
table[index] = null ;
return true ;
}
Entry <K, V> p... | 6 |
private static Farbe waehleFarbe(int spielerAnzahl) {
Farbe farbe = null;
if (spielerAnzahl > 2 || Farbe.ROT.isIstFrei()
&& Farbe.BLAU.isIstFrei() && Farbe.GRUEN.isIstFrei()
&& Farbe.SCHWARZ.isIstFrei()) {
farbe = farbeAussuchen();
if (farbe.isIstFrei()) {
farbe.setIstFrei(false);
} else {
... | 6 |
private char nextChar()
{
if (hasInput())
return input.charAt(position++);
else
return (char) -1;
} | 1 |
public boolean isGetClass() {
MethodAnalyzer mana = getMethodAnalyzer();
if (mana == null)
return false;
SyntheticAnalyzer synth = getMethodAnalyzer().getSynthetic();
return (synth != null && synth.getKind() == SyntheticAnalyzer.GETCLASS);
} | 2 |
@SuppressWarnings("rawtypes")
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
TKey other = (TKey) obj... | 9 |
public double getDouble(){
try{
return Double.parseDouble( value );
}
catch( NumberFormatException ex ){
throw new XException( ex );
}
} | 1 |
public String parseAtcocode( InputStream in ) throws JsonParseException {
JsonParser jp = null;
try {
jp = jsonFactory.createParser( in );
while ( jp.nextToken() != JsonToken.END_OBJECT ) {
String fieldName = jp.getCurrentName();
if ( "atcocode"... | 6 |
public static void main(String[] args)
{
if (args.length < 2)
{
System.out.println("Number of Argument " + args.length +" is smaller than 2! Exiting!!");
System.exit(0);
}
URL url = null;
InputStream inputStream = null;
FileWriter fileWriter ... | 7 |
private void removeAVL(TreeNode startingNode, String searchingKey) {
currentSearchHeight++;
if (startingNode == null) {
System.out.println("\nKey " + searchingKey + " not found.");
} else {
if (startingNode.value.compareTo(searchingKey) > 0) {
removeAVL(st... | 4 |
public void insertarOrdenado(int dato) {
if (this.estaOrdenada()) {
Nodo nuevo = new Nodo(dato);
Nodo nodo = this.nodoInicial;
if (this.nodoInicial == null)
this.nodoInicial = new Nodo(dato);
else {
if (dato <= nodo.getDato())
this.insertarInicio(dato);
else
while (nodo != null) {
... | 7 |
public void DescargarParche(){
try{
FileReader ArchivoConfiguracion = new FileReader("Configuracion.txt");
BufferedReader _ArchivoConfiguracion = new BufferedReader(ArchivoConfiguracion);
String LineaInformacion = "";
String RutaCarpetaWoW = "";
int Li... | 9 |
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println("Current thread: " + t);
// change the name of the thread
t.setName("My Thread");
System.out.println("After name change: " + t);
try {
for(int n = 5; n > 0; n--) {
System.out.println(n);
Thread.sleep(100... | 2 |
@Test
public void gameStateTransitionTest() {
City_Graph city_graph2 = new City_Graph();
city_graph2.loadMap("res/test.mp");
Move move = new Move("R 2");
city_graph2 = city_graph2.gameStateTransition(move);
assertEquals(city_graph2.convertGameStateToString(),"CNRR");
} | 0 |
public Queue<String> tanqueXMLUnit (){
try {
path = new File(".").getCanonicalPath();
FileInputStream file =
new FileInputStream(new File(path + "/xml/papabicho.xml"));
DocumentBuilderFactory builderFactory =
DocumentBuilderFactory.newInstance();
Do... | 9 |
private static boolean insertPatient(Patient bean, PreparedStatement stmt) throws SQLException{
stmt.setString(1, bean.getFirstName());
stmt.setString(2, bean.getLastName());
stmt.setDate(3, bean.getDob());
stmt.setString(4, bean.getPrimaryDoc());
stmt.setString(5, bean.getPhone());
stmt.setString(6, bean.... | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Coordinate other = (Coordinate) obj;
if (c != other.c)
return false;
if (r != other.r)
return false;
return true;
} | 5 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.