method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
be9b338e-adce-4add-a870-9195e8243b45 | 6 | void repositionPlayers (){
if(!GameState.randomPlayerPositions){
for(int i=0; i<10; i++){
Entity entity = operateEntityList(AL_READ, i, null);
//team specific init
if(i<5){
entity.x = playerStartX[i];
entity.y = playerStartY[i];
} else {
entity.x = 6000 - playerStartX[i - 5];
e... |
11ee2c1a-c4b2-4dc2-b585-3c9dbb95d208 | 5 | private static Clip getClipFromFile(File inputFile) throws GameException
{
// UnsupportedAudioFileException, IOException, LineUnavailableException
if(preLoadedSounds!= null && preLoadedSounds.containsKey(inputFile.getPath()))
{
return preLoadedSounds.get(inputFile.getPath());
}
FileInputStream fis ... |
0a2ded06-9fba-4386-bbd7-6bbb47e916df | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Act other = (Act) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
... |
8ffdd7c1-a113-4bbf-804c-bd51a066c0e9 | 8 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Physical target=super.getTarget(mob, mob.location(), givenTarget, commands, Wearable.FILTER_UNWORNONLY);
if(target==null)
return false;
if((!(target instanceof Ammunition))||(!((Ammunitio... |
8e9fe582-b826-4417-9488-dcb43f815f3c | 0 | protected void onFinger(String sourceNick, String sourceLogin, String sourceHostname, String target) {
this.sendRawLine("NOTICE " + sourceNick + " :\u0001FINGER " + _finger + "\u0001");
} |
28da30af-68c0-430a-8654-8ce8d57dd5bc | 7 | public void steplsqr( PaceMatrix b, IntVector pvt, int ks, int j,
boolean adjoin ) {
final int kp = pvt.size(); // number of columns under consideration
int [] p = pvt.getArray();
if( adjoin ) { // adjoining
int pj = p[j];
pvt.swap( ks, j );
double dq[] = h1( pj, ks );
i... |
b414d86c-18a5-4e10-969a-f3b4341a8c1a | 4 | public JPanel paneStrategy() {
paneStrategy.setLayout(new GridLayout(1, 2));
GridBagLayout plantGBL = new GridBagLayout();
GridBagLayout herbivoreGBL = new GridBagLayout();
GridBagConstraints plantGBC = new GridBagConstraints();
GridBagConstraints herbivoreGBC = new GridBagConstraints();
// Plant
panePl... |
f0fb3bd9-1d9c-4089-8645-d4337a4b0a45 | 0 | @Test
public void test() throws ClassNotFoundException, SQLException, IOException {
System.out.println("First show case");
assertEquals(SqlTester.executeAndCountSqlFile("test/resources/test1.sql"), 2);
} |
52c6863e-ac90-4e9e-88d7-3dd68f3bf55b | 6 | public void setDirectionDisplay(int elevator, int direction) {
Lib.assertTrue(elevator >= 0 && elevator < numElevators);
elevators[elevator].direction = direction;
if (elevators[elevator].doorsOpen) {
postRiderEvent(RiderEvent.eventDirectionChanged,
elevators[elevator].floor, elevator);
... |
48bd6348-1d2c-4f34-878a-68bcb1f417ce | 0 | public Image getImageBytesAndContentTypeById(String id) {
Query query = new Query();
query.fields().include(Image.FIELD_NAME_BYTES);
query.fields().include(Image.FIELD_NAME_CONTENT_TYPE);
query.addCriteria(Criteria.where(Image.FIELD_NAME_ID).is(id));
return mongoImageTemplate.findOne(query, Image.class);
} |
a0240644-dafb-49aa-8516-82c740ac9697 | 3 | public static void run(String[] args) throws Exception {
if (args.length < 2) {
System.err.println("File.jar fileLocation fileOutput");
ToolRunner.printGenericCommandUsage(System.err);
} else {
Date date = new Date();
String valueToAdd="";
//Job cofiguration
Configuration conf = new Confi... |
36d079b6-c003-4f46-8014-926754890c56 | 7 | public int getRank()
{
int i = 1;
Connection conn = null;
ResultSet rs = null;
PreparedStatement ps = null;
try
{
conn = iConomy.getiCoDatabase().getConnection();
ps = conn.prepareStatement("SELECT * FROM " + Constants.SQLTable + " WHERE hidden = 0 ORDER BY balance DESC");
r... |
e69571ae-0078-4007-8736-f677a2cedd43 | 8 | public String buildQueryWithParams(String docTableName) throws SQLException {
String readyQuery="";
//Checking if user select any particular document number
if (selectedDocsByID.size()==0){
if (isDocDateExistsInTable(docTableName)) {
readyQuery = "select * from " + do... |
c817c6c5-1178-4b87-b1cc-b49d67473501 | 6 | public String getTextView(int yType){
String temp = "<html><table border='1'><tr><th>Title</th><th>Author</th><th>Pub. Year</th><th>Num. Pages</th><th>Review</th><th># Reviews</th></tr>";
ArrayList<Book> list = (ArrayList<Book>)books.clone();
switch(yType){
case TITLE:
Collections.sort(list,new SortByTitl... |
a1cb3fe5-353b-49ff-b157-0d9ed13a1ce8 | 6 | @Override
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
DatabaseManager manager=DatabaseManager.getManager();
try{
String title=request.getParameter(Equipment.TITLE);
String masterRoom=request.getParameter(Equipment.MULTIPURPOSE_ROOM);
Stri... |
3104a2f5-e96a-4fc2-ac1a-6e0585b277f7 | 5 | private static double[] getSupportPoints(int lineNumber, double[] lowPrices) {
double[] sPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 999999999;
for(int j=-5;j<=0;j++){
if((i+j>=0) && (i+j<lineNumber-1) && lowPrices[i+j]<pri... |
9c7ce17e-69c6-45ef-88bd-ab5a6bc2a429 | 9 | final char[] optimizedCurrentTokenSource3() {
//try to return the same char[] build only once
char[] src = this.source;
int start = this.startPosition;
char c0, c1=src[start+1], c2;
int hash = (((c0=src[start])<< 6) + (c2=src[start+2])) % TableSize;
// int hash = ((c0 << 12) + (c1<< 6) + c2) % TableSize;
char[][... |
a0fa4e16-dad9-42a7-9b5a-7613c13b7007 | 6 | private void loadshieldStorage() {
log.info("TEST");
if(shieldStorageFile == null) {
try{
log.info("Creating Shields File... " + directory);
shieldStorageFile = new File(directory, "shields.yml");
shieldStorageFile.createNewFile();
} catch (Exception e) {
log.info("Error: " + e.toString());
}
... |
504564f5-98f7-41e4-8cd7-36da66e53bc9 | 1 | public JSONObject getJSONObject(String key) throws JSONException {
Object object = this.get(key);
if (object instanceof JSONObject) {
return (JSONObject) object;
}
throw new JSONException("JSONObject[" + quote(key)
+ "] is not a JSONObject.");
} |
5e92ee2a-611c-4d0e-ade6-18385c518e20 | 5 | public Position execute(List<Action> actions, Long[] borders, List<Position> positions)
throws IllegalParameterException {
LOGGER.debug("Starting execute method...");
// 1. Checking input parameter
LOGGER.debug("Checking input parameter...");
if (borders == null || borders.length != 2) {
throw new Illega... |
8f42e143-509d-4076-8a12-1e2600f5549c | 7 | @Override
public void run() {
solicitarListaArquivos();
for(;;) {
// Se o socke esta fechado então terminar Thread.
if(socket.isClosed()) return;
try {
mensagemRecebida = (Mensagem) entrada.readObject();
switch(mensagemRecebida.g... |
be76395f-427d-4ff4-b360-e1d8ffe36761 | 2 | protected byte[] unpack(int[] src, int srcOffset, int destLength) {
assert destLength <= (src.length - srcOffset) * 4;
byte[] dest = new byte[destLength];
int i = srcOffset;
int count = 0;
for (int j = 0; j < destLength; j++) {
dest[j] = (byte) ((src[i] >> (24 - (8 * ... |
3b0587e6-5ffe-4bdd-acfc-9c7529075553 | 7 | @Override
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
if (key == KeyEvent.VK_RIGHT || key == KeyEvent.VK_LEFT) {
cont = false;
doubleCount++;
startTime = System.currentTimeMillis();
}
previousKey = dir;
if (key == KeyEve... |
c2e56e77-3c71-4b41-ba30-cdc8ea4c0c5b | 8 | public boolean isValidControlChar(java.awt.event.KeyEvent e){
//CTRL
if(e.isControlDown() && !e.isAltDown() && !e.isShiftDown()){
if(e.getKeyCode() == java.awt.event.KeyEvent.VK_V){
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
try {
appendText((String)(cb.getData(DataFlavor.strin... |
7a70f517-7ca0-46ef-971e-82b4b5199407 | 0 | protected final SchedulerConfigurationBuilder configureScheduler()
{
return schedulerConfiguration;
} |
32e93595-2b75-4361-91f9-982949a05533 | 4 | public String toString() {
if(bits == null)
throw new IllegalStateException();
String mask = new String();
String space = new String();
for(int i = bits.length - 1; i >= 0; i--) {
space = "";
if((i + 1) % 8 == 0 && i < bits.length - 1)
space = " ";
mask += space + bits... |
9f7dce5f-62a1-4d42-8aa6-2fe1caee1c46 | 2 | public void makeOneStep(Ocean ocean) {
Denizen[][] array = ocean.getArray();
timeToStarvation -= 1;
if (timeToStarvation <= 0) {
array[myRow][myColumn] = WATER;
System.out.println(this + " starved.");
return;
}
Direction direction = chooseRando... |
64782418-2026-4944-9c67-a4550b30adf2 | 3 | public UInt32 readUInt32() {
byte[] bytes = new byte[4];
for(int i = 0; i < 4; i++) {
try {
bytes[i] = this.readByte();
} catch (IOException e) {
Client.logger.Log(e);
}
}
UInt32 value = new UInt32((byte)0);
try {
value = new UInt32(bytes);
} catch (InvalidUIntException e) {
Client... |
8bc4e43d-4f2c-4f8b-a441-53b280441b72 | 8 | @Override
public Object evaluate(DeferredObject[] arguments) throws HiveException {
if (random == null){
random = new MersenneTwister();
}
for (int i=0;i<arguments.length;i++){
if (arguments[i].get()==null)
return null;
}
List<IntWritable> results = new ArrayList<IntWritable>();
PrimitiveCategory... |
284b58bc-3318-4749-bc6b-94891660e1c1 | 9 | public void solve() throws IOException
{
char[][] board = new char[4][4];
int[][] numSharp = new int[4][4];
for(int i = 0; i < 4; ++i)
{
String temp = readString();
for(int j = 0; j < 4; ++j)
board[i][j] = temp.charAt(j);
}
for(int i = 1; i < 4; ++i)
{
for(int j = 1; j < 4; ++j)
{
... |
a09b514d-32a1-4bce-908a-95c499864f5d | 6 | */
public void clearSpeciality(Unit unit) {
if (!requireOurTurn()) return;
UnitType oldType = unit.getType();
UnitType newType = oldType.getTargetType(ChangeType.CLEAR_SKILL,
unit.getOwner());
if (newType == null) {
gui.sh... |
438cb6ec-b29d-45e9-a75e-00f3312f9ff4 | 2 | public InputStream fetch(String name) throws IOException {
try {
URL loc = new URL(base, mangle(name));
return(get(loc));
} catch(IOException e) {
throw(e);
} catch(Exception e) {
/* There seems to be a weird bug in NetX */
throw((IOException)(new IOException("Virtual NetX IO exception").ini... |
6fb2eeae-7e2a-4aa0-ab4d-a9f842528268 | 5 | public static void fullGraphRepaint(Graphics2D g2, ArrayList<RoadGraph> list) {
g2.setComposite(AlphaComposite.DstOut);
g2.setColor(new Color(0, 0, 0, 1f));
g2.fillRect(0, 0, GUI.getBufferedImageSize().width, GUI.getBufferedImageSize().height);
g2.setComposite(AlphaComposite.SrcOver);
... |
751c6258-e999-4ca4-b577-4d659e0dfd01 | 5 | public void optTranspose ()
{
int num_procs = 4;
for (int index = 0; index < (dim/(num_procs*32)); index++) {
for (int p = 0; p < num_procs; p++) {
for (int k = 0; k < dim/32; k++) {
for (int j = 0; j < 32; j++) {
for (in... |
19378c52-8249-4e27-aa1d-25614929e05b | 3 | public FolderEntry [] getFolders (boolean external) throws IOException
{
int blocks = getFolderBlockCount (external);
byte folders [] = new byte [blocks * BLOCKSIZE];
Data data = new Data (this, folders);
Vector v = new Vector (8);
int offset = 0;
int folderNum = 0;
FolderEntry temp;
FolderEntry retv... |
59b6afb3-365a-4f25-8147-eec44dbaa07e | 3 | public double get (int i)
{
switch (i)
{ case 0:
{ return x;
}
case 1:
{ return y;
}
case 2:
{ return z;
}
default:
{ throw new ArrayIndexOutOfBoundsException (i);
}
}
} |
1ababee6-f528-46ee-9051-3df0a2c471d4 | 9 | public BlockAndRecord getTableRecordAndLock(RecordId recordId, List<Integer> columnIds, TableRecordMetadata meta, Set<Object> pinnedBlocks) {
ListBlock block = (ListBlock) BlockManager.getInstance().getBlock(recordId.getPtr(), meta, pinnedBlocks);
block.readLock();
try {
TableRecord record = (TableRecord) bloc... |
404449ce-65f1-468a-9c20-6cfc587b1840 | 2 | protected Option matchOption(ItemStack item)
{
for (Option o : options)
{
if (o.getIcon().itemEquals(item))
{
return o;
}
}
return null;
} |
9fc3fc2c-c1f8-474d-ae25-41fe2344b08e | 4 | public static List<FoodInfo> getShopFoodList(int shopId)
throws HibernateException {
List<FoodInfo> shopFoodList = null;
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
try {
// Begin unit of work
session.beginTransaction();
String hqlString = "select f from FoodInfo as f whe... |
68fa2939-392e-4f76-849b-5356a72df80d | 8 | public Object lookup(String serviceName) throws UnavailableServiceException {
logger.info("Looking up JNLP Service:"+serviceName);
//Can't be null Service Name
if(serviceName == null) {
throw new UnavailableServiceException("serviceName is null");
}
//First de... |
aa4e86cf-99f4-4ea7-9a58-f62659da4c6c | 3 | @Override
public void run() {
StringBuilder s = new StringBuilder();
for (int i = 0; i < FINISH_LINE; i++)
s.append("=");
System.out.println(s);
for (Horse horse : horses) {
System.out.println(horse.track... |
b671b863-fe6f-4c00-97cc-50ec5de6927a | 4 | @Override
public boolean activate() {
return ((Inventory.contains(Constants.INVENTORY_CURLY_ROOT_ID)
|| Inventory.contains(Constants.INVENTORY_STRAIGHT_ROOT_ID))
&& !validate(Constants.WAITFOR_WIDGET)
&& !validate(Constants.FLETCH_WIDGET)
&& Inventory.isFull()
);
} |
890a16a3-0b91-460e-8966-c70e83ddedf2 | 9 | public boolean appendRecord(SurveyRecord data) {
logger.entering(this.getClass().getName(), "appendData", data);
if (!isOpen) {
logger.info("attempting to append to closed record");
return false;
}
if (data == null) {
logger.info("attempting to append a null record");
return false;
}
String[] t... |
4a51b733-4977-4b72-b852-96c6149e5008 | 7 | public void onRelease(int x, int y, int button){
for (int i=0;i<bHandler.length;i++){
Button b = bHandler[i];
if (b != null && x > b.getEntity().getHitBox()[0] && y > b.getEntity().getHitBox()[1] && x < b.getEntity().getHitBox()[2] && y < b.getEntity().getHitBox()[3] && button == 1){
... |
f30f1e3d-322d-4bca-bca3-48f49b2750cd | 7 | public boolean within(int x0, int y0, int x1, int y1) {
boolean test = false;
if (test || m_test) {
System.out.println("Coordinate :: within() BEGIN");
}
// x1/y1 are right-open
if (test || m_test) {
System.out.println("Coordinate :: within() END");
}
return ((m_X >= x0) && (m_Y >= y0) && (m_X < x1... |
615dba32-e23f-4b54-ab16-6d45d65164a6 | 8 | public void run() {
Vector<Frame> strip = movie.getStrip();
// If only one frame in a repeating Movie, then display it and quit
// without calling notifyEndMovie(), because it doesn't really end.
if (strip.size() == 1 && movie.isRepeating())
notifyChangeFrame(((Frame)strip.get(0)).getImage());
else {
if... |
bffbfb85-34bb-441d-abda-991ce9f98bea | 9 | private static List<String> contCGtaintsearch(CallGraph cg, CGNode taintNode, String source, List<String> sinks) {
List<String> out= new ArrayList<String>();
IR tIR =taintNode.getIR();
List<Integer> inTaintvns=new ArrayList<Integer>();
if (source==null){
for (int i = 0; i... |
05d345da-565e-4043-b83d-6a78f6748077 | 8 | public void removeSnapshotListeners() {
if (snapshotMenuItem != null) {
ActionListener[] a = snapshotMenuItem.getActionListeners();
if (a != null && a.length > 0) {
for (ActionListener x : a) {
snapshotMenuItem.removeActionListener(x);
}
}
}
if (snapshotButton != null) {
ActionListener[] ... |
cc31002c-4977-4e24-aa32-aebf8986f08b | 0 | public String getAlgorithm() {
return algorithm;
} |
c683e4f6-7d66-432e-9080-43787e34a924 | 9 | * @param client
*/
private void cmd_describe(final String arg, final Client client) {
final Player player = getPlayer(client);
final Room room = getRoom( player.getLocation() );
// @desc <object name/object dbref/here/me>=<description>
final String[] args = arg.split("=");
final String ref = args[0];
... |
fc7f1602-196d-48d6-89a6-2f1ac71c035f | 8 | private static ArrayList<String> parseCollection(InputStream stream, String elementName) {
ArrayList<String> collectionItems = new ArrayList<String>();
XMLStreamReader xr;
try {
xr = xif.createXMLStreamReader(stream);
} catch (XMLStreamException e) {
xr = null;
//TODO throw exception
}
if (xr... |
40f11e6e-ec7b-438f-8581-3a8825ff761e | 6 | @Override
public V put(K key, V value) {
if (key == null || value == null)
throw new IllegalArgumentException();
int hash = (key.hashCode()) % totalBuckets;
hash = hash * (hash < 0 ? -1 : 1); //save me from negative hashes!!
System.out.println(String.format("They key for... |
e242ccd3-b042-48b9-8b45-fa1d7fe08370 | 0 | private Phone(String phoneType) {
this.phoneType = new SimpleStringProperty(phoneType);
this.countryCode = new SimpleStringProperty("");
this.cityCode = new SimpleStringProperty("");
this.localNumber = new SimpleStringProperty("");
this.extension = new SimpleStringProperty("");
} |
796b7f7b-5b39-4d75-a988-c9c130119639 | 7 | public static boolean promptYesNo ( String text, boolean defaultYes )
{
ArrayHelper yesPos = new ArrayHelper( "yes", "y" );
ArrayHelper noPos = new ArrayHelper( "no", "n" );
if ( defaultYes )
{
String uInput = promptBasic( text + "[Y/n]" ).trim().toLowerCase();
return yesPos.contains( uInput ) || uInput... |
e2431925-b838-4adc-aee5-4152786c7a5c | 8 | private Szo getLegtobbEgyezes(Mondat mondat, List<Szo> potencialisSzavak) {
Map<Integer, List<Szo>> map = new TreeMap<>();
int i = 1;
while (i == 1 || map.get(i - 1) != null) {
for (Szo szo : potencialisSzavak) {
for (String szavaim : mondat.getMondat().split(" ")) {
... |
81daa1bc-10b2-4057-8d28-0bda8f546af0 | 7 | public void actionPerformed(ActionEvent actionEvent) {
if (actionEvent.getSource() == menuItem1[0]) {
textArea[0].setText("");
textArea[1].setText("");
}
if (actionEvent.getSource() == menuItem1[1]) {
// TODO: ファイルの読み込み
}
if (actionEvent.getSource() == menuItem1[2]) {
// TODO: ファイルの保存
}
if (ac... |
b1b574ff-ee12-418a-9e97-58ac34321bb8 | 3 | @SuppressWarnings("empty-statement")
public String[] recupererEnchereTableau() throws SQLException
{
ResultSet retourBDD = this.m_modele.getAllEnchere();
Object[][] retour = null;
int i=0;
int taille = 0;
while(retourBDD.next())
{
... |
91b1e631-f8eb-448f-b6d6-282a9fa7e5dc | 9 | public void checkItemsAndHandleThem() {
synchronized (taskList) {
for (Task task : taskList) {
if ((task.getDueDate().before(new Date()) || (task.getDueDate().equals(new Date())))
&& !task.isCompleted() && !task.isTaskExpiredHadBeenNotify()) {
dataXMLManager.deleteTaskFromXML(task);
task.handl... |
7660938a-2257-4086-9cd9-713b3981c56b | 4 | public void updateFrame(GameTimer gameTime)
{
// Get the time since the last Update.
_TotalElapsedTime += (float) gameTime.getElapsedTime().TotalSeconds();
// If it's not time to change frame yet, stop here.
if (_TotalElapsedTime < _TimePerFrame) { return; }
// If the animation is going forward.
if (_Ani... |
310d8b45-c6f6-46e7-ac56-a7a8fbbd35b3 | 5 | void mergeOpacityBuffer(int color, boolean clear) {
if (!opacityArea.isEmpty()) {
if (curBrush.paintMode != CPBrushInfo.M_ERASE || !lockAlpha) {
paintingModes[curBrush.paintMode].mergeOpacityBuf(opacityArea, color);
} else {
// FIXME: it would be nice to be able to set the paper color
paintingModes[... |
2d452227-2194-4e80-9999-909b3fe8d4a1 | 3 | public void listaTabela() {
UsuarioBO Encarregados = new UsuarioBO();
if (userLogado.getTipo().equals("Gerente")) {
try {
tbResultadoBusca.setModel(DbUtils.resultSetToTableModel(Encarregados.preencheTabelaEncarregadoPorDepartamento(userLogado.getDepartamento().getCodigo()))... |
9d71a1da-1dc5-4858-83fd-9dc8f1ed1d3e | 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... |
debb8c9d-7e90-4bda-92de-34514f2672ce | 7 | private static Node<Integer> add_HeadOnesDigitData_Recursive_Internal(Node<Integer> num1, Node<Integer> num2,
int carry) {
if (num1 == null && num2 == null && carry == 0) {
return null;
}
Node<Integer> result = new Node<Integer>(null);
int value = carry;
i... |
129a0c4d-a666-487a-a4fb-3772bf67fc52 | 0 | public Object(Point position, int baseSpeed, int baseForce,
World currentWorld, boolean bouncing) {
this.exactPostitionX = position.x;
this.exactPostitionY = position.y;
this.speed = baseSpeed;
this.force = baseForce; // 100%
this.currentWorld = currentWorld;
this.ySpeed = 0;
this.xSpeed = 0;
this.is... |
bbcae86b-89c0-4472-adf6-7fb6f42144b9 | 3 | private String getValidName(String name, String extension) {
String cleanName = name;
String[] splits = name.split("\\.");
if (splits.length != 0) {
if (splits[splits.length-1].equalsIgnoreCase(extension)) {
cleanName = "";
for(int i = 0; i < splits.le... |
e76dd721-7c30-46fe-a4b4-103c4e38c602 | 4 | public static void ellipse(double x, double y, double semiMajorAxis, double semiMinorAxis) {
if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative");
if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative");
double xs = s... |
ce17b527-3393-4a4e-904f-0be88e96e6ce | 0 | public gui.editor.ToolBar getToolBar() {
return toolbar;
} |
08c71d15-eb33-489d-8ae1-a77b39deb1d4 | 0 | @Override
public ArrayList<Excel> getColoredExes() {
return coloredEx;
} |
de5e49e5-8c40-489a-b741-cbefa7a3f1ad | 2 | private void loadTargetPins(Dimension arrayDimensions, int pinInset, Dimension pinDimensions, int verticalMargin, int horizontalMargin) {
targetPin = new TargetPin[arrayDimensions.width][arrayDimensions.height];
for (int x = 0; x < arrayDimensions.width; x++) {
for (int y = 0; y < a... |
4af3070a-3852-4d75-867f-8030eb2532f9 | 8 | private boolean removeStore(String workspace, String storename, StoreType type,
final boolean recurse, final Purge purge) throws IllegalArgumentException {
try {
if (workspace == null || storename == null)
throw new IllegalArgumentException("Arguments may not be null!");
... |
d91ccd0c-c58d-450c-aa4e-33d83525ae59 | 5 | public static void main(String[] args) {
Scanner s = new Scanner(System.in);
Object o = new Object(); // just a raw value. Don't worry 'bout it.
HasherTable<String, Object> h = new HasherTable<>();
while (true) {
System.out.print("> ");
String n = s.next();
... |
92a84059-3643-4978-be82-75a836c88f0d | 4 | @Override
public void reload() throws RemoteException {
// TODO Auto-generated method stub
// determine the configure file is existed or not
if (isExistedFile(midwarePath + "conf", confFile) == false) {
throw new RemoteException("There is no " + confFile
+ "and can't reload");
}
// determine the serv... |
efa1d981-db9a-46bd-b140-f1c63b2c63ce | 4 | private static void decodeNumberInput(int keyNumber) {
Movement.checkAllFalse();
switch (keyNumber) {
case 37:
Movement.MOVEMENT[Movement.LEFT] = true;
Miscellaneous.log("LEFT");
break;
case... |
38c9f48e-7db7-4cc6-b14f-380c98d49984 | 6 | public void mousePressed(MouseEvent me)
{
if (me.getButton() == MouseEvent.BUTTON1)
{
int x = me.getX()
/ (getTileSize() * getZoom() + (isDrawGridLines() ? 1 : 0));
int y = me.getY()
/ (getTileSize() * getZoom() + (isDrawGridLines() ? 1 : 0));
... |
8612c458-d6d4-488d-84e1-ce64b264c235 | 3 | public static int[] selectionSort(int array[]){
for (int i = 0; i < array.length - 1; i++)
{
int index = i;
for (int j = i + 1; j < array.length; j++)
if (array[j] < array[index])
index = j;
int min = array... |
3455857d-7fcc-406f-b9d8-ea633f1983cc | 2 | public ArrayList<Integer> getTransitionStartToGoal( int startID, int goalID ){
ArrayList<Integer> transition = new ArrayList<Integer>();
transition.add( goalID );
while(true){
int to = transition.get(transition.size()-1);
int from = getNode(to).getFromID();
transition.add(from);
if( from == startID... |
379c9cc0-b8ab-4fa4-b3cc-27df6d537ef0 | 2 | public static void print() {
for (int i = 1; i <= 5; i++) {
try {
System.out.println("Counter: " + i);
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} |
757bbf48-04a6-4f0c-9bd2-8142e9e0476c | 5 | void setScrollAttribute(CS355SScrollbarAttrConsts scrollBar, CS355SScrollbarAttrConsts attribute, int number)
{
JScrollBar scrollbarToChange = null;
switch (scrollBar)
{
case H_SCROLL_BAR:
scrollbarToChange = jScrollBar2;
break;
case V... |
589bcb70-2243-49fc-81b4-d2824c34df6e | 4 | static Match[] makeMatches( int len, BitSet versions,
MVD mvd, int endPair, int endIndex,
boolean multiple, ChunkState state ) throws Exception
{
BitSet bs = versions;
Vector<Match> matches = new Vector<Match>();
for ( int i=bs.nextSetBit(0); i>=0; i=bs.nextSetBit(i+1) )
{
// start from one byte afte... |
e326f34d-e30e-4b34-b916-34889bbde40d | 0 | void initQuantity() {
quantity = 1;
} |
175cd5f4-655c-451b-9e31-4c1fe0c9ea02 | 1 | public JPanel getShutdownBtnMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.shutdBtn;
} |
7c318217-d978-43e0-8380-147832fc72df | 9 | @Override
protected CommandExecutionResult executeArg(Map<String, RegexPartialMatch> arg) {
final Set<EntityPortion> portion = getEntityPortion(arg.get("PORTION").get(0));
EntityGender gender = null;
final String arg1 = arg.get("GENDER").get(0);
if (arg1 == null) {
gender = EntityGenderUtils.all();
} e... |
a31a5fc0-4d3b-4a6d-b930-a94b42e1e9fb | 1 | public void setShutdownMenuFonttype(Fonttype fonttype) {
if (fonttype == null) {
this.shutdownMenuFontType = UIFontInits.SHDMENU.getType();
} else {
this.shutdownMenuFontType = fonttype;
}
somethingChanged();
} |
0d31ab47-ebae-47c6-8d4a-4b843c3243a6 | 6 | static private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(4, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(5, active0);
return 6;
}
switch(curChar)
{
cas... |
61a5b72f-c120-45d3-b5cc-6e675baa28f3 | 0 | public void IncrementBussesCreated()
{
bussesCreated += 1;
} |
5955398a-ee72-4061-8c8b-c2beec5f5639 | 2 | @Override
public String toString(){
String s = "List of Entities\n";
for (int i=0;i<eHandler.length;i++){
if (eHandler[i] != null)
s += eHandler[i].getName() + "\n";
}
s += "END OF LIST\n-----------------\n\n";
return s;
} |
23a6c340-8b14-4d29-b8ae-ba04cdc9739f | 0 | public ServiceEntity() {
setId(System.nanoTime());
} |
cbb0d554-4371-47f3-afc6-34ce1636cbe6 | 6 | public static char six(int r, int c, int f) {
if (s1(r, c, f) || s2(r, c, f) || s4(r, c, f))
return '|';
else if (s3(r, c, f) || s6(r, c, f) || s7(r, c, f))
return '_';
return '.';
} |
6962e31b-241e-4e09-bc43-ab543a219990 | 5 | public boolean canDropProduce(Player p, Entity e){
if(!plugin.getAnimalData().contains("AnimalCoolDown")){
return true;
}else{
if(this.getHunger() == true){
p.sendMessage(ChatColor.RED + this.getAnimalName() + " needs to eat first");
return false;
}else if(this.isHealthy == false){
p.sendMess... |
7858ff63-1b0c-4ebc-8543-409560f95b45 | 7 | public void moveEast()
{
boolean [] temp = WhenShitHits.Enemy2Setpiece(this, 3);
if(temp[1] == false)
{
if(direction != 3)
{
direction = 3;
anamationFrame = 0;
pic = eastAnamation()[anamationFrame];
animate = false;
if(animationTimer.isRun... |
1ed3412c-0fc0-4c7c-a97b-9d76f091aab5 | 7 | private ArrayList<String> getSenderList() {
int count=0;
int noOfSenders=0;
ArrayList<String> allIPs = new ArrayList<String>();
ArrayList<String> senderIPs = new ArrayList<String>();
read.lock();
try {
for (int i=0; i<localMemberList.getSize(); i++)
{
if(localMemberList.getFullList().get(i).i... |
1bd29f8a-6651-4fc9-b60e-f99514bf8007 | 2 | public static double[][] add( double[][] mat1, double[][] mat2 )
{
int m = mat1.length;
int n = mat1[0].length;
double[][] matres = new double[m][];
for ( int i = 0; i < m; ++i )
{
matres[i] = new double[n];
for ( int j = 0; j < n; ++j )
matres[i][j] = mat1[i][j] + mat2[i][j];
}
return(matres);
} |
0280a5c1-8b45-47b6-b43a-6886eb4d0d81 | 0 | public CookieProtected() {
print("CookieProtected constructor");
} |
9fd6feb5-432b-4b00-9e33-e3355a59f5e5 | 3 | private void agrupar() {//TODO: adicionar novas formas de agrupamento?
if(alunosTurma != null){
agrupamentoAlunos = new Agrupamento("Alunos");
for(Object obj : alunosTurma){
if(obj instanceof MatriculaAlunoTurma){
this.agrupamentoAlunos.addItem("Alunos... |
1aae151e-0a25-430e-85d3-03104409256f | 2 | public Set<Track> getTracks(final int recNumber) throws SQLException
{
Set<Track> retSet = new TreeSet<Track>();
// First Build the bare track details
PreparedStatement s = Connect
.getConnection()
.getPreparedStatement(
"SELECT TrackRefNumber, TrackName, ... |
9ce529d8-8d4e-4a31-ae74-87b64b1e4693 | 1 | public int getAttributeLocation(String name) {
Attrib a = attrib(name);
return a != null ? a.location : -1;
} |
dece66a4-516f-4689-9dd2-3ea28bd92cc4 | 3 | public RemoteRecipes(JFrame frame) {
super(frame);
String recipeDir = "";
opt = Options.getInstance();
if(opt.getProperty("optRecipe") != null)
recipeDir = opt.getProperty("optRecipe");
if(recipeDir.equalsIgnoreCase("") ) {
try {
recipeDir = SBStringUtils.getAppPath("recipes");
} catch (... |
7c361909-bd67-4f8a-b916-3c6028deeb93 | 4 | public boolean proceedToNext() {
for (final Player player : this.players) {
if (!player.hasPlayedCards() && !player.isCzar() && !player.isWaiting()) {
return false;
}
}
return true;
} |
928e977f-cf08-4bf7-8760-2efad680508d | 9 | private void quickSort0(int[] a, int low, int high) { //the valid elements of the list are [low, high]
if (high - low <= 1)
return;
if (high - low == 2) { //efficient!
if (a[low] > a[low + 1])
swap(low, low + 1);
return;
}
// if (high... |
ca108771-8d64-4cca-9ab5-ceb17905f141 | 1 | public void setLoadingStatusFontstyle(Fontstyle fontstyle) {
if (fontstyle == null) {
this.loadingFontStyle = UIFontInits.LOADINGSTATUS.getStyle();
} else {
this.loadingFontStyle = fontstyle;
}
somethingChanged();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.