method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3139dd0f-7eda-4bdd-93bc-e0b4e7f423c4 | 9 | private void drawShape(Shape shape, BasicGraphicalElement element, Color backupColor) {
GraphicAttributes attributes = element.getGraphicAttributes();
Color fillColor = null;
if (element.isClosed() && attributes instanceof FillAttributes) {
fillColor = ((FillAttributes) attributes).getFillColor();
}
if (fi... |
d57ebb38-bca9-43e5-9757-de286add963f | 1 | private static int sommeInt(HashMap<VoieEnum, AtomicInteger> map) {
int somme = 0;
for (AtomicInteger value : map.values()) {
somme = somme + value.get();
}
return somme;
} |
7d2bb06f-0911-4d2c-9797-8e140ae2cd21 | 4 | public boolean contact(Connector c2) {
Component e = c2.getParent();
int x = e.getX() - e.getHeight() / 4;
int y = e.getY() - e.getHeight() / 4;
int width = e.getWidth() + e.getHeight() / 2;
int height = e.getHeight() + e.getHeight() / 2;
Point p1 = new Point(x, y);
Point p2 = new Point(x + width, y);
P... |
52f29f04-6756-4499-a400-a05555cbb50d | 8 | public Dimension getSizeForImageManipulation(ImageMetadata imageMetadata, RequestData requestData) {
Dimension d = new Dimension();
Dimension regionSize = getRegionCoordinates(requestData, imageMetadata).getSize();
log.debug("getSizeForImageManipulation - passed");
i... |
afbd57d4-2115-4bdb-be03-22af28c35084 | 8 | public static void main(String[] args) throws FileNotFoundException, ExecutionException, InterruptedException, IOException {
int NT = Integer.parseInt(args[0]);
String inputFile = args[1];
String outputFile = args[2];
InputReader in = new InputReader(inputFile);
String fr... |
65c98c11-5cdb-4107-b187-c77fc07b847d | 2 | public void removeProvinceFromCache(String worldName, int chunkX, int chunkZ) {
String together = worldName + "+" + chunkX + "+" + chunkZ;
if (provinceLocCache.containsKey(together)) {
int id = provinceLocCache.get(together);
plugin.info("Removing provinceLocCache: " + together + " = " + id);
if (provinc... |
7c7e7c6b-e131-4742-b13a-ad8b75c51ed4 | 9 | private void loadAssetFileAsZIP() {
renderEngine.logger.info("ASSETS LOADER : Extracting game assets...");
ArrayList<String[]> var = ZipUtilities.getFiles(assetFile.toString());
ArrayList<String> list = new ArrayList<String>();
ArrayList<File> list1 = new ArrayList<File>();
for (... |
4a4f8a10-2151-4964-8e0c-b059c12b99d6 | 4 | protected void initEditDebateComponents() {
createDebateJfme = new JFrame();
createDebateJpel = new JPanel();
createDebateJfme.add(createDebateJpel);
titleCDJlbl = new JLabel("Title:");
titleCDJlbl.setFont(new Font("Tahoma", 1, 16));
maxTurnsCDJlbl = new JLabel("Max Turns");
maxTurnsCDJlbl.setFont(new Fon... |
9098a15d-54d9-4cec-bb3d-5358089397b8 | 2 | public void setPlayerStatus(PlayerStatus playerStatus) {
if (playerStatus == null)
throw new IllegalArgumentException("The given PlayerStatus is invalid!");
if (this.playerStatus != playerStatus) {
this.playerStatus = playerStatus;
getGrid().getEventManager().sendEvent(new Event(EventType.PLAYER_STATUS_... |
8870c73a-b9e5-4db8-b56e-d362479fc69b | 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... |
0c0f5768-a932-4793-bd79-46b2d57a229a | 5 | private static void parseInterClusterProbabilities(final Map<String, String> args,
final CommandLineArguments result) throws ParseException
{
int k = result.cl_sizes.size();
if (args.containsKey("p_out"))
{
double p_out;
try
{
p_out = new Double(args.get("p_out"));
}
catch (final NumberForma... |
3ecc5ccd-f7bb-4ee5-a6c9-14cce13c09e2 | 1 | public void atualizar(FonteFinanciamento fontefinanciamento) throws Exception
{
String sql = "UPDATE fontefinanciamento SET nome = ? WHERE id = ?" ;
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setString(1, fontefinanciamento.getNome());
stmt.setLong(2... |
b235bbf6-5fdd-4baa-afc6-b9cf631f526b | 2 | protected Option[] loadOptions(int x, int y, String... optionTitles) {
Option[] optionPage = new Option[optionTitles.length];
for(int i = 0; i < optionTitles.length; i++) {
if(i == 0) {
optionPage[i] = new Option(optionTitles[i], x, y, true);
} else {
... |
56d59a54-67bd-4e06-8ca6-f93f2450eabd | 4 | public void put(int key, int value) {
HashPrinter.tryPut(key, value);
/** Index that moves through array slots */
int runner = 0;
int hash = (key % TABLE_INITIAL_SIZE);
if (table[hash] == null) {
table[hash] = new Node(key, value);
HashPrinter.successfulInsertion(key, hash);
} else {
/** Col... |
8a9322a8-ea62-4531-bb35-a88e0d88eb1a | 7 | @Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(mob.isInCombat())
return Ability.QUALITY_INDIFFERENT;
if(!(target instanceof MOB))
return Ability.QUALITY_INDIFFERENT;
if((((MOB)target).amDead())||(!CMLib.flags().canBeSeenBy(target,mob)))
return Ability.QUALI... |
e89192fd-7761-4714-9894-e6ed3f1c5a83 | 0 | public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
} |
db2f2819-e6df-4e45-85e6-56b28cab2e11 | 6 | private void initializeButtons() {
for (int i = 0; i < maxPartySize; i++) {
//partyList.add(new Textbox("Hire Party Member\nCost: " + partyMemberCost, initialPartyVSpacer, initialPartyVSpacer + (i * partyVSpacer) + (i * partyTHeight), partyTWidth, partyTHeight, IntroSequence.input));
partyButtons.add(new Button... |
7e916336-c1f4-4036-bcc3-d7c17760aac3 | 4 | @Override
public void deserialize(Buffer buf) {
questId = buf.readUShort();
if (questId < 0 || questId > 65535)
throw new RuntimeException("Forbidden value on questId = " + questId + ", it doesn't respect the following condition : questId < 0 || questId > 65535");
objectiveId = b... |
13f8050b-d857-4cf5-9e98-69d572aac5df | 6 | public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... |
cae2f4eb-9c98-477b-b9c7-afdd0c3a825c | 9 | public static Project getProjectFromURL(String url) {
Project project = new Project();
project.setUrl(url);
System.out.println("------" + url);
Document doc;
try {
doc = Jsoup.connect(url).get();
Elements backersElements = doc.select("div#backers_count");
String totalBackers = backersElements.get(0).... |
b9024ff6-a07e-4378-81c5-b5f387518825 | 4 | public void setMatrix(String values) {
String number = "";
int row = 0;
int column = 0;
for (int i = 0; i < values.length(); i++) {
if (values.charAt(i) == ',') {
setElement(row, column, Integer.parseInt(number));
column++;
numb... |
f873e449-8fe1-4692-976c-1c25b252bc11 | 1 | public Object getBounds() {
if (bounds == null) {
bounds = computeBounds();
}
return bounds;
} |
e4fc54c6-c34d-4bbe-9d80-8c795fd36ded | 8 | private void handleCollisions()
{
// Anything that is destroyed should be erased, so get ready
// to erase stuff
Graphics g = playArea.getGraphics();
g.setColor(Color.BLACK);
// Deal with shots blowing up comets
for(int i = 0; i < shots.size(); i++)
{
Shot s = shots.elementAt(i);
for(int j = 0; ... |
298880fc-b867-4d74-9907-10f89e822d1c | 0 | public Collection<String> getStations() {
return new ArrayList<String>(stations);
} |
d1eec7a6-4f93-4ac3-ba92-78d97cf009cc | 1 | public static void main(String[] args) throws IOException {
StaticDynamicUncertaintyULHSolver solverWithoutADI = new StaticDynamicUncertaintyULHSolver();
StaticDynamicUncertaintyWithADIULHSolver solverWithADI = new StaticDynamicUncertaintyWithADIULHSolver();
ConstantNormalDistributedProblemGenerator problemGenera... |
2a74299d-3d54-4abe-8e80-d5b51956b9de | 5 | public Object getFieldValue(_Fields field) {
switch (field) {
case FIRST_NAME:
return getFirstName();
case LAST_NAME:
return getLastName();
case STATUS:
return getStatus();
case ID:
return Integer.valueOf(getId());
case EMAIL:
return getEmail();
}
throw... |
24e69adf-174c-44d3-8e71-81c80297a0a5 | 1 | public double evaluate_double(Object[] dl) throws Throwable {
if (Debug.enabled)
Debug.println("Wrong evaluateXXXX() method called,"+
" check value of getType().");
return 0.0D;
}; |
8d8fea91-e46f-4983-8932-c6ffb889ddde | 0 | @Test(expected = NullPointerException.class)
public void findBestDistanceNullException(){
assertEquals(Quantity.best(null), new ArithmeticQuantity(4, Distance.YARDS));
} |
a1966eb3-744d-4396-8696-89823df9d637 | 8 | protected int processPuzzle(int f,int e)
{
if(f==0||f==1)
return f;
if(e==1)
{
return f;
}
int attemptsReqdBrk,attemptsReqdDBrk,res;
int min=Integer.MAX_VALUE;
if(e>1)
{
for(int i=1;i<=f;i++)
{
// egg breaks
if(!cache.containsKey(f+","+e))
{
attemptsReqdBrk=1+processPuzzl... |
af7f29fd-323d-4ece-a367-f5cb51d58e48 | 4 | public void zoomOut(){
if(utmWidth >= 364790 || utmHeight >= 269423) { //You can't zoom more out than this
//If the upper left corner is not in the right position, reset the map
if(upperLeftX != 434168 && upperLeftY != 6412239) {
resetMap();
}
return;
}
zoom(upperLeftX-(utmWidth*0.1), upperLeftY... |
3723955b-0486-4615-80ad-9420149f4b4b | 7 | public GameBoard()
{
addKeyListener(new TAdapter());
setFocusable(true);
setBackground(Color.BLACK);
setDoubleBuffered(true);
//---Create the elements on the board---//
// Put walls along the boundary
for (int i = 0; i < BOARD_WIDTH; i += BLOCK_WIDTH){ //Top Row
wallL... |
89614395-fbf9-4532-ad57-ebc4952c23d7 | 7 | public void LoadConfig(FileConfiguration config) {
config.options().copyDefaults(true);
plugin.DebugEnabled = Config().getBoolean("debug", false);
plugin.USDateFormat = Config().getBoolean("us-date-format", false);
plugin.JoinMessage = Config().getString("messages.join");
plugin.AnnounceMessage = Config().ge... |
2e63f271-7f5a-46f1-881b-6f6af5c8878f | 9 | public int parseLine(String line) {
setEFileVersionNumber("1.7");
checkMinimumLength(line);
if (line.length() > 2)
setDetailRecId(line.substring(0,2));
// if these remain null this will cause problems in PicCodeParserManifestV17
setOverlabelIndicator("");
setOverlabelBarcodeConstructCode("");
setO... |
af50a083-ff07-4fd7-a74d-8870db04eee3 | 9 | private static String parseString(ListIterator<Character> chars) {
StringBuilder ret = new StringBuilder();
boolean isControlled = false;
int hexValue = 0;
int hexChar = -1;
while (chars.hasNext()) {
char cur = chars.next();
if (hexChar >= 0) {
try {
hexValue <<= 4;
hexValue |= Integer.par... |
65547bb2-6005-4a97-bfb4-b16d034faaf1 | 7 | public int circularHead(Node node)
{
if(node == null)
return -1;
else
{
Node slow = node;
Node fast = node;
while(fast.next != null)
{
slow = slow.next;
if(fast.next.next == null)
{
return -1;
}
else
{
fast = fast.next.next;
}
if(slow == fast)
... |
73f792de-6cae-4ee6-b249-f6b744a6e914 | 6 | protected void UpdateLineColumn(char c)
{
column++;
if (prevCharIsLF)
{
prevCharIsLF = false;
line += (column = 1);
}
else if (prevCharIsCR)
{
prevCharIsCR = false;
if (c == '\n')
{
prevCharIsLF = true;
}
else
line += (column = 1);
... |
0ae169d1-6eea-4d67-b38b-6ba4c0043ad7 | 8 | private void btnConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmarActionPerformed
if(tbxPasswordActual.getPassword().length != 0 && tbxPasswordNuevo.getPassword().length != 0
&& tbxPasswordNuevoRepetido.getPassword().length != 0){
try {
... |
11908066-6a7d-49ca-a6f7-cd7c440551e8 | 1 | public List<Double> getRHList() {
List<Double> result= new ArrayList<Double>();
double[] values= this.getRHArray();
for (int i= 0; i< values.length; ++i) {
result.add(Double.valueOf(values[i]));
}
return result;
} |
9343db07-682c-44a6-8ef0-6733d1f1fc48 | 4 | public static List<String> expandWithThesaurusBroader1(String node)
throws JSONException {
HashMap<String, List<String>> result = new HashMap();
List<String> resultsList = new ArrayList<String>();
List<String> expandedNodes = new ArrayList<String>();
List<String> expandedTerms = new ArrayList<String>();
L... |
3c43867b-07ed-4590-b9ef-810c7b68b98b | 7 | private static String js_substr(String target, Object[] args) {
if (args.length < 1)
return target;
double begin = ScriptRuntime.toInteger(args[0]);
double end;
int length = target.length();
if (begin < 0) {
begin += length;
if (begin < 0)
... |
13734f46-9cbd-4d49-83a8-42dc00ca525b | 0 | public float getPrix() {
return prix;
} |
7688a774-72c6-4b7c-ab0f-1c61409ad188 | 4 | public void writeHistory(DataOutput output) {
try {
output.writeInt(VERSION);
int comboCount = directoryCombo.getItemCount();
Vector strings = new Vector();
for (int i = 0; i < comboCount; ++i) {
String next = (String) directoryCombo.getItemAt(i);
... |
1788c101-88ca-494a-bcfb-6da76a72d50c | 3 | private Program generateOffspring() {
List<Program> crossoverParents = selectionCrossoverOp.select(population, 2);
Program offspring = null;
try {
if(crossoverParents != null && crossoverParents.size() > 1) {
offspring = crossoverOp.generateOffspring(crossoverParents.get(0), crossoverParents.get(1));
o... |
6523bcd3-9c25-4687-976d-49941cfc4413 | 8 | public void fxpDirectory(FTPConnection destination, FTPFile srcDir,
FTPFile dstDir) throws IOException, FtpWorkflowException,
FtpIOException {
if (!srcDir.isDirectory())
throw new FtpFileNotFoundException("Downloading: "
+ srcDir.getName()
... |
9bc7ac88-64ca-4190-b99d-612ec14b54ac | 8 | public void createBlocks() {
// We get the target and put it last to guarantee it will always be on top
Entity target = entities.pop();
Entity temp;
for (int i = 1; i < 9; i++) {
temp = new Entity(new Vector2(i, 2.5f),textures.get(3));
temp.setObjectID(Entity.ObjectIDType.BLOCK);
... |
64e08d29-6a1c-4a5f-9ee8-b35dd9b042e9 | 3 | private void btnApagarPagamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApagarPagamentoActionPerformed
try {
if (JOptionPane.showConfirmDialog(rootPane, "Deseja realmente apagar esta forma de pagamento?") == 0) {
carregaObjeto();
... |
ddf03958-bcc9-4d70-b04e-ec89a81bbdd7 | 0 | public void mousePressed(MouseEvent e) {} |
9694a9d8-be5b-4532-830a-99c2de02125e | 1 | public void testEra() {
assertEquals(1, BuddhistChronology.BE);
try {
new DateTime(-1, 13, 5, 0, 0, 0, 0, BUDDHIST_UTC);
fail();
} catch (IllegalArgumentException ex) {}
} |
332cc95d-7a07-4f0b-9540-709f0d7da0cb | 1 | private int getMachineIndexBySelectedRow(JTable table){
InputTableModel model = (InputTableModel) table.getModel();
int row = table.getSelectedRow();
if(row < 0) return -1;
String machineFileName = (String)model.getValueAt(row, 0);
return getMachineIndexByName(machineFileName);
} |
27e94657-4d9d-4dde-bc37-809b6df96a1c | 1 | private void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 16; i-- > 0;)
jjrounds[i] = 0x80000000;
} |
f7c371ac-9cbe-4321-9d50-1f02eb353fa0 | 9 | public static void mergeQuestion() {
int arrlen = 3;
int [] arra = new int[arrlen * 2];
int [] arrb = new int[arrlen];
int [] arrc = new int[arrlen * 2];
arra = ArrayUtil.getRandomIntArray(arrlen * 2, 100);
arrb = ArrayUtil.getRandomIntArray(arrlen, 100);
Arrays.sort(arra);
Arrays.sort(arrb);
... |
d333bdd1-d68d-4130-be1f-b234b44b9cfb | 8 | public void resetAP(MapleClient c, byte stat) {
MapleCharacter player = c.getPlayer();
short amount = 0;
switch (stat) {
case 1: // STR
amount = (short) (player.getStat().getStr() - 4);
if ((player.getRemainingAp() + amount) > 32767) {
... |
306aa4b5-6a0b-464b-a0e7-d00b5e34548d | 5 | @Override
public List<Event> searchEventByVenue(Venue v) {
final List<Event> ret = new ArrayList<Event>();
final String vID = v.getId();
final HashMap<String, String> params = this.createDefaultHashMap();
params.put("location", vID);
final String url = this.conn.prepareURL("events/search", params)... |
4b5a6d69-d377-4c2a-9050-2d57cd350061 | 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... |
9825e41c-652a-463b-b346-c5ecdf12eb6c | 7 | private void startTask() {
if (m_TaskRunning == false && m_TaskQueue.size() > 0) {
Thread activeTaskThread;
activeTaskThread = new Thread() {
public void run() {
m_TaskRunning = true;
Task currentTask = (Task)m_TaskQueue.pop();
String taskId = (String)m_TaskIdQueue.pop();
TaskSta... |
9edf2367-5451-4319-8dd1-d14b6af4b90b | 1 | public void startServer() {
System.out.println("Starting server...");
try {
server.startServer(9876);
System.out.println("Server started!");
} catch (CouldNotStartServerException e) {
System.out.println("Server could not be started: " + e.getMessage());
}
} |
1bf71410-cdf3-40f2-bbec-1dcd4803c309 | 9 | public boolean equals(Object other) {
if (this == other)
return true;
if (other == null)
return false;
if (!BoardType.class.isAssignableFrom(other.getClass()))
return false;
Board board = (Board) other;
if (!this.getShiftCard().equals(board.getShiftCard())
|| !this.getTreasure().equals(board.ge... |
1aa574c3-7057-4ad8-b51e-1b5e508503b8 | 9 | private void parseEntityValue(ReplacementTextBuffer value) throws IOException {
final Token t = new Token();
for (;;) {
int tok;
for (;;) {
try {
tok = Tokenizer.tokenizeEntityValue(buf, bufStart, bufEnd, t);
currentTokenStart = bufStart;
bufStart = t.getTokenEnd();
break;
}
catch (Em... |
0ec341e7-4b4e-45b2-ba54-d8e760a61deb | 7 | protected final void raiseEvent(Event event) {
if (event == null)
return;
Class<?> eventClass = event.getClass();
while (Event.class.isAssignableFrom(eventClass)) {
fireEvent(eventClass, event);
Class<?>[] interfaces = eventClass.getInterfaces();
for (Class<?> i : interfaces) {
if (Event.c... |
359615aa-9fff-4a14-a824-cecdb8d6d10d | 8 | public static String getPermutation(int n, int k) {
int[] factorial = new int[n + 1];
for (int i = 0; i < n + 1; i++) {
if (1 < i) factorial[i] = factorial[i - 1] * i;
else factorial[i] = 1;
}
List<Integer> alpha = new ArrayList<Integer>();
for (int i = 1; i < n... |
1ab9052d-778c-4445-8bde-21969ca5ea5e | 9 | protected static Ptg calcCoupDayBS( Ptg[] operands )
{
if( operands.length < 2 )
{
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "COUPDAYSBS" );
try
{
GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].getValue() );
GregorianCalenda... |
110a99f4-5c9c-409d-bf20-a8aee3657bc8 | 1 | private boolean jj_3_74() {
if (jj_scan_token(ANDAND)) return true;
return false;
} |
71bdefb0-8dd2-49e1-aa74-0cea2e28278d | 8 | private void cftrec4_th(final int n, final float[] a, final int offa, final int nw, final float[] w) {
int i;
int idiv4, m, nthreads;
int idx = 0;
nthreads = 2;
idiv4 = 0;
m = n >> 1;
if (n > ConcurrencyUtils.getThreadsBeginN_1D_FFT_4Threads()) {
nthre... |
948ec5d7-219c-40c2-9efa-b2cfc2c1cecf | 1 | public boolean canDo(char symbol) {
if (symbol == ' ') return true;
return false;
} |
d8730391-498e-4e82-907e-f9e5c4fa925a | 7 | private void computeLater(final ExprInfo exprInfo) {
Iterator blocks = cfg.nodes().iterator();
while (blocks.hasNext()) {
final Block block = (Block) blocks.next();
final Phi phi = exprInfo.exprPhiAtBlock(block);
if (phi != null) {
phi.setLater(phi.canBeAvail());
}
}
blocks = cfg.nodes().ite... |
8c8cf001-a7b7-4be7-bd1a-8287c757f62a | 6 | private void convert(int slot) {
readerGen[slot] = currentReaderGen;
int index = 0;
String value = values[slot];
if (value == null) {
ords[slot] = 0;
return;
}
if (sortPos == 0 && bottomSlot != -1 && bottomSlot != slot) {
// Since we are the primary sort, the... |
9cd76902-950b-46a1-ae5d-5aa66aea464d | 3 | public Map<String, Object> getValues(boolean deep) {
Map<String, Object> result = new LinkedHashMap<String, Object>();
Configuration root = getRoot();
if (root != null && root.options().copyDefaults()) {
ConfigurationSection defaults = getDefaultSection();
if (defaults ... |
c388987a-2d80-4246-bbc6-09d5f0b7766d | 7 | private String setHeader (String key, int datalen, Map header) {
String info = separator + key;
if (header != null && header.containsKey("dtime")) {
info += separator + "dtime=" + header.get("dtime");
header.remove("dtime");
} else {
info += separator + "dtim... |
9d868b97-f1a8-4a2c-9439-e2b7dda541f4 | 2 | private Expression orStatement( List<Expression> args, String caller ) {
// return the first non-false value
for( int i = 0; i < args.size(); ++i ) {
if ( args.get(i).show(defSubst, caller).compareTo("#f") != 0 ) {
return args.get(i).eval(defSubst, caller);
}
}
... |
57571d45-95c1-44f3-9ef3-9ee911976816 | 0 | public boolean checkVersion() {
String curVersion = this.plugin.getDescription().getVersion();
String file = (String) this.latest.get(this.DL_NAME);
String last = file.substring(file.lastIndexOf("-"), file.length());
return !newVersion(curVersion, last);
} |
ad71dc05-a7dc-4bc4-bb39-43449326e533 | 0 | public void setAge(int age) {
this.age = age;
} |
7ca43111-bb20-4519-93f1-8cd0fa7b9189 | 0 | public void setTipo(String tipo) {
this.tipo = tipo;
} |
1a0d6874-0db9-45f5-9373-93e4b0ee741d | 2 | private void movePaddle(MouseEvent e) {
int x = 0;
boolean movementOver = false;
while (x++ < WIDTH && !movementOver) {
//x++ is limiting counter
movementOver = paddleCtrl.movePaddle(e.getX());
}
} |
cc106cc7-d425-4d74-9480-0dbc0b2ed956 | 2 | public void visitAttribute(final Attribute attr) {
buf.setLength(0);
buf.append(tab).append("ATTRIBUTE ");
appendDescriptor(-1, attr.type);
if (attr instanceof Traceable) {
((Traceable) attr).trace(buf, labelNames);
} else {
buf.append(" : unknown\n");
... |
2a710a4d-3c40-4407-ab08-aeb07c9b89a5 | 5 | public void updateAuctionList() {
new Thread() {
@Override
public void run() {
if (userId != null && userProfile != null) {
synchronized (activeRequest) {
activeRequest.setSenderId(userId);
activeRequest.setSessionToken(userProfile.getSessionToken());
boolean success = Comms.se... |
a3732c83-2de0-46da-a7c0-e0392a836351 | 3 | private void mouseKeyStatus(MouseEvent e, boolean status) {
if (e.getButton() == MouseEvent.BUTTON1) {
mouseState[0] = status;
} else if (e.getButton() == MouseEvent.BUTTON2) {
mouseState[1] = status;
} else if (e.getButton() == MouseEvent.BUTTON3) {
mouseStat... |
69809f9e-f846-4ef8-81f7-aedee95ac926 | 4 | public static URL baseUrlOfClass(Class<?> clazz) {
try {
String name = clazz.getName();
URL url = clazz.getResource("/" + name.replace('.', '/') + ".class");
int curPos = 0;
do {
curPos = name.indexOf('.', curPos + 1);
if (curPos >=... |
613ee015-57fe-49d9-9bfd-18a94552d885 | 1 | private static URL __getWsdlLocation() {
if (AQACQUISITIONSERVICE_EXCEPTION!= null) {
throw AQACQUISITIONSERVICE_EXCEPTION;
}
return AQACQUISITIONSERVICE_WSDL_LOCATION;
} |
cb27261f-2c18-41b6-9fdd-62b1956a7acf | 1 | private static int booleanString(boolean b){
if(b){
return 1;
}
else{
return 0;
}
} |
0471b87c-fde8-484d-b280-57f2ad0fb1dd | 9 | public final ControlFlow.lvalue_return lvalue(String funcName) throws RecognitionException {
ControlFlow.lvalue_return retval = new ControlFlow.lvalue_return();
retval.start = input.LT(1);
CommonTree id=null;
TreeRuleReturnScope r1 =null;
try {
// C:\\eclipse-workspaces\\workspace1\\Compiler\\src\\edu\\c... |
e6e04eb4-99b2-4f45-9e53-a58fc3eb835c | 2 | public Dimension getPreferredSize()
{
int maxx = MIN_SIZE;
int maxy = MIN_SIZE;
if (background != null)
{
maxx = Math.max(maxx, background.getWidth());
maxy = Math.max(maxx, background.getHeight());
}
for (Sh... |
5b15d5ba-d2a1-4110-a8c3-8adf6954327d | 6 | private Element requestLaunch(Connection connection, Element element) {
FreeColServer freeColServer = getFreeColServer();
// Check if launching player is an admin.
ServerPlayer launchingPlayer = freeColServer.getPlayer(connection);
if (!launchingPlayer.isAdmin()) {
return DO... |
39273bb8-ee2e-445c-b809-d51f4d1969a5 | 9 | void drawHLine(int argb, boolean tScreened, int x, int y, int z, int w) {
// hover, labels only
int width = g3d.width;
if (w < 0) {
x += w;
w = -w;
}
int[] pbuf = g3d.pbuf;
int[] zbuf = g3d.zbuf;
if (x < 0) {
w += x;
x = 0;
}
if (x + w >= width) {
w = wi... |
469074fd-b5b6-4c5c-b57c-7b8763c34d5a | 7 | public final void and_expr() throws RecognitionException {
try {
// Python.g:324:10: ( shift_expr ( AMPER shift_expr )* )
// Python.g:324:12: shift_expr ( AMPER shift_expr )*
{
pushFollow(FOLLOW_shift_expr_in_and_expr2657);
shift_expr();
state._fsp--;
if (state.failed) return;
// Python.g:324:... |
456117b1-6650-4914-a4a1-36f53c52ee86 | 9 | public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(args[0]));
String l;
while ((l = br.readLine()) != null) {
String[] a = l.split("\\ ");
LinkedList<String> s = new LinkedList<String>();
int c = 0;
double x, y;
String o;
for... |
7fc07d09-80aa-4fde-863b-ee9fe84801ae | 5 | public void sortByValue() {
ArrayList<Card> newHand = new ArrayList<Card>();
while( hand.size() > 0 ) {
int pos = 0;
Card c = hand.get(0);
for (int i = 1; i < hand.size(); i++) {
Card c1 = hand.get(i);
if ( c1.getValue() < c.getValue() ||
(c1.getValue() == c.getValue() && c1.getSuit() < c.get... |
def12eb3-1612-4b88-b806-ada7eef2959f | 5 | public void ge_main_process(TextArea area,SimpleNode node)throws SemanticErr{
int i=0;
for (i = 0; i < gt.symbol_table.symbol_name.size(); i++) {
String symbol = gt.symbol_table.symbol_type.get(i).toString();
if(symbol.equals("VARIABLE_NAME")){
break;
... |
77e941c7-7d41-4d16-a1ab-1475cf73028a | 8 | public boolean isCollision(Sprite s1, Sprite s2) {
// if the Sprites are the same, return false
if (s1 == s2) {
return false;
}
// if one of the Sprites is a dead Creature, return false
if (s1 instanceof Creature && !((Creature)s1).isAlive()) {
return fal... |
d43e9b98-0f4e-4af5-86f6-c61184f36da1 | 5 | public Binding<Boolean> inbound(Binding<String> fromBinding) {
Binding<Boolean> toBinding = new Binding<Boolean>(Boolean.class, null);
if (fromBinding == null || fromBinding.getObj() == null) {
return toBinding;
}
String fromStr = fromBinding.getObj().toString();
if (... |
a7485e3c-5284-4f69-8569-6a7eaeda1ef3 | 8 | static boolean function(String st){
char cerrado = '\0', abierto = '\0';
if(st.length()==0)return true;
if(st.charAt(0) == '('){
cerrado = ')';
abierto = '(';
}
else{
cerrado = ']';
abierto = '[';
}
int nAbiertos = 1;
for (int i = 1; i < st.length() && nAbiertos > 0; i++){
if(st.charA... |
ffc01da1-392d-4c38-8fd1-ebc7e0208c58 | 4 | public CanvasExtended(String ownerName) {
super(SimpleUniverse.getPreferredConfiguration());
setDoubleBufferEnable(true);
// Create a universe
universeProxyServer = Client.getSharedUniverse(App.SERVER_NAME, "1234",
"Pluton");
universe = new CSharedUniverse(universeProxyServer, this);
// Load a vrml mo... |
6ca1f3e1-232c-44b9-bb76-bcdef569a509 | 0 | public XMLGregorianCalendar getExpiryDate() {
return expiryDate;
} |
000485e6-8d97-4e5f-8466-794cc5ac3279 | 9 | static void draw_sprites(osd_bitmap bitmap,int pri)
{
int offs,fx,fy,x,y,color,sprite;
if (sprite_enable==0) return;
for (offs = 0x1000-8;offs >= 0;offs -= 8)
{
/* Don't draw empty sprite table entries */
if (buffered_spriteram.read(offs+7)!=0xf) continue;
if (buffered_spriteram.read(offs+0)==0xf0... |
66aa9e26-4d33-4b69-be28-eb71e1213991 | 7 | public static String getRelativePath(final String parentPath, final String absolutePath) {
if (parentPath == null || absolutePath == null
|| (parentPath.length() > absolutePath.length())) {
return null;
}
String relativePath = null;
final File absoluteFile = ... |
4311d2f1-a4a1-48fd-bb4a-d6d94c308876 | 7 | public void renderTile(int xp, int yp, Tile tile) {
xp -= xOffset;
yp -= yOffset;
for (int y = 0; y < tile.sprite.SIZE; y++) {
int ya = y + yp;
for (int x = 0; x < tile.sprite.SIZE; x++) {
int xa = x + xp;
if (xa < -tile.sprite.SIZE || xa >= width || ya < 0 || ya >= height) break;
if (xa < 0) x... |
9e6c94e4-f99a-4691-9d07-875500e82665 | 1 | private static int checkFormalTypeParameters(final String signature, int pos) {
// FormalTypeParameters:
// < FormalTypeParameter+ >
pos = checkChar('<', signature, pos);
pos = checkFormalTypeParameter(signature, pos);
while (getChar(signature, pos) != '>') {
pos = checkFormalTypeParameter(signature, pos)... |
23854fb8-9bc7-4d83-b665-5b4abd49b27e | 9 | public PairingsGUI(int round, ArrayList<Match> matches,Player pbye){
this.matches = matches;
this.nextTitle = ("Round " + round + " Standings");
seats.add(table1_seat1);
seats.add(table1_seat2);
seats.add(table2_seat1);
seats.add(table2_seat2);
seats.add(table3_seat1);
seats.add(table3_seat2);
seat... |
047d136a-e22a-4ca1-b97d-7bfcea99082d | 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... |
fc06769c-915c-45cc-810e-7dac18c27620 | 4 | static char convert(byte[] bytes)
{
char result = '-';
int secPosValue = 0;
int i;
for (i = 0; i < bytes.length; i++)
{
bytes[i] -= GB_SP_DIFF;
}
secPosValue = bytes[0] * 100 + bytes[1];
for (i = 0; i < 23; i++)
{
if (secPosValue >= secPosValueList[i]
&& secPosValue <... |
60ea4793-b304-4a44-8872-ac797088e4fa | 0 | @Override
public void fatalError(SAXParseException e) {
System.out.println(padding + "XML PARSER FATAL ERROR: Line: " + e.getLineNumber() + " Column: " + e.getColumnNumber());
System.out.println(padding + e.getMessage());
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.