method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
f96e8a5c-a12e-48dc-8df8-a33bf856fe5f | 8 | void directModification(final Modification mod) {
// die Mengen und bei Komposition auch die Elemente werden betrachtet
final List<ObjectSet> sets = getObjectSets();
for(ObjectSet set : sets) {
if(set.getObjectSetType().getReferenceType() == ReferenceType.COMPOSITION) {
// Elemente
final List<SystemObj... |
0ee47f1e-83cb-4e98-aaff-b988981bceca | 5 | public boolean pay(Player p) {
if(!plugin.useVault){
return true;
}
Economy econ;
RegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class);
if(rsp == null){
return true; //No Vault found
}
econ = rsp.getProvider();
if(econ == null)... |
c7509694-8c2f-4fc4-a2b2-9c10d2575f19 | 2 | public Position getNextPos(Node n) {
if(initialize) {
initialize = false;
double speed = Math.abs(speedDistribution.nextSample()); // units per round
double wt = Math.ceil(waitingTimeDistribution.nextSample()); // potential waiting time
Position startPos = getNextWayPoint();
nextDestination = getNe... |
0bb9be97-1d23-46f1-bcfe-bbda41d207e5 | 3 | private final short getGuildFilter() {
switch (club) {
default:
case Whatever:
return 0;
case No:
return 1;
case Yes:
return 2;
}
} |
26e7ca1f-58f7-4503-a4b8-5b239f672d8f | 6 | private int getHiddenLineCountAboveImpl(Fold fold, int line, boolean physical) {
int count = 0;
if (fold.getEndLine()<line ||
(fold.isCollapsed() && fold.getStartLine()<line)) {
count = fold.getCollapsedLineCount();
}
else {
int childCount = fold.getChildCount();
for (int i=0; i<childCount; i++) ... |
2210ee17-dc7e-4222-9bec-8b1d37ea0544 | 9 | public static void main(String[] args) {
// TODO Auto-generated method stub
File _myFile = new File(".//Atom Results//10.200.252.105");
String lineSeperator = "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
String _tempString;
StringBuffer _buffer = new StringBuffe... |
23eabe3e-e8c9-48a8-98c2-4115d7a28605 | 1 | public String toString(){
String asw = "";
for (Planet p : this.planets) {
asw += "Owner : " + p.Owner() + ".";
asw += "Number of ships : " + p.NumShips() + ".\n";
}
return asw;
} |
5488fc17-a9ff-471a-b745-76dbef0df021 | 6 | private void listenForDatabaseServers() {
if (this.listeningSocket != null) {
byte[] buffer = new byte[100];
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
while (this.running && this.dbServers.isEmpty()) {
try {
this.listeningSocket.receive(packet);
InetAddress address = pa... |
afe21279-aa0d-4bed-89c5-18b534451de0 | 1 | private BigDecimal calculateAvailableWeeklyTotal(BudgetBreakdown breakdown, BigDecimal totalMoneyAvail) {
return (breakdown.getBudgetType().equals(ANNUAL)) ?
totalMoneyAvail.divide((ANNUAL_DIVISIBLE_WEEKS), 2, RoundingMode.HALF_UP) :
totalMoneyAvail.divide((MONTHLY_DIVISIBLE_WEEK... |
8cad9b75-cd72-4a54-bb05-79948d315739 | 6 | public ResultSet preencherTabelaEncarregadOPordepartamento(String CodDepartamento) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.... |
8978e4ca-27dd-48ba-84c9-bc13abcc835e | 4 | public int valueofCad(String cad) {
for (int i = 0; i < this.getLista().size() - 1; i++) {
if (this.getLista().get(i).getIsPattern()) {
if (cad.matches(this.getLista().get(i).getMatch())) {
return this.getLista().get(i).getValor();
}
} ... |
e42ecf17-73ca-49a9-b094-7b1e5d2ff60d | 2 | public static String getQualifiedName(Class<?> clazz) {
Assert.notNull(clazz, "Class must not be null");
if (clazz.isArray()) {
return getQualifiedNameForArray(clazz);
} else {
return clazz.getName();
}
} |
f8d0480c-e107-41bf-9353-dd626736708b | 4 | private void createTimer(String[] sd, String[] st, String[] ed, String[] et){
int day = subtract(ed[2], sd[2]);
int hour = subtract(et[0], st[0]);
int minute = subtract(et[1], st[1]);
int second = subtract( et[2].substring(0, 2), st[2].substring(0, 2) );
if (sec... |
2aab0fa2-3511-483b-85c6-740db288ddc4 | 6 | public void afegirElement(String dia, int hora, Element e) {
int i;
if (dia.equals("dilluns")) i = 0;
else if (dia.equals("dimarts")) i = 1;
else if (dia.equals("dimecres")) i = 2;
else if (dia.equals("dijous")) i = 3;
else if (dia.equals("divendres")) i = 4;
else... |
57aa3e24-0078-47f7-a577-2c3717aba13d | 4 | public int getorder(int[] nums1,int m,int[] nums2,int n){
int order = 0;
if(nums1[0]>nums1[m-1]){
order = -1;//desc
}else if(nums1[0]==nums1[m-1]){
if(nums2[0]>nums2[m-1]){
order = -1;//desc
}else if(nums1[0]==nums1[m-1]){
order = 0;//all same
}else{
order = 1;
}
}else{
order = 1;/... |
3bc47c3c-929e-41a7-88da-f7e4b4c483a8 | 9 | private static String getValue(String value)
{
if (value == null)
{
return null;
}
int start;
int end;
int index;
if ((start = value.indexOf("${")) != -1)
{
String tag = value.substring(start + 1);
if ((end = tag.... |
49147354-8021-47c5-a3b4-a59d59748e63 | 8 | public static int getClosestColor(int red, int green, int blue) {
if(red < 0 || red > 255)
throw new IllegalArgumentException("getClosestColor: red is outside of valid range (0-255)");
if(green < 0 || green > 255)
throw new IllegalArgumentException("getClosestColor: green is outs... |
01bbf9e4-941d-4674-b815-f5b0fbb52b4f | 3 | private byte[] pkcs1pad2(byte[] data, int n)
{
byte[] bytes = new byte[n];
int i = data.length - 1;
while (i >= 0 && n > 11)
{
bytes[--n] = data[i--];
}
bytes[--n] = 0;
while (n > 2)
{
bytes[--n] = 0x01;
}
bytes[--n] = 0x2;
bytes[--n] = 0;
return bytes;
} |
e51c2dc5-0f5d-4501-9186-ddc1a3585d83 | 7 | @Override
public String getObjectiveOutput(ColorList color, int level) {
String str = "";
for (int i = 0; i <= level; i++)
str = str + "\t";
str = str + getName() + " " + getWeight() + " { ";
AttributeDomain d = getDomain();
double vals[] = d.getWeights();
... |
54ccac1e-58f4-4545-99a9-0dc4899a3e77 | 9 | public static void initializeMappingFile (String mappingFileName) {
GenUtil.validateString(mappingFileName);
try {
BufferedReader br = new BufferedReader (new FileReader (mappingFileName));
String line;
String [] headersArr = null;
while ((line = ... |
4e0164c7-e374-49f9-990c-485ef23b6e5a | 2 | @Override
public void mouseReleased(MouseEvent e) {
int row = table.rowAtPoint(e.getPoint());
FindReplaceResult result = model.getResult(row);
int type = result.getType();
if (type == FindReplaceResult.TYPE_DOC) {
handleDocumentClick(result);
} else if (type == FindReplaceResult.TYPE_FILE) {
hand... |
c7a63a1b-3d4b-4405-8761-93d0617e6d31 | 0 | public void setId(int id) {
this.id = id;
} |
2d39d583-0bb4-4777-9129-a68c75fd5f6d | 6 | static final void method2642(int i, int i_6_, boolean bool, int i_7_,
int i_8_) {
anInt4138++;
for (int i_9_ = 0;
(i_9_ ^ 0xffffffff) > (Class348_Sub38.anInt7008 ^ 0xffffffff);
i_9_++) {
Rectangle rectangle = Class180.aRectangleArray2371[i_9_];
if ((i_7_ ^ 0xffffffff) > (rectangle.width + r... |
19c9ad36-4179-4284-970c-c5545d30f133 | 1 | public void setState(String state) {
if(isValidState(state)) {
this.state = state;
} else {
//TODO: geeignet ändern
throw new RuntimeException();
}
} |
debd06bd-ded9-40f9-8e0b-3642fcb7e0cc | 3 | public synchronized byte[] execute() {
POWWorker[] workers = new POWWorker[Runtime.getRuntime().availableProcessors() * THREADS_PER_CPU];
for (int i = 0; i < workers.length; i++) {
workers[i] = new POWWorker(target, i, workers.length, initialHash, this, targetLoad / THREADS_PER_CPU);
new Thread(workers[i], "... |
fe6d8ce5-c485-4b7c-a673-406cfb701fe9 | 7 | private boolean noWCS(String RA, String DEC, String VEL, String w_RA, String w_DEC, String w_50, String w_20, String w_VEL) {
return RA.length() == 0
&& DEC.length() == 0
&& VEL.length() == 0
&& w_RA.length() == 0
&& w_DEC.length() == 0
&& w_50.length(... |
b2240d3d-8397-49b3-a82a-1c79e3d3c66d | 3 | public void load() throws IOException {
classes = new HashMap<String, ClassNode>();
JarFile jar = ((JarURLConnection) jarURL.openConnection()).getJarFile();
Enumeration<JarEntry> entries = jar.entries();
if (!entries.hasMoreElements()) {
return;
}
JarEntry entry;
while (entries.hasMoreElements()) {
... |
4cfc2f2b-05b7-4112-9807-1b4fd0d08c6a | 0 | public void setSources(String sources)
{
this.sources = sources;
} |
4e52135e-f809-40db-a478-b8ec1dd90946 | 5 | @Override
public void run()
{
if(socket == null)
{
if(!setupMulticastservice())
{
System.err.println("Multicastservice not started.");
return;
}
}
running = true; //set running flag
try
{
while(running)
{
byte[] buffer = new byte[bufferSize];
DatagramPacket messageIn = n... |
04474cc5-bac1-4673-8695-650b57263aec | 4 | public String insertionSort3(String a) {
char[] arr = a.toCharArray();
char tmp;
for (int i = 1; i < arr.length; i++) {
tmp = arr[i];
for (int j = i; j > 0; j--) {
if (tmp < arr[j - 1]) {
arr[j] = arr[j - 1];
} else {
arr[j] = tmp;
break;
}
// this case is when a element swap... |
1974723e-2432-4bcb-8164-b499c6d804dc | 9 | public static File extractModelFromPDB(File aPdbFile,
File anOutputDirectory, String aPdbId, int aModelNumber)
throws IOException {
if (!aPdbFile.exists()) {
throw new FileNotFoundException("No PDB file found!.");
}
// get the total number of Models
int tNM = PdbHelper.findNumberOfModels(aPdbFile);
i... |
05840af2-a8e7-42f3-aa0d-5d1b90ba5414 | 0 | void left(int velocity) {
} |
21f224e9-5650-4dfc-bfb5-54b42e113fc9 | 0 | private List<File> getRootDirs() {
return rootDirs;
} |
03382a7f-60b3-4d1b-a49a-2f2108a8c585 | 0 | public void removeNext()
{
remove(next);
revalidate();
repaint();
state.setWaiting(false);
} |
93f4de71-dabc-4a8e-a4bb-72044bca44ac | 4 | public void sizeColumnsToFit() {
ArrayList<Column> columns = new ArrayList<>();
for (Column column : mModel.getColumns()) {
if (column.isVisible()) {
int width = column.getPreferredWidth(this);
if (width != column.getWidth()) {
column.setWidth(width);
columns.add(column);
}
}
}
if (!... |
7299cb7c-6b82-48e3-b9d3-8beba92dad1f | 4 | @Override
public synchronized FileVisitResult visitFile(Path file,
BasicFileAttributes attr) {
if (attr.isRegularFile()) {
String name = "" + file;
if (name.endsWith(".txt")) {
for (JSONArray comments : extractor.extractFromCrawler(file, related)) {
... |
b77b197d-77c3-47b8-91f0-71a86afac18c | 1 | public static void main(String[] args) {
//-- get system look and feel --
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
System.out.println(e.getMessage());
}
Simulator simulator = new Simulator();
... |
9e8dd53a-22fb-403b-a189-1b28bf6f12e9 | 5 | public final T invalidate() {
if (this.valid) {
this.minSize = minSizeSet ? minSize : null;
this.prefSize = prefSizeSet ? prefSize : null;
this.maxSize = maxSizeSet ? maxSize : null;
if (this.parent != null) parent.invalidate();
this.valid = false;
... |
9159774a-d973-4119-800a-f723ab4f43bb | 1 | @Override
public void tableCheckAndCreate() throws SQLException {
// http://stackoverflow.com/questions/2942788/check-if-table-exists
Statement statement = con.createStatement();
DatabaseMetaData dbm = con.getMetaData();
// check if "employee" table is there
//http://markmail.org/message/tdl26btburmhuhkc
S... |
8c9f4584-ddaf-4117-80f7-e115cdfc1ad2 | 5 | @Override
public boolean checkTable(String table) {
try {
Connection connection = open();
//this.connection = this.open();
Statement statement = connection.createStatement();
ResultSet result = statement.executeQuery("SELECT * FROM " + table);
if (result == null)
return f... |
99f4501b-6f68-45e9-ad4c-4ea6e45f3875 | 8 | void setTapePointer(int n) {
if (!hasEmbeddedMovie())
throw new RuntimeException("cannot set pointer because there is no tape");
modelTimeQueue.setPointer(n);
for (int i = 0; i < numberOfAtoms; i++) {
atom[i].moveRPointer(n);
atom[i].moveVPointer(n);
atom[i].moveAPointer(n);
}
if (obstacles != nul... |
f43c5e5e-04fe-48ba-acef-da7c8373eda8 | 0 | public void clearSelected() {
selectedNodes.clear();
} |
562a8c59-7471-45ee-bbbf-f86a9d18fb84 | 8 | @Override public void iterate(){
matcount += 1;
if(matcount >= mat){matcount = 0;
calculate(); }
if(ages){ if(active){ if(age == 0){age = 1;} else{age += 1;}}else{ age = 0;}
if(fades){ if( age >= fade){ purgeState(); age = 0;}}
if( age > 1023){ age = 1023; }state = agify(age);}
else{if(ac... |
cb5069cb-a880-4644-a881-b80f24ab9fc1 | 0 | @Override
public Product retrieveResult() {
return product;
} |
9d54b767-6dd5-49ac-9a31-85ef36b68167 | 5 | private static List<Class<?>> getAllContextModels(Class<?> c)
{
List<Field> allSetsForThis = ContextReflectUtils.listAllSetFieldsFor(c);
List<Class<?>> retval = new LinkedList<Class<?>>();
for (Field f : allSetsForThis)
{
retval.add(ContextReflectUtils.getXMLStoreSetCont... |
43982083-04ad-4ab6-a2ad-a444a5748c60 | 3 | static /* package scope */ void addProfile(LangProfile profile, int langsize) throws LangDetectException {
String lang = profile.name;
if (instance_.langlist.contains(lang)) {
throw new LangDetectException(ErrorCode.DuplicateLangError, "duplicate the same language profile");
}
... |
675d72e0-2d53-46e5-9fc7-0c3ba3979d77 | 7 | private void ValidateGlobalInputs() {
int numScouts = Integer.parseInt(NumScouts_Field.getText());
int numRunsperTest = Integer.parseInt(RunsPerTestField.getText());
int setVisibility = Integer.parseInt(VisibilityField.getText());
double netThreshold = Double.parseDouble(NetworkThreshold.ge... |
2074db45-b88d-4270-9fdc-ec060018bb84 | 2 | public void executeEvent(IGameEvent e) {
ArrayList<IGameEventListener> listeners = eventListeners.get(e.getEventType());
if(listeners != null) {
for(IGameEventListener listener : listeners) {
listener.execute(e);
}
}
} |
a5d4cf4b-2c85-4f87-bc04-ff968f498a91 | 7 | public static String[] toStringA(byte[] data) {
// Advanced Technique: Extract the String array's length
// from the first four bytes in the char array, and then
// read the int array denoting the String lengths, and
// then read the Strings.
// ----------
if (data == null || data.length <... |
5c68afd8-3bdd-4e86-a923-408b8303bbd5 | 7 | public static void main(String[] args) throws IOException {
BuildManager manager = new BuildManager();
if (args.length != 4) {
LOG.info("Usage: java SSPPBuildManager CIUrl tempFolder formalBuildFolder zipUselessFolderPath");
System.exit(0);
} else {
CI_URL = ... |
07bbcd41-776d-454b-9194-3691d526126f | 7 | private void iniciar() {
view.getDepManual().addActionListener(this);
view.getRetManual().addActionListener(this);
view.getTotalField().addActionListener(this);
view.getVentaOk().addActionListener(this);
tablaDetalles = view.getTablaDetDef();
view.getTablaArticulos().addM... |
7cb773d5-6b43-4e7e-891a-02d1a404cff5 | 2 | public Dimension minimumLayoutSize(Container parent) {
synchronized (parent.getTreeLock()) {
Insets insets = parent.getInsets();
int ncomponents = parent.getComponentCount();
int w = 0;
int h = 0;
for (int i = 0; i < ncomponents; i++) {
Component comp = parent.getComponent(i);
Dimension d ... |
aa20b676-3700-4165-9117-e4e8143c3d94 | 4 | public void fetchPages() throws IOException, SAXException, ParserConfigurationException {
// Look at the first page with the originalURL:
int firstAdNum = 0;
int maxAdsPerPage = 0;
boolean firstLoop = true;
// maxAdsPerPage is set to the number of ads on the first page;
// subsequent pages will ... |
121047a9-8e16-4076-8123-ef92ece7cbe3 | 7 | private void startScene1() throws NoSuchElementException,
NoSuchElementException,
IllegalStateException,
IOException {
String fila = input.readLine().toUpperCase();
for (int i = 0; i < Rows; i++) {//antes comparaba !fila.equals("0,0,0")
for (int j = 0; j <... |
d47671a1-633a-4bd1-ab2b-fb5fee916fc3 | 8 | private int buildZone(int x, int maxLength)
{
int t = random.nextInt(totalOdds);
int type = 0;
for (int i = 0; i < odds.length; i++)
{
if (odds[i] <= t)
{
type = i;
}
}
switch (type)
{
... |
e0c1570b-ef68-45ae-a5a1-ce5ed8466bef | 2 | private static String makeProjectName(String baseProjectName, int currentDeepLevel, File dir, int dirCount) {
String s = "";
while (dirCount > 0 && currentDeepLevel > 0) {
s = '/' + dir.getName() + s;
dir = dir.getParentFile();
--currentDeepLevel;
--dirCount;
}
return baseProjectName + s;
} |
1e873b24-75f5-4a4a-baf2-0fe8f70b1026 | 2 | public void DeleteDir(String srcFolder) {
File directory = new File(srcFolder);
// make sure directory exists
if (!directory.exists()) {
System.out.println("Directory does not exist.");
System.exit(0);
} else {
try {
delete(directory);
} catch (IOException e) {
e.printStackTrace();
S... |
81ddbae4-7343-46f5-b024-28a54135a801 | 0 | public void setName(String name) {
this.name = name;
} |
22747364-1000-4190-b6a9-a34215ce90b8 | 5 | public void ListJobs() {
ListJobsRequest request = new ListJobsRequest()
.withVaultName(this.vaultName);
ListJobsResult result = AppCache.getClient().listJobs(request);
lastRetrievedJobs = result.getJobList();
int i = 1;
for (GlacierJobDescription job : l... |
242efde1-5fca-468e-8f78-9475883cba27 | 4 | public GamePanel(GameTable gameTable, TimePanel timePanel) {
this.gameTable = gameTable;
this.timePanel = timePanel;
this.words = gameTable.getWordsList();
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
setBackground(UIConstants.BackgroundColor);
setMinimumSize(DimensionMin);
setPreferredSize(Dimens... |
54a08a49-5e25-4da2-8d99-f206f6675026 | 0 | public static int getDocCount() {
return docCount;
} |
03a27c7e-9f36-4beb-b58d-d5f2b39139a6 | 2 | public static boolean isMagicPeerId(byte[] peerid) {
if (peerid==null) return false;
byte[] digest;
try {
digest = Torrent.hash(peerid);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return false;
}
int magic = (digest[digest.length-2] << Byte.SIZE) | digest[digest.length-1];
return... |
94e36ff1-a1f6-44d1-861c-41daa8bef7cf | 2 | public double[][] updateVelocities() {
for(int i = 0; i < velocities.length; i++){
for(int k = 0; k < velocities[i].length; k++){
velocities[i][k] = velocities[i][k] * inertiaWeight;
}
}
calculateVelocities();
limitVelocity();
return getVelocities();
} |
51dcd58f-903f-4d59-945c-5607e4d93c55 | 7 | public void SortPlayerGoals() {
Collections.sort(playerVector, (Player p1, Player p2) -> {
if (p1.getPosition().getPosID() == Position.PosID.GOALIE) {
if (p2.getPosition().getPosID() == Position.PosID.GOALIE) {
int shots = p1.getAssists() + p1.getGoals();
float perc1 = (shots == 0 ? 0 : (100 - (f... |
7be7431a-5d4a-4127-8783-921df570f837 | 2 | public void addAction(UndoableAction action) {
if (pos < QUEUE_SIZE) {
undoQueue[pos++] = action;
for (int i = pos; i < QUEUE_SIZE; i++)
undoQueue[i] = null;
} else {
UndoableAction[] tempQueue = new UndoableAction[QUEUE_SIZE];
System.arraycopy(undoQueue, 1, tempQueue, 0, QUEUE_SIZE - 1);
... |
7e696f7d-6adb-4050-8f33-26636ba20761 | 1 | private void renameButton()
{
JMenuItem renameItem = new JMenuItem("Rename");
renameItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent evt)
{
table.editCellAt(table.getSelectedRow(), 0);
if (table.getEditorComponent() != null)
... |
b83fa097-bd5f-4b3a-b4ff-d74ed7aaeaa0 | 7 | public int CreateVaultUserBatch(List<VaultUser> users)
{
int recAdded = 0;
String retval = null;
Connection con = null;
java.sql.PreparedStatement psVaultUser = null;
java.sql.PreparedStatement psLoginData = null;
String psVaultUserSql = "INSERT OR IGNORE INTO USERS (" +
"UserID,"+
"Email,"... |
6468acef-8662-4d89-a0e1-679e5137a6bf | 4 | public String createEvent(String username, String calendar, String description, Date start, Date end, String location) {
try {
java.sql.Timestamp sqlDateStart = new java.sql.Timestamp(start.getTime());
java.sql.Timestamp sqlDateEnd = new java.sql.Timestamp(end.getTime());
crs = qb.selectFrom("calendars").wh... |
8e551958-4ea3-45a1-bb35-92f4793cbf68 | 5 | @Override
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON3 && label.getOnCanvas()) {
label.erase(canvas.getCurrentLayer());
} else if (e.getButton() == MouseEvent.BUTTON1 && label.getOnCanvas()){
label.drawTile(canvas.getCurrentTile(), canvas.g... |
090c1c48-dd05-4ccd-961e-8f1e542701e0 | 6 | @Override
public boolean validMovement(double x1, double y1, double x2, double y2)
{
boolean move = false;
// 3,3 > 3,5
// vertical movement
if(x2 == x1 && (y2 < super.maxBoardSize && y2 >= super.minBoardSize))
{
move = true;
}
// 2,3 > 4,3
// horizontal movement
if(y2 == y1 && (x2 < super.maxBoa... |
6eff5f4f-cda2-4d37-b278-7ca752ad1f6b | 6 | public static Map<String, String> getList(String fileName) {
BufferedReader br = null;
String line;
Map<String, String> originalToModifiedStringMap = new HashMap<String, String>();
try {
br = new BufferedReader(new FileReader(fileName));
while ((line = br.readL... |
67d97ac3-591f-403d-9177-3065379628de | 3 | protected boolean storeRegistrationID(Sim_event ev, List list)
{
boolean result = false;
if (ev == null || list == null) {
return result;
}
Object obj = ev.get_data();
if (obj instanceof Integer)
{
Integer id = (Integer) obj;
list.... |
bc3083ca-6b4f-4054-9b19-59a893f86100 | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... |
b4865739-92c4-4dd4-9043-9e6d0a89004e | 1 | protected static void openOutlinerDocument(FileProtocol protocol) {
DocumentInfo docInfo = new DocumentInfo();
PropertyContainerUtil.setPropertyAsString(docInfo, DocumentInfo.KEY_PROTOCOL_NAME, protocol.getName());
// Select the file we are going to open.
if (!protocol.selectFileToOpen(docInfo, FileProtocol.... |
dd001c02-eb04-4378-8763-e538256de6b5 | 7 | public static String lenghtUnitIndexToString(int index) {
switch (index) {
case 0:
return "m";
case 1:
return "ft";
case 2:
return "mm";
case 3:
return "cm";
case 4:
retur... |
e33d7211-8a77-4b22-bfff-63c3cf826b5d | 4 | public void updateMap(Vector2 prev){
MenuObj m = getObj(prev);
if(m!=null) //hide previous
if(!m.hiLite)
m.hidden = true;
m = getObj(gs.cursor);
if(!m.hiLite) {
m.hidden = false; // show current
MenuObj t = getObj(new Vector2(6, 5));
if(t!=null) //update text
t.setText(dirMapping.get(m.ge... |
77450e50-4f1e-468c-b6b6-47d339528773 | 0 | public void setTipo(TipoSala tipo) {
this.tipo = tipo;
} |
e1f0c4f4-75b7-4e84-8bb2-094b781f9067 | 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... |
ed527e43-1ed8-4862-86ca-2e66a180da8c | 2 | @Override
public void run() {
try
{
while (!Thread.interrupted())
{
q.take().run();
}
} catch (InterruptedException e)
{
}
System.out.println("Finished PrioritizedTaskConsumer");
} |
b7155d0b-db07-42c3-9068-cce108a6b604 | 7 | public boolean isAdjacentTo(Persona persona)
{
return (((getLine() == persona.getLine()) && (getColumn() == persona.getColumn() + 1))
|| ((getLine() == persona.getLine()) && (getColumn() == persona.getColumn() - 1))
|| ((getColumn() == persona.getColumn()) && (getLine() == persona.... |
b14268da-ebc6-48bb-ad8b-ed5db362eec2 | 8 | public static void dfs(Node cur, boolean div, int acum, int level) {
acum += div ? 1 : 0;
Stack<Integer> s = new Stack<>();
for (int i = 0; i < cur.map.length; i++)
if (cur.map[i] != null)
s.push(i);
if (cur.finish)
ans += acum;
if (s.size() > 1)
while (!s.isEmpty())
dfs(cur.map[s.pop()], tru... |
12a82439-abd2-4148-931b-04160f29f3a7 | 3 | private ArrayList<Rod> trackBack(double[][] profits, int idCount, int length, ArrayList<Rod> rods) {
ArrayList<Rod> result = new ArrayList<Rod>();
while(idCount > 0) {
if(profits[idCount][length] != profits[idCount - 1][length]) {
result.add(rods.get(idCount));
length -= rods.get(idCount).getLength();
... |
a715e912-d9d1-40a7-8110-6a01bed3a7de | 5 | private void colorSchemeSetup() {
if(getConfig().getString("ColorScheme").equalsIgnoreCase("default")) {
prefix = ChatColor.DARK_AQUA + "[" + ChatColor.AQUA + pluginname + ChatColor.DARK_AQUA + "] " + ChatColor.GRAY;
text = ChatColor.GRAY + "";
SText = ChatColor.AQUA + "";
return;
} el... |
7a50fa67-2547-4b9f-921d-3929c6362bab | 9 | public static void update(){
for(BLWorld blworld:blworlds){
if(blworld.world!=null){
long time=blworld.world.getTime();
long timenight=12000;
int tick=0;
if(time>timenight){
if(!blworld.lampsoff.isEmpty()){
for(Lamp lamp:blworld.lampsoff){
tick++;
lamp.update(fals... |
81b7b87a-4df9-42f5-8c53-4bf45bc0e1bf | 5 | @Override
public void notifyLoggedIn(Credentials credentials, boolean loggedIn, boolean rememberMe) {
if (loggedIn) {
if (rememberMe) {
try {
CredentialsCodec.write(credentials);
} catch (IOException | GeneralSecurityException e) {
logger.warn("Failed to save credentials:", e);
}
} else {... |
ca68fefa-eda3-4715-baa5-7be2caca6866 | 6 | Class<?> getClassByName(final String name) {
Class<?> cachedClass = classes.get(name);
if (cachedClass != null) {
return cachedClass;
} else {
for (String current : loaders.keySet()) {
InjectorClassLoader loader = loaders.get(current);
tr... |
8170c23a-3f11-4d81-b7e4-9c7933c47b97 | 6 | private static int partition(Comparable[] a, int lo, int hi){
int i=lo, j=hi+1;
while(true){
//scan from left
while( Helper.less(a[++i], a[lo]) ){
if( i == hi ) break; //right bounds error check
}
//scan from right
while( Hel... |
8ed120d9-e4b2-4f8e-a969-c072ff35dacd | 5 | public Color get(int x, int y) {
if (x < 0 || x >= width()) throw new IndexOutOfBoundsException("x must be between 0 and " + (width()-1));
if (y < 0 || y >= height()) throw new IndexOutOfBoundsException("y must be between 0 and " + (height()-1));
if (isOriginUpperLeft) return new Color(image.ge... |
eab8a90b-0f44-4bb8-835b-a338707e10a6 | 9 | public Result combine(EvaluationCtx context, List parameters,
List ruleElements) {
boolean atLeastOneError = false;
boolean potentialDeny = false;
boolean atLeastOnePermit = false;
Result firstIndeterminateResult = null;
Iterator it = ruleElements.iterat... |
f09a29ed-4a8e-4711-accc-d601d9932044 | 1 | public MapObject(TileMap tm, World world, String uin) {
UIN = uin;
tileMap = tm;
tileSize = tm.getTileSize();
this.world = world;
currentAction = -1;
if(hasAnimation()){
animation = new Animation();
}else{
animation = new Animation();
BufferedImage[] bi = new BufferedImage[]{getEntityTexture(... |
e24400fe-7787-4b86-af06-91ab3d2b079f | 0 | public FindReplaceResultsModel getModel() {
return this.model;
} |
4009ae20-b5c4-4334-8e0f-fd64d679c75e | 3 | public void saveScheme() {
final String schemeFilePath = dlgDiscreteModel.open();
if (schemeFilePath != null) {
Yaml yaml = new Yaml();
BufferedWriter stream = null;
try {
stream = new BufferedWriter(new FileWriter(schemeFilePath));
str... |
a9cf4d96-fbd5-4941-8dfa-0153231ccb18 | 7 | private String typedHistoryChange(final String componentName, final String currentStr, final boolean undoCommand){
String popedStr = currentStr; //just for more clarity
java.util.Stack<String> typedHistoryUndoStack = typedHistoryByPanelsMap.get(componentName);
java.util.Stack<String> typedHisto... |
03bc0529-e264-44eb-b00d-8a1b3aa659b8 | 0 | public CheckResultMessage check15(int day) {
return checkReport.check15(day);
} |
e2af00b2-04f0-462d-abbc-2729ec1c5c81 | 6 | public static void main(String[] args) {
Scanner s = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
for(;;){
int x = s.nextInt();
if(x == 0){
break;
}
int width = (int) Math.log10(Math.pow(2, 2 * (x-1))) + 1;
... |
daa6afc7-641b-42d9-b978-6e76ffe7035c | 3 | public boolean debugCheckAssertOnly() {
assert nbArticles >= 0;
if ( nbArticles < 0 ) {
return incoherenceOuTrucBizarre();
}
assert nombreDeRonchonnements >= 0;
if ( nombreDeRonchonnements < 0 ) {
return incoherenceOuTrucBizarre();
}
assert (dateFin == 0) || (dateDebut < d... |
329bd1ad-a7fa-4563-8f1e-1817a1cefef5 | 1 | public void visit_putstatic(final Instruction inst) {
final Type type = ((MemberRef) inst.operand()).nameAndType().type();
stackHeight -= type.stackHeight();
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} |
ed8c7429-1e92-4067-9117-c9edc85604a6 | 8 | public void p_Nickname_abusive_Playforreal(
LinkedHashMap<String, LinkedHashMap<String, String>> credentials) {
autoutil.openBrowser(dataSheet(credentials,"url","url"));
autoutil.waitTime(8000);
autoutil.clickButton(dataSheet(credentials,"button","sign"),propFile("link"));
autoutil.waitTime(3000);
f... |
17bc3737-ed73-47b2-94d7-e203e3a1ccf2 | 9 | private void viewerPanel(JTabbedPane tabbedPane) {
JPanel xmlFilePanel = new JPanel();
tabbedPane.addTab("Database Viewer", null, xmlFilePanel, null);
GridBagLayout gbl_xmlFilePanel = new GridBagLayout();
gbl_xmlFilePanel.columnWidths = new int[] { 21, 38, 86, 0, 0, 0, 45, 86, 72, 0, 0, 34, 0 };
gbl_xmlFilePa... |
f534da97-5296-43f9-9a21-1367d94fc212 | 0 | public LabelBox(String text) {
setText(text);
setMinWidth(AppSettings.getDoubleValue("body.label.width"));
setPrefWidth(AppSettings.getDoubleValue("body.label.width"));
setMaxWidth(AppSettings.getDoubleValue("body.label.width"));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.