text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setEditable(boolean value) {
if (inputText.getParentElement().getParentElement() == null && value) {
tagList.appendChild(inputText.getParentElement());
for (ItemTag<T> itemTag : getInputTags()) {
itemTag.listItem.getFirstChildElement().getNextSiblingElement().... | 7 |
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://do... | 6 |
private Player createNewPlayer(Socket cs, Server server, String name, Connection c) throws SQLException, IOException, NoSuchAlgorithmException {
//Offer to create a new player
Telnet.writeLine(cs, "This is your first time logging in, do you want to create a new character? ");
String input = Telnet.readLine(cs);
... | 5 |
public int nstStraight(Block set, Material m, BlockFace bf)
{
int x = 1;
int a = gen.nextInt(40);
if (a < 12) {
a = 12;
}
while (x < a) {
int newx = x - 1;
Block otherset = set.getRelative(bf, newx);
Block set1 = otherset.getRelative(BlockFace.WEST, 1);
Block set2 = ... | 8 |
private ParticipantList() {
textColors = new ArrayList<String>();
textColors.add("0000FF");
textColors.add("FF0000");
textColors.add("00FF00");
textColors.add("FF00FF");
textColors.add("00FFFF");
textColors.add("FFFF00");
} | 0 |
public int getIdEncargo() {
return idEncargo;
} | 0 |
private boolean isValidVertMove(int r1, int c1, int r2, int c2) {
if (c1 != c2) {
return false;
}
int step = r1 - r2 < 0 ? 1 : -1;
if (step > 0) {
for (int r = r1 + step; r < r2; r += step) {
if (board[r][c1] != EMPTY) {
return... | 8 |
public void put(String key, MqttPersistable message) throws MqttPersistenceException {
checkIsOpen();
File file = new File(clientDir, key+MESSAGE_FILE_EXTENSION);
File backupFile = new File(clientDir, key+MESSAGE_FILE_EXTENSION+MESSAGE_BACKUP_FILE_EXTENSION);
if (file.exists()) {
// Backup the existing fi... | 7 |
public String getOrder() {
return order;
} | 0 |
static final void method696(int i, int i_0_, int i_1_, int i_2_) {
if (i_2_ == -1007) {
if ((i ^ 0xffffffff) == -1010)
ScriptExecutor.method701(Class327.aClass273_4091, i_1_, i_0_);
else if ((i ^ 0xffffffff) != -1013) {
if (i == 1002)
ScriptExecutor.method701(Class348_Sub40_Sub32.aClass273_9415,
... | 6 |
@Override
public void compile(Possession possession, Team home, Team away, TimeStamp timeStamp)
{
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch b... | 9 |
public static int oppgave2()
{
int antallFeil = 0;
DobbeltLenketListe<Integer> liste =
new DobbeltLenketListe<>();
if (!liste.toString().equals("[]"))
{
antallFeil++;
System.out.println("Oppgave 2a: Tom liste skal gi []!");
}
if (!liste.omvendtStri... | 8 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getSource() == jTextField1) {
PanelPedidos.this.jTextField1ActionPerformed(evt);
}
else if (evt.getSource() == jBtnDelete) {
PanelPedidos.this.jBtnDeleteActionPerformed(evt);
}
else if (... | 5 |
@Override
public void stateChanged(ChangeEvent e) {
if(objPanelMR != null) {
if(e.getSource().equals(objPanelMR.sliderWC)){
objPanelMR.textFieldWC.setText(objPanelMR.sliderWC.getValue()+"");
}
if(e.getSource().equals(objPanelMR.sliderWW)){
... | 5 |
private void addPlanTicketToGroup(PlanTicket pt)
{
StopRange range = new StopRange();
range.start = pt.getStartStop();
range.end = pt.getEndStop();
int pos = CollectionUtils.binarySearchBy(this._stopRangeGroups, range, new Selector<StopRangeGroup, StopRange>(){
@Override
public StopRange select(StopR... | 1 |
private void evaluateOperatorByCount(int n) throws BinaryOperatorException {
int count = 0;
while (count < n) {
evaluateOperator();
count++;
}
} | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UsersSubscribeHashtagsEntityPK that = (UsersSubscribeHashtagsEntityPK) o;
if (hashtagId != that.hashtagId) return false;
if (userId != that.use... | 5 |
@Override
public void buildDough() { pizza.setDough("pan baked"); } | 0 |
public FIB getModel(int Question_ID) {
FIB fibQuestion = new FIB();
try {
StringBuffer sql = new StringBuffer("");
sql.append("SELECT QuestionID,QuestionType,QuestionText, Instructions");
sql.append(" FROM `FIB`");
sql.append(" where QuestionID="... | 2 |
protected static HashMap<String, String> parseHeaders(String wholeMessage){
HashMap<String, String> answer= new HashMap<String, String>();
try {
String tempMessage= wholeMessage;
int indexOfNewline= tempMessage.indexOf(StompFrame.endlineChar);
String newLine= tempMessage.substring(0, indexOfNewline);
te... | 3 |
public void startClient() throws IOException {
Socket socket = null;
PrintWriter out = null;
BufferedReader in = null;
InetAddress host = null;
BufferedReader stdIn = null;
try {
host = InetAddress.getLocalHost();
socket = new Socket(host.getHostName(), 5559);
out = new PrintWriter(socket.get... | 5 |
public boolean register(String user, String password){
PreparedStatement st;
Integer rs;
String query;
query="INSERT INTO people(name,password) VALUES('"+user+"','"+password+"')";
try {
st = conn.prepareStatement(query);
rs = st.executeUpdate();
st.close();
} catch (SQLException e) {
return fals... | 1 |
private void addBlankBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBlankBtnActionPerformed
try {
question = questionField.getText();
instructions = instructionField.getText();
hlanswer = questionField.getSelectedText();
hlanswer2="[" +... | 3 |
public void setCombatModifiers(int typeID) {
switch (typeID) {
case 0: weakAgainst = 4;
strongAgainst = 2;
break;
case 1: weakAgainst = 0;
strongAgainst = 3;
break;
case 2: weakAgainst = 2;
strongAgainst = 4;
break;
case 3: weakAgainst = 3;
strongAgainst = 0;
break... | 6 |
public static boolean isReservedAssignmentOp(String candidate) {
int START_STATE = 0;
int TERMINAL_STATE = 1;
char next;
if (candidate.length()!=1){
return false;
}
int state = START_STATE;
for (int i = 0; i < candidate.length(); ... | 5 |
@Override
public void removeMyAffectsFrom(Physical P)
{
if(!(P instanceof MOB))
return;
final List<Ability> V=getMySpellsV();
final Set<String> removedAbles = new HashSet<String>();
for(int v=0;v<V.size();v++)
{
final Ability A=V.get(v);
if(!A.isSavable())
{
removedAbles.add(A.ID());
((M... | 7 |
public static <T> NBTList fromArray(T[] args)
{
final NBTList list = new NBTList(args.length);
for (T arg : args)
{
final NamedBinaryTag tag = NBTParser.wrap(arg);
if (tag != null)
{
list.addTag(tag);
}
}
return list;
} | 2 |
public boolean checkCollision(Cell[][] tiles){
for(int i = 0; i < tiles.length; i++){
for(int j = 0; j < tiles[i].length; j++){
if(tiles[i][j] != null && hitbox.checkCollision(tiles[i][j].getHitbox())){
return true;
}
else if(tiles[i][j] != null && feetBox.checkCollision(tiles[i][j].getHitbox())){... | 6 |
public void play(Sequence sequence, boolean loop) {
if (sequencer != null && sequence != null && sequencer.isOpen()) {
try {
sequencer.setSequence(sequence);
sequencer.start();
this.loop = loop;
}
catch (InvalidMidiDataException... | 4 |
public static StringWrapper cppTranslateTypeSpec(StandardObject typespec) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(typespec);
if (Surrogate.subtypeOfParametricTypeSpecifierP(testValue000)) {
{ ParametricTypeSpecifier typespec000 = ((ParametricTypeSpecifier)(typespec));
if... | 6 |
public Mensaje crearMensaje(String xml, String ip) {
Mensaje mensaje = null;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader sr = new StringReader(xml);
... | 7 |
public static void restart(boolean ausloggen)
{
if(ausloggen)
{
try
{
startUp._client.logout();
}
catch(RemoteException e)
{
e.printStackTrace();
}
}
startUp._server = null;
startUp._client = null;
startUp = null;
System.gc();
KeyboardFocusManager
.setCurrentKeyboardFocu... | 3 |
public void printFrameInfo() throws IOException {
int fn = -1;
FlacAudioFrame audio;
while ((audio=flac.getNextAudioPacket()) != null) {
fn++;
System.out.print("frame="+fn);
System.out.print(SPACER);
System.out.print("offset=??");
Syst... | 8 |
public boolean getColor (){
return color;
} | 0 |
public void paint(Graphics g) {
g.setFont(f);
FontMetrics fm = g.getFontMetrics(f);
int ascent = fm.getAscent() / 2;
// ruler
int maxValue = 0;
if (type == PITCH) maxValue = maxPitchValue;
else if (type == RHYTHM) maxValue = maxRhythmValue;
else if (type =... | 9 |
public Booking(String HKID, String userName, GregorianCalendar date){
this.HKID = HKID;
this.userName = userName;
this.date = date;
} | 0 |
public void reset(int width, int height, Minesweeper game) {
sections.clear();
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
sections.add(new Section(x, y, game));
}
}
} | 2 |
private void getDataFromSectionTable () {
try {
connection = DriverManager.getConnection(Utils.DB_URL);
statement = connection.createStatement();
resultSet = statement.executeQuery("SELECT id, name FROM Section");
while (resultSet.next()) {
section... | 2 |
public static void iceManipulationWaterWalk(Player player) {
for (int x = -1; x < 2; x++) {
for (int z = -1; z < 2; z++) {
Location location = new Location(player.getWorld(), player.getLocation().getBlockX() + x, player.getLocation().getBlockY(), player.getLocation().getBlockZ() + z);
Block block = locatio... | 4 |
private void doStop() throws Exception {
if (isActive()) {
doSetActive(false);
//..stop GarbageConnectios
try {
if ((garbageConnections != null) && (garbageConnections.isAlive())) {
garbageConnections.setStopped(true);
}
//..destroy listener
if (listener ... | 4 |
private static ServerSocketChannel createServerChannel() throws IOException {
ServerSocketChannel serverChannel = ServerSocketChannel.open();
serverChannel.configureBlocking(false);
for (int port = PORT_RANGE_LOWER; port <= PORT_RANGE_UPPER; port++) {
try {
serverChannel.bind(new InetSocketAddress(port));
... | 2 |
@Override
public String getErrorMessage() {
return errormessage;
} | 0 |
public static void main(String[] args) {
System.out.println("Initialisation du client");
System.out.println("Specifiez l'adresse IP (127.0.0.1 par defaut): ");
String ip ="";
int port1 = 9876;
try
{
ip = bufferedReader.readLine();
if(ip == null || ip == "")
{
ip = "127.0.0.1";
}
Clie... | 5 |
@Override
public boolean equals(Object obj){
boolean out = false;
if (obj instanceof ChessGameConfiguration){
ChessGameConfiguration acg = (ChessGameConfiguration) obj;
if(this.currentBoard.length == acg.getCurrentBoard().length){
... | 8 |
@Override
public void run() {
long beforeTime, afterTime, timeDiff, sleepTime;
long overSleepTime = 0L;
int noDelays = 0;
long excess = 0L;
beforeTime = System.nanoTime();
running = true;
while (running) {
update();
render();
... | 6 |
public ChatClient () {
client = new Client();
client.start();
// For consistency, the classes to be sent over the network are
// registered by the same method for both the client and server.
Network.register(client);
client.addListener(new Listener() {
public void connected (Connection connection) {
... | 7 |
public ScreenEffect(Vector4f start, Vector4f end, float duration, boolean moveTo, Tween tween) {
if(moveTo) {
Vector4f.sub(end, start, end);
}
this.startingValue = start;
this.endingValue = end;
// Using a duration of zero causes the effects to return NaN
if(duration == 0) {
duration = 0.001f;
}
t... | 2 |
private void nonTrivial(int[] section) {
int s, e;
for (e = buffer.length() - 1; e > 0 && buffer.charAt(e) == BLANK; e--)
;
if (buffer.charAt(e) != BLANK)
e++;
for (s = 0; s < e && buffer.charAt(s) == BLANK; s++)
;
section[0] = s;
section[1] = e;
} | 5 |
public void takeClickDown(MouseEvent e)
{
if(drawing && selectedPoints.size()==0)
{
image.addPoint(e.getX(), e.getY()-22);
}
if(drawing && selectedPoints.size()==1)
{
image.insertPoint(e.getX(), e.getY()-22, iindex);
iindex++;
}
... | 9 |
public int AddPhrase(String Text, String ID) {
//Controllo se l'ID sia presente nella lista
for (int i = 0; i < this._MyPhraseList.size(); i++) {
if (this._MyPhraseList.get(i).GetID().equals(ID)) {
//Creo la stringa che contiene il testo
Chunk TmpChunk... | 4 |
public void mouseMoved(MouseEvent e) {
// @TODO not built to handle multiple mice
float x = e.getX();
float y = e.getY();
float dx = x - mouse_old_x;
float dy = y - mouse_old_y;
mouse_old_x = x;
mouse_old_y = y;
data.items_new[FIRST_MOUSE_AXIS+0].value += dx>0? dx:0;
data.i... | 4 |
public int getLevel()
{
if (experience < 250) {
return 1;
} else if (experience < 750) {
return 2;
} else if (experience < 1250) {
return 3;
} else if (experience < 2000) {
return 4;
} else if (experience < 3250) {
return 5;
} else if (experience < 5500) {
return 6;
} else if (experienc... | 9 |
protected double getBreedingProbability()
{
return BREEDING_PROBABILITY;
} | 0 |
private void addLink(JLabel label, final Key key) {
label.setCursor(getPredefinedCursor(HAND_CURSOR));
label.addMouseListener(
new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
Game game = gameListModel.getSelection();
String oldValue = null;
... | 9 |
@Override
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
if (!initSoundPlayed) {
initSoundPlayed = true;
}
if (InputChecker.isInputPressed(container, KeyBindings.P1_INPUT)) {
GameState levelState = new LevelState();
levelState.init(container, game)... | 2 |
public void shiftLeftClick() {
int flagCount = 0;
for (int i = -1; i < 2; ++i) {
for (int k = -1; k < 2; ++k) {
Tile update = this.board.getTile(super.row + i, super.col + k);
if (update != null) {
if (update.state.equals("flag")) {
++flagCount;
}
}
}
}
if (flagCount == this.n... | 8 |
public long getMax() {
return max;
} | 0 |
static void addEntries(JSONArray entry_list, int index, Connection Con, String str, int start_index, int max_fetch) throws Exception {
switch(index) {
case 0: {
entry_list.addAll(Course.Query(Con,str,start_index,max_fetch));
break;
}
case 1: {
... | 6 |
public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for (int c=0,T=parseInt(in.readLine().trim());c++<T;) {
StringTokenizer st=new StringTokenizer(in.readLine());
int A=parseInt(st.nextToken()),B=parseInt(st.nextToken()),C=parseIn... | 9 |
public void setCurrent(int numberResults, Double timeInSeconds) {
if(run>=0 && timeInSeconds>=0.0) {
int queryNr = queryMix[currentQueryIndex];
int nrRuns = runsPerQuery[queryNr]++;
aqet[queryNr] = (aqet[queryNr] * nrRuns + timeInSeconds) / (nrRuns+1);
avgResults[queryNr] = (avgResults[queryNr] * nrRuns... | 6 |
private void openSelected()
{
IFile file = ((SearchResult) resultList.get(resourceNames
.getSelectionIndex())).getFile();
try
{
// open the file
// @Eclipse2
// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor... | 9 |
public String sortingMethod(String[] stringList){
boolean lexSorted = true;
boolean lengthSorted = true;
int n = stringList.length;
for(int i=0; i<n-1; i++){
if(stringList[i].length()>stringList[i+1].length()) lengthSorted=false;
if(stringList[i].compareTo(stringL... | 7 |
public void createGUI(Composite parent) {
GridLayout gridLayout;
GridData gridData;
/*** Create principal GUI layout elements ***/
Composite displayArea = new Composite(parent, SWT.NONE);
gridLayout = new GridLayout();
gridLayout.numColumns = 1;
displayArea.setLayout(gridLayout);
// Creating these e... | 6 |
private boolean read() {
try {
final URLConnection conn = this.url.openConnection();
conn.setConnectTimeout(5000);
if (this.apiKey != null) {
conn.addRequestProperty("X-API-Key", this.apiKey);
}
conn.addRequestProperty("User-Agent", Up... | 4 |
double[] compob(double x[]) {
for (int j = 0; j < parameters.length; j++) {
parameters[j] = x[j];
}
// singleRun();
// modelrun !!!!!!!!!
double F[] = new double[M];
for (int i = 0; i < M; i++) {
if (MaximizeEff[i] == Statistics.MINIMIZATION) {
... | 6 |
public static TreeMap<Integer,Integer> pitchRangeTrunkate(TreeMap<Integer,Integer> pitchTreeIn){
TreeMap<Integer,Integer> pitchTreeOut = new TreeMap<Integer,Integer>();
Iterator<Integer> pitchIterator = pitchTreeIn.keySet().iterator();
while(pitchIterator.hasNext()){
int key = pitchIterator.next();... | 3 |
@Override
public boolean equals(Object person) {
if (Java8.Person2.this == person)
return true;
//if (!(person instanceof Person2))
if (person.getClass() != Person2.class)
return false;
Java8.Person2 p = (Java8.Person2) person;
... | 9 |
public void setMetadonnee(File doc) {
if (doc == null) {
nom = "Inconnu";
chemin = "0";
taille = 0;
dateModif = "Inconnu";
auteur = "Inconnu";
duree = "Inconnu";
note = 0;
icone = "img//icoNotFound.png";
listeSeries = null;
} else {
nom = doc.getName();
chemin = doc.getPath();
ta... | 1 |
public void setAccountId(String accountId) {
this.accountId = accountId;
} | 0 |
public Login1() {
Runnable obt_run = new Runnable() {
//check Caps Lock is On
public void run() {
while (check) {
if (Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)) {
JOptionPane.showMessageDialog(n... | 6 |
public IrcClient getCurrentClient(){ return CurrentClient; } | 0 |
@Override
public void run() {
while (this.parent.sckt.isConnected() && !this.parent.sckt.isInputShutdown()) {
try {
if (this.in.available() > 0) {
this.parent.onInputReceived(this.in);
}
... | 5 |
public void setDays(ArrayList <Day> list)
{
days = list;
} | 0 |
public TreeNode getMaxNode() {
TreeNode current = root;
if (current == null)
return null;
while (current.right != null) {
current = current.right;
}
return current;
} | 2 |
static final int method3266(AbstractToolkit var_ha, int i, Class277 class277) {
try {
anInt9674++;
if ((((Class277) class277).anInt3569 ^ 0xffffffff) == 0) {
if (((Class277) class277).anInt3575 != -1) {
TextureDefinition class12 = ((AbstractToolkit) var_ha).aD4579.getTexture(
((Class277) class27... | 7 |
public <T> void loadingMatches(final ObjectMapper<T> objectMapper) {
try {
while (getXmlStreamReader().hasNext()) {
getXmlStreamReader().nextTag();
if (getXmlStreamReader().getEventType() == XMLStreamConstants.START_ELEMENT) {
if (getXmlStreamReade... | 8 |
private static TypeArgument[] parseTypeArgs(String sig, Cursor c) throws BadBytecode {
ArrayList args = new ArrayList();
char t;
while ((t = sig.charAt(c.position++)) != '>') {
TypeArgument ta;
if (t == '*' )
ta = new TypeArgument(null, '*');
e... | 4 |
private LinkedList<Vector2> findPath(Vector2 goal) {
// Get start position and direction
Vector2 start = iState.getAgentPosition();
int currentDirection = iState.getAgentDirection();
// Tentative G score
int tentativeG;
// Allows us to build the optimal path later
... | 9 |
public Project updateProject(String projectName, String projectID,
String startDate, String endDate, String scope, String status,
String category, String outcome, String lastUpdated,
String updatedBy) {
Project prj = manager.find(Project.class, projectID);
if (prj != null) {
prj.setProjectName(projectNa... | 1 |
private boolean isDragOk(final java.io.PrintStream out,
final java.awt.dnd.DropTargetDragEvent evt) {
boolean ok = false;
// Get data flavors being dragged
java.awt.datatransfer.DataFlavor[] flavors = evt
.getCurrentDataFlavors();
// See if any of the flavors are a file list
int i = 0;
while (!ok &... | 7 |
public static String squeeze(String s) {
s = StringDemo.allTrim(s);
int count = StringDemo.spaceCount(s);
char c[] = s.toCharArray();
char c1[] = new char[c.length - count];
for (int i = 0, j = 0; i < c.length; i++) {
if (c[i] != ' ') {
c1[j] = c[i];
j++;
}
}
s = new String(c1);
return s;
... | 2 |
public static String doNameRequest(String userID, Boolean isGroup) throws ParseException
{
URL vkRequest;
String jsonResponse;
JSONObject obj;
JSONArray array;
JSONParser parser = new JSONParser();
if (userID.isEmpty())
return null;
try
{
... | 7 |
public void getPeopleYouMightKnowToFile(FileWriter f) throws IOException {
ArrayList<String> ppl = new ArrayList<>();
for (User user : followers) {
if (user.getFollowers().size() == 0) {
ppl.add("The user: " + user.getName() + " doesn't follow anybody.\n");
} else... | 8 |
public static void main(String[] args) {
boolean teste = true;
MenuOpenHash menuOpenHash = null;
MenuClosedHash menuClosedHash = null;
MenuHma menuHma = null;
Scanner entrada = new Scanner(System.in);
while(teste) {
short opcao;
System.out.println("\n\n1- Open Hash\n2- Closed H... | 8 |
@Override
public boolean valid() {
if (options.useBOB.get() && options.beastOfBurden.bobSpace() > 0 && System.currentTimeMillis() > script.nextSummon.get()) {
if (!ctx.summoning.summoned() || ctx.summoning.timeLeft() <= nextRenew) {
return ctx.summoning.canSummon(options.beastOfBurden);
}
}
return fals... | 5 |
public static void main(String args[])
{
long begin=System.currentTimeMillis();
int total=1632442;
int limit=108829;
ExecutorService executorService=Executors.newFixedThreadPool(total/limit);
String name="";
for(int i=0;i<=total/limit;i++)
{
name="T"+i;
executorService.execute(new SetPaperAuthorLis... | 2 |
public String replaceDocRootDir(String htmlstr) {
// Return if no inline tags exist
int index = htmlstr.indexOf("{@");
if (index < 0) {
return htmlstr;
}
String lowerHtml = htmlstr.toLowerCase();
// Return index of first occurrence of {@docroot}
// Not... | 9 |
public GeoJsonObject()
{
type = getClass().getSimpleName();
} | 0 |
@Override
public String getMessageErreur(int index) throws Exception {
if (index >= 0 && index < erreurs.size()) {
return erreurs.get(index);
} else {
throw new Exception("Index d'activité hors limite.");
}
} | 2 |
public void zoomOut(boolean center){
double x = EditorWindow.getPanelWidth()/2;
double y = EditorWindow.getPanelHeight()/2;
if ((mouseX-mainX)/tileBuffer.getMapPixelWidth() < 0 ||
(mouseX-mainX)/tileBuffer.getMapPixelWidth() > 1 ||
(mouseY-mainY)/tileBuffer.getMapPixelHei... | 8 |
public static boolean containsAny(Collection<?> source,
Collection<?> candidates) {
if (isEmpty(source) || isEmpty(candidates)) {
return false;
}
for (Object candidate : candidates) {
if (source.contains(candidate)) {
return true;
}
}
return false;
} | 6 |
public void setPruebaCollection(Collection<Prueba> pruebaCollection) {
this.pruebaCollection = pruebaCollection;
} | 0 |
private boolean r_verb_suffix() {
int among_var;
int v_1;
int v_2;
int v_3;
// setlimit, line 164
v_1 = limit - cursor;
// tomark, line 164
if (cursor < I_pV)
{
... | 9 |
@Override
public String convertToText(String language, String filePath) {
StringBuilder responseText = new StringBuilder();
try {
int responseCode = sendImage(language, filePath, responseText);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
... | 2 |
private FieldIdentifier findField(String name, String typeSig) {
for (Iterator i = fieldIdents.iterator(); i.hasNext();) {
FieldIdentifier ident = (FieldIdentifier) i.next();
if (ident.getName().equals(name) && ident.getType().equals(typeSig))
return ident;
}
return null;
} | 3 |
private void checkOSStarted(VirtualMachine virtualMachine)
throws Exception {
String startTimeout = virtualMachine.getProperty(VirtualMachineConstants.START_TIMEOUT);
boolean checkTimeout = startTimeout != null;
int remainingTries = 0;
if (checkTimeout) {
remainingTries = Integer.parseInt(startTimeo... | 8 |
public static void GedExportTest(ArrayList<Dwarf> dwarfs) throws SAXException, IOException {
PrintWriter writer = new PrintWriter("dwarf.ged", "UTF-8");
for (int i = 0; i < dwarfs.size(); i++) {
if (dwarfs.get(i).getGender().contentEquals("MALE")) {
if (dwarfs.get(i).getSpous... | 5 |
private void placeZAxis(final List<Player> orderedPlayerList) {
ListIterator<Player> it = orderedPlayerList.listIterator();
boolean hasLegalSpot = true;
while (it.hasNext() && hasLegalSpot) {
Player player = it.next();
Set<PlanetEntrance> availableEntrances = galaxy.getAvailableSpots();
if (availableEnt... | 7 |
public void setEnderchestContents(ItemStack[] contents)
{
for (int i = 0; i < Enderchest.length; i++)
{
if (i < contents.length && contents[i] != null)
Enderchest[i] = contents[i].clone();
else
Enderchest[i] = null;
}
} | 3 |
@Override
protected void setReaction(Message message) {
try {
String url = getUrl(message.text);
reaction.add( getDefinition(url) );
} catch (Exception e) {
setError("Cannot load given URL.", e);
}
} | 1 |
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.