method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
d556d58c-d1da-4965-af16-9f9bc73151a9 | 5 | public void setZhishus(Iterator<Element>tempit,WeatherInfo tempweather){
Element tempElement,tempElement2;
Iterator<Element>tempit2;
Zhishu zhishu=new Zhishu();
int i=0,j;
while(tempit.hasNext()){
tempElement=tempit.next();
tempit2=tempElement.elementIterator();
j=0;
while(tempit2.hasNext()){
... |
0b2b76ec-e95b-4e81-9fa0-cb918139a72a | 0 | public static void main(String[] args) {
// 利用抽象工厂,new一个具体工厂,获取具体的产品
Driver driver = new BenzDriver();
Car car = driver.driverCar();
// 利用抽象的产品,根据具体产品进行生产
car.driver();
} |
c15ba11c-8d9b-4150-b89e-a994b73ef004 | 5 | @Override
public boolean doSmall() {
if (!options.useOtherHouse.get() && script.houseTask.getHouseLocation() != HouseTask.HouseLocation.YANILLE) {
script.log.info("House not in yanille");
return false;
} else {
options.status = "Walking to yanille bank";
final Tile smallRandom = locationAttribute.getSm... |
bef8e6ec-41b2-4cf0-b17e-e8ee8e4465bd | 0 | public Level getLogLevel() {
return this.level;
} |
3ea672f0-4fea-4056-b239-a96d21347cf0 | 0 | public String getName() {
return name;
} |
da18abea-641a-4677-83fc-336c9bcf5971 | 9 | public void commit() throws IOException {
//write all uncommited free records
Iterator<Long> rowidIter = freeBlocksInTransactionRowid.iterator();
Iterator<Integer> sizeIter = freeBlocksInTransactionSize.iterator();
PageCursor curs = new PageCursor(_pageman, Magic.FREEPHYSIDS_PAGE);
//iterate over filled pag... |
bc62d65b-7057-4fa6-b45b-453d6804dd82 | 2 | public static InformationUsageEnum fromValue(String v) {
for (InformationUsageEnum c : InformationUsageEnum.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} |
e44ae61c-5d40-442e-91cb-cbe7917d4f6f | 6 | public String compress(String toBeCompressed){
int length = toBeCompressed.length();
ArrayList<Tag> ret = new ArrayList<>();
Tag tempTag , charTag;
for(int i = 0 ; i < length; i++){//main loop ->
charTag = new Tag(0,0,toBeCompressed.charAt(i));
for(int j = i -1 ;... |
ee650186-9cca-49e9-b79a-65e4559d8f5c | 3 | private static int findminimumgreedyscorefortailvertex(int tailvertex) {
// TODO Auto-generated method stub
int temp = 0;
for(int j = 0 ; j<graph.get(tailvertex).size();j++){
if(!(exploredarray.contains(graph.get(tailvertex).get(j)))){
temp = pathlength[tailvertex] + edgewieght[tailvertex][graph.ge... |
4cebd9f7-2a89-4d89-85f0-ecf9b0381d51 | 8 | private static int findMedian(int[] a, int lo, int hi) {
int mid_ind = (hi + lo) / 2;
/*System.err.println("------------------");
for (int i = 0; i < a.length; i++) {
System.err.print(a[i] + " ");
}
System.err.println();
System.err.println(" {" + lo + " " + mid_ind + " " + hi + "}");*/
int re... |
ff7d388b-f99e-42d4-8e17-56add6379db3 | 5 | public Fenetre(final ActionsClientMessagerie irc) {
this.irc = irc;
// Initialisation de la fenêtre
this.setTitle("Messagerie instantanée");
this.setSize(400, 700);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
panel.setBackground(C... |
9eb63abe-cb56-4dbd-80e3-9f2e493d99f1 | 7 | private static void generateTestCases(){
firstNumbers = new ArrayList<int[]>();
secondNumbers = new ArrayList<int[]>();
bases = new ArrayList<Integer>();
// you can change the bases here
int [] basesArray = {2,10,17};
int [] firstNum;
int [] secondNum;
int [] zero = {0};
Random rand = new Random... |
33851e8e-d3db-4bd1-96a7-d522cacef583 | 1 | @Override
public void start() {
if (this.mcApplet != null) {
this.mcApplet.start();
return;
}
} |
ba694739-7083-498d-b26e-4514c6a43923 | 8 | public boolean sign_in(String username, String password) {
BasicDBObject query = new BasicDBObject("username", username);
DBCursor the_row = getTable("User").find(query);
// System.out.println(the_row.toArray());
ArrayList row_list = (ArrayList) the_row.toArray();
if (row_list.isEmpty())
return false;
S... |
cdd514f5-5b77-4122-953f-7c3682bb5d09 | 9 | void handleWrite() {
if (queue.isEmpty() && outgoing == null) {
key.interestOps(SelectionKey.OP_READ);
return;
}
try {
if (outgoing == null) {
Queued b = (Queued) queue.pop();
ByteBuffer[] msg = b.getMsg();
... |
362677a2-e546-4b69-9311-899aafeb5b05 | 8 | @SuppressWarnings("deprecation")
private void placeMushroomTree(World world, int x, int y, int z, Random rand)
{
boolean brownTree = rand.nextBoolean();
if(brownTree)
{
int height = rand.nextInt(3)+5;
for(int y2 = 0; y2 < height; y2++)
{
setBlockWithData(world, x, y+y2, z, Material.HUGE_MUSHROOM_1.... |
47e34d48-a11b-438e-91df-c4436934e904 | 0 | public EncryptionMethodType createEncryptionMethodType() {
return new EncryptionMethodType();
} |
78a4fd56-8fc8-40b7-99b8-0fbc3db8f3ac | 1 | void fireStart(ComponentAccess w) {
if (shouldFire) {
fire(Type.EXECUTING, new ComponentEvent(c, w.getComponent()));
}
} |
6412b786-7de4-4229-b8b4-3d3265f66c59 | 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... |
2fe64f31-842f-43eb-af64-4113ee9ef0b1 | 3 | /* */ @EventHandler
/* */ public void onInventoryClose(InventoryCloseEvent event)
/* */ {
/* 319 */ if (!(event.getPlayer() instanceof Player))
/* */ {
/* 321 */ return;
/* */ }
/* */
/* 325 */ Player p = (Player)event.getPlayer();
/* */
/* 327 */ if (Main.g... |
a3f6803a-18ee-4a7b-833c-35867d3d2adf | 2 | public void positionAnywhereIn(GameObject go) {
if(this.getSize().width > go.getSize().width || this.getSize().height > go.getSize().height){
throw new IllegalArgumentException("GameObject is bigger than the passed GameObject");
}else{
Random generator = new Random();
int xOffset = generator.nextInt(go.get... |
0af8f752-8e82-4655-8733-8fb13f3c1c42 | 3 | @Test
public void test2() {
System.out.println("Test avec l'init avec 1 argument et tous les états possibles");
System.out.println("Tests de couverture des post-conditions d'init");
for(BlocType b : BlocType.values()) {
bloc2.init(b);
assertTrue("type initial Fail",bloc2.getType()==b);
assertTrue("power... |
75109267-8b21-437a-96da-7f0103ded74c | 0 | public BinaryTime() {
setLayout(new BorderLayout(0, 0));
timer.start();
JButton btnBack = new JButton("BACK");
btnBack.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
MainFrame.cardLayout.show(getParent(), "startScreen");
}
});
add(btnBack, BorderLayout.SOUTH)... |
4c1c4d60-539f-46f4-ace3-d03dfa8a574d | 9 | public boolean isValidFor(SeedNode node) {
if (node.x < Consts.SEED_RADIUS - Consts.EPSILON || node.x > width - (Consts.SEED_RADIUS - Consts.EPSILON) || node.y < Consts.SEED_RADIUS - Consts.EPSILON || node.y > height - (Consts.SEED_RADIUS - Consts.EPSILON))
return false;
for (Location tree : trees) {
if (L... |
6ce82f6b-35c9-46e6-8a59-8c5ca0bcf5b9 | 7 | public void testKeySetRemoveAllTCollection() {
int[] keys = {1138, 42, 86, 99, 101, 727, 117};
long[] vals = new long[keys.length];
TIntLongMap map = new TIntLongHashMap();
for ( int i = 0; i < keys.length; i++ ) {
vals[i] = keys[i] * 2;
map.put( keys[i], vals[i]... |
f60eec87-74c1-47a9-aeea-a020fabb119a | 2 | public void requestPlayCard(Card card) {
if (playRequest == null && this.canPlay(card)) {
playRequest = card;
}
} |
8fcb6e9d-ab84-4dd0-b217-e1bea2c05bc2 | 0 | public void setSuccess(String success) {
this.success = success;
} |
d16d2510-b745-4e22-8339-15c31ed0105a | 4 | public XMLMenu() {
JMenu menu;
JMenuItem item;
menu = new JMenu("Arquivo");
item = new JMenuItem("Criar");//arquivo
item.addMouseListener(new MouseAdapter() {
String nome_da_pasta = "Novo Arquivo";
@Override
public void mousePressed(MouseEve... |
9e4457c8-2e7d-4432-85d4-a0356669d4ec | 2 | @Override
public Class<?> getColumnClass(int index) {
return index == 0 ? Icon.class : String.class;
} |
3f7e5ef9-3ab6-423a-8b38-af396cbc7b1c | 4 | private boolean checkValid20() {
if ((inChar8[0]==false)&&(inChar8[6]==true)&&(inChar8[7]==true)&&(bcount>=8)) return true;
else return false;
} |
8ecd2f08-2426-46e9-82c6-41eb0eb6d370 | 8 | protected String checkMap(int paramInt1, int paramInt2)
{
if (this.ImageMap != null)
{
Enumeration localEnumeration = this.ImageMap.keys();
Object localObject = null;
int i = 0;
while ((localEnumeration.hasMoreElements()) && (i == 0))
{
localObject = localEnumeration.next... |
6129a641-3dfe-4fe6-87c9-94d0af8b083a | 3 | @Override
public List<Consulta> listPorDate(Date data) {
Connection con = null;
PreparedStatement pstm = null;
ResultSet rs = null;
List<Consulta> consultas = new ArrayList<>();
try {
con = ConnectionFactory.getConnection();
pstm = con.prepareStateme... |
40fbe0e8-b981-4935-a9c6-3795105858a3 | 1 | private static void buildFromScratch() {
for (int i = 2; i <= 365994; i++) {
lookup(i);
}
save();
} |
a88534e2-e7c0-40d0-a170-97a8cfe0c63c | 2 | public static String[][] parse(String s) throws IOException {
if (s == null) {
throw new IllegalArgumentException("Null argument not allowed.");
}
String[][] result = (new CSVParser(new StringReader(s), CSVStrategy.DEFAULT_STRATEGY)).getAllValues();
if (result == null) {
... |
89be9bf7-9dc8-4d0d-85a7-53a2e3b92601 | 8 | public String downloadUrl(String filename, String urlString) {
BufferedInputStream in = null;
FileOutputStream fout = null;
HttpURLConnection connection = null;
String md5 = "";
try {
URL url_ = new URL(urlString);
byte data[] = new byte[1024];
connection = (HttpURLConnection) url_.openConnec... |
00e1aacd-13cd-43ee-b4a4-cb43085fc835 | 0 | public void setName(String name) {
this.name = name;
} |
81101613-dfdd-47e2-b555-cbd77b83ad5f | 2 | @Test
public void test() {
Vote fetchedVote = (Vote) MongoHelper.fetch(vote, "votes");
if(fetchedVote == null)
TestHelper.failed("vote not found");
fetchedVote.setOptionID(new Integer(5));
if(!MongoHelper.save(fetchedVote, "votes")){
TestHelpe... |
cfecc04c-425f-40fb-b6ca-4d800c9c636c | 0 | public SHSMemberEntity() {
setId(System.nanoTime());
} |
f4c79eff-5790-4b8a-a76b-5c5f626fd839 | 6 | public static double getSilhouette(Dataset trainingSet, ArrayList<ArrayList<Integer>> clusters, double[][] distance, int VERBOSE) {
int logFlag = Constants.LOG_SILHOUETTE;
/** initial phase **/
// build an inverted index of cluster assg, i.e., clusterAssignment[objectNo] = clusterId;
int[] clusterAssignment = n... |
55d24385-f093-44b5-a43c-449c13cfcf04 | 5 | public Shader(String name)
{
this.shader = ARBShaderObjects.glCreateProgramObjectARB();
if (this.shader != 0) {
this.vertShader = createVertShader("/shader/" + name + ".vert.txt");
this.fragShader = createFragShader("/shader/" + name + ".frag.txt");
} else {
this.useShader = false;
}... |
e2db0dad-8223-4fcb-b88b-1652ddb402db | 4 | public static Class<? extends CTFSession> getSession(String name) {
for (Class<? extends CTFSession> cls : sessionTypes) {
if (cls.getSimpleName().equalsIgnoreCase(name)) {
return cls;
}
}
return null;
} |
490ad87a-0875-42ec-bc81-3ca93baa0c93 | 0 | @Override
public String getIpdbserver() {
return ipdbserver;
} |
9584773b-abe0-4126-b233-3d7a20716cd8 | 3 | public static String filter(String str) {
String output = "";
StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length(); i++) {
int asc = str.charAt(i);
if (asc != 10 && asc != 13) {
sb.append(str.subSequence(i, i + 1));
}
}
output = new String(sb);
return output;
} |
f203d84b-d04b-4684-85b2-8e88f9850ad5 | 2 | public void animateEntity(Entity entity, int x, int y)
{
// this.game.stroke(0, 0, 255);
// this.game.rect(x * this.game.c_tilesize, y * this.game.c_tilesize, this.game.c_tilesize,
// this.game.c_tilesize);
// moving
if (entity.busy > 0 && entity.center < 2)
{
entity.xold = x - entity.dx;
entity.yol... |
05245e03-8d0f-41c1-bc25-142bf084874d | 7 | public static void avlToFile(AVL avl, Path file, Path origin) throws IOException {
FileOutputStream fos = new FileOutputStream(file.toFile());
avl.getGeometry().writeAVLData(fos);
fos.close();
String fileMassPath = file.toString().replace(".avl", ".mass");
File fileMass = new Fi... |
61661457-f0f5-424c-a256-b48c0066690e | 8 | public AngleDR Ampqk(AngleDR ap, AMParams amprms) {
double gr2e; /* (grav rad Sun)*2/(Sun-Earth distance) */
double ab1; /* sqrt(1-v*v) where v=modulus of Earth vel */
double ehn[] = new double[3]; /* Earth position wrt Sun (unit vector, FK5) */
double abv[] = new double[3]; /* Earth vel... |
778a52ad-60bd-438c-94d7-33d9894eea5a | 0 | public void setPowered(boolean a){
powered = a;
} |
202155ee-3df6-4f1b-9ea2-331360af1fc5 | 1 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
} |
973639c8-8144-4de8-873f-9261ce8db714 | 9 | public void checkCollision(){
if(player1.getArrX()[0]==player2.getArrX()[0] && player1.getArrY()[0]==player2.getArrY()[0]) {
snake1Alive=false;
snake2Alive=false;
}
else{
for(int i = 0; i<player2.getSize(); i++) {
if(player1.getArrX()[0]==player2.getArrX()[i] && player1.getArrY()[0]==player2.getArrY(... |
ec0f2751-b1e5-4678-8611-0652e0d43d83 | 8 | protected boolean orderConnections(NeuralNetwork neuralNetwork, Layer currentLayer, Set<Layer> calculatedLayers, Set<Layer> inProgressLayers, List<ConnectionCandidate> calculateCandidates) {
boolean result = false;
if (calculatedLayers.contains(currentLayer) || Util.isBias(currentLayer)) {
result = true;
} els... |
64759a6e-2388-4b40-809b-d5a6bdbd0938 | 0 | @Test
public void testRemoveAnt() throws IOException {
System.out.println("removeAnt");
Cell instance = new Cell(0,0);
AntBrain ab = new AntBrain("cleverbrain1.brain");
Ant ant = new Ant(ab, true, 0);
instance.setAnt(ant);
instance.removeAnt();
Ant e... |
05108f90-6061-46dc-b1c1-255c2a15b951 | 6 | public String getNextComponent(Identifier ident) {
String prefix = ident.getFullName();
if (prefix.length() > 0)
prefix += ".";
int lastDot = prefix.length();
if (!wildcard.startsWith(prefix))
return null;
int nextDot = wildcard.indexOf('.', lastDot);
if (nextDot > 0 && (nextDot <= firstStar || firs... |
8481c8f3-c39a-45dc-942b-e22c57699bdd | 0 | @Override
public void handlePeerReady(SharingPeer peer) { /* Do nothing */ } |
eadbb0fe-a3f3-458d-8fed-0625c9076b87 | 2 | IntIterator getReverse(int key) {
int bucket = key % buckets;
if(bucket < 0) {
bucket = -bucket;
}
int[] data = content[bucket];
if(data == null) {
return IntIterator.EMTPY_ITERATOR;
}
else {
//return new IntIterator(data, key);
iterator.data = data;
iterator.offset = data[0] * 2 + 1;
i... |
a893a867-fe53-4c89-9297-407e9fa6e855 | 6 | private static boolean method518(char c) {
return c < 'a' || c > 'z' || c == 'v' || c == 'x' || c == 'j'
|| c == 'q' || c == 'z';
} |
119d4007-f437-41c2-9931-d22bd3f01356 | 3 | private void writeObjectDictionary(Dictionary obj) throws IOException {
logger.log(Level.FINER, "writeObjectDictionary() obj: {0}", obj);
if (obj == null)
throw new IllegalArgumentException("Object must be non-null");
Reference ref = obj.getPObjectReference();
logger.log(Lev... |
684eec16-90ef-487a-b61d-f7814882239d | 2 | private static List<Appointment> findMonthlyByDaySpan(long uid,
long startDay, long endDay) throws SQLException {
List<Appointment> aAppt = new ArrayList<Appointment>();
PreparedStatement statement = null;
// select * from Appointment where frequency = $MONTHLY
// and startTime <= $(endDay + DateUtil.DAY_LEN... |
d6e40568-d050-4e57-bb00-009620d11303 | 5 | public void getSuggestions(ArrayList<ISuggestionWrapper> suggestions) {
ArrayList<SuggestionCacheWrapper<IDocument>> cachedSuggestions = queryPosition.getCachedSuggestions();
for (SuggestionCacheWrapper<IDocument> suggestion : cachedSuggestions){
double suggestionRank = suggestion.getRank() ... |
fcb2b7f4-8245-4a92-914b-a928a037a207 | 1 | public Value pop() throws IndexOutOfBoundsException {
if (top == 0) {
throw new IndexOutOfBoundsException(
"Cannot pop operand off an empty stack.");
}
return values[--top + locals];
} |
6002146a-3b30-42ba-8db3-ef189012e998 | 7 | private boolean needEvents(int count) {
int level = 0;
Iterator<Event> iter = events.iterator();
iter.next();
while (iter.hasNext()) {
Event event = iter.next();
if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
le... |
d2fe84ef-22e1-4958-aaa4-d208aa6910eb | 7 | private final boolean prepareWriteBuffer(final MMOConnection<T> con)
{
boolean hasPending = false;
DIRECT_WRITE_BUFFER.clear();
// if there is pending content add it
if (con.hasPendingWriteBuffer())
{
con.movePendingWriteBufferTo(DIRECT_WRITE_BUFFER);
hasPending = true;
}
if ((DIRECT_WRITE_BU... |
1612a1e9-5cc0-416d-ae1b-71bdd1fec3fb | 8 | public void insert(Symbol sy) throws ParseException {
if(containsLocal(sy)) {
throw new SemanticException(sy, "Symbol is already defined in scope " + identName);
}
switch(sy.kind) {
case constKind:
// is constant
nrOfConstants++;
break;
case funcKind:
// is function
nrOfFunctions++;
... |
ff8d64c2-c3ea-4b61-af45-0f61fcdf2e2c | 2 | public String getStateDescription(State state)
{
/*
* If the output has not been set i.e. this is a brand new state
* before the user has entered a state output, then an
* empty string shows up instead of lamba. It is purely cosmetic.
*/
if(myMap.get(state) == nul... |
f3b262a3-3515-4127-a900-5c20cd95cbec | 9 | static boolean matchStr(String str, String pat, String matches[]) {
int i = 0; // move through str
int j = 0; // move through matches
int pos = 0; // move through pat
// System.out.println("Inside matchStr :\n");
// System.out.print("Strlen of str,pat,match="+str.length... |
704f9cf7-1626-44ac-a203-da657a324a51 | 7 | public Command getCommand(char currentOperator){
Command command;
switch (currentOperator){
case BrainFuckConstants.SHIFT_RIGHT: command = new ShiftRight();
break;
case BrainFuckConstants.SHIFT_LEFT: command = new ShiftLeft();
break;
c... |
03bfb54d-150b-4e03-8ac3-c315e23bf5e3 | 4 | public static byte[] decrypt(byte[] data, byte[] key) {
byte[] tmp = new byte[data.length];
byte[] bloc = new byte[16];
key = paddingKey(key);
S = generateSubkeys(key);
int i;
for(i=0;i<data.length;i++){
if(i>0 && i%16 == 0){
bloc = decryptBloc(bloc);
System.arraycopy(bloc, 0, tmp, i-16, bloc.le... |
52349bbd-7fa7-4657-b0bd-4175b17a22d5 | 7 | public void create(Roles roles) throws PreexistingEntityException, RollbackFailureException, Exception {
if (roles.getEmpleadoCollection() == null) {
roles.setEmpleadoCollection(new ArrayList<Empleado>());
}
EntityManager em = null;
try {
em = getEntityManager();
... |
811f7de6-157b-481d-b6a6-a9c73162377b | 8 | private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... |
1e44282f-11b1-4e5e-9499-dd909f094f7c | 2 | private String requestInput(String Prompt) {
String r = "";
while (r.isEmpty()) {
r = console.readLine("%s: ", Prompt);
if (r.isEmpty()) {
console.printf("%s", "Please provide an answer!\n");
}
}
return r;
} |
d3916b7c-d982-4504-a424-d2c4e74209c8 | 3 | public void read(Reader reader, ParserHandler handler) throws IOException, ParseException {
StringBuffer buffer = new StringBuffer();
int c = reader.read();
while (c != -1) {
buffer.append((char) c);
if (c == separator) {
boolean shallContinue =
... |
63811bbb-31f0-4698-872c-49c82bf7de17 | 2 | @Override
protected boolean onCache(ByteBuffer buffer)
{
// If the buffer doesn't have the same buffer size or the buffer
// is not a DirectByteBuffer then return.
if (buffer.capacity() != maxSize || !buffer.isDirect()) {
return false;
}
stack.push(buffer);
return true;
} |
c11b7949-43a0-4d65-80e7-c2351b8aace9 | 1 | private void handlePointMovement(Point draggedPoint) {
if (selectedPoint != -1) {
selectedCurve.setPoint(selectedPoint, draggedPoint);
selectedCurve.updateBezierPoints();
Main.state = State.Drawing;
}
} |
59c21882-2a26-4117-8aff-12e0a4bfa410 | 1 | private void writeTile(Tile tile, XMLWriter w) throws IOException {
w.startElement("tile");
w.writeAttribute("id", tile.getId());
writeProperties(tile.getProperties(), w);
if (tile instanceof AnimatedTile)
writeAnimation(((AnimatedTile)tile).getSprite(), w);
w.endE... |
58ad6fe0-e4e0-49e4-a398-51b87ce2f644 | 7 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Participant that = (Participant) o;
if (email != null ? !email.equals(that.email) : that.email != null) return false;
if (name != null ? !name.... |
a7088e3a-a715-4966-ab21-8105bd91f59b | 1 | public void decoder(int[] octets_data){
if (taille == 7){
//System.out.println("DEplacement1 cr��");
positionXhigh = octets_data[0];
positionXlow = octets_data[1];
positionX = ((positionXhigh<<8) + positionXlow);
positionYhigh = octets_data[2];
positionYlow = octets_data[4];
positionY... |
fc01d0de-8b2a-4841-ab56-8a58ce94e91f | 1 | private void startGame(){
//starts the mechanics iterator
gameServer = new Server();
gameServer.run();
ObjectInputStream objInStream = null;
try{
//wait for the server to settle
Thread.sleep(1000);
//initialize tcp connection
sock = new Socket("localhost", 1337);
//set receive buffer siz... |
f89a2c2e-94fa-4d3e-bc59-8deeec6b0b63 | 0 | public int getId() {
return id;
} |
8e3d01e8-954d-487c-9418-10365c51acb4 | 5 | public boolean addCoefDecalage(String name, BigDecimal coefficient, BigDecimal gap) {
if (name != null && !name.equals("") && !this.existInList(name) && coefficient != BigDecimal.ZERO && this.coefficientList != null) {
Unit unit = new Unit(name, coefficient, gap, false);
this.coefficient... |
84ea4fb0-ef30-4b48-8b73-4e228e1b6015 | 3 | @Override
public void cadastarIntNota(ItensNota intensNot) throws ClassNotFoundException, SQLException,Exception {
dados.cadastarIntNota(intensNot);
if(intensNot.getQtdComprada()<=0){
throw new ItensNotaException("Quantidade Comprada nao pode ser menor ou igual zero");
}
if(intensN... |
e1cd78fa-e15e-4435-8a25-f9dd0b0a1a7e | 2 | private void setButtonMode (Integer bm) {
if (bm == 0) {
okButton.setEnabled(false);
cancelButton.setEnabled(false);
copyButton.setEnabled(true);
deleteButton.setEnabled (true);
editButton.setEnabled(true);
newButton.setEnabled(true);
}
if (bm == 1) {
okButton.setEnabled(true);
... |
95c9cbbd-2b4d-4046-9bf2-e0ecf3c02cd4 | 9 | public static boolean analysisNSMJ(AnalysisOutput o, List<AnalysisOutput> candidates) throws MorphException {
int idxVbSfix = VerbUtil.endsWithVerbSuffix(o.getStem());
if(idxVbSfix==-1) return false;
o.setVsfx(o.getStem().substring(idxVbSfix));
o.setStem(o.getStem().substring(0,idxVbSfix))... |
55e7a57a-cf32-4a50-8c9d-e142678ecafd | 7 | private final boolean cons(int i){
switch (b[i])
{
case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
}
} |
3f655257-8940-4b61-838f-eb5984ad851a | 3 | public static ByteToMessageDecoder createProtocolHandler(int protocolVersion)
{
if (protocolVersion == 4 || protocolVersion == 5)
return new MC1_7Handler();
if (protocolVersion == 47)
return new MC1_8Handler();
return null;
} |
e8566405-9226-4f6d-b26d-3f5cc1cd22eb | 6 | private boolean _jspx_meth_c_choose_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:choose
org.apache.taglibs.standard.tag.common.core.ChooseTag _jspx_th_c_choose_0 = (org.apache.taglibs.stand... |
1f42cc59-9c38-4ecb-b4bf-7f2b50ba563f | 0 | Speed(long delay) {
this.delay = delay;
} |
481851a0-88ed-4b50-88ab-48c568fb324b | 2 | @Override
public int compare(GenericEdge o1, GenericEdge o2) {
if(o1.getAttribute().getValue() < o2.getAttribute().getValue()){
return -1;
}
if(o1.getAttribute().getValue() > o2.getAttribute().getValue()){
return 1;
}
return 0;
} |
4d93cb7f-2ff6-4455-ab61-09bb53abcfd3 | 9 | public static Method findMethod(Class target_class, String method_name, Object[] args) throws Exception {
int len=args != null? args.length : 0;
Method retval=null;
Method[] methods=getAllMethods(target_class);
for(int i=0; i < methods.length; i++) {
Method m=methods[i];
... |
7738d1fe-4193-48f5-90a8-2b1afe6608d7 | 7 | public int escribir(String nombre, String rutaArchivo) {
InputStream entrada = null;
PreparedStatement pst = null;
int ingresados = 0;
try {
File archivo;
String insert;
z.con.setAutoCommit(false);
insert = "Insert into docu... |
478a1a0d-4ead-4edb-aa0d-6b9a50a8473d | 3 | protected void setDirection(String newDirection, int tape) {
if (!(newDirection.equals("L") || newDirection.equals("R") || newDirection
.equals("S")))
throw new IllegalArgumentException("Direction must be L, R, or S!");
direction.set(tape, newDirection);
} |
a10aac0f-b114-4559-a9cf-f85c4a120685 | 2 | @Override
public void doLoopAction() {
if (hit) {
//super.ai();
}
if (changeAni) {
setAnimation();
changeAni = false;
}
} |
4e62105e-3f59-47d3-8286-acb550a27e57 | 9 | public final void run() {
anInt4553++;
for (;;) {
int i;
synchronized (this) {
for (;;) {
if (ioexception != null)
return;
if ((anInt4556 ^ 0xffffffff) != -1) {
if (anInt4556 < anInt4558)
i = -anInt4558 + bufferSize;
else
i = -1 + anInt4556 - anInt4558;
} else
i... |
01a638a9-823a-4b02-abf1-2bff28194525 | 4 | public void confirmApplication(Application a) {
employs.base().incCredits(0 - a.hiringFee()) ;
final Actor works = a.applies ;
//
// TODO: Once you have incentives worked out, restore this-
//works.gear.incCredits(app.salary / 2) ;
//works.gear.taxDone() ;
works.setVocation(a.position) ;
... |
4c4a0785-a842-45c1-901b-17bbe29267ee | 3 | public void drawWave2Text(int x, String text, int effectSpeed, int y, int color) { // method387
if (text == null) {
return;
}
x -= getANTextWidth(text) / 2;
y -= trimHeight;
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c != ' ') {
drawChar(pixels[c], x + horizontalKernin... |
c32cc122-7d22-4186-b80b-5dbe5b200474 | 8 | @Override
public void run() {
for (int i = this.nTimes + (this.nTimes == 0 ? 0 : 1); i != 1; i--) {
long t = (long) (Math.random() * thinkMillis);
System.out.println("Philosopher " + id + " thinks for " + t + " time units.");
try {
Thread.sleep(t);
... |
a93a0cb1-5eeb-4dfd-becb-50d96b530feb | 0 | public String getName()
{
return nameLabel.getText();
} |
7c65cc11-8ffe-4265-b176-2801eda59f74 | 9 | @Override
public void endElement( final String namespace_uri, final String local_name, final String qualified_name )
throws SAXException {
if ( ForesterUtil.isEmpty( namespace_uri ) || namespace_uri.startsWith( ForesterConstants.PHYLO_XML_LOCATION ) ) {
if ( local_name.equals( TolXml... |
e8af81cf-e2a5-4d1f-8ddc-4a55d48fb6e2 | 9 | public double lloydPlusPlus(int k, int n, int d, Point points[]) {
//System.out.println("starting kMeans++");
//choose random centres
this.tmpCentresStreamingCoreset = chooseRandomCentres(k, n, d, points);
double cost = targetFunctionValue(k, n, this.tmpCentresStreamingCoreset, points);
... |
5b94bd9f-4145-4960-9d74-0b5f354e12be | 6 | public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... |
cc83c019-b301-4748-9445-645524a3262f | 0 | public void setImage(File image) {
this.image = image;
} |
36264b00-9c11-4ca1-8e06-a6f502738697 | 4 | public void initTable() {
tableModel.addTableModelListener(deckTable);
deckTable.setRowSelectionAllowed(true);
deckTable.getTableHeader().setReorderingAllowed(false);
//deckTable.setRowSorter(sorter = new TableRowSorter<DeckTableModel>(tableModel));
//sorter.setSortsOnUpdates(tru... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.