method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
c96ee548-5071-4f3a-b016-e547e126f5e1 | 9 | @Override
public boolean onCommand(CommandSender cs, Command cmnd, String string, String[] strings) {
if(!cs.hasPermission("dynamicmarket.admin")) {
cs.sendMessage("You do not have permissions for this command");
return true;
}
if(strings.length == 0)
... |
99862ff0-f9ea-4f7b-8efb-247c2d03c8da | 1 | private static String generateResolutionTitle(PrinterResolution res) {
StringBuilder buffer = new StringBuilder();
int x = res.getCrossFeedResolution(ResolutionSyntax.DPI);
int y = res.getFeedResolution(ResolutionSyntax.DPI);
buffer.append(Integer.toString(x));
if (x != y) {
buffer.append(" x "); //$NON-N... |
40d9f2d4-d17f-41a1-8525-13e2030c7480 | 5 | @Override
public final void drawGui()
{
if (this.tick++ >= 30)
{
this.tick = 0;
if (!GuiScreen.gamQueue.isEmpty())
{
GuiScreen.gamList.add(GuiScreen.gamQueue.get(0));
GuiScreen.gamQueue.remove(0);
}
if (!GuiScreen.gsmQueue.isEmpty())
{
GuiScreen.gsmList.add(GuiScreen.gsmQueue.get(0)... |
d7f73123-ea83-4a5a-9523-c9195c380257 | 6 | public void save() {
plugin.getSave().getCustomConfig().set("lottery.jackpot", jackpotCurrent);
plugin.getSave().getCustomConfig().set("lottery.drawsSinceLastWin", drawsSinceLastWin);
if(range!=-1){
for (int i = 0; i < range; i++) {
ArrayList<String> tmp = new ArrayList<String>();
for (String p : ti... |
bacb3ec7-6d0f-4f77-91d2-99ee7b4d6051 | 7 | protected void fixFillingRoomUnlinkedExits(Room newRoom, Room R, boolean andSave)
{
boolean changed=false;
for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)
{
final Exit exit=R.getRawExit(d);
if((exit!=null)&&(exit.temporaryDoorLink().equalsIgnoreCase(newRoom.roomID())))
{
exit.setTemporaryDoorLink(... |
805bbc0c-7bb3-4022-91f9-d5389495265f | 5 | @Override
public String getColumnName(int column) {
switch (column) {
case 0:
return "Nom";
case 1:
return "Prénom";
case 2:
return "E-Mail";
case 3:
return "Contenu";
case 4:
... |
3c5ad29c-b2ad-47d6-98f7-07307103bdfa | 6 | public Object parseClass() throws ParseException, IOException {
int linenr = scanner.getLineNr();
int token = scanner.getToken();
if (token != IDENTIFIER_TOKEN)
throw new ParseException(linenr, "Class name expected");
Object instance;
try {
Class clazz = Class.forName("jode.obfuscator.modules."
+ s... |
04cbdbb7-75df-4147-9de7-10ee90da545b | 4 | public Tile(int x, int y, int lookid)
{
this.x = x;
this.y = y;
this.lookid = lookid;
if(lookid == 0) look = Texture.gras;
if(lookid == 1) look = Texture.wasser;
if(lookid == 2) look = Texture.sand;
if(lookid == 3) look = Texture.mauer;
} |
242e2368-4829-4433-84ce-56a2f7f5716f | 4 | @Override
public void update() {
if (isJumping()) {
//TODO this is fucking things up!!!
//setY(getY() - 10);
currentJumpHeight += 10;
if (currentJumpHeight > maxJumpHeight) {
currentJumpHeight = 0;
state = State.falling;
... |
3718ca96-b8ef-4688-8bf5-633e18251bda | 0 | @Override
public void documentRemoved(DocumentRepositoryEvent e) {} |
0f517a10-acb6-4e2c-a45a-11fedf7e87dd | 4 | private void recursiveFindChanged(List<ClassChangeList> changedList, Node sub, ObjectStack otherStack, ClassChangeList deletedNodes)
{
List<Node> supers = sub.getSupers();
if (supers.size() == 0)
{
// no superclasses, this is the end of a chain of deleted
// interfaces or superclasses
ClassChangeList re... |
8c358cd3-be67-4bbd-b5f2-02320d0bc13f | 9 | private boolean expression_sempred(ExpressionContext _localctx, int predIndex) {
switch (predIndex) {
case 3: return 9 >= _localctx._p;
case 4: return 8 >= _localctx._p;
case 5: return 5 >= _localctx._p;
case 6: return 3 >= _localctx._p;
case 7: return 2 >= _localctx._p;
case 8: return 15 >= _localct... |
184095e1-4869-4c99-8fe2-9a0248bd9437 | 8 | @Override
public void executeTask() {
System.out.println("Server is listening");
try {
receivingSocket = new DatagramSocket(LISTENING_PORT);
do {
// System.out.println(("Server listening..."));
dataGram = new DatagramPacket(new byte[512], 512);
/* Blocking receive */
receivingSocket.receive(d... |
b611deaa-176d-425c-8de3-e3a1a7d37f06 | 3 | public void removeIndex(int i)
{
if (locationEnd.length > 1)
{
Location[] newEnd = new Location[locationEnd.length - 1];
for (int x = 0; x < i; x++)
{
newEnd[x] = locationEnd[x];
}
for (int x = i; x < locationEnd.length - 1;... |
2e3fa1ab-afa8-4607-a859-ce07c059b6f7 | 4 | private void construct() {
if (orientation == HORIZONTAL) {
int space = dims.width / items.size();
for (int i = 0; i < items.size(); i++) {
Dimension itemDims = items.get(i).getDims();
items.get(i).setPosition(new Vector(space/2 + space*i - itemDims.width/2 + position.x,position.y + (dims.height - itemD... |
11c24cd3-676d-4f42-ac50-4c663cc64d22 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Patient)) {
return false;
}
Patient other = (Patient) object;
if ((this.ssn == null && other.ssn != null) || (t... |
a90adf08-6e81-4843-b2a2-b5f317e4c39d | 8 | public void handle_strarray(String[] nextLine) throws Exception{
//FORMAT: Animal_Native_ID, linger_days, onset_date, (cure_date <default to never/today>, (diagnosis_date <default to today>, (name <no default>, ( notes <no default>))))
String animal_native_id = nextLine[0].trim();
int linger_days =... |
79a00002-25a0-4615-9fd2-42d44d7c754e | 5 | void initializeSortState (final Tree tree) {
/* Reset to known state: 'down' on column 0. */
tree.setSortDirection (SWT.DOWN);
TreeColumn [] columns = tree.getColumns();
for (int i = 0; i < columns.length; i++) {
TreeColumn column = columns[i];
if (i == 0) tree.setSortColumn(column);
SelectionListener ... |
01b8566d-5fdf-4e3b-8f36-bda77ceca244 | 5 | private boolean containsEnemyWool(TeamPlayer p, CTFTeam team) {
Wool w = new Wool(this.GoalTeam.getColor());
//Check for wool
for (ItemStack m : p.getPlayer().getInventory()) {
//If item in inventory is wool
if (m != null && m.getType().equals(Material.WOOL))
{
System.out.println("Got... |
649edc14-5c9b-4aff-8638-2af399f753e8 | 4 | public void resetP2player()
{
start = false;
if (P2character.equals("White"))
{
whiteKnight.reset(900,450,false);
}
else if (P2character.equals("Bond"))
{
jamesBond.reset(900,450,false);
}
else if (P2character.equals("Ninja"))
... |
76bf79cd-1a2d-4ac7-9dd6-1b7a017e0b44 | 5 | private void broadcastServerInfo() {
final Communicator comm = sr.getServerComm();
if (comm != null) {
StringBuilder sb = new StringBuilder();
sb.append(DISCOVERY_INFO);
sb.append(DELIMITER);
InetAddress address = comm.getAddress();
try {
... |
95a598fa-69dd-49f4-9fa0-5337a11fa399 | 8 | private void processGridletSubmission(Sim_event ev)
{
if (trace_flag)
{
System.out.println(super.get_name() +
": received an SUBMIT_GRIDLET event. Clock: " + GridSim.clock());
}
/***********
We have to submit:
- the gridlet whose id c... |
0f7ac481-9eba-4153-b7b6-b4fb724a5874 | 2 | public boolean pikkusuora(){
for(int i=0; i<5; i++){
if(nopat[i].getValue()!=i+1){
return false;
}
}
return true;
} |
fcbaa262-126f-404c-ba4f-5b4613bce96e | 6 | public void endContact(Contact c) {
Fixture fa = c.getFixtureA();
Fixture fb = c.getFixtureB();
if(fa == null || fb == null) return;
if(fa.getUserData() != null && fa.getUserData().equals("foot")) {
numFootContacts--;
}
if(fb.getUserData() != null && fb.getUserData().equals("foot")) {
numFoo... |
8f1b9126-e051-4166-a01b-e6252334b9ab | 9 | @Test(groups = {"forgotpassword"})
@Parameters({"browser"})
@BeforeClass
public void beforeClass(String browser) throws IOException, InterruptedException
{
if (browser.equals("firefox")) {
driver=browserFirefox();
}
if (browser.equals("chrome")) {
driver=br... |
20665818-6b46-4c2b-8dc0-e6be48783788 | 9 | @SuppressWarnings("unused")
@Test
public void testTextLineIteratorWithNesting() {
//Create a few regions with text lines: tr1, cr2 (tr3,tr4), tr5 (tr6)
Page page = new Page();
PageLayout pageLayout = page.getLayout();
TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion);
TextLine t11 =... |
0a03bb1b-5b91-441f-b1a3-41761e823b44 | 0 | @Override
public void run() {
} |
2453cb47-6e09-4fc0-9de2-a04ebc8274fb | 9 | public static void setEntity (Description description, Entity entity) {
if (description instanceof AlternateOf) {
((AlternateOf) description).setAlternateB (entity);
}
if (description instanceof HadMember) {
((HadMember) description).setMember (entity);
}
... |
ec5456a1-8e04-4853-bf0a-5f484bbefb73 | 6 | @Override
public void scan(Particle[] particle) {
for (int index = 0; index < particle.length; index++) {
int startFrom = index - neighborhoodSize/2;
int endAt = index + neighborhoodSize/2;
if (startFrom < 0) startFrom = 0;
if (endAt >= particle.length) endAt = particle.length - 1;
int best... |
5384fca9-b64a-4fdc-8906-30c2e1ae6f27 | 8 | public static ArrayList<ArrayList<String>> createListFromString(String s) {
ArrayList<ArrayList<String>> newlists = new ArrayList<ArrayList<String>>();
// special handle, s="aaaa"
int length = 1;
while (length < s.length()) {
if (!s.substring(length - 1, length).equals(
s.substring(length, length + 1)))... |
ab08d62b-72ac-43ee-8f3d-5ae553f32418 | 0 | public int getID() {
return this.id;
} |
11e87258-75f4-410a-ae03-8378fc4192f6 | 8 | private boolean r_factive() {
int among_var;
// (, line 132
// [, line 133
ket = cursor;
// substring, line 133
among_var = find_among_b(a_7, 2);
if (among_var == 0)
{
... |
8344cc29-877c-49f4-9ce0-23c3a209726c | 3 | private void placeWumpusBloodAndMud(){
Random rand = new Random();
boolean success = false;
int x = 0;
int y = 0;
//Place Wumpus
while(!success){
x = rand.nextInt(10);
y = rand.nextInt(10);
if (grid[x][y]!=RoomState.PIT && grid[x][y]!=RoomState.SLIME){
grid[x][y] = RoomState.WUMPUS;
success... |
6ec63e25-8078-4e75-bcee-9ce255f52a42 | 1 | private static ClassType parseClassType(String sig, Cursor c)
throws BadBytecode
{
if (sig.charAt(c.position) == 'L')
return parseClassType2(sig, c, null);
else
throw error(sig);
} |
1624700c-df41-41b9-a407-5ec8163f23b7 | 9 | @Override
public void mutate() {
// Move a game from one week to another week randomly
Random random = new Random();
double r = random.nextDouble();
if(r < 0.75) {
// Get two random weeks
Week w1 = weeks.get(random.nextInt(weeks.size()));
Week w2 = weeks.get(random.nextInt(weeks.size()));
// G... |
f2bb1f22-b17d-471e-83d6-82df729f3955 | 2 | @Override
public ApiResponse executeCommand(final ApiCommand command) throws IOException, InternalApiException {
if (command.getHttpMethod() == GET) {
return executeGetCommand(command);
} else if (command.getHttpMethod() == POST) {
return executePostCommand(command);
... |
f98272f2-3c73-4f5e-9730-e178ab2ada15 | 1 | @Override
public boolean setStackInNextAvailableSlot(ItemStack item) {
if(item.getItem().equals(Items.grease)){
setStackInSlot(0, item);
return true;
}
return false;
} |
9c7a8a35-fd84-4096-86e0-04c484a731c8 | 0 | public void removeplayer(Player p) {
p.teleport(playerslocation.get(p));
playerslocation.remove(p);
players.remove(p);
} |
51831f5e-7bd3-4caa-87d4-5046585f7c2b | 0 | @Override
public String toString() {
return _firstName;
} |
dc8a0178-dd06-4548-abf7-5de7567b092c | 5 | public void visit(ClassOrInterfaceDeclaration classOrInterface,
Object object) {
List<ClassOrInterfaceType> extendsList = classOrInterface.getExtends();
List<ClassOrInterfaceType> implementsList = classOrInterface
.getImplements();
if (extendsList != null) {
for (ClassOrInterfaceType extendsName : ext... |
e91276f8-b1b3-4008-8e8d-aaedaafa5c56 | 2 | public ArrayList<String> ParaseXML(String filePath) {
ArrayList<String> list = new ArrayList<String>();
try {
XMLReader parser = XMLReaderFactory.createXMLReader();
MyHandler myHandler = new MyHandler();
parser.setContentHandler(myHandler);
parser.parse(filePath);
// System.out.println(myHandler.getNa... |
366ddc36-962f-4a3d-904a-a48b2767f5bc | 9 | private static final void loadFilesizes() {
assert FILESIZES == null;
FILESIZES = new HashMap<Integer, String>();
BufferedReader reader = TextResource.getBufferedReader("filesizes.txt");
try {
try {
String line;
while ((line = reader.readLine()... |
794d14b3-2df4-430b-8b21-3988f2c310ef | 3 | @Override
public double estimateMiceNumber(int nbOcc){
double comp = 0;
for(int i = b; i <= 32 ; i++){
HashMap<String, Integer> t = strTab.get(i);
for (String s : t.keySet())
if (t.get(s) == nbOcc)
comp++;
}
return comp * Math.pow(2, b);
} |
18580472-93a4-4837-98b0-cf4e489b82eb | 0 | public static void v(CanFly x) {
x.fly();
} |
cf02503a-b0f1-48ea-88af-9770cef1b185 | 8 | public void actionPerformed(ActionEvent e){
if(e.getSource() == btnSearch){
//DB query to populate doctor names
//"Doctor Name", "Phone Number", "Room Number", "Availability", "Average Rating"
String spec = (String) boxSpecialty.getSelectedItem();
int count = table.getRowCount();
for(int i=0; i<c... |
aa9bb710-e800-44be-9b4e-bf705382c3b6 | 0 | public static GeneralNameValueConfig getGeneralConfigByField(String field) {
return Registry.getConfigByField(field,generalFields);
} |
c47b93f2-a835-462f-ada9-7ae76abd673b | 9 | public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
_hashCode += getAccountId();
_hashCode += getBatchId();
if (getBatchStatusId() != null) {
_hashCode += getBatchStatusId().hashC... |
584b75a9-bbef-46ad-96d8-f980e9d02f95 | 7 | public TilePanel(TileFrame tileFrame, TileSheet tileSheet) {
setLayout(null);
this.tileFrame = tileFrame;
this.tileSheet = tileSheet;
tileFrame.addMouseListener(new MouseInputAdapter() {
@Override
public void mouseClicked(MouseEvent event) {
if (Ti... |
72827752-e816-4d2d-b14c-7a9b4efe873b | 0 | public List findByRecordTime(Object recordTime) {
return findByProperty(RECORD_TIME, recordTime);
} |
c7a096c0-91e7-4256-8ba8-d0c586d1b55e | 2 | private static List<Line> getAvailableLines(Mixer mixer, Line.Info[] lineInfos) {
List<Line> lines = new ArrayList<Line>(lineInfos.length);
for (Line.Info lineInfo : lineInfos) {
Line line;
line = getLineIfAvailable(mixer, lineInfo);
if (line != null) lines.add(line);
}
return lines;
} |
6f197921-308c-482a-8300-bb33974c0ee4 | 1 | public PreferenceString getSaveEncoding() {
if (useDocumentSettings()) {
return this.saveEncoding;
} else {
return Preferences.getPreferenceString(Preferences.SAVE_ENCODING);
}
} |
38482f5a-fa1b-4bd1-85a9-b8f6ef6c87fd | 4 | @Override
public PrintService accept(PrintRequestAttributeSet set) {
PrintService service = super.accept(set);
if (mCopies != null) {
PrintUtilities.setCopies(set, ((Integer) mCopies.getValue()).intValue());
}
if (mPageRangeAll != null) {
if (mPageRangeAll.isSelected()) {
PrintUtilities.setPageRanges... |
d56939ed-ac23-4119-b99a-7dee0544eb76 | 7 | public CapabilitiesServlet() {
logger.info("Capabilities servlet started.");
String filterFileName = System.getProperty(EmbeddedServer.StartupSetting.SEARCH_FILTER_FILE.getKey());
if( filterFileName == null ) {
filterKeywords = null;
} else {
FileInputStream fis = null;
try {
fis = new FileInput... |
7107e6d7-efaa-46e8-bb23-bc095714ccad | 2 | private void loop() throws Exception {
buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
long time = System.nanoTime() / 1000000L;
int fps = 0;
while (!org.lwjgl.opengl.Display.... |
f27a44c9-ac3b-4294-87ad-1907e8f540f1 | 4 | public Game(int x, int y) {
boolean test = false;
if (test || m_test) {
System.out.println("Game :: Game() BEGIN");
}
setGrid(new Grid(x, y));
if (test || m_test) {
System.out.println("Game :: Game() END");
}
} |
e906ee44-ba3a-457a-89bc-53d310545cf3 | 7 | public void calculateEnergyConsumptionEP() {
int i = 1;
System.out.println("EVALUATING SYSTEMS\n");
for (SoftwareSystem system : systemsEP) {
System.out.println("\tSystem " + (i++) + "\n\t\t" + system);
int j = 0;
Calculator calculator = new Calculator(this);
for (FunctionalRequirement functionalRequ... |
6b5107e4-77ed-40aa-bf6c-5714c913e71a | 8 | protected void genMountText(MOB mob, Modifiable E, int showNumber, int showFlag)
throws IOException
{
if((showFlag>0)&&(showFlag!=showNumber))
return;
if(mob.session()==null)
return;
mob.session().safeRawPrintln(L("@x1. Mount Strings: '@x2'.",""+showNumber,E.getStat("PUTSTR")+"/"+E.getStat("MOUNTSTR")+"... |
229fe655-652d-4ad2-bdb6-bed3dfa069a0 | 8 | private void calculateMinMax()
{
double maxX = 0, maxY = 0, minX = 0, minY = 0;
boolean initMinMax = true;
for (Entry<String, DataPoints> e: this.m_PointsSet.entrySet())
{
DataPoints dp = e.getValue();
if (initMinMax)
{
maxX = dp.getMaxX();
maxY ... |
e5584c1a-0545-4da8-8f01-7f2af561c07e | 5 | public boolean isBalanced(treeNode root,
HashMap<treeNode, Integer> nodeDepthes) {
if (root == null)
return true;
int depthLeft = depthOfNode(root.leftLeaf, nodeDepthes);
int depthRight = depthOfNode(root.rightLeaf, nodeDepthes);
if (!isBalanced(root.leftLeaf, nodeDepthes))
return false;
if (!isBal... |
35e63bdf-a08c-4c6b-81bb-c78fd99e69be | 9 | private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
String name = txtFieldName.getText();
String password = txtPassword.getText();
int staffId = -1;
PersonalType st = (PersonalType) cmbBoxPersonalTypes.getSelectedItem();
S... |
586d4d5d-0401-4dde-844f-1d1c277bbc8c | 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... |
db21ac42-bdec-4d95-9cfc-99d029b2e24b | 8 | public void onTick(ArrayList<Thing> toMove, ArrayList<GridSpace> destinations) {
// checks if there is a weapon modifier in the grid space, if so,
// applies damage
for (int i = 0; i < thingsInSpace.size(); i++) {
if (thingsInSpace.get(i) instanceof Weapon) {
for (int j = 0; j < thingsInSpace.size(); j++) ... |
f1977b35-7133-4927-a1f9-e47e97eb160d | 9 | public boolean checkToolTips() {
boolean result;
Class<?> cls;
BeanInfo info;
PropertyDescriptor[] desc;
int i;
Vector<String> missing;
String suffix;
print("Tool tips...");
result = true;
suffix = "TipText";
cls = getObject().getClass();
//... |
e63246d3-dcf4-47ea-ba78-17eed3dd992a | 0 | private void saveDataToStorage(String artistName, String data) throws IOException {
File eventsFile = FileUtil.getEventsFile(artistName);
FileUtil.saveDataToFile(eventsFile, data);
} |
34208c4e-bfc3-48d0-9ed9-a6f04ab63a4c | 4 | public static void insertExtendedNetwork(ExtendedNetwork net, ExtendedNetworkData d){
ExtendedNetworkData extData;
if (net!=null) //call from the Rest Interface
extData = net.getNetwork();
else //call from createMultiple
extData=d;
//Recover the network object (from the Rest Interface) attribute... |
ddc70bc6-0bbb-497c-a0c7-5802632e9c5d | 1 | public static Drug searchDrug(String drugName){
Drug sDrug = new Drug();
sDrug.setDrugName(drugName);
sDrug=(Drug)DatabaseProcess.getRow(sDrug);
if(sDrug!=null)
return sDrug;
else return null;
} |
aabf99ae-cfa8-4c56-be3b-5e1c7cf1978e | 3 | @Override
public void updateIcon() {
if(isProperty()) {
if (isPropertyInherited()) {
setIcon(ICON_IS_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_PROPERTY);
}
} else {
if (isPropertyInherited()) {
setIcon(ICON_IS_NOT_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_NOT_PROPERTY);
}
... |
c84e115f-85b0-4c16-97a7-9d5b6a198455 | 4 | public BMPcontainer(File file) throws IOException {
DataInputStream dataInputStream = new DataInputStream(new FileInputStream(file));
id[0] = (char) dataInputStream.readByte();
id[1] = (char) dataInputStream.readByte();
if ('B' != id[0] && 'M' != id[1]) {
throw new Invali... |
b1097823-89b2-40f9-9a5f-ee23a95afb8e | 0 | public void setEmail(String email) {
Email = email;
} |
afa01517-e4e3-4dbf-a766-944b3b3b9f42 | 6 | @Override
public List<String> onTabComplete(CommandSender sender, Command command,
String alias, String[] args) {
if (args.length == 1) {
List<String> matches = new ArrayList<String>();
for (String subcommand : subcommands) {
if (StringUtil.startsWithIgnor... |
0c1b5a6b-1bd7-4f80-9d46-81cea4ef32d4 | 8 | public void mousePressed(int button,int x,int y){
if (xpos >= Button.GAME_WIDTH/2-76 && xpos <= Button.GAME_WIDTH/2 + 76 && ypos >= 600 && ypos <= 647){
mousePress = 1;
}
else if (xpos >= Button.GAME_WIDTH/2-creditWidth/2 && xpos <= Button.GAME_WIDTH/2 + creditWidth/2 && ypos >= Button.GAME_HEIGHT/2+100 && ... |
e69aa854-f901-4a9e-81a7-893b91b651fb | 9 | public static String makeSkinFile(MD3_File md3_file){
if( md3_file == null )
return "";
StringBuilder sb = new StringBuilder();
String md3_file_name = md3_file.file.getName();
String skin_file_name = md3_file_name.split("[.]")[0] + ".skin";
sb.append("//.................... skin file ..... |
9e02f732-c0b3-4a01-a4ab-dcbfb60ca719 | 9 | public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException {
Expression select2 = visitor.typeCheck(select, contextItemType);
if (select2 != select) {
adoptChildExpression(select2);
select = select2;
}
ItemType sortedIte... |
6990155e-03f4-4b4e-9a91-aedab002ae3b | 5 | public static HashMap<String,List<String>> toElementParser(
HashMap<String,List<String>> pDictionary, String elementType) {
if (elementType.equals("pathway")) {ElementParser.parseMapInfo(pathway, pDictionary);}
else if (elementType.equals("datanode")) {ElementParser.parseDataNode(pathway, pDictionary);}
el... |
48945eea-5d57-44c8-9b03-8150e142153f | 0 | @Before
public void setUp() {
simpleObject = new Simple();
} |
61b31087-b644-4912-8f83-3d54d33d3139 | 5 | public boolean onkoPoytaTaynna() {
int ristitJaNollat = 0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (poyta[i][j] != 0) {
ristitJaNollat++;
}
}
}
if (ristitJaNollat == 9) {
try {
... |
60c71cb2-296f-4219-8636-94e9ea076ff6 | 7 | public Color getColor(float[] f) {
if (true) {
return new java.awt.Color(f[2], f[1], f[0]);
}
/* float A = (float)Math.exp(gamma[0]*Math.log(f[2]));
float B = (float)Math.exp(gamma[1]*Math.log(f[1]));
float C = (float)Math.exp(gamma[2]*Math.log(f[0]));*/
... |
4501e67d-63c5-4414-a789-32dfb7d4690b | 5 | private void setatime(int atime) {
int am;
String unit;
if (atime > (604800 * 2)) {
am = atime / 604800;
unit = "week";
} else if (atime > 86400) {
am = atime / 86400;
unit = "day";
} else if (ati... |
f88f1ec3-70e0-47df-91e5-7afe823d5d11 | 3 | public void drawChat(Graphics2D g) {
GameState state = ((GameState) Engine.getInstance().getGState());
List<Message> cbText = Chat.getCbText();
if (cbText.size() > 15)
getInnerPanel().setCurrentHeight(cbText.size() * getLineHeight());
int inputTextHeight = (int) (getBounds(... |
32a19708-59a0-45c1-8589-dead2abefd50 | 5 | public long update(){
if(!pause){
if (Timer.duration(this.turnSnapshot, this.currentSnapshot)>=TURN_DURATION) this.startTurn(); // If more than 1s has elapsed
Timer.updateSnapshot(this.currentSnapshot);
// for(Event ev: eventList){
for(int i=0; i < eventList.size... |
edee1748-71fc-4b58-ac64-d4f4922ae66b | 8 | public void visit_iload(final Instruction inst) {
final int index = ((LocalVariable) inst.operand()).index();
if (index + 1 > maxLocals) {
maxLocals = index + 1;
}
if (inst.useSlow()) {
if (index < 256) {
addOpcode(Opcode.opc_iload);
addByte(index);
} else {
addOpcode(Opcode.opc_wide);
... |
cee63678-49bc-4ca5-a9e6-d250a89074ad | 4 | @Override
public void run() {
int poblacionNumero = 1;
Poblacion poblacionActual, poblacionNueva;
//Generar primer población ALEATORIA
poblacionActual = new Poblacion(operacion, cantIndividuos, restricciones);
y[poblacionNumero] = poblacionActual.apt... |
a160192f-6081-4583-9f7a-ac4e07802f63 | 7 | private void setVBusMode() {
if (m_voltageMode) {
if(m_robotDrive!= null) {
m_robotDrive.setMaxOutput(1);
}
try {
if (_leftFrontMotor != null) {
_leftFrontMotor.changeControlMode(CANJaguar.ControlMo... |
ac119a76-28d5-4c17-afea-443bf098aa30 | 7 | public int adOscLookback( int optInFastPeriod,
int optInSlowPeriod )
{
int slowestPeriod;
if( (int)optInFastPeriod == ( Integer.MIN_VALUE ) )
optInFastPeriod = 3;
else if( ((int)optInFastPeriod < 2) || ((int)optInFastPeriod > 100000) )
return -1;
if( (int)optInSlowPeri... |
63b068e8-76fe-4aa4-a069-843505b611d2 | 0 | public void setEmail(String email) {
Email = email;
} |
71bc1276-5a2c-4b4a-9396-a4f6f9f5640a | 2 | void readData() {
String str;
try {
while ((str = reader.readLine()) != null) {
int n = Integer.parseInt(str);
System.out.println(n);
}
} catch (NumberFormatException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
6697baa6-3bd4-4a42-b8d4-1474f3afb985 | 6 | public void makeMovieQuotes(String cat, String url) {
String content = "";
try {
content = Request.Get(url).execute().returnContent().asString();
} catch (ClientProtocolException e) {
System.err.println("Protocol error: " + e.getMessage());
e.printStackTrace();
} catch (IOException e) {
System.err.p... |
430d2a70-de7a-4027-ace0-968704b14613 | 9 | public boolean execute() {
final int cycle=CDState.getCycle();
if( shuffle ) rperm.reset( Network.size() );
for(int j=0; j<Network.size(); ++j)
{
Node node = null;
if( getpair_rand )
node = Network.get(CDState.r.nextInt(Network.size()));
else if( shuffle )
node = Network.get(rperm.next());
else
no... |
c8253921-3a6f-4356-9d66-dd00f60db8c0 | 6 | @Override
public void run() {
if (Updater.this.url != null) {
// Obtain the results of the project's file feed
if (Updater.this.read()) {
if (Updater.this.versionCheck(Updater.this.versionName)) {
if ((Updater.this.versionLi... |
89804712-295e-487e-96d5-f1efa86c18c7 | 6 | private ZeroLink getLinkObjectInternal(byte[] data, int outputformat)
{
ZeroLink link;
switch(outputformat)
{
case Constants.JSON_FORMAT:
link= Utils.parseJSON(getStringResponseInternal(data));
break;
case Constants.PLAIN_TEXT_FORMAT:
link = new ZeroLink();
link.setShortLinkUrl(getStringRespon... |
3dfb3c8b-37c6-49db-8797-eedf06a673f8 | 1 | public void visit_fastore(final Instruction inst) {
stackHeight -= 3;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} |
b19f5556-3b38-4c61-9d31-100fd5657211 | 0 | public void method2()
{
System.out.println("执行方法!");
} |
642fc70e-854c-464f-9039-b6d55d91769b | 4 | private static int computeFreqHelper(int freq, long startTime) {
switch (freq)
{
case Frequency.ONCE:
return 0;
case Frequency.DAILY:
return 0;
case Frequency.WEEKLY:
Date startD = new Date(startTime);
return startD.getDay();
case Frequency.MONTHLY:
startD = new Date(startTime);
return sta... |
484cecc9-dcfa-41ec-b019-25935b5450b9 | 6 | public HospitalPart getSpecialist(){
double t = nextRand();
if ( t < 0.15 )
return HospitalPart.CARDIO;
else if ( t < 0.3 )
return HospitalPart.NEURO;
else if ( t < 0.5 )
return HospitalPart.INTERNAL;
else if ( t < 0.63 )
return HospitalPart.ORTHOPED;
else if ( t < 0.75 )
return HospitalPart.... |
e77007c3-92f3-4820-b5c8-49cb7b1f6560 | 1 | static Object get(Map<String, Object> inst, String key) {
Object val = inst.get(key);
if (val == null) {
throw new IllegalArgumentException("No such component name '" + key
+ "'");
}
return val;
} |
d8d68884-3344-4cd0-a724-f1d1db85d3ce | 1 | public void setCurrentThreadClassLoader() {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader instanceof ExtendableClassLoader) return;
else {
currentLoader = loader;
Thread.currentThread().setContextClassLoader(this);
}
} |
3c58f769-7acb-4c41-967e-74949b125660 | 1 | public boolean execute(String sql){
try {
Statement statement = mc.getConnection().createStatement();
statement.executeUpdate(sql);
return true;
} catch (SQLException ex) {
Logger.getLogger(Crud.class.getName()).log(Level.SEVERE, null, ex);
ret... |
762640d7-c991-4f13-98f6-abb720c2db62 | 9 | @Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Parameter that = (Parameter) obj;
i... |
ecba7c85-8a8b-4830-a6a7-5470de56bc5b | 3 | public static String getMapfile()
{
String mapfile = "";
try
{
BufferedReader r = new BufferedReader(new FileReader("config.txt"));
String line = r.readLine();
while (line != null)
{
if (line.startsWith("Mapfile="))
... |
210a053b-1dd1-430d-9044-67abde1fc41e | 0 | @Override
public void setTmp(String value) {this.tmp = value;} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.