method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3bc9d4bb-09a4-4033-bfd5-ccb0cfa99af5 | 3 | static List<Integer> findMultiplesOf3Or5(int ceiling) {
List<Integer> toSum = new ArrayList<>();
for(int i = 1; i < ceiling; i++) {
if(i % 3 == 0 || i % 5 == 0) {
toSum.add(i);
}
}
return toSum;
} |
a194c551-5192-4f9c-8044-4a2aa00ab13d | 3 | @Override
public void caseAConstantesDeclaracao(AConstantesDeclaracao node)
{
inAConstantesDeclaracao(node);
if(node.getValor() != null)
{
node.getValor().apply(this);
}
if(node.getVar() != null)
{
node.getVar().apply(this);
}
... |
9b272aab-490f-4a62-9f3f-64b1ad533415 | 0 | public Ant getAnt() {
return ant;
} |
b84f6784-6728-44c8-9789-17c74ce79f1c | 9 | public void processCollisions(double timeStep) {
for (Iterator<CollisionPair> it = collisionBroadphase
.getCollisionPairs().iterator(); it.hasNext();) {
CollisionPair pair = (CollisionPair) it.next();
double restitution = Math.min(pair.rigidBody1.getResitution(),
pair.rigidBody2.getResitution());
i... |
0bc12d49-7e0c-4b58-a949-fac64ba76f2b | 4 | public static void main(final String[] args) {
// log4j
PropertyConfigurator.configureAndWatch("cfg/log4j.properties", 10 * 1000);
// Default IDs
EntityFactory.getClientFactory().setCURRENT_ENTITY_ID(Integer.MIN_VALUE);
EntityFactory.getClientFactory().setOWNER_ID(Constants.CLIENT_ID_UNREGISTERED);
// loa... |
a0122dff-941f-426d-a032-da3908ba5551 | 4 | @Override
protected void queryValidation(StatementEnum statement) throws SQLException {
switch ((Statements) statement) {
case USE:
this.writeError("Please create a new connection to use a different database.", false);
throw new SQLException("Please create a new connection to use a different data... |
37775110-f809-499f-a5cf-11a849a0573a | 0 | public static EnvironmentFrame[] frames() {
return (EnvironmentFrame[]) environmentToFrame.values().toArray(
new EnvironmentFrame[0]);
} |
1cf209ea-11e2-4c35-8372-b781829ba524 | 0 | @Override
public String toString() {
return name;
} |
dfbfeeda-36e4-4d9e-ac63-2b80eb8e8b67 | 2 | private void updateSearch(double time) {
if (atDestinationNode()) {
location = getLocFromMapLoc(currentDestinationX, currentDestinationY);
if (isFinalDestination()) {
enemyState = EnemyState.MOVING;
updateFinalLoc();
} else {
updateNextLoc();
}
} else {
gunAngle = bodyAngle = getLocFromM... |
5f983fba-6688-469d-8751-c4634ca4782e | 7 | public boolean permitirAniadido(Producto prod){
boolean perm=false;
if(!this.listaProdPermitidos.isEmpty()){
for(String[] itr:this.listaProdPermitidos)
if(itr[0].equals(prod.getNombre())){
if(this.listaActualProductos.isEmpty()&&prod.getCantidad()<=Integer.valueOf(itr[2]))
perm=true;
if(!this... |
fbb3cac1-dfda-440d-83fe-b4ff8152afb7 | 4 | public static Color getTeamColor(Teams team) {
if (team == Teams.BLUE) {
return Color.BLUE;
} else if (team == Teams.GREEN) {
return Color.GREEN;
} else if (team == Teams.ORANGE) {
return Color.ORANGE;
} else if (team == Teams.RED) {
return Color.RED;
} else {
return null;
}
} |
d10fea01-410b-4bc8-8168-32be91d99a75 | 0 | @Override
public int getType() { return BuildingType.HOUSE.ordinal(); } |
ff71a3aa-e4db-4bcd-a5bf-854270c60571 | 6 | public boolean setBlock(int var1, int var2, int var3, int var4) {
if (var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
if (var2 < 0) {
return false;
} else if (var2 >= 128) {
return false;
} else {
... |
e3fb461e-bf92-4c5d-b4ff-d755a785fb8f | 3 | private static void displayTwoDegrees(BufferedReader reader, VideoStore videoStore) throws IOException, SQLException {
System.out.println("Please enter the first performer:");
String performer1 = reader.readLine();
System.out.println("Please enter the second performer:");
String performe... |
abc34114-694f-4713-9e0a-281a47542a44 | 5 | public SinglyLinkedListNode<T> deleteNode(int index) {
// Check for out of bounds insertion.
if (index > size) {
return null;
}
SinglyLinkedListNode<T> deleteNode = null;
SinglyLinkedListNode<T> newNextNode = null;
// Find the node before the node we want to delete.
SinglyLinkedListN... |
ec84151a-cef4-44ec-ba0d-a50c42ce27c7 | 6 | public int ermittleVerstaerkung(Spieler s) {
int verstaerkungen = 3;
if(kontroliertAfrika(s)) {
verstaerkungen += 3;
}
if(kontroliertSüdamerika(s)) {
verstaerkungen += 2;
}
if(kontroliertNordamerika(s)) {
verstaerkungen += 5;
}
if(kontroliertAsien(s)) {
verstaerkungen += 7;
}
if(kontr... |
0ee2c9c2-bb05-4025-92d0-fb0dd2cc1615 | 9 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CToJavaMessage other = (CToJavaMessage) obj;
if (this.Z != other.Z) {
return false;
}... |
74ccfc0c-8e34-49a9-883e-6156e6af990e | 3 | private void rubric_additional_row_buttonActionPerformed(
java.awt.event.ActionEvent evt) {// GEN-FIRST:event_rubric_additional_row_buttonActionPerformed
if (data[0][1] != null) {
Object[][] temp = new Object[data.length + 1][2]; // hold the first datapoint in a temp object
for (int i = 0; i < data.length; i... |
e40b3b8e-90f1-4127-bb9f-85ebdd0414e7 | 2 | public void renewFilm(int filmID, int userID) {
FilmBean film = this.getFilm(filmID);
if(film.getBorrowerID() == userID && film.getRenewals() < 2){
film.setRenewals(film.getRenewals() + 1);
film.setReturnDate(new Date(film.getReturnDate().getTime()+(1000*60*60*24*7)));
... |
db7b7059-0bd1-45f3-aa8c-49d08311ef3e | 4 | public static int getGreatesProdUpLeftDiagonal(int[][] arr, int maxDigits, int columns, int rows) {
int prod = 0;
for(int i = (maxDigits - 1); i < (rows); i++) {
int tmp = maxDigits - 1;
for(int j = 0; j < (columns-(maxDigits-1)); j++) {
int tmpprod = 1;
for(int k = 0; k < maxDigits; k++) {
tmppr... |
11cdcd58-4c68-4638-823f-23ae7bb52d9e | 0 | public void setId(String id) {
this.id = id;
setDirty();
} |
d9fdd420-559b-4fdf-9747-988ca828bdc8 | 8 | private void readTask(HashMap<Keyword, String> parameters) {
String key = parameters.get(Keyword.CONTENT);
boolean isExact = parameters.containsKey(Keyword.EXACT);
Clock clock = new Clock();
String start = clock.getCurrentDateAndTime();
String end = "";
boolean isArchived... |
9fb775ed-5f67-4d61-a471-700e128d6b05 | 0 | @BeforeTest
public void setUp() throws Exception {
driver = new FirefoxDriver();
baseUrl = "http://localhost:8888/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
} |
38fd0adb-3feb-405b-93ae-c0d123f13427 | 1 | public boolean isPlayer() {
if (rend != null) {
return (rend.hasImage("kritter") == false);
} else return false;
} |
7598fd41-92eb-4868-b1ba-e12e7ca56fbd | 7 | ListNode add(ListNode l1, ListNode l2, int carry) {
if (l1 == null && l2 == null && carry == 0)
return null;
int n1 = l1 == null ? 0 : l1.val;
int n2 = l2 == null ? 0 : l2.val;
int n = n1 + n2 + carry;
ListNode node = new ListNode(n % 10);
carry = n / 10;
... |
f4cec6ed-b6e0-44e2-a98b-e390d2f70261 | 6 | public double[][] createStockLattice(int rows, int cols, double s0,
double up)
{
stk_lat = new double[rows][cols];
//rev_lat = new double[rows][cols];
for(int i = 0; i <= stk_lat.length; ++i)
{
if(i > 0)
{
... |
8bbc37a1-2c42-4c44-bae6-242104563642 | 5 | private RouteMatcher getRouteMatcher() {
RouteMatcher matcher = new RouteMatcher();
matcher.get("/zips", new Handler<HttpServerRequest>() {
@Override
public void handle(final HttpServerRequest req) {
JsonObject json = new JsonObject();
MultiMap par... |
cc4c2e8f-ad38-4d0f-8d6b-4aa84e3aaae9 | 7 | public void paintScreen() {
try {
if (!this.isDisplayable()) {
return;
}
paint = this.getGraphics();
Toolkit.getDefaultToolkit().sync();
if (VectorWorld.DEBUG_GFX) {
if (paint == null || oImg == null) {
... |
2b6ad446-c370-4165-b8f8-5d1141f4ce70 | 5 | Vector<Integer> proposePath(int fromCellId, int toCellId) {
int guessNumCells = (int) (estimateDistanceInCells(fromCellId, toCellId) * 1.25 + 1);
Vector<Integer> result = new Vector<>(guessNumCells);
int currentCellId = fromCellId;
result.add(currentCellId);
while (currentCellId ... |
63da250a-8300-49dd-915d-7f230c2aba84 | 0 | public Stack<IPaintable> getActions() {
return actions;
} |
fea484ba-ce26-4422-82d9-2b55862a39a5 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Attribute other = (Attribute) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
ret... |
2732db9c-87f7-4de1-890a-e5068cd90785 | 1 | public void export() {
if (computedRE == null) {
JOptionPane.showMessageDialog(frame,
"The conversion has not yet finished.", "Not Finished",
JOptionPane.ERROR_MESSAGE);
return;
}
FrameFactory.createFrame(new RegularExpression(computedRE));
} |
b1ac9edc-54c2-48f7-bf59-c54040b81f6c | 1 | public boolean init() {
if(!scene.init()) {
System.out.println("Error initializing the scene");
return false;
}
cursor = Application.get().getResourceManager().getTextureManager().getTexture("assets/graphics/ui/cursor.png");
mouseX = Display.getWidth() / ... |
12212a7e-2121-4573-92d9-18637bf8f93e | 8 | private void rewindTheLoopToTheEnd() throws BadCallException,
MalformedCodeException {
if (code[codePointer] != '[')
throw new BadCallException("Nie ma '[' w miejscu startu",
codePointer);
// System.err.println("Wchodzę w pozycji: " + codePointer);
int stack = 1;
codePointer++;
while (stack > 0) {... |
be1872b7-b2d9-4895-961a-a8e78e70bebd | 6 | public static int stationTime(int x, int y, int nextStation) {
switch (nextStation) {
case 1:
if (s1 == steps)
return 2;
break;
case 2:
if (s2 == steps)
return 3;
break;
ca... |
4d2bafca-b8a4-46e4-b889-c9d86b4b3885 | 3 | public void update(Input i)
{
Point p = i.getPos();
Rectangle mRec = new Rectangle(p.x, p.y, 1, 1);
if (box.intersects(mRec))
{
hover = true;
} else
{
hover = false;
}
//Bullshit error in input class or something
//TODO: FIX!
if(hover && i.mousePressed())
press();
} |
2cc13711-a159-46d2-bf79-756b825bfb41 | 3 | @Override
public void validate(Object object, Errors errors) {
LoginForm loginForm = (LoginForm)object;
if (loginForm == null){
errors.rejectValue("userName", "error.not-specified", null, "Error not specified.");
} else {
if (!StringUtils.hasText(loginForm.getUserName())){
errors.rejectValue("userName"... |
e9438865-249f-4b1a-9f98-541bad1f1626 | 3 | private static String[] getArgs(String base){
String[] result = new String[10];
int currentIndex = 0;
int argCount = 0;
while(currentIndex < base.length()){
int nextComma = base.indexOf(_argDelim, currentIndex);
if (nextComma < 0) {
n... |
0906a67c-250f-4fa3-8067-5283218c7783 | 6 | private void choosePath(JComponent jc, String function,
Map<SectionType, String> strings) throws DocumentException,
NullPointerException, IOException {
JFileChooser chooser = new JFileChooser(recentPath);
// setChooser(chooser, function);
chooser.setFileFilter(getFilter(function));
int returnVal = choos... |
c0361ab4-cc03-46d3-aa1a-2acf5491d42d | 1 | public boolean toBoolean() {
if (toCanonicalString().equals("T")) {
return true;
} else {
return false;
}
} |
3ae1060b-55b2-44b5-946a-a95ff031dfcc | 9 | public void anotarActivitat(Activitat a) {
//En el proces d'anotar una activitat a la ruta s'han d'actualitzar els atributs d'aquesta
//En tots els casos, s'ha d'afegir l'activitat, assignar-li a la data corresponent, actualitzar l'hora actual,
//el nombre d'activitats (si fa falta) i el preu de la ruta
a.assig... |
efe02cd1-89d3-4be2-9248-c12c96d27382 | 5 | public String buscarProspectoPorApellidoMaterno(String surname2){
//##########################CARGA_BASE DE DATOS#############
tablaDeProspectos();
//##########################INGRESO_VACIO###################
if(surname2.equals("")){
surname2 = "No busque na... |
3012c795-22af-4ef0-b194-145eecf9eb13 | 0 | public IautosCarInfo() {
this.setSourceType();
} |
b224621d-8e95-49c3-9187-c8500bfea0c9 | 1 | public void addFirst(DNode v){
try {
addBefore(header,v);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
4a1a2d71-256a-437d-ace5-703776c35cb0 | 6 | public static String escape(String string) {
char c;
String s = string.trim();
StringBuffer sb = new StringBuffer();
int length = s.length();
for (int i = 0; i < length; i += 1) {
c = s.charAt(i);
if (c < ' ' || c == '+' || c == '%' ... |
eb1eca9d-f4d7-456c-9646-274d75ce821d | 4 | public int getTime(){
boolean test = false;
if (test || m_test) {
System.out.println("ConnectFourAI :: getTime() BEGIN");
}
if (test || m_test) {
System.out.println("ConnectFourAI :: getTime() END");
}
return m_time;
} |
f62ca5c9-ae06-448e-b102-5241244bee29 | 2 | private static int binary(int pwr) {
if (pwr < 0) {
throw new NullPointerException("Must be positive (+)");
} else {
if (pwr > 0) {
return binary(pwr - 1) * 2;
}
}
return 1;
} |
aa38412b-e490-4db0-963d-1ebf4633210b | 5 | public int solution(int[] array) {
if (array.length < 2) {
return array.length;
}
int i = 0;
int j = array.length - 1;
long current = max(abs(array[i]), abs(array[j]));
int count = 1;
while (i <= j) {
if (abs(array[i]) == current) {
i++;
continue;
}
if (abs(array[j]) == current) {
... |
68459a30-5f7c-4f8a-bbc6-00d14ab08b77 | 4 | private LocalVarEntry find(int addr) {
LocalVarEntry li = list;
while (li != null && li.endAddr < addr)
li = li.next;
if (li == null || li.startAddr > addr) {
return null;
}
return li;
} |
f734fd25-376a-4045-973d-2208375de572 | 1 | public void showDialog() {
if(frame == null) {
buildGUI();
}
model.doRefresh();
frame.setVisible(true);
} |
c387dfad-44ff-4a94-9be2-7463f07ed953 | 2 | @Override
public Converter put(String key, Converter value) {
Converter v = super.put(key, value);
if (v != null) {
throw new IllegalArgumentException("Duplicate Converter for "
+ key);
}
return v;
} |
0d5fac55-866e-4dd5-a9a0-ec004d666fdf | 2 | public static void main(String[] args) throws InstantiationException, IllegalAccessException, NoSuchFieldException, SecurityException {
fill();
DataFinder finder =
new DataFinder(SomeClass.class).
Where("StringIndexingField", "f3").
Where("findField", "33");
while (true)
{
SomeClass s = ... |
541d7801-3166-4173-8cf3-ee63106a9a0a | 7 | public void nextPermutation1(int[] num) {
if(num.length<=1) return;
if(IsLargest(num, 0))
{
Arrays.sort(num);
return;
}
int startpos=0;
while(startpos<num.length)
{
if(!IsLargest(num, startpos+1))
{
startpos++;
}else
{
int oldStart = n... |
89717e46-4131-499e-b280-39f3af80ecce | 5 | @Override
public void act() {
if (Greenfoot.isKeyDown("enter")) {
setBackground("achtergrondSelectie.png");
nextMenu = true;
}
if (nextMenu == true) {
if (Greenfoot.isKeyDown("1")) {
Greenfoot.setWorld(new FloodWorld(Player.PlayerT... |
ff98c0a7-28b1-40d7-8a57-413ce085dbcf | 7 | public void setOptions (String[] options)
throws Exception {
String optionString;
resetOptions();
optionString = Utils.getOption('P', options);
if (optionString.length() != 0) {
setStartSet(optionString);
}
optionString = Utils.getOption('Z', options);
if (optionString.length() !... |
59f0dd78-0c5c-4ae5-92cd-f570ba122846 | 3 | @POST()
@Path("add")
@Consumes("application/json")
@Produces("application/json")
@SportService(ServiceType.MLB)
public Player addPlayer(Player p)
{
UserTransaction utx = null;
p.setId(0);
try
{
System.out.... |
771061ff-3228-4b27-9904-f6ab910c2817 | 8 | private void NewSubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NewSubmitButtonActionPerformed
try {
messageLabel.setText(null);
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "oracle");
Statement ... |
cf4fb096-8161-404f-9f37-ccc5d107c4ac | 3 | @Override
public void run() {
try {
Thread.sleep(waiting);
for(Car car:cars){
if(!car.finished){
car.interrupt();
race.isfinished=false;
}
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
e2743a9f-3b96-4af1-b80d-48ae1b9f9ba6 | 3 | private static void test_isSet(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 += 3) {
int bits = (Integer) t.tests[i];
boolean exp = (Boolean) t.tests[i + 1];
i... |
d40a8c4c-1e8d-420c-9133-a88729c291ca | 0 | public void setPINUsageMode(PINUsageModeType value) {
this.pinUsageMode = value;
} |
d12312dd-4d6a-4e2a-815a-ff1439c01585 | 5 | public static String decrypt(final String encryptedText) {
String decryptedtext = null;
if (encryptedText != null && !("null".equals(encryptedText))) {
TripleDesCipher cipher = new TripleDesCipher();
cipher.setKey("GWT_DES_KEY_16_BYTES".getBytes());
try {
decryptedtext = cipher.decrypt(encryptedT... |
19c5df20-0e7d-48fd-b566-528bdc7794a7 | 8 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!super.okMessage(myHost,msg))
return false;
if(temporarilyDisable)
return true;
final MOB mob=msg.source();
if(affected instanceof MOB)
{
if(msg.amISource((MOB)affected))
{
if(CMLib.flags().isInFlight(mob))... |
8de65be1-9615-464c-84e3-16ad87970596 | 8 | final public void Program_variable_declaration() throws ParseException {
/*@bgen(jjtree) Program_variable_declaration */
SimpleNode jjtn000 = new SimpleNode(JJTPROGRAM_VARIABLE_DECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getT... |
9267d627-8a4e-465e-bd86-ab251b91898c | 8 | public void alignComponents() {
int gridX, gridY;
switch (gridHAlign) {
case (H_ALIGN_LEFT) : {
gridX = this.getLocationX();
break;
}
case (H_ALIGN_CENTER) : {
gridX = this.getLocationX() + this.getWidth()/2 - grid.getW... |
feab1145-f596-438e-9ce8-96252d722d00 | 2 | protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String username = request.getParameter("username");
String password = request.getParameter("password");
if(username.equals(user1) && password.equals(pass1)){
HttpSession session = req... |
8d11d30f-ebb5-46c1-83c6-d40cf74f2e34 | 3 | private void spawnMobs(){
if(amount > 6) return;
if(amount < 2){
for(int i = 0; i < 6; i++){
dungeon.addMob(x, y, this);
}
}
} |
9d1bac43-0d13-4395-9afc-fd97af66c4b1 | 7 | private static void resultWriter() throws IOException, ParseException { //retweetIʂăOo͂
File outfpath = new File("retweetLog" + start);
if (!outfpath.isDirectory()) outfpath.mkdir();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
retweetedNum = retweeted.size();
checkedNum = 0;
resultWriteT... |
b50826c7-4f3d-4baa-a240-6be3d9929a36 | 1 | private static void write( UmlDiagram diagram, UmlDiagramRepository repository ) {
try {
Path path = Paths.get( "diagram.xml" );
repository.write( diagram, Format.XML, path );
} catch( IOException e ) {
e.printStackTrace();
}
} |
acb352ca-00d6-45c7-b2ba-05eb4a18b4b0 | 8 | public void move(){
if((this.x<-40)||(this.x>Board.getWIDTH()+40)||(this.y<-40)||(this.y>Board.getHEIGHT()+40)){
this.setVisible(false);
}
switch(inici.get(3)){
case 0:
this.setX(this.x + 1 * Math.sin(Math.toRadians(this.inic... |
a683e404-37cf-4eed-a57a-c43b28b58b78 | 5 | public static StraightPathFlags swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) {
return swigValues[swigValue];
}
for (int i = 0; i < swigValues.length; i++) {
if (swigValues[i].swigValue == ... |
b01c42c0-648b-4ad0-9fdf-5373e67f231e | 7 | @Override
public List<Room> getAllRoomsFilled()
{
final Vector<Room> V=new Vector<Room>();
final Room[][] subMap=getBuiltGrid();
if(subMap!=null)
{
for (final Room[] element : subMap)
{
for(int y=0;y<element.length;y++)
{
Room R=element[y];
if(!V.contains(R))
V.addElement(R);
... |
b70b6ff2-d0eb-44c3-aefa-fede084cbfdc | 1 | public void addMouseListener(MouseListener mouseListener)
{
super.addMouseListener(mouseListener);
for (Component component : getComponents())
{
component.addMouseListener(mouseListener);
}
} |
7e3fb825-07f8-40b2-879a-0f361fca1996 | 7 | private String readLine() throws IOException {
List<Byte> collectedBytes = new ArrayList<>();
int chunkSize = currentConverter.getChunkSize();
byte in_byte;
int [] encoded_message_part = new int[chunkSize];
int [] decoded_message_part;
while (tru... |
d4215b57-d0a7-4ca2-bf47-304ad7ae776f | 1 | @Override
public int hashCode() {
int hash = 0;
hash += (url != null ? url.hashCode() : 0);
return hash;
} |
772599eb-890e-46cf-b302-a98df4eb8a53 | 2 | public String aliasString(CharSequence separator)
{
Iterator<String> i = getAliases().iterator();
if(i.hasNext())
{
StringBuilder s = new StringBuilder(i.next());
while(i.hasNext())
{
s.append(separator).append(i.next());
}
return s.toString();
}
return "";
} |
bd945c09-0395-4cff-83a5-f862bab13d07 | 2 | static int getFractionalDigitsCount(final double value)
{
for (int i = 0; i < FLIMITS.length; i++)
{
if (value >= FLIMITS[i])
{
return i;
}
}
return FLIMITS.length;
} |
8298f5a5-892b-474d-a293-109df69fbb18 | 8 | private boolean r_shortv() {
int v_1;
// (, line 49
// or, line 51
lab0: do {
v_1 = limit - cursor;
lab1: do {
// (, line 50
if (!(out_grouping_... |
7f7f61e8-57b2-48b8-a279-96573d2e1511 | 7 | private void pushOnCommentsStack(int start, int end) {
for (int i=start; i<=end; i++) {
// First see if comment hasn't been already stored
int scannerStart = this.scanner.commentStarts[i]<0 ? -this.scanner.commentStarts[i] : this.scanner.commentStarts[i];
int commentStart = this.commentPtr == -1 ? -1 : (thi... |
5d0e1e6f-e5f2-4ae8-bfe7-63ee80522910 | 2 | public static Pfad findPfadById(ArrayList<Pfad> pfads, int id) {
for(Pfad pfad:pfads) {
if(pfad.getId()==id) {
return pfad;
}
}
return new Pfad();
} |
ea9fa1a4-9b65-472e-8201-dbb83288fd9b | 5 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Line2D line = (Line2D) o;
if (!a.equals(line.a)) return false;
if (!b.equals(line.b)) return false;
return true;
} |
af658449-dc94-4877-92e4-a2a04d28dadd | 2 | public void removeAllBoxes(){
// Empty openPath ArrayList
if(!openPath.isEmpty()){
openPath.clear();
}
// Empty segments ArrayList
if(!segments.isEmpty()){
segments.clear();
}
this.nSeg = 0;
this.checkNoMix = true;
this.ch... |
3291c64c-5e26-4190-983a-c6ee78795f3d | 1 | private void textInputKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textInputKeyPressed
int key = evt.getKeyCode();
if (key == KeyEvent.VK_ENTER) {
saveFormToTransition();
}
}//GEN-LAST:event_textInputKeyPressed |
f9bb47a7-31d4-4e14-a196-924167702a4a | 1 | public void SetMinimumPassenger(int minimumPassenger)
{
if(minimumPassenger < this.minimumPassenger)
this.minimumPassenger = minimumPassenger;
} |
58a2b39f-d8e4-4977-b5a2-b9dcbd8fff12 | 6 | private void list_framesMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_list_framesMousePressed
current_hitbox=null;
current_frame=null;
hitbox_index_selected=-1;
frame_index_selected=Integer.parseInt(""+list_frames.getSelectedIndex());
//NodeList listOfMoves = hitboxes_doc.getElement... |
3838adf9-7a91-477d-8bcf-d8143c8ed665 | 9 | public static void main(String[] args) throws IOException {
/*
* bluetooth initialization
*/
bluetoothInit();
// **************************************************************
/* // set zone coordinates manually for testing
*
Constants.goodZone = new int[] { 5 * Constants.SQUARE_LENGTH,
5 * Co... |
18906c7f-58bd-42c1-8435-8a3f771956bc | 3 | private int getNumberOfDead(int time){
if (vectors[0][0] == null){
return 0;
}
int res = 0;
for (Vector vector: vectors[time]){
if (vector.getBeing().isDead()){
res++;
}
}
return res;
} |
e436d12d-937c-4285-8b57-ed2f4087cf5f | 0 | @Override
public void endDocument() {} |
36d691be-603c-48ac-8d7b-58da2b6b2d16 | 8 | @Override
public Iterator<LatticePoint> getChildren(boolean unvisited) {
List<LatticePoint> ret = new ArrayList<LatticePoint>();
if (!this.top.isEdge && this.top.visited == unvisited) ret.add(this.top);
if (!this.bottom.isEdge && this.bottom.visited == unvisited) ret.add(this.bottom);
if (!this.left.isE... |
af0e9199-b524-4ca5-81e7-9f47a3ba5255 | 7 | public static void dbRelationUpdateDemon(Proposition proposition, Keyword updateMode) {
if ((updateMode == RDBMS.KWD_ASSERT_TRUE) ||
(updateMode == RDBMS.KWD_PRESUME_TRUE)) {
RDBMS.dbRelationGoesTrue(proposition);
Proposition.destroyRedundantProposition(proposition);
}
else if (updateMod... |
1290d7ad-f481-4ca1-8409-8580874b0f04 | 7 | GenericDescriptor lookupSymbol(final String name,
final GenericDescriptor relativeTo,
final DescriptorPool.SearchFilter filter)
throws DescriptorValidationException {
// TODO(kenton): This could be optimized in a nu... |
6829e4ca-d453-4b85-93f4-8a3788803215 | 1 | public void visit_laload(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 2;
} |
bfe7bb44-1810-44c4-beb9-11beec7656ec | 7 | public void revealSurrounding(int x, int y) {
if (!board.positionExists(x, y)) return;
Square s = board.getSquare(x, y);
if (!s.isRevealed() || s.isMine() || !board.isSatisfied(x, y)) return;
for (int i = x - 1; i <= x + 1; i++) {
for (int j = y - 1; j <= y + 1; j++) {
if (!board.positionExists(i, j))... |
7145d0f2-acea-4244-b1c8-943b55504e8c | 5 | public void itemDrawn(SelectedItem item) {
selectedItem = item;
String dimString = "";
ArrayList<Integer> coords = pPanel.getPaintList()
.get(pPanel.getPaintList().size() - 1).getCoords();
for (int i = 0; i < coords.size(); i++) {
dimString += coords.get(i);
if (i < coords.size() - 1) {
dimString ... |
57675c6c-03db-495d-81ca-ada1bbc5304c | 2 | public void mouseClicked(MouseEvent e)
{
if(e.getClickCount() == 2)
{
if(e.getSource().equals(gauche))
{
add();
} else {
remove();
}
}
} |
afeb5185-6f98-4e70-8974-010249c51fb4 | 7 | private ImageIcon getImageOfElement(Coordinate current) {
MazeNode currentNode = game.getNode(current);
if (game.isMouseAtLocation(current) && game.isCatAtLocation(current)) {
return ICON_DEAD;
}
else if (game.isMouseAtLocation(current)) {
return ICON_MOUSE;
}
else if (game.isCatAtLocation(current)... |
6c9eebc6-711b-47a2-b660-07ef72273062 | 5 | private void ajustarPesos(int numeroEntradasIniciales, String [] entradas){
System.out.println("*** Ajuste de pesos ***");
int entradasRecorrer = 0;
String [] a;
for(int m = 0; m < this.getNumeroCapasOcultas(); m++){
for(int i = 0; i < this.getNumeroNeuronasPorCapa(); i++){
//La capa oculta 1 (0)... |
66d0ede3-2fda-436d-a3a3-ab972ce5d296 | 7 | @Test
public void testConstructorPaddle() {
Paddle p;
//inbounds x and lower y
try{
p = new Paddle(250,90);
assertArrayEquals(new int[]{250,90},p.getPosition());
}
catch(IllegalArgumentException e){
fail("Failed requirement: P.1, P.1.2");
}
//inbounds x and upper y
try{
p = new Paddle(25... |
35603a02-796f-4604-8ca6-71ba72496fed | 7 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession(true);
String uname = request.getParameter("username").replaceAll("\\s","");
String pwd = request.getParameter("password").replaceAll("\\s","");
String ... |
fecab67c-f886-4a1f-8b18-1de39d547463 | 5 | public void checkPowerClick(double x, double y) {
if (machineButtons != null){
for (int i = 0; i < machineButtons.size(); i++) {
if (machineButtons.get(i).isInside(x, y)) {
machines.get(i).powerToggle();
if (singleMachine != null) {
setRandomMoneyButton();
setRandomDispenserButton();
}... |
a5c9b4c1-314d-42d7-81d5-6860727dc092 | 9 | public int converterS(String l) {
if (l.equals("a")) {
return 0;
}
else if (l.equals("b")) {
return 1;
}
else if (l.equals("c")) {
return 2;
}
else if (l.equals("d")) {
return 3;
}
else if (l.equals("e")) {
return 4;
}
else if (l.equals("f")) {
return 5;
}
else if (l.equals("g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.