method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
750e5b32-3c23-4493-afdf-3c630ec62ee1 | 6 | @Test
public void testConvertingHashMapToSQLArray() {
HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
for (int i = 0; i < 10; i++) {
map.put(i + 1, i);
}
String result = null;
try {
Method method = DBHandler.class.getDeclaredMethod("c... |
50650ca2-884c-4397-b2de-fec2b81ad8d1 | 2 | public void setOxygen( int n ) {
oxygen = n;
if ( oxygen == 100 ) {
bgColor = maxColor;
} else if ( oxygen == 0 ) {
bgColor = minColor;
} else {
double p = oxygen / 100.0;
int maxRed = maxColor.getRed();
int maxGreen = maxColor.getGreen();
int maxBlue = maxColor.getBlue();
int mi... |
5df4d580-ed5e-47d1-b6a1-ccf00a4232d5 | 6 | public static void deleteAccounts(List<Account> accountList, Accounts accounts){
if(!accountList.isEmpty()) {
ArrayList<String> failed = new ArrayList<String>();
for(Account account : accountList) {
try{
accounts.removeBusinessObject(account);
... |
61e40c1e-6456-44d3-bbb2-826b3cd90be1 | 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... |
76613843-a9a9-48ae-8f92-d2a3fefeefac | 8 | private GameState findSetToTrue(GameState state, Card card)
{
//Check the hand
for(Card c : state.getPlayer(card.getFaction()).getHand())
{
if(c.equals(card))
{
state.getPlayer(card.getFaction()).removeFromHand(c);
c.setTrue(state.getTime());
state.getPlayer(card.getFaction()).addToHand(c);
... |
883510f0-5b38-47e9-a0b0-471b528df61b | 7 | public static void main(String[] args)
{
File dictionary = null;
File document = null;
String option = "";
if(args.length < 2 || args.length > 3)
{
System.out.println("Incorrect number of arguments!");
return;
}
dictionary = new File(args[0]);
if(!dictionary.isFile()){
System.out.printl... |
384e75a0-fac0-4f59-ac91-99105f2c9b37 | 8 | public static void copybitmap(osd_bitmap dest, osd_bitmap src, int flipx, int flipy, int sx, int sy,
rectangle clip, int transparency, int transparent_color)
{
rectangle myclip=new rectangle();
/* if necessary, remap the transparent color */
if (transparency == TRANSPARENCY_COLOR)
transparent_col... |
1daf2b6f-b915-4c85-9e82-17c69a111051 | 0 | public Modele getPlateau1() {
return plateau1;
} |
da787dca-d14b-4e91-88e7-43fd635268f7 | 6 | public boolean write(aos.apib.OutStream out, aos.apib.Base o) {
PeerInfo__Tuple v = (PeerInfo__Tuple)o;
int i = -1;
while ((i = out.nextField(i, this)) >= 0) {
switch (i) {
case 0:
out.putInt(v.id, i, __def.id, this);
break;
case 1:
out.putBool(v.isAlive, i, __def.isAlive, this);
... |
a9f18084-d077-4bfc-bc42-cf36b210bc3c | 4 | public static void main(String[] args) {
/* Use an appropriate Look and Feel */
try {
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
long l = Long.parseLong("1111222222222222");
Date d = new Date(l);
Calendar c = C... |
4becd18f-8c33-4f0a-8fd3-ef5efb2f8f8e | 9 | public Dimension getPreferredSize() {
Insets i = getInsets();
return new Dimension(i.left + i.right + 2 + (image != null && text != null && textVisible ? textImageGap : 0)
+ (image != null ? image.getWidth(this) : 0)
+ (metrics != null && textVisible && te... |
61f4acd7-0e23-4953-a54a-2ccd907150ad | 8 | protected void oneMoreStoryChar(){
if(curStory.isEmpty()&&curPStory.isEmpty()){
timer.stop();
storyDiscription="";
pStoryDiscription="";
storyCharIndex=0;
pStoryCharIndex=0;
return;
}
if(!curStory.isEmpty()){
... |
d54b6e49-5f41-4291-85e3-fb57101d8113 | 7 | public ClassifierCustomizer() {
m_ClassifierEditor.
setBorder(BorderFactory.createTitledBorder("Classifier options"));
m_updateIncrementalClassifier.
setToolTipText("Train the classifier on "
+"each individual incoming streamed instance.");
m_updateIncrementalClassifier.
a... |
65939f4c-1a51-46cc-9672-3d814d5f7945 | 5 | public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = in.nextInt();
ArrayList<ArrayList<Integer>> a = new ArrayList<>();
for (int i = 0 ; i <= 100 ; i++){
ArrayList<Integer> b = new Arr... |
d20bf472-3d29-48b9-adc4-86a5e2b0901c | 5 | public void sinkDown(int k){int a = mH[k];
int smallest =k;
if(2*k<position && mH[smallest]>mH[2*k]){
smallest = 2*k;
}
if(2*k+1<position && mH[smallest]>mH[2*k+1]){
smallest = 2*k+1;
}
if(smallest!=k){
swap(k,smallest);
sinkDown(smallest);
}
} |
ee2fbf14-23cd-4355-8305-551b99def722 | 3 | public void trimData( int maxLength )
{
if( audioData == null || maxLength == 0 )
audioData = null;
else if( audioData.length > maxLength )
{
byte[] trimmedArray = new byte[maxLength];
System.arraycopy( audioData, 0, trimmedArray, 0,
... |
51799eec-4480-4938-a512-032bc84aae12 | 5 | @EventHandler (priority = EventPriority.NORMAL)
public void onBlockPlace(BlockPlaceEvent event){
Player p = event.getPlayer();
if(!RPSystem.permission.has(p, plugin.config.getString("block-restriction.override-permission")) && !p.isOp()){
if(plugin.itemConfig.getStringList("restricted-items").contains(event.... |
60896f79-c713-4b43-a794-832d5dd728f9 | 0 | public int getS1() {
return this.state;
} |
ada3ae03-c1e6-42e5-a6ed-7ef569bedf83 | 7 | public static void main( String[] args )
{
/*
* Given following method signature, print all the combinations of the numbers: void combinations(int maxNumber);
*/
System.out.println("01---------------------------------------");
int[] sampleArray = { 1, 2, 3,4 };
ArrayList<Object> arr ... |
718fe4f9-a986-4599-831f-18e5ccd0f06b | 5 | public static BufferedImage getPanel(int w, int h, BufferedImage img) {
BufferedImage res = new BufferedImage(w, h, 2);
int onew = img.getWidth() / 3;
int oneh = img.getHeight() / 3;
res.getGraphics().drawImage(img.getSubimage(0, 0, onew, oneh), 0, 0, onew, oneh, null);
res.getGraphics().drawImage(img.get... |
881d848c-446a-42c6-b5b5-4f2bb115d8fc | 4 | public void leftRotate( int d) {
int i, j, k, temp;
int n = arr.length;
int gcd = gcd(d, n);
for (i = 0; i < gcd; i++) {
/* move i-th values of blocks */
temp = arr[i];
j = i;
while (true) {
k = j + d;
if (... |
ada5c0b2-9304-4bc2-9b1c-ce6b18bb3746 | 5 | @Override
public boolean execute(final CommandSender sender, final String[] split) {
if (sender instanceof Player) {
if (MonsterIRC.getHandleManager().getPermissionsHandler() != null) {
if (!MonsterIRC.getHandleManager().getPermissionsHandler()
.hasCommand... |
042f0906-0a83-4db8-b0c5-e51d0336a0b8 | 0 | public void getMemento() {
Memento memento = (Memento) c.getMemento();
state = memento.getState();
System.out.println("the state is " + state + " now");
} |
8f7d84c9-42b2-4b81-99fd-09bb335da418 | 1 | @Test
public void fieldFilterIsCaseInsensitive() {
citations.add(c1);
filter.addFieldFilter("author", "kekkonen");
List<Citation> filtered = filter.getFilteredList();
assertTrue(filtered.contains(c1) && filtered.size() == 1);
} |
88cd19e5-5abe-4de2-90bd-85b8f5554343 | 3 | private synchronized void invia (String v, int a, int b) throws JMSException {
QueueConnection qc =null;
QueueSession qs =null;
///prova mess
try {
qc = qcf.createQueueConnection();
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try... |
612c8092-1786-4ebb-b1e7-d22e3254045d | 7 | private static Map processJsonAsMap(JsonElement jsonElement, Class<?> mapClass, Class<?> valueClass) throws JsonException, IllegalAccessException, InstantiationException {
Map map;
if (mapClass.isInterface()) {
if (mapClass.isAssignableFrom(HashMap.class)) map = new HashMap();
el... |
c79aa20c-5cf7-489f-a9e9-3e38cfe496aa | 0 | public void setDescription (String d)
{
description = d;
} |
a510fa43-e77e-4055-855f-85581e3e92bc | 1 | @Override
public void handleNotOpenEnded( int x, int y ) {
if( itemShown ){
parent.removeItem( line );
}
itemShown = false;
} |
0f0d3c57-a1c9-4557-8ae9-11255f2253ef | 7 | void placeAllShipsRandomly(){
Random generator = new Random();
int randomRow = generator.nextInt(10);
int randomCol = generator.nextInt(10);
boolean isHorizontal = generator.nextBoolean();
// place the battle ship
Battleship battleship = new Battleship();
battlesh... |
675993be-cf44-4041-a70d-bbb995337873 | 8 | @Override
public void erzeugeAnmeldung(AnmeldungDTO a) {
Laeufer provLaeufer = new Laeufer();
Laufveranstaltung provLaufveranstaltung = new Laufveranstaltung();
Verein provVerein = new Verein();
for(int i = 0; i < laeuferList.size(); i++) {
provLaeufer = laeuferL... |
c0e4c096-e062-442e-a91b-1f008f0b1e47 | 1 | @Override
public void handleEvent(Event event) {
if (event.getType() == EventType.END_ACTION)
endActionUpdate();
} |
365cfafb-68af-4a51-b389-ad5b9068814d | 5 | public final void update(Level level, int x, int y, int z, Random rand) {
if(rand.nextInt(4) == 0) {
if(!level.isLit(x, y, z)) {
level.setTile(x, y, z, DIRT.id);
} else {
for(int var9 = 0; var9 < 4; ++var9) {
int var6 = x + rand.nextInt(3) - 1;
... |
ab09c309-991b-45ea-bf7b-95dab6cad4e0 | 0 | public int run(){
sort(aInt);
return 0;
} |
8ee1c83e-ed16-4290-9941-d7729c9ca702 | 8 | @Override
public void run()
{
resetFlags();
try
{
this.in = this.socket.getInputStream();
// attempt to start a WebSocket session - failure caught in error handler
String responseString = startSession(in);
sendResponse(responseStr... |
347d34c5-9e41-4057-967c-a22f0821dc0a | 2 | public Builder staffRepository(Repository respository) {
// If we didn't get a repository, do nothing.
if (respository == null) {
return this;
}
if (message.staffRepositoryList == null) {
message.staffRepositoryList = new ArrayList<Reposit... |
f651e6df-b6fd-402c-9d5c-e4522a26f124 | 0 | public static void flipCell(JCellule[][] grid, int x, int y, JLabel lblGeneration, JButton btnProchaineGeneration) {
ControllerGrille.grid.flipCell(x, y);
synchroniser(grid, lblGeneration, btnProchaineGeneration);
} |
4b4cf273-2ec7-4cd3-b603-524d124ed11a | 6 | public static int findNumYouIs(String content) {
int result = 0;
if (content != null && !content.equals("")) {
ArrayList<String> sentences = findSentences(content);
for (String sentence : sentences) {
if (sentence.contains("IMHO"))
result += countNumberOfOccurence(sentence, "IMHO");
if (sentence.... |
1ea58253-950d-40ca-94b6-211c0e79c487 | 5 | public static String convertPatternExtractBracketedExpression( String pattern )
{
String[] s = pattern.split( "\\[" );
if( s.length > 1 )
{
pattern = "";
for( String value : s )
{
int zz = value.indexOf( "]" );
if( zz != -1 )
{
String term = "";
if( value.charAt( 0 ) == '$' )
... |
bff1b356-00de-4d9e-a62a-51c721a9cef9 | 5 | @Override
public void doChangeBrightness(int brightnessAmountNum) {
if (imageManager.getBufferedImage() == null)
return;
WritableRaster raster = imageManager.getBufferedImage().getRaster();
for (int x = 0; x < raster.getWidth(); x++) {
for (int y = 0; y < raster.getHeight(); y++) {
double[] pixel = new... |
6a0d4bad-4912-4f63-9734-adcc65e8a4b8 | 1 | @Override
public void copyDifferentItemsToRightList() throws RemoteException {
try {
toList.addItems(fromList.getWorkingDirectory(), fromList.getDifferentItems(toList));
} catch (IOException ex) {
throw new RuntimeException(ex);
}
} |
78c07f58-c799-4edc-9985-a5e735e59f6b | 9 | @Override
public boolean envelopesPoint(double xx, double yy) {
return (((a > 0 && (xx >= x && yy >= y)) && (xx <= x + a) && (yy <= y + a)) || ((a < 0 && (xx <= x && yy <= y)) && (xx >= x + a) && (yy >= y + a)));
} |
c6c2f42c-a322-428f-83d8-88a286010923 | 1 | public boolean matches( Class<?> clazz )
{
return clazz.isAnnotationPresent( this.annotationType );
} |
b848a115-b227-43b9-a061-95a26ac6623f | 6 | final public UpdateCommand Update() throws ParseException {
String tableName;
List<AttributeAssign> attrAssgs = new ArrayList<AttributeAssign>();
String condition = "";
AttributeAssign attrAssg;
jj_consume_token(KW_UPDATE);
tableName = getTokenImage();
jj_consume_token(KW_SET... |
c7aa371f-26cd-42e2-95fd-336ee7e54350 | 9 | private void assertTagValue(JsonObject node, String propertyName, String value)
throws XPathExpressionException {
List<JsonElement> list = new ArrayList<>();
if (propertyName.startsWith("/")) {
findJsonElementsPath(node, propertyName.substring(1).split("/"), list);
} else {
findJsonEleme... |
56fb09da-6327-489f-ad7f-fb9d222ad9dc | 9 | @Override
protected void processClasspathResources(List<ClasspathResource> classpathResources) {
updateStatus("Searching for overlaping jars");
List<JarPair> overlapReportLines = scanner.findOverlappingJars(classpathResources, false);
for (JarPair overlapPair : overlapReportLines) {
... |
33f1d570-a4f5-49e7-b70c-f240b1ad16f9 | 7 | private String DDCRET_String(int retcode)
{
switch ( retcode )
{
case DDC_SUCCESS: return "DDC_SUCCESS";
case DDC_FAILURE: return "DDC_FAILURE";
case DDC_OUT_OF_MEMORY: return "DDC_OUT_OF_MEMORY";
case DDC_FILE_ERROR: return "DDC_FILE_ERROR";
case DDC_INVALID_CALL:... |
6eca562c-34ff-46ed-93fa-e2a5e67f5fdf | 0 | public Tool(AutomatonPane view, AutomatonDrawer drawer) {
this.view = view;
this.drawer = drawer;
automaton = drawer.getAutomaton();
} |
4fce99ed-fef4-4fe0-80a0-ce31ae9ed925 | 2 | private int signOf(double x)
{
if (x > 0.1)
return 1;
else if (x < -0.1)
return -1;
else
return 0;
} |
be5b80e3-94c8-4898-a965-ead37f7a6661 | 0 | public Period getDepartureTime() {
return this._departureTime;
} |
984f3ea9-19d4-458d-8778-a2e267f5681f | 5 | private void boutonAsgardMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonAsgardMouseClicked
// TODO add your handling code here:
if (partie.getAs().isActif()) {
if (!partie.getDieuActuel().isaJouerEnAsgard()
|| ((partie.getDieuActuel().getNom().compar... |
66564e47-2129-4618-890e-da713fea133a | 5 | public static boolean driveDistance(double distance) {
if (!encoderInit) {
resetEncoders();
currentDistance = 0.0;
encoderInit = true;
}
if (distance > 0) {
while (currentDistance < distance) {
currentDistance = getEncoderAverage();
return fa... |
013bd1bf-fa9f-433e-abfa-a5b0871163ca | 4 | public Partie() {
lstJoueurs = new LinkedList<Joueur>();
peuplesPris = new LinkedList<Class<? extends Peuple>>();
peuplesDispo = new LinkedList<Class<? extends Peuple>>();
pouvoirsPris = new LinkedList<Class<? extends Pouvoir>>();
pouvoirsDispo = new LinkedList<Class<? extends Pouvoir>>();
argentPeuple = ne... |
06fc165f-4c22-457d-a775-da313f5fb881 | 4 | public boolean setFile(String file) {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: setFile() BEGIN");
}
m_inFile = new File(this.m_path + file);
if (test || m_test) {
System.out.println("FileManager :: setFile() END");
}
return true;
... |
da838bb8-74df-463c-8f69-dc9f7456e5d9 | 1 | public Types getObjectType(String name) {
int index;
if((index = ObjectNames.indexOf(name)) != -1) {
return ObjectType.get(index);
}
return null;
} |
978240d1-4876-4a01-940e-6e7120bff406 | 5 | public void initRGBbyHSL( int H, int S, int L )
{
int Magic1;
int Magic2;
pHue = H;
pLum = L;
pSat = S;
if( S == 0 )
{ //Greyscale
pRed = (L * RGBMAX) / HSLMAX; //luminescence: set to range
pGreen = pRed;
pBlue = pRed;
}
else
{
if( L <= (HSLMAX / 2) )
{
Magic2 = ((L * (HSLMAX +... |
86b16b89-58b5-44a1-8ced-1939ef63021d | 9 | public static void stopServer() {
// TODO Fix bug, server not sending message to all clients
//send message to clients informing them of server shutdown
try
{
for(int a = 0; a < clients.size(); a++)
{
//System.out.println("Exit: " +
clients.elementAt(a).setServerMessage("ServerShutdown");
fo... |
088ecf49-a763-494f-afe9-90ce4c18cae5 | 5 | public void checkValid(Loader l) throws InterruptedException {
boolean test = false;
if (test || m_test) {
System.out.println("ControlButtonListener :: "
+ "checkValid() BEGIN");
}
if (l.getValid()) {
m_game.getGrid().setGrid(l.getGridArray());
m_game.setPla... |
cb4ea0d7-a71c-40c1-bcaa-9aca5b5e7814 | 4 | private void asetaKimmotusehto(Pelihahmo h){
if (0 > h.getMinX() || kentanLeveys < h.getMaxX()){
setEhtoX(h, getEhtoX(h)+1);
} else {
setEhtoX(h, 0);
}
if (0 >= h.getMinY() || kentanKorkeus <= h.getMaxY()){
setEhtoY(h, getEhtoY(h)+1);
} else {... |
a93ef3f8-4f6f-4ffb-8bb3-a8e39ff72a2c | 4 | public int isGameOver ()
{
if (gameover!=NOPLAYER) return gameover; // cached value
switch (neutron_x) {
case 1: gameover=BLACK; break;
case 5: gameover=WHITE; break;
default:
if (!canNeutronMove()) {
gameover=whoDidLastMove();
break;
}
gameover=NO... |
31ffcb42-d017-464e-bc0d-42adbd3fbcd1 | 4 | public FilesWatcher(int periodInSec) {
period = periodInSec * 1000;
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
List<File> hasChanged = new ArrayList<File>();
synchronized (LOCK_WATCHERS) {
for (FileWatcher watcher : watchers) {
if (watcher.hasChan... |
be8668f4-1c26-43b8-8cfe-2c2fbc2e2d6a | 0 | public int getComboMonth() {
return combo2.getSelectedIndex();
} |
6ef596c4-450a-4f9e-838c-e62a02aa309a | 4 | public int bestAction()
{
int selected = -1;
double bestValue = -Double.MAX_VALUE;
for (int i=0; i<children.length; i++) {
if(children[i] != null) {
//double tieBreaker = m_rnd.nextDouble() * epsilon;
double childValue = children[i].totValue / (c... |
c2a3fc8d-f4ad-489e-af6b-031c923545b5 | 8 | protected PseudoSequenceBIDE trimBeginingAndEnd(Position positionStart, Position positionEnd){
int itemsetStart = 0;
int itemStart =0;
int itemsetEnd=lastItemset;
int itemEnd=lastItem;
if(positionStart != null){ // where the cut starts
itemsetStart = positionStart.itemset;
itemStart = positionStart... |
8ebcab7b-565d-4942-ba25-0913b52c6591 | 1 | @Test
public void removeHousehold() throws InstanceNotFoundException,
ParseException, DuplicateInstanceException {
Household hh = familyService.findHousehold(0);
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
Calendar cal3 = Calendar.getInstance();
cal3.setTime(sdf.parse("12/03/2006"));
Student... |
c2b9e7ca-8613-426b-bfde-7fdcca87257e | 7 | public String getDayOfWeekName(Integer dayOfWeek){
switch (dayOfWeek){
case 1:
return "Sun";
case 2:
return "Mon";
case 3:
return "Tue";
case 4:
return "Wed";
... |
af0d7cc8-2d1d-4719-a72f-4e1791ed860e | 7 | private String formatNodes(ViterbiNode[][] startsArray, ViterbiNode[][] endsArray) {
this.nodeMap.clear();
this.foundBOS = false;
StringBuilder sb = new StringBuilder();
for (int i = 1; i < endsArray.length; i++) {
if(endsArray[i] == null || startsArray[i] == null) {
continue;
}
for (int j = 0; j ... |
ee2bb193-d9e8-4af1-9027-a949632eabef | 7 | public void createDirectedGraph() {
for(String word1 : parseUtil.getFeatureWordSet()) {
Map<String, Double> rowMap = new HashMap<String, Double>();
for (String word2 : parseUtil.getFeatureWordSet()) {
rowMap.put(word2, 0.0);
}
directedGraph.put(word1, rowMap);
}
Iterator iterator = parseUtil.g... |
d54f0bbc-0916-421e-8055-1229d0272fe2 | 9 | public void writeBlocks(DAWG graph) throws IOException {
// use heuristic to estimate number of blocks
// estimated overhead of 15 and 25KB / block target size
int blockNumber = graph.text.length() / 1000 * 15 / 25;
if (blockNumber < 100) {
blockNumber = 100;
}
int threshhold = (graph.size() / blockNu... |
8651f201-3448-4701-96ff-cf920b328c0d | 1 | public static double processLightHouse(LightHouse lightHouse) {
long timeStart = System.currentTimeMillis();
while (!lightHouse.canBeLifted()) {
//Random balloon with diameter 20..30 cm and fullness 80..100%
Balloon b = Balloon.getRandomBalloon(0.10, 0.15, 0.8, 1.0);
... |
b134d5d5-7eaf-4f2e-90bf-ce90aa9be119 | 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... |
de363ba0-6fcd-4f1c-98f4-29354265035a | 8 | private String getUpdatedTokenWithAlias(final String querySchema, final String tableName,
final String fieldToken, final String aliasBefore,
final String aliasAfter)
{
if (fieldToken.lastIndexOf(SQLFormatter.DOT) != -1)
... |
94b7550c-b46e-4e59-af53-48ed2c262661 | 2 | @Override
public boolean canMove(Board board, Field currentField, Field emptyField) {
return this.validSetupForMove(currentField, emptyField) && this.inSameRankOrFile(currentField, emptyField) && board.clearPathBetween(currentField, emptyField);
} |
6f9f9ccd-dada-4fa6-a037-4669e5562819 | 9 | private void afficherFixerCoefficient() {
System.out.println("Fixer un coefficient.");
System.out.println("Liste de vos modules :");
Professeur professeur = (Professeur) this.modeleApplication.getCurrent();
ArrayList<Module> modules = this.universite.getModulesParProfesseur(professeur);
... |
7152a009-9a40-4bb3-bed5-70f2275cd3c7 | 8 | protected boolean update(SunFishFrame parent, display.DisplayData displayData) {
title = displayData.getFileName();
doc = (Document)(displayData.getData(0));
Node documentRoot = doc.getDocumentElement();
DefaultMutableTreeNode treeRoot = addTreeNodes(documentRoot);
tree = new JTree(treeRoot);
tree.set... |
a2474643-11ff-4208-bfa9-41e36e4a67f8 | 9 | public void add(DimensionValueCollection o, Long TimeStamp, InfoStored type) {
if(size() == CAPACITY && !containsKey(TimeStamp))
{
Iterator <Long> i = keySet().iterator();
Long oldest = i.next();
while(i.hasNext())
{
Long check = i.next();
if(check < oldest)
oldest = check;
}
remove(o... |
7bdd4e09-91e0-4f09-9d30-300738085026 | 5 | private static void read(int[] symbols, FileReader reader) throws IOException {
int c;
while ((c = reader.read()) != -1) {
if (c - 'a' < 26 && c - 'a' >= 0) {
symbols[c - 'a']++;
} else {
if (c - 'A' < 26 && c - 'A' >= 0) {
symbols[c - 'A']++;
}
}
}
} |
31829023-c5cc-4e77-92ca-be8b395950c3 | 6 | public static void exportProcess(){
BufferedWriter file =null;
String nameFile = "UsiExportQuartier";
try{
File dir = new File("export");
dir.mkdirs();
FileWriter fileWriter = new FileWriter("export\\" + nameFile + ".csv");
file = new BufferedWrit... |
4acb95aa-55b2-49f8-8e55-fabfe545031a | 3 | private List<Movement> listPositionsToMove(Player player) {
if (player == null)
throw new IllegalArgumentException("Player can't be null!");
List<Movement> possibleMovements = new ArrayList<Movement>();
for (Movement move : Movement.values()) {
if (grid.canMove(player, move))
possibleMovements.add(mov... |
aad8cd98-4fbe-4187-81d5-b9f4c737cffd | 6 | @Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Route other = (Route) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return... |
3e16e8cd-9e8b-4879-af8d-b550d085196b | 2 | public Lexicon(boolean stressSensitive, boolean trace, boolean useTrust, boolean useProbMem,
boolean useNorm, double probAmount, double decayAmount, SubSeqCounter counter) {
this.stressSensitive = stressSensitive;
this.trace = trace;
this.useTrust = useTrust;
this.NORMALIZATION = useNorm;
this.counter = co... |
3ea3fe9d-7b4e-4d58-af4d-0338158d444e | 0 | public String getSaveEncoding() {
return saveEncoding;
} |
a32cd027-deac-4fc6-9dc9-6ce8bbaed676 | 2 | @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession(true);
System.out.println("desde NEXT");
String salir = request.getParameter("salir");
String newsC = request.getPa... |
f7eae596-7b24-40d2-8726-5b7f06d907b7 | 2 | public void printOriginalGraph() {
int vertex = 0;
int neighbor = 0;
int edge = 0;
Iterator<Integer> it = originalGraph.keySet().iterator();
while (it.hasNext()) {
vertex = it.next();
System.out.print(vertex + ":");
HashMap<Integer, Integer> neighbors = originalGraph.get(vertex);
Iterator<Integer... |
612776d6-94b7-4be3-a64a-3a03a2dc6da3 | 5 | static final void method701(Class273 class273, int i, int i_0_) {
ClientScript class348_sub42_sub19
= Class153.method1223(i, i_0_, 96837648, class273);
if (class348_sub42_sub19 != null) {
anIntArray1164
= (new int
[((ClientScript) class348_sub42_sub19).anInt9688]);
aStringArray1155
= (new Stri... |
552704f3-89c5-42da-afc5-21c5599f4508 | 6 | public Response handleRequest() {
switch (criteria) {
case CREATE_ACCOUNT:
(new ApplyAccountCreate(list)).accountCreate();
break;
case CHECK_LOGIN:
return (new ApplyLoginCheck(list)).checkLogin();
case CHECK_REGISRTY:
... |
36dde0d6-83b5-4279-8a54-44d4a1253820 | 1 | public int[] exceptionTypes() {
if (exceptions != null) {
return exceptions.exceptionTypes();
}
return new int[0];
} |
0cc30056-9c89-4b2f-96a2-b16ff1aa1bb3 | 9 | public void paint(Graphics g)
{
super.paint(g);
if (shapes == null) return;
long timeOverlap = - System.currentTimeMillis();
// reset overlaps
for (Shape s: shapes) s.overlaps = false;
// Calculate overlaps
for (Shape s1: shapes) {
for (Shape s2: shapes) {
if (s1.hashCode() < s2.hashCode()) ... |
9403b951-26a2-4f0b-8bc4-ea87897d0c53 | 2 | protected boolean canPutInBackpack(Actor actor)
{
System.out.println(getName() + " is finding out if it can add " + ((SimpleWorldActor)actor).getName() + " to its backpack.");
return getBackpack() != null && //must have a backpack
actor instanceof ContainableSimWo && //a is containable
... |
5da19958-4604-46b9-a859-9c12194a84bd | 9 | public static ByteBuffer get(FileDescription description)
{
if (description.getIndex() == 255 && description.getArchive() == 255)
{
return meta;
}
if (data.containsKey(description))
{
return data.get(description);
}
ArchiveMeta meta = cache.get(description.getIndex()).getArchiveMeta(
descriptio... |
6f7db55d-39a2-41fc-9b2c-2fbb183adfa2 | 2 | public void InsertarOtro(ArrayList datos)
{
// Cambiamos todos los datos, que se puedan cambiar, a minúsculas
for(int i = 0 ; i < datos.size() ; i++)
{
try{datos.set(i, datos.get(i).toString().toLowerCase());}
catch(Exception e){}
}
biblioteca.insertar... |
f176ef83-1768-4af0-abea-058772b78e66 | 2 | public GridSizeDialog() {
myPanel.add(new JLabel("Width:"));
wField.setText("10");
myPanel.add(wField);
myPanel.add(Box.createHorizontalStrut(15));
myPanel.add(new JLabel("Height:"));
chooseFile.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileC... |
d74f0b74-a395-4744-9977-a149ef4d7f34 | 2 | public boolean isGetMethodPresentFor(Field field) {
FieldStoreItem item = store.get(FieldStoreItem.createKey(field));
if(item != null) {
return item.getGetMethod() != null ? true : false;
}
return false;
} |
af4a27ed-1a8e-425f-b77e-6b69d96c7aed | 0 | public void stop(){
distributedService.dispose();
} |
5ded3c7a-5be8-43e3-bef3-3e64d2c62181 | 3 | @Override
public void paintComponent(Graphics g)
{
super.paintComponent(g);
// Determine the width of the space available to draw the line number
FontMetrics fontMetrics = component.getFontMetrics( component.getFont() );
Insets insets = getInsets();
int availableWidth ... |
87c68eb8-4a44-4b5f-9748-a3b43da8fab0 | 5 | void readCdsFastaFile(String cdsFastaFileName) {
int lineNum = 1;
if (!quiet) System.out.print("Reading file:" + cdsFastaFileName + "\t");
FastaFileIterator ffi = new FastaFileIterator(cdsFastaFileName);
for (String cds : ffi) {
// Transcript ID
String trid = GprSeq.readId(ffi.getHeader());
// Repeat... |
7da029b5-4bd0-4183-88e4-9b67651fa48a | 2 | public void executeJob(IJob job){
JobExecutor executor = new JobExecutor(job, updateable, id);
try {
executor.run();
} catch (Exception e) {
e.printStackTrace();
try {
//Executing the job went wrong, we signal the master and shut ourselves down
updateable.send(new StatusUpdate("VM " + id ... |
0094c425-f1e9-4732-bcbf-8f87ea095b78 | 6 | private static void solve(Integer[] in) {
int cuts = 0;
int min = Integer.MAX_VALUE;
// for (int item : in) {
// if (item > 0 && item < min) {
// min = item;
// }
// }
//
... |
dd332e3f-44bc-44c5-bd3a-ee16eee633c4 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Sequence other = (Sequence) obj;
if (definitionLine == null) {
if (other.definitionLine != null)
return false;
} else if (!definitionLin... |
b84abee1-b3d7-4b9e-a538-1dba6e3bcebe | 2 | public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sM = reader.readLine();
String sN = reader.readLine();
int nM = Integer.parseInt(sM);
int nN = Integer.parseInt(sN);
for (in... |
d010e1d0-e681-47be-8a4d-b1fe0e4fa098 | 9 | public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7)
{
this.syncCurrentPlayItem();
this.netClientHandler.addToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.inventory.getCurrentItem())... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.