method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
164559ac-1928-4484-8a48-304f24d9949e | 0 | public double getMarkerLatitude()
{
return markerRect.getLatitude();
} |
2f5b1381-df06-4a94-bdb0-b2f9eaac5127 | 7 | public static void commandMode(final EnvironmentInterface env) {
final int maxBuf = 200;
byte[] buf = new byte[maxBuf];
int length;
try {
System.out.print("\nTAallocation: query using predicates, assert using \"!\" prefixing predicates;\n !exit() to quit; !help() for help.\n\n> ");
while ((length=System.i... |
ec020bfc-0831-47a4-a496-531b84bdb1b0 | 0 | public MeasureKit(DataStructures inData, int numberOfPoints){
this.inData = inData;
this.numberOfPoints = numberOfPoints;
} |
279caffe-73c5-4ca3-8258-100147915630 | 9 | private void fillNumbers() {
int dx[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
int dy[] = { -1, -1, 0, 1, 1, 1, 0, -1 };
int width = board.length;
int height = board[0].length;
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
if (board[x][y] != MINE) {
board[x][y] = 0;
for (i... |
5bf5f26e-777e-4759-8c58-9d4f9d85d1fd | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
UserBean other = (UserBean) obj;
if (password == null) {
if (other.password != null)
return false;
} else if (!password.equals(other.pas... |
07b8dc50-4fd9-476f-92a2-627dbd7c039f | 9 | public void encode(char c, BitOutputStream bos) throws IOException {
int nodeNumber = currentNumber;
for (int i = 512; i >= currentNumber; --i) {
// found leaf with symbol
if (c == nodes[i].symbol && nodes[i].left == null) {
nodeNumber = i;
bre... |
6a27be01-5dce-48fc-ae6a-9eb2cab0108a | 5 | void nachRechts() {
if (dx < 0) {
dx = 0;
try {
texture = TextureLoader.getTexture("PNG", new FileInputStream(new File(uT.locationMid)));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block... |
705133cd-f94e-4278-bee6-74e42d26edf4 | 5 | private void parse(Node groupNode) throws UnisensParseException{
NamedNodeMap attr = groupNode.getAttributes();
Node attrNode = attr.getNamedItem(GROUP_ID);
id = (attrNode != null) ? attrNode.getNodeValue():"" ;
attrNode = attr.getNamedItem(GROUP_COMMENT);
comment = (attrNode != null) ? attrNode.getNodeVal... |
bd492600-a060-41dc-8afe-11c34230d4a5 | 5 | public boolean place(int x, int y) { //if all squares are free, place ship and placed == true. if not, return false
if (randomAlignment() == true) {
x = randomWithRange(0,7);
for (int i = x; i < x + 3; i++) {
if (!Grid.isSquareEmpty(i, y)) {
Grid.addTo... |
ec8fe500-b87b-4c68-a099-9d71b2019eed | 8 | @Override
public Set<String> composeSample(Distribution base, int maxSize) {
// if all samples fit into the maxSize just return them all.
if (this.getSampleSizeSum() <= maxSize) {
return this.getSampleReferences();
}
TreeSet<String> result = new TreeSet<String>();
Distribution approximateDistribution = n... |
1ef8d01d-7246-45c9-b1e6-1adff5ce4b89 | 8 | public int largestRectangleArea(int[] height) {
Stack<Integer> stack = new Stack<Integer>();
int maxArea = 0;
for (int i = 0; i < height.length; i++) {
if (stack.isEmpty() || height[stack.peek()] <= height[i]) {
stack.push(i);
} else {
while (!stack.isEmpty() && height[stack.peek()] > height[i]) {
... |
446ca5b3-bc58-4ee0-a31f-8e31ee164603 | 6 | public List<Edge> incidentEdges(Vertex vertex) {
ArrayList<Edge> edgeList = null;
if (graphType == Type.UNDIRECTED) {
for (EdgeListObject elo : vertex.getIncidenceList()) {
if (edgeList == null)
edgeList = new ArrayList<Edge>();
edgeList.add(elo.getEdge());
}
} else {
List<EdgeListObject> ou... |
88e20fce-af8e-4e4e-a6df-f13e01cc704f | 4 | public mxPoint getParentOffset(Object parent)
{
mxPoint result = new mxPoint();
if (parent != null && parent != this.parent)
{
mxIGraphModel model = graph.getModel();
if (model.isAncestor(this.parent, parent))
{
mxGeometry parentGeo = model.getGeometry(parent);
while (parent != this.parent)
... |
324cf5f1-cf0f-41f7-b39e-ca09416a436d | 9 | public void updateDirection(SnakePart s){
if(s.x >= wa || s.y >= ha || s.x < 0 || s.y < 0){
gameEnd();
return;
}
int dir = board[(int) s.x][(int) s.y];
if(dir==1){
s.xD = 0;
s.yD = 1;
}
if(dir==2){
s.xD = -1;
s.yD = 0;
}
if(dir==3){
s.xD = 0;
s.yD = -1;
}
if(dir==4){
... |
b6258568-bba7-41ec-b714-ac8a3f04892d | 8 | public Usage(){
addForm(_defaultprop);
StringBuffer defprop = new StringBuffer();
FileInputStream fin = null;
InputStreamReader ir = null;
BufferedReader br = null;
try {
fin = new FileInputStream(AppUtil.getAppPath() + AppUtil.DEFAULT_PROP_FILE);
ir = new InputStreamReader(fin,"UTF-8");
br ... |
2ab10d4f-2564-4ce5-8abd-ce10e5bee1e5 | 4 | @EventHandler(priority = EventPriority.LOWEST)
public void onLoginServer(ServerConnectEvent e) {
ProxiedPlayer p = e.getPlayer();
if (plugin.maintenanceEnabled && !p.hasPermission("bungeeutils.bypassmaintenance")) {
p.disconnect(new ComponentBuilder("").append(plugin.messages.get(EnumMes... |
f5a1c124-e058-47e0-8591-f3d12960abe6 | 0 | public void removePlotter(final Plotter plotter) {
plotters.remove(plotter);
} |
55deab98-5bb2-4eec-9809-cd52319471e0 | 9 | @Override
public void populate(World world, Random random, Chunk chunk) {
if (!isGraveyardSet(chunk) && random.nextInt(4) < 1) {
Vector<GraveyardStructure> structures = new Vector<>();
for (Class<? extends GraveyardStructure> clazz : structureClasses) {
try {
... |
77bd5030-bdb7-48bc-be03-7f54a3065d2b | 2 | @Command(name = "language", usage = "[language]")
@RequiresPermission
private void languageCommand(CommandSender sender, CommandArgs args)
{
if (args.size() > 0)
{
String language = args.getString(0);
Translation tranlation = Translation.get(this.plugin.getClass(), la... |
bb037cfd-bbaa-4c34-a6e7-12b2b6eb9ca3 | 8 | private String testCount() {
String tCount = "";
// report test totals
if (this.numberOfTests == 1) {
tCount = "\nRan 1 test.\n";
} else if (this.numberOfTests > 1) {
tCount = "\nRan " + this.numberOfTests + " tests.\n";
}
// report error totals
if (this.errors == 0) {
tCount = tCount + "All te... |
87064088-e8e9-40d8-8b23-e34000008f83 | 2 | private static ArrayList<String> toStringArrayList(String str) {
ArrayList<String> array = new ArrayList<String>();
String[] Str = str.split("");
for(String s : Str) {
if(s != "") {
array.add(s);
}
}
return array;
} |
16ba7bc6-6488-4fa5-9da3-bbc984c546a4 | 1 | public PropertyTree getNode(int result) {
if(nodes.size()>result) {
return nodes.get(result);
}
return null;
} |
a8b84716-2260-4284-b56c-8b1996634b45 | 3 | public static void main(String[] args) {
Logger logger = null;
try {
logger = new Logger("log.txt");
logger.log("Test 1");
logger.log("Test 2");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (logger != null) {
try {
logger.close();
} catch (IOException e) {
e.pri... |
33faa07e-788b-40a0-b53c-40b66db75ece | 9 | void run(){
Scanner sc = new Scanner(System.in);
for(;;){
int n = sc.nextInt();
int m = sc.nextInt();
if((n|m)==0)break;
Map<String, Integer> ref = new HashMap<String, Integer>();
int id = 0;
int s = id; ref.put(sc.next(), id++);
int p = id; ref.put(sc.next(), id++);
int g = id; ref.put(sc.n... |
8696b6a5-38a6-458a-a9f4-46cf70d6b177 | 0 | protected void initialize() {
_nextDistance();
super.initialize();
} |
b503a5cb-e719-4282-b2f0-a9eab1fffe0a | 6 | public static void main(String[] args) throws IOException {
String host = args[0];
int port = Integer.parseInt(args[1]);
String serviceName = args[2];
BufferedReader in = new BufferedReader(new FileReader(args[3]));
// locate the registry and get ror.
RMIRegistryClient registry = RMIRegistryClient.getRegis... |
6a6fe739-c4ae-4eb9-bef6-bd5308f79fe7 | 8 | public void actionPerformed(ActionEvent evt) {
String cmd = evt.getActionCommand().toLowerCase();
try {
if(cmd != null) {
if (cmd.equals("open interface")) {
selectInterface(ActionHandler.openInterface());
}
if (cmd.equals("show grid")) {
Settings.displayGrid = displayGrid.isSelected();
... |
efd7da78-32fd-482a-8431-070bf4e441bc | 6 | private static List<BeanMappingObject> parseMappingObject(InputStream in) {
Document doc = XmlHelper.createDocument(
in,
Thread.currentThread().getContextClassLoader().getResourceAsStream(
... |
9a9512e0-e4cb-4f43-863c-2cd8753dcb27 | 6 | @Override
public Predictors<MultiClassLabel> process(Predictors<Collection<MultiClassLabel>> input) throws Exception {
Predictors<MultiClassLabel> res = new Predictors<MultiClassLabel>(input.size());
for(int i = 0; i<input.size(); i++) {
Collection<MultiClassLabel> sets = input.get(i);
... |
dd0b8513-1ee5-466d-977a-26baeb354292 | 6 | public double[] getRandLetterNoise(double ordM, double invM) throws IOException {
char letter;
Random r = new Random();
letter = (char) (r.nextInt(5) + 'J');
BufferedImage letterImage = ImageIO.read(getClass().getResource("/images/" + letter + ".png"));
double[] result = new doub... |
5cf14334-9bdc-46a3-8d07-2352db7981af | 4 | public static boolean isImprimivel(Tipo tipo)
{
switch(tipo){
case INTEIRO:
case REAL:
case CARACTERE:
case CADEIA:
return true;
default:
return false;
}
} |
9c108b46-08b7-45b2-8c39-9506345718a8 | 1 | public void map_move_step(int x, int y) {
Gob pgob;
int btn = 1;
int modflags = 0;
synchronized (glob.oc) {
pgob = glob.oc.getgob(playergob);
}
if (pgob == null)
return;
Coord mc = tilify(pgob.position());
Coord offset = new Coord(x, y).mul(tileSize);
mc = mc.add(offset);
wdgmsg("click", JSBot... |
6f879d88-41b2-4e54-ba13-3b5c66048e29 | 7 | @Override
public NameData[] getNameData() {
int length = crawledData.length;
updateStatus(length, 0, 0, 0);
if(length == 0) return null;
for(int i = 0; i < length; i++) {
cd = crawledData[i];
// Für jedes crawledData wird neu angefangen nach Künstlern zu suchen.
foundNameIDs.clear()... |
75d29e0a-acab-4086-a44d-21506714edd4 | 8 | public void loop(){
int counter = 0;
printOptions();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (true){
int i = 5;
try {
i = Integer.valueOf(br.readLine());
if (i<0 || i>2){
System.out.println("Please enter a number between 0 and 2");
printOptions();
... |
49ca64c9-9968-46ba-9e85-a0559c44dcb2 | 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... |
e8ba2bdb-b623-4ddd-9fc0-a0e023300122 | 5 | public Tile(int x, int y, int typeInt) {
tileX = x * 40;
tileY = y * 40;
type = typeInt;
r = new Rectangle();
if (type == 5) {
tileImage = StartingClass.tiledirt;
} else if (type == 8) {
tileImage = StartingClass.tilegrassTop;
} else if (type == 4) {
tileImage = StartingClass.tilegrassLeft;
... |
2506f634-d78a-4b1e-a6ce-25c3908da43b | 8 | public int compare(Object o1, Object o2)
{
final EdgeCrossing a = (EdgeCrossing)o1;
final EdgeCrossing b = (EdgeCrossing)o2;
if(a.getAngle() < b.getAngle())
{
return -1;
}
if(a.getAngle() > b.getAngle())
{
return 1;
}
// Angles are equal.
... |
2b20581f-c48d-455e-ae5f-1cd7f41fca6a | 6 | public static void analyseResults(File resultFile)
{
try
{
int correctHams = 0;
int correctSpams = 0;
int incorrectHams = 0;
int incorrectSpams = 0;
int lineCounter = 0;
Scanner sc = new Scanner(resultFile);
File analysisFile = new File("analysis3.txt");
BufferedWriter bw = new ... |
719d5b43-dd96-4dbf-806a-a9ccb0de185e | 1 | public DataPoint(double one, int to, double two, int tt, double three, int tth, double four, int tf, double five, int tfi )
{
p1 = one;
p2 = two;
p3 = three;
p4 = four;
p5 = five;
t1 = to;
t2 = tt;
t3 = tth;
t4 = tf;
t5 = tfi;
//Fill the array with values to feed to perceptrons
fVals[0] = p1;
fVals[1] = ... |
10ec8dd5-f57c-404b-ac3c-245bcff5f9ac | 9 | public static void main(String[] args) throws Exception {
String host = null;
int port = -1;
for (int i = 0; i < args.length; i++) {
System.out.println("args[" + i + "] = " + args[i]);
}
if (args.length < 2) {
System.out.println("USAGE: java client host port");
System.exit(-1);
}
try { /* get inp... |
5949625b-def1-4345-ae16-2e1f4c5e1a75 | 8 | @Override
public QueryResult execQuery(Query q) {
Statement st = null;
ArrayList<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
if(!q.isParsed()) {
q.parse();
}
try {
st = con.createStatement();
ResultSet res = st.executeQuery(q.getParsedQuery());
while(res.nex... |
fd1948dd-e554-421d-b99c-8230858e0638 | 3 | private boolean noTeleporterOnWall(Grid grid) {
List<Teleporter> teleports = getTeleportersOfGrid(grid);
for (Teleporter teleport : teleports) {
final Position tpPos = grid.getElementPosition(teleport);
for (Element e : grid.getElementsOnPosition(tpPos))
if (e instanceof Wall)
return false;
... |
6b3f4c79-0342-459a-b837-e39555d2c383 | 8 | private void algo() {
// Step 1 -
// initialize the zero flow (if none is given)
// mark Quelle
init();
// Step 2
// save the current to be inspected Vertice into vi.
// end loop, if there are no more.
for (Long vi = popFromQueue(); vi != -1L; vi = popFromQueue()) {
// filter all edges by O(vi) an... |
0b538c36-f293-40b1-95c7-53c610350027 | 4 | @Override
public void startElement(String uri, String localName, String name,
Attributes atts) throws SAXException {
super.startElement(uri, localName, name, atts);
if (numLayers > 0
&& startRecordingElementName.equalsIgnoreCase(localName)
&& "class".equalsIgnoreCase(atts.getLocalName(0))
&& startRe... |
5422ac0b-351f-40e8-9c7a-1874d633ff65 | 3 | @Override
public int loginUser(UserRequest request) {
int result = -1;
User unvalidatedUser = new User(request.getUsername(), request.getPassword());
int index = users.indexOf(unvalidatedUser);
if(index > -1) {
IUser validUser = users.get(index);
result = (validUser.getPassword().equals(unvalidatedUser.... |
aa22935b-5eee-40be-bbfa-00baf30a2f16 | 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 fe... |
10b2ed59-df5c-46ff-b4b6-7d7672b6fefc | 1 | public final void enqueue() {
if (nextOnQueue == null) {
this.nextOnQueue = notifyQueue.first;
notifyQueue.first = this;
}
} |
03e2bc08-870b-43c9-9c60-c34387e997a3 | 7 | public BigInteger[][] getEncryptionKeys(BigInteger[] keyArray) {
// String keyString
BigInteger[] outputArray = new BigInteger[52];
// BigInteger[] keyArray = Helper.stringToBigIntegerArray(keyString);
BigInteger key = Helper.bigIntegerArraySum(keyArray, 8);
BigInteger[] shortKeyArray = Helper.ext... |
7b980ead-aaa5-426f-8f41-9c03042be4e5 | 0 | public int getStatus() {
return this.Status;
} |
144afce5-832f-4c77-a6f9-56daf4f28dee | 7 | public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
// @Override
// public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse response)throws Exception {
String code = req.getPar... |
21ec61b0-c352-40ee-81f2-d4178fd386d5 | 3 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
if ((clipboardContent != null)
&& (clipboardContent.isDataFlavorSupported(DataFla... |
479be841-2867-4cff-bd42-528e6a3aaafb | 3 | public boolean load(String audiofile) {
try {
setFilename(audiofile);
sample = AudioSystem.getAudioInputStream(getURL(filename));
clip.open(sample);
return true;
} catch (IOException e) {
return false;
} catch (UnsupportedAudioFileException e) {
return false;
} catch (LineUnavailableException... |
e3c43998-a3a0-4456-b869-2cdf8d8585d0 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Atendimento)) {
return false;
}
Atendimento other = (Atendimento) object;
if ((this.codatendimento == null && o... |
32ab5123-dfd0-458f-bc03-bffc045bb48c | 0 | public void addSubCategory(SubCategory scat)
{
this.subcategories.add(scat);
} |
cb57497e-a528-4b8e-a674-222c5819d307 | 9 | @Override
public boolean equals(Object o) {
if (null == o || !(o instanceof BytesKey)) {
return false;
}
BytesKey k = (BytesKey) o;
if (null == k.getData() && null == this.getData()) {
return true;
}
if (null == k.getData() || null == this.getD... |
9c06e962-8e63-4f58-916b-f16160ba3718 | 1 | public boolean isDownloadList() {
MediaUrlDao mediaUrlDao = new MediaUrlDao();
mediaUrlModelList = mediaUrlDao.getUrlList();
if (mediaUrlModelList.size() > 0 ) {
return true;
}
return false;
} |
8a5b7aa9-a8dc-4786-8258-e2d65a23c76b | 8 | public String weekday_name( int weekday )
{
String result = "";
if ( weekday == 1 )
{
result = "Sunday";
}
else if ( weekday == 2 )
{
result = "Monday";
}
else if ( weekday == 3 )
{
result = "Tuesday";
}
else if ( weekday == 4 )
{
result = "Wednesday";
}
else if ( weekday == 5 ... |
3e20ec73-ab68-44d5-be8c-90caee45a6d0 | 9 | private String getSFieldEntries(){
String output = "";
Integer counter = 0;
for (int i = 0; i < this.sObjects().length; i++) {
if(!this.objects.equals("all") && !this.objectList().contains(sObjects()[i].getName().toLowerCase() )){
continue;
}
if(this.limit != -1 && counter++ > this.limit){ break;}
... |
1ae5809c-cfad-42d8-b637-0a3acb0be177 | 6 | public void testInferenceProblemStoreReuse() {
System.out.println("\n**** testInferenceProblemStoreReuse ****");
CycAccess cycAccess = null;
try {
try {
if (connectionMode == LOCAL_CYC_CONNECTION) {
cycAccess = new CycAccess(testHostName, testBasePort);
} else if (connection... |
b48960b0-b78b-40f5-acff-be37c22758b4 | 9 | protected void genGender(MOB mob, MOB E, int showNumber, int showFlag)
throws IOException
{
if((showFlag>0)&&(showFlag!=showNumber))
return;
mob.tell(L("@x1. Gender: '@x2'.",""+showNumber,""+Character.toUpperCase((char)E.baseCharStats().getStat(CharStats.STAT_GENDER))));
if((showFlag!=showNumber)&&(showFlag... |
79c2cf24-a643-4005-9c11-71c2924bb5d0 | 1 | public void collideVertical() {
// check if collided with ground
if (getVelocityY() > 0) {
onGround = true;
}
setVelocityY(0);
} |
43245c1c-cbc1-40bb-8071-e3cd52cc6820 | 3 | public void setColor(int r, int g, int b){
double dR = mapIntColToDoubleCol(r), dG = mapIntColToDoubleCol(g), dB = mapIntColToDoubleCol(b);
if((colorR != dR)||(colorG != dG)||(colorB != dB)){
//only print the statement, if the color changed
colorR = dR;
colorG = dG;
colorB = dB;
println(colorR+" "+co... |
47947f8b-34cc-4a38-91a2-a0368145aba3 | 1 | public AudioThread(int port) {
try{
serverSocket = new ServerSocket(port);
} catch (Exception e){ e.printStackTrace(); }
} |
83bcbb48-07ba-439b-926a-ff70914c93f0 | 1 | private HTMLPanel createFeedbackPanel(List<String> history) {
StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.append("<div id = 'feedbackHistoryPanel'>"
+ "<div class='panelTitle'>"+constants.Feedback()+"</div>");
for (String h : history) {
htmlBuilder.append("<div class='Feedback... |
72f92c11-e5ac-44d0-8d6a-e8c4ec5ba968 | 0 | public void scrub() {
append(" Detergent.scrub()");
super.scrub(); // Call base-class version
} |
8df311e2-9725-4d9d-bd4b-8031e8c3d1d7 | 6 | @Override
public void mutate() {
Population offspring = new Population();
for (int i = 0; i < population.getSize(); ++i){
double r;
synchronized (rng){
r = rng.nextDouble();
}
if (r < PROBABILITY){
HiffIndividual mutant ... |
566dda85-392c-45ca-9e02-934dd22ac385 | 9 | @SuppressWarnings("unchecked")
private StringBuilder traverse(Object object, String path) throws IllegalAccessException, InvocationTargetException {
StringBuilder ret = new StringBuilder();
if (isSkipObject(object)) {
return ret;
}
Method[] methods = object.getClass().get... |
7aed50bb-e904-4aba-8f66-ff99b3d139d8 | 9 | protected int findLastUnion() {
int split = -1;
int depth = 0;
int end = start + length;
for (int i = end - 1; i != start; i--) {
switch (expr[i]) {
case '}':
case ']':
depth++;
break;
case '{':
case '[':
if (--depth == 0) {
... |
02fccbb7-77d8-49c9-9062-6dd2448294f4 | 8 | @Test
public void testToStringSockClosedSocketThread() {
LOGGER.log(Level.INFO, "----- STARTING TEST testToStringSockClosedSocketThread -----");
try {
server1.startThread();
} catch (IOException | ServerSocketCloseException | FeatureNotUsedException e) {
exception = t... |
1572b413-0550-43dd-8bd9-e6ea7239e02a | 1 | private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked
if(DescField51.getText() != null)
{
readsettings.write((String)jComboBox1.getSelectedItem(), DescField51.getText() );
JOptionPane.showMessageDialog(null, "Settings changed!", "Timetable... |
6b5292c3-fdd8-4fb1-b582-8807571ef32b | 0 | public Timestamp getCreateDateGmt() {
return this.createDateGmt;
} |
5d09e821-62bc-448e-aa9f-31c954860ab5 | 8 | private boolean connected(Country a, Country b) {
if (a == null || b == null) {
return false;
}
if (a.getUnit().getArmy() != b.getUnit().getArmy()) {
return false;
}
boolean[] visited = new boolean[42];
Queue<Country> searchQ = new ArrayDeque<Country>();
searchQ.add(a);
while (!searchQ.isEmpty()... |
69f7253b-6140-4b95-8d3a-70f5e3f58e45 | 0 | public int getManaRegen()
{
return manaRegen;
} |
1c3aed89-8b7d-4c40-86eb-dd9be8bb6f9d | 4 | public static char nextLetter(char letter) {
if (letter == 'Z') {
return 'A';
}
else if (letter == 'z') {
return 'a';
}
for (int i = 0; i < 51; i++) {
if (getAlphabet(true).charAt(i) == letter) {
return getAlphabet(true).charAt(i + 1);
}
}
//keeps compiler happy
return ' ';
} |
eae71764-f4e0-4a57-8ec4-0e0397c3a5de | 7 | protected Option[] discoverOptionsViaReflection() {
Class<? extends AbstractOptionHandler> c = this.getClass();
Field[] fields = c.getFields();
List<Option> optList = new LinkedList<Option>();
for (Field field : fields) {
String fName = field.getName();
Class<?> f... |
e58f9264-4568-49db-b54d-15cf85035cf9 | 6 | private static void printClass(ClassDoc cd) {
String type;
if (cd.isInterface()) {
type = "interface";
} else if (cd.isEnum()) {
type = "enum";
} else {
type = "class";
}
os.println("\\begin{texdocclass}{" + type + "}{"
+ HTMLToTex.convert(cd.name()) + "}");
os.println("\\label{texdoclet:"... |
5fb1431c-0555-4f24-801c-4fd786edc170 | 9 | private void traverseMutualGraph(KB_Node child, KB_Node knownParent) {
ArrayList<KB_Node> argPath = new ArrayList<KB_Node>();
ArrayList<ArrayList<KB_Node>> hold;
ArgInfo.mutationCheck[] mutationCheck = ArgInfo.mutationCheck.values();
int findMutationParent = 0, findMutationChild = 1;
... |
7c217413-fd56-4d9a-904c-35a0d4ed3c04 | 6 | public void resetMap() throws SlickException {
GameGrid.mapArray = new Tile[rows][columns];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
GameGrid.mapArray[i][j] = new Tile(i, j);
if (i == 0 || i == rows - 1 || j == 0 || j == columns - 1) {
GameGrid.mapArray[i][j].walkable = f... |
e611d6ee-c009-42bf-9fea-1c2a21160779 | 5 | @Override
public void moveComponent(final Integer diffX, final Integer diffY) {
if (diffX == null && diffY == null)
return;
super.moveComponent(diffX, diffY);
for (final Edge edge : this.task.getInputEdges()) {
edge.getEdgeComponent().updateComponent(null, this);
... |
d8986981-7837-4d67-930a-066728c4119b | 6 | public boolean setNodeParam(String region, String agent, String plugin, String paramKey, String paramValue)
{
boolean isUpdated = false;
int count = 0;
try
{
while((!isUpdated) && (count != retryCount))
{
if(count > 0)
{
... |
f81f8192-749c-486d-aea9-d8ee53340ff1 | 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... |
62a6e5cc-7915-4ed4-92a2-e2ab01d80a90 | 0 | public void setDepartment(int department) {
this.department = department;
} |
6edeefb8-6f35-44d2-b4d9-c3b173173f8e | 3 | public int checkbannedips()
{
try
{
BufferedReader in = new BufferedReader(new FileReader("./data/bannedips.txt"));
String data = null;
while ((data = in.readLine()) != null)
{
if (connectedFrom.equalsIgnoreCase(data))
{
return 5;
}
}
}
catch (IOException e)
{
System.out.pr... |
571659bd-cde9-4a92-8386-94ddd7b04eb3 | 7 | @Override public void draw(
HDR64Buffer dest, int x, int y,
int clipLeft, int clipTop, int clipRight, int clipBottom
) {
assert clipLeft >= 0;
assert clipTop >= 0;
assert clipRight <= dest.width;
assert clipBottom <= dest.height;
// TODO: more efficiently!
int skipY = clipTop > y ? clipTop - y : 0... |
09db3ff9-d39a-4c2b-beb6-ad5f7b938a4d | 7 | private final void step6()
{ j = k;
if (b[k] == 'e')
{ int a = m();
if (a > 1 || a == 1 && !cvc(k-1)) k--;
}
if (b[k] == 'l' && doublec(k) && m() > 1) k--;
} |
51a6f4e2-62e4-4005-a44d-59e011b1a394 | 7 | public Map<String, String> getPropertiesFromServer() {
if (this.connector == null) {
return Collections.emptyMap();
}
Map<String, String> properties = Collections.emptyMap();
try {
properties = this.connector.get();
if (this.backupMode && properti... |
2f8607c3-dd4f-4438-b4b7-d9e7fb8d5a41 | 8 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof AbstractPassengerCarriage))
return false;
AbstractPassengerCarriage other = (AbstractPassengerCarriage) obj;
if (baggageCurWeight != other.baggageCurWeight)
retur... |
f88e5818-019c-46ae-adca-6c9e73def7c2 | 3 | @Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == view.getLoginView().getLoginButton()){
try{
String username = view.getLoginView().getUsername().getText();
String password = view.getLoginView().getPassword().getText();
DAOFactoryLogin daoFactoryLogin = (DAOFactoryLogin) ... |
bcdcae61-7546-48f1-a28a-75820df0d800 | 3 | public List<LoginEntry> readLoginInfo(String playerName) {
List<LoginEntry> retList = new ArrayList<LoginEntry>();
try {
ResultSet rs = _sqLite.query("SELECT login.* FROM player, login "
+ "WHERE player.playername = '" + playerName + "' "
+ "AND player.id = login.id_player "
... |
3597ca58-ac61-4a0b-a7fe-6d6730836c4e | 1 | public static float speed() {
if (Level.state == 0) {
return 1;
} else {
return (float) (2 / Math.pow(2, Level.state));
}
} |
856a4187-d6f2-48a0-8aa9-b798105f5986 | 0 | public Plant(Field field, Location location)
{
alive = true;
this.field = field;
setLocation(location);
} |
fc57d892-45ce-4f1f-94cb-6e75712e077d | 1 | public boolean checkAccusation(Solution accusation) {
if (accusation.equals(solution))
return true;
else return false;
} |
aaa4b6bf-b44e-40e0-bdb3-6d6b5ca6ea48 | 0 | public void setSecond(T newValue) { second = newValue; } |
b9f8c7e6-4700-4f41-8c1b-bdfcc3fd5d92 | 6 | protected boolean executeInternal(RuleContext ruleContext)
{
Rule rule = ruleContext.getActiveRule();
if (null == rule)
{
throw new RuntimeException("RulesEngine.execute: Active Rule object has not been loaded on the RuleContext");
}
// a_Load dependencies
String ruleName = rule.getName... |
c5ad5fab-8f9d-4c3f-b664-a90387101cb5 | 8 | private void XspeedTFKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_XspeedTFKeyTyped
boolean OK = false;
if((evt.getKeyChar()=='-')&&(XspeedTF.getText().equals("")))OK = true;
if((evt.getKeyChar()=='.')&&(!XspeedTF.getText().equals("")&&!XspeedTF.getText().equals("-")))OK = true;
... |
2cfda134-000c-494b-8f49-c22467310376 | 5 | public void identifier() {
//le nom du joueur
nom = JOptionPane.showInputDialog(null, "entrer votre nom svp :",
"Entrer le nom", JOptionPane.PLAIN_MESSAGE);
if (nom == null || nom.equals("")) {
nom = "Anonyme";
}
//le type du jeu
if (m3.isSelec... |
4a1e1709-4972-4fff-aa6b-e1da43428454 | 5 | public void remove() {
AccountRemoveEvent Event = new AccountRemoveEvent(this.name);
iConomy.getBukkitServer().getPluginManager().callEvent(Event);
if (!Event.isCancelled()) {
Connection conn = null;
PreparedStatement ps = null;
try
{
conn = iConomy.getiCoDatabase().getConne... |
00060675-2f3e-4d1f-8463-d00d4fd0ab5b | 7 | public String get(final String uuid, final String... extra)
throws BadRequestException, DocumentNotFoundException, ServerErrorException
{
final String xslt = extra[0];
if (extra.length == 0 || xslt == null)
return super.get(uuid, extra);
final XMLDocument document;
... |
9c55dba8-c162-40f1-a0f3-b5ba86016b90 | 6 | private static void removeShit() {
for (StringBuilder s : outStrings) {
for (int i = 0; i < s.length(); i++) {
boolean deleted = false;
char c = s.charAt(i);
if (c == '[') {
int startNote = i;
int endNote = i + 1... |
bb0eba38-fbd7-45ad-971e-7163e6cbdfc8 | 1 | @Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
getStageManager().setStatge(StageManager.STAGE_MENUE, null);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.