method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
48a685cf-97be-4466-b4fd-bf4362c769f2 | 5 | public Wave46EliteLorelei(){
super();
MobBuilder m = super.mobBuilder;
for(int i = 0; i < 4000; i++){
if(i % 5 == 0)
add(m.buildMob(MobID.JYNX));
else if(i % 4 == 0)
add(m.buildMob(MobID.LAPRAS));
else if(i % 3 == 0)
add(m.buildMob(MobID.CLOYSTER));
else if(i % 2 == 0)
add(m.buildMob(M... |
966aef4d-0e55-46de-92c8-0788572b1063 | 5 | public void openFile()
{
System.out.println("manager.openFile() CALLED");
JFileChooser fc = new JFileChooser();
fc.setFileFilter(new FileNameExtensionFilter("mp3 files", "mp3"));
int answer = fc.showOpenDialog(null);
if (answer == JFileChooser.APPROVE_OPTION &&
fc.getSelectedFile().getName().endsWith(".m... |
c4b93265-ec54-423a-ae89-2f7c86e36097 | 8 | static void terminateBits(int numDataBytes, BitArray bits) throws WriterException {
int capacity = numDataBytes << 3;
if (bits.getSize() > capacity) {
throw new WriterException("data bits cannot fit in the QR Code" + bits.getSize() + " > " +
capacity);
}
for (int i = 0; i < 4 && bits.get... |
e8319aec-0976-4bbc-b710-fbcc1566065f | 8 | private List <Movement> listPositionsToMove(Player player, Grid grid){
Position pos = player.getPosition();
List <Movement> possibleMovements = new ArrayList<Movement>();
if (canMoveToPosition(player, grid, new Position(pos.getxCoordinate(), pos.getyCoordinate()-1)))
possibleMovements.add(Movement.UP);
if (c... |
05d04719-923b-4fb3-9eeb-d80c7a5c7bac | 4 | protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
conn = DatabaseConnection.getConnection();
String user = req.getParameter("user");
String pass="";
try {
pass = stringToHash(req.getParameter("password"));
} catch (NoSuchAlgorithmException e1)... |
2f295028-8ae6-4948-bacf-11c9c087d420 | 4 | public void openPrayMenu(final Player p, final God g, final Shrine s) {
//Adding the player for statistics if not already registered
AGPlayer agp = getAGPlayer(p.getName());
if(agp == null)
agp = addAGPlayer(p.getName());
if(agp.isPraying()) {
Messenger.sendMessage(p, Message.alreadyPraying);
return;
... |
6b1ecf86-34b6-4359-8972-fccf72134188 | 7 | protected Class<?> resolveProxyClass(String[] interfaces)
throws IOException, ClassNotFoundException
{
// ClassLoader latestLoader = latestUserDefinedLoader();
ClassLoader latestLoader = loader;
ClassLoader nonPublicLoader = null;
boolean hasNonPublicInterface = false;
// define proxy in class loader of non-p... |
4a57f827-d342-419c-89f6-ec071d86de45 | 6 | private void loadMap(String filename) throws IOException {
ArrayList lines = new ArrayList();
int width = 0;
int height = 0;
BufferedReader reader = new BufferedReader(new FileReader(filename));
while(true){
String line = reader.readLine();
if(line==null){
reader.close();
break;
}
if(!line... |
0b72b904-a625-4b61-a6ce-46efbeb6bf8d | 0 | public String[] getInputStrings() {
return inputStrings;
} |
4908c01f-d1d5-43db-90a0-cf43bbdc90e3 | 9 | public static Set<PosixFilePermission> byteToPerms(byte[] b) {
Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class);
// @formatter:off
if ((b[0] & 1)!=0) result.add(OWNER_READ);
if ((b[0] & 2)!=0) result.add(OWNER_WRITE);
if ((b[0] & 4)!=0) result.add(OWNER_EXECUTE);
if (... |
4c860d3e-4ac5-4953-897c-ab9d66330594 | 1 | @Override
public boolean isEmpty() {
if(root == null){
return true;
}
return false;
} |
41da60be-dc1a-44ea-a890-9288c5353871 | 2 | public void stop() {
if (running) {
try {
server.stop();
} catch (Exception e) {
e.printStackTrace();
}
running = false;
}
} |
ab957ed2-8dfd-4bfd-a002-4bcc84bc66a6 | 4 | @Override
public boolean preConditionIsTrue()
{
message = myAgent.receive(mt);
if(message != null)
{
if(message.getContent().equals("A")) {
brand = Brand.A;
}
else {
brand = Brand.B;
}
beer = agent.getRefrigerator().getBeer( brand );
if(beer != null && beer.getState() == BeerState... |
22e2e94e-299b-4191-a09e-ff3db18055de | 2 | public InputStream getInputStream() {
InputStream in = this.classLoader.getResourceAsStream(this.path);
if (in != null) {
return in;
}
try {
return new FileInputStream(this.path);
} catch (FileNotFoundException e) {
return null;
}
} |
3854d6ed-3b35-4b32-b67e-6f3925d75dda | 4 | private byte[] get_img_stream(File dot, String type)
{
File img;
byte[] img_stream = null;
try {
img = File.createTempFile("graph_", "."+type, new File(GraphViz.TEMP_DIR));
Runtime rt = Runtime.getRuntime();
// patch by Mike Chenault
String[] args = {D... |
9ef556b9-da49-4b25-b311-65a4af02c27d | 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... |
345ce124-1a6c-4e5f-977f-456923f2814f | 0 | public void setDiscountPercent(int discountPercent) {
this.discountPercent = discountPercent;
} |
74826661-9e17-4df7-b5f5-da76744d5cfd | 7 | @Override
public boolean equals( Object o ) {
if( o == this ) {
return true;
}
if( !( o instanceof LongSet ) ) {
return false;
}
LongSet m = (LongSet)o;
if( m.size() != size() ) {
return false;
}
try {
... |
56dce644-e70f-49ba-b57d-c553064e77af | 0 | public static Injector getInjector() {
return injector;
} |
699bb232-912e-4ddb-ba0f-b4ceb2db739e | 5 | private void dbInit() {
// Initialize connection pool
String driver, url, user, pass;
if (plugin.getConfig().getBoolean("mysql.enabled")) { // MySQL
dbms = DBMS.MySQL;
ConfigurationSection cs = plugin.getConfig().getConfigurationSection("mysql");
String host = cs.getString("host");
int port = cs.ge... |
2e6b7dbf-2cf0-4485-8653-48e284804e2c | 7 | public int getUnnotedItem(int ItemID) {
int NewID = ItemID - 1;
String NotedName = "";
for (int i = 0; i < Config.ITEM_LIMIT; i++) {
if (Server.itemHandler.ItemList[i] != null) {
if (Server.itemHandler.ItemList[i].itemId == ItemID) {
NotedName = Server.itemHandler.ItemList[i].itemName;
}
}
}
... |
33d48a36-bdf4-4fdc-8574-28803474b2f0 | 0 | public Filter and( Filter other )
{
return new And( this, other );
} |
e091fd65-fd1c-4247-99a1-ad0a3406c167 | 7 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int nCase = 1;
while ((line = in.readLine()) != null && line.length() != 0) {
int depth = Integer.parseInt(line.tr... |
96697231-923d-43e8-a54b-5138d214058f | 7 | public void setValue(RNG rng, VoxelStack stack, int x, int y, int z)
{
if (x >= minX && x <= maxX && y >= minY && y <= maxY && z >= minZ && z <= maxZ)
determineValue(rng,stack,x,y,z);
for (TreeNodeArea tna: subAreas)
{
tna.setValue(rng, stack, x, y, z);
}
} |
c9550bef-0793-4247-ba3d-cf47e5be6b2b | 4 | public void render() {
BufferStrategy bs = getBufferStrategy();
if (bs == null) {
createBufferStrategy(3);
return;
}
clear();
draw();
Graphics g = bs.getDrawGraphics();
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth(), getHeight());
if (getWidth() / getHeight() > width / height) {
g.dra... |
d361b31b-1f8c-4013-a780-a5ab674135ef | 3 | public boolean hasNext() {
int tmp = vsize.length - 1;
while (tmp >=0
&& this.start[tmp] + this.chunkStep[tmp] >= this.vsize[tmp]) {
tmp--;
}
if (tmp < 0) {
return false;
}
return true;
} |
1f21b2bf-4494-4e3c-ad59-1be102108d8d | 3 | public double useHeuristic(Board b )
{
int counter = 0;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
if (b.boardState[i][j] == 0)
counter++;
}
}
return adjust(counter);
} |
4a7b5806-34a5-47a7-b223-e807a82df15f | 0 | private void jButtonSuivantActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSuivantActionPerformed
((CtrlVisiteur)controleur).visiteurSuivant();
}//GEN-LAST:event_jButtonSuivantActionPerformed |
d1f61bca-647d-4e5d-8312-6fb21dbc504f | 5 | public boolean SetupPasswordCallback(OTCaller passwordCaller, OTCallback passwordCallback) throws LoadingOpenTransactionsFailure {
if (!isPasswordImageSet) {
throw new LoadingOpenTransactionsFailure(LoadErrorType.PASSWORD_IMAGE_NOT_SET, "Must Set Password Image First!");
}
if (isPas... |
542068ac-e174-4017-9a31-c80260c80746 | 1 | public int getCalibrationDataSize() {
if (calibrationType == MEAN) {
return 1;
} else {
return calibrationDataSize;
}
} |
4603e3ef-ab30-4880-acc5-45179c1adaf2 | 5 | public boolean checkBuildRadiusPermissions(Location location, Player player, String direction){
World world = location.getWorld();
int x = location.getBlockX();
int y = location.getBlockY();
int z = location.getBlockZ();
if(wg != null){
//loop through cuboid area (19x19x6) to check if player is making ... |
bb855b80-a609-403e-8d48-80c399cef200 | 5 | public static void flatten4(TreeNode root) {
if(root == null ){
return;
}
Stack<TreeNode> toVisit= new Stack<TreeNode>();
TreeNode prev = null;
toVisit.push(root);
while(!toVisit.isEmpty()){
TreeNode cur = toVisit.pop();
if(cur.right != null) toVisit.push(cur.right)... |
910362be-04ff-444a-b204-3d099c17381f | 8 | private ExtractedCommand extractCommands(String s)
throws ValidationException {
Option<?> c = null;
String arg = null;
if (s.startsWith("--")) {
s = s.substring(2);
int i = s.indexOf('=');
if (i > -1) {
arg = s.substring(i + 1);
s = s.substring(0, i);
}
c = options.get(s);
if (c == nu... |
76c083f5-fe31-4716-aabf-cb974144caea | 3 | public boolean type(char k, java.awt.event.KeyEvent ev) {
if (k == 10) {
if ((cur != null) && cur.enter())
wdgmsg("login", cur.data());
return (true);
}
return (super.type(k, ev));
} |
fa074b1c-8283-4789-8909-a368de93c5dc | 9 | public String getRoomName(){
if (roomInitial == 'S')
roomName = "Study";
else if (roomInitial == 'L')
roomName = "Library";
else if (roomInitial == 'R')
roomName = "Billiard Room";
else if (roomInitial == 'C')
roomName = "Conservatory";
else if (roomInitial == 'B')
roomName = "Ballroom";
else... |
c12a3abe-e098-4075-8b96-bf9f5ab2373c | 9 | private boolean encased(String s) {
int countP = 0; // count of parentheses, 1 for every '(', -1 for every ')'
int matchedP = -1; // index where the parentheses end up matching
if(s.startsWith(NEGATIVE+"")) { // if it starts with a negative sign, ignore the negative
s = s.substring(1);
}
if(s.contains... |
1f1dcf78-9278-439c-af92-75b3a77a7b21 | 8 | public void searchByName() {
String sSql = "";
sSql += "Select kisiAdiSoyAdi,mekanID,soruID,cevapID from hareketler where kisiAdiSoyadi = '";
if (txArama.getText().trim().equals("")) {
JOptionPane.showMessageDialog(rootPane, "Aranacak Kişi Seçilmedi !");
} else {
... |
681eea77-8c3d-492a-9898-4e4c9e9238c0 | 2 | public void moveJump(Jump jump) {
if (this.jump != null)
throw new AssertError("overriding with moveJump()");
this.jump = jump;
if (jump != null) {
jump.prev.jump = null;
jump.prev = this;
}
} |
bb941842-aa16-405b-9084-a60189eff32d | 2 | public Geometric(double p) throws ParameterException {
if (p < 0 || p > 1) {
throw new ParameterException("Geometric parameter 0 <= p <= 1.");
} else {
this.p = p;
}
} |
9f9a460b-749f-4133-b6b0-6764a2bca0db | 5 | public void runSimulation() throws VehicleException, SimulationException, IOException {
this.log.initialEntry(this.carPark,this.sim);
for (int time=0; time<=Constants.CLOSING_TIME; time++) {
//queue elements exceed max waiting time
if (!this.carPark.queueEmpty()) {
this.carPark.archiveQueueFailures(time);... |
66ed01be-e381-4917-854f-26a917672389 | 0 | public final void op(String channel, String nick) {
this.setMode(channel, "+o " + nick);
} |
e4406f35-80fd-4971-893e-5eb24b4e7756 | 4 | public boolean submitBipolarQuesion(BipolarQuestion bipolarQuestion) {
Element bipolarQuestionE;
boolean flag = false;
for (Iterator i = root.elementIterator("bipolarQuestion"); i.hasNext();) {
bipolarQuestionE = (Element)i.next();
if (bipolarQuestionE.element("id").getText().equals(bipolarQuestion.getId())... |
406c7701-4a85-48e7-9ef5-721a6188e5e6 | 7 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Order other = (Order) obj;
if (this.orderNum != other.orderNum && (this.orderNum == null || !this.orderNu... |
10dff0a0-fa3b-47ab-aed2-3711e480cd4a | 5 | static final void method3459(Class348_Sub34 class348_sub34, int i,
int i_0_, int i_1_, int i_2_) {
anInt4330++;
long l = (long) (i_0_ << -1072233266 | i << 1409307868 | i_1_);
Class348_Sub37 class348_sub37
= (Class348_Sub37) Class130.aClass356_1895.get(l);
if (class348_sub37 == null) {
class348_sub37... |
92c95ae4-9c86-4446-8cd0-61fa126c1370 | 3 | static void testLow()
{
Scanner in = new Scanner(System.in);
Board b = Board.readBoard(in);
ArrayList<Integer> nextPiece = new ArrayList<Integer>();
while(in.hasNextInt())
nextPiece.add(in.nextInt());
Searcher s;
for (int i = 6; i <9; i++){
for(int j= 1; j < i; j++){
s = new Jogger(new LinearW... |
770a6414-2bed-4a66-bccc-927393cd1e0d | 1 | private void initGameView() {
myGameSWT = new GameSWT(display, myGame);
if (!myGameSWT.isDisposed()) {
myGameControls = myGameSWT.getControls();
initGameViewListeners();
myGameSWT.start();
} else {
reloadSettings();
}
} |
df2026eb-1083-4166-83c6-c8cc9cbfa890 | 2 | public Serie buscarSerieSeguida(String titulo) throws Exception{
for (Serie serie : seguidas) {
if (serie.obtenerTitulo().equals(titulo))
return serie;
}
throw new Exception("El usuario no sigue la serie seleccionada.");
} |
3dc18789-ed1f-42bf-956d-7159142871da | 1 | public static void inorderTreeWalk(Node node){
if(node != null){
inorderTreeWalk(node.left);
System.out.print(node.key+" ");
inorderTreeWalk(node.right);
}
} |
6a444844-f1a7-4105-9808-62c7e9295a92 | 2 | private void checkNotEmptyClass(
String testString,
boolean needsError,
boolean ownMessage) {
Set<ConstraintViolation<Object>> constraintViolations;
Object notEmptyClass... |
74acdf34-d134-49ef-928c-3649f9c2f662 | 9 | public void move(int x, int y) throws ImpossibleMoveException {
if ((x >= tailleX) || (x < 0) || (y >= tailleY) || (y < 0)) {
throw new ImpossibleMoveException("Cette case n'existe pas");
} else if (labyr[x][y].canMoveToCase() && ((x == posX + 1) || (x == posX - 1)) && ((y == posY + 1) || (... |
043ffaef-67d1-4480-b056-21d68c1d7289 | 6 | public boolean updateR(NodeFunction f, NodeVariable x, PostService postservice) {
NodeVariable variable = null;
//System.out.println("Sono nell'updateR per la variabile "+x.getId());
LinkedList<MessageQ> qmessages = new LinkedList<MessageQ>();
// R from other functions f' to v
... |
7d6d4f9b-642a-4e76-9b20-5cf6b1f370b1 | 2 | private static void test_pack(TestCase t) {
// Print the name of the function to the log
pw.printf("\nTesting %s:\n", t.name);
// Run each test for this test case
int score = 0;
for (int i = 0; i < t.tests.length; i += 5) {
int exp = (Integer) t.tests[i];
int arg1 = (Integer) t.tests[i + 1];
int ar... |
5910dab6-906d-4d91-9d7a-f8f4bf199c2f | 0 | public String getModuleName() {
return moduleName;
} |
5532ef16-22e7-44ee-b6c9-a6ad4aefdf60 | 6 | public void setSystemRelation(ElementSystem e1, ElementSystem e2, SystemRelation r) {
if (e1 == null || e2 == null)
throw new NullPointerException("The ElementSystem is null.");
if (r == null)
throw new NullPointerException("The ElementSystem relation is null.");
if (r ==... |
a480139d-f41c-4cbd-a279-a838817b5759 | 9 | public int getSelectedIndex(Object component) {
String classname = getClass(component);
if (("combobox".equals(classname)) || ("tabbedpane".equals(classname))) {
return getInteger(component, "selected",
("combobox".equals(classname)) ? -1 : 0);
}
if (("list".equals(classname)) || ("table".equals(classna... |
b968f7f6-31e4-44d4-854e-59f85b9d2120 | 1 | public RSS() {
try {
showMsgsCount = Integer.valueOf( config.getValue(configKeyCount) ).byteValue();
} catch(NumberFormatException e) {
showMsgsCount = 5;
}
addFeeds();
checkFeeds();
setPeriodicUpdate(60000);
} |
75a7299d-3713-44df-99ce-b52d4dc8f62f | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if((mob.numFollowers()>0)||(mob.isMonster()))
{
mob.tell(L("You cannot have any followers when calling a familiar."));
return false;
}
if(!super.invoke(mob,commands,givenTarget,auto,asLeve... |
d36f112f-8c20-4a6b-b5f0-c70533faba78 | 6 | private static ArrayList<Comment> crawlComment(String storeID) throws IOException {
ArrayList<Comment> comments = new ArrayList<Comment>();
String baseUrl = "http://www.dianping.com/shop/" + storeID + "/review_all?";
int page = 1;
boolean flag = true;
while (flag) {
String url = baseUrl + "pageno=" + page;... |
75533a03-8130-4835-a0ed-c69b7674f502 | 1 | public void render(){
if (!life.isStarted())
life.start();
//square.render();
} |
2ea91066-34fa-4327-a91c-ebcc484c0000 | 3 | public void mousePressed(MouseEvent me){
if (me.getButton() == MouseEvent.BUTTON1) {
if (typeAction.equals(Constantes.ADD_ENT)) {
DictionnaireTable data = mcdComponent.getData();
data.addObserver(mcdComponent.addEntite(me.getX(), me.getY()));
... |
c416fe6b-8740-4c2f-a4fc-a7a647c786ab | 2 | public void setFormat(String format) {
this.format = format;
if (format != null && type.equals("date")){
dateFormatter = new SimpleDateFormat(format);
dateFormatter.setTimeZone(TimeZone.getTimeZone("GMT+1"));
}
} |
14590a1b-5295-4da2-a05a-23f26f8bbda8 | 0 | public void setEmail(String email) {
this.email = email;
} |
ed78a33c-7aae-4bf1-905f-578ee9ac4e58 | 1 | public String toString()
{
if (this == Couleur.BLANC)
return "B ";
return "N ";
} |
c534334d-9149-4be9-9c02-82253d250697 | 2 | private void _parseFile() throws ReaderException {
ConfigurationManager.logger.log("parsing", 5);
JSONParser parser = new JSONParser();
try {
_readFile();
this.read_time = getConfigFile().lastModified();
this.json_obj = parser.parse(new FileReader(getConfigFile()));
} catch (IOException e) {
Conf... |
386f73f1-c8bb-41ea-95f5-2fac05744248 | 1 | public static void initialize(){
try {
coinSprites.clear();
coinSprites.add(ImageIO.read(Entity.class.getClassLoader().getResourceAsStream("images/coin1.png")));
coinSprites.add(ImageIO.read(Entity.class.getClassLoader().getResourceAsStream("images/coin2.png")));
coinSprites.add(ImageIO.read(Entity.class.... |
2344321e-bdd2-4b39-8503-24a09e76a0e1 | 6 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession sesionOk = request.getSession();
if (sesionOk.getAttribute("usuario") != null) {
response.setContentType("text/html;charset=UTF-8");
... |
b194511b-44f8-4fe3-a647-f0be2d072f2d | 8 | public LinkedList<String>getPopularPerformers(Date startDate, Date endDate, int amount) throws SQLException {
PreparedStatement statement = connection.prepareStatement(
"SELECT ISBN, SUM(Amount) FROM Orders WHERE Date>=? AND Date<=? GROUP BY ISBN");
statement.setString(1, sqlDate.format(... |
54afea58-c036-4dee-a9ae-4b906c15a93f | 4 | private boolean check(Block next) {
if (next != null) {
return next.thenPre == this || next.elsePre == this || next.normalPre == this
|| next.loopBack == this;
}
return true;
} |
27b67783-4b62-40df-8a7b-df9a610ad911 | 7 | @Override
public void cleanup(
BSPPeer<NullWritable, NullWritable, NullWritable, NullWritable, JobMessage> peer)
throws IOException {
if (peer.getPeerIndex() == 0) {
JobMessage result = peer.getCurrentMessage();
while (result != null) {
int peerInd = result.getSender();
Matrix block = res... |
7525d3a6-5acc-4a73-a6ae-25d2515b589e | 0 | public RetrievalMethodType createRetrievalMethodType() {
return new RetrievalMethodType();
} |
4d55b833-206e-4c8c-ac37-33f7c14f33ae | 1 | public void visitIntInsn(final int opcode, final int operand) {
buf.setLength(0);
buf.append("mv.visitIntInsn(")
.append(OPCODES[opcode])
.append(", ")
.append(opcode == Opcodes.NEWARRAY
? TYPES[operand]
: In... |
364a74f4-92dd-4ee7-929f-2c433919c59f | 4 | public SimpleRunCPE(String args[]) throws Exception {
mStartTime = System.currentTimeMillis();
// check command line args
if (args.length < 1) {
printUsageMessage();
System.exit(1);
}
// parse CPE descriptor
System.out.println("Parsing CPE Descriptor");
CpeDescription cpeDesc =... |
d0bb2d33-e57c-4ac9-a855-4455b8a47cdf | 6 | private void updatePositions(long elapsed)
{
// calculate new speed
headSpeed += headAcceleration * (float)elapsed;
if (headSpeed < MIN_SPEED)
headSpeed = MIN_SPEED;
// calculate change in position and update head position
Vector2D deltaPos = (direction).mult(headSpeed * (float... |
b47ddc2a-b5db-4280-9baf-143219b5bc04 | 5 | public static void main(String args[]) {
// Select Saxon XPath implementation (necessary in case there
// are other XPath libraries in classpath).
System.setProperty("javax.xml.xpath.XPathFactory", "net.sf.saxon.xpath.XPathFactoryImpl");
Configuration config = new Configuration();
// Configuration parameters can... |
ee59b53b-62c9-488f-abbf-aa9399699f77 | 2 | public void test_set_RP_int_intarray_int() {
BaseDateTimeField field = new MockPreciseDateTimeField();
int[] values = new int[] {10, 20, 30, 40};
int[] expected = new int[] {10, 20, 30, 40};
int[] result = field.set(new TimeOfDay(), 2, values, 30);
assertEquals(true, Arrays.equal... |
87b81ebc-7157-46f4-a432-46f25ec88847 | 1 | public float UtoTextureSpace(float _u) {
if(texture != null) {
return (widthRatio * _u);
}
else {
System.err.print("RoyalFlush: Texture2D.UtoTextureSpace - No texture has been loaded.\n");
return _u;
}
} |
57be2ae1-82fd-4636-af63-4cad09c7aed2 | 7 | private void initializeGrid() {
endSim = false;
gridInitialized = true;
//Clear list of colony ants and bala ants
activeAnts.clear();
balaAnts.clear();
//Initializes the turn counter to 0 and resets the time
turn = 0;
time = "Turn: 0 Day: 0 Year: 0 ";
simGUI.setTime(time);
// Sets up node... |
be664be6-72f1-41ea-9035-8cc9da14c419 | 0 | public Vector<ServerHandleConnect> getServerHandleConnectList() {
return serverHandleConnectList;
} |
56deb6f1-d71f-4b73-af92-5ff968019e19 | 3 | public int maxCoins(int[] nums) {
if (nums == null || nums.length == 0) return 1;
if (nums.length == 1) return nums[0];
cache.clear();
return (int) search(nums);
} |
d0d773b2-b870-41c5-bf10-f2e80b98369a | 3 | private void splitRoot(){
if (this.root instanceof Leaf){
Leaf newLeaf= ((Leaf)this.root).split(null); //splits the root
Vector<Link> newElement= new Vector<Link>();
newElement.add(((Leaf)this.root).getLast());
Vector<Object> newPointers= new Vector<Object>();
newPointers.add(this.root);
newPointers... |
6dbc9c92-90b9-49df-936f-67c43eb92b77 | 6 | private InputStream locateResource(String name) {
name += getExtension();
String file="";
if( isOSX()) {
file="/native/osx/" + name;
}else if( isWindows()) {
if( is64Bit()){
file="/native/windows/x86_64/" + name;
}else {
file="/native/windows/x86_32/" + name;
}
}else if( isLinux()) {
i... |
9b38356e-cc23-4d7f-a724-b112c4dc4244 | 7 | @Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
stage = 0;
sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
"Do you want to trade?",
"Hello, shorty.",
"Why don't you ever restock ores and bars?");
}else if (stage == 0) {
if(componentId == 2) {
stage = 2;
... |
de899db6-3983-4491-bf9f-7ca6abd4319b | 9 | public static String urlPathEncode(String part)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < part.length(); i++)
{
char c = part.charAt(i);
String valid = "./:-_?=;@&%#";
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')
|| valid.indexOf(c) > -1)
... |
fe2c26c4-da9a-4f4d-bc01-4dbaf258ede4 | 9 | public void Remove(int index) {
if (index > length - 1 || isEmpty() || index < 0) {
return;
}
if (index == 0) {
head = head.getNext();
length--;
} else if (index == length - 1) {
Node node = new Node();
node = head;
for (int i = 1; i < length; i++) {
node = node.getNext();
if (i =... |
e26fd7c8-915f-4135-acd5-bb4d78c24eb2 | 7 | * @param xxx
* @param yyy
* @param zzz
*/
public void renderVine(int textureId, int xxx, int yyy, int zzz, int blockOffset) {
float x = xxx + this.x*16;
float z = zzz + this.z*16;
float y = yyy;
byte data = getData(xxx, yyy, zzz);
boolean rendered = false;
if ((data & 1) == 1)
{
// So... |
cc032cf8-60f6-4961-a100-a9e36f686785 | 1 | @RequestMapping(value = "/room-event/{id}", method = RequestMethod.GET)
public ModelAndView speakerPage(
final HttpServletRequest request,
final HttpServletResponse response,
@PathVariable(value = "id") final String idStr
) throws IOException {
ModelAndView modelAndVi... |
d5560b0a-e527-420b-ac8f-c3bfbfa08d35 | 4 | private Move makeFirstMoves(){
Move center1 = new Move(3, 3);
Move center2 = new Move(3, 4);
Move center3 = new Move(4, 3);
Move center4 = new Move(4, 4);
if(LegalMoves.isLegal(bd, center1, myColor)){
return center1;
}
if(LegalMoves.isLegal(bd, center2, myColor)){
return center... |
15d575b3-83e4-4f3c-be04-bbc0feac1de3 | 5 | public void perm(ArrayList<ArrayList<Integer>> resArr,
ArrayList<Integer> res, int[] num, int[] cnt) {
int n = num.length;
int i = 0;
for (i = 0; i < n; i++) {
if (cnt[i] > 0)
break;
}
if (i == n) {
resArr.add((ArrayList<Integer>) res.clone());
return;
}
for (; i < n; i++) {
if (cnt[i] ... |
6e714385-df14-47c3-a3ec-bf347cd9ace1 | 0 | public int getY() {
return y;
} |
a171944c-15cb-446b-aaec-ddc2271c7152 | 7 | private void tabEstoqueStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tabEstoqueStateChanged
// TODO add your handling code here:
int tabIndex = tabEstoque.getSelectedIndex();
Conexao dbCon = new Conexao();
//Método usado para atualizar as tabelas, quando o usuario ... |
26e25319-c95f-44ff-b4ab-c92673059e6e | 1 | public void visitChildren(final TreeVisitor visitor) {
if (!visitor.prune()) {
visitForceChildren(visitor);
}
} |
1378df21-ca79-4ba9-a09e-065185c11af8 | 3 | public void physicsTick(PhysicsSpace space, float f) {
//get all overlapping objects and apply impulse to them
for (Iterator<PhysicsCollisionObject> it = ghostObject.getOverlappingObjects().iterator(); it.hasNext();) {
PhysicsCollisionObject physicsCollisionObject = it.next();
... |
672f0473-2a91-42c0-8330-20db10c4c135 | 4 | @Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_W:
keys[0] = true;
break;
case KeyEvent.VK_S:
keys[1] = true;
break;
case KeyEvent.VK_I:
keys[2] = true;
break;
case KeyEvent.VK_K:
keys[3] = true;
break;
default:
break;
}
... |
40f40e1b-7060-44bc-a431-858fafa037f1 | 4 | public Tile getTile(int x, int y){
if (x < Standards.CHUNK_SIZE && x >= 0){
if (y < Standards.CHUNK_SIZE && y >= 0){
return contents[x][y];
}
}
return null;
} |
edcd907f-dca1-4090-8713-bef30f5c0b5a | 3 | public static void sendFileRes
(
Socket sckIn
, String strId
, boolean blnRes
)
throws Exception
{
if
(
strId != null && strId.length() > 0
)
{
EzimDtxSemantics.initByteArrays();
String strRes = blnRes
? EzimDtxFileSemantics.OK
: EzimDtxFileSemantics.NG;
OutputStream osTmp = sck... |
7bb1ff4f-35ff-4daf-9cb1-8c687c14ac61 | 7 | public BinType getBinType(String type) {
if ("string".equalsIgnoreCase(type)){
return BinType.STRING;
} else if ("integer".equalsIgnoreCase(type)){
return BinType.INTEGER;
} else if ("blob".equalsIgnoreCase(type)){
return BinType.BLOB;
} else if ("list".equalsIgnoreCase(type)){
return BinType.LIST;
... |
bf7e8217-4d5d-49e6-9388-094a10fb2807 | 2 | public void sort(int start, int end) {
if (end - start <= 1) {
return;
}
int middle = (start + end) / 2;
Thread th = new Thread(new MergeSort(array, start, middle));
th.start();
sort(middle, end);
try {
th.join();
} catch... |
f9d95640-e65f-4a30-8bb4-aba21fdd1858 | 7 | private void addTestFruits() {
int maxCount;
double random;
Machine m;
BufferMachine bm;
Iterator<Machine> i = productionLine.iterator();
while (i.hasNext()) {
m = i.next();
if (m instanceof BufferMachine) bm = (BufferMachine)m;
else continue;
if (m instanceof HoldingBay) maxCount = 49;
e... |
4504f661-9d5e-47a2-94ab-8ae8b8b0399d | 2 | public Production(String lhs, String rhs) {
if(lhs == null) lhs = "";
if(rhs == null) rhs = "";
myLHS = lhs;
myRHS = rhs;
} |
c5ec8999-4b5b-4402-8b3e-f3fb08c4790a | 2 | @Deprecated
public Class<? extends APacket>[] getPackageClasses() {
//noinspection unchecked
return (Class<? extends APacket>[])classes.toArray();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.