method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
1d81532d-bd5d-421f-8a84-744d01a6a58c | 7 | private void expTypeChanged() {
if (m_Exp == null) return;
// update parameter ui
if (m_ExperimentTypeCBox.getSelectedItem() == TYPE_CROSSVALIDATION_TEXT) {
m_ExperimentParameterLabel.setText("Number of folds:");
m_ExperimentParameterTField.setText("" + m_numFolds);
} else {
m_Experi... |
1ee4b01e-6722-4c9d-9422-bb737c9b7bd1 | 2 | private double[] charToDouble(char[] responses){
int n = responses.length;
double[] converted = new double[n];
for(int i=0; i<n; i++){
double holdi = (double)((int)responses[i]);
if(holdi>96.0){
converted[i] = holdi-96.0;
}
else{
... |
7acc0b09-c0e3-4b1c-93de-bae6eecfa63a | 3 | public void drawCities(){
for ( int r = 0; r < GameConstants.WORLDSIZE; r++ ) {
for ( int c = 0; c < GameConstants.WORLDSIZE; c++ ) {
City city = game.getCityAt(new Position(r, c));
if (city != null){
CityFigure cf = new CityFigure(city,
... |
23058936-834f-4cc9-b4bb-95ec1fcd30ac | 8 | @Override
public boolean equals(Object obj) {
if (!(obj instanceof LabelBlock)) {
return false;
}
LabelBlock that = (LabelBlock) obj;
if (!this.text.equals(that.text)) {
return false;
}
if (!this.font.equals(that.font)) {
return fal... |
59d1c2f2-b424-4c6f-a337-ef0469c27d18 | 1 | private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
currentRound++;
jLabel7.setText(g.makeThrow(2));
jLabel3.setText(g.getScore());
jLabel6.setText(g.getPredictedThrow());
if(currentRound == numberOfThrows) {
JOptionPane.showMessageDialog(this, "Final Score: " + g... |
4a7bb636-317c-49d6-98d1-c483d88a48b9 | 3 | public char skipTo(char to) throws JSONException {
char c;
try {
int startIndex = this.index;
int startCharacter = this.character;
int startLine = this.line;
reader.mark(Integer.MAX_VALUE);
do {
c = next();
if (c... |
fe8668f1-4b68-4c02-b43d-808c45908378 | 4 | private static void doArchive() throws MVDException
{
try
{
MVD mvd = loadMVD();
File m = new File( mvdFile );
File archiveDir;
XMLGuideFile guideFile = new XMLGuideFile( mvd );
// create default archive name
if ( archiveName == null )
{
archiveName = m.getName();
int index = archiveNa... |
13b627b3-eb27-489a-9fc8-2a58370b5c85 | 0 | int getId()
{
return id;
} |
9e62e4e7-ee12-4e7b-9447-83dcbef00e1e | 8 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Note note = (Note) o;
if (id != note.id) return false;
if (headLine != null ? !headLine.equals(note.headLine) : note.headLine != null) return f... |
96409357-5450-46e8-a5d8-7b7d0f3f9b60 | 2 | public Deck() {
cards = new ArrayList<DevCard>(25);
for (int i = 0; i < 14; i++)
cards.add(new DevCard("Knight"));
cards.add(new DevCard("Progress", "Road building"));
cards.add(new DevCard("Progress", "Road building"));
cards.add(new DevCard("Progress", "Year of plenty"));
cards.add(new DevCard("Prog... |
03e31afa-5d34-4f7c-98e1-ea2bba950a44 | 2 | public static int nextSequenceNumber(int sequenceNumber) {
if(sequenceNumber == Packet.SEQUENCE_NUMBER_NOT_APPLICABLE || sequenceNumber == Packet.MAXIMUM_SEQUENCE_NUMBER)
return Packet.MINIMUM_SEQUENCE_NUMBER;
return sequenceNumber + 1;
} |
095e1e8d-71d5-4ebf-b4a3-dbaa884e6a57 | 0 | public Quicksort(int[] values) {
this.numbers = values;
} |
8ec015b8-0b81-4ecc-9d6a-fb13656e75ee | 2 | public void addItem(Item item) {
for(int x = 0; x<size; x++) {
if(items.get(x).getID() == 0) {
items.set(x, item);
break;
}
}
} |
138fb613-9016-4068-9fbd-9a1413cd194c | 4 | public String toString()
{
String rankStr = null;
if(rank == 11)
{
rankStr = "jack";
String str = rankStr+suit;
return str;
}
else if(rank == 12)
{
rankStr = "queen";
String str = rankStr+suit;
return str;
}
... |
35cdd763-30f5-41a8-a545-23c8efa9d8d7 | 7 | @Override
public int read(char cbuf[], int off, int len) throws IOException {
// System.out.println("read() off:" + off + " len:" + len);
// Fetch new line if necessary
if (curLine == null) {
getNextLine();
}
// Return characters from current line
if (cur... |
88834f4f-d3ff-458c-ae5e-41aa6dd60d0c | 1 | @Override
public void run() {
try {
String dur=null;
int[][] A = new int[cnt][cnt],B=new int[cnt][cnt],C=new int[cnt][cnt];
int_mat(A);
int_mat(B);
long start=System.currentTimeMillis();
integer_operation(A, B, C);
long end=System.currentTimeMillis();
dur=end-start+"";
Syst... |
8510e628-772e-460c-8230-ca1641638a8f | 6 | @Override
public void actionPerformed(ActionEvent event) {
String userkey = projectName.getText().toString();
String mess = p_dao.saveProject(userkey);
if(event.getActionCommand().equals("Add")){
if(!userkey.equals("")) {
message.setText(mess);
projectName.setText("");
if(mess.contain... |
7be59751-eb30-4ebf-9d78-166ac35f91c3 | 7 | private void buildTranslationTable(BufferedReader buf) throws IOException {
translationTable = new Hashtable<String, String>();
String line = buf.readLine();
while(line!=null && ! line.contains(";")) {
String[] parts = line.split("\\s+");
if (parts.length>2) {
int index = 0;
while(index<parts.len... |
720b599e-1ab9-481a-a29e-6b0f14001ba5 | 3 | public static void main(String [] args){
String path = new String("/home/elblonko/Desktop/DICOMFiles/BRAINIX/sequence/IM-0001-0001.dcm");
//Number of files in the path
File fileDir = new File("/home/elblonko/Desktop/DICOMFiles/BRAINIX/sequence");
int numFiles = fileDir.listFiles().leng... |
900910c2-5f61-49d1-abd1-7301efdb28c1 | 8 | public int compare(Object d1, Object d2) {
//put non display modes at bottom
if(!(d1 instanceof DisplayMode)) {
return 1;
}
if(!(d2 instanceof DisplayMode)) {
return 1;
}
//now compare bit depth and resolution
... |
932222bc-c029-4ad3-8ae6-724ad10a0cda | 7 | public boolean SetBusActiveStatus(int busNumber, int inputBufferNumber, int packetSequence, int TIME, ConfigFile cfg)
{
//REMOVE IN CROSSBAR FABRIC TYPE
//only one bus present in this fabric type,
busNumber = 0;
//ensure valid busNumber chosen
//if(((busNumber+1)<= ... |
b07edf03-69d7-4a80-a5be-846fda322eec | 3 | public boolean estVoisin(Region r)
{
int i = 0;
while ((r.nom != voisins[i].nom) && (i != voisins.length))
{
i++;
}
if (!(r.nom == voisins[i].nom))
return false;
return true;
} |
0b122052-282c-44de-83fb-7bae5b7dcde3 | 6 | private String[] getEnabled() {
enabledMods.clear();
if(folder.exists()) {
for(String name : folder.list()) {
if(name.toLowerCase().endsWith(".zip")) {
enabledMods.add(name);
} else if(name.toLowerCase().endsWith(".jar")) {
enabledMods.add(name);
} else if(name.toLowerCase().endsWith(".lite... |
15f7ed5a-d0f1-42e6-9bc7-eb5f0f56c4b4 | 3 | public ManaCrystal getClosestCrystal(Point point) {
double min = Double.POSITIVE_INFINITY;
ManaCrystal closestManaCrystal = null;
for(ManaCrystal manaCrystal : manaCrystals) {
if(manaCrystal instanceof ManaCrystal) {
if(Geometry.squareDistance(point, manaCrystal.getPoint()) < min) {
min = Geometry.squ... |
fd8e3003-6291-4db7-8340-6d5035b5a938 | 0 | public static String getSig() {
StackTraceElement st = (new Throwable()).getStackTrace()[1];
return st.getClassName() + "#" + st.getMethodName();
} |
542a7f2d-53f7-4ce1-bc7a-85f14494e4fa | 6 | @Override
public String toString()
{
String result = "\tHandicap Situation:";
if(problemWithFontSize)
result = result + "\n\t\tPROBLEM WITH FONT SIZE!";
if(problemWithMagnification)
result = result + "\n\t\tPROBLEM WITH MAGNIFICATION!";
if(problem... |
3067ebf7-ba52-4db7-aeff-4d9ed1803d83 | 9 | private RequirementElement parseReqElementInfo(List<String> factors) {
/*
* this part is exclusively for requirement elements 0)notation,element;
* 1)id,51670; 2)shape,Hexagon; 3)name,Calculate price;
* 4)layer,Business; 5)thickness, 1.0; 6)double stroke; 7)size:
* 117.945899963379 43.817626953125; 8)no f... |
25a23568-30fe-46ab-8786-f20bd4508c25 | 4 | public void mouseWheelMoved (MouseWheelEvent event)
{
if (!(doorgaan_thread) && (doorgaan_wheel)) // deze methode alleen uitvoeren als de thread uitstaat EN
{ // 'het verplaatsen mbv het wieltje' aan
int ticks = event.getWheelRotation(); // wat levert dit op?
... |
ff9598bf-0360-42e7-9e82-3640b3c62603 | 3 | @Override
public WriteMsg write(long txnID, long msgSeqNum, FileContent data)
throws RemoteException, IOException {
String fileName = data.getFileName();
// if this is the first message, we obtain a lock on file first
if (msgSeqNum == 1) {
Semaphore lock = null;
if (!fileLock.containsKey(fileName)) {
... |
82b109a7-0cb2-423c-a62e-f3dedacb75ef | 0 | public boolean hasNext() { return current != null; } |
5cbd6c23-4ed3-4260-a91e-4a7d2c095ce9 | 1 | static void mergeTryCatch(FlowBlock tryFlow, FlowBlock catchFlow) {
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_ANALYZE) != 0)
GlobalOptions.err.println("mergeTryCatch(" + tryFlow.getAddr()
+ ", " + catchFlow.getAddr() + ")");
tryFlow.updateInOutCatch(catchFlow);
tryFlow.mergeSuccessors(catchF... |
f790ca78-c719-456d-a3cf-d44506aa7fe5 | 9 | @POST
@Path("/{algorithm}/{provider}/list")
@Consumes(APPLICATION_JSON)
public String list(@PathParam("algorithm") String algorithm, @PathParam("provider") String provider,
String keystoreAndPassword) {
InputStream inputStream = null;
try {
KeyStore keySto... |
ba4a6344-9ac0-49bd-a74f-6f24fca97525 | 5 | @Override
public void selectElement() {
assert isInitialized : "Menu not initialized";
Choice pointedChoice = Choice.values()[getPointedElementId()];
switch (pointedChoice) {
case RETURN:
close();
break;
case USE:
setChanged();
... |
fb98c9f5-a1d0-41d7-85b3-a00815862a54 | 7 | @Test
public void getBeansWithObjectAndAnyQualifierShouldReturnGenericBeans() {
final Collection<Object> beans = beanLoader.getBeans(Object.class, "any");
assertNotNull(beans);
assertEquals(BeanCount.SCANNED.getNumberOfBeans(), beans.size());
boolean foundListOfOneStuffBean = false... |
d600f42e-e9cf-4292-ad7c-ed8d58f6f6ad | 0 | public NotFunc() {
setLayout(new BorderLayout(0, 0));
JButton btnSorrynotImplementedYet = new JButton("sorry,not implemented yet (not enough time ; < )");
btnSorrynotImplementedYet.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
MainFrame.cardLayout.show(getParent()... |
36c04f93-2ad5-4fe0-8793-a85e890f2456 | 8 | private void flushFlags(int totalFields, int[] fieldNums) throws IOException {
// check if fields always have the same flags
boolean nonChangingFlags = true;
int[] fieldFlags = new int[fieldNums.length];
Arrays.fill(fieldFlags, -1);
outer:
for (DocData dd : pendingDocs) {
for (FieldData fd... |
2f003a34-8fe8-4417-aba9-fa8aec7c3354 | 6 | private int get() throws IOException {
if (start > end) {
if (end > BACK) {
int len = Math.min(BACK, end - BACK + 1);
System.arraycopy(buf, end + 1 - len, buf, BACK - len, len);
back = BACK - len;
}
if (in != null) {
if (!in.markSupported()) in = new BufferedInputStream(in);
this.reader ... |
5ef091a1-c327-4891-8c72-12e66e6bf8df | 3 | public Node<Integer> findKthToLastElemItr(Node<Integer> head, int k) {
Node<Integer> p = head;
for (int i = 0; i < k - 1; i++) {
if (p == null)
return null;
p = p.next;
}
Node<Integer> q = head;
while (p.next != null) {
p = p.next;
q = q.next;
}
return q;
} |
96af6d69-a792-4e7a-ba62-f8b766c3f7da | 7 | public static boolean createContactAccount(int index, String contactID, String label, String nymID, String acctID, String assetID, String serverID, String serverType, String publickey, String memo) {
System.out.println("createContactAccount contactID:"+contactID);
boolean status = false;
Address... |
b472fcc3-4b06-49b3-a2e0-466dacfc67ea | 2 | public void create( int subdivisions, Vector3f p1, Vector3f p2, Vector3f p3, Vector3f p4 )
{
if ( subdivisions <= 0 )
{
if ( pok % 2 == 0 )
{
triangles.add( new Triangle( p3, p1, p4 ) );
triangles.add( new Triangle( p4, p1, p2 ) );
}
else
{
triangles.add( new Triangle( p1, p2, p3 ) );
... |
42b0d3f1-edd6-42b2-bff0-54ff2ef09c46 | 1 | public ArrayList<Molecule> split(int[] MoleculeID){
ArrayList<Molecule> fragments = new ArrayList<Molecule>();
int len = (Arrays.equals(MoleculeID, new int[0])) ? 0 : MoleculeID.length;
Molecule splitPoint = getFromMoleculeID(MoleculeID, MoleculeID.length, 0);
//System.out.println("S... |
f63dffae-eb01-447e-ac7a-47aa09d552b9 | 9 | public static int value(tile input) {
int output = 0;
for (int y = -1; y < 2; y++) {
for (int x = -1; x < 2; x++) {
if (x != 0 || y != 0) {
if (input.getX() + x >= 0 && input.getX() + x <= 9
&& input.getY() + y >= 0 && input.getY() + y <= 9) {
if (board[input.getX() + x][input.getY() + y].g... |
0337cd8e-d172-4f41-b581-d070cb9916e4 | 2 | public void update(GameContainer gc, StateBasedGame sbg, int delta)throws SlickException
{
if(!isGameOver)
{
if(!isPause)
{
}
else
{
}
}
else
{
}
} |
e67edd37-22bd-4fbe-98e6-35a5265bd957 | 0 | public List<Partner> findPartnersByHallEventIdAndRoleName(
final Long hallEventId, final String partnerRoleName
) throws WrongTypeNameException {
return new ArrayList<Partner>();
} |
450b4431-0855-47e7-a7ba-a017255ade7b | 6 | public int move(int d, boolean findChange) {
if (d == 0) return moveDown(findChange);
if (d == 1) return moveLeft(findChange);
if (d == 2) return moveUp(findChange);
if (d == 3) return moveRight(findChange);
if (d > 3 || d < 0) System.err.println("Invalid move");
return -... |
ccf2bf0f-a49c-42d8-ac90-349058dfcccd | 5 | private Object readBinding(Object source) {
try {
if (source == null) {
return null;
}
if (this.pathName == ".") {
return source;
} else {
return source.getClass().getMethod("get" + this.pathName).invoke(source);
... |
dd7e5964-2c07-48f5-80cb-29b79c700d2a | 8 | @Override
public Object getValueAt(Object object, int row, int col) {
Prestamo prestamo = (Prestamo) object;
try {
if (col == 0) {
return prestamo.getUsuario().getDNI();
} else if (col == 1) {
return prestamo.getUsua... |
c4664e65-f0e5-4d94-baad-404652e09c57 | 4 | public int[] returnInts () {
int itotal=totalLength/8;
int out[]=new int[itotal];
BitSet bset=new BitSet();
int a,tc=counter,bcount=0,ocount=0;
for (a=0;a<totalLength;a++) {
if (this.get(tc)==true) bset.set(bcount);
else bset.clear(bcount);
bcount++;
if (bcount==8) {
out[ocount]=binaryToInt8(b... |
8a406f95-0000-4355-9e0a-841bc4b7f9b8 | 8 | public static void markText(JTextComponent pane, int start, int end, SimpleMarker marker) {
try {
Highlighter hiliter = pane.getHighlighter();
int selStart = pane.getSelectionStart();
int selEnd = pane.getSelectionEnd();
// if there is no selection or selection do... |
acc5be32-df1b-48a3-a26b-146e6e0bedc8 | 2 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((base == null) ? 0 : base.hashCode());
result = prime * result + ((seed == null) ? 0 : seed.hashCode());
return result;
} |
c655174e-05a0-4d97-98a8-bd006431d283 | 8 | @Override
public boolean tick(Tickable ticking, int tickID)
{
if(!(affected instanceof MOB))
return super.tick(ticking,tickID);
final MOB mob=(MOB)affected;
if(tickID!=Tickable.TICKID_MOB)
return true;
if(!proficiencyCheck(null,0,false))
return true;
if((mob.curState().getHunger()<=0)
||(mob.c... |
53ec3d25-c6d6-47dd-af66-2fe44e121b5e | 4 | protected Behaviour getNextStep() {
if (lead == null) findLead() ;
if (expired()) {
//I.say(actor+" performance has expired...") ;
return null ;
}
if (client != null) {
final Recreation r = new Recreation(client, venue, type) ;
if (client.matchFor(r) == null) {
final Acti... |
cce23613-db9c-4ae5-9212-f85d67dd66c7 | 4 | public void treatBackstageOnly(Item item){
if (item.isLessSellInThan(11) && item.isLessQualityThan(50)) {
item.increaseQuality();
}
if (item.isLessSellInThan(6) && item.isLessQualityThan(50)) {
item.increaseQuality();
}
} |
b7bd1520-b242-4069-8e91-472d0175680d | 6 | public static RepNotification GET_NOTIFICATIONS(OVNotification oVNotification) throws SQLException {
RepNotification rep = new RepNotification();
Connection connexion = GET_CONNECTION();
try {
int distance = oVNotification.getDistance();
int major = oVNotification.getOvB... |
13cf75cd-0f9e-49f3-92fc-4f0e34384f89 | 5 | private String keyToString(JsonElement keyElement) {
if (keyElement.isJsonPrimitive()) {
JsonPrimitive primitive = keyElement.getAsJsonPrimitive();
if (primitive.isNumber()) {
return String.valueOf(primitive.getAsNumber());
} else if (primitive.isBoolean()) {
return Boo... |
50de1e20-2ca4-4792-8567-3dfbb31d68ac | 2 | void copyIso8859_1ReadBuffer(int count)
{
int i, j;
for (i = 0, j = readBufferPos; i < count; i++, j++) {
readBuffer[j] = (char) (rawReadBuffer[i] & 0xff);
if (readBuffer[j] == '\r') {
sawCR = true;
}
}
readBufferLength = j;
} |
fe8e59ad-2d5c-4cb1-9ab4-351325f6613d | 9 | public void build () throws ExceptionInvalidParam
{
if ( upperXBound <= lowerXBound
|| upperZBound <= lowerZBound
|| destWidth <= 0
|| destHeight <= 0
|| sourceModule == null
|| destNoiseMap == null)
throw new ExceptionInvalidParam ("Invalid ... |
f90a098b-fc4a-4458-b41d-58dedb873d90 | 4 | public static void move(int d) {
if (d == 0) {
System.out.println("down");
Main.fenrir.pressKey(40);
} else if (d == 1) {
System.out.println("left");
Main.fenrir.pressKey(37);
} else if (d == 2) {
System.out.println("up");
M... |
31a126b1-cc4a-4077-88ae-af82d935625a | 7 | public void updateInterventionForce() {
Specification spec = getSpecification();
int interventionTurns = spec.getInteger("model.option.interventionTurns");
if (interventionTurns > 0) {
int updates = getGame().getTurn().getNumber() / interventionTurns;
for (AbstractUnit un... |
fb425a4a-bf47-48b6-963e-ce54c3683a0f | 3 | private void deleteSelected() {
if (JOptionPane.showConfirmDialog(frmDictionaryEditor, Localization.getInstance().get("messageConfirmEntryDelete")) != JOptionPane.OK_OPTION) {
return;
}
try {
for (Long id : getSelectedIDs()) {
dic.deleteEntry(id);
}
} catch (Exception ex) {
showError(Localizatio... |
cc29204c-90c6-4eb0-9d54-d8faf43518ad | 5 | private void render() {
if (this.world != null) {
Iterable<Chunk> chunks = this.world.getLoadedChunks();
for (Chunk chunk : chunks) {
for (int section = 0; section < 8; section++) {
if (chunk.getVboId(section) == 0) {
int vboId = glGenBuffersARB();
chunk.setVboId(section, vboId);... |
21af392a-7736-4e8e-bd13-983ff51a0c0e | 0 | public ListenerThread(ActiveMQConnectionFactory factory,
ConcurrentMap<String, MessageAdaptor> messageResponse, String topic) {
this.factory = factory;
this.messageResponse = messageResponse;
this.topic = topic;
} |
738250a8-159a-4f71-9fd9-d6d38b2f4fbc | 2 | private int swim(int i)
{
Key t = pq[i]; // Save key for later restoring
while (i > 1 && greater(pq[i / 2], pq[i]))
{
// exch(pq, i / 2, i);
pq[i] = pq[i / 2]; // half exchanges
i = i / 2;
}
pq[i] = t; // restore key
return i;
} |
51465807-730d-4564-8321-071c58e58d5d | 2 | public Map load(String path, Sprite sprite)
{
try
{
inputStream = new FileInputStream(new File(getClass().getResource(path).toURI())); //Some crap to read file
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
byte[] data = ... |
31cd4122-1da1-4db0-a235-b1e8d24af9b8 | 1 | public boolean isWide() {
return (desc.charAt(0) == Type.LONG_CHAR)
|| (desc.charAt(0) == Type.DOUBLE_CHAR);
} |
eca57659-4170-47a5-9b9f-5fc7bb3bd847 | 4 | Subject[] generateSubjectGroup(int size, int[] code, int[] slot, String[] name){
Subject[] s = new Subject[size];
ArrayList<Subject> arr = new ArrayList<>(size);
int t = 1;
for(int i=0; i<size; i++){
int k = (int)(size * Math.random());
arr.add(new Subject(code[k ... |
502259ec-5283-409f-b32b-4ad66dcce212 | 9 | @Override
public void iterate() {
try {
if (isAllyControlled()) {
targets = renderer.getEnemyShips();
} else {
targets = renderer.getAllyShips();
}
} catch (NullPointerException ex) {
this.setRemovable();
}
... |
6a36ae7d-6647-473b-b630-e52e4c8ac5a5 | 5 | @Override
// KEY LISTENER FUNCTIONS
public void keyPressed(KeyEvent e) {
int keyCode = e.getKeyCode();
if(keyCode == KeyEvent.VK_LEFT){
mainPlayer.setLeft(true);
}
if(keyCode == KeyEvent.VK_RIGHT){
mainPlayer.setRight(true);
}
if(keyCode == KeyEvent.VK_UP){
mainPlayer.setUp(true);
}
if(keyCo... |
42e9e800-b99d-4e6b-9d2f-293a3c543620 | 7 | private void printEntitiesInNary(ORASSNode node, String naryRelName, List<String> entities, int currEntityIndex, int numOfTabs) {
String entityName = node.getName();
writer.println(getTabs(numOfTabs) + "<xs:element name=\""+entityName+"\" minOccurs=\"0\" maxOccurs=\"unbounded\">");
writer.println(getTabs(numOf... |
bcbb5d14-488d-4730-b2bc-b56b47da259d | 8 | protected void initDefaultStyle() {
if(this.styleMap == null) {
this.styleMap = DefaultStyle.getDefaults();
}
//background
if(!styleMap.containsKey(BACKGROUND_KEY))
styleMap.put(BACKGROUND_KEY, new Color(209,215,226));
//header title font
if(... |
8e18ddcc-60db-4133-9a87-c26757e9faa5 | 4 | public static void filledEllipse(double x, double y, double semiMajorAxis, double semiMinorAxis) {
if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative");
if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative");
double ... |
50ccf6f5-6c55-47e1-9ab2-25367fbfbf6a | 2 | public State[] getUnreachableStates() {
ArrayList list = new ArrayList();
State[] states = myAutomaton.getStates();
/** Create nodes for DFS. */
initializeNodes(states);
Node initialNode = getNodeForState(myAutomaton.getInitialState());
/** Start DFS at node representing initial state. */
visit(initialNo... |
9cebc22c-3134-46b7-95c9-c4ad22697697 | 2 | public static synchronized void updateDynmapVersion(String dynmapVersion) {
if (Main.dynmapVersion != null) {
if (!Main.dynmapVersion.equals(dynmapVersion)) {
logger.error("You use different Versions of Dynmaps");
System.exit(-1);
}
} else {
... |
6e391879-b2d4-4e92-b959-4c02fd607434 | 7 | public void doINTERPRET(){
try{
System.out.print("> ");
in.readLine();
String curWord = null;
while((curWord = in.getNextWord()) != null){
int word = dict.find(curWord);
if(word != -1){
if(state == STATE_INTERP){
dict.runWord(word, this);
}else... |
53fa1d91-20c6-4542-afc7-320c0c3ef096 | 7 | private int yy_advance ()
throws java.io.IOException {
int next_read;
int i;
int j;
if (yy_buffer_index < yy_buffer_read) {
return yy_buffer[yy_buffer_index++];
}
if (0 != yy_buffer_start) {
i = yy_buffer_start;
j = 0;
while (i < yy_buffer_read) {
yy_buffer[j] = yy_buffer[i];
++i;
... |
2e03d9f2-3853-4469-9542-fa137fca933e | 9 | public DotBracketNotation(Sequence aSequence, String aDotBracketNotation)
throws InvalidDotBracketNotationException {
if (aSequence.getLength() != aDotBracketNotation.length()) {
throw new InvalidDotBracketNotationException(
"Sequence and dot bracket notation are not the same length.");
}
if (!this.is... |
30a8ccb1-dbf6-4469-b895-237ca56ac88c | 8 | StructInfo(Class<?> clz)
{
this.clz = clz;
Field[] fields = clz.getDeclaredFields();
List<FieldMarshal> required = new ArrayList<FieldMarshal>();
for (Field i : fields)
{
boolean ignore = Modifier.isStatic(i.getModifiers()) ||
... |
0b91d66f-e4b2-4ed3-8ce7-def5a995fd3f | 2 | public String getSqlStatement() throws ParseException, IOException {
StringBuilder sb = new StringBuilder();
// for (int k = 1; k <= 1; k++) {
for (int k = 1; k <= 66; k++) {
for (int chapter = 1; chapter <= CHAPTER_COUNT_1TO66[k]; chapter++) {
String str = g... |
a82d367e-705f-48fa-aa98-4a1313cb9e16 | 4 | public static AutomatonTable getConnections(Map<Integer, ZState> states){
List<Connection> connections = new ArrayList<>(states.size());
List<String> ids = new ArrayList<>();
List<boolean []> codes = new ArrayList<>();
AutomatonTable table = new AutomatonTable();
table.c... |
25fb1c78-b471-4bb7-895c-73cc15698954 | 0 | @Override
public String getSex() {
return super.getSex();
} |
9755165b-a3b9-4160-8945-b3ddf0b79c80 | 3 | public synchronized void update(long timePassed) {
if (scenes.size() > 1) {
movieTime += timePassed;
if (movieTime >= totalTime) {
movieTime = 0;
sceneIndex = 0;
}
if(movieTime > getScene(sceneIndex).endTime) {
scene... |
d2137ae0-877f-4f56-840e-f3696c4e6850 | 8 | public static void main(String args[]) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int circle = 1; ; circle++) {
int number = Integer.parseInt(reader.readLine());
if (number != 0) {
String currentStr = reader.readLine();
System.out.println... |
d578a495-f743-4f97-94a6-4c83e8623ee3 | 4 | protected Script createAddScript(Path resourcefile, List<ResourceVO> resources, Path resHackerLog) {
assert (resourcefile != null) && (resHackerLog != null);
assert (resources != null) && !resources.isEmpty();
List<String> sb = new LinkedList<>();
Iterator<ResourceVO> i = resources.list... |
97ab6d4e-c6e4-4139-b512-23c8515d1dd2 | 6 | public void move()
{
switch(direction)
{
//1 Up/Left
case 1:
{
TLY -= DY * localG.delta;
TRY -= DY * localG.delta;
BLY -= DY * localG.delta;
BRY -= DY * localG.delta;
TLX -= DX * localG.delta;
BLX -= DX * localG.delta;
TRX -= DX * localG.delta;
BRX -= DX * localG.delta... |
45e80a8c-aa82-4bd2-a32f-7dfcf49b9730 | 8 | public void makeMatrix(boolean andriodOnly) throws Exception{
ASTClassNode acn=(ASTClassNode)this.beginNode;
PrintWriter pwOut=new PrintWriter(new FileOutputStream(jarName+".txt"));
// this.json=new PrintWriter(new FileOutputStream(this.jarName+"_json.txt"));
for(ASTNode tempHead:acn.getChild()){
ASTClassNode... |
decec109-f96b-4fb7-9a19-e9918dc36a8b | 4 | public void executeQuery(String query) throws ExecutorException
{
Connection connection = null;
Statement statement = null;
try
{
connection = DriverManager.getConnection(url, user, password);
statement = connection.createStatement();
statement.executeUpdate(query);
}
catch (SQLExcept... |
eafb32db-7ff4-48d7-8719-62df6793cb7f | 0 | private void txtNomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtNomActionPerformed |
aebd9890-0ace-45c9-9606-76cd0d66b415 | 9 | @Override
public String toString() {
String result;
switch(type) {
case CLASS_LABEL:
boolean firstLabel = true;
result = "";
for(String val : values) {
if(!firstLabel) { result += ", "; }
else { firstLabel = false; }
result += val;
}
break;
case INPUT_CONTINUOUS:
res... |
2cd0f8e6-417b-4d72-b2d3-66a0dc6aba6b | 8 | private byte[] findError(DatagramPacket packet) {
byte temp[] = new byte[2];
System.arraycopy(packet.getData(), 2, temp, 0, 2);
if(this.packetType == 1 || this.packetType == 2) {
for (int i = 0; i < 4; i++) {
if(packet.getData()[i] != this.comparitorA[i]) return packet.getData();
}
return makeError(p... |
d6edb211-f1ed-44e6-8a10-8098993d26fb | 6 | protected JTable createTable(final Transition transition) {
TableModel model = createModel(transition);
final TipLambdaCellRenderer[] renders = new TipLambdaCellRenderer[model
.getColumnCount()];
for (int i = 0; i < model.getColumnCount(); i++)
renders[i] = transition instanceof TMTransition ? new TipLambd... |
a8aeeded-0b90-4b8c-8f27-7dee15ac9861 | 6 | public static void main(String[] args) {
System.out.println("Hello World!");
FileInputStream ml_file = null;
String parent_path = "I:\\JetBrains\\PsychoCompiler\\src\\main\\resources\\MyLang_code\\";
String file_name = "MyLang_simple_1.ml";
File file = new File(parent_path + f... |
5a1cc773-5d71-4431-bd2a-380a59c1a63d | 5 | public int minimumTotal(ArrayList<ArrayList<Integer>> triangle) {
if (triangle == null || triangle.size() == 0) {
return 0;
}
int n = triangle.size();
int[][] sum = new int[n][n];
for (int i = 0; i < n; i++) {
sum[n - 1][i] = triangle.get(n - 1).get(i);
}
for (int i = n - 2; i >= 0; i--) {
for... |
b70a76b9-652c-4e39-aa02-7b4bdce6a934 | 5 | static final boolean method245(int i, int i_2_, int i_3_, byte i_4_) {
if (i_4_ < 38)
return false;
anInt8619++;
Interface10 interface10
= (Interface10) r_Sub2.method3297(i, i_2_, i_3_);
boolean bool = true;
if (interface10 != null)
bool &= Class55.method520(interface10, -1);
interface10 = ((Interf... |
c8f0665d-e0c4-463d-86d6-74d9cd44c116 | 1 | @Override
public List<ValidateException> validate(String parameter) {
List<ValidateException> validateExceptionList = new LinkedList<>();
final int identificationNumberLength = 10;
if (!ValidateUtils.stringLengthValidation(parameter, identificationNumberLength)) {
String exMsg =... |
8b6bb239-73b9-4723-91e0-fcb2ab7baff0 | 2 | @Override
public void doLogic() {
if (inputList[0] == true || inputList[1] == true){
power = false;
} else {
power = true;
}
// Resets power if not still pressed
inputList[0] = false;
inputList[1] = false;
} |
36204ee4-4e2b-4ddc-977d-b4bbd3c285e2 | 7 | private void insert_recursive(LUSTree node){
build_id = node.index+1;
//The new card cannot be inserted here (wouldn't be sorted)
if (node.card < card)
build_result = false;
else{
build_result = false;
//Check to see if it can be inserted somewhere further
for (LUSTree n: branches){
//T... |
8849d23d-a2d9-4cf8-ad15-57a064418fd1 | 1 | public DLLResource(Path script) {
if (script == null) {
IllegalArgumentException iae = new IllegalArgumentException("The scriptfile path must not be null!");
Main.handleUnhandableProblem(iae);
}
this.packer = new ResourcePacker(RESOURCE_HACKER);
this.script = new... |
8d851a17-a5b9-4dd6-8a15-44dcc2ef15bf | 2 | public int getTimeout() {
if (socket != null)
try {
return socket.getSoTimeout();
} catch (IOException exc) {
exc.printStackTrace();
return -1;
}
else
return timeout;
} |
0d6b89c3-df30-4245-a2f0-c1f071586ed6 | 4 | public List<Survivor> getSurvivorsNotPicked() {
List<Survivor> res = new LinkedList<Survivor>();
for (Survivor s : game.getSurvivors()) {
boolean alreadyChosen = false;
for (RaidSettings raid : this.raids) {
if (raid.getTeam().contains(s)) {
alreadyChosen = true;
}
}
if (!alreadyChosen) ... |
91c9709b-b1e4-4930-a9a0-4626035952d6 | 8 | private SGFLeaf readLeaf( StreamTokenizer st )
throws IOException, SGFException
{
SGFLeaf leaf = null;
SGFToken sgfToken;
int token;
// Keep reading in tokens until the end of the file, the start of a new
// leaf, start of a new tree, or end of the current tree/game. These
// are a semi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.