method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
bba56e18-3782-42aa-89f9-fc5d44607ea2 | 8 | public MusicGroup asSchemaOrg(boolean showAction, boolean showChildren) {
MusicGroup musicGroup = new MusicGroupImpl("http://jarekandshawnmusic.com/artist/" + id.getName());
if (getName() != null) {
musicGroup.setName(getName());
}
try {
musicGroup.setUrl(new URI("/artist/" + id.getName()));
... |
c2a6d84e-0e16-4bfc-8f63-c3d45fe7b5e4 | 9 | private void mergeBlock(int[] listA, int[] listB, int[] listC,
int blockOffset, int blockSize) {
int a = blockOffset * blockSize;
int b = a;
int c = blockOffset / 2 * 2 * blockSize;
int nextOffset = (blockOffset + 1) * blockSize;
while (a < nextOffset && b < nextOffset && a < listA.length
&& b < listB... |
ee7f54f9-c2b8-4e21-9b00-7d8b09c0dbe6 | 2 | @Override
public void fill(Parameter parameter, Type type, Annotation[] annotations)
{
for (Annotation annotation : annotations)
{
if (annotation instanceof Desc)
{
parameter.offer(Properties.DESCRIPTION, ((Desc)annotation).value());
return... |
a8691748-d01e-438d-a967-5de0215d8ddd | 2 | public void popEntries(int numberToRemove) {
for (int i = 0; i < numberToRemove; i++) {
Binder b = symbols.get(top);
if (b.getTail() != null) {
symbols.put(top, b.getTail());
} else {
symbols.remove(top);
}
top = b.getPr... |
ec8f58d5-5674-4f04-a3c0-93de760c37b7 | 7 | public Result ValidarCampo(Clientes BEEntidades){
// Nombre, ApellidosPaterno, ApellidoMaterno, Email, NroDocumento, Telefono
sb.append(Common.IsNullOrEmpty(BEEntidades.getNombre())? "nombre inválido,": "");
sb.append(Common.IsNullOrEmpty(BEEntidades.getApellidoPaterno())? "nombre inválido,"... |
471016e1-009a-4433-8908-1ef079bcc4fb | 3 | public N getEnclosingNetwork(int mask) throws NetworkException {
if ((mask < 0) || (mask > 1)) {
throw new InvalidAddressException(String.format("'%d' is not a valid netmask.", mask));
}
if (mask > longMaskToShort(this.mask)) {
throw new InvalidAddressException(String.for... |
e4e22fba-e563-4531-b811-a882c9c6c670 | 9 | private void addPieces() {
for(int x = 0 ; x< 8 ; x++)
{
Pawn whitePawn = new Pawn(true, new Point(x,1),this);
Pawn blackPawn = new Pawn(false, new Point(x,6),this);
Piece strongBlack=null;
Piece strongWhite = null;
if(x==0||x==7)
{
strongWhite = new Rook(true,new Point(x,0),this);
str... |
201af632-562b-4582-8824-86398a84692a | 1 | public static DBObject toDBObject(String query, Object... parameters) {
String finalQuery = generateQuery(query, parameters);
try {
return (DBObject) JSON.parse(finalQuery);
} catch (Exception e) {
throw new IllegalMongoShellException("Mongo Query表达式式非法:", e);
}
} |
d1cd4a24-a49b-486e-91be-6d3fe8b21fe3 | 7 | public String CreateDiffFiles(DatabaseAccess JavaDBAccess, String TargetPHPFileSelectedComboBox) {
String PHPFileTextArea = null;
Connection conn = null;
PreparedStatement ps = null;
String diffFile = "";
try {
if ((conn = JavaDBAccess.setConn()) != null) {
... |
c13a2fbf-456d-418c-a358-e79858f698f9 | 3 | @Override
public boolean moveable(Direction direction) {
if (direction == null)
return false;
if (!direction.getDirectionsExcludeDiagonal().contains(direction))
return false;
if (lifetime <= 0)
return false;
return true;
} |
b213567e-5632-4683-8dbf-82558ad5871e | 2 | @Override
public Item getSelectedItem() {
for( Item item : getItems() ) {
if( item.isPrimarySelected() ) {
return item;
}
}
return null;
} |
63f3859f-bfc8-4976-bed3-3d0cbf51a62c | 0 | public void setId(int id) {
this.id = id;
} |
2da69099-96ff-4449-b68c-4380ff425633 | 2 | public static void triangle2(String s) {
char c[] = s.toCharArray();
for (int i = 0; i < c.length; i++) {
System.out.println();
for (int j = 0; j < (c.length - i); j++) {
System.out.print(c[j]);
}
}
} |
2e139876-ff8e-45d9-abc2-23b8c03cd88f | 8 | public boolean exist(char[][] board, String word) {
Stack<Character> stack = new Stack<Character>();
for(int i=word.length();i<0;i--){
stack.push( word.charAt(i) );
}
boolean [][] used = new boolean[board.length][board[0].length];
//char[] wc = word.toCharArray();
//char[] tmpc = new char[wc.length];
... |
7a239bf9-dee7-41c5-97c9-87694c318d46 | 9 | private float phraseFreq() throws IOException {
if (!initPhrasePositions()) {
return 0.0f;
}
float freq = 0.0f;
numMatches = 0;
PhrasePositions pp = pq.pop();
int matchLength = end - pp.position;
int next = pq.top().position;
while (advancePP(pp)) {
if (hasRpts && !advanceRp... |
58420c73-c2cf-4228-af62-48cc096128ba | 9 | public void setPayments(){
desktopPane.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
try {
try {
tableModelDay.clear();
listPaymentDay.clear();
List<PaymentModel> input = new PaymentDAO().getPaymentDay(ut.dateFormatInsertSq... |
a4a41199-de60-474d-aac4-e0ddf3b05d5a | 7 | public static QuantCvTermReference getIsotopeLabellingMethodParam(String accession) {
if (ITRAQ_QUANTIFIED.getAccession().equals(accession)) {
return ITRAQ_QUANTIFIED;
} else if (TMT_QUANTIFIED.getAccession().equals(accession)) {
return TMT_QUANTIFIED;
} else if (O18_QUA... |
2dfb9a76-0a1d-4099-8fc2-0d4b5123d6a0 | 9 | final boolean method2668(int i) {
anInt4208++;
if (aBoolean4205)
return true;
if (aClass144_4201 == null) {
try {
int i_15_
= (Class8.modeWhere == Class55_Sub1.aClass364_5271 ? 80
: 7000 - -(((ConnectionMode) Class135_Sub2.worldConnectionNode)
.portOffset));
aClass144_4201
= ... |
7f97fa97-13b2-4fef-94b5-05e1f6835aa6 | 3 | public float get(int dimension) {
switch (dimension) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
default:
return -1;
}
} |
f7331fa0-6bdd-413d-aa6d-e62d111a8d81 | 1 | public boolean equalsExpr(final Expr other) {
return (other instanceof ZeroCheckExpr) && super.equalsExpr(other);
} |
995a6676-fb03-4083-90c5-4096d09efd9e | 3 | public String getEmployer(int ID)
{
try {
int employerID = ID;
if(employerID > 0) {
if(employerID < ReadFromFile.getNumberFromFile("company.txt")) {
Company [] checkEmployers = ReadFromFile.findAllCompanyData();
return checkEmployers[employerID-1].getName();
}
}
}
catch(NumberFormatExc... |
1ad35ad6-1b90-43c6-a606-4a94d56261d8 | 2 | public ComplexMatrix getLocalPropagationMatrix(int index, double energy) {
MatterInterval inl = intervals.get(index);
MatterInterval next = intervals.get(index + 1);
Complex p;
// Double.POSITIVE_INFINITY is handled here and it assigns to
// real part
// of Complex if app... |
e10d6211-67d8-448c-b2fd-6347dbf76d9a | 4 | public static void main(String[] args) {
if (args.length > 0) {
try{
int port = Integer.parseInt(args[0]);
if (port > 65535 || port < 1) {
System.out.println("Invalid port number... starting as default 2222");
new ServerHandler... |
6ba93fee-34ce-4688-9e54-1a8d4a0db14a | 3 | @Override
public void run()
{
long lastTime = System.nanoTime();
long timer = System.currentTimeMillis();
final double ns = 1000000000D / 60;
double delta = 0;
int frames = 0;
int updates = 0;
requestFocus();
while (running) {
long now = System.nanoTime();
delta += (now - lastTime) / ns;
last... |
7d2f5123-cca1-42d1-8672-bee9e7deddb1 | 3 | public static double[] toHSL(int r, int g, int b) {
double rp = r;
double gp = g;
double bp = b;
rp /= 255;
gp /= 255;
bp /= 255;
double cmax = Math.max(rp, Math.max(gp, bp));
double cmin = Math.min(rp, Math.min(gp, bp));
double delta = cmax - cmin... |
21f73c63-d435-40ea-840b-8e0f34fa3fbb | 7 | public void draw(Graphics g) {
//g.setColor(needsHighlight() ? selectColor : lightGrayColor);
g.setColor(needsHighlight() ? selectColor : Color.GRAY);
setBbox(x, y, x2, y2);
if (x < x2 && y < y2) {
g.fillRect(x, y, x2 - x, y2 - y);
} else if (x > x2 && y < y2) {
... |
c9637332-2543-45e5-b89e-56ee091e647c | 8 | @SuppressWarnings("nls")
public static void openURL(String url) {
String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Mac OS")) {
Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
Method openURL = fileMgr.getDeclaredMethod("openURL",
new Class[] { String.class ... |
5dd125e0-358e-4c66-9ec2-51cff1cacb66 | 4 | private void setDictionary(Dictionary dic) {
this.dic = dic;
dic.addDictionaryListener(new DictionaryListener() {
public void recieveEvent(DictionaryEvent event) {
changed = true;
}
});
dic.addDictionaryListener(new DictionaryListener() {
public void recieveEvent(DictionaryEvent event) {
swi... |
3de6f9be-ef55-4d0a-a38c-985325bb83e2 | 2 | public void displayAtIndex(int index)
{
if (index >= 1 && index <= numItems)
{
String book = bookArray[index -1];
System.out.print(book);
} else
{
System.out.println("The index you specified is out of range");
}
} |
4f84116f-2363-4714-958f-368467b2fddf | 2 | public void CalcNormals()
{
for(int i = 0; i < m_indices.size(); i += 3)
{
int i0 = m_indices.get(i);
int i1 = m_indices.get(i + 1);
int i2 = m_indices.get(i + 2);
Vector3f v1 = m_positions.get(i1).Sub(m_positions.get(i0));
Vector3f v2 = m_positions.get(i2).Sub(m_positions.get(i0));
Vector3f no... |
06e46b4e-87e4-4c5e-927a-5f39ce7dc67d | 4 | public void actionPerformed(ActionEvent ae) {
double x = 0.0, y = 0.0;
Double d;
try {
d = new Double(eastings.getText());
x = d.doubleValue();
} catch (NumberFormatException nfe) {
eastings.setText("0");
x = 0.0;
}
try {
d = new Double(northings.getText());
y = d.doubleValue();
} catc... |
4f8db291-d186-487c-aa6b-fe73f40fd9a0 | 7 | final public void PowerExpression() throws ParseException {
UnaryExpressionNotPlusMinus();
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case POWER:
ASTFunNode jjtn001 = new ASTFunNode(JJTFUNNODE);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
jj_consume_token(POWER);
UnaryExpre... |
572501d8-a455-46e6-84f0-e52352a2ee1b | 5 | @BeforeClass
public static void setUpBeforeClass() {
try { new MySQLConnection(); }
catch (InstantiationException e) { e.printStackTrace(); }
catch (IllegalAccessException e) { e.printStackTrace(); }
catch (ClassNotFoundException e) { e.printStackTrace(); }
catch (SQLException e) { e... |
effa4e31-e48b-41cb-b087-a557cd2e4c0b | 0 | public void selectMarker(int index)
{
//markerRect.select(index);
} |
6f3c8710-4ec0-498c-a0f6-dc1c95aef894 | 9 | private String argDigest() {
if (argsSpecified) {
if (argNames.isEmpty())
return "";
StringBuilder b = new StringBuilder();
List<String> list = new ArrayList<String>(argNames.keySet());
for (int i = 0; i < list.size(); i++) {
String name = list.get(i);
b.append(" <").append(name).append('>');
... |
88f76941-d7b9-41ba-9b31-a229baa3a900 | 1 | public List<Integer> getValues() {
List<Integer> valuesArray = new ArrayList<Integer>();
iter = bucket.iterator();
while(iter.hasNext()) {
valuesArray.add(iter.next().getValue());
}
return valuesArray;
} |
0218a4e1-a715-4547-a018-45947980d73a | 3 | @Override
public List<BaseArtifactType> queryFullArtifacts(String query) throws Exception {
String path = "/s-ramp?query=" + query;
List<BaseArtifactType> artifacts = new ArrayList<BaseArtifactType>();
Feed feed = getFeed(path, 200);
for (Entry entry : feed.getEntries()) {
... |
9c1685e6-72be-4573-b5c9-a2c4b935b5d6 | 5 | private Map<String, List<String>> getMessageToPartMap(
Element documentElement, WsdlSchema retSchema) {
Map<String, List<String>> retMap = new HashMap<String, List<String>>();
List<SchemaElement> messages = getElements(documentElement,
"wsdl:message", false, null, retSchema);
if (messages != null) {
for... |
6cefa662-7ede-4991-8d3e-fbfc48824c3c | 2 | public void processLine(String line) {
StringTokenizer s = new StringTokenizer(line);
while (s.hasMoreTokens()) {
String currWord = s.nextToken();
double currScore = getWordScore(currWord.toLowerCase());
if (maxScore < currScore) {
maxScore = currScore;
maxWord = currWord;
maxLineCount = count... |
ce7835dc-6de6-44a2-aa05-696f73e0fafb | 0 | public String getToolTip() {
return "Building Block Creator";
} |
21852ef6-6243-49e0-99b1-ca028ccedfd2 | 1 | public boolean containsID(int id) {
return (first_land.getID() == id || second_land.getID() == id);
} |
990f8ada-0f54-463b-b1c1-55d69af1a29c | 8 | public boolean processDataOut(APDU apdu) {
if (selectingApplet())
return false; //allow other Services to postprocess if needed
if (mode == ENCRYPT_NONE) {
return false;
}
if (mode == SYMMETRIC_REQUEST) {
mode = ENCRYPT_SYMMETRIC;
return false;
}
if(mode == ASYMMETRIC_REQUEST) {
mode = ENCRYP... |
cf17fae8-09f8-47c1-b993-5986eaa49627 | 6 | public static void main(String[] args) {
Scanner inFile = null;
try {
// Create a scanner to read the file, file name is parameter
inFile = new Scanner(new File(System.getProperty("user.dir") + "/src/Files/prog464a.dat"));
} catch (FileNotFoundException e) {
System.out.println("File not found!");
// ... |
f17d4759-e776-4a5b-9ce4-5a30f403c0de | 5 | @Ignore
@Test
public void placeFiguresOnBoard() {
Map<String, Integer> figureQuantityMap = new HashMap<>();
figureQuantityMap.put(KING.toString(), 2);
figureQuantityMap.put(QUEEN.toString(), 3);
figureQuantityMap.put(BISHOP.toString(), 4);
figureQuantityMap.put(ROOK.toStr... |
9dd22673-74b8-4cb4-8cf6-98f8e62d717f | 9 | * @param height The height of the grid array
* @param d The dimension of the initial drawing area
*/
protected void initGrid(int width, int height, Dimension d) {
if ( (width > MAX_GRID_X) || (height > MAX_GRID_Y) ){
throw new IllegalStateException ( ); // hack bf
//return;
}
int i, j... |
14514e1f-1321-483c-ad38-792826f87a89 | 2 | public long set(long millis, int value) {
int[] wwd = iChronology.isoFromMillis(millis);
millis = iChronology.getTimeOnlyMillis(millis)
+ iChronology.millisFromISO(value, wwd[1], wwd[2]);
if (wwd[1] == 53) {
int[] wwd2 = iChronology.isoFromMillis(millis);
if (... |
ac5b4d8b-a5d9-44ec-989a-3864add9b213 | 1 | public Object whoIsRight(Object a, Object b)
{
Random r = new Random();
if(r.nextBoolean())
{
return a;
}
return b;
} |
5d202384-8c94-4870-8da7-5b45bc12e627 | 8 | @SuppressWarnings("resource")
public ArrayList<String> getAllClasses(String jarFile, String superclassName) throws FileNotFoundException, IOException, ClassNotFoundException {
ArrayList<String> list = new ArrayList<>();
JarInputStream jar = new JarInputStream(new FileInputStream(jarFile));
JarEntry entry;
... |
83e3fbdd-be1a-4321-8209-5e4e1d629082 | 6 | private void update()
{
final ThreadMXBean bean = ManagementFactory.getThreadMXBean();
final long[] ids = bean.getAllThreadIds();
for (long id : ids)
{
if (id == getId())
{
continue;
}
final long cpuTime =... |
d19fe968-269c-4a21-ba7a-4f83f454ed7b | 8 | @SuppressWarnings("unchecked")
@Test
public void testThisWeek() {
SimpleValidator simpleValidator = new SimpleValidator();
DateRangeBean bean;
Set<?> validations;
for (int days = -2007; days <= -7; days += 100) {
bean = new DateRangeBean();
bean.setDate8(util.add(new Date(), Calendar.DAY_OF_MONTH, days... |
efeab784-2958-4a14-81c2-36a3c1432e32 | 2 | public void testPropertyCompareToMilli() {
TimeOfDay test1 = new TimeOfDay(TEST_TIME1);
TimeOfDay test2 = new TimeOfDay(TEST_TIME2);
assertEquals(true, test1.millisOfSecond().compareTo(test2) < 0);
assertEquals(true, test2.millisOfSecond().compareTo(test1) > 0);
assertEquals(true... |
f055ee09-cf82-4953-8fbc-3beab3413f3e | 5 | public int[][] naiveMultiplication(final int[][] X, final int[][] Y) {
try {
int[][] result = new int[X.length][Y[0].length];
// for each rwo of X
for (int i = 0; i < X.length; ++i) {
if (X[i].length == Y.length) {
// for each column of Y
... |
3f4c8966-385a-4030-b82c-581aa3f5b571 | 7 | private int findIndex(int key) {
int[] keys = this.keys;
if (keys != null) {
int fraction = key * A;
int index = fraction >>> (32 - power);
int entry = keys[index];
if (entry == key) { return index; }
if (entry != EMPTY) {
// Se... |
a0c8297e-2576-4a48-bd6f-2ee55ce26ed8 | 9 | private void run() {
// repita ate que a lista de algum homem esteja vazia ou todos estejam casados
while(!someManListEmpty() && !everyoneEngaged()) {
boolean existFreeMan = true;
// enquanto existir homem solteiro
while(existFreeMan) {
Person currentMan = existFreeMan();
if(currentMan != null && c... |
d1521f77-d70d-47e6-a182-5373c2f6bec6 | 7 | public static boolean isSafeMaterial(Material mat)
{
switch (mat)
{
case AIR:
case WEB:
case VINE:
case SNOW:
case LONG_GRASS:
case DEAD_BUSH:
case SAPLING:
return true;
default:
return false;
}
} |
a23f80b9-c6e2-417c-a8d2-9039f0365d18 | 0 | public Diamant(Rectangle masse, IntHolder unit, int points) {
super(masse, unit);
this.points = points;
} |
12de9f93-4d22-47ad-b6ef-0445ee622e56 | 4 | private void tryCreateAmbits() throws IOException {
if (wordIndex == null) {
return;
}
Map meetings = wordIndex.getMeetings();
if (meetings == null) {
return;
}
for (int file : wordIndex.getMeetings().keySet()) {
RendezVous rv = wordInd... |
8b210873-1ef4-4b26-bcd3-343a9eb6a615 | 4 | private double[] calculateHDDConsumptionW(Component component, HardwareAlternative hardwareAlternative) {
double consumption[] = { 0, -1 };
for (HardwareComponent hdd : hardwareAlternative.getHardwareComponents()) {
double temp[] = Utils.consumptionHDD((Hdd) hdd, component.getUsageHDD());
if (temp[1] != -1 &&... |
970d2975-b0f3-46b0-a72a-2fed29742725 | 7 | public int[] recorderOddEven(int[] data){
if(data == null){
throw new IncompatibleClassChangeError("Error input array.");
}
int odd = 0 , even = data.length - 1;
while(odd < even){
while(odd < even && isOdd(data[odd])){
odd++;
}
while(odd < even && !isOdd(data[even])){
even--;
}
if(odd... |
1e3c5c6b-f636-4dfc-a23a-b9a86faa917d | 3 | public String cadastrar() {
if (!nome.isEmpty() && dataNasc != null) {
PacienteDAO paciente = new PacienteDAO(null, nome, dataNasc, logradouro, numero, bairro, cidade, uf);
FacesContext contexto = FacesContext.getCurrentInstance();
if (paciente.cadastrar()) {
... |
f4941bb7-2147-4e21-a69e-c2a9cf4e8259 | 6 | private void UpdateTotal() {
double taxes, finalTotal;
taxes = 0.00;
finalTotal = 0.00;
pizzaTotal = 0.00;
/*
* check to see which radio button is checked
*/
if (rdbtnSmallPizza.isSelected()) {
pizzaTotal = 8;
} else if (rdbtnMediumPizza.isSelected()) {
pizzaTotal = 10;
} else if (rdbtnLarge... |
ad170a57-161a-42eb-aae4-e284909e0573 | 9 | public void moveBackward() {
// as long as I'm on the board and visible...
if (onBoard) {
// get the direction of the sprite to find what is foreward;
int dir = image.getDirection();
// now check to see which way to move
switch (dir) {
cas... |
3fcc31c4-5bf5-4d28-a7f5-2c5dd0d61550 | 5 | public Point[] generateGhostBlockCoordinates() {
Point[] ghostBlockCoordinates = new Point[4];
int verticalDistance = boardSizeY - 1;
for (Block b : currentTetromino.getBlocks()) {
int y = -1;
while ((b.getMapIndexY() + y < boardSizeY - 1)
&& tetrisMap[b.getMapIndexX()][b.getMapIndexY() + y + 2] != 1)... |
7fbaf2d3-5ca7-44b2-97ab-1132a464df17 | 8 | public static void main(String args[]) {
int number_of_duels = 10;
String cowboy1 = "";
String cowboy2 = "";
if (args.length < 2) {
System.err.println("Gotta choose two cowboys, brother.");
} else if (args.length < 3) {
if (args[0] instanceof String) {
... |
a0a0b9a9-1ac8-43a9-ab33-e4e055b67f61 | 6 | public User loadUser(String login, String pwd) throws ProfileExceptions {
User loadedUser = null;
try {
String defaultPath = new File("").getAbsolutePath().toString()
+ mainStructure;
DirectoryStream<Path> stream = Files.newDirectoryStream(FileSystems.getDefault().getP... |
a7dcc4d5-da75-4e60-bd7e-7a84daf8390b | 5 | @Override
public List<Joueur> findAll() {
List<Joueur> listJ = new ArrayList<Joueur>();
Statement st = null;
ResultSet rs = null;
try {
st = this.connect().createStatement();
rs = st.executeQuery("select * from Joueur");
System.out.println("recherc... |
51a323e9-ab1b-4189-be94-7919f9cddc3e | 4 | public Collection<Artist> getCoreMembers()
{
Set<Artist> coreMembers = new TreeSet<Artist>();
boolean first = true;
for (LineUp lineUp : getLineUps())
if (first)
{
// Add all the artists
coreMembers.addAll(lineUp.getArtists());
first = false;
}
else
{
Collection<Artist> toRemove =... |
29f550fb-6d86-41c9-8fbe-45886da5d760 | 2 | public void addUnit(int x, int y, int type, int mov, int team)
{
if(inMap(x, y) && map.getUnit(x, y) == null) //Make sure adding unit within map grid, and that there is no unit currently there
{
Unit temp = new Unit(x, y, im, mov, team);
map.addUnit(x, y, temp);
u... |
0b72c13e-a900-4d1f-b8a1-9dc0ff7bdaa2 | 5 | public static void drawCircle(Circle circle, WritableRaster imgRaster)
{
double perimeter = circle.getPerimeter();
double angleIncrement = Constants.TWO_PI/perimeter;
int width = imgRaster.getWidth();
int height = imgRaster.getHeight();
for(double angle = 0.; angle < Constants.TWO_PI; angle += angleIncre... |
ea53cadb-51a3-424c-a548-5421da2c487d | 2 | public void criarDep(Departamento DEP) throws SQLException, excecaoDepartamento, excecaoCodDepartamentoInavlido {
DepartamentoDAO depDAO = new DepartamentoDAO();
Departamento DepExistente = null;
DepExistente = depDAO.selecDepartamento(DEP.getNome(), DEP.getCodigo());
if (DepExistente... |
17fd343a-8c99-4174-85ef-5230e99e8cf2 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
UserBean other = (UserBean) obj;
if (firstName == null) {
if (other.firstName != null)
return false;
} else if (!firstName.equals(other.... |
5ce6271f-858e-42fa-9e1e-c410dbc988e6 | 3 | private static Zombie chooseZombie(Necromancer player, int zombieIndex) {
Zombie[] zombies = player.getZombies();
Zombie zombie;
if (zombieIndex > -1 && zombieIndex < zombies.length && zombies[zombieIndex] != null) {
zombie = zombies[zombieIndex];
} else {
zombie = zombies[0];
}
return zom... |
07b2cad8-e9a0-4c5a-adff-52b45479298d | 7 | private void readValues(Stream stream)
{
do
{
int j = stream.readUnsignedByte();
if(j == 0)
return;
if(j == 1)
{
anInt648 = stream.readUnsignedWord();
anInt649 = stream.readUnsignedByte();
anInt650 = stream.readUnsignedByte();
} else
if(j == 10)
stream.readString();
else
... |
2274dc02-dbde-4cbf-9acf-621fe54ead93 | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS... |
dc8d905b-2bab-4300-874d-f011b850ec4e | 4 | @Override
public boolean execute(final CommandSender sender, final String[] split) {
if (sender instanceof Player) {
if (MonsterIRC.getHandleManager().getPermissionsHandler() != null) {
if (!MonsterIRC.getHandleManager().getPermissionsHandler()
.hasCommand... |
5b548e03-f8ed-43cd-abd0-f5762a78feba | 5 | public void mouseMoved(MouseEvent e)
{
if (!e.isConsumed() && handles != null)
{
int index = getIndexAt(e.getX(), e.getY());
if (index >= 0 && isHandleEnabled(index))
{
Cursor cursor = getCursor(e, index);
if (cursor != null)
{
graphComponent.getGraphControl().setCursor(cursor);
e.... |
26ba4f7c-a553-4ebe-a2f2-7a0252f83a8a | 5 | direction bNNIEdgeTest( edge e, double[][] A, double[] weight, int wPos )
{
edge f;
double D_LR, D_LU, D_LD, D_RD, D_RU, D_DU;
double w1,w2,w0;
if ( e.tail.leaf() || e.head.leaf() )
return direction.NONE;
f = e.siblingEdge();
D_LR = A[e.head.leftEdge.head.index][e.head.rightEdge.head.inde... |
5ebfdf09-1291-4872-a02b-3ba25a27f250 | 4 | public boolean isIntersecting(Vector3f origin, Vector3f direction) {
Vector3f delta = verticies.get(0).coord.minus(origin);
// Find the time when they intersect
float t = normal.dotProduct(direction);
if (t <= 0) // don't divide by zero or intersect with the back of objects
... |
760c9938-e65c-4316-88f2-826008fd770a | 8 | @Override
public int getCharThinSortCode(String codeName, boolean loose)
{
int x=CMParms.indexOf(CHAR_THIN_SORT_CODES,codeName);
if(x<0)
x=CMParms.indexOf(CHAR_THIN_SORT_CODES2,codeName);
if(!loose)
return x;
if(x<0)
{
for(int s=0;s<CHAR_THIN_SORT_CODES.length;s++)
{
if(CHAR_THIN_SORT_CODES[... |
48f242d1-13e3-4c0f-b375-d3cf00e9fbea | 4 | public void endElement(String uri, String localName, String qName) throws SAXException {
switch (qName) {
case "config": {
configList.add(getConfig());
break;
}
case "population": {
getConfig().setPopulation(Intege... |
5d862684-1acc-4f5f-aac0-fd91e6b76976 | 1 | @Override
public String getToolTipText(MouseEvent event) {
Column column = mOwner.overColumn(event.getX());
if (column != null) {
return column.getHeaderCell().getToolTipText(event, getColumnBounds(column), null, column);
}
return super.getToolTipText(event);
} |
a4dea05c-a845-4dd9-9072-19c5f7ff2559 | 7 | public int IDgenerator(HttpServletRequest request, HttpServletResponse response,String Type)
throws ServletException, java.io.IOException
{
int UserID=0;
String query;
String tablename;
if(Type.equals("purchase"))
{
tablename="purchase_record";
}
else
tablename=Type;... |
14e7af82-b2bb-4fcd-bbd0-27350e756705 | 3 | @Override
protected void channelReadHttpObject(ChannelHandlerContext ctx, HttpObject msg) {
switch (currentState) {
case INITIAL:
reaInitialResponse((HttpResponse) msg);
break;
case READING_CONTENT:
readNextContent(ctx, msg);
... |
c43d932e-f4b3-4134-a0d7-87f1fdec8eb3 | 7 | public void paintComponent(Graphics gfx) {
super.paintComponent(gfx);
Graphics2D g = (Graphics2D) gfx;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setPaint(Color.blue);
//Draw all the lines
for(int i = 0; i ... |
70c7db5b-9fa1-4d16-ba31-2a6f2f71d7ad | 4 | public void paintBackground() {
// Graphics g = MainPanel.getInstance().getGraphics();
g.clearRect(0,0,MainPanel.getInstance().getWidth(),MainPanel.getInstance().getHeight());
g.setColor(Color.white);
int pointX = 0;
int pointY = 0;
try {
InputStream pathToFile... |
3b0e5b2e-99b6-4ffe-8736-2952addd0ed0 | 3 | static EnumSet<Content> parse(final String str) {
final EnumSet<Content> set = EnumSet.noneOf(Content.class);
if (!str.isEmpty()) {
for (int i, j = 0; j >= 0;) {
i = j;
j = str.indexOf(',', i + 1);
final String sub = j >= 0 ? str.substring(i, j++) : str.substring(i);
set.add(Enum.valueOf(C... |
ae9e8a9c-e193-440f-9e84-960402f2236d | 3 | public static void basicProcessingFormat(Object[] Fieldsin) {
// %^_TRATAR_.” | %^I_TRATAR_INSERT.”
//Field(0) = Nombre de instruccion
//Field(s%3=0) = VariableComp1 = [X:|S:|C:|E:][N:|H:]NAME_op1
//Field(s%3=1) = operation = ',' ',,'
//Field(s%3=2) = VariableComp2 = [X:|S:|C:|E... |
e31750c1-4851-429c-a07a-d9c5a1e02d68 | 4 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int sendID = Integer.parseInt(request.getParameter("senderID"));
int receiverID = Integer.parseInt(request.getParameter("receiverID"));
String confirm = request.getParameter("confirm_btn");
Str... |
bacac28b-8e8e-4f10-b163-2bb0feef6ec5 | 9 | public Line localOptimize()
{
for (int i = 0; i < lines.size();)
{
Line optimizedLine = lines.get(i).localOptimize();
if (optimizedLine == null)
{
lines.remove(i);
continue;
}
if (optimizedLine != lines.get(i))
lines.set(i, optimizedLine);
if (optimizedLine instanceof Block)
{
... |
358ca8cc-3133-4ef3-b56e-68eacac425a5 | 1 | public double bonusAttaque(Territoire from, Territoire to) {
return to.coutAttaque(this) == Double.POSITIVE_INFINITY ? Double.POSITIVE_INFINITY : 0;
} |
15340115-3572-4663-b043-748af63ef8d3 | 8 | private static int countCombinations (long deadcards, int toprank, int botrank)
{
int topcount = 0;
int botcount = 0;
for (int s=0; s<4; s++)
if ( (deadcards & (0x01L<<(toprank+13*s))) == 0)
topcount++;
if (botrank == -1)
{
switch (topcount)
{
case 2:
return 1;
... |
b2f06a7a-8a00-47d5-8514-de6ddd684129 | 2 | private void select() {
if (currentChoice == 0) {
gsm.setCharacter(GameStateManager.HEART);
Print.say("Choosing heart");
gsm.setState(GameStateManager.GAME);
}
if (currentChoice == 1) {
gsm.setCharacter(GameStateManager.BRAIN);
Print.say("Choosing Brain");
gsm.setState(GameStateManager.GAME);
... |
b1a55db8-532d-4c7f-b7cd-9a8eac97b0a7 | 5 | public boolean estInscrit(String login, char[] password) {
ok = false;
String mdp = "";
for (int i = 0; i < password.length; i++) {
mdp += password[i];
}
BufferedReader lecteurAvecBuffer = null;
String ligne;
try {
lecteurAvecBuffer = new BufferedReader(new FileReader("file.txt"));
while ((ligne ... |
dedb15bc-a078-4197-97d0-cd9b3fde12d1 | 3 | public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
int n=1,flag=0;
Connection conn;
//ResultSet rs1;
//ResultSet rs2;
Statement stmt;
//Statement stmt1;
PrintWriter out=response.getWriter();
response.setContentType("text/html");
try
{
... |
2c060048-d3cd-4ede-b8ad-5dd3f4f304bc | 7 | protected void initialise() {
this.memory = new MemSpace((int) Math.pow(2.0D, this.addrBits));
for (int i = 0; i < this.addrBits; i++) {
String name = "A" + i;
this.pins.add(new InputPin(this.cntlBits + 1 + i, name));
}
if (this.dataBits - (this.addrBits + this.cntlBits) == 0) {
this.pins.add(new Pow... |
cd1384d9-6e9e-4224-b820-edfe14311137 | 6 | private boolean dfs(char[][] board, int pos)
{
int n = board.length;
if (pos == n*n)
{
return true;
}
int x = pos / n;
int y = pos % n;
if (board[x][y] == '.')
{
for (char c='1'; c<='9'; ++c)
{
board[... |
c7ed8713-8dd2-4f95-9b19-3786d8ea98f4 | 0 | public void autonomousPeriodic() {
// Runs commands & stuff.
Scheduler.getInstance().run();
} |
e05e1e15-5d44-423d-aacf-c73190268a7c | 4 | private boolean isTwoPair(){
int rID=0;
for (int i = 0; i < crds.size()-1; i++) {
if(crds.get(i).getRankID()==crds.get(i+1).getRankID()){
System.out.println("matched "+crds.get(i+1).getRankID());
if(rID!=crds.get(i).getRankID()&& i>1){
System.out.println("two pair matched****************************... |
23fdcd3f-089a-4d0e-913d-5c0b48ac03d6 | 0 | public String getPath() {
return assetPath;
} |
198d430e-6412-4850-89d2-616b17650859 | 6 | public void start() {
ProcessBuilder builder = new ProcessBuilder(this.getExecutableName());
try {
builder.redirectErrorStream(true);
process = builder.start();
writer = new BufferedWriter(new OutputStreamWriter(
process.getOutputStream()));
OutputListener listener = new OutputListener(process, sil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.