method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
40a3c86f-28ae-4a11-a1f7-dade64ac8920 | 6 | protected void OnDataRangeChanged() {
if (selectedIndex != null) {
try {
lastData = NetworkManager.showMore(selectedIndex.getSymbol(), selectedRange);
lineChart.getData().clear();
if (pointerType != null && !pointerType.equals("hide")) {
... |
f1c6837a-92d4-4a39-9ccf-8231b9165c13 | 9 | public void checkForAdjacentChests()
{
if (!this.adjacentChestChecked)
{
this.adjacentChestChecked = true;
this.adjacentChestZNeg = null;
this.adjacentChestXPos = null;
this.adjacentChestXNeg = null;
this.adjacentChestZPosition = null;
... |
4020d4bf-ee25-432b-b16f-69608b662b89 | 1 | public JTextArea getTaChat() {
if (taChat == null) {
taChat = new JTextArea();
}
return taChat;
} |
1efdc508-60b2-4229-a127-af641ac3423a | 0 | public void setConstantTemperature(long constantTemp) {
this.constantTemp = true;
sa.temps[0][indexI][indexJ] = constantTemp;
sa.temps[1][indexI][indexJ] = constantTemp;
System.out.println(this.getTemp());
} |
24cee721-5242-4e5e-8928-4c76d4edcead | 0 | public String getId() {
return id;
} |
950c334f-c7b7-4c60-a615-50167eeee1b8 | 4 | private static void validateLocalePart(String localePart) {
for (int i = 0; i < localePart.length(); i++) {
char ch = localePart.charAt(i);
if (ch != '_' && ch != ' ' && !Character.isLetterOrDigit(ch)) {
throw new IllegalArgumentException(
"Locale part \"" + localePart + "\" contains invalid character... |
c497fe52-a01f-4fcc-a013-d14e50c632e6 | 0 | public static void communicate(CommandSender sender, String message) {
sender.sendMessage(__(PREFIX + message));
} |
c711e079-9e38-4e94-9938-07bbd41b8f83 | 6 | private void queryDb(ActionEvent event) {
String query = sqlQuery.getText();
String[] meta;
List<String[]> data = new ArrayList<String[]>();
try {
SQLResultInterface res = mdi.executeSqlQuery(query);
if (res == null)
return;
List<String> header = res.getHeader();
if (header == null)
meta ... |
a329e891-a72c-4ccb-ad8a-565a94c9307e | 7 | public static void runWrite() throws FileNotFoundException {
if (FileReadService.sList.isEmpty()) {
System.out.println("There is no Student !");
} else {
for (int i = 0; i < FileReadService.sList.size(); i++) {
try {
// Error : 2nd line.
if (FileReadService.sList.get(i).getP().equals(null))
... |
0ca3535d-79bd-425b-8289-f07cf03d7a4a | 4 | public void writeSymbol(CycSymbol cycSymbol)
throws IOException {
if (trace == API_TRACE_DETAILED) {
Log.current.println("writeSymbol = " + cycSymbol);
}
if (cycSymbol.isKeyword()) {
writeKeyword(cycSymbol);
return;
}
if (cycSymbol.equals(CycObjectFactory.nil)... |
f23674ab-a506-4d1b-9614-2ffeeadbe68d | 9 | public static int maxProfit4(int[] prices) {
if (prices.length < 2) {
return 0;
}
int[] left = new int[prices.length];
int[] right = new int[prices.length];
int min = prices[0];
int max = prices[prices.length - 1];
left[0] = 0;
right[prices.length - 1] = 0;
for (int i = 1; i < prices.length; i++) ... |
098d5d89-a22e-4437-ad14-f6e7283a1aeb | 4 | @Override
public long[] getData()
{
if (ptr != 0) {
return null;
} else {
if (isConstant()) {
if (length > getMaxSizeOf32bitArray()) return null;
long[] out = new long[(int) length];
for (int i = 0; i < length; i++) {
... |
9bb31467-d897-46c5-8091-805f4fdcbe9d | 8 | private Bounds getBounds(String left, String right, String top, String bottom) {
return new Bounds((left != null && left != "" ? Double.valueOf(left) : (double) -10),
(right != null && right != "" ? Double.valueOf(right) : (double) 10),
(top != null && top != "" ? Double.valueOf(top) : (double) 10),
(bott... |
c6d27d47-4bf0-41e4-af94-1bf728424e9a | 0 | public void setMACKeyReference(String value) {
this.macKeyReference = value;
} |
5b1403f8-2a4a-42f2-b0ae-9f53d767f31b | 2 | @Override
public DemandeMoyen postDemandeMoyen(DemandeMoyen dem) throws JSONException,
BadResponseException {
Representation r = new JsonRepresentation(dem.toJSON());
r = serv.postResource("intervention/" + interId + "/demande", dem.getUniqueID(), r);
DemandeMoyen demande = null;
try {
demande = new ... |
03ee2ac3-6983-4fc5-a8ec-6be2f6edd987 | 0 | public int addEntry(String variable, String lookahead, String expansion) {
int[] r = getLocation(variable, lookahead);
entries[r[0]][r[1]].add(expansion);
fireTableCellUpdated(r[0], r[1] + 1);
return entries[r[0]][r[1]].size();
} |
b2a7614f-cad9-450b-b8a7-dffc89d6c18d | 5 | @Override
public Boolean call()
throws SongFeatureException {
Boolean resH, resL;
if(this.hlEvaluation)
resH= false;
else
resH= true;
if(this.llEvaluation)
resL= false;
else
resL= true;
if(this.hlEvaluation)
resH= HighLevelSongFeature.start(this);
if(this.llEvaluation)
... |
20cafae7-4b78-4ffa-82c4-be64c2758aa5 | 1 | @Override
public void rotateCounterClockwise(Board board) {
int rot = (getRotation()+3) % 4;
Point inverseBase = new Point(-BASES[getRotation()].getX(), -BASES[getRotation()].getY());
if (rotateAlgorithm(board, Point.translate(getBase(), inverseBase), RELS[rot], getKicks()[(getRotation()+2)%4])) {
addRotation... |
7c650ee4-c6c1-4355-ac9e-291a530852ca | 7 | private String loadBiomes() {
if (details) System.out.println("Loading biomes.");
File imageFile = new File("output/"+Name+"/overviews/biomes_overview.png");
if (imageFile.exists()) {
try {
BufferedImage tempImage = ImageIO.read(imageFile);
if (tempImage.getWidth() == chunksX * MyzoGEN.DIMENSION_X &... |
02af9f61-a493-4b97-bcfc-2b39abb24d71 | 5 | final public CycConstant makeConstantFromName(String name) throws ParseException {
CycConstant val = null;
if (name.startsWith("#$")) {
name = name.substring(2);
}
val = CycObjectFactory.getCycConstantCacheByName(name);
if (val == null) {
try {
val = new CycConstant(name, null);
... |
bf0b30b0-e1a1-412d-b6f1-c43322cc5e02 | 3 | public synchronized void moveRight(boolean pressed) {
rightPressed = pressed;
if (pressed) {
if (timeToNextRightMove <= 0) {
tetromino.tryMove(this, Direction.RIGHT);
if (timeToNextRightMove < 0) timeToNextRightMove = AUTO_REPEAT_INIT_TICKS;
el... |
bd354684-e32b-4d2b-a752-a1fff76e6166 | 8 | public boolean isOne(Type type) {
if (type instanceof IntegerType) {
return (value instanceof Integer && ((Integer) value).intValue() == 1);
} else if (type == Type.tLong) {
return (value instanceof Long && ((Long) value).longValue() == 1L);
} else if (type == Type.tFloat) {
return (value instanceof Floa... |
2e0827fd-b43a-4340-a51f-922ac143b630 | 3 | private String createSample() {
StringBuilder sb = new StringBuilder();
sb.append( "SELECT\n " );
for ( Column col : table.getColumns() ) {
if ( !"ListColumn".equals( col.getClass().getSimpleName() ) ) {
sb.append( col.getColName().toUpperCase() + ", " );
... |
65311c1f-b131-41d9-b7f9-6acc11012ee5 | 1 | public String getWwTopLevel() {
River r = trip.getRiver();
if (r == null) {
return "0";
}
return ""+r.getWwTopLevel ();
} |
d20e9e66-aa22-462c-9476-0eef76cf3f22 | 6 | public AABB shrink(float var1, float var2, float var3) {
float var4 = this.x0;
float var5 = this.y0;
float var6 = this.z0;
float var7 = this.x1;
float var8 = this.y1;
float var9 = this.z1;
if(var1 < 0.0F) {
var4 -= var1;
}
if(var1 > 0.0F) {
var7 -... |
879aa62c-44bb-4624-8f0b-0cbc9e7dda71 | 7 | private String unCommentLine(String line) {
String result = line;
if (line != null) {
if (isSlashStar) {
int posStarSlash = line.indexOf("*/");
if (posStarSlash >= 0) {
isSlashStar = false;
result = unCommentLine(line.substring(posStarSlash+2));
} else {
result = "";
}... |
9c2c1b49-8a37-419d-9b45-4037a31f34de | 1 | public MP3ClickMenu(ActionListener queAl, int number) {
JMenu menu = new JMenu("Queue");
for (int i = 0; i < number; i++) {
String n = Integer.toString(i);
String n1 = Integer.toString(i+1);
JMenuItem menuItem = new JMenuItem(n1);
menuItem.addActionListener(queAl);
menuItem.setActionCommand(n);
... |
fd48d2fc-f9d3-44e7-8ab5-9b17e49da9ce | 8 | public void showImmoMenu() {
//Menüoptionen
final int NEW_HOUSE = 0;
final int EDIT_HOUSE = 1;
final int DELETE_HOUSE = 2;
final int NEW_APPARTMENT = 3;
final int EDIT_APPARTMENT = 4;
final int DELETE_APPARTMENT = 5;
final int BACK = 6;
//Immobilienverwaltungsmenü
Menu maklerMenu = new Menu("Immo... |
2e489d00-f3cf-47b8-b6d2-74b1475416a8 | 0 | public CryptUtils() {
} |
270ff998-d5b8-46e4-ab62-e88b3fefb815 | 3 | @Override
public void OnTrigger(Connection User, RoomItem Item, int Request, boolean UserHasRights)
{
if (!UserHasRights)
{
return;
}
Room Room = Item.Environment.RoomManager.GetRoom(Item.RoomId);
if (Room == null)
{
return;
... |
964d8e05-8cbb-4277-8adc-47da2062b383 | 0 | public void setPRF(PRFAlgorithmIdentifierType value) {
this.prf = value;
} |
cb81e58b-24a9-4328-ab60-e5212954c5fe | 0 | public void setWRholder(String newWRholder) {
WRholder = newWRholder;
} |
51778d78-e27f-4fb6-95d2-5124f56d2eac | 6 | public final void setLanguage(final Language LANGUAGE) {
switch(LANGUAGE) {
case GERMAN:
qlock = new QlockGerman();
break;
case ENGLISH:
qlock = new QlockEnglish();
break;
case FRENCH:
qlock = new... |
a23ddc5e-8e3b-4d50-96be-bc40f3c06040 | 6 | private static void pickCards(final GameState state)
{
int players = state.getPlayerList().length;
HashSet<Card> chosenCards = new HashSet<Card>();
ExecutorService cardPicker =
Executors.newFixedThreadPool(players);
@SuppressWarnings("unchecked")
Future<Card>[] cardFutures = new Future[players];
... |
d75618f2-685f-4fb3-88e7-d4329f75342f | 7 | private JSONWriter append(String s) throws JSONException {
if (s == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write(',');
... |
bd9a323c-22ad-40bf-845a-7ae8b06c97ac | 6 | protected OgexGeometryObject toGeometry( DataStructure ds, Map<BaseStructure, Object> index ) {
OgexGeometryObject result = (OgexGeometryObject)index.get(ds);
if( result != null ) {
return result;
}
result = new OgexGeometryObject();
index.put(ds, result);
... |
832f6056-542e-4c92-9497-0c23ae19bcf5 | 3 | public void setJournals(Journals journals){
this.journals = journals;
combo.removeActionListener(this);
combo.removeAllItems();
if (journals!=null) {
for (Journal journal : journals.getBusinessObjects()) {
combo.addItem(journal);
}
}
combo.addActionListener(this);
combo.setEnabled(journals!=nul... |
df4f4edc-e44f-4c98-ae66-81a9a5e46fff | 9 | void rehash() {
int oldCapacity = table.length;
Entry oldMap[] = table;
int i;
for (i = oldCapacity; --i >= 0;) {
Entry e, next, prev;
for (prev = null, e = oldMap[i]; e != null; e = next) {
next = e.next;
Object obj = e.ref.get()... |
1ac4353e-40aa-4182-8aaa-308eeaf03a1e | 8 | private void trainWithBufferedExamples() {
try {
this.best = ep.parallelDo(new EvolutionaryProcess.Function<Payload<CrossFoldLearner>>() {
@Override
public double apply(Payload<CrossFoldLearner> z, double[] params) {
Wrapper x = (Wrapper) z;
for (TrainingExample example : b... |
8667779b-5e37-45a9-9d5e-1d9ec6e34cea | 0 | public int getId() {
return id;
} |
c64547ba-9c46-4d6e-9119-8af7d83e9472 | 8 | public void create()
{
//all the cards
ArrayList<Card> cards = new ArrayList<Card>() ;
//creates 20 1-tile movement cards
for(int x = 0 ; x < 5 ; x++)
{
cards.add(new Card(1,Color.RED,false)) ;
cards.add(new Card(1,Color.BLUE,false)) ;
cards.add(new Card(1,Color.GREEN,false)) ;
cards.add(new Card... |
0737d7f5-b4cd-4a3b-b98a-54fa289ea8a1 | 1 | public PlanBoeseRespekt(JSONObject object) throws FatalError {
super(object, "BoeseRespekt");
if (PlanBoeseRespekt.list == null) {
PlanBoeseRespekt.list = new OpponentList();
}
} |
8056447e-a0b3-44d8-a0bb-0d6f20a51e85 | 3 | @Override
public void commitTransaction() throws SQLException {
try {
this.connection.commit();
} catch (SQLException e) {
try {
this.connection.rollback();
} catch (SQLException e2) {
throw new DBException("error rolling back tra... |
74d45142-3eba-4f3e-ba10-5874df14ef7a | 1 | private void unload() {
boolean loading = false;
Dispatcher.informShipMoored(name);
try {
lock.lock();
log.info(Dispatcher.informShipAction(name, loading));
if ((port.getCapacity() - port.getLoading() >= cargo)) {
port.increaseLoading(cargo);
... |
bd868593-7911-42e3-ae56-aeaa0c8c9c6a | 8 | public boolean loadBoard( String countriesFile, String continentsFile, String adjacenciesFile ) throws FileNotFoundException
{
this.fileNames = new File( countriesFile );
input = new Scanner( this.fileNames );
Scanner secondInput;
boolean hasLoaded = true;
try
{
// Load this object's countries array from c... |
14f4e156-a9bf-4320-ae50-a0e0041496aa | 9 | private StringBuffer getShortStringData(int shortSID, int nBytes) {
StringBuffer data = new StringBuffer();
byte[] byteBuf = new byte[shortSectorSize];
int ptShort = 0;
int thisSID;
if (rootEntry == null)
return data;
try {
thisSID = rootEntry.SIDfirstSector;
// point to correc... |
e92ea788-c0c8-4652-bebf-24f3b2941aa1 | 9 | public Scope(Engine eng) {
Button toggleZero = new Button("0");
toggleZero.setOnAction(e -> {
zeroMode = !zeroMode;
toggleZero.setStyle(zeroMode ? "-fx-background-color: #33FF33;" : "");
});
this.add(toggleZero, 0, 1);
this.add(canvas, 0, 0);
this.setStyle("-fx-background-color: black, linear-gradient... |
421ed236-e190-4cf9-bbea-5862f2ec7cbe | 6 | public int CalculateSequenceLength() {
int length = 0;
boolean[] BitsClone = Bits.clone();
setNumberOfBits(NumberOfBits);
initTimeOut(ACCEPTABLE_RUN_TIME);
strobeClock();
for (;;) {
length++;
strobeClock();
if (isTimeOut())
... |
2c9301a9-2cf7-4dca-9c8c-307b1996a8e7 | 3 | public void setPosition(Position position) {
if (position == null)
throw new IllegalArgumentException("Position can't be null");
if (position.xCoordinate < 0 || position.yCoordinate < 0)
throw new IllegalArgumentException("The given position is invalid!");
this.position = position;
notifyObservers();
... |
d473d838-e2be-484f-a345-1717e48dfbc8 | 8 | public Coordinates(Instance instance) {
double[] values = instance.toDoubleArray();
int classIndex = instance.classIndex();
if (classIndex == -1) {
m_coord = new int[values.length];
} else {
m_coord = new int[values.length - 1];
}
m_hashCode = 0;
int factor=1;
for (int i = ... |
a2111a50-1b3f-4b01-895f-738ba6847986 | 3 | public void toArray(TreeNode node, List<Integer> list) {
if (node != null) {
if (node.left != null)
toArray(node.left, list);
list.add(node.val);
if (node.right != null)
toArray(node.right, list);
}
} |
fafd4ed1-cce8-4d1a-8379-1889149591e2 | 0 | private Colors() {
} |
34d9e5e8-4adc-4b1c-9575-dbfdc9905517 | 1 | protected static String redoFileFormat(String text) {
String[] dates = text.split(" ");
if (dates.length < 2)
return "invalid format";
else
return dates[0] + "_URL_" + dates[1] + ".html";
} |
954770a6-f038-4f4d-9ca3-8bfd8377375d | 8 | @Override
public ConversionUnit getConversionUnit() {
switch (getUnitType()) {
case UnitConstants.FEET_SECOND:
return new FeetSec(getValue());
case UnitConstants.FEET_MINUTE:
return new FeetMinute(getValue());
case UnitConstants.MILES_MINU... |
07fb76a1-9e99-4027-b03a-582be3c878d8 | 3 | public void render(Graphics2D g) {
Graphics2D g2d = (Graphics2D) finalBoard.getGraphics();
g2d.drawImage(gameBoard, 0, 0, null);
for (int row = 0; row < ROWS; row++) {
for (int col = 0; col < ROWS; col++) {
Tile current = board[row][col];
if (current == null)
continue;
current.render(g2d);
... |
ccd1f4e7-6e50-4a5f-aaca-af077d325650 | 1 | public static <T> List<T> list(T... params) {
List<T> result = new ArrayList<T>();
for (T t : params) {
result.add(t);
}
return result;
} |
fb6189c8-aca5-436e-beb8-08aeaf00bb87 | 7 | private double solveRules(List<Solution<T>> solutions) {
if (interruptCheck.isInterrupted()) {
throw new RuntimeTimeoutException();
}
if (this.rules.isEmpty()) {
return 0;
}
FieldGroup<T> chosenGroup = getSmallestFieldGroup();
if (chosenGroup == null) {
throw new IllegalStateException(... |
4f38db0f-b768-40de-9f49-7508fd41f9c6 | 3 | @Override
public void setLevelState(int state) {
if (state == MAIN) {
_text = "";
} else if (state == COMPLETED) {
_text = "Level Completed";
Application.getInput().setAction(KeyEvent.VK_SPACE, new RestartLevelAction());
} else if (state == START) {
_text = "Press Spacebar";
}
} |
31cf01a0-7ad4-428f-9bba-2364f63db3d4 | 2 | @RequestMapping(value = "/employeeForm")
public ModelAndView showEmployeeForm(HttpServletRequest request)
{
ModelAndView modelAndView = new ModelAndView("employeeForm");
String method = request.getParameter("action");
if (method.equals("add"))
{
modelAndView.... |
c839c0a3-3498-4d92-be0d-87b5f9294318 | 7 | public void updatePosition() {
if (xPos < xDestination)
xPos++;
else if (xPos > xDestination)
xPos--;
if (yPos < yDestination)
yPos++;
else if (yPos > yDestination)
yPos--;
if(xPos == xDestination && yPos == yDestination && isMovingToTeller) {
isMovingToTeller = false;
timer.schedule(new... |
8a02a0cb-52e8-49f8-a8e4-9cb7d6a3a238 | 0 | public Student1(teacher t)
{
this.t1 = t;
} |
6c19b473-b294-43fa-aa30-abd55fb27a02 | 4 | /** @see javax.swing.TransferHandler#importData(javax.swing.TransferHandler.TransferSupport) */
@Override
public boolean importData(TransferSupport info) {
Transferable t = info.getTransferable();
String data;
try {
data = (String) t.getTransferData(DataFlavor.stringFlavor);
} ca... |
66bf118f-8ddd-40b7-a42e-5f777405c946 | 6 | public String get(int n) {
if (capitalword_) return null;
int len = grams_.length();
if (n < 1 || n > 3 || len < n) return null;
if (n == 1) {
char ch = grams_.charAt(len - 1);
if (ch == ' ') return null;
return Character.toString(ch);
} else {... |
2da2a749-6f8c-43d5-9107-1a88174535f6 | 4 | public void hit(int damage) {
if (dead || flinching) return;
health -= damage;
if (health < 0) health = 0;
if (health == 0) dead = true;
flinching = true;
flinchTimer = System.nanoTime();
} |
f9dcc17b-d1f4-4264-b2bd-c755fb5a4cee | 4 | boolean dinicBfs(int src, int dest, int[] dist) {
Arrays.fill(dist, -1);
dist[src] = 0;
int[] Q = new int[V];
int sizeQ = 0;
Q[sizeQ++] = src;
for (int i = 0; i < sizeQ; i++) {
int u = Q[i];
for (Edge e : ady[u]) {
if (dist[e.t] < 0 && e.f < e.cap) {
dist[e.t] = dist[u] + 1;
Q... |
5361aa73-01f1-4aa3-9cee-fc74eb20c5a0 | 4 | public ArrayList<Pizza> haeKaikkiPizzat() throws DAOPoikkeus {
ArrayList<Pizza> pizzat = new ArrayList<Pizza>();
// avataan yhteys
Connection yhteys = avaaYhteys();
try {
// Haetaan tietokannasta Pizzat ja täytteet
String pizzaSQL = "select Tuote.nimi, Tuote.numero, Tuote.hinta, Tuote.tuoteID... |
14061d8f-8cbe-4592-82df-a4168c70a73e | 7 | private static void printNumber(int number) {
NumberType numberType = NumberType.NORMALNUM;
String numberValue = String.valueOf(number);
if (number % 3 == 0 && number % 5 == 0) {
numberType = NumberType.STWANDO;
} else if (number % 3 == 0) {
numberType = NumberType.STW;
} else if (number % 5 == 0) {... |
1445082e-c319-44d9-8ee3-885954fc9127 | 0 | public void setHueChange(double change) {
hueChange = Math.IEEEremainder(change, 360.0);
parametersToNumbers.put("hueChange", new Double(change));
} |
cd2f746c-435d-4a86-bcd7-17e0dddb6faa | 9 | public static String vectorFlagsString(OMMVector data)
{
StringBuilder buf = new StringBuilder(60);
if (data.has(OMMVector.HAS_DATA_DEFINITIONS))
{
buf.append("HAS_DATA_DEFINITIONS");
}
if (data.has(OMMVector.HAS_SUMMARY_DATA))
{
if (buf.leng... |
50ea4f6b-8ece-4543-a935-cf1fac5cce10 | 3 | public void testResponseJSON(){
DomainTools domainTools = new DomainTools("username", "key");
ObjectMapper m = new ObjectMapper();
String json = "";
try {
json = domainTools.use("whois").on("domaintools.com").toJSON().getJSON();
m.readTree(json);
} catch (JsonProcessingException e) {
fail();
} catc... |
3ec4676f-b2ce-4a62-bbe2-0bf1cef4bbe6 | 0 | public int GetPriority()
{
//return the priority of the person for the stop
return priority;
} |
777e1a12-f6df-4163-9d27-68e196fc1c93 | 3 | protected CycList substituteForBackquote(final CycList messageCycList, Timer timeout)
throws IOException, CycApiException {
if (messageCycList.treeContains(CycObjectFactory.backquote)) {
final CycList substituteCycList = new CycList();
substituteCycList.add(CycObjectFactory.makeCycSymbol("read... |
f84fe91f-52b0-4a57-8714-61d0c06c9cf8 | 7 | private void scan(File file) {
if (file == null || !file.exists()) {
return ;
}
if (file.isFile()) {
try {
cruScan.put(file.getCanonicalPath(), new TimeSize(file.lastModified(), file.length()));
} catch (IOException e) {
e.printStackTrace();
}
}
else if (file.isDirectory()) {
File... |
3e270021-45d9-4123-8647-1cf5095d0e79 | 5 | private boolean isBlocked(int x, int y) {
int key = genKey(x, y);
boolean tileblocked = true;
if (tileHashMap.containsKey(key)) {
tileblocked = tileHashMap.get(key).isOpaque();
}
boolean entblocked = false;
if (entities.containsKey(key)) {
ArrayLis... |
a76ae087-ad25-42ec-b2a4-7a520b03b9eb | 1 | public String toString()
{
if (nome != null)
return nome.toString();
return id + "";
} |
1f3994ad-9777-49e3-8fd6-492982deb946 | 1 | private boolean jj_2_47(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_47(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(46, xla); }
} |
99f112e8-0768-425a-b599-13dd8c5843de | 3 | public static int findNumDays(String fileName)
{
int lineNumber = 0;
String line;
try {
BufferedReader br = new BufferedReader( new FileReader(fileName));
while( (line = br.readLine()) != null)
{
lineNumber++; ... |
dc0a9302-5d71-496c-aa23-b29823d55e6d | 3 | public void loadImage() {
if (file == null) {
thumbnail = null;
return;
}
//Don't use createImageIcon (which is a wrapper for getResource)
//because the image we're trying to load is probably not one
//of this program's own resources.
ImageIcon tm... |
58464298-d4c9-4c76-ad48-90ffd67e887e | 6 | public static Object cast(String value, int type) {
if ((type == TYPE_INTEGER) || (type == TYPE_INTEGER_WRAPPER)) {
return Integer.parseInt(value);
}
if ((type == TYPE_LONG) || (type == TYPE_LONG_WRAPPER)) {
return Long.parseLong(value);
}
if ((type == TYP... |
0414c58f-6bb1-4655-bf10-ef3e0b77f7bf | 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... |
1b680fe7-f1f9-423a-a8fe-fa2ff6bb3408 | 5 | public ResultSet executerRequeteSelect(Object... params) throws SQLException, IllegalStateException {
// Vérification de l'existence de la connexion.
if (this.conn == null) {
fermerConnexion();
throw new IllegalStateException("Impossible d'exécuter la requête car la connexion à la base de données n'a pas é... |
1bb78cdd-877f-46b8-90c6-8c1bb6f9db10 | 7 | public static int findNumCommentsMentionedUsabilityTestings(String content) {
if (content != null && !content.equals(""))
if (content.contains("Usability Testing")
|| content.contains("usability testing")
|| content.contains("ui testing")
|| content.contains("User Testing")
|| content.contains(... |
008b440d-8688-4573-b4af-463f8b6bd8da | 0 | @Override
public void mousePressed(MouseEvent e) {} |
eec03204-5359-4186-87c3-3918fd9b9da3 | 6 | public static void main(String[] args) {
try {
if (args.length != 1 || StringUtils.isEmpty(args[0])) {
System.err.println("RubyExecMain take only one parameter : a ruby script to run");
System.exit(1);
}
final File rubyScript = new File(args[0]... |
a7a1e010-de7c-4f83-a407-1203d5a99f5e | 8 | @Override
public void moveRight () {
if (!checkMove ()) {
return;
}
score--;
final GameControllerEvent event = createEvent (RIGHT_MOVE);
final Cell before = map.findRobot ();
if (before.x < map.getWidth ()) {
final Cell after = before.right ();
final Ab... |
b3d01c2c-abc9-496c-9394-d517a1727458 | 3 | public void setWindowOpaque(Window window, boolean isOpaque) {
// prevent setting if not supported
if(!isTranslucencyCapable(window.getGraphicsConfiguration()) ||
!isTranslucencySupported(Translucency.PERPIXEL_TRANSLUCENT, window.getGraphicsConfiguration().getDevice())) {
return;
}
final Color background... |
5a1e3dab-dc22-42c3-8dd4-892d6f056b20 | 1 | @Override
public long spawnBoss(String bossData) {
super.spawnBoss(bossData);
GameActor a = Application.get().getLogic().createActor(bossData);
PhysicsComponent pc = (PhysicsComponent)a.getComponent("PhysicsComponent");
pc.setLocation(x + 100, y - 200);
pc.setAngleRad(MathUti... |
dd8b0fd4-67bf-46e4-a289-fecd5ce6754e | 5 | public CheckResultMessage check6(int day) {
int r1 = get(2, 5);
int c1 = get(3, 5);
int r2 = get(17, 5);
int c2 = get(18, 5);
int r3 = get(27, 5);
int c3 = get(28, 5);
BigDecimal b = new BigDecimal(0);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = ... |
83d5da36-b69d-4846-b9c5-b63c6747f1f3 | 0 | @Test
public void hello() {
} |
50d867cb-61ad-419e-819f-3ed47a71f74e | 2 | private void loadInitialData(){
Server s = new Server(currentUser.getIP(), currentUser.getPORT(), currentUser.getName());
s.execute();
UsersList users = GetUsers.getRegisteredUsers();
for (User usr : users.users) {
System.out.println("Main " + usr.getIP() + " " + ... |
ad557391-4f31-4f17-87cc-54ada4113222 | 8 | public void setForegroundCorpus(Documents docs) {
Counter scores = new Counter();
termScore = new HashMap<String, Double>();
Set<String> stopwords = new HashSet<String>();
FileReader fr;
try {
fr = new FileReader("stopwords.txt");
BufferedReader br = new Buffered... |
05537502-98fd-45b9-b533-8783f8626ce9 | 2 | public void doExperiment()
{
float avg_coefficient = 0;
for(Node n : graph.getNodes())
{
int en = getNeighboursNumberConnection(n);
int kn = n.getToNode().size();
if(kn > 1)
{
float result = (float)en/(kn*(kn-1));
n.setCoeffcient(result);
avg_coefficient += result;
}
}
avg_coe... |
a90d3766-41ef-4465-9f70-a2fd0429b163 | 9 | public static int Fase( int i, int ant, int ant2 ) {
if ( i == tam ) {
return 1;
}
int max = 0;
for ( int j = 0; j < 3; j++ ) {
if ( ant == 2 && j != ant2 && j != 2 ) {
max += Fase( i + 1, j, ant );
}
if ( ant != 2 && j != ant ) {
max += Fase( i + 1, j, ant );
}
if ( ant != 2 && i + 1 ... |
0f0d6fe0-9beb-4288-9762-d76eca2df16c | 7 | public EvaluationResult evaluate(List inputs, EvaluationCtx context) {
// Evaluate the arguments one by one. As soon as we can
// return a result, do so. Return Indeterminate if any argument
// evaluated is indeterminate.
Iterator it = inputs.iterator();
while (it.hasNext()) {
... |
a18c1d0f-ca9f-4a0a-ae15-5ea607eb7ff4 | 1 | public void resetWallDecoration(int y, int z, int x) {
GroundTile groundTile = groundTiles[z][x][y];
if (groundTile != null) {
groundTile.wallDecoration = null;
}
} |
1bc43ec5-87d5-4959-b281-c6d486f8527b | 0 | @Override
public List<String> getInheritence() {
return inheritence;
} |
fcb5f435-fe7e-48cd-a4b8-f439c80a14fb | 0 | @Override
public String toString() {
return null;
} |
616cea75-bd98-4f64-acc0-011ee4c295b6 | 6 | public String toJSON()
{
Map<String,Object> parameters = new LinkedHashMap<String,Object>();
parameters.put("id",Integer.valueOf(getId()));
if (GoCoin.hasValue(getName()))
{
parameters.put("name",getName());
}
if (GoCoin.hasValue(getUid()))
{
parameters.put("uid",getUid());
... |
5a0a39c7-6621-4fe8-b4e1-e2b89ec09406 | 5 | public void execute(final Event event) {
try {
if (ignore && event.isCancelled()) { // Dont pass events that are cancelled if you ignore them
return;
}
method.invoke(listener, event);
} catch (final IllegalAccessException e) {
e.printStackTrace();
} catch (final IllegalArgumentExcept... |
85b5aa57-ce5b-4685-ab65-71ff6c5f632d | 9 | public final List<AttributeGroup> getAttributeGroups() {
if(_attributeGroups == null) {
List<AttributeGroup> directAttributeGroups = getDirectAttributeGroups();
List<AttributeGroup> attributeGroups = new ArrayList<AttributeGroup>();
attributeGroups.addAll(directAttributeGroups);
List list = getSuperTypes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.