method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
7f1e2710-523e-4204-9355-1e1ce2bea5d7 | 2 | public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
LineWidget lineOne = new LineWidget(shell, LineDirection.Horizontal, 50, 5, 10);
lineOne.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Li... |
1082761e-0f39-4a4d-89f4-5f0518d2423a | 7 | @Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_ENTER){
String text = input.getText();
data.setLastLine(text);
if (response){
data.setText(text + "\n" +data.getText());
}
... |
1b9d04d3-3750-442a-880a-ad1afaac9078 | 8 | protected void compareDatasets(Instances data1, Instances data2)
throws Exception {
if (!data2.equalHeaders(data1)) {
throw new Exception("header has been modified\n" + data2.equalHeadersMsg(data1));
}
if (!(data2.numInstances() == data1.numInstances())) {
throw new Exception("number of instan... |
dd2ae915-2a81-4512-9fc0-b9a056f6a329 | 0 | @Override
public void setResponseRemoteCallObject(IRemoteCallObject rco) {
response = rco;
} |
9c266eac-3b14-491c-b686-3f860f07791c | 5 | final protected void update(){
if(createWhen()){
list.add(create());
}
for(int i=0;i<list.size();i++){
SingleObject bl=list.get(i);
if(inRange(bl)){
whenCrash();
}
if(removeWhen(bl)){
list.remove(bl);
i--;
}
}
for(int i=0;i<list.size();i++){
SingleObject bl=list.get(i);
... |
ee31c5fa-7763-42c3-9351-9d8c6f49b6c3 | 0 | public void setIP(String ip) {
clientIP = ip;
} |
0b5c4588-f4cf-4e52-a312-9e86be332952 | 7 | private int minmax(Color p, Board b, int d, int cutoff,
ArrayList<Integer> moves) {
bestSoFar = Integer.MIN_VALUE;
moves.clear();
if (d == 0) {
return staticEval(p, b);
}
for (int move = 0; move < b.size() * b.size(); move += 1) {
if (b.isLegal... |
c39b6369-d40f-4f94-9d23-5a636558c4ae | 3 | public static ArrayList<BillItem> listBillItems(int billID) {
String query = "SELECT *"
+ "FROM `billItem`"
+ "WHERE `billItem`.`billId` = '%d';";
ArrayList<BillItem> listOfBillItems = new ArrayList<>();
DBA dba = Helper.getDBA();
try {
Resul... |
1c07307d-0fef-4384-b2eb-8744b91a9fb6 | 2 | private int setStats(int idx, int value){
int bonus = 0;
this.stats[idx] += value;
if(stats[idx] < 0){
bonus = stats[idx];
stats[idx] = 0;
}else if(stats[idx] > getMaxStats(idx)){
bonus = stats[idx] - maxStats[idx];
stats[idx] = maxStats[idx];
}
return bonus;
} |
2eee69b5-108c-4930-af10-b807a10340f0 | 8 | private final Path getPathFunc(final String[] names, int offset) {
Path p = this;
for (int i = offset; i < names.length; ++i) {
final String name = names[i];
final PathReference pWeak;
if (name.startsWith(".")) {
if (name.equals(".")) {
continue;
} else if (name.equals("..")) {
if (p.pare... |
0700dfef-b0c4-4841-9917-522714bbd23e | 7 | public void moveRight(){
switch (polygonPaint) {
case 0:
line.moveRight();
repaint();
break;
case 1:
curv.moveRight();
repai... |
71e28fef-4349-4e9e-8a42-1a7546fd85d8 | 4 | @SuppressWarnings("unchecked")
public Class<Mapper<Writable, Writable, Writable, Writable>> loadClass ()
throws IOException, ClassNotFoundException {
/* Load Jar file */
String jarFilePath = this.task.getJarEntry().getLocalPath();
JarFile jarFile = new JarFile(jarFilePath);
Enumeration<JarEntry> e = jarF... |
d746175e-8979-4b22-a84e-2a5c50e1b3e8 | 8 | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
//System.out.println(localName+" "+qName);
if (qName.equalsIgnoreCase("layer")) {
rightLayer = true;
}
else if (qName.equalsIgnoreCase("srs")) {//Odotetaan että XML-documentiss... |
7f5de43e-9ce4-4bef-a10d-9255012ac649 | 4 | private int checkHeight(BTPosition<T> current) {
if (current == null)
return 0;
int leftH = checkHeight(current.getLeft());
if (leftH == -1)
return -1;
int rightH = checkHeight(current.getRight());
if (rightH == -1)
return -1;
int diff = leftH - rightH;
if (Math.abs(diff) > 1)
return -1;
... |
07390d75-efde-4156-a47a-13c965cbc56c | 1 | public void sendInitiatedNotification() {
for (long uid : this.aWaitingId)
{
JointAppointmentInitiated notification =
new JointAppointmentInitiated(this);
Notification.add(uid, notification);
}
} |
c065e5fc-b2aa-4bb0-84b2-c489bcf9d734 | 4 | public int getequal2(String newtitle) {
try{
@SuppressWarnings("resource")
ObjectInputStream osi = new ObjectInputStream(new FileInputStream("bookcollection.txt"));///óϾ , Ͼ׳ϴ° ҽ߰
this.setBookCount(osi.readInt());
collectionb.clear();
for( int i= 0; i< this.getBookCount();i++){
Book ms = (Book)osi... |
5becc97f-ab5e-4c5e-9f69-5d7f71e6a402 | 9 | public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[59];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 0; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if... |
2873bbee-e912-4571-a68c-14df48967b43 | 4 | public void appendValue(String value) throws NoSuchMethodException {
try {
String currentValue = getValue();
setValue((currentValue == null ? "" : currentValue) + value);
} catch (NoSuchMethodException e) {
// try "add"
try {
Method method = target.getClass().... |
35fac22e-20b9-469e-863d-9bd641ddb946 | 7 | private void calculate() {
int termLength, payFreq;
loanScheduleTableModel.setRowCount(0);
// set PDL paydown amount
try {
String aprStr = aprTextField.getText();
calculator.setInstallAPR(Double.parseDouble(aprStr));
} catch (NullPointerException npe) {
... |
dbddaff6-be39-4ad6-a5cb-9191fb61f7cd | 1 | public void setFechaConstru(long fechaConstru) {
if (this.fechaConstru > fechaConstru)
this.fechaConstru = fechaConstru;
} |
992bd8b8-c076-4fac-aead-a392f8b59fa5 | 4 | public TableModel Update() {
String columnNames[] = { "Lib Classe","Liste Filiere"};
DefaultTableModel defModel = new DefaultTableModel();
defModel.setColumnIdentifiers(columnNames);
SequenceController seq_classe= new SequenceController();
seq_classe.CreateSequence("SEQ_CLASSE")... |
b529e09a-57f2-4d3d-8b8c-f3bf490effb0 | 2 | public void tick() {
entities.removeAll(removeList);
snake.removeEntities(removeList);
for (Entity entity : entities) {
((EntityBody) entity).tick();
Random r = new Random();
int vx = r.nextInt(30)-15;
int vy = r.nextInt(30)-15;
snake.particles.create(entity.x, entity.y,vx,vy, Color.WHITE);
}... |
30818f5f-6f23-4cb9-8ff8-6758c61f81f7 | 8 | void output(int code, OutputStream outs) throws IOException {
cur_accum &= masks[cur_bits];
if (cur_bits > 0)
cur_accum |= (code << cur_bits);
else
cur_accum = code;
cur_bits += n_bits;
while (cur_bits >= 8) {
char_out((byte) (cur_accum & 0xff), outs);
cur_accum >>= 8;
... |
475f6070-ad67-4161-9350-6031ba92c8f6 | 2 | public static boolean propertyEqualsAsBoolean(PropertyContainer container, String key, boolean test_value) {
if (container != null) {
try {
boolean value = getPropertyAsBoolean(container, key);
return value == test_value;
} catch (NullPointerException npe) {
return false;
}
} else {
throw ne... |
1cc65202-fc25-4d1d-a0c9-b36088a174c9 | 8 | static public String repair(String input) {
int cast = 0;
if( input.length() == 3) {
char num1 = '\0', num2 = '\0';
char c = '\0';
for(int i = 0; i < input.length(); i++) {
char temp = input.charAt(i);
if(Character.isDigit(temp)) {
if( num1 == '\0') {
num1 = temp;
cast++;
}
... |
b25de456-1ff1-49df-bc05-dd5c37c375aa | 2 | public boolean intervalContainsGeometry(RoadGeometry section, int beginning, int end) {
for (int i = beginning; i <= end; i++) {
if (stakes.get(section).contains(i)) {
return true;
}
}
return false;
} |
29b2d93a-a80f-480e-a1c8-3fef3425ebda | 4 | public String[] promptKeyboardInteractive(String destination,
String name,
String instruction,
String[] prompt,
boolean[] echo) {
Container ... |
04ade75e-a5a9-4218-a26b-6dcc4cea5dc2 | 3 | public static boolean date(int h, int m) {
String hh, mm;
if (h == 0) {
if (m < 10)
return true;
else {
mm = m + "";
return mm.charAt(0) == mm.charAt(1);
}
} else if (h < 10) {
hh = h + "";
mm = format(m);
return hh.charAt(0) == mm.charAt(1);
}
hh = format(h);
mm = format(m);
... |
233f217a-4953-40c5-9ed7-22da3d1a05d7 | 2 | public boolean equals(final Object duration) {
if (duration == this) {
return true;
}
if (duration instanceof Duration) {
return compare((Duration) duration) == DatatypeConstants.EQUAL;
}
return false;
} |
5efae2f2-6c51-4c30-baca-af2070ddd4e6 | 4 | public void write_single(short address, short msg) throws IOException {
if ((this.mode==0) || (this.mode==SET_MODE_I2C_SERIAL)) this.set_mode(SET_MODE_I2C_100);
byte[] data=new byte[3];
data[0]=(byte)RW_SINGLE;
data[1]=(byte)address;
data[2]=(byte)msg;
byte[] result = this.sendAndRec... |
b1e9fe89-b530-48f8-a106-b7d520369ea7 | 3 | void clear () {
checked = grayed = false;
texts = null;
textWidths = new int [1];
fontHeight = 0;
fontHeights = null;
images = null;
foreground = background = null;
displayTexts = null;
cellForegrounds = cellBackgrounds = null;
font = null;
cellFonts = null;
cached = false;
super.setText ("");
super.setIm... |
f6806146-753f-463b-90b1-9bbd6430f088 | 8 | public static String readDecodedString(LittleEndianAccessor llea) {
int strLength;
byte b = llea.readByte();
if (b == 0x00) {
return "";
}
if (b >= 0) {
// UNICODE BABY
if (b == 0x7F) {
strLength = llea.readInt();
} else {
strLength = (int) b;
}
if (strLength < 0) {
log.error... |
19199952-7856-48e5-a362-62157a9d33c9 | 7 | public Entity getEntityByClass(String className){
for(Class<?> c : entitys){
if(c.getName().equals(className)){
try {
return (Entity) c.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
}
try {
Class<?> c = Class.forName(className);
if(Entity.class.isAssignabl... |
c231160c-469f-498f-928b-76e1ca6d608d | 9 | @SuppressWarnings("unchecked")
public boolean isInitialized() {
// Check that all required fields are present.
for (final FieldDescriptor field : getDescriptorForType().getFields()) {
if (field.isRequired()) {
if (!hasField(field)) {
return false;
}
}
}
// Check ... |
80f17aae-677a-4af8-9549-3e5cfb0cc313 | 7 | public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if(this.codCliente <= 0){
errors.add("Errores", new ActionMessage("error.codigo.cliente.no.valido"));
}
if(this.codMedida <= 0){
er... |
af937606-5772-4dae-8d3b-5ef17b8933bd | 0 | public String toString() {
return this.getPrefix() + this.getNick();
} |
d9ce43d1-53aa-438b-b9b4-f67b2b97d756 | 5 | private static double[] getSupportPoints(int lineNumber, double[] lowPrices) {
double[] sPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 999999999;
for(int j=-28;j<=0;j++){
if((i+j>=0) && (i+j<lineNumber-1) && lowPrices[i+j]<pr... |
33533a88-138d-451e-9be6-3e4a96e160b0 | 9 | @Override
public void broadcast(AIPlayer p, gamelogic.PublicGameBoard board) {
String message = "5/" + p.getID() + ",";
BoardCoordinate c = _target.location();
int v = -1;
boolean exp = board.isExpanded();
int nv = (exp)? NUM_VERTICES_EXP:NUM_VERTICES;
Map<Integer, List<Integer>> x_gr = (exp)? X_GROUPS_EXP... |
8e61345b-4b0a-4d31-ae44-694412ec49a6 | 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... |
3b32c07e-8ab6-4059-a175-a10bdcfff26b | 2 | public int nEquipa(String cod_competicao){
try {
int i=0;
Statement stm = conn.createStatement();
ResultSet rs = stm.executeQuery("SELECT cod_equipa FROM EquipaCampeonato where cod_competicao='"+cod_competicao+"'");
for (; rs.next(); i++);
... |
321cfed6-4134-42b9-b49c-a10a6df1aa63 | 1 | public void remover(InstituicaoSubmissao instituicaosubmissao) throws Exception
{
String sql = "DELETE FROM instituicaosubmissao WHERE id = ?";
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setLong(1, instituicaosubmissao.getId());
stmt.executeUpdate();
... |
30c42044-0cba-43c8-a178-70d97f080b2b | 6 | private void compileParameters() throws IllegalArgumentException, IllegalAccessException, MalformedLayarRequestException {
Field[] fields = LayarGetPOIsRequest.class.getFields();
for (Field f : fields) {
String fName = f.getName();
Class fClass = f.getType();
if(parameters.containsKey(fName)) {
String[... |
b675596f-bae3-4160-8e5d-3b464d0f29c5 | 1 | public void testWithFieldAdded_unknownField() {
YearMonth test = new YearMonth(2004, 6);
try {
test.withFieldAdded(DurationFieldType.hours(), 6);
fail();
} catch (IllegalArgumentException ex) {}
} |
f7cb4906-22ef-45d9-9b4c-d8cd9fd7d622 | 3 | public Aluno pesquisaAlunoPelaMatricula(String matricula)
throws AlunoInexistenteException {
Aluno alunoAchado = null;
for (Aluno e : alunos) {
if (e.getMatricula().equals(matricula)) {
alunoAchado = e;
break;
}
}
if (alunoAchado != null) {
return alunoAchado;
} else {
throw new AlunoI... |
d8bc62d1-a6e5-4da2-babb-46aa17b373f4 | 3 | @Override
public void valueChanged(ListSelectionEvent event) {
if (!event.getValueIsAdjusting()) {
ListSelectionModel lsm = (ListSelectionModel) event.getSource();
if (lsm.isSelectionEmpty() == false) {
try {
int selectedRow = lsm.getMinSelectionIndex();
// da in der Tabelle die Autosortierung ... |
22a67782-ee66-4fd7-b331-07cd88366123 | 8 | final void method3049(ByteBuffer class348_sub49, int i, int i_39_) {
while_209_:
do {
try {
anInt9384++;
if (i_39_ == 31015) {
int i_40_ = i;
do {
if ((i_40_ ^ 0xffffffff) != -1) {
if ((i_40_ ^ 0xffffffff) != -2) {
if (i_40_ == 2)
break;
break while_209_;
}
... |
fe15d6b7-21cd-4991-9eb6-23b5d953db09 | 7 | public int findBomb(int startIndex, int stopIndex) {
startIndex=(startIndex+LANDNUM)%LANDNUM;
stopIndex=(stopIndex+LANDNUM)%LANDNUM;
if(startIndex>stopIndex){
for(int i=startIndex;i<LANDNUM;i++){
LandForm tempLandForm=(LandForm)landList.get(i);
if(temp... |
1573bf8a-5eaa-44f5-9e7c-b013c0368b0c | 6 | @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length < 1) {
showHelp(sender);
return true;
}
String[] newArgs = new String[args.length - 1];
for (int i = 1; i < args.length; i++) {
newArgs[i - 1] = args[i];
}
AbstractCommand com... |
c6d5e31e-8d1d-4677-8978-67c3b05c1cf2 | 7 | public static int Compare(NaturalNumber n, NaturalNumber m)
{
int i, comparison;
if(n.size != m.size)
{
/* the longer one is not necessarily the greater, if the
difference is all leading zeroes -- scan the excess: if there
is a nonzero digit, then the longer one is the greater, else
proc... |
4f49c892-f1df-4e5e-bb87-8fb901f4a275 | 8 | public boolean defilerTemps(Joueur j)
{
/* Methode qui compare le temps du systeme au temp de jeu d'un joueur.
* Met fin à la partie si le temps de jeu est ecoule. */
// MAJ temps
boolean fini = false;
do
{
try
{
Thread.sleep(1000);
j.setTempsEcoule(j.getTempsEc... |
6d9d0aae-d761-4920-9c91-604f5e060753 | 5 | private void bfs(Graph G, int s)
{
Queue<Integer> q = new LinkedList<Integer>();
q.add(s);
marked[s] = true;
while (!q.isEmpty())
{
adjCount[s]++;
int v = q.remove();
for (int w : G.adj(v))
if (!marked[w])
{
edgeTo[w] = v;
marked[w] = true;
distTo[w] = distTo[v] + 1;
... |
d206dca7-4da3-4f35-821f-ba2b43ca1994 | 8 | protected String getJSONBaseString() {
StringBuilder json = new StringBuilder();
if(this.getId()!=null)
json.append("\"id\":").append(JSONObject.quote(this.getId())).append(",");
json
.append("\"type\":\"").append(this.getType()).append("\"," )
.append("\"text\":").append(JSONObject.quote(this.getText())... |
816df931-518b-4aed-b28c-4d789883953c | 5 | public void advance() {
if (location == null) {
location = new Location(map.start[0], map.start[1]);
grid.add(location, this);
}else if(health <= 0) {
kill();
}else{
if(step > speed) {
step = 0;
Location l... |
9730faa5-2624-4aa4-abb7-6b36dd1d3ade | 3 | public void putRecent(String f) {
// Trim from back end if too long
while (recentNames.size() > maxRecentFiles - 1) {
recentNames.remove(recentNames.size()-1);
}
// Move filename to front: Remove if present, add at front.
if (recentNames.contains(f)) {
recentNames.remove(f);
}
recentNames.add(0, f);... |
f6b53ee0-743b-4653-bbed-6bf1416477a9 | 2 | public ArrayList<ArrayList<String>> readData() throws IOException {
ArrayList<ArrayList<String>> datas = new ArrayList<ArrayList<String>>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String str = "";
while (!(str = reader.readLine()).equals("")) {
... |
3d310bf4-ec28-45ad-ab3b-9d56531fc35d | 0 | public static void main(String[] args) {
FilePrompt.filePrompt();
} |
dad704d9-17b0-4906-9f06-f78a0adc8744 | 1 | public Question(String question,String a,String b,int i){
if(i > 1){
i = 1;
}
formattedQuestion = question;
answers = new String[2];
answers[0] = a;
answers[1] = b;
answer = i;
} |
248ed3fb-733f-4dc3-a27c-b4f522570a71 | 2 | @Override
public void mouseClicked(MouseEvent event) {
if(event.getClickCount()==2){
int linha = janela.getTabelaContatos("todos").getSelectedRow();
System.out.println("Linha selecionada foi "+linha);
} else if (event.getClickCount()==1){
}
} |
74e4855c-a6d1-4f43-a5c5-d7b83264d4a9 | 0 | private void onIncorrect()
{
isCorrect = false;
dispose();
} |
356624c2-9e49-40a4-834c-20aff231864b | 9 | public static void moveAll() {
Map map = Map.getInstance();
Random rand = new Random();
int num = 0;
for (Party enemy : list) {
num = rand.nextInt(10);
if(num == 0 && map.moveParty(enemy, Direction.NORTH))
enemy.move(Direction.NORTH);
else if(num == 1 && map.moveParty(enemy, Direction.SOUTH... |
81aae110-c158-4916-81bd-cb48093ec9a6 | 9 | private void setField(FieldDictionary dictionary, OMMFieldEntry fentry, FidDef fiddef,
boolean ripple, boolean add)
{
FieldValue field = getValue(fiddef.getName());
if (field == null)
{
if (add)
{
short type = fentry.getDataType();
... |
9fb4fbda-b841-4d30-974b-af3c4c102046 | 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;
} |
e9c57661-77c0-4445-acfb-734f843e7e4f | 8 | private void hazardCheckLine(int p,Point2D.Double p1,Point2D.Double p2) {
int h = 0;
Point2D.Double pointIntersect;
Line2D.Double lineR = new Line2D.Double();
lineR.setLine(p1, p2);
while (h < main.map.hazards) {
h++;
MapHazard hz = main.map.ge... |
f5186550-f149-41b0-a788-0a6b29f6bec9 | 8 | private void printSemiIfNeed(JsNode node) {
if (!(node instanceof JsFunction) &&
(node instanceof JsLiteral ||
node instanceof JsInvocation ||
node instanceof JsArrayAccess ||
node instanceof JsBinaryOperation ||
node instanceof JsUnaryOperation ||... |
1b4930ae-dfbf-4168-8308-d0002221c26d | 9 | private static A convert(String regex) {
List<String> groups = splitAndGroup(regex);
A curr = new A();
if (groups.size() > 1) {
for (String s : groups) {
A tmp = convert(s);
curr.stateNames.addAll(tmp.stateNames);
curr.transitionsForState.putAll(tmp.transitionsForState);
curr.addTransition(cur... |
57aa2184-cefa-4532-803e-4472b398265f | 8 | public static void compileJarAssetsFile(String prjCompileDir, String prjGameName, String prjDir) {
File selectedFile = new File(prjCompileDir + File.separator + prjGameName.toLowerCase() + ".assets.jar");
File content = new File(prjDir);
File[] files = content.listFiles();
assert files !... |
2f0a6db5-f107-404b-bd8f-04a16dcde61d | 9 | public boolean equals(Object obj)
{
if (!(obj instanceof JavaAdapterSignature))
return false;
JavaAdapterSignature sig = (JavaAdapterSignature) obj;
if (superClass != sig.superClass)
return false;
if (interfaces != sig.interfaces) {... |
a7f8e2e6-cf13-40fb-a7fe-9918526a5222 | 1 | public MainFrame(User user) {
super(JGSystem.NAME);
this.user = user;
this.DEFAULT_MAIN_FRAMESIZE = new Dimension(1024, 768);
this.PREFERRED_PANEL_SIZE = new Dimension(1024-5-25, 768-25-25);
this.setSize(this.DEFAULT_MAIN_FRAMESIZE);
this.setMaximumSize(this.DEFAULT_MAIN_FRAMESIZE);
this.setLayout(new Bor... |
c807f286-f1c8-41ba-b218-3bf7424ce7c5 | 9 | private void genTextMaps(){
Session session = sessionFactory.openSession();
session.beginTransaction();
Query q1 = session.createQuery("from Intro_learn");
@SuppressWarnings("unchecked")
List<Intro_learn> list_intro = q1.list();
Intro_learn intro = new Intro_learn();
String introduction;
text_cls tc;... |
cf153d92-663f-4410-87e9-7f0660d1a634 | 8 | final public NodeToken ValueExpansion() throws ParseException {
Token value;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VALUE_IDENTIFIER_T:
value = jj_consume_token(VALUE_IDENTIFIER_T);
break;
case NOT_IMPLEMENTED_T:
value = jj_consume_token(NOT_IMPLEMENTED_T);
break;
case ... |
20088638-c1a4-4a00-aafd-420d9abaafe8 | 0 | private PDestination(String whereTo) {
label = whereTo;
} |
f85dcf62-2015-4606-865e-41d995a23015 | 1 | public static void createWindow(int width, int height, String title)
{
Display.setTitle(title);
try
{
Display.setDisplayMode(new DisplayMode(width, height));
// DisplayMode displayMode = null;
// DisplayMode[] modes = Display.getAvailableDisplayModes();
//
// for (int i = 0; i < modes.leng... |
7da3b6ac-dddf-430c-8858-7913f81d4ac7 | 6 | @Override
public void update() {
super.update();
boolean doUpdate = !gameController.getIsMasterPaused();
HUD hud = null;
for (int i = 0; i < huds.size(); i++) {
hud = huds.get(i);
if (doUpdate || hud.getName().equals("Pause") || hud.getName().equals("Tutori... |
f1107e70-5b16-4c32-bb0c-aff1e08667f1 | 3 | private MetadataEntry getUserMetadata(GoogleDocs googleDocs) throws ServiceException
{
DocsService docsService = new DocsService("spring-social-google-docs/1.0");
docsService = googleDocs.setAuthentication(docsService);
try
{
return docsService.getEntry(new URL(METADATA_... |
d713919d-9194-4c0d-b6e9-44bfb98486bd | 1 | public ArrayList<String> getAllArtists()
{
ArrayList<String> songArtists = new ArrayList<>();
//Run through each song and get artist, set in array
for (Song s : songList)
{
songArtists.add(s.getArtist());
}
//Return array of artists
... |
8ea367f2-b0c5-4fb9-b022-eecb1c9b38bb | 5 | @Override
public double train(Collection<_Doc> trainSet) {
ArrayList<_Doc> graph = new ArrayList<_Doc>();
String lastItemID = null;
for(_Doc d:trainSet) {
if (lastItemID == null)
lastItemID = d.getItemID();
else if (lastItemID != d.getItemID()) {
if (graph.size()>10)//otherwise the graph is too ... |
586c57bc-1a65-499b-a30d-a50a2a6439b6 | 3 | public static void main(final String[] args) {
parseArgs(args);
/* load icons */
for (final Command c : Command.values()) {
final ImageIcon image = loadIcon("/genetic/res/"
+ c.toString()
+ ".png");
COMMAND_ICONS.put(c, image);
}
... |
4a202313-51c8-4f77-a7c5-d720a0675fb3 | 0 | @Test
public void testGetMarker() {
System.out.println("getMarker");
Mark instance = new Mark(6,9);
int expResult = 6;
int result = instance.getMarker();
assertEquals(expResult, result);
} |
5c34fcd3-962d-4397-bb40-cea101564c4c | 0 | public void setItemId(int itemId) {
this.itemId = itemId;
} |
59f819d0-9b49-4ff0-a2e4-a1734da7a6a6 | 5 | @Test
public void depthest11opponent3()
{
for(int i = 0; i < BIG_INT; i++)
{
int numPlayers = 4; //assume/require > 1, < 7
Player[] playerList = new Player[numPlayers];
ArrayList<Color> factionList = Faction.allFactions();
playerList[0] = new Player(chooseFaction(factionList), new SimpleAI());
... |
30c0306c-0fbe-46f3-9c8b-71e04da0c836 | 9 | @SuppressWarnings({ "deprecation", "static-access" })
public void loadInventory() {
try {
Connection conn = MineAuction.db.getConnection();
PreparedStatement ps = conn
.prepareStatement("SELECT * FROM ma_items WHERE playerID=? ORDER BY qty ASC LIMIT 54");
// Prepare statement
int playerID = Databas... |
85e4aa9e-b3c5-46f4-a4f1-b3f38bcfd777 | 2 | public static boolean isBlankRow(Row row) {
Iterator<Cell> iterator = row.iterator();
boolean isBlankRow = true;
while (iterator.hasNext()) {
Cell curCell = iterator.next();
if (curCell.getCellType() != Cell.CELL_TYPE_BLANK) {
isBlankRow = false;
break;
}
}
return isBlankRow;
} |
d9d86ba6-9734-4d7e-86ed-f70329f02fab | 8 | public static void main(String[] args) throws Exception{
if(ClientModel.isMac()){
System.setProperty("com.apple.mrj.application.apple.menu.about.name","Enigma");
System.setProperty("apple.laf.useScreenMenuBar", "false");
}
splash.setVisible(true);
Mode mode=Mode.NORMAL;
if(args.len... |
43587592-af4d-4388-b815-b52cc37cc4ef | 7 | public static void main(String[] args) throws IOException {
StringBuilder out = new StringBuilder();
l = new Cube[223]; // Pre calculate
int cont = 0;
long a = 0;
double a_3 = 0, aux;
for (int i = 2; i <= 199; i++)
for (int j = i; j <= 199; j++)
if (p3(i) + p3(j) <= LIMIT)
for (int k = j; k <= 1... |
30056950-15a9-4a0a-a4b2-a821dff86181 | 2 | public Collection<String> getCatNos() throws SQLException
{
if (catnos == null || catnos.size() == 0)
catnos = GetRecords.create().getCatNos(number);
return catnos;
} |
7b080399-85bf-47dc-86f7-1a53d33f53db | 4 | @SuppressWarnings("unchecked")
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
String serviceName = (String) table.getValueAt(row, column - 1);
HashMap<String, String> userStatusAssoc;
User user = instanceGUI.getUser();
// Check if a t... |
1c5f2f96-3633-4bce-9b4b-8c5b31616dc4 | 0 | public int getHora() {
return hora;
} |
58ca45ab-9fec-4ddd-b834-edc900046b3e | 1 | public boolean operate(Boolean boolean1, Boolean boolean2) {
boolean b1 = (java.lang.Boolean) boolean1;
boolean b2 = (java.lang.Boolean) boolean2;
return b1 && b2;
} |
6f927167-5508-49ed-a3c7-e70b6f877d4e | 3 | public void startDownloading(ThreadPoolExecutor executorService) {
if (this.started) throw new IllegalStateException("Cannot start download job that has already started");
this.started = true;
if (this.allFiles.isEmpty()) {
//Launcher.getInstance().println("Download job '" + this.name + "' skipped as... |
f0097420-2654-4770-a4bd-4fef9ac0270d | 8 | @SuppressWarnings("incomplete-switch")
/* package */void processInputMessage (BitTorrentMessage msg) {
assert msg != null;
switch (msg.getMessageType()) {
case HANDSHAKE_START:
HandShakeStart hss = (HandShakeStart) msg;
remoteFlags.or(hss.getFlags());
... |
35b06cf5-d74f-4b67-a190-e4f3f1c37033 | 8 | public Map<String,Object> getMapObject(){
Map<String, Object> desc = new LinkedHashMap<String, Object>();
if ( format_ != null ) desc.put("format",format_);
if ( name_ != null ) desc.put("name",name_);
if ( subscribe_ != null ) desc.put("subscribe",subscribe_);
if ( visibility_ != null ) desc.put("visibility"... |
b823d135-a99d-4357-8c94-eb7a3f27f045 | 7 | @Override
public void mouseExited(MouseEvent e) {
switch (((JButton) (e.getSource())).getText()) {
case "Start":
break;
case "Turn":
break;
case "Move":
break;
case "Shoot":
break;
cas... |
8ba16673-cdf8-419c-866e-0aaa5c0aa6e3 | 7 | public ClientConnectionProperties(ClientDavParameters clientDavParameters) throws ConnectionException {
super(
null,
null,
clientDavParameters.getUserName(),
clientDavParameters.getUserPassword(),
clientDavParameters.getCommunicationParameters().getSendKeepAliveTimeout(),
clientDavParameters.g... |
6fe138dc-69bc-4af7-8fdd-c1247deaf91b | 6 | public static void main(String[] args) {
if(args.length < 1) {
System.out.println("Erreur : vous devez spécifier un jeu à lancer");
System.exit(1);
}
if(args[0].equals("diaballik")) {
new Diaballik(false);
}
else if(args[0].equals("diaballik_va... |
6f010dea-7e81-487d-b06c-0d69ddd94646 | 3 | public void login() throws Throwable {
char[] pword_onChar = passwordField.getPassword();
String pword = "";
for (char k : pword_onChar) {
pword += k;
}
Users user = new Users();
Integer auth = new Integer(user.login(textField.getText(), pword));
System.out.println(auth);
if (textField... |
61e86106-c3ce-4149-8ce1-80a277cea989 | 8 | public static ArrayList <RecipeData> loadData() {
File load = new File("resources/files/RecipeData/");
Gson loader = new Gson();
ArrayList <RecipeData> res = new ArrayList <RecipeData>();
for (File f : load.listFiles()) {
BufferedReader br = null;
FileReader fi = null;
try {
fi = new FileReader(f);... |
dcfbee0e-f6ca-4a4a-8fc1-67eba1de7bc0 | 5 | private void updateNodeColours(){
if(armyColours)
{
for(Node N : network)
{
if(N.id != clicked)
{
D.getGraphPanel().setNodeColorNoRepaint(N.id, Color.getHSBColor(colourMap.get(((GossipicoFAB)N.getFAB(0)).beacon.A), 1f, 1f));
... |
4e908952-543f-4a8e-bbf1-a4e151e63048 | 3 | public void visitCallMethodExpr(final CallMethodExpr expr) {
if (expr.receiver == from) {
expr.receiver = (Expr) to;
((Expr) to).setParent(expr);
} else {
for (int i = 0; i < expr.params.length; i++) {
if (expr.params[i] == from) {
expr.params[i] = (Expr) to;
((Expr) to).setParent(expr);
... |
11d40240-3192-4923-9a68-2b11c38d5230 | 8 | private void set(String id, String in) {
if (id.equals(MovieShowColumn.HOUSE_ID)) {
house_id = in;
}
else if (id.equals(MovieShowColumn.SHOWING_ID)) {
showing_id = in;
}
else if (id.equals(MovieShowColumn.MOVIE_ID)) {
movie_id = in;
}
... |
8770fc65-3015-490f-907e-5e2fd5a2fcef | 9 | public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(System.out);
String line;
TreeSet<String> set = new TreeSet<String>();
while ((line = br.readLine()) != null) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.