method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
c34b6ca8-7ad8-4883-aaf8-c79c5e0064ef | 9 | private SimpleJsonState readJsonObject(SimpleJsonTokenizer x) {
Map<String, SimpleJsonState> elements = new LinkedHashMap<String, SimpleJsonState>();
SimpleJsonState res = new SimpleJsonState(elements);
char c;
String key;
if ( x.nextClean() != '{' ) {
throw x.synta... |
4f41a683-929d-4dea-bb9f-2ad44432e23a | 7 | public void saveScoreStats()
{
File file = new File("Scores.txt");
boolean flag = false;
FileWriter writer;
ArrayList<String> scoreData = new ArrayList<String>();
ListIterator<String> iterator;
try
{
Scanner s = new Scanner(file);
while(s.hasNextLine())
{
scoreData.add(s.nextLine());
... |
3d41cabb-c024-49df-8288-9c71077fa491 | 2 | public void visitPhiStmt(final PhiStmt stmt) {
if (stmt instanceof PhiCatchStmt) {
visitPhiCatchStmt((PhiCatchStmt) stmt);
} else if (stmt instanceof PhiJoinStmt) {
visitPhiJoinStmt((PhiJoinStmt) stmt);
/*
* else if (stmt instanceof PhiReturnStmt)
* visitPhiReturnStmt((PhiReturnStmt) stmt);
*/
... |
e392c3ca-ae05-4e70-a2f9-758baae77be3 | 9 | public boolean exactlySameAs(PhoneNumber other) {
if (other == null) {
return false;
}
if (this == other) {
return true;
}
return (countryCode_ == other.countryCode_ && nationalNumber_ == other.nationalNumber_ &&
extension_.equals(other.extension_) && italianLeadi... |
18a5f3f2-65c7-47ba-b352-3392f5706643 | 8 | public static void main(String[] args) throws Exception {
if(args.length < 2) {
System.out.print("Usage : bdecoder -f <file> \n"
+ " : bdecoder -s <string1> [string2] ...\n");
return;
}
String argument;
if(args[0].equals("-f")) {
argument = args[1];
File... |
a6b6844c-7c3f-40f1-aef5-fa187ff5d633 | 8 | @Override
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex )
{
int width = tabPane.getWidth();
int height = tabPane.getHeight();
Insets insets = tabPane.getInsets();
int x = insets.left;
int y = insets.top;
int w = width - ins... |
52c4ecb4-0594-44e7-b382-03c60bd418e4 | 4 | @Before
public void setUp()throws Exception{
//first courier
firstCourier.put("slug","india-post-int");
firstCourier.put("name","India Post International");
firstCourier.put("phone","+91 1800 11 2011");
firstCourier.put("other_name","भारतीय डाक, Speed Post & eMO, EMS, IPS We... |
813693c3-dce8-40f6-aaa7-c7370aa8736b | 2 | public boolean isBlocking()
{
if ( channel instanceof SocketChannel )
return ( (SocketChannel) channel ).isBlocking();
else if ( channel instanceof WrappedByteChannel )
return ( (WrappedByteChannel) channel ).isBlocking();
return false;
} |
83af3da1-57ab-4994-86d5-8c72816b84d4 | 3 | public Env(EnvParams ep) throws Exception{
super();
int PAGE_SIZE=10;
int cur_page_offset=0;
instances=new ArrayList<CompositeInstance>();
logger= Logger.getLogger("driver");
locator(ep);
if(locator==null)
throw new Exception(this.error);
Compo... |
dde446e6-32ab-42e5-b48d-1f8c52bbe5c9 | 6 | public TinyELStatement parseFor() {
accept(TinyELToken.FOR);
accept(TinyELToken.LPAREN);
String type = exprParser.type();
String varName = exprParser.name().toString();
if (lexer.token() == TinyELToken.COLON) {
lexer.nextToken();
TinyELForEachStatement stmt = new TinyELForEachStatement();
stmt.setT... |
11ce4caf-d8a3-427d-85a1-39f9a337fb46 | 9 | public static void main(String[] args) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
Octopart.setApiKey("566cc7d2");
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
FileDialog filepicker = new FileDialog((java.awt... |
fd199872-8e05-41f2-817a-24d6963fc9b9 | 2 | public static String format(String line){
String formattedLine = line;
if (line.subSequence(0, 1).equals("/")){
String[] words = line.split("\\s+");
words[0] = words[0].substring(1,words[0].length()).toUpperCase();
formattedLine = new String();
for (String word: words){
formattedLine += word + " ";
... |
68091fb5-cc1f-4016-9e85-a7adf843527e | 1 | public int run(String [] args) throws Exception {
Job job = new Job(getConf());
job.setJarByClass(MapReduce.class);
job.setJobName("LogAnalyser");
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setMapperClass(Map.class);
job.setCombinerClass(Reduc... |
8ed06a74-0699-4b6c-ab2b-c821c391f5e7 | 3 | public void deletePollingScheme(String objectName) {
String objectPath;
Folder schemeFolder;
objectPath = "/PollingSchemes/" + objectName;
try {
schemeFolder = (Folder) session.getObjectByPath(objectPath);
ItemIterable<CmisObject> children = schemeFolder.getChildr... |
23560645-32cc-45d5-9e7f-9b870bb4d318 | 2 | public void eventListner(String message) {
Message messageObj = GameApiJsonHelper.getMessageObject(message);
if (messageObj instanceof UpdateUI) {
game.sendUpdateUI((UpdateUI) messageObj);
} else if (messageObj instanceof VerifyMove) {
game.sendVerifyMove((VerifyMove) messageObj);
... |
0254128e-650d-4a90-b7c5-1dfb90abfaa2 | 2 | public ArrayList<String> traerListaCargos(){
conn = Conector.conectorBd();
String sql = "select descripcion from usuario";
try {
pst = conn.prepareStatement(sql);
ArrayList<String> ls = new ArrayList<String>();
rs = pst.executeQu... |
bd359087-3131-4f3c-870b-2db47b1cd9d7 | 6 | public String processInput(String input) {
stringParts = input.split(" ");
try {
cmdPart = stringParts[0];
} catch (NullPointerException e) {
System.out.println("Error: found no Command");
}
if (cmdPart.equals("!login")) {
return logginUser();
}
if (cmdPart.equals("!logout")) {
return... |
55d31029-5c1a-48c5-8618-c87f23b77e34 | 9 | public static void main(String[] args) throws IOException {
int port = 4444;
String localhost = "localhost";
// create a new serversocketchannel. The channel is unbound.
ServerSocketChannel channel = ServerSocketChannel.open();
// bind the channel to an address. The channel starts listening to
// incoming... |
c0e279cd-5406-4fed-b49b-9420002c2926 | 8 | @Override
public void run() {
Scanner keyboard = new Scanner(System.in);
System.out.println("Welcome to the Smart Parking Lot "
+ "administrative control panel. (type h for help)");
while (true) {
String input = keyboard.nextLine();
if (input.equalsIgnoreCase("h")) {
System.out.println("... |
f3a90e52-1112-4538-965f-23463253e8a5 | 9 | public void save() {
StringBuilder data = new StringBuilder();
data.append("-" + nameText.getText() + "-" + System.getProperty("line.separator"));
if(meleeButton.isSelected()) {
data.append("<THRUST>" + System.getProperty("line.separator"));
data.append(thrustPanel.save());
data.append("<CRUSH>" + System... |
60ef6725-4125-47c4-942c-4ae13a22c111 | 0 | @Transactional
public void deleteById(Integer id) {
tasksDao.setDeletedById(id, true);
} |
5be8cbc0-414f-44ea-b064-a11038ad1d36 | 9 | public void setUserinfo(String p_userinfo) throws MalformedURIException {
if (p_userinfo == null) {
m_userinfo = null;
}
else {
if (m_host == null) {
throw new MalformedURIException(
Messages.getString("URI.userinfoCannotBeSetWhenHostIsNull")); //$NON-NLS-1$
}
/... |
f351bf6e-4355-474a-96b6-c282bd1fa65e | 3 | public void readPublisher(){
while(true){
Publisher publisher = new Publisher();
publisher.setName(read("Name"));
publisher.setCountryCode(read("Country code"));
publisher.setPostCode(read("Post code"));
publishers.add(publisher);
String ye... |
50ffb4d2-75de-4170-a915-8a1e4b1310d5 | 2 | public boolean sqlEjecutar(String sql){
try {
int resultado = stmt.executeUpdate(sql);
if (resultado == 0) return false;
return true;
} catch (SQLException ex) {
//Log.rutea("Error Ejecutar " +ex.getMessage() + "\n" + sql);
return false;
... |
ad9f0f04-ec3e-48fc-95d9-f6e69a205a8e | 9 | public int slideChar() {
AlignWin win = curAli.randWin(2);
AlignCol col1 = win.first, col2 = win.last;
int[] inds1 = col1.inds, inds2 = col2.inds;
int s = 0; // slidables
for(int i = 0; i < inds1.length; i++)
if(inds1[i] >= 0 ^ inds2[i] >= 0)
rows[s++] = i;
if(s > 0) {
// choose a random slidable
... |
f6bfd4cb-7d9a-4066-8599-f9fbedc91428 | 4 | public void setFont(Font font) {
if (days != null) {
for (int i = 0; i < 49; i++) {
days[i].setFont(font);
}
}
if (weeks != null) {
for (int i = 0; i < 7; i++) {
weeks[i].setFont(font);
}
}
} |
362fae11-d517-4393-96c6-d2ce6fb6f9e1 | 4 | private String createColumnListString() {
ClassInspect inspector = getClassInspector();
List<Field> annotatedFields = inspector.findAllAnnotatedFields(Column.class);
int columnCount = 0;
StringBuilder columnBuilder = new StringBuilder();
StringBuilder valueBuilder = new StringBuilder();
columnBuilder.append... |
9ade9fa9-1db3-4c4b-b047-fea7d8f4f928 | 4 | public Set<Coordinate> findThreatenedSquares(Color color) {
Set<Coordinate> threatenedSquaresSet = new LinkedHashSet<Coordinate>();
for (int col = 0; col < NUMBER_OF_COLS; col++) {
for (int row = 0; row < NUMBER_OF_ROWS; row++) {
Piece currPiece = pieces[col][row];
if (currPiece.isNone())
continue;
... |
41321c7c-b507-4f27-8b3e-7f5aee10b2e2 | 3 | public void runScene() throws InterruptedException {
while (!this.finished) {
Display.update();
if (Display.isCloseRequested()) {
this.finished = true;
} else if (Display.isActive()) {
Display.sync(FRAMERATE);
this.traitementsLo... |
ac355e47-23e0-4a0d-8cda-9468f8520846 | 0 | public JLabel getjLabel4() {
return jLabel4;
} |
504718c6-8ad3-4948-8d5e-7dca6c45899b | 0 | public List<BeerResponse> getBeers() {
return beers;
} |
109467ef-bfc3-417f-9203-36da75a7109c | 9 | private void moveRandomDirection() {
while (true) {
int move = (int) (Math.random() * 4);
switch (move) {
case 0:
if (up()) {
return;
}
break;
case 1:
i... |
551b7b7a-0ca9-40c0-b826-71d5ba96f226 | 3 | public String getLineStyle()
{
switch(magnitude)
{
case HIGH:
return HIGH_SIZE;
case MEDIUM:
return MEDIUM_SIZE;
case LOW:
return LOW_SIZE;
default:
return "";
}
} |
5108c732-5544-488f-ab1b-4fcc892febb9 | 0 | public CheckSum(File file) throws Exception{
super(file);
} |
a2054648-e12b-4133-9efc-02cef46a1c9f | 0 | @Override
public Exception getException() {
return exception;
} |
855f66af-5f4b-4df9-97d9-8f7d418aa1a4 | 2 | public void show() {
StringBuffer report = new StringBuffer();
for(Slot<String> s : theDraft.copy()) {
report.append(s.pickId);
report.append(" ");
if (Slot.BasicStates.USED.equals(s.state)) {
report.append(s.player);
} else {
... |
9b35f603-dae0-4f80-bc6d-a113914ec94e | 1 | private void onFullnessChanged(double oldVolume) {
for(IFullnessChangedObserver fo: fullnessObservers) {
fo.fullnessChangedHandler(this, oldVolume);
}
} |
978a1a44-09fa-479a-ad66-a77309b868f0 | 1 | private static final double getResolution(final int port) {
return (double) port < 4 ? 1023 : 63;
} |
66a3454d-cf17-471e-946c-24c79f1465f0 | 3 | public synchronized Exception getException() {
Exception e = exception;
for (ConnectionProcessor pipe : pipes) {
if (e == null) {
e = pipe.getException();
}
if (e != null) return e;
}
return e;
} |
bf2cc94b-7f3c-4860-8a5d-0df3ce1b1419 | 1 | Item newLong(final long value) {
key.set(value);
Item result = get(key);
if (result == null) {
pool.putByte(LONG).putLong(value);
result = new Item(index, key);
put(result);
index += 2;
}
return result;
} |
714403ce-31a7-4e93-9840-0f2372cc7c0f | 1 | @Override
public double[] getAmountVariableValues() {
double[] amountVariables = new double[periods.length];
for (int i = 0; i < amountVariables.length; i++){
amountVariables[i] = periods[i].amount;
}
return amountVariables;
} |
ca7113a1-cd1b-465b-8dc6-0e3a496f4cc1 | 9 | public void close () {
Connection[] connections = this.connections;
if (INFO && connections.length > 0) info("kryonet", "Closing server connections...");
for (int i = 0, n = connections.length; i < n; i++)
connections[i].close();
connections = new Connection[0];
ServerSocketChannel serverChannel = this.se... |
b594331e-3726-4b72-8574-7dffff21793a | 9 | private void createVirtualNodesAndEdges() {
int idCounter = 1;
for(LayoutNode v : graph.getAllVertices()) {
if(v.getId() >= idCounter) {
idCounter = v.getId() + 1;
}
}
LayoutNodeFactory vertexFactory = new LayoutNodeFactory(idCounter);
Set<LayoutEdge> edges = graph.getAllEdges();
for (LayoutEdge e... |
4b19fff2-b0d6-4298-893c-04ffe6454038 | 9 | private void addSnapshotImage(Component parent, ImageIcon image, String filename, boolean inputDescription,
String pageAddress) {
if (editor == null)
editor = new SnapshotEditor(this);
String s = Modeler.getInternationalText("TakeSnapshot");
if (editor.showInputDialog(JOptionPane.getFrameForComponent(parent... |
10421326-ecad-414e-9088-0ef54af4e599 | 8 | public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException {
// Folder containing the Zargo UML files
File f = new File("models/");
File[] fileArray = f.listFiles();
// File for saving the statistics for the processed models
File summary = new File("result/zargo-xmi... |
c9c989f5-23bb-4b2d-b706-f24f16863854 | 0 | @After
public void tearDown() throws Exception {
pool.shutdown();
pool.awaitTermination(100, TimeUnit.SECONDS);
final Xpp3Dom results = xmlRunListener.getResults();
assertAllTestCasesHaveRequiredElements(results);
assertEquals(700, results.getChildCount());
assertEqua... |
2cd4178e-fcf0-463e-8075-40e64171c115 | 4 | public static void removeReservation(int productID, int memberID){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
conn.setAutoCommit(... |
629ae812-4a73-4d33-80dd-6919f34e11ff | 9 | public void populate(String games) {
//TODO
System.out.println("lobby: games = " + games);
if(!games.equals(input)){
System.out.println("repopulating");
System.out.println(games);
System.out.println(input);
input = games;
int pos = 0;
int i;
gameNumID.clear();
ArrayList<String> listDat... |
6e4081f3-1781-422d-ada3-f74d772a4484 | 8 | protected void fetchLegendItems() {
this.items.clear();
RectangleEdge p = getPosition();
if (RectangleEdge.isTopOrBottom(p)) {
this.items.setArrangement(this.hLayout);
}
else {
this.items.setArrangement(this.vLayout);
}
if (this.sortOrder.... |
534cb283-1b99-4208-aa27-e03fc8763f6e | 9 | private int find_K(int A[], int startA, int B[], int startB, int k)
{
if(A.length ==0 || A.length <= startA) return B[startB+k-1];
if(B.length ==0 || B.length <= startB) return A[startA+k-1];
if(k==1)
{
if(A[startA]<B[startB])
return A[startA];
else
... |
84a605ba-6c24-447c-87a8-e29ffcb1628c | 7 | * @param superclass
* @return boolean
*/
public static boolean subclassOfP(Stella_Class subclass, Stella_Class superclass) {
if (subclass == superclass) {
return (true);
}
{ TaxonomyNode subnode = subclass.classTaxonomyNode;
TaxonomyNode supernode = superclass.classTaxonomyNode;
in... |
05d64f71-2d8a-457c-a5db-877ec3fd1295 | 5 | public void adjustListPosition(int val){
//Checks for positive or negative value
if(val == 1)
{
//Checking if at end of list
if(listPosition == listImages.size()-1){
listPosition = 0;
} else {
listPosition += val;
}
// Checking if on far right of screen
if(positionOnScreen == 4... |
db61ba0b-a6c7-478b-bf2a-b141d65d3acf | 3 | @Override
public void rotateZPlus() {
if(orientation == Z) return;
orientation = (orientation == X ? Y : X);
for(int i = 0; i < others.length; i++) {
IntPoint p = others[i];
others[i] = new IntPoint(-p.getY(), p.getX(), p.getZ());
}
} |
8de49d67-10a5-4d8c-b861-074388b4e69c | 0 | @After
public void tearDown() {
} |
0d550072-ae4a-42e3-a58e-3a469338203c | 6 | public static HashMap<String, Double> getOneWayAnovaPValues(ENode root) throws Exception
{
HashMap<String, Double> returnMap = new HashMap<String, Double>();
HashMap<Float, List<ENode>> map = ReadCluster.getMapByLevel(root);
System.out.println(map.size());
for( Float f : map.keySet())
{
File outFile = ... |
3b43b4d6-4cfb-4481-b51f-23f939d23d7d | 1 | private void tuplaaKoko(){
Siirto[] uusi = new Siirto[keko.length*2];
for (int i = 0; i < keko.length; i++){
uusi[i] = keko[i];
}
this.keko = uusi;
} |
7c7db0f8-93af-42d2-a22c-bdee66218008 | 0 | public void setDateModified(String dateModified) {this.dateModified = dateModified;} |
c23349d3-666b-42f5-8c2d-fe01bfd2b2a5 | 7 | public double weightedStandardError_of_ComplexModuli() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
boolean hold2 = Stat.nEffOptionS;
if (nEffReset) {
if (nEffOptionI) {
Stat.nEffOp... |
9db7a38b-5b31-4551-8fd8-aaff73057ba6 | 2 | @Override
public void send(String n, String m) {
try {
m_server.pushMessage(new Send(n, m));
} catch (RemoteException e) {
e.printStackTrace();
} catch(InterruptedException e){
e.printStackTrace();
}
} |
468de5d0-d442-43b1-b346-ad302ff82dab | 1 | public void setValueB(Value value) {
if(!opcode.isBasic())
throw new IllegalArgumentException("Can not setValueB on non-basic opcode");
this.valueB = value;
} |
60eace19-19b4-4bdd-9229-e53a97de6337 | 1 | private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {
int tamaño = this.jTextField1.getText().length();
if (tamaño >= 12) {
evt.consume();
}
} |
46c0461e-5d96-40ab-941b-1b6c574d4b51 | 5 | public void chessPieceRedirection(int originLetter, int originNum, int newLetter, int newNum)
{
System.out.println();
String chessPiece = b.checkBoard(originNum, originLetter);
if(chessPiece.equalsIgnoreCase("r"))
{
RookMovement rook = new RookMovement(chessPiece, b);
rook.checkMove(originLetter, originN... |
925716fa-f669-4785-974a-94331b3b4940 | 6 | public LinkedList<Integer> stackDFS(Digraph G, int source) {
if (G.bag.length < source) { // If length of bag is lesser than source, source can't exist
return null;
}
boolean[] visited = new boolean[G.V()]; // Create boolean array to flag visited ve... |
61c3df11-1667-4793-a613-305eb37c142c | 0 | public Configuration[] getConfigurations() {
return (Configuration[]) configurationToButtonMap.keySet().toArray(
new Configuration[0]);
} |
fb183a36-241c-489f-ba4c-56256be0ddbe | 2 | private List<Symbol> removeEpsilon(List<Symbol> alphabet) {
List<Symbol> results = alphabet;
for(Symbol result : results){
if(result.mathValue("epsilon")){
results.remove(result);
break;
}
}
return results;
} |
2d2ee5ea-e228-489b-ac26-897e5f3e8f4e | 7 | private void calculateAnchors(){
//get rack and print it
int[] tmpRack = rack.getCards();
//analyze the rack to find the anchor points
//if the card in slot "i" fits roughly the flat, maximal spread distribution, it is an anchor
int slotLow = 1, slotHigh;
for (int i = 1; i <= rack_size; i++){
slotHig... |
15eba1fd-41e5-40bd-83ba-d5a75ea3b427 | 2 | private AcctsRecTransRec parseDeleteTransaction() {
String mastID;
AcctsRecTransRec result;
if (tokens.length > 1) {
mastID = tokens[1];
if (tokens.length == 2)
{ result = new AcctsRecDeleteTransRec(mastID); }
else {
result = new AcctsRecIllFormedT... |
00454d42-e3cd-4079-aa91-3a12f6a1b44d | 9 | private static ArrayList<Line> readLineInfo(Scanner input, HashMap<String, BusStop> busStops) throws Exception
{
String temp, lineNo;
int period;
Time start, last;
lines = new ArrayList<Line>();
input.useDelimiter("[:=<>,\\s]+");
while (input.hasNext())
{
temp = input.next();
if (temp.compareTo("li... |
d87d53a4-54b8-413f-b792-d6904c45059b | 8 | public void event() {
System.out.println("DELETE 버튼 이벤트 발생!");
Iterator<Information> it = list.iterator();
Information i;
int count = 0;
try {
while (it.hasNext()) {
i = it.next();
if (i.getName().equals(name_tf.getText()) // 이름으로 삭제
&& id_tf.getText().equals("")) {
list.remove(count);
... |
4e4056ea-6a91-471d-993c-9c0d2959d3f7 | 0 | public void addButton(Container c, String title, ActionListener listener)
{
JButton button = new JButton(title);
c.add(button);
button.addActionListener(listener);
} |
542846e4-642f-4921-a960-ebf56a817f89 | 9 | public void end(Integer statusCode){
this.setStatus(Call.CALL_ENDED);
if (getPastStatus()==Call.CALL_INITIALIZED){
try {
initialRequest.createResponse(statusCode).send();
} catch (IOException ex) {
ex.printStackTrace();
}
}
... |
2292dcf4-67c8-4950-98bc-c5b6d513e51c | 3 | int alloc(int len) {
if (hp+len+1 > size) { // Check for space in the heap.
garbageCollect(); // Invoke garbage collector.
if (hp+len+1 > size) { // And then retest for space in heap.
fatal("Out of memory!");
}
}
int result = hp-size;
for (heap[hp++]=len; len>0;... |
14acfd4a-ce69-4385-b2d0-01b68359a340 | 6 | private double _value(final Interval<Double> region,
final Function<Double, Double> function, final double firstGuess,
final int iteration, final DoubleAbsolute criterion) {
if (this.getMaximumIterations() < iteration)
throw new MaximumIterationsException(iteration);
... |
c2cbd23d-065a-4957-b966-1d3806dd8220 | 0 | public void addNeighbor(Region ar) {
this.neighbors.add(ar);
} |
f5d972e8-fbd9-46cf-b021-44bae3f8ad77 | 6 | public void startUpload() throws InterruptedException
{
Random random = new Random();
uploadWindow.statusLabel.setText("Loading image...");
System.out.println(filePath);
BufferedImage image = getBufferedImage(filePath);
if (image == null) {
uploadWindow.statusLabel.setText("An error occured!");
uplo... |
4586057b-0bb0-462d-a36d-b89dbce1730c | 0 | public Operator<Boolean> getOperator() {
return operator;
} |
1441bbf5-550c-4108-ada1-c52af339e6b9 | 3 | void NewickPrintBinaryTree( PrintStream out ) throws Exception
{
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits( DOUBLE_PRECISION );
edge e, f;
node rootchild;
e = root.leftEdge;
rootchild = e.head;
out.write('(');
f = rootchild.leftEdge;
if ( null != f )
{
NewickPr... |
623ff357-e802-46ae-b96e-57f337565187 | 8 | public static void main(String[] args) throws Exception
{
if (args.length < 1) {
System.err.println(
"usage: java PKCS12Import {pkcs12file} [newjksfile]");
System.exit(1);
}
File fileIn = new File(args[0]);
File fileOut;
if (args.length > 1) {
... |
733bfd2e-7af1-4af3-bd33-1863c0c60b92 | 6 | @Override
public synchronized void mouseMoved(MouseEvent e) {
Point mousePoint = e.getPoint();
// Test all objects to see if the mouse position is within the bounds of
// the eventable object. If it is, add their event to the
// waitingEventsMouseOver list. We must also add it to the list of
// currentMouseO... |
e0c94785-1f7b-4057-90e8-f22abaa2dfff | 3 | public synchronized Entity operateEntityList(int op, int index, Entity e){
switch(op){
case 0 :
playerList.add(e);
return null;
case 1 :
return playerList.get(index);
case 2 :
playerList.remove(index);
return null;
default :
return null;
}
} |
ab3f1cb7-b90b-482c-bd04-eac2bec39e6d | 9 | public List<TravelDataBean> getarticleList(int start, int end, int area) throws Exception{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
List<TravelDataBean> articleList = null;
String sql = "";
try{
conn = getConnection();
/*추천지수 불러오는sql*/
sql = "update travel set r... |
ba7a5b92-c213-4a35-8dae-7044e2d8bf65 | 5 | @Override
public final boolean equals(Object o) {
if ((o != null) && (o instanceof IPNetwork)) {
IPNetwork net = (IPNetwork)o;
return (net != null) && address.equals(net.address) && mask.equals(net.mask) && (BITS == net.BITS);
}
return false;
} |
13cc87f6-8057-4d0a-b76d-77d0154d45f3 | 1 | public void mergeBreakedStack(VariableStack stack) {
if (breakedStack != null)
breakedStack.merge(stack);
else
breakedStack = stack;
} |
d1534c38-1fc9-4fc8-8ddd-3c67d6d911a1 | 5 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.content == null) ? 0 : this.content.hashCode());
result = prime * result + ((this.mime == null) ? 0 : this.mime.hashCode());
result = prime * result + ((this.reference == null) ? 0 : this.reference.hashCo... |
8f76934f-8400-4805-a192-4dfd80fb4193 | 2 | public void histogramme(ShortPixmap img) {
short[] histogramme = new short[256];
for (int i=0; i<=img.width; i++) {
for (int j=0; j<=img.height; i++ ) {
//int k = img.
//histogramme[k]++;
}
}
} |
6509cd90-5deb-46fb-b35a-82cec70501c0 | 1 | public static Database getInstance() throws Exception {
if(Database.db == null)
throw new Exception("No database initialized.");
else
return Database.db;
} |
55f06381-d63f-4302-8e6a-194e40625953 | 4 | @Override
public void execute() {
for(int i = 0; i<rockArray.length; i++){
EfficientMiner.operation = "Looking for ores";
rockArray[i] = SceneEntities.getAt(ORES_TILES[i]);
if(rockArray[i].getId() == ORES[i])
if(rockArray[i].isOnScreen()){
rockArray[i].interact("Mine");
EfficientMiner.operatio... |
7d86f043-8cae-4656-bb1a-9bf0ec74516f | 4 | private void getNumMappedFlagstat(String flagstatPattern, String dirName) throws IOException{
numMapped = new HashMap<String, Integer>();
TextFile flagstat;
File dir = new File(dirName);
for (File ch : dir.listFiles()) {
if (ch.isDirectory()){
for (File child ... |
a7ba9b54-7709-44b6-bf60-c17c54c01fb7 | 9 | public boolean[][] fillIn(int[] order, boolean[][] bAdjacencyMatrix) {
int nNodes = bAdjacencyMatrix.length;
int[] inverseOrder = new int[nNodes];
for (int iNode = 0; iNode < nNodes; iNode++) {
inverseOrder[order[iNode]] = iNode;
}
// consult nodes in reverse order
for (int i = nNodes - 1; i >= 0; i--) {... |
8e854d76-e2d1-4500-be3c-d4f7f55f233a | 4 | private void updateTypeMenu()
{
if(specificType != null)
{
panel.remove(specificType);
}
if(playerType.equals(AI))
{
specificType = new JComboBox<String>(AIList.getNames());
}
else
{
specificType = new JComboBox<String>(GUIList.getNames());
}
panel.add(specificType);
... |
452f8181-b052-434a-b73f-eccbb1ac5db4 | 1 | public Photograph(String[] photograph) {
if (photograph == null) {
photograph = new String[]{};
}
this.pic = photograph;
} |
21879266-04c8-4a94-940b-09a406d75a58 | 8 | public static ArrayList<BasicNode> GetPath(LevelEntity[][] level, BasicNode start,BasicNode goal){
int[][] temp = {{ 1,-1},
{ 1,-2},
{ 2,-2},
{ 2,-3},
{ 3,-3},
{ 3,-4},
{ 4,-4},
{ 5,-3},
{ 6,-3},
{ 7,-3},
{ 8,-2},
{ 8,-1}};
int[][] temp2 = {{ 1,-1},
{ 1,... |
0a202ba3-fd2b-46d3-8f28-3c15145b17a6 | 3 | public static void main(String[] args)
{
System.out.println("Starting failure example 1...");
try
{
if (args.length < 1)
{
System.out.println("Usage: java ResFailureEx01 network_ex01.txt");
return;
}
/////////... |
f99ab6ae-7fe7-44a4-979c-469e3390203c | 7 | private TreeModel generateLoggerTreeModel() {
myLogger.fine("Erzeuge Tree-Model mit allen Loggern");
// Das Tree-Model mitsamt Root-Knoten anlegen
TreeNodeObject tno = new TreeNodeObject("Alle Logger");
DefaultMutableTreeNode root = new DefaultMutableTreeNode(tno);
DefaultTreeMo... |
4032f3da-d142-44a8-832e-51c7734994e6 | 1 | @Override
public void updatePlayersList(Players players) {
playersInGame.removeAllElements();
for (Player player : players.getPlayers()) {
playersInGame.addElement(player.getName() + " " + "(" + player.getRole() + ")");
}
} |
052657a2-4a3d-4a18-8919-1d47375a8de4 | 2 | public void update(final Observable model, Object ignored) {
if (_disposed)
throw new IllegalStateException();
// Redraw the window
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// _content.repaint() causes a call to _content.paint(g)
// where g is an... |
f38266cb-5011-41e7-a7fb-1b2760744453 | 0 | @Override
public void buildDough() { pizza.setDough("cross"); } |
1947c303-be28-4860-8c00-1a7cbd3307cb | 0 | @Override
public void mouseExited(MouseEvent e) {
unprocessedEvents.add(e);
mouse = new Point2D.Double(-1, -1);
} |
4452ae12-d305-435a-97ba-049cf750c8e4 | 0 | @Test
public void EnsureNothingIsRemovedWhenNoLeadingTrailingSlashes() {
String path = "x/y";
String newpath = Path.trimSlashes(path);
assertEquals("x/y", newpath);
} |
bb8939fc-6e5a-4fae-b52b-e1fc7d232678 | 6 | public static Tile CONCRETE() {
if (random.nextInt(100) == 0) {
return WASTELAND_GROUND1;
} else if (random.nextInt(100) == 0) {
return WASTELAND_GROUND2;
} else if (random.nextInt(100) == 0) {
return WASTELAND_GROUND3;
} else if (random.nextInt(100) == 0) {
return WASTELAND_GROUND4;
} else if ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.