method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
e08e3015-fb4e-4cb5-a3fe-171839d882c7 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
@SuppressWarnings("rawtypes")
ArrayHashMapMergingQueue other = (ArrayHashMapMergingQueue) obj;
if (mergedMap == null) {
if... |
9cd8605d-c1e3-4c6f-9a1a-c84814d0748e | 1 | @Override //оповещение наблюдателей
public void notifyObservers() {
//идем по листу наблюдателей и оповещаем их
for (final Observer anObserverList : observerList) {
//из состояния моделт берем все, что надо знать наблюдателю и передаем ему
anObserverList.update(state.getBrick... |
69e44d6e-9671-41d6-b775-bc2f960e1d64 | 3 | private static void test_zerosCount(TestCase t) {
// Print the name of the function to the log
pw.printf("\nTesting %s:\n", t.name);
// Run each test for this test case
int score = 0;
for (int i = 0; i < t.tests.length; i += 2) {
int bits = (Integer) t.tests[i];
int exp = (Integer) t.tests[i + 1];
... |
6dca7aa3-19d1-45a5-a7e6-433ca3296ca7 | 2 | public LocalInfo getLocalInfo(int addr, int slot) {
LocalInfo li = new LocalInfo(this, slot);
if (lvt != null) {
LocalVarEntry entry = lvt.getLocal(slot, addr);
if (entry != null)
li.addHint(entry.getName(), entry.getType());
}
allLocals.addElement(li);
return li;
} |
a54dc522-2f34-4020-b017-512a56d1cdc5 | 7 | public String reverseWords(String s) {
String result = "";
if (s.length() == 0)
return result;
Stack<String> stack = new Stack<String>();
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) != ' ') {
String word = "";
while (i < s.length() && s.charAt(i) != ' ') {
word += s.charAt(i);
... |
ded3b284-ac79-4e1f-aeec-165c8a354400 | 1 | public Coord getc() {
Gob tgt = gob.glob.oc.getgob(this.tgt);
if(tgt == null)
return(gob.rc);
Coord c = tgt.position();
return(c);
} |
8d03f707-fab5-43b8-8785-3f038a5199dd | 7 | public DisplayMode getHighestResolutionDisplayMode(){
DisplayMode[] videoCardModes = videoCard.getDisplayModes();
int highest = 0;
for(int k = 1; k < videoCardModes.length; k++){
if(videoCardModes[highest].getWidth() < videoCardModes[k].getWidth()){
highest = k;
}else if(videoCardModes[highest].getWidth... |
a9c99a80-d8a3-4d37-a6e4-34d827024eb4 | 3 | private static Method findMethod2(Class clazz, String name, String desc) {
Method[] methods = SecurityActions.getDeclaredMethods(clazz);
int n = methods.length;
for (int i = 0; i < n; i++)
if (methods[i].getName().equals(name)
&& makeDescriptor(methods[i]).equals(desc... |
e3a9edec-67c3-4e40-9966-891a5cf6b35f | 9 | public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int n = sc.nextInt();
int m = sc.nextInt();
if((n|m)==0)break;
double[][] t = new double[n][n];
for(int i=0;i<n;i++)for(int j=0;j<n;j++)t[i][j]=sc.nextDouble();
double[][] dp = new double[m][n];
for(int i... |
63aec09a-8061-4256-9f3f-fdf3894cf17f | 8 | public void in_event ()
{
// If still handshaking, receive and process the greeting message.
if (handshaking)
if (!handshake ())
return;
assert (decoder != null);
boolean disconnection = false;
// If there's no data to process... |
75068778-f182-4ac1-ab07-d29c6aec633e | 0 | public boolean isEatable() {
return false;
} |
a04d6345-5284-4826-a8db-129b9bdf8512 | 3 | private void checkInterval(int value) throws PropertyException
{
if(value != UNDEFINED) {
if((value < 0) || (value > 100)) throw new PropertyException(this, "Value " +value +" is not in range [0, 100].");
}
} |
ab525ce7-f0a6-4d4f-9580-1b031b9552fc | 6 | public void keyReleased(KeyEvent e){
switch(e.getKeyCode()){
case 37:
case 65:
left = false;
((Player)engine.getWorld().getPlayer()).setNext(left, right,-1);
break;
case 38:
up = false;
break;
case 39:
case 68:
right = false;
((Player)engine.getWorld().getPlayer()).setNext(left, ri... |
1dcfb466-a36a-438c-b9c0-9960eb937591 | 3 | private ActualParameters parseActualParameters() {
//System.out.println("parseActualParameters");
ActualParameters node = new ActualParameters();
expect("lp");
String[] operators = {"plus","minus","ident","integer","lp","tilde"};
for(String l : operators) { //int i=0; i< operators.length; i++) {
if (nextIs... |
aa719d85-ed05-4f1f-afe1-5695985df4e6 | 2 | public OdigosCard(int id) {
/*
* kartela odigou gia anafora provlimatos
*/
con = new Mysql();
odigosId=id;
this.setTitle("Anafora Provlimatos");
/* vgazei to para8uro sto kedro tis othonis me diastaseis 350x250 */
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setBounds(dim.width/... |
f038fc80-ca76-48b0-9765-d532e7597730 | 5 | public void ClearCircleStrong(int X, int Y, int R)
{
// long time = System.nanoTime();
for (int i1 = Math.max(X-(R+1),0); i1 < Math.min(X+(R+1),w); i1 ++)
{
for (int i2 = Math.max(Y-(R+1),0); i2 < Math.min(Y+(R+1),h); i2 ++)
{
... |
ae776fba-50c9-49cf-a9c2-13e70a1fc04a | 1 | public void registerTick() {
// count Frames per second...
lastTime = curTime;
curTime = System.currentTimeMillis();
totalTime += curTime - lastTime;
if( totalTime > 1000 ) {
totalTime -= 1000;
fps = frames;
frames = 0;
}
++frames;
} |
b7e8b78b-d3d5-4cb8-aba8-6efe155bc8ca | 3 | public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.printl... |
ce7742c4-0c2e-4964-b9e2-4fb8693ab712 | 2 | public String toString() {
String s = "";
for (int r = 0; r < 4; r++) {
s += "[ ";
for (int c = 0; c < 4; c++) {
s += get(c, r) + " ";
}
s += "]\n";
}
return s;
} |
58d951b3-a902-41dd-9c1c-3475711f8ebf | 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... |
f4c045bc-c799-4bf0-8954-2dc742df3df6 | 1 | private String buildJsonUsername() {
Iterator<String> iterator = getUserName().iterator();
JsonArrayBuilder jsonArrayBuilder = Json.createArrayBuilder();
while (iterator.hasNext()) {
jsonArrayBuilder.add((String) iterator.next());
}
System.out.println("User Array " + ... |
d5e03687-d977-40db-860f-efe36afd8b25 | 3 | public void drawGameObjects(final Graphics g) {
for (GameObject gameObject : gameObjects) {
gameObject.draw(g);
}
for (Projectile p : projectiles) {
p.draw(g);
}
for (int i = 0; i < monsters.size(); i++) {
monsters.get(i).draw(g);
}
... |
d53c3f0e-99d5-400f-b1b4-d476b9101f48 | 2 | public Deck() {
for (Card.SIGN sign : Card.SIGN.values()) {
for (Card.VALUE value : Card.VALUE.values()) {
cards.add(new Card(sign, value));
}
}
} |
a31e2811-c11b-43d3-ad68-ce38f6d5f610 | 9 | public static String code(String pngfile) throws IOException
{
BufferedImage image = null;
try{
File file=new File(pngfile);
image=ImageIO.read(file);
}catch(IIOException e){
//System.out.println("Image not found");
}
BufferedImage img=null;
int w=image.getWidth();
... |
63dbd5ac-c2d3-4905-95af-e26e550997d0 | 9 | private void trSort(int n, int depth)
{
final int[] arr = this.sa;
TRBudget budget = new TRBudget(trIlg(n)*2/3, n);
for (int isad=n+depth; arr[0]>-n; isad+=(isad-n))
{
int first = 0;
int skip = 0;
int unsorted = 0;
do
{
... |
efe7a3e6-2f6e-4cc7-9f79-003d3b350f51 | 8 | public synchronized int[] makeMove(Scanner stdin, String play) {
int r;
int c;
int[] a = null;
Boolean goodInput = false;
while(!goodInput) {
r = -1;
c = -1;
System.out.println ("Enter coordinates to play your " + play);
if (stdin.h... |
02e961e0-820a-47ce-b37a-a1d7d188c069 | 1 | public IsChecked(ExcData excData) {
super(excData.getExceptionClass());
isChecked = isCheckedException(exceptionClass);
if (isChecked) {
rightAnswer = YesAnswer.getInstance();
} else {
rightAnswer = NoAnswer.getInstance();
}
} |
09b810a1-ade8-4481-a7f3-7022ba56d85f | 0 | @BeforeClass
public static void setUpClass() {
} |
1f206f7c-67f5-4ee3-9122-41099ba1d8de | 1 | @Override
public String valueToString(Object value) throws ParseException {
double val = ((Double) value).doubleValue();
return mForceSign ? Numbers.formatWithForcedSign(val) : Numbers.format(val);
} |
f63fc129-33a6-461b-8409-053abdb54a5a | 2 | public <T> T getItem(Class<T> type, ReadCallback<T> callback)
{
if (getBoolean()) {
T item = callback.read(this);
if (valid) {
return item;
}
}
return null;
} |
6b3bd3a9-cc9b-4c40-a8d9-837a869d4e7c | 1 | @Test
public void square_test() {
try{
double [][]mat= {{3.0,2.0}, {1.0,3.0}};
double[][]result = Matrix.square(mat);
double [][]exp= {{13.0,9.0}, {9.0,10.0}};
Assert.assertArrayEquals(exp, result);
}
catch (Exception e) {
// TODO Auto-generated catch block
fail("Not yet implemented");
}
} |
8afba6c8-c986-4235-8da7-5b4b292d7cc6 | 7 | public static Point[] closestk( Point myList[], int k ) {
Comparator<Point> cmptor = new Comparator<Point>() {
public int compare(Point p1, Point p2) {
double x = Math.sqrt(p1.x*p1.x +p1.y*p1.y) - Math.sqrt(p2.x*p2.x +p2.y*p2.y);
if (x>0)
return -1;
else if (x<0)
return 1;
else
r... |
4086fc15-7304-4862-957f-296c4ba34ae0 | 1 | private static Employee getEmployee(Employee bean, PreparedStatement stmt, ResultSet rs) throws SQLException{
stmt.setString(1, bean.getUsername());
rs = stmt.executeQuery();
if (rs.next()) {
Employee newBean = new Employee();
newBean.setName(rs.getString("name"));
newBean.setUsername(rs.getString(... |
26165db9-e894-462e-858c-0a6bdc5ee5ba | 1 | private void processMoveToAcePile(MouseEvent e) {
int index = (int) (e.getY() / (CARD_Y_GAP + CARD_HEIGHT));
if (index < 4) {
activeMove.cardReleased(index, CardMoveImpl.MOVE_TYPE_TO.TO_ACE_PILES);
String result = activeMove.makeMove(game, this);
processMoveResult(res... |
efb788e5-0a91-421c-b6e1-59e02039ca75 | 7 | public ArrayList<Statement> getStatements(SearchOptions searchOptions) {
ArrayList<Statement> result = new ArrayList<Statement>();
CounterParty counterParty = searchOptions.getCounterParty();
String transactionCode = searchOptions.getTransactionCode();
String communication = searchOptions.getC... |
406b0a3f-4deb-4859-a89e-a51e9ee110de | 8 | @Override
public void run() {
// loads the file "kdv_node_unload"
InputStream pointFile = getClass().getResourceAsStream(
"kdv_node_unload.txt");
BufferedReader pointInput = new BufferedReader(new InputStreamReader(
pointFile));
String line = null;
double x, y;
int index = -1;
... |
1b78cab6-cb37-485d-b02f-d09038d275ea | 6 | public int search(String txt) {
int N = txt.length();
if (N < M) return N;
long txtHash = hash(txt, M);
// check for match at offset 0
if ((patHash == txtHash) && check(txt, 0))
return 0;
// check for hash match; if hash match, check for exact match
... |
33cc487e-b536-4149-8294-3a8a4b21a7de | 3 | public int hashCode() {
int result;
result = (address != null ? address.hashCode() : 0);
result = 29 * result + (city != null ? city.hashCode() : 0);
result = 29 * result + (country != null ? country.hashCode() : 0);
return result;
} |
ef178278-2f9c-4cad-b557-5f19598228da | 4 | static int KMP(char[] p, char[] t) {
int i = 0, j = 0, m = p.length, n = t.length, len = 0;
while (i < n) {
while (j >= 0 && t[i] != p[j])
j = b[j];
i++;
j++;
len = Math.max(len, j);
if (j == m)
j = b[j];
}
return len;
} |
0142992a-30fc-463c-8ded-846e7a799f2e | 8 | public static void main(String[] args) {
HashSet<Integer> hashSet = new HashSet<Integer>();
if (hashSet.add(10))
System.out.println("element 10 added");
if (hashSet.add(20))
System.out.println("element 20 added");
if (hashSet.add(30))
System.out.println("element 30 added");
System.out.println();
... |
b838f841-b641-4580-acb9-15e522732c60 | 2 | public static String getPackageName(Class<?> clazz) {
Assert.notNull(clazz, "Class must not be null");
String className = clazz.getName();
int lastDotIndex = className.lastIndexOf(PACKAGE_SEPARATOR);
return (lastDotIndex != -1 ? className.substring(0, lastDotIndex) : "");
} |
4da3dbea-ebbb-49b6-bad9-e33006ef257b | 7 | @Override
public boolean done(ArrayList<Node> nw, int fab){
int a = ((BeaconFAB)nw.get(0).getFAB(fab)).A;
Set<Integer> armies = new HashSet<Integer>();
int min = Integer.MAX_VALUE;
int d0 = 0;
int d1 = 0;
int d2 = 0;
int d3 = 0;
boolean res = true;
... |
236b258b-5fdd-494e-ba0d-dede312e2115 | 7 | private final boolean cvc(int i) {
if (i < 2 || !cons(i) || cons(i - 1) || !cons(i - 2)) {
return false;
}
{
final int ch = this.b[i];
if (ch == 'w' || ch == 'x' || ch == 'y') {
return false;
}
}
return true;
} |
6c9b12c3-25c8-4b7a-8637-e1ff3e950c54 | 1 | public void testWithFieldAddWrapped3() {
Partial test = createHourMinPartial();
try {
test.withFieldAddWrapped(null, 6);
fail();
} catch (IllegalArgumentException ex) {}
check(test, 10, 20);
} |
db5c9a1c-fde9-4c85-8983-7eba6593d6f2 | 3 | public void run() {
Thread.currentThread().setName("ChatSocketServer");
ServerSocket serverSocket = null;
try {
serverSocket = new ServerSocket(port);
} catch (IOException e1) {
e1.printStackTrace();
}
System.out.println("ChatServer listening on " + port + "...");
while (listening) {
try {
So... |
71bf7c78-e2b2-41e7-b9f9-786b596a06b6 | 5 | public void recevoir(Information<Boolean> information) {
informationRecue = information;
if (information.iemeElement(0) instanceof Boolean) {
int nbElements = information.nbElements();
boolean[] table = new boolean[nbElements];
for (int i = 0; i < nbElements; i++) {
table[i] = information.iemeElement(i... |
a07759ad-504f-417c-b87f-a88d8c968172 | 2 | protected void processLineBreakBlocks(List<String> lineBreakBlocks) {
if(generateStatistics) {
for(String block : lineBreakBlocks) {
statistics.setPreservedSize(statistics.getPreservedSize() + block.length());
}
}
} |
ec027af4-7b69-4b78-9758-2f00e44e2de4 | 7 | public void fadeOut() {
double volume = 0.6;
for (;;) {
if (((volume - 0.05) < 0) || !setVolume(volume)) {
break;
}
try {
Thread.sleep(150);
... |
6b25efff-7025-4bee-9fdf-cdba244d126e | 0 | public JLabel getjLabelDateRapport() {
return jLabelDateRapport;
} |
8978e9c4-8d57-4a93-bdc0-b31fab0ee9f3 | 4 | @Override
public ArrayList getRecordArray()
{
ArrayList outputArr = new ArrayList();
outputArr.add( this );
int nChart = -1;
for( int i = 0; i < chartArr.size(); i++ )
{
if( i == 0 )
{
Begin b = (Begin) Begin.getPrototype();
outputArr.add( b );
}
Object o = chartArr.get( i );
if( o i... |
4a9f9861-c271-418c-bd06-91868d635d31 | 9 | public void compileInsert() {
createSelectorLists();
String insert = "INSERT INTO ";
if(!compFromList.isEmpty()) {
Selector selector = compFromList.get(0);
insert += selector.tableField() + " ";
}
String fields = "(";
for(Selector selector : com... |
0eafbfa4-a3a9-4d31-b7f4-9682e0e0bf26 | 6 | public String toString()
{
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
nf.setMinimumFractionDigits(2);
StringBuffer buff = new StringBuffer();
buff.append(this.n + " sequences with distance " + this.getAverageDistance());
//buff.append( getConsensus());
for( int x=0; x... |
d33f5022-5142-411d-99bb-8da30c61bbf2 | 9 | public ClientPlayGameMessage(int version, int typecode, int gameindicator, int gametypecode, int gameplayrequest, long betamount)
{
/* make sure parameters are valid */
this.iVersion = 0;
if (version >= 0)
{
this.iVersion = version;
}
this.iTypeCo... |
968dc68b-2799-4760-82da-3c4c5258140e | 4 | public void addPerson(int x, int y) {
Piece person = new Person(x, y);
if (this.numberOne==null && this.numberTwo==null) {
this.numberOne=person;
} else if (numberOne!=null && numberTwo==null){
this.numberTwo=person;
}
} |
ad3af726-9854-44b0-9e45-cea9b3f8f12f | 0 | @Id
@Column(name = "item_id")
public int getItemId() {
return itemId;
} |
a5f3640f-84a8-41b1-8bd3-fd3372e21f0d | 3 | public int availableCars(String typeOfCar){
int counter = 0;
for(int i = 0; i < CARS.size(); i++){
if (typeOfCar.equals(typeOfCar) && carRented == false){
counter++;
} else {
return 0;
}
}
return counter;
} |
97d2b409-c923-4fb7-a4f5-9f28499050df | 6 | private boolean testPortConditions(Player p){
int gold = 0;
for(ItemStack i : p.getInventory()){
if(i != null){
if(i.getType() == Material.GOLD_BLOCK){
gold += i.getAmount();
}else{
if(!AllowedItems.contains(i.getTypeId())){
p.sendMessage(DeityNether.lang.formatInvalidItems());
retu... |
5c972157-bc03-40c4-85b9-c53382cbfef0 | 2 | @Override
public int doStartTag() throws JspException {
try {
if (price != 0) {
JspWriter out = pageContext.getOut();
out.write(PriceDiscountManager.getFinalPrice(price, discount, userDiscount).toString());
return EVAL_BODY_INCLUDE;
}
... |
58ad57af-887f-462d-a713-40610d7747af | 0 | public void setTime(double time, int index){
this.time[index] = time;
} |
9b3ce9eb-c6e0-45ec-9873-22a513e91731 | 8 | private Dimension layoutSize(Container target, boolean preferred)
{
synchronized (target.getTreeLock())
{
// Each row must fit with the width allocated to the containter.
// When the container width = 0, the preferred width of the container
// has not yet been ... |
a9c84b45-3b3f-4291-8876-267306e5dc71 | 7 | @Override
public void onEnable() {
log.info(String.format("[%s] - Initializing...", getDescription().getName()));
log.info(String.format("[%s] - Checking for Vault...", getDescription().getName()));
// Set up Vault
if(!setupPermissions()) {
log.info(String.forma... |
5a78aa5d-22dd-490c-a133-8b84b088d3cf | 2 | @Override
public void display(UserInterface ui) {
if (breakpoints.isEmpty()) {
UserInterface.println("There are no breakpoints currently set.\n");
} else {
UserInterface.print("Breakpoints are currently set on lines: ");
for (String breakpoint : breakpoints) {
... |
83299bd9-d204-4014-81b8-92cd1d85cfe1 | 0 | public static void main (String args[])
{
java.awt.EventQueue.invokeLater (new Runnable ()
{
public void run ()
{
new LoginWindow (1500).setVisible (true);
}
}
);
} |
93f3d2ee-b7f1-4cae-9a99-3ea6a864d7a0 | 9 | @Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
Vector<String> origCmds=new XVector<String>(commands);
if(commands.size()<2)
{
CMLib.commands().doCommandFail(mob,origCmds,L("Hold what?"));
return false;
}
commands.remove(0);
final List<I... |
441fbb48-7d48-4b3c-9507-9dc13f96163a | 5 | public void generateString(ArrayList<String> result, String pic, int left, int right){
if (right <left){
return;
}
if (left==0&&right == 0){
result.add(pic);
return;
}
if(left <0){
return;
}
if(left ==0){
... |
67cad890-f3be-4e26-86c0-f464cba4de7b | 0 | public String getDescription(int skill)
{
return skillDescriptions[skill];
} |
f9b28598-7c9a-4e9b-b2f0-23c933c1a597 | 3 | private void saveProgress() {
if(modified && fileName != null) {
if(JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(frame
,new JLabel("Save progress with " + fileName + " ?")
,"Unsaved Progress"
,JOptionPane.YES_NO_OPTION
)) {
saveToFile(fileName);
}
}
} |
95c9c152-ece6-44ab-a771-90266a875357 | 1 | public boolean _setSpriteImage(URL spriteURL)
{
if(image != null)
{
this.setIcon(new ImageIcon(spriteURL));
return true;
}
else
{
return false;
}
} |
5840843a-e1f2-4f1f-a60f-37756f59c107 | 5 | @Override
public boolean consider(Comparable object, int index) {
if (index==0) {
maximum = object;
}
if (index<cutOff) {
if (maximum.compareTo(object)<0) {
maximum = object;
}
}
if (index>=cutOff) {
if (maximu... |
dcc37125-941f-486b-ac81-fea3ad5275b3 | 9 | @Override
public boolean ausfuehren(ServerKontext kontext, Spieler spieler,
Befehlszeile befehlszeile)
{
//TODO auslagern in Methoden
String richtung = extrahiereRichtung(befehlszeile);
Raum nebenRaum = getRaumFuerRichtung(kontext, spieler, richtung);
kontext.schreibeAnSpieler(spieler, "Dr.Little schaut ... |
75cc2c59-a35e-42d8-b6a9-14b52dde6c60 | 8 | protected final MapleData getItemData(final int itemId) {
MapleData ret = null;
final String idStr = "0" + String.valueOf(itemId);
MapleDataDirectoryEntry root = itemData.getRoot();
for (final MapleDataDirectoryEntry topDir : root.getSubdirectories()) {
// we should have .img... |
cc85d4e9-ffb5-400e-8bf6-dcca6ccc796e | 3 | private boolean createFileChannel(){
File requestedFile = new File(this.filePath);
if(requestedFile != null && requestedFile.exists()){
try {
// 直接通过文件管道将文件内容输出到客户端
this.fileInput = new FileInputStream(requestedFile);
this.fileChannel = fileInput.getChannel();
} catch (IOExce... |
b846bdc3-1e4b-4ebd-a240-4dd3df99878b | 9 | public double [][] envCumProb() throws FileNotFoundException{
envCumProb = new double [envName.size()] [envName.size()];
try {
FileReader file = new FileReader("EnvCumProb.txt");
BufferedReader br = new BufferedReader (file);
... |
06704bbe-2274-433b-9dd2-ccf7695eef4f | 9 | private void validateConfiguration() throws MojoExecutionException {
// Validate aliases.
for (final Map.Entry<String, String> alias : aliases.entrySet()) {
if (StringUtils.isBlank(alias.getValue())) {
throw new MojoExecutionException("Illegal alias found. Alias is not allowe... |
c47eedb4-8819-4bd7-ab1a-aa70898ebac8 | 8 | public static boolean transferFont( File inDir, File inFile, File outDir, FontTester tester ) {
if( inDir == null ) {
inDir = inFile.getParentFile();
}
String relPath = getRelativePath( inDir, inFile.getParentFile(), true );
outDir = new File( outDir, relPath );
Fil... |
cc32e394-f48f-4df0-94dc-62fdf18d85df | 3 | @Override
public void handle(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
// Cache Validation
String ifModifiedSince = request.headers().get(IF_MODIFIED_SINCE);
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
SimpleDateFormat dateFormatter =... |
9034c75d-d2a4-490a-bedc-412849cb619a | 0 | @Override
public void focusGained(FocusEvent e) {
textArea = (OutlinerCellRendererImpl) e.getComponent();
textArea.hasFocus = true;
} |
5e1a5fcc-50ca-451a-a837-3b1aaddae47e | 2 | public Object get(int index) {
return index < 0 || index >= size() ? null : mList.get(index);
} |
fe8c9c01-221d-4797-8edd-6b96c5f14eab | 4 | public void testBinaryCycAccess6() {
System.out.println("\n**** testBinaryCycAccess 6 ****");
CycAccess cycAccess = null;
try {
try {
if (connectionMode == LOCAL_CYC_CONNECTION) {
cycAccess = new CycAccess(testHostName, testBasePort);
} else if (connectionMode == SOAP_CYC_CO... |
5de887d6-62ca-4598-b835-c09cffae6b92 | 8 | public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int opcao;
Menu m = new Menu();
try{
m.Menu();
InfoFuncionario info = new InfoFuncionario();
System.out.println("Digite Sua Opcao :");
opcao = sc.nextInt();
do {
if(opcao == ... |
0d5fa682-3b62-4964-901c-8565d582204c | 5 | public void insert(Halfedge halfEdge) {
Halfedge previous, next;
int insertionBucket = bucket(halfEdge);
if (insertionBucket < _minBucket) {
_minBucket = insertionBucket;
}
previous = _hash.get(insertionBucket);
while ((next = previous.nextInPriorityQueue) != ... |
b1effcff-f5aa-4261-b273-beb72f646ad7 | 6 | @Override
public boolean execute(SimpleTowns plugin, CommandSender sender, String commandLabel, String[] args) {
final Localisation localisation = plugin.getLocalisation();
if (args.length == 0) {
sender.sendMessage(localisation.get(LocalisationEntry.ERR_SPECIFY_STATUS));
re... |
72e6f9c3-f9ca-41de-bdbf-93aaabe2cd9a | 0 | public String getType() {
return type;
} |
811cbce7-901f-4945-80b6-3093a29122bb | 6 | void sort_duan(double[][] x, double[] y) {
Vector<Integer> indices = new Vector<Integer>();
for (int i = 0; i < x.length; i++) {
indices.add(new Integer(i));
}
if (!stepData.maximizeObjectiveFunctionValue()) {
Sorter sorter = new Sorter(y, Sorter.ASCENDING);
... |
9a3cf583-86a6-47e5-bf67-1203fcad9fef | 4 | public void checaProyectilChocaConMuros(){
// checa si proyectil colisiona con las paredes
// de la derecha y la izquierda...
if (proBola.getX() < 0){
proyectilChocaIzquierda();
}
else if(proBola.getX() + proBola.getAncho() > getWidth()){
proyectil... |
81d1ca66-4b50-4136-b6ac-81024684647c | 2 | @Override
public void reactPressed(MouseEvent event) {
if (isPressed) {
isPressed = false;
releaseImage();
StateMachine.resetMutePressed();
} else {
if (mt.isPressed())
mt.reactPressed(null);
isPressed = true;
pr... |
f4586e7b-b3fd-44fe-b24f-d0c4b4bdb9a9 | 3 | public void addVoiture(Vehicule voiture) {
this.voitures.add(voiture);
try {
oos = new ObjectOutputStream(
new BufferedOutputStream(
new FileOutputStream(
new File("voitures.txt"))));
for(int i = 0; i < this.voitures.size... |
4e12f1f3-3ac0-42bf-9309-66e3f76c54b1 | 9 | private void processCommands() {
// tratador das opções da linha de comando
getOpt = new Getopt("prover", argv, ":nsltho:");
getOpt.setOpterr(false);
int c;
// verifica as opções
while ((c = getOpt.getopt()) != -1)
{
switch(c)
{
... |
0e9e81fc-788d-4c64-a9c1-e0d600809627 | 5 | public static double[] doLinearRegressionFromTo(int start,int end,double[][] args) //input int start, int end
{ //input double[1]=array of prices
double[] answer = new double[3];
int ... |
6983c2f3-e173-41b8-8808-044db8e92b00 | 4 | public Pedestrian(int x, int y, int walktype) {
this.walktype = walktype;
i = 0; minus = 1;
switch (walktype) {
case GO_LEFT:
speedX = DEFAULT_SPEED_LEFT;
speedY = 0;
break;
case GO_RIGHT:
speedX = DEFAULT_SPEED_RIGHT;
speedY = 0;
break;
case GO_UP:
speedX = 0;
speedY = DEFAULT_SPEED... |
82e29978-61a1-4c38-8826-56ecd2ebf028 | 9 | public static void setDistance(Red r1, Red r2, int d) {
int N = r1.getSize();
int M = N;
int s1, s2, i, n;
int[] st = new int[N];
int[] rst = new int[d];
for (n = 0; n < N; ++n) {
st[n] = n;
s1 = r1.getNodo(n).getS();
r2.getNodo(n).set... |
2bd38095-2370-44da-a83e-f8a8f878ba4d | 7 | public static void printRuleInGoalTree(ControlFrame frame, Proposition impliesprop, int depth) {
{ PatternRecord patternrecord = frame.patternRecord;
boolean reversepolarityP = frame.reversePolarityP;
System.out.print("RULE: ");
{ Surrogate rulename = ((Surrogate)(KeyValueList.dynamicSlotValue(im... |
a8799b32-122a-40ac-bfce-8ddb2f130394 | 1 | public void visit_monitorenter(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} |
dae85031-8b95-4e34-9a1d-77d1693c2df3 | 0 | public void setEnd(Date end) {
this.end = end;
} |
8bb41335-0956-4a7c-9323-ed60fccb87fe | 5 | public boolean renderBlockTorch(Block block, int i, int j, int k) {
int l = this.blockAccess.getBlockMetadata(i, j, k);
Tessellator tessellator = Tessellator.instance;
float f = block.getBlockBrightness(this.blockAccess, i, j, k);
if (Block.lightValue[block.blockID] > 0) {
f... |
fd1413c0-2503-46a9-b6a9-f3f8f6386883 | 4 | protected final void useItemOnPlayersPosition(Player player) throws InvalidActionException {
if (player == null)
throw new IllegalArgumentException("The given player is invalid!");
if (!(this instanceof Useable))
throw new InvalidActionException("The selected item can't be used!");
if (player.getRemainingAc... |
c1df1a68-0ef2-4a04-a933-8e6749d49e6b | 5 | public static void update(){
for(int i=0;i<4;i++){
if(i==0) prev[KeyEvent.VK_LEFT]=pressed[KeyEvent.VK_LEFT];
if(i==1) prev[KeyEvent.VK_RIGHT]=pressed[KeyEvent.VK_RIGHT];
if(i==2) prev[KeyEvent.VK_DOWN]=pressed[KeyEvent.VK_DOWN];
if(i==3) prev[KeyEvent.VK_UP]=pressed[KeyEvent.VK_UP];
}
} |
0d57b10d-2353-4ceb-8c93-b7010510ce5d | 2 | public static void main(String[] args) {
try {
logger.info("Starting the data provider.");
String path = "C:\\DataCommons\\Data";
String domain = "idd:boom.org:boomid";
String contributorName = "BOOM";
int port = 9091;
logger.info("Provider data path: " + path);
logger.info("Provider dom... |
156f2589-9ee0-46f8-be56-23f1eb34d183 | 2 | public int findNumberByInnovNumber(int linkInnovNum) {
int number = -1;
for (int i = 0; i < this.getNumberGenes(); i++) {
if (genes.get(i).getInnovation_num() == linkInnovNum) {
number = i;
}
}
return number;
} |
1bd5c075-6dda-451d-a57f-9c49e34bfce3 | 8 | public static void main(String[] args) {
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
UIManager.put("Table.background", Color.WHITE);
UIManager.p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.