method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b9a3fd1f-fd86-498c-a970-5e67b93ece9f | 3 | public JCheckStatement(Configuration configuration,
Map<Class<?>, Class<? extends Gen<?>>> classGenerators,
FrameworkMethod method,
Object test)
{
this.configuration = configuration;
this.classGenerators = classGenera... |
4ba92eb5-d831-4c3f-8b72-e2802c67fdb0 | 1 | public void sendData(String data) {
DatagramPacket packet = new DatagramPacket(data.getBytes(), data.getBytes().length, ipaddress, port);
try {
socket.send(packet);
} catch (IOException e) {
e.printStackTrace();
}
} |
371a1e3f-8475-4147-a30a-376c032124b5 | 7 | private void createPanel() {
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(2, 2, 2, 2);
c.anchor = GridBagConstraints.WEST;
JLabel label;
int i = 0;
String s = Modeler.getInternationalText("EmbeddedModel");
for (Iterator it = page.getComponentPool().getModels().iterator(); it.h... |
84325e72-2714-463d-81a1-9bf8eb9971e8 | 8 | public void renderSprite(int xp, int yp, Sprite sprite, boolean fixed) {
if (fixed) {
xp -= xOffset;
yp -= yOffset;
}
for (int y = 0; y < sprite.getHeight(); y++) {
int ya = y + yp;
int ys = y;
for (int x = 0; x < sprite.getWidth(); x++) {
int xa = x + xp;
int xs = x;
if (xa < 0 || xa >... |
6a9bcea2-4dda-4f33-bf7b-76aa8fcb72b4 | 4 | public void keyReleased(KeyEvent e) {
// Stop moving players
int key = e.getKeyCode();
if (key == KeyEvent.VK_W) {
p1.setVelY(0);
}
else if (key == KeyEvent.VK_S) {
p1.setVelY(0);
}
else if (key == KeyEvent.VK_DOWN) {
p2.setVe... |
129181c7-ff45-4e1a-aa82-850c5d61d17f | 1 | public Treatment getTreatment(int index){
try{
return treatment.get(index);
} catch (IndexOutOfBoundsException e){
}
return null;
} |
4d67d174-c2f2-4e93-9b69-c9f3abd44699 | 6 | private void readVersions( Element versionsElement )
{
NodeList nl = versionsElement.getChildNodes();
for ( int i=0;i<nl.getLength();i++ )
{
org.w3c.dom.Node node = nl.item( i );
if ( node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE )
{
String nodeName = node.getNodeName();
if ( nodeName != ... |
55a345a4-a297-448a-b0a6-27d3dde890a5 | 6 | boolean setMapSize(int x) {
if (num_play >= 2 && num_play <= 4) {
if (x < 5 || x > 50)
return false;
} else {
if (x < 8 || x > 50)
return false;
}
return true;
} |
3c71b423-3669-4bdd-9d91-2d53b25f7959 | 3 | public void noteOff(int note, int velocity) {
//find the voice that corrosponds to this key and release it
for (int i = 0; i < voices.length; i++) {
if (voices[i].midiNote == note && voices[i].isPressed) {
voices[i].release();
break;
}
}
... |
3d7272e7-9d9a-4312-b22d-02f7e2af88da | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
// Add this menuItem to the parent menu.
((JMenu) GUITreeLoader.elementStack.get(GUITreeLoader.elementStack.size() - 2)).add(this);
} |
11126894-782a-42bd-9d57-459ceea7d462 | 2 | public void mergeGenKill(Collection gen, SlotSet kill) {
grow(gen.size());
big_loop: for (Iterator i = gen.iterator(); i.hasNext();) {
LocalInfo li2 = (LocalInfo) i.next();
if (!kill.containsSlot(li2.getSlot()))
add(li2.getLocalInfo());
}
} |
4c89ac34-e603-47a8-b698-5d4143c8d53d | 2 | public Transport open() {
EventThread.exec(new Runnable() {
@Override
public void run() {
if (Transport.this.readyState == ReadyState.CLOSED || Transport.this.readyState == null) {
Transport.this.readyState = ReadyState.OPENING;
Tra... |
9c137093-c33c-4e87-a1cb-d0b72123f324 | 2 | public static boolean checkForUnique(String str){
HashSet s=new HashSet();
int count=0;
boolean value=false;
while(count<str.length()){
if(s.contains(str.charAt(count))){
return false;
}else{
s.add(str.charAt(count));
value=true;
}
count++;
}
return value;
} |
c9d3f0fb-cef3-4304-a69e-c2142665c226 | 1 | public void startSQL() {
try {
InputStream in = this.getClass().getResourceAsStream("/sols/Util/jdbc.properties");
Properties pp = new Properties();
pp.load(in);
url = pp.getProperty("jdbc.url");
user = pp.getProperty("jdbc.username");
pas... |
f8319a44-6c45-403d-9872-b3b300140d1d | 1 | public void decompile(String className, Writer writer,
ProgressListener progress) throws java.io.IOException {
if (searchPath == null) {
String classPath = System.getProperty("java.class.path").replace(
File.pathSeparatorChar, altPathSeparatorChar);
searchPath = new SearchPath(classPath);
}
ClassIn... |
d912185e-bc4b-4de3-880c-8fa6232794d6 | 8 | public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Type)) {
return false;
}
Type t = (Type) o;
if (sort != t.sort) {
return false;
}
if (sort == OBJECT || sort == ARRAY) {
if (len != t.len) {
return false;
}
for (int i = off, j = t.off, end =... |
0e28e668-e9fd-44c4-a4c1-c39ddd65f2f7 | 8 | void substitute(char c, State state, StateQueue nextQ,
double positionalEditPenalty) {
if (state.tokenComplete() && c != ' ') {
double score = state.mScore
+ mLM.log2Estimate(state.mContextIndex,' ')
+ mEditDistance.substituteWeight(c,' ')
... |
0817ef66-8d23-4d9a-8ba5-fd5f6eea9a45 | 6 | public final LogoParser.array_return array() throws RecognitionException {
LogoParser.array_return retval = new LogoParser.array_return();
retval.start = input.LT(1);
Object root_0 = null;
Token char_literal47=null;
Token char_literal48=null;
Token char_literal49=null;... |
c035abd7-524c-439d-81e0-5c75276d45c4 | 2 | private static Sprite getSprite(int index, Archive container, String name) { // method207
long l = (TextUtil.imageToLong(name) << 8) + index;
Sprite sprite = (Sprite) Interface.spriteCache.get(l);
if (sprite != null) {
return sprite;
}
try {
sprite = new Sprite(container, name, index);
Interface.spri... |
38f371dd-78f6-4aa6-b4f4-3af7a03c92d0 | 1 | public void write(AnnotationsWriter writer) throws IOException {
int num = values.length;
writer.arrayValue(num);
for (int i = 0; i < num; ++i)
values[i].write(writer);
} |
938168e0-b1c4-4135-bcc5-a3c0e405e3f2 | 0 | public void removeSkills()
{
remove(skillOne);
remove(skillTwo);
remove(skillThree);
remove(skillFour);
remove(skillFive);
revalidate();
repaint();
} |
496ef79d-91e5-47ff-afbe-2c30483126f7 | 5 | private void prepareCards() {
int[][][] cards = new int[Card.TYPE_AMOUNT][Card.SUIT_AMOUNT][2];
// Initialising starting cards
for (int type = 0; type < Card.TYPE_AMOUNT; type++) {
for (int suit = 0; suit < Card.SUIT_AMOUNT; suit++) {
cards[type][suit][0] = type;
... |
7a536aa6-0e85-4cf2-8cd0-e90194659cf3 | 6 | private static void setButtonStyle(JButton b, Type type) {
Color foregroundColor = null;
Color backgroundColor = null;
switch (type) {
case CONST:
foregroundColor = Color.WHITE;
backgroundColor = CONST_COLOR;
break;
case CONTROL:
foregroundColor = Color.WHITE;
backgroundColor = CONTROL_COLOR;
... |
c3082997-0bdd-4d15-aa71-45b6b090adba | 4 | public FakeSimpleCommandMap(SimpleCommandMap oldCommandMap) {
super(Bukkit.getServer());
oldMap = oldCommandMap;
// Lazy mode activated!
Class c = oldMap.getClass();
if(oldMap instanceof FakeSimpleCommandMap)
c = c.getSuperclass();
for (Field f : c.getDeclaredFields()) {
try {
if (this.getClass().... |
0b98898b-c899-452b-845c-18511156fc0c | 0 | public String getCreatedBy() {
return createdBy;
} |
0b53374a-c5a9-4e04-ab20-940f4859750b | 0 | private void start() {
new Thread(this).start();
} |
3defe917-4e2e-4ea3-b8db-19025aef2a01 | 5 | public String execute() throws Exception{
//MD5 加密部分
userpasswd = EncoderPwdByMd5(userpasswd);
try{
user = this.userDao.queryUser(username, userpasswd);
if(user.equals(null)){
this.getRequest().put("userinfo", "false");
}
}catch (Exception e) {
System.out.println(e.getMessage());
this... |
73d08cb8-2326-4a9a-8754-9e6d665ede71 | 0 | @Override
public void documentRemoved(DocumentRepositoryEvent e) {} |
2100e405-a814-45b3-8c4f-23ec6a08d0e3 | 7 | @Override
@SuppressWarnings("unchecked")
public Enumeration<LocatedPair> scriptHosts(final Area area)
{
final LinkedList<List<LocatedPair>> V = new LinkedList<List<LocatedPair>>();
if(area == null)
{
for(final String areaKey : scriptHostMap.keySet())
V.add(scriptHostMap.get(areaKey));
}
else
{
... |
f11d4a79-dbf1-4cef-8717-498a31d6bbfb | 5 | public static String formatDayTime(float time, boolean full){
String h = String.valueOf((int)(time*(24f/Main.DAY_TIME)));
String m = String.valueOf((int)((time*60f*(24f/Main.DAY_TIME))%60f));
if(m.length()<2) m = 0 + m;
if(full){
if(h.length()<2) h = 0 + h;
return h+":"+m;
} else {
String d = ""... |
7dfc2fde-404c-44ca-a635-41bafc7f89fa | 3 | public Collection<AbstractResource> getAllResources() {
Map<String, AbstractResource> resources = new HashMap<String, AbstractResource>();
for (ResConfig rc : this.configurations)
for (AbstractResource res : rc.getResources())
if (!resources.containsKey(res.resourceName))
resources.put(res.resource... |
21c8633c-1e03-4ff6-a280-b964b1c103e1 | 9 | @Override
protected boolean processKeyBinding( KeyStroke keystroke, KeyEvent event, int condition, boolean pressed )
{
if ( !isEnabled() )
{
// Don't bother to process keys for a disabled component...
return false;
}
InputMap inputMap = getInputMap( condition );
ActionMap actionMap ... |
5c16e2c8-8a09-4c00-bf8f-0b0534d0d74b | 8 | public void listWordsAdmin(){
try{
//write what has been written
FileInputStream fstream = new FileInputStream("Words.dat");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
//jTable1... |
4ced7b16-aabc-42a6-9f93-dfe7b44f9cc9 | 0 | public static void main(String[] args) throws UnknownHostException{
System.out.println("Hello Humans I am A Client");
DisplayWatcher dw = new DisplayWatcher();
BufferedImage image = null;
String computer = InetAddress.getLocalHost().getHostName();
ClientConnectionHandeler ch = new ClientConnectionHandeler()... |
d01e42e1-cd99-4cc9-bb12-0d5646457189 | 4 | public void run() {
for(int i = 0; i < 100; i++){
if(i == 1){
Thread th1 = new Thread(currentThread().getThreadGroup(), "t1");
}
else if(i == 2){
Thread th2 = new Thread(currentThread().getThreadGroup(), "t2");
}
else if(i == 3){
Thread th3 = new Thread(currentThread().getThreadGroup(), "t3... |
3c1d9dc8-6bfd-4ed8-b2c1-e5fb00d7b5b3 | 8 | public void update(float delta) {
if (screenChange > 0) {
screenChange -= delta;
return;
}
if (soundBox.contains(Input.mspWin) && Input.mouseDown && System.currentTimeMillis() - justClicked > 250) {
Sound.toggleSound();
Input.mouseDown = false;
justClicked = System.currentTimeMillis();
System.ou... |
ceed7541-3f2f-48e5-9a2f-ca12e75bdd96 | 8 | public void create() {
synchronized (polls) {
runningId++;
id = runningId;
polls.put(id, this);
}
Popup popup = new Popup(
"Umfrage",
String.format("Umfrage #%s", id),
String.format(
"%s§##Unter allen Teilnehmern werden 5 Knuddels verlost.",
question), 400, 300);
Panel panel = ... |
c1fd6ac0-6300-4bb3-a597-70e146ac0484 | 7 | public static int[][] SetMarixZero(int[][] matrix)
{
int[] row = new int[matrix.length];
int[] column = new int[matrix[0].length];
for (int i=0; i<row.length; i++)
for(int j=0; j<column.length; j++)
{
if(matrix[i][j] ==0)
{
row[i] = 1;
column[j] = 1;
}
}
for (int i=0; i<row... |
785a91eb-b89a-432e-b447-c1cb21628737 | 5 | private void runScriptMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
String filename = null;
if (fileChooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) {
return;
}
File file = fileChooser.getSelectedFile();
filename = file.toStri... |
a9c78819-9fb0-4596-87b0-9a94728411f0 | 9 | private void downloadFile() {
BufferedInputStream in = null;
FileOutputStream fout = null;
try {
URL fileUrl = new URL(this.versionLink);
final int fileLength = fileUrl.openConnection().getContentLength();
in = new BufferedInputStream(fileUrl.openStream());
fout = new FileOutputStream(new File(this.up... |
891cb731-cf5e-4430-b717-4b033319f502 | 3 | public void gameLoop()
{
long lastLoopTime = System.nanoTime();
final int TARGET_FPS = opt.getTargetFps();
final long OPTIMAL_TIME = 1000000000 / TARGET_FPS;
// keep looping round til the game ends
while (gameRunning)
{
// work out how long its been since the last update, this
... |
d43ca686-fe4c-4b57-b139-2a7531cc009d | 6 | @EventHandler
public void SlimeStrength(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getSlimeConfig().getDouble("Slime.Strength.... |
b3f3fcea-d1bd-4ed5-a168-d194900ab7a2 | 2 | private String pullAccount(String uname) throws InvalidUsernameException, SQLException {
String a = "";
String pulledAccount = "";
String queryResult = "SELECT * FROM Customer c WHERE c.customer_ID = '" + uname + "'";
Statement stmt = myC.getConnection().createStatement();
ResultSet rs = stmt.executeQuery(... |
34b15f21-7b5b-41d5-8924-a4c718f4dc6e | 6 | private void splitEdge(final Block src, final Block dst) {
// This shouldn't happen since
// (1) edges from the source are either source->init, or
// source->catch. Edges with catch blocks are already split.
// (2) edges to the sink are always unconditional jumps.
//
Assert.isFalse((src == srcBlock) || (dst... |
8399da39-8f9d-4c44-8e8e-7d82d2b74091 | 5 | private Object handleTitl(Object tos) {
if ((tos instanceof Media && ((Media)tos).getTitle() == null) ||
(tos instanceof Source && ((Source)tos).getTitle() == null)) {
return new FieldRef(tos, "Title");
}
else if (tos instanceof Person) {
Name name = new Name();
na... |
8a217b61-613c-45bc-a52b-c6acb109cc1c | 5 | public double[] decodifica() throws IllegalArgumentException {
double[] limInf = getFitness().getLimInf();
double[] limSup = getFitness().getLimSup();
if((limInf.length != 1 && limInf.length != getFitness().getNumVariaveis()) ||
(limSup.length != 1 && limSup.length != getFitness(... |
a48e67cc-939d-4191-8ada-0c5f99845f4e | 6 | public boolean userCanLaunch(int userID, String actionName)
{
Statement st = null;
ResultSet result = null;
int idAction = -1;
boolean ok = false;
String req = "";
try
{
st = cnx();
if(st == null) return false;
// RECUPERATION ID ACTION
req = "SELECT id FROM t_actions WHERE (name='"+a... |
b0e1c8dc-327d-4f72-b1e7-97d0c793f866 | 4 | public static void printKanjiList(List<Kanji> kanjis) {
Logger.log("**************************");
Logger.log("LIST OF #" + kanjis.size() + "# Kanjis:");
if(kanjis.size() > 8 ) {
for(int i=0; i<3; i++) {
Logger.log("# ucs:" + kanjis.get(i).getUcs() + ", meanings: \"" + kanjis.get(i).getJoinedMeanings("|"));... |
006851a3-4fa7-427d-a4b8-767ee3366a7e | 0 | public FactoryOfCapturingsForPiece(Position position, Board field) {
super(position, field);
} |
30235ae5-aa4e-4926-996e-c65601d06d4e | 0 | public void setPostalCode(String postalCode) {
addressCompany.setPostalCode(postalCode);
} |
73017bbc-caaa-40fd-b4bb-03e33afa2072 | 7 | @Override
public List<Session> clearInvalidSnoopers(Session mySession, int channelCode)
{
List<Session> invalid=null;
if(mySession!=null)
{
for(final Session S : CMLib.sessions().allIterable())
{
if((S!=mySession)
&&(S.mob()!=null)
&&(mySession.isBeingSnoopedBy(S))
&&(!mayReadThisChannel(S... |
66fb8ac8-b485-4295-a977-0dafd3704014 | 1 | @Override
public boolean verify(JComponent input) {
if (input instanceof JTextField) {
JTextField tf = (JTextField) input;
String name = tf.getName();
return (tf.getText().length() != 0);
} else {
JTextArea ta = (JTextArea) ... |
51184eef-14f8-4218-9dac-f42346b7d285 | 8 | public void printSimInfo() {
double cdf = 0, exp = 0;
try {
//LATENCY
FileWriter fstream = new FileWriter(new File("exp_latency." + TreeBuilder.treeSize + ".txt"));
BufferedWriter out = new BufferedWriter(fstream);
exp = 0;
for (Integer latency... |
ddeb2f63-7d4f-4e2a-b25d-a9eb2eca568e | 7 | public static void clean(Object o) {
Class<?> c = o.getClass();
while (c != null) {
for (Field field : c.getDeclaredFields()) {
if (field.getType().isArray() || field.getType().isPrimitive())
continue;
if ((field.getModifiers() & Modifier.STATIC) == Modifier.STATIC)
continue;
try {
fie... |
758f935a-8623-4cd9-83f7-ecc05857acda | 3 | private String getAddButtonTooltips(){
if(players.size() >= 4){
return "There are already 4 players. Can't add more players.";
}
if(nameField.getText().trim().length() ==0 ){
return "Can't add player with empty name.";
}
if(players.contains(new StandardPlayer(nameField.getText().trim()))){
return "A ... |
a8b8a916-efe8-4a7a-b8dd-4fd49271e4b4 | 1 | public static String getFirstChildText(Element parent, String child, String defaultText) {
NodeList children = parent.getElementsByTagName(child);
return children.getLength() > 0? children.item(0).getTextContent():defaultText;
} |
38346128-fe8a-47fd-b8c8-d38460b59d19 | 7 | public boolean containsMethodAliasDirectly(String methodName,
String paramType, IdentifierMatcher matcher) {
for (Iterator i = methodIdents.iterator(); i.hasNext();) {
Identifier ident = (Identifier) i.next();
if (((Main.stripping & Main.STRIP_UNREACH) == 0 || ident
.isReachable())
&& ident.wasAlia... |
4a788c69-1d5e-466a-a8b3-967afc464e45 | 4 | private boolean pushButtonQuest(Quest q, int id){
if(q.getID() == 100 && engine.getWorld().getCurrentMap().getName().equals("dung_2")){
if(engine.getPlayer().getBounds().intersects(new Rectangle(448,352,32,32)))
{
System.out.println("Button pushed!");
// Add enemies
ArrayList<Character> list = ... |
489ef8b3-6b6d-4884-994b-f9b7b46c6055 | 9 | public String pduTypeToString() {
switch (pdu_type) {
case SNMP_MSG_GET:
return "SNMP-Get";
case SNMP_MSG_GETNEXT:
return "SNMP-GetNext";
case SNMP_MSG_RESPONSE:
return "SNMP-Response";
case SNMP_MSG_SET:
return "SNMP-Set";
c... |
734809d3-1652-4307-b6fe-f673983f60ff | 9 | @Override
public boolean equals(Object o) {
if(o == null)
return false;
else if (o == this)
return true;
else if (o instanceof OfertaEmprego){
OfertaEmprego ofertaEmprego = (OfertaEmprego) o;
if(this.id == ofertaEmprego.id
... |
74edd2c6-176f-4847-9c05-3c0d1153dbaa | 6 | public static boolean areEqual(TreeNode<String> t1, TreeNode<String> t2) {
if (t1 == null && t2 == null) {
return true;
}
if (t1 == null || t2 == null) {
return false;
}
if (!t1.data.equals(t2.data)) {
return false;
}
/* recursive call */
return areEqual(t1.left, t2.left) && areEqual(t1.righ... |
732cdaa9-6269-4daa-a075-5689fd2b430c | 0 | public Date getOfflineDate() {
return offlineDate;
} |
efc5562b-499a-42da-8011-b7ab6d11b49c | 2 | public Cliente buscarCliente(long identificacao) {
for (Cliente c : clientes) {
if (c.getIdentificacao() == identificacao) {
return c;
}
}
return null;
} |
bb338938-4148-4653-a7ac-a6dcf63029cd | 9 | public static int[] getLongestSub(int[] list) {
if(list == null || list.length == 0)
return null;
int[] maxLength = new int[list.length];//记录以i结尾的最长递增子序列
int[] pre = new int[list.length];//记录i的前驱节点
int maxLengthIndex = 0;
for (int i = 0; i < list.length; i++) {
maxLength[i] = 1;
for (int j = 0;... |
785fc148-fa30-4d29-bbc8-da0e8d7ceb27 | 8 | private void checkLoginLogout(HttpServletRequest request) {
Principal user = request.getUserPrincipal();
mainWindow.removeAllComponents();
mainWindow.addComponent(authInfo);
if (authInfo.getComponentIterator().hasNext()
&& ((user != null && getUser() != null) || (user == n... |
99bd8ea8-2ebc-4651-a2d8-d74e40f22be5 | 2 | private void changeSelection(int direction) {
if(get(selection).getSurroundings()[direction] != null) {
get(selection).setSelected(false);
selection = indexOf(get(selection).getSurroundings()[direction]);
get(selection).setSelected(true);
if(pointer != null) {
pointer.setPositionAt(get(selection))... |
6d4ae389-5810-4cc5-9b74-475d8705ef66 | 6 | public void broadcastReceived (Address senderAddress, Serializable content)
{
Message message = (Message) content;
if (senderAddress.toString().equals(getAddress()))
{
// Si on est l'expediteur et le destinataire (ie lors d'un envoi en broadcast)
// alors on ne traite pas le message
}
else
{
swi... |
6bfee4eb-0e8e-4cff-8f97-f4d7375803f2 | 9 | public Room newRandomCorridor() {
Room newCorridor = null;
Cell theDoor = (Cell) chooseRandom(mapFreeWalls);
int offsetX = 0;
int offsetY = 0;
int doorX = theDoor.getX(), doorY = theDoor.getY();
// East
if (getTile(doorX + 1, doorY) == TILE_EMPTY) {
... |
f0125fa8-e746-42e5-a04b-ae6d4768bb31 | 3 | synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
synchronized (org.omg.CORBA.TypeCode.class)
{
if (__typeCode == null)
{
if (__active)
{
return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
}
... |
2929a38b-ad91-4dd5-8455-a1606eef5ac9 | 7 | public Enumeration listOptions() {
Vector result = new Vector();
Enumeration en = super.listOptions();
while (en.hasMoreElements())
result.addElement(en.nextElement());
result.addElement(new Option(
"\tFull name and options of the evaluator analyzed.\n"
+"\teg: weka.attri... |
0122275b-c8af-46ee-a22a-753566de9a26 | 4 | @Override
public void run() {
while (shouldRun()) {
try {
// Tell client that we are still here.
ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
oos.writeObject(0);
// Create a list of al... |
77397354-41aa-4333-9a49-f060893c496c | 9 | private void addInterference(IceMap map) {
IceMapSolver solver = new IceMapSolver(map);
LinkedList<NavigationNode[]> solutions = solver.solve(MOVE_LIMIT, PRUNE_SOLUTION_SET);
int attempts = 0;
int lastX = -1;
int lastY = -1;
IceMap.Tile lastTile = null;
while(solutions.size() >= 1 && attempts < ... |
7c843ac5-ae07-48ca-9a13-404627e066e5 | 4 | static void makeDirs(){
for (AppDefaults setting : AppDefaults.values()) {
if(setting.key.endsWith("PathExt")) {
String path = Settings.getSetting("homeDir") + setting.value;
File folder = new File(path);
if (!folder.isDirectory()) {
... |
672f6e63-4dcc-4715-addc-2d4ab70d9cf4 | 8 | public boolean login() {
boolean loggedIn = false;
try {
loggedIn = mServerInt.login(mUserName, mUserPass, mInstance, ServerInterface.CLIENT);
} catch(Exception ex){
if(connect())
return login();
System.out.println("A Login-Error occured: " + ex.getMessage());
return false;
}
if(loggedIn) {... |
40c870a1-b93f-45e6-881d-e998ef3e1a04 | 0 | public Panel(){
setLayout(new FlowLayout());
setUp();
} |
49aa9c09-48e6-4fb5-9fb8-18ba5f198980 | 6 | public void renderWithRotation(float var1) {
if(!this.field_1402_i) {
if(this.showModel) {
if(!this.compiled) {
this.compileDisplayList(var1);
}
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, t... |
9bacf596-8fc7-4483-8272-f24e9706f91b | 4 | public static void main(String[] args){
Scanner in = new Scanner(System.in);
int a1 = in.nextInt();
int a2 = in.nextInt();
int a3 = in.nextInt();
int a4 = in.nextInt();
String s = in.next();
int result = 0;
for(char c : s.toCharArray()){
if(c == '1') result+=a1;
else if(c == '2') result+=... |
9549a50b-dd51-46c8-9965-d7f213d4590c | 8 | @Override
public void caseADeclEnquantoDefinicaoComando(ADeclEnquantoDefinicaoComando node)
{
inADeclEnquantoDefinicaoComando(node);
if(node.getEnquanto() != null)
{
node.getEnquanto().apply(this);
}
if(node.getLPar() != null)
{
node.getLPa... |
b7015b15-743e-48d9-8600-7a976604cd6a | 6 | @Override
public void collidedWith(Entity other) {
// prevents double kills, if we've already hit something,
// don't collide
if (used) {
return;
}
// if we've hit an alien, kill it!
if (other instanceof AlienEntity && shotType==0) {
/... |
42b8c0a0-88f3-4872-90bd-69788b0ce5a7 | 7 | private boolean testarLogin(String userName, String password) {
User user = showLoginPanel(userName, password);
if (user != null) {
try {
user = admin.login(Integer.parseInt(user.getNome()), user.getPassword());
JOptionPane.showMessageDialog(this, "Bem-vindo,... |
fdcb3a1b-f260-4011-9285-cbb6ba2eedb5 | 1 | public InputStream getInputStream() {
InputStream inputStream = null;
try {
inputStream = socket.getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
return inputStream;
} |
f75d8769-92ff-4c65-a534-aa97f5615fb9 | 3 | @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (handler instanceof DefaultServletHttpRequestHandler) {
return true;
}
if (request.getMethod().equalsIgnoreCase("GET")) {
// GET - allow the request
return true;
} else {
... |
db8c85c9-ef97-4404-9f28-36a0cda990c2 | 0 | public boolean exists() {
File cache_file = new File(file_name);
ConfigurationManager.logger.log("A cache was found at: " + cache_file.getAbsolutePath() + ". "
+ "Trying to retrieve the file name from this cache and checking if the configuration file is still at this location.", 1);
return cache_file.exists... |
5dc1987d-a2df-4203-9d85-ac9c0bd20688 | 4 | public void digest() {
if (password == null || challenge == null || challenge.length == 0) {
throw new RuntimeException("Password or challenge was null (or zero size)");
}
try {
MessageDigest md = MessageDigest.getInstance("sha1");
md.reset();
ByteBuffer bb = ByteBuffer.allocate(password.getBytes().le... |
534bf6c4-9c32-430a-b352-2fa5e4bafacd | 0 | public int getOption(){
return option;
} |
3cab8542-0b8a-4c5e-a25c-b5f2e58f036d | 9 | public void cargarCajas(java.util.Date desde, java.util.Date hasta) {
if (desde != null && hasta != null) {
abrirBase();
listaCajas.setRowCount(0);
List<Caja> lista = Caja.where("fecha between ? and ?", desde, hasta);
for (Caja c : lista) {
totalVe... |
a9ab122d-6059-4e4a-b3ea-f361910a2911 | 7 | private void jButtonEmprestarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEmprestarActionPerformed
if (cidadao == null) {
JOptionPane.showMessageDialog(this, "cidadao obrigatorio", "aviso", JOptionPane.WARNING_MESSAGE);
} else if (dtm.getRowCount() == 0) {
... |
d4c0a47e-d56d-4304-99e2-2580fcf8e761 | 9 | public static int doPixel(int x) {
inColorWindow = Window.checkColorWindow();
int mainColor = CGRAM.getColor(PPU.colorMain);
int subColor = (PPU.prioritySub == 0 ? CGRAM.fixedColor : CGRAM.getColor(PPU.colorSub));
boolean clipMain = checkWindowEffect(clipBlack);
boolean preventSubMath = checkWindowEffec... |
8f4f8059-a8fb-4110-9b6a-36b633ff035a | 0 | public void setErrorType(Integer errorType) {
this.errorType = errorType;
} |
cc895806-b6d8-47be-bf22-1fe6edc98690 | 6 | public void getPlacesFromCPN(Document doc, PetriNet pn) {
NodeList placeList = doc.getElementsByTagName("place");
for (int i = 0; i < placeList.getLength(); i++) {
Node nNode = placeList.item(i);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = ... |
8c4766fe-f19f-4ccf-a6cc-24f4f5e7b976 | 3 | @Override
public boolean equals(Object obj) {
// 性能优化:比较操作有可能很昂贵
if (this == obj)
return true;
if (! (obj instanceof PossibleError))
return false;
PossibleError other = (PossibleError) obj;
return names == null ? other.names == null : names.equals(other.names);
} |
dd11459c-8f0b-4cb9-ac2c-f58ca5a95a41 | 3 | public void StartGame(){
this.isGameOver = false;
this.dealer= new Dealer("Dealer");
this.theDeck = LoadFullDeck();
while(!isGameOver){
for (IPlayer iPlayer : players) {
iPlayer.AppendCard(theDeck.DrowCard());
iPlayer.AppendCard(theDeck.DrowCard());
// TODO: Do the logic
if(iPlayer.Command().... |
c1f81fdb-d07b-4bcc-990d-76fe54698b3c | 5 | public void liberarPaneles(int idPanel) {
if (panelActual != -1) {
switch (panelActual) {
case 0:
this.remove(crearEstudiante);
break;
case 1:
this.remove(consultarEstudiantes);
break;
... |
2b48ef95-d5a0-4a58-b999-dd02ebfe6420 | 1 | public List<String> getKeys() {
List<String> keysList = new ArrayList<String>();
iter = bucket.iterator();
while(iter.hasNext()) {
keysList.add(iter.next().getKey());
}
return keysList;
} |
d6c60807-8070-48e3-802c-4b6a90b863e2 | 1 | private List<String> getLines(InputStream inputstream) {
List<String> lines = new ArrayList<>();
Scanner scanner = new Scanner(inputstream);
while (scanner.hasNextLine()) {
lines.add(scanner.nextLine());
}
scanner.close();
return lines;
} |
ef957bc3-7504-4452-80ee-ff899668415d | 9 | private void update_BHSR(boolean actual_outcome){
if (actual_outcome == false){
if (shared_BHSR == 0 )
shared_BHSR = 0 ;
else if (shared_BHSR == 1 )
shared_BHSR = 2;
else if (shared_BHSR == 2 )
shared_BHSR = 0;... |
88eb38e2-3b71-4c43-bb97-fbee416e41b5 | 5 | public List<Entity> getEntitiesContaining(Class<?>... componentClassList) {
List<Entity> foundEntityList = new LinkedList<Entity>();
// Iterate all 'possible' entity lists
entityIteration: for (Entity entity : entityList) {
// get the components owned by that entity
for (Class<?> componentClass : componentC... |
87503d8e-0142-4e1e-b6ff-1ba426cdf9fd | 4 | public static double getFitness(GTree tree,Polynomial f,DoubleObj[] outputVector,int linearFactors,int quadraticFactors){
setAll(outputVector,0);
Polynomial[] factors = new Polynomial[1 + linearFactors + quadraticFactors];
tree.getValue();
int j=0;
double[] scalar={outputVector[j].value};
factors[j]=new Pol... |
a2e988e3-45b8-41f0-ad5f-44868069d30b | 4 | public Mark next() {
Mark next;
switch (this) {
case RED:
next = YELLOW;
break;
case YELLOW:
next = GREEN;
break;
case GREEN:
next = BLUE;
break;
case BLUE:
next = RED;
break;
default:
next = EMPTY;
break;
}
return next;
} |
02add579-7bce-46bf-b1e4-671d5a6ffc45 | 0 | public boolean getColor(){
return myColor;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.