method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b5f970e3-faf8-489c-a37c-a0e0a8bb085b | 7 | void doAutobond() {
// perform bonding if necessary
boolean doBond = (bondCount == 0 || isMultiFile || isPDB && bondCount < atomCount / 2);
if (viewer.getForceAutoBond() || doBond && viewer.getAutoBond() && getModelSetProperty("noautobond") == null) {
autoBond(null, null);
}
viewer.setShapeProperty(JmolCon... |
2fec3ce9-6219-4842-888c-8fe2874be9c3 | 0 | public void clickTutorial() {
System.out.println("You have already chosen characters and equipped them with items, now just click to play the game.");
//TODO: Maybe add instructions of how the game will be played, how to move, what will happen, etc.?
} |
70463c45-5ab0-4dbf-9712-c447034acd20 | 6 | public TableModel obtenerResumenFinanzasDB(int ano, String mes) {
Connection conn = null;
Statement stmt = null;
String query = "SELECT * FROM GYMDB.FINANZAS WHERE FECHA LIKE '"
+ ano + "-"
+ mes + "-%'";
ResultSet rs = null;
try {
... |
f12f967d-9aed-41a3-9226-4438870f2762 | 4 | public int compareTo(Suffix that) {
if (this.equals(that)) return 0; // optimization
int N = Math.min(this.length(), that.length());
for (int i = 0; i < N; i++) {
if (this.charAt(i) < that.charAt(i)) return -1;
if (this.charAt(i) > that.charAt(i)) return +1;
}
... |
cd12cee2-89d8-435a-85c7-9d6096696786 | 2 | @Override
public void simpleInitApp() {
/*
* meny = new Meny(); while(!meny.started()){ // g�r inget f�rens
* man har valt join eller host System.out.println("lol"); }
*/
// IP = meny.getIP();
initLights();
initObjects();
initKeys();
initCam();
initAudio();
threads = new Vector<Thread>();
t... |
07897096-e7f4-4135-9d43-395c1f14f6f9 | 8 | private double getSpecialAccuracyModifier(Player player) {
Item weapon = player.getEquipment().getItem(Equipment.SLOT_WEAPON);
if (weapon == null)
return 1;
String name = weapon.getDefinitions().getName();
if (name.contains("whip") || name.contains("dragon dagger")
|| name.contains("dragon longsword")
... |
0c23b286-8235-44c9-b78c-4954a8d9412f | 1 | @Override
public void draw(Graphics g, Camera cam) {
if (canPickUp) super.draw(g, cam);
} |
e80cf296-4925-436a-b9b0-237a1fc2725a | 3 | public static void copy(final InputStream input, final File target) throws IOException {
if (target.exists()) {
throw new IOException("File already exists!");
}
if (!target.createNewFile()) {
throw new IOException("Failed at creating new empty file!");
}
... |
ac90bf1b-dbff-488c-9410-599a20d8314f | 7 | public void settle() {
String temp = toString();
for (int i = 0; i < width; i++) {
int colCount = 0;
String currCol = new String(getCol(i));
String chunks[] = currCol.split(" ");
char[] tempChars = new char[height];
for (int z = 0; z < height; ... |
2a14bf36-20f5-4b33-8bf4-9e900c215da0 | 8 | public int getFileCount(int idx) throws Exception{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs =null;
int result = 0;
try{
conn = getConnection();
pstmt = conn.prepareStatement("select count(*) from food where idx=?");
pstmt.setInt(1, idx);
rs = pstmt.executeQuery();
if... |
c89c18f2-eeb6-497a-9690-4f8808ed3e0e | 5 | public static void main(String[] args) {
final BlockingQueue<String> bq = new ArrayBlockingQueue<String>(16);
for (int i = 0; i < 16; i++) {
String log = (i + 1) + "--->";
try {
bq.put(log);
} catch (InterruptedException e) {
e.printSt... |
d01b2e4f-a974-4de8-a1b2-956f609d2ef6 | 6 | public static boolean adjacent(char x, char y) {
initPositionSingleton();
KeyBoardPosition pos = (KeyBoardPosition) qwertyposSingleton.get(new Character(Character.toLowerCase(x)));
if(pos == null) {
return false;
}
int col = pos.getCol();
int row = pos.getRow();
String keyRow = QWERTY[row];
if(col... |
9fef3801-3b5e-47e0-b7d7-3d4999d9063b | 3 | public boolean checkIfAllEmpty() {
for (int i = 0; i < rows; ++i) {
for (int j = 0; j < cols; ++j) {
if (gridCells[i][j].getState() != GridState.EMPTY) {
return false;
}
}
}
return true;
} |
2841f165-7bd5-476d-a196-90263d4b4a5d | 2 | public Object getTransferData(DataFlavor flavor)
throws UnsupportedFlavorException {
if (flavor.equals(colorFlavor))
return color;
else if (flavor.equals(DataFlavor.stringFlavor))
return color.toString();
else
throw new UnsupportedFlavorException(flavor);
} |
d288f737-c73e-41d0-984a-31bdd6bc9bbe | 3 | Attrib attrib(String name) {
for (int i = 0; i < attributes.length; i++) {
if (name.equals(attributes[i].name))
return attributes[i];
}
// throw an exception if not found...
if (strict)
throw new IllegalArgumentException("no active attribute by nam... |
5f1fb2b9-c4ba-436b-8e19-58247f9b1556 | 5 | public void setUse(String compType, boolean b) {
switch (compType) {
case "Ext":
useExtension = b;
break;
case "Hash":
useHash = b;
break;
case "Name":
useName = b;
break;
case "Size":
useSize = b;
break;
case "Thorough":
useThorough = b;
break;
default:
return;
}
} |
33f15ab2-feae-4981-b5d7-9f4348a16cf8 | 5 | @RequestMapping(value = "del", method = RequestMethod.POST)
@ResponseBody
public Map del(@RequestParam int[] id) {
Map<String, Object> map = new HashMap<>();
List<String> l1 = new ArrayList<>();
List<String> l2 = new ArrayList<>();
List<String> l3 = new ArrayList<>();
f... |
33d4bf69-6e61-4f67-9640-e573b6571d5c | 7 | private final void step6() {
this.j = this.k;
if (this.b[this.k] == 'e') {
final int a = m();
if (a > 1 || a == 1 && !cvc(this.k - 1)) {
this.k--;
}
}
if (this.b[this.k] == 'l' && doublec(this.k) && m() > 1) {
this.k--;
}
} |
a59c701a-bd12-46b0-bf7b-c5d5a2dbf07f | 9 | public void keyReleased(KeyEvent e) {
switch ( e.getKeyCode() ) {
case KeyEvent.VK_LEFT:
case KeyEvent.VK_A:
gc.keys[0] = false;
break;
case KeyEvent.VK_RIGHT:
case KeyEvent.VK_D:
gc.keys[1] = false;
... |
1a20479d-fd16-45b3-b9d6-8e49b9669e90 | 9 | public PercolationStats(int N, int T) {
if (N <= 0 || T <= 0)
throw new java.lang.IllegalArgumentException("N<=0 or T<=0");
this.T = T;
counT = new double[T];
Percolation percolation;
for (int i = 0; i < T; i++) { // run open() T times with two random
int randI = 0, randJ = 0;
int count = 0;
perco... |
51c68bb6-a79e-45f5-b135-47326e2485d4 | 6 | protected List<HashMap<String, GraphComponent>> processResults(QueryComponents queryComponents, Hashtable<String, Object> result) throws InformationProblem {
List<HashMap<String, GraphComponent>> resultList = new Vector<>();
ArrayList data = (ArrayList)result.get("data");
if (data != null) {
// assum... |
4fc18f23-d20b-4b0c-9422-2b5eae269756 | 5 | public ClientThread(Socket socket, User usr) {
try {
this.socket = socket;
reader = new BufferedReader(new InputStreamReader(socket
.getInputStream()));
writer = new PrintWriter(socket.getOutputStream());
// 接收... |
b0dc44cf-7ece-4459-a25e-8442cc381871 | 0 | public long getFrameDataStart() {
return frameDataStart;
} |
e9c123a7-d342-4761-92da-6248efc4472c | 8 | private void searchPrompt()
{
ArrayList<String> searches = new ArrayList<String>();
ArrayList<String> queries = new ArrayList<String>();
System.out.println("Search in the form 'attribute identifier'. Press 'done' when finished with searches.");
BufferedReader br = new BufferedReader(new InputStreamReader(Sy... |
0e0a421b-a7b8-4b03-a468-b201f874dab9 | 1 | private BufferedImage getItemImage() {
// String mainPath = new File("").getAbsolutePath();
// File file = new File(mainPath + "/bin/graphics/entity/coin/");
// File[] fileArray = file.listFiles();
// String str = fileArray[(int) (Math.random() * 10) % fileArray.length]
// .getPath();
// str = str.substring... |
a8bdbc2c-e84c-4033-b758-61ace80fe02b | 7 | public void add(String documentName, String word) {
//adds a new term or inc frequency if it already exists in BST
Term term = new Term(documentName, word);
BSTNode node = new BSTNode(term);
BSTNode current = root;
boolean added = false;
//System.out.println("\nAdding ter... |
b8d61faa-3973-4bcd-a3e9-5ac7ce068b3e | 5 | public boolean metodoCompare(Pessoa u ){
if (this.end.equals(u.getEnd()) && this.nome.equals(u.getNome())
&& this.login.equals(u.getLogin()) && this.senha.equals(u.getSenha())
&&(this.id.equals(getId()))){
return true;
}
return false;
} |
d349be3b-2770-4801-989d-abc9addff129 | 5 | private void assignMandatoryVariables(final List<Variable> mandatoryVars,
final Map<Variable, Expression> varAssignments)
throws VerifyException {
final int size = mandatoryStack.size();
if (mandatoryVars.size() != size) {
try {
feed.reject("Statement has wrong number of mandatory variables in proof");
... |
1edaabca-5c97-4bbf-ba59-9eb9ca6b3618 | 0 | @BeforeClass
public static void setUpClass() {
} |
4cb0ca6d-fea1-4250-a60e-29e530b7596b | 1 | public static void main(String args[]) {
File dir = new File("C:\\Files");
String[] files = dir.list();
int option;
for (int fileInList = 0; fileInList < files.length; fileInList++) {
option = fileInList + 1;
System.out.println(option + " " + files[fileInList].toString());
}
} |
ba259243-1a4b-4ef8-b96e-4d5d33913d52 | 1 | @Override
public synchronized void removeConsumer(ImageConsumer imageconsumer) {
if (imageConsumer == imageconsumer) {
imageConsumer = null;
}
} |
31d3cfae-1c31-41ea-ace1-813ae4ae1a28 | 5 | public void drawMessage(ChatPacket pkt){
calendar = new GregorianCalendar();
DateFormat dfm = new SimpleDateFormat("HH:mm:ss");
String time = dfm.format(calendar.getTime());
System.out.println(pkt.get_sender()+" "+pkt.get_message());
if (pkt.get_sender().equals("ADMIN") && pkt.get_message().equals("Session Fr... |
b20d0e4f-47ba-4461-a464-0ee03600da25 | 9 | public static int[][] computeDistanceMap(int[][] image) {
// first pass: top-left to bottom-right
for (int y = 0; y < image.length; y++) {
for (int x = 0; x < image[y].length; x++) {
if (image[y][x] != 0) {
image[y][x] = 0;
} else {
image[y][x] = image.length + image[y].length;
if (y > 0)... |
3d049638-f94b-4776-b64f-fc182395b89d | 1 | private void jButtonUtilisateurValideMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonUtilisateurValideMouseClicked
String nom = jTextFieldUtilisateurNom.getText();
String prenom = jTextFieldUtilisateurPrenom.getText();
String identifiant = jTextFieldUtilisateu... |
e909da38-add6-4b78-a461-978acbdf5a55 | 3 | public void readTimes() {
ArrayList<String> bestTimesStringList;
Path path = Paths.get("Sudoku Saves\\BestTimes");
if (Files.notExists(path)) {
reset();
writeTimes();
return;
}
try {
bestTimesStringList = (ArrayList<String>) readAll... |
4aacc2dd-1293-4623-a49c-b6740668c8e1 | 5 | @Override
public int getFlightForDate(Date date, Airport from) throws ConnectException {
long timestamp = date.getTime();
String sql = "SELECT idFlight FROM flight where Date = " + timestamp + " OR ( Date <= " + (timestamp+3600000L) + " AND Date >= " + (timestamp-3600000L) + ") AND DepartureAirport = "
+ from... |
d0f27eb2-a61f-4a4b-8e36-2b599fdc6a3c | 1 | public Map<String, String> connectAndGetPeerList () {
try {
createSocketAndSend("Connection Request From : " + myName, CONNECT);
}
catch (Exception e) {
e.printStackTrace();
}
return myPeerList;
} |
08eee995-575c-4da8-85b6-f1fb05c01636 | 6 | * @param otherlists
* @return Cons
*/
public Cons concatenate(Cons list2, Cons otherlists) {
{ Cons list1 = this;
if (list1 == Stella.NIL) {
list1 = list2;
}
else {
if (list2 == Stella.NIL) {
list2 = list1;
}
else {
Cons.lastCons(list1).... |
04dc6ea2-89ff-4f12-baaa-3918b0281263 | 0 | public String getColumnName(int column) {
return COLUMN_NAMES[column];
} |
1bfd027b-a34f-4419-a24a-2c096a742cac | 2 | private void rx(DatagramSocket socket, byte[] data) throws Exception
{
try
{
DatagramPacket packet=new DatagramPacket(data, data.length);
socket.receive(packet);
messagePacket = Packet.parseUDPdata(data);
if (clientAddress == null)
{
clientAddress = packet.getAddress();
clientPort = packet.... |
64fa655e-29a2-48b8-9ef7-e3489d8e7003 | 8 | public static double[] getPixleOffsets(double distance, int direction){
double[] retArray = new double[2];
switch(direction){
case 8:
retArray[1] = distance;
break;
case 6:
retArray[0] = 0-distance;
break;
case 4:
retArray[0] = distance;
break;
case 2:
retArray[1] = 0-distance;
break... |
4c82914f-9de5-47de-afd4-9a5bb481da53 | 7 | protected void paintComponent(final Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.setColor(Color.WHITE);
//---- Position determination ----------
int xCenter = this.getWidth() / 2;
... |
dcb4b6f6-2f3a-4b33-b6d2-fb18abc17029 | 2 | public int getHandValue() {
if ((handValue > 21) && (ace)) { // Removes 10 points from handValue if
// there is an Ace being counted as
// 11
handValue -= 10;
}
return handValue;
} |
e53380c0-a930-4e57-ac51-4b450397dc92 | 0 | @Override
public void Area(double dx) {
this.rad+=dx;
this.area = 4*Math.PI* this.rad*this.rad;
} |
23d6dbe1-59fd-47c0-9eef-b86ec8e68177 | 6 | public void buildUp(PathQuad quad) {
if(!quad.noChildren()) {
this.buildUp(quad.getChild(2));
this.buildUp(quad.getChild(3));
} else if(!quad.isBlocked() && ((this.getBox().getX() >= quad.getBox().getX() && this.getBox().getX() < quad.getBox().getMaxX())
|| (quad.getBox().getX() >= this.getBox().getX() &... |
40096d21-a643-4676-bb26-ca8a87164a5e | 0 | OperandException() {} |
4b673056-3dfc-4279-8921-692a3ab818c5 | 4 | private String addJavaEqualsFuction(String classStr)
{
String tmpStr = classStr;
tmpStr += "\n\t//equals() fucntion.\n";
tmpStr += "\tpublic boolean equals(";
for(int i = 0; i != this.lstGroupingTypeName.size(); i++)
{
tmpStr += this.lstGroupingTypeName.get(i).getFirst();
tmpStr += " ";
tmpStr += th... |
2389c896-6279-4013-a8ad-8c6b343fb105 | 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... |
fdce61d8-50eb-4f72-aea4-c41afcff35aa | 3 | private void removeRow(int removeMe) {
for (int row = removeMe; row > 0; row--) {
for (Cell cell : cellsInRow(row)) {
Cell cellAbove = getCell(row - 1, cell.column);
if (movingShapeCells().contains(cellAbove)) {
cell.setPopulated(false);
... |
f4118bbf-d1ef-4a46-acc3-7615b1ac76d4 | 9 | public static boolean isBot(HttpServletRequest request) {
if (request.getRequestURI().indexOf("robots.txt") != -1) {
// there is a specific request for the robots.txt file, so we assume
// it must be a robot (only robots request robots.txt)
return true;
}
ClickstreamConfig config = ConfigLoader.getInsta... |
112620d1-0d35-4a70-bf95-4c1e114122af | 8 | private static String combatDiffColor(int i, int j)
{
int k = i - j;
if(k < -9)
return "@red@";
if(k < -6)
return "@or3@";
if(k < -3)
return "@or2@";
if(k < 0)
return "@or1@";
if(k > 9)
return "@gre@";
if(k > 6)
return "@gr3@";
if(k > 3)
return "@gr2@";
if(k > 0)
return "@gr1@... |
bc92284c-7698-438a-8ab7-f78ce3a01cc9 | 8 | EncryptInputStream(Hessian2Input in)
throws IOException
{
try {
_in = in;
byte []fingerprint = null;
String keyAlgorithm = null;
String algorithm = null;
byte []encKey = null;
int len = in.readInt();
for (int i = 0; i < len; i++) {
Str... |
316fe3fc-4af5-401c-8b37-dc465507b23d | 1 | public void setVisible(boolean b){
frame.setVisible(b);
//if false then frame should be disposed.
if (!b){
frame.dispose();
}
} |
779e72c9-37fe-4818-a21d-bb0e4d103b0f | 5 | protected void tearDown() {
// cleanup. This shouldn't be needed, but we'll check
if (analyzer != null) {
try {
analyzer.close();
} catch (Exception ex) {
assertFalse("Failed to close open analyzer: " + ex.getMessage(), true);
}
... |
50ed594e-83a4-4d43-88e6-2d845610a007 | 2 | @Override
public void mouseClicked(MouseEvent e) {
if(!innerCircle.contains(e.getPoint()) && outerCircle.contains(e.getPoint())) {
button.stop();
button.start();
centerColor = new Color(bimage.getRGB(e.getX(), e.getY()));
//centerColor = new Color(bimage.ge... |
eb479432-793c-478e-80bb-0465b736da83 | 6 | private void closeStreams()
{
if (dataInputStream != null)
{
try
{
dataInputStream.close();
} catch (IOException e)
{
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
... |
582e0e00-b7a4-46be-9a80-4dbaa09006dd | 5 | public static Map<String, Chromosome> getRandomGenes(String fileName, int number) throws FileNotFoundException
{
ArrayList<ArrayList<String>> arrrrr = loadArrayList(fileName);
Map<String, Chromosome> chrs = getSorteredMap();
ArrayList<Integer> repeat = new ArrayList<Integer>();
Array... |
f5d1c32c-e60f-4a03-83fd-7ae9160246f2 | 0 | public DrawableItem duplicate() {
return canvas.addItem(new PathItem(this));
} |
7554f2ba-7c77-4ebc-9423-ce6985747e49 | 6 | @FXML
public void addQuizButton(ActionEvent evt) throws SQLException
{
if(!questionx.getText().equals("") || !answerx.getText().equals("") || !option_1x.getText().equals("") || !option_2x.getText().equals("") || !option_3x.getText().equals("") || !option_4x.getText().equals(""))
{
ad... |
38f11a6a-be90-4b54-993b-c2919857ab64 | 5 | public static void main(String[] args) {
double[] doubleArray = {8, 4, 9, 3, 0, 2, 7, 9, 3, 4};
Arrays.sort(doubleArray);
System.out.printf("\ndoubleArray: ");
for(double value : doubleArray)
System.out.printf("%.1f ", value);
int[... |
88a66e0d-6994-4c60-85ae-df70cf0b6b8d | 6 | public Region(Location start, Location end) {
world = start.getWorld();
int startX = start.getBlockX();
int startY = start.getBlockY();
int startZ = start.getBlockZ();
int endX = end.getBlockX();
int endY = end.getBlockY();
int endZ = end.getBlockZ();
highX = (startX > endX) ? startX : endX;
low... |
a4d22c11-484a-4569-97a5-e355cb21d403 | 3 | public String toString() {
switch (flags) {
case FROM:
return "FROM " + super.toString();
case TO:
return "TO " + super.toString();
case FROM_TO:
return "FROM " + super.toString() + " TO " + date2.toString();
default:
return "DatePeriod[UNKNOWN " + super.toString() + "]";
}
} |
19fe733f-0740-4d2f-a431-a1c3a660cd15 | 2 | private void combo_personsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_combo_personsItemStateChanged
//заносим в глобальную переменную ID выбранного человека
Globals.idCurrentActivePerson = Globals.global_connection.t_людиID_from_t_людиName((String)combo_persons.getSelectedItem());
... |
90e47ec0-8fdd-43cc-8bc2-1d98ca9c5aeb | 2 | public List<Player> getWideRecieverList() throws IOException, ParseException {
List<String> csvPlayers = retriveData(WR_PROJECTION_LINK);
List<Player> players = new ArrayList<Player>();
for (String playerString : csvPlayers) {
String[] split = playerString.split("\t");
... |
d6d09479-3aa2-4956-88b1-ae05967dfeb6 | 2 | public static void setModel(int i) {
if( i == 0 || i == 1)
model = i;
} |
a00a30f3-d890-4233-9e69-71e68f4f6163 | 7 | public static void handleEnemies() {
removeEnemies();
if(currentEnemyDelay <= 0) {
currentEnemyDelay = ENEMY_DELAY + currentEnemyDelay;
if(Math.random() > .25 || (level == 0 && gameState != GameState.START_MENU)) {
enemyAddition.put(new Meteor(), true);
} else {
enemyAddition.put(new EnemyShip()... |
4fedddee-3195-4f17-b4fa-603c773ca313 | 3 | private void clear() {
for (int r = 0; r < shape.getHeight(); r++) {
for (int c = 0; c < shape.getWidth(); c++) {
if (shape.checkSlot(r, c)) {
setSlot(r + currentY, c + currentX, (byte) 0);
}
}
}
} |
ed1bf14c-19c6-4c80-a457-01011938699d | 5 | @Override
public void onDraw(Graphics G, int viewX, int viewY) {
if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
{
Graphics2D g = (Graphics2D)G;
Composite c = g.getComposite();
// g.setComposite(new Additive());
g.setColor(new Color(255,r.nextInt(255),... |
9c6bdcc2-fecf-48c6-92e6-80b2d9a20548 | 8 | public void setWall(int locx, int locy, int setDirec) {
//System.out.println("Set wall called. Direction: " + setDirec);
switch (setDirec) {
case 0:
traversal[locy][locx] |= 0x11;
if (locy > 0) traversal[locy - 1][locx] |= 0x44;
break;
... |
a6c027cf-e35f-4083-8d2f-00737113cdbe | 2 | public static void newAccounting(Accountings accountings) {
String name = JOptionPane.showInputDialog(null, "Enter a name");
try {
Accounting accounting = new Accounting();
accounting.getBalances().addDefaultBalances();
accounting.setName(name);
accounting... |
e6665efd-e250-4086-ae11-13596e14750a | 3 | @Override
public LinkedList<E> getObjectsInRange(int x1, int y1, int x2, int y2) {
SortedMap<Integer, E> xRange = xTree.subMap(x1, x2);
LinkedList<E> inRange = new LinkedList<E>();
for(Entry<Integer, E> e : xRange.entrySet()) {
int y = e.getValue().getIntY();
if(y1 <= y && y <= y2) {
inRange.add(e.getV... |
add87b7f-2ac0-4d94-9bed-594de5bda3bd | 6 | private void updateSlider() {
this.adjustingSlider++;
try {
int mode = getMode();
if (mode == HUE) {
this.slider.setValue(this.hue.getIntValue());
} else if (mode == SAT) {
this.slider.setValue(this.sat.getIntValue());
} els... |
fd196c3a-6f1c-4597-9136-7fea336e47d3 | 5 | public static void createProfessor() {
System.out.println("=== Creation of a professor ===");
System.out.print("Give a name: ");
String name = "";
while (name.equals("")) {
Scanner scName = new Scanner(System.in);
name = scName.nextLine();
}
System.out.print("Give a first name: ");
String forename =... |
0c90da87-103f-41fb-b753-d76f6826a8c8 | 8 | private boolean handleBreakAllowed(Player player, Block block) {
if (WorldRegionsPlugin.getInstanceConfig().ENABLE_ALLOWED_BREAK && WGCommon.willFlagApply(player, WorldRegionsFlags.ALLOWED_BREAK)) {
// Disabled?
if (WGCommon.areRegionsDisabled(player.getWorld())) return true;
// Bypass?
if (!WGCommon.... |
af74d98a-394c-476d-839c-b5ff4726d177 | 0 | public void setSequence(int value) {
this._sequence = value;
} |
f28b112d-60c5-40c1-9006-74e235328434 | 0 | public Bitmap(int length){
datamap = new int [1 + length/32];
} |
ba19aa5e-da65-4b86-943f-946b2faa483d | 2 | long fixedFromGJ(int year, int monthOfYear, int dayOfMonth) {
long year_m1 = year - 1;
long f = 365 * year_m1 + div(year_m1, 4) - div(year_m1, 100)
+ div(year_m1, 400) + div(367 * monthOfYear - 362, 12) + dayOfMonth;
if (monthOfYear > 2) {
f += isLeapYear(year) ? -1 : -2;... |
e23a1d15-c4bd-4615-8c80-cf7362afc9ec | 2 | public void setPWFieldFont(String font) {
if ((font == null) || font.equals("")) {
this.pWFieldFont = UIFontInits.PWFIELD.getFont();
} else {
this.pWFieldFont = font;
}
somethingChanged();
} |
54092505-e4f8-4b5e-a132-25e93f80e963 | 9 | public static double recursive( DenseMatrix64F mat )
{
if(mat.numRows == 1) {
return mat.get(0);
} else if(mat.numRows == 2) {
return mat.get(0) * mat.get(3) - mat.get(1) * mat.get(2);
} else if( mat.numRows == 3 ) {
return UnrolledDeterminantFromMinor.det... |
1efc9a4f-f4b2-4769-a07e-3faf5160518b | 5 | public void toggleLighting(
Model lightsModel, boolean lit, float xoff, float yoff, float zoff
) {
if (! lit) {
if (lightingFX != null) detach(lightingFX) ;
lightingFX = null ;
}
else {
///I.say("Toggling lighting on...") ;
if (lightingFX != null && lightingFX.model() != lights... |
a116c77b-0f73-4b7f-ae71-6bd71ea02345 | 0 | public boolean isMytank() {
return isMytank;
} |
ea65cb06-ab5c-4afc-ae24-055bdc4da4c0 | 9 | public void setFilter(weka.filters.Filter c) {
boolean loadImages = true;
if (c.getClass().getName().
compareTo(m_Filter.getClass().getName()) == 0) {
loadImages = false;
}
m_Filter = c;
String filterName = c.getClass().toString();
filterName = filterName.substring(filterName.
i... |
e7d88e80-6be1-4330-86ca-b8033215a04e | 2 | public void itemStateChanged(ItemEvent e)
{
if (e.getStateChange() == ItemEvent.SELECTED)
{
String item = e.getItem().toString();
try
{
// If its an int it's a font size change.
int size = Integer.parseInt(item);
Action fontSize = new StyledEditorKit.FontSizeAction(
"FontSize", size);
... |
3eca015d-d9ae-41bc-957a-94d7593e514e | 1 | public static boolean isMonochrome(Color color) {
int green = color.getGreen();
return color.getRed() == green && green == color.getBlue();
} |
e311a292-1306-473b-bb30-62537a6690fb | 7 | public void sunMoonSwapper()
{ // either the sun or moon will be drawn
if(startApplet == false) // if we're in the play mode AKA. the applet has not just been started
{
if(sun_moon == 1) // draw moon
{
filter(INVERT); // invert background colours to simulate night
sunMoon.drawMoon();
daytime... |
dae879ed-df71-4e8a-8b5f-be6d1ef1a286 | 0 | public boolean isAdult() {return adult;} |
54d59b50-6b55-41d2-a18d-88f1cca7e7d8 | 0 | public UpdateFrame() {
initComponents();
} |
20e919e4-96c2-4516-8c6e-3bb26344aeb8 | 4 | private Vector<DashboardIcon> getCostensValues(Player player) {
// object variable costs
DashboardIcon variableCosts = new DashboardIcon();
variableCosts.setTitle("variable costs");
variableCosts.setIcon("align-left");
variableCosts.setColor("turquoise");
try {
variableCosts.setValue(Double.toString(play... |
61608173-7664-42f4-b04b-b62109cbb077 | 3 | private void computePaths(Vertex source)
{
source.minDistance = 0.;
PriorityQueue<Vertex> vertexQueue = new PriorityQueue<Vertex>();
vertexQueue.add(source);
while (!vertexQueue.isEmpty()) {
Vertex u = vertexQueue.poll();
// Visit each edge exiting u
for (Edge e : u.... |
a79952fe-9afa-4357-b64f-71643bf2204e | 4 | public static boolean is_expression(String expr) {
//OK
if (expr == null) return false;
if (expr.contains("+") || expr.contains(">") || expr.contains("<")) {
// flag being evaluated
return true;
}
return false;
} |
d0154cc9-6e41-4c82-9d23-4997c8a9a880 | 7 | private Set<PartOfSpeechTag> analyzeWordForPossibleTags(String word){
Map<PartOfSpeechTag, Integer> tagCount = new HashMap<PartOfSpeechTag, Integer>();
Set<PartOfSpeechTag> mostLikelyTags = new HashSet<PartOfSpeechTag>();
if(isNumeric(word)){
mostLikelyTags.add(PartOfSpeechTag.CD);
... |
db38f0fe-1bdd-4317-98da-ee829cbdcb5c | 5 | private void removeChildSelectionPath(TreePath p) {
if (p.getPathCount() == 2 || p.getPathCount() == 3) {
Enumeration<?> e = ((MutableTreeNode) p.getLastPathComponent()).children();
while (e.hasMoreElements()) {
removeChildSelectionPath(p.pathByAddingChild(e.nextElement()));
}
}
else if (p.getPathCou... |
a2efd2b4-7096-42ec-8c6c-ed25c14685f3 | 8 | @Override
public void collectionProcessComplete(ProcessTrace arg0) throws ResourceProcessException,
IOException {
super.collectionProcessComplete(arg0);
// TODO :: compute the cosine similarity measure
for(queryAnswers qa: QAList){
HashMap<String, Integer> queryVector = qa.queryTermF... |
fc1487a3-4ca9-436f-a828-e5f2d7dc6a90 | 2 | private static int count(String s, char c) {
int count = 0;
for (int i = 0; i < s.length(); i++)
if (s.charAt(i) == c)
count++;
return count;
} |
532754b3-cd07-498c-a3d7-acace2afbb01 | 1 | public void setName(String name) {
checkModify();
if (name != null)
qualifiedName = name;
} |
3375ee58-42e9-40ef-b806-0175b3e8d43e | 7 | public void addCondition(Condition cndStore) {
if (vctConditions.size() == 0)
Game.vctCheckConditions.addElement(this);
else {
Condition cndStore2;
int i = 0;
while (i<vctConditions.size()) {
cndStore2 = (Condition)vctConditions.elementAt(i);
if (cndStore2.NAME.equalsIgnoreCase(cndStore.NAME)) {... |
812005ed-777a-456c-abbc-a712c445a607 | 2 | private void collectGenerators()
{
UseGenerators useGenerators = method.getAnnotation(UseGenerators.class);
if (useGenerators != null) {
for (Generator generator : useGenerators.value()) {
collectGenerator(generator);
}
}
collectGenerator(meth... |
fcdd1540-f3d5-4822-989e-4f3e91390d4b | 1 | public List<Class<? extends Pouvoir>> getPouvoirsPris() {
return pouvoirsPris;
} |
9d728cf7-ad53-4bea-b518-fd9fb6ff5265 | 0 | @AfterClass
public static void tearDownClass() {
} |
2564e4f0-a080-49db-9d03-d1acd7f35685 | 3 | public static FilmItemStatusType valOf(Character val) throws Exception {
if (val.equals(Good.getVal())) {
return Good;
} else if (val.equals(Brooken.getVal())) {
return Brooken;
} else if (val.equals(Lose.getVal())) {
return Lose;
}
throw new Exception("Kode tidak terdaftar");
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.