method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
d4866ce6-2d22-49da-9a4e-d286cb116251 | 0 | public LibrationODE(double a, double epsilon, double delta, double omega0) {
this.a = a;
this.epsilon = epsilon;
this.delta = delta;
this.omega0 = omega0;
} |
b43e37f1-cc31-47e9-816b-a977b1f849d0 | 6 | @EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
if(plugin.config.getBoolean("Apply.Enabled"))
{
Player player = event.getPlayer();
String pw = plugin.config.getString("Apply.Password");
String group = plugin.config.getString("Apply.Group");
... |
7b8c9590-88b5-4932-8847-ab779e84f40e | 9 | @SuppressWarnings("unchecked")
@Override
public void recoverCharStats()
{
baseCharStats.setClassLevel(baseCharStats.getCurrentClass(), basePhyStats().level()
- baseCharStats().combinedSubLevels());
baseCharStats().copyInto(charStats);
final Rideable riding = riding();
if (riding != null)
riding.affec... |
d3a11d45-8115-4644-a709-d9c3e891b9d0 | 3 | @Test
public void test() {
PersonnageService perso = new PersonnageImpl();
Random rand = new Random();
System.out.println("Tests de pré-condition non atteignable");
perso.init(0, 0);
System.out.println("Tests de couverture des postconditions de init");
assertTrue("Le personnage est mort après init", perso.... |
6ff57d4a-aa30-4cc8-b64c-5111f35c4b86 | 2 | private static SpriteSheet getSpriteSheet(String path, float scale) {
try {
SpriteSheet spriteSheet;
Color col = new Color(0, 0, 255);
Image img = new Image(path);
if (scale != 1) {
img = img.getScaledCopy(scale);
}
img.set... |
ae434392-9a8c-43a3-93dc-b85599bae1a0 | 1 | private void asetaJonoonArvollinen() throws IllegalStateException {
if (seuraavaArvollinen == null) {
throw new IllegalStateException();
}
nykyinenJono().lisaaSeuraavaArvollinen(seuraavaArvollinen);
this.seuraavaArvollinen = null;
} |
deee0647-cf35-4b20-872a-f6c8978ae6b1 | 1 | public void writeToDebugFile(String value) throws IOException {
if(debug) {
//append text to log
//text = Date + time + " || " + value
FileWriter write = new FileWriter(System.getProperty("user.dir") + "/" + debugFile + ".txt", true);
PrintWriter print_line = ne... |
73974c7b-f736-48f2-85e0-29149e547459 | 2 | public String getColumnName(int columnIndex) {
switch (columnIndex) {
case 0:
return "Name";
case 1:
return "Week Day";
}
return "";
} |
d5abb6e8-cfc0-4164-9b4b-ce1fc371d2c5 | 9 | public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Usage: java Chess input-file");
System.exit(0);
}
String inputFileName = args[0];
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(inputFileName));
} catch (IOException e) {
Syste... |
45322c84-5a61-4827-b6c0-2fd68bdbac0c | 0 | public String getrank() {//Accesses the Card's rank
return rank;
} |
322b2eb1-ff91-4dbd-ba71-ca6505c788a7 | 4 | public static Image createTransparentImageFromBitmap(
byte[] bytes,
int width,
int height) {
Display.check();
int pix[] = new int[width * height];
int index = 0;
int srcPos = 0;
int dstPos = 0;
int[] colors =
{
0x000ffffff,
0x0ffffffff,
0x0ff000000,
0x0ff000000 };
for (int y ... |
620b1f34-aed4-4fee-8c45-c02e8adfbadd | 2 | public static double getDoubleParameter(String key) throws CorruptConfigurationEntryException {
key = key.toLowerCase();
if(parameters.containsKey(key)) {
try {
return Double.parseDouble(parameters.get(key));
} catch(NumberFormatException e) {
throw new CorruptConfigurationEntryException("The entry '"... |
571174c2-6dcb-47c6-9110-a6bfd43d770a | 1 | public boolean isGameOver() {
return (board.numberOfPawns()==1)
|| (board.maxGold() >= 3);
} |
92bad23a-b1e3-4e98-9407-90561afb15ce | 2 | public User(String name) {
if (name == null || name == "")
throw new IllegalArgumentException();
this.name = name;
} |
68b3c81b-0a0d-4d7f-b5b7-91404379865c | 9 | public static void render(Item item){
int dialogWidth;
if(item.getName().length() > item.getDescription().length()){
dialogWidth = item.getName().length() * 8 + 20;
}else{
dialogWidth = item.getDescription().length() * 8 + 20;
}
// 20 + 12 * i (i = desc lines)
int dialogHeight = 20 + 12 * (item.... |
3641a23e-c199-43c7-9531-900fb0ada726 | 3 | @SuppressWarnings("unchecked")
public String getEventsLineChart() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT m.event_id, e.name, sum(m.auton_top)... |
a1d0d548-58c7-4185-9495-4b98ee0065be | 0 | private void especialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_especialActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_especialActionPerformed |
a66945db-d0da-48ff-bd31-43758d30f8c4 | 5 | private static void generateLeafs(){
for(int i = 0 ; i < Config.labels.size() ; i++){
ArrayList<Composant> list = Config.hash.get(Config.labels.get(i));
int j = 0 ;
while(j < list.size()){
Composant c = list.get(j);
System.out.println("\t " + c);
if(c.getList().size() == 1){
if(c.getList().... |
19a8538d-2fe3-49e2-84df-ff5d69eaa1ab | 3 | public static void doubleWalk(int current, boolean[] visited, UndirectedGraph ug, ArrayList<Integer> doublePath){
if(visited[current]){ return; }
doublePath.add(current);
visited[current]=true;
for(int i=0;i<ug.dist[current].length;i++){
int to=ug.dist[current][i];
if(!visited[to]){
doubleWalk(to,visi... |
e84d8870-1286-4739-a18a-c5e780763275 | 9 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
ArrayList<CompRequest> comp = new ArrayList<Com... |
0c3bf42c-1c77-49d3-a561-90ad05698ad3 | 4 | public ArrayList<Meeting> getMeetingNotificationsByUsername(String username){
ArrayList<Meeting> meetings = new ArrayList<>();
ArrayList<MeetingInvite> meetingInvites = meetingInvites().getMeetingInvitesByUsername(username);
for(MeetingInvite meetingInvite : meetingInvites){
Meeting... |
ba615e6a-d26d-4745-9b11-816d151800d6 | 3 | public void test_constructor1() {
OffsetDateTimeField field = new OffsetDateTimeField(
ISOChronology.getInstance().secondOfMinute(), 3
);
assertEquals(DateTimeFieldType.secondOfMinute(), field.getType());
assertEquals(3, field.getOffset());
try {
... |
b06306ba-a27a-42fb-9668-174249e74b01 | 8 | static int KMP(char[] p, char[] t) {
int i = 0, j = 0, m = p.length, n = t.length;
boolean palindrome = false, alindrome = false;
while (i < n) {
while (j >= 0 && t[i] != p[j])
j = b[j];
i++;
j++;
if (j == m) {
if (i == j)
palindrome = true;
else if (i != n)
alindrome = true;
... |
3d68ec42-16d6-44ca-9375-2e7831cd1f1a | 1 | private final List<Integer> getIntegerList (Object[] objList) {
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < objList.length; i++) {
list.add((Integer)objList[i]);
}
return list;
} |
99fa4177-efe9-4254-ba6c-0d8c99d8dfb4 | 2 | public void get(String url) {
try {
URI requestUrl = URI.create(url);
Map<String, List<String>> params = prepareParameters(requestUrl.getQuery());
String path = requestUrl.getPath();
if(!routes.containsKey(path)) {
System.out.println("No service found for path '" + path + "'!!!");
return;
... |
d8a82888-114b-4a49-b13a-72707211f399 | 3 | public void flipH() {
for (Connector c : connectors) {
if (c.getPosition() == Position.left)
c.setPosition(Component.Position.right);
else if (c.getPosition() == Position.right)
c.setPosition(Position.left);
}
} |
e82438a5-fd40-41b7-bc8c-7cd18c28d251 | 1 | public List<Class<? extends Pet>> types() {return types;} |
296778b7-3194-4d58-89fc-3b692a775916 | 0 | @Override
public void connectionLost(String message) {
c = null;
connectionSemaphore.acquireUninterruptibly();
System.out.println("[DcStation " + alias + "] Connection lost: " + message);
} |
241bdae7-2a40-4df6-8661-b41a3fb1dc28 | 0 | public void setPcaSecuen(Integer pcaSecuen) {
this.pcaSecuen = pcaSecuen;
} |
14b840c6-2517-4f6c-afeb-bf3064564113 | 3 | private void be(String label) {
if (verbose)
System.out.println("(Branch? " + (acc == 0 ? "YES" : "NO") + ")");
if (acc == 0)
index = branches.get(label) - 1;
} |
4d0c7a8a-b3a0-442d-a3e0-3ac955f2f586 | 0 | public static void main(String[] args) {
System.out.println(1 + 2); // 3
System.out.println(2 - 3); // -1
System.out.println(3 * 4); // 12
System.out.println(16 / 5); // 3
System.out.println(16 % 5); // 1
} |
52e7da80-1aa8-4a4d-8215-8bd9cf194499 | 4 | public Matrix plus(Matrix B) {
Matrix A = this;
if (B.M != A.M || B.N != A.N) throw new RuntimeException("Illegal matrix dimensions.");
Matrix C = new Matrix(M, N);
for (int i = 0; i < M; i++)
for (int j = 0; j < N; j++)
C.data[i][j] = A.data[i][j] + B.data[i]... |
7528a3ce-2e7e-4c59-8aaa-eefad9a33c2d | 9 | @Override
public List<SearchResult<SequenceMatcher>> searchForwards(final WindowReader reader,
final long fromPosition, final long toPosition) throws IOException {
// Initialise:
final int longestMatchEndPosition = sequences.getMaximumLength() - 1;
long searchPosition = fromPosi... |
b9c190a9-d23a-44f8-80aa-f706abb411ec | 0 | public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("[Sales:");
buffer.append(" id: ");
buffer.append(id);
buffer.append(" datetime: ");
buffer.append(datetime);
buffer.append(" total: ");
buffer.append(total);
buffer... |
1ebe5ade-c11a-471a-a3e8-64389839fe9e | 7 | @Nullable
public Table loadTable(@NotNull String name) {
if(tableCache.containsKey(name)) {
return tableCache.get(name);
}
int ignore = 0;
int attributesCount = 0;
int firstPage = 0;
List<Attribute> attributes = null;
for(Record rec: table) {
Map<Second... |
de2e83c5-a5a8-4a91-9532-5ce044b56c67 | 2 | private Repository getRepositoryFork(GitHubClient gitHubClient, Repository masterRepository) throws IOException {
Properties properties = ApplicationProperties.getProperties();
RepositoryService repositoryService = new RepositoryService(gitHubClient);
List<SearchRepository> searchReposi... |
5d41e2a5-2bd9-4346-8c34-56ec37422141 | 4 | public ArrayList<Integer> getMostConstrainedMeeting()
{
HashMap<Integer, ArrayList<Integer>> slotsForMeetings = this.SlotsForMeetings;
int minNumSlots = Integer.MAX_VALUE;
ArrayList<Integer> meeting = new ArrayList<Integer>();
for(Integer key: slotsForMeetings.keySet())
{
int numSlots = slotsForMeetings.g... |
03b05d72-3e0f-4044-aac4-495630cd0b49 | 5 | public AsciiImage execute(AsciiImage img) throws OperationException {
AsciiImage newI = new AsciiImage(img);
String[] lines = data.split("\n");
if(lines.length < img.getHeight()) {
throw new OperationException("Not enough lines");
}
for(int y = 0; y < lines.length; ... |
a77deab1-981d-438a-a284-4e37667c1340 | 1 | public void visiteurSuivant(){
int index = getVue().getjComboBoxVisiteur().getSelectedIndex()+1;
if(index== getVue().getjComboBoxVisiteur().getItemCount())index=0;
getVue().getjComboBoxVisiteur().setSelectedIndex(index);
} |
cb6b6300-f028-4a99-ac30-73834811ffb0 | 3 | public Integer GetCount(Stone Color) {
Integer retCnt = 0;
Pos workPos = new Pos();
for (int x = Common.X_MIN_LEN; x < Common.X_MAX_LEN; x++) {
workPos.setX(x);
for (int y = Common.Y_MIN_LEN; y < Common.Y_MAX_LEN; y++) {
workPos.setY(y);
if (getColor(workPos) == Color) {
retCnt++;
}
}
... |
2eeaece3-5738-4f8a-b070-e78f638c9db3 | 1 | public static String getAvailableTimeSlot(long[] aUid) {
TimeSlotHelper helper =
new TimeSlotHelper(DateUtil.getStartOfDay(TimeMachine.getNow()
.getTime()), 5);
for (long uid : aUid)
{
helper.removeByUser(uid);
}
return helper.toSentence();
} |
39af9870-4d5e-43da-b96d-916c0bc83bb1 | 4 | public void selectNextStream() {
int selectedRow = table.getSelectedRow();
int numberOfStreams = controlStreams.getStreamVector().size();
//no stream is selected
if(selectedRow == -1 && numberOfStreams > 0) {
selectedRow = 0;
} else if (selectedRow >= (numberOfStreams-1)) {
selectedRow = 0;
} else ... |
4b1e91c6-aa44-4dfc-8fc3-ba4d43c8bc81 | 8 | final public void AppExp() throws ParseException {/*@bgen(jjtree) AppExp */
SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTAPPEXP);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(LEFTB);
Expression();
Expression();
jj_consume_token(RIGHTB)... |
e6ec84ea-13ad-4e49-aa3e-32d61c012cf4 | 0 | public initiateRemoval()
{
this.requireLogin = true;
this.addParamConstraint("id", ParamCons.INTEGER);
this.addRtnCode(405, "permission denied");
} |
0dc594b1-2603-431c-87c3-4e9d2586b32e | 7 | protected MOB getCharmer()
{
if(charmer!=null)
return charmer;
if((invoker!=null)&&(invoker!=affected))
charmer=invoker;
else
if((text().length()>0)&&(affected instanceof MOB))
{
final Room R=((MOB)affected).location();
if(R!=null)
charmer=R.fetchInhabitant(text());
}
if(charmer==null)
... |
79783464-ee7c-4be7-a2ad-a8d6f8ba06e0 | 0 | public void setPopTerminal(String popTerminal) {
this.popTerminal = popTerminal;
} |
c25c42df-2a25-40be-958e-57af1b87f178 | 5 | private static boolean is2Pawn(final ChessBoardEntity board, final ChessmenEntity c, final PositionEntity p) {
boolean result = false;
for (int y = 0; y < 9; y++) {
ChessmenEntity cto = getChessmen(board, p.getX(), y);
if (null != cto) {
if (cto.isPlayer() && Type.Pawn == cto.getType() && !cto.isPromote()... |
6b796a3d-93de-4cfd-ba9e-b2c2c4f3af69 | 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... |
4543b1fb-28ac-4aeb-87e3-a133b0226fae | 0 | public void resume_ingress() {
++resume_ingress_count;
} |
61753c18-7187-4f96-9b7c-189851c3f393 | 7 | private void resetZoomButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetZoomButtonActionPerformed
diagramPanel.getScaleRatio()[0] = 1;
diagramPanel.getScaleRatio()[1] = 1;
diagramPanel.getScaleRatio()[0] = Math.max(0.3, getDiagramPanel().getScaleRatio()[0]);
d... |
63757f5d-90d6-4bcf-ae6f-d577c7e4d155 | 2 | protected boolean isOfType(final Object object) {
if (object instanceof CycList) {
return parse((CycList) object, false) != null;
} else if (object instanceof CycNaut) {
return parse((CycNaut) object, false) != null;
} else {
return false;
}
} |
054c6173-1f57-4f60-bfc1-b1f1199ab31c | 7 | public ListNode reverseBetween(ListNode head, int m, int n) {
if(head == null || head.next == null) return head;
ListNode preNode = new ListNode(0);
preNode.next = head;
ListNode ahead = head;
ListNode current = head;
for(int i=0; i<n-m; i++)
ahead = ahead.next;
for(int i=1; i<m; i++){
preN... |
db89c928-571c-446f-8ce5-73eaaf8906ae | 5 | @Override
public Measurement add(Measurement m) {
Connection conn = db.getConnection();
Vector<PreparedStatement> vps = new Vector<PreparedStatement>();
ResultSet rs = null;
try {
conn.setAutoCommit(false);
int measurementId = HomeFactory.getMeasurementHome().executeInsertUpdate(vps, m);
// wi... |
517131a9-528d-452b-979f-a9b68332ea3e | 0 | public boolean getAlwaysDrawGrouting() {
return alwaysDrawGrouting;
} |
6cc56d53-0276-4e39-ac3e-1509e6924b92 | 9 | public Value unaryOperation(final AbstractInsnNode insn, final Value value) {
int size;
switch (insn.getOpcode()) {
case LNEG:
case DNEG:
case I2L:
case I2D:
case L2D:
case F2L:
case F2D:
case D2L:
size = 2;
break;
case GETFIELD:
size = Type.getType(((FieldInsnNode) insn).desc).getSize();... |
bcb32bb3-db0f-4001-b482-7953ef32e36c | 2 | public final boolean isWalkable(final Point p) {
final Point point = sanitizeCoordinates(p);
if (point == null) {
return false;
}
if (wall.contains(point)) {
return false;
}
return true;
} |
aa41bedc-702e-4357-88e0-d185e29bcd9e | 9 | public static long S1() {
// S1: No student writes more than one exam in a time slot.
long numS1 = 0;
for(Student s : Environment.get().students.objects()){
// TODO: this is slow, is there a better than N^2 way to check this?
for(Lecture l1 : s.lectures){
if(l1.session == null) continue;
for(Lecture... |
ed930b9b-c520-455e-80f9-0ae156646d18 | 5 | protected boolean yObstacleAhead(double time) {
final int halfOfWidth = this.currentWidth / 2;
for (StaticObject so : AppFrame.getFrameDesign().getStaticObjects()) {
if (checkYObstacle(so, time, halfOfWidth)) {
if (obstacleReaction(so)) {
currentVerticalSp... |
61cf9638-0621-44b0-a668-8846f0516e7a | 2 | static private int[] permutation(int N) {
int[] a = new int[N];
// insert integers 0..N-1
for (int i = 0; i < N; i++) {
a[i] = i;
}
// shuffle
for (int i = 0; i < N; i++) {
int r = (int) (Math.random() * (i + 1)); // int between 0 and i
... |
46266285-502f-44e9-8958-c127ff8eb843 | 7 | static void scanJarForMatchingFiles(List<String> matchingFiles, File jarfile, Logger log) {
try {
JarFile jar = new JarFile(jarfile);
Enumeration<JarEntry> entries = jar.entries();
while (entries.hasMoreElements()) {
String name = entries.nextElement().toStrin... |
86295bec-3c05-470d-b5dc-5870f91d71b9 | 1 | public Transform getTransform()
{
if ( parent != null )
return parent.getTransform();
return new Transform();
} |
28f3236d-97b9-437d-8087-4a8967ea528b | 8 | public Frame11() {
try{
Class.forName(JDBC_DRIVER);
conn = DriverManager.getConnection(DB_URL,USER, PASS);
statement = conn.createStatement();
}catch(SQLException se){
se.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
setTitle("Blok E, 1 - 35");
setDefaultCloseOperation(JF... |
b7de0982-4166-4e66-97ff-efedebdd2b4a | 8 | @Override
public void update() {
if (attributes.get(primaryKey) == null) {
throw new NullPointerException("Can't update a non inserted object");
}
StringBuilder sb = new StringBuilder("UPDATE ");
sb.append(tableName).append(" SET ");
StringBuilder where = new Stri... |
2cc2b74a-6a39-405c-92a8-57adfbc8cffc | 9 | private void cargarSetAprendizaje(){
DefaultTableModel temp = (DefaultTableModel) this.tablaSetAprendizaje.getModel();
String csvFile = "dataset/diabetes_aprendizaje_quickpropagation.csv";
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
try {
double maximo0 = normalizacion.o... |
2547a0d3-9ac9-4fd7-a482-4cd0d79290fc | 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... |
acf35d80-9e71-4663-ab30-22027e4fea10 | 8 | private boolean satisfyNEGATE(Variable v0, Variable v1, Trail trail) {
IntDomain d0 = (IntDomain) v0.getDomain();
IntDomain d1 = (IntDomain) v1.getDomain();
if (d1.size() == 1) {
// v0 = -v1
int value = -d1.value();
if (!d0.contains(value))
return false;
if (d0.size() > 1)
v0.updateDomain(new... |
a85655b5-e3bc-4469-b293-43ab34273f60 | 3 | public JSONObject putOnce(String key, Object value) throws JSONException {
if (key != null && value != null) {
if (this.opt(key) != null) {
throw new JSONException("Duplicate key \"" + key + "\"");
}
this.put(key, value);
}
return this;
} |
ebf4893e-4e8c-4684-9043-2094b0245c14 | 3 | public JMenuItem createOpenItem() {
open = new JMenuItem("Open");
open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
open.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
if ... |
12d3dabd-511a-43e9-b20c-6423cd336b59 | 6 | public void clearship ()
{
switch (this.dir)
{
case 0: {
if (!this.invalid)
for (j=this.y1;j<this.y2;j++)
{
Battleship.getPlayers(Battleship.getYou()).setBboard(this.x1,j,null);
Battleship.getPlayers(Battleship.getYou()).setHitOrMiss(this.x1,j,false);
... |
5ae4b9d2-7c5d-4324-8469-ce1623f09858 | 9 | public static ListNode insertionSortList(ListNode head) {
if (head == null || head.next == null)
return head;
ListNode newHead = new ListNode(head.val);
ListNode pointer = head.next;
// loop through each element in the list
while (pointer != null) {
// insert this element to the new list
ListNode i... |
2ca37169-2b05-4f44-96fb-0cbdfffbf2d2 | 8 | public void addPedestrian(){
int n = rand.nextInt(4);
int m = rand.nextInt(2);
switch(n){
case Pedestrian.GO_DOWN:
if(m==0)
pedestrians.add(new Pedestrian(260, 0, Pedestrian.GO_DOWN));
else
pedestrians.add(new Pedestrian(412, 0, Pedestrian.GO_DOWN));
break;
case Pedestrian.GO_UP:
if(m==0)
... |
d12227ef-17ec-4590-b087-c254d0df2f97 | 6 | public void close() throws IOException {
if(r != null) {
r = null;
ogg.close();
ogg = null;
}
if(w != null) {
w.bufferPacket(info.write(), true);
w.bufferPacket(tags.write(), false);
long lastGranule = 0;
for(Sp... |
57d1113c-0aee-46ca-91b5-f1b2993e5fce | 8 | public static void abundantOTUToSparseThreeColumn(String abundantOTUClust, String outFile,
HashMap<String, String> sequenceToSampleMap) throws Exception
{
File in = new File(abundantOTUClust);
BufferedReader reader =
abundantOTUClust.toLowerCase().endsWith("gz") ?
new BufferedReader(new InputStreamRe... |
120675e8-ea10-417a-812b-802e78882652 | 9 | protected String stripData(StringBuffer str, String div)
{
final StringBuffer data = new StringBuffer("");
while(str.length()>0)
{
if(str.length() < div.length())
return null;
for(int d=0;d<=div.length();d++)
{
if(d==div.length())
{
str.delete(0,div.length());
return data.toString(... |
96ed7147-8fc0-4fa8-ac45-63261469aeb5 | 9 | protected ESBLogUtils(Class<?> clazz) {
if (!ESBServerContext.isProductMode()) {
StackTraceElement[] ste = Thread.currentThread().getStackTrace();
String className = ste[3].getClassName();
Class<?> callClazz = null;
try {
callClazz = Class.forName... |
6e4581bb-d7c0-4221-9751-cb9a7157d169 | 9 | @Override
public void processLine(InOutParam inOutParam) {
//Prepare output
LineOutput lineOut = new LineOutput();
try
{
//Remove "is" and "?"
String formattedLine = this.line.split("(\\sis\\s)")[1];
formattedLine = formattedLine.replace("?","").trim();
// search for all numerals for their v... |
619007ea-1c71-4032-b36a-d291fcfe4c8b | 4 | Module removeCommand(String name) {
if (null == this.commands || StringUtils.isEmpty(name)) {
return this;
}
if (null != this.commands.remove(name) && this.commands.isEmpty()) {
this.commands = null;
}
return this;
} |
10fc21af-93d6-4033-b3be-db6e2ea8608f | 7 | @Override
public String getPageTitle() {
String title = "";
if ((this.id >= 1) && (this.id <= 5)) {
title = " - partner projektu Bezpečné paneláky";
}
if (this.id == 4) {
title = " - elektrikár - Bratislava";
}
if ((this.id == 12) || (this.i... |
256aa872-c8d4-4010-9641-23a4e699d73a | 2 | public void run(boolean wait) {
// Create an Akka system
ActorSystem workQueue = ActorSystem.create("vcfWorkQueue");
// Create the master
ActorRef master;
if (masterClazz != null) master = workQueue.actorOf(new Props(masterClazz), "masterVcf");
else master = workQueue.actorOf(masterProps, "masterVcf");
... |
a7b0dcf7-6683-493e-94ca-79b33555e55f | 5 | private Point chooseRandomLocation() {
Point randomLocation;
ArrayList<Point> listOfEmptyLocations = new ArrayList<>();
Player[][] locations = this.board.getBoardLocations();
// create list of empty locations
for (int row = 0; row < locations.length; row++) {
Player... |
9c8fd64f-28b0-4d2f-962f-7b9feff8e548 | 0 | public String getIsKey() {
return isKey;
} |
ebd8e74e-8866-4f78-b942-2c6f10a18be2 | 3 | public char nextClean() throws JSONException {
for (;;) {
char c = next();
if (c == 0 || c > ' ') {
return c;
}
}
} |
64f00b16-76a5-43a4-897b-d14dbf1457d6 | 4 | public void stopMoving(Direction dir) {
boolean foundDir = false;
for(int i = 0; i < queuedMoveDirectionPreferences.length - 1; i++) {
if(!foundDir && queuedMoveDirectionPreferences[i] == dir)
foundDir = true;
if(foundDir)
queuedMoveDirectionPreferences[i] = queuedMoveDirectionPreferences[i + 1];
}
... |
501bdb2f-1708-4a49-bfd6-c78b606b34a9 | 8 | private static void handleMoveType3(PGNMove move, String strippedMove, byte color, byte[][] board) throws PGNParseException {
byte piece = WHITE_PAWN;
int fromhPos = getChessATOI(strippedMove.charAt(1));
int tohPos = getChessATOI(strippedMove.charAt(2));
int tovPos = strippedMove.charAt(3) - '1';
int fromvPos... |
24287c79-a9ed-4579-bd52-9237cac976cf | 1 | public List<String> tableNames(String schema) throws SQLException {
ArrayList result = new ArrayList();
ResultSet rs = statement.executeQuery(String.format(getTableStatement, schema));
while (rs.next()) {
result.add(rs.getString(1));
}
return result;
} |
a2c0b3b2-c884-4ace-9863-99062e6ff999 | 3 | public void setTarget(Slot target) {
switch (destAction) {
case (DEST_VISIBLE_TRUE): {
component.setVisible(false);
break;
}
case (DEST_VISIBLE_FALSE): {
component.setVisible(true);
break;
}
}... |
a735f988-4dbd-4b1a-a989-61fd81637967 | 1 | public void addShow(Show show){
if (show instanceof Movie){
movies.add((Movie) show);
}else{
theatricals.add((Theatrical) show);
}
} |
40cdd400-5310-4ce9-8dc5-4035b7a7bdde | 2 | public String useItem(int itemSlot)
{
if(inventory.hasItem(itemSlot))
{
if(inventory.getItem(itemSlot).getRoomUsedIn() == currentRoom)
{
String ret = inventory.getItem(itemSlot).getUsedDescription();
inventory.removeItem(itemSlot);
currentRoom.itemUsed();
itemRemove... |
69f4fea4-d12d-4704-aa70-a1911d04c5ec | 0 | public int getDepartmentId() {
return departmentId;
} |
c2af385f-1571-4392-b6bc-1af41f360b5b | 5 | public void firstDeal() {
this.dealerHand = new Hand(shoe.dealCard(), shoe.dealCard());
System.out
.println("====================================================");
System.out.println(">Dealer's visible card is: "
+ dealerHand.getHand().get(1).toString());
System.out.println("TESTING: DEALER'S SECON... |
25530ea6-5fb4-4f2b-9b62-ee7f4b4e4c50 | 4 | private void diceButtonListeners() {
diceButton.addMouseMotionListener(genericMouseMotionListener);
diceButton.addMouseListener(new MouseListener() {
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent... |
d8c48c0c-5656-4983-be47-f501113bf5d5 | 4 | public static void initialMgrsDisplay()
{
System.out.println("You've entered the Manager's verification.");
LoginDisplay.username();
Employee employee = LoginDisplay.getLoggedInEmployee();
if (employee.getAccessLevel().equalsIgnoreCase("Manager"))
{
System.out.print("Would you like Employee Management (E... |
e8e0ed5e-27d4-4e07-b71b-4d03f6b00655 | 2 | public boolean peutConsulter(Utilisateur utilisateur) {
return (utilisateur != null && utilisateur.getRole().getValeur() >= getConsultationRoleMinimum().getValeur()) || getConsultationRoleMinimum() == Role.Visiteur;
} |
88090354-b38e-4460-a9cf-e968e950a623 | 0 | @After
public void tearDown() {
} |
65996183-de0c-4a36-912e-2174ec8484e0 | 9 | @Override
public void printApplication(Employee employee, HttpServletResponse httpServletResponse, XMLGenerator xmlGenerator, Map<String, String[]> parameterMap, HttpSession httpSession)
{
udane = false;
String selectedOperation = null;
if (parameterMap.get("Dalej") != null)
{
... |
1c390876-801f-4092-a61d-e4ecc2e26473 | 1 | @Override
public Object getRoot()
{
if (document == null)
return null;
return new XMLNodeWrapper(document.getRootElement());
} |
771c7c02-a962-48e4-b3a5-60ab6566b9bb | 0 | private void handlePotentialConflicts(double[][] costs, int[] assigns, SegmentedImage A, SegmentedImage B){
//TODO: test some constants
List<MergeCell> merges = detectPotentialMerge(costs, assigns, A, B, .9);
List<SplitCell> splits = detectPotentialSplit(costs, assigns, A, B, .9);
//TODO: finish method
} |
9854bf8e-45f5-4e3d-ba19-b56f346c25cc | 1 | public String getReturnType() {
return returnType == null ? null : returnType.toString();
} |
23a2a1d6-4490-4d68-aee3-f6b13f6a0666 | 6 | public static void main(String[] args) throws Exception {
try {
if (args.length > 0)
Logger.setActivated(Integer.parseInt(args[0]) != 0);
if (args.length > 1)
Logger.setLogSuffix(args[1]);
} catch (NumberFormatException e) {
}
try {
Reader reader = new Reader();
while (true) {
reader.rea... |
0fc042b1-6573-4210-b986-f63dd6d08950 | 2 | public static String getKeyFromLock(String item) throws IOException{
String lock = sanitizeKey(item,1);
int len = lock.length();
//computing the key
String key = ""+(char)(lock.charAt(0) ^ lock.charAt(len-1) ^ lock.charAt(len-2) ^ 5);
for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.