method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
c126efc2-56c5-4504-98d2-d358c01d01b0 | 3 | public static StatInfo generateBundleStatistics(int id, float emn, float emx) {
ArrayList<Float> stats = new ArrayList<Float>();
if (Database.BUNDLES.size() < Database.DB_ARRAY.size())
return new StatInfo(stats, id, StatInfo.DONT_SHOW);
// TreeMap<Float, ArrayList<Integer>> BUNDLES
for (Entry<Float, float[... |
82a573d7-6d15-4d31-804e-c0334b4f6964 | 8 | public String waterCheck(MOB mob, Item I, Item container, StringBuffer msg)
{
if(I==null)
return "";
if(I.container()==container)
{
if(((I instanceof Drink))
&&(((Drink)I).containsDrink())
&&(CMLib.flags().canBeSeenBy(I,mob)))
msg.append(L("@x1 contains some sort of liquid.\n\r",I.name(mob)));
... |
82b3b0ae-53e6-440c-a7b6-03246cc8c034 | 9 | protected void handleSwitchEvent(SelectionKey key, SocketChannel sock) {
OFSwitch sw = switchSockets.get(sock);
OFMessageAsyncStream stream = sw.getStream();
try {
if (key.isReadable()) {
List<OFMessage> msgs = stream.read();
if (msgs == null) {
... |
b81c772b-0992-4827-95fa-ea0a946cdea1 | 8 | public synchronized boolean writeVar(String key, Object obj)
{
Utils.logger.log(Level.INFO, "Writting var " + key);
String value = obj == null ? "" : obj.toString();
List<String> oldConfiguration;
oldConfiguration = this.currentConfig;
FileWriter fileWriter;
try
{
fileWriter = new FileWriter(this.conf... |
2a55f6d6-4867-4d4d-aaf4-d27f87db72dc | 6 | public int read()
throws IOException {
if( this.isClosed )
throw new IOException( "Cannot read from a closed stream." );
int b;
// Are there still bytes left to read from the latest replacement?
if( this.currentReplacementBuffer != null ) {
b = this.currentReplacementBuffer.read();
if( this.curr... |
305af6cb-0ef1-4da0-8ddd-6a736e3c6077 | 8 | public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the string1:");
String str1 = scanner.next();
str1= str1.toLowerCase();
System.out.println("Enter the string2:");
String str2 = scanner.next();
str2 = str2.toLowerCase();
Map<Character, Inte... |
d9751e4e-5928-4dab-825e-52a8a3bbfa4c | 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 Component)) {
return false;
}
Component other = (Component) object;
if ((this.id == null && other.id != null) |... |
903822dd-719b-46ec-b5f5-f9e5c1a1a144 | 1 | private void btnRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoverActionPerformed
if(JOptionPane.showConfirmDialog(rootPane,"Você tem certeza que deseja "
+ "remover o item","",JOptionPane.OK_CANCEL_OPTION) == 0){
FormasPagamentoDAO dao = new Form... |
da85133a-9e13-440d-b839-4f395386a57d | 3 | private void generateMessages()
{
File messagesFile = new File(getDataFolder(), "messages.yml");
if (!messagesFile.exists())
{
messages = (messages1 = new NewYAML(messagesFile)).newYaml();
BufferedReader input = new BufferedReader(new InputStreamReader(getClassLoader().getResourceAsStream("messages.yml"))... |
e6557dbe-06c4-47f8-aa9b-9e8d798ecbb4 | 0 | @Test
public void findHandFromCardSet_whenHandContainsAtoT_returnsAceHighStraight() {
Hand hand = findHandFromCardSet(fourFlushWithStraight());
assertEquals(HandRank.Straight, hand.handRank);
assertEquals(Rank.Ace, hand.ranks.get(0));
} |
db3f046d-f16d-4440-a311-95db39ada359 | 9 | public int checkCollisions()
{
int check = -1;
// Comprobamos primero que PacMan no haya chocado y si choca si se puede comer al fantasma
for (Phantom phantom : phantoms) {
if (checkTouch(pacMan, phantom)) {
if (phantom.isEatable()) {
phantom.h... |
00986654-21d5-46ad-b9f9-2ee9c7453fb1 | 6 | private AbstractConnection connection( ConnectionType type, ItemKey<Connection> key, DefaultUmlDiagram diagram ) {
switch( type ){
case AGGREGATION:
return new AggregationConnection( diagram, key );
case COMMENT:
return new CommentConnection( diagram, key );
case COMPOSITION:
return new Compositi... |
987f8b66-54b4-47a8-adae-ad8f8f5bbbef | 5 | @Override
public boolean seqChangeEffect(Variant seqChange, ChangeEffects changeEffects) {
if (!intersects(seqChange)) return false;
if (seqChange.includes(this) && (seqChange.getChangeType() == VariantType.DEL)) {
changeEffects.add(this, EffectType.UTR_3_DELETED, ""); // A UTR was removed entirely
}else {
... |
8d05dbb1-ee32-40f9-8ac5-e0b36ab89352 | 7 | public int[] lpc() {
int phi[] = new int[n];
int plcp[] = new int[n];
lcp = new int[n];
phi[sA[0].index] = -1;
for (int i = 1; i < n; i++) {
phi[sA[i].index] = sA[i - 1].index;
}
int L = 0;
for (int i = 0; i < n; i++) {
if (phi[i] == -1)
plcp[i] = 0;
else {
while (i + L <... |
ccdcdc89-5213-47af-9669-ca5fd54dd9cf | 5 | @Override
public JTable display(){
//This creates a new array which is the same as result, apart from the title line, the first one in result.
int n = result.length-1;
String[][] newArray = new String[n][];
System.arraycopy(result,1,newArray,0,n);
//This array will be filled with the da... |
470012cc-3830-4054-9a05-8485c2ae9d3e | 4 | @Override
public E set(int i, E e) throws IndexOutOfBoundsException {
if (i < 0 || i > size)
throw new IndexOutOfBoundsException();
E element = null;
if (i + 1 > size) {
size++;
if (size > capacity)
growArray();
} else {
element = elements[getIndex(i)];
}
elements[getIndex(i)] = e;
ret... |
10a23310-36bf-4345-9e94-ed3a93fc5721 | 3 | double normalizedgeometricRange(Sample x[]) {
if (x.length == 0) {
return 0;
}
double min[] = new double[n];
double max[] = new double[n];
double mean = 0;
for (int i = 0; i < n; i++) {
min[i] = Double.POSITIVE_INFINITY;
max[i] = Dou... |
638ab5f9-5061-4778-8a17-3fd884c60fde | 2 | @Override
public boolean activate() {
if(Tabs.getCurrent() != Tabs.INVENTORY && hasSpinTicket()) {
return false;
}
return hasSpinTicket();
} |
86ea2387-6fbb-4a90-90ca-e2574142b3cc | 9 | public Fabrik(int laufzeit, int numLieferanten, int numMonteure, String filePfad) {
logger = new LoggerFactory().getLogger(Fabrik.class);
logger.info("Fabrik wird geoeffnet.");
this.laufzeit = laufzeit;
this.sekretariat = new Sekretariat();
//LagerMitarbeiter
lagerMita... |
2451ed65-791b-4eb9-8c17-5b2527aab1b6 | 9 | private void gatherAnnotations(Class<?> clazz) {
try {
// Loops through all methods
for (Method method : clazz.newInstance().getClass().getDeclaredMethods()) {
// checks for methods using the @EventHandler interface
if (method.isAnnotationPresent(Module... |
ff8c62af-0267-4714-8e9c-533a03405593 | 2 | private final String getLineWidth( int linenumber )
{
if ( linenumber < 10 )
{
return " ";
}
else if ( linenumber < 100 )
{
return " ";
}
else
{
return " ";
}
} |
2cedd559-b942-4638-a4c0-fea1d221de1a | 7 | static Constructor findConstructor(Class objectClass, Object[] params) {
// System.out.println("Finding Constructor in class " + objectClass);
Constructor[] methods = objectClass.getConstructors();
methodLoop:
for (Constructor method : methods) {
Class<?>[] parameterTypes ... |
53f6d4db-1de5-47cb-a6f7-21c84491821d | 2 | private String postMakeRoom(javax.swing.JTextArea Area) {
String bs = "";
int act = Area.getCaretPosition();
try {
String sig = Area.getText(act, 1);
if (sig.equalsIgnoreCase("\n")) {
Area.setCaretPosition(Area.getCaretPosition() + 1);
} else {... |
aba98757-bd3a-4b83-a7c0-2c99a8b9f51d | 8 | private void checkBetweens() {
HashMap<String,Integer> betweens = new HashMap<>();
HashMap<Integer,Integer> padCounts = new HashMap<>();
String between;
int len;
int keyCount = 0;
for (LangFileElement lfe: fileStructure) {
if (lfe.getType() == LangFileElemen... |
3dd9eb46-c3da-4e82-a03e-5275734033d6 | 6 | private JPanel getTreasureDisplayPanel(Loot loot, int max)
{
JPanel panel = new JPanel();
double test;
//First, we determine the dimensions (always a square)
if(max >= 0)
{
test = Math.sqrt(max);
}
else
{
int total = 0;
for(String treasure : Treasure.allTreasures())
{
total+= ... |
f3994ee3-1abe-4021-a366-d5b5a00d72c0 | 7 | @Override
public void enterPortal(MapleClient c) {
MapleCharacter player = c.getPlayer();
double distanceSq = getPosition().distanceSq(player.getPosition());
if (distanceSq > 22500) {
player.getCheatTracker().registerOffense(CheatingOffense.USING_FARAWAY_PORTAL, "D" + Math.sqrt(d... |
7fa3ad9f-b5a2-486b-a73a-e5c70c109719 | 1 | public static void save() {
JFileChooser fileChooser = new JFileChooser();
fileChooser.showSaveDialog(null);
try {
PrintWriter fichierSauvegarde = new PrintWriter(new FileOutputStream(fileChooser.getSelectedFile()));
fichierSauvegarde.print(grid.dump());
fichi... |
9cf16291-a483-406b-b5c5-6e4083f95e31 | 4 | @Override
public void caseADoopExp(ADoopExp node)
{
//for(int i=0;i<indent;i++) System.out.print(" ");
//indent++;
//System.out.println("(" + node.getOp());
inADoopExp(node);
if(node.getOp() != null)
{
node.getOp().apply(this);
}
indent++;... |
7f28e052-d785-4fcd-b9ca-c576ee77bf86 | 7 | public static void randTest() {
double labelCeil = 10.0;
Double unLabel = new Double(1.0);
double fracCon = 0.3;
int numVertices = 10;
int numLabels = 3;
Random rand = new Random(1847860);
HashMap<Integer,Double> ls = new HashMap<Integer,Double>(numLabels);
for (int i=0; i < numLabels; ) {
Integer ne... |
4f71f3a0-5d00-4de9-994b-fbd4a6d5539f | 1 | @Override
public void collideWith(Element e) {
super.collideWith(e);
if (e instanceof PlayerCTF)
((PlayerCTF) e).dropFlagOnAdjacentPosition(getGrid().getElementPosition(this));
} |
9e085b25-6845-4e20-8160-c31844211986 | 0 | public int getOrderId() {
return this.orderId;
} |
ec08f620-6790-414a-8014-eef7ceece78a | 4 | @EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerPreLoginEvent(PlayerPreLoginEvent event){
if(plugin.getConfig().getBoolean("DelayCheck"))
return;
if(plugin.isBlacklisted(event.getAddress())){
event.setKickMessage(plugin.getConfig().getString("DisconnectMessage"));
if(plugin.getConfi... |
5ab78592-61a5-4441-ba70-ef7866f7bff7 | 8 | public boolean cutoffPartialMatchP(boolean traceP) {
{ WhynotPartialMatch self = this;
{ double score = self.positiveScore;
double scorecutoff = self.dynamicCutoff;
int unknowngoalcutoff = self.unknownGoalCutoff;
boolean cutoffP = false;
if ((score == Stella.NULL_FLOAT) ||
... |
fb6a6ad5-74fd-4ed9-8b37-e75545ca608b | 6 | public static Object deserialize(JSONObject jsonObject, Class beanClass) throws NotSerializableException {
Field[] fields = beanClass.getDeclaredFields(); /*loading the field object for the class*/
Object beanStub = null;
try {
beanStub = beanClass.newInstance(); /*Creating an empty bean*/
} catch (Ins... |
dad47632-a1a9-4b92-9cf7-43fcbe343006 | 6 | public void loadObjects(Element docEle){
NodeList objectsList = docEle.getElementsByTagName("Objects");
Node objectsNode = objectsList.item(0);
Element objectElement = (Element)objectsNode;
String objectsPath = objectElement.getAttribute("FolderPath");
String objectPrefix = objectElement.getAttribute("Prefix"... |
c8739a16-a7eb-4362-859f-78351c961133 | 5 | public static boolean posNeg( int a, int b, boolean negative )
{
if ( negative )
{
return ( a < 0 ) && ( b < 0 );
}
else
{
return ( a < 0 ) && ( b > 0 ) || ( a > 0 ) && ( b < 0 );
}
} |
41b21b7d-1722-457f-a217-08f9c3ccc1bd | 0 | public void remove() { throw new UnsupportedOperationException(); } |
a440c068-cabf-4a2b-846a-9c8c25680d98 | 7 | public void rotateSelectedAtoms(BitSet bs, char axis, float angle) {
if (rotationMatrix == null)
rotationMatrix = new Matrix3f();
if (tempPoint3f == null)
tempPoint3f = new Point3f();
if (axisAngle == null)
axisAngle = new AxisAngle4f();
Point3f center = getCenterOfSelectedAtoms(bs);
switch (axis) {
... |
feca6c4e-a23f-48d6-8e1b-9f1cb01ee174 | 7 | private int zeroExplore(int startPostion, int depth, int dicrection, int lastFoundPlayer, LongBoard state) {
if(depth == 0) {
return lastFoundPlayer;
}
long mask = 1l <<(startPostion + dicrection);
if((state.boards[0] & mask) != 0) {
if(la... |
ca35d45d-1c31-4be9-9e9f-c680e9b35a76 | 9 | public static int findMinElement(int[] array) {
int len = array.length;
if(len == 0) {
return -1;
}
if(len == 1) {
return array[0];
}
int start = 0;
int end = len - 1;
while(start < end) {
int mid = (end+start)/2;
... |
ea090a1b-540b-483d-bb21-374f08b16c3e | 2 | private Map<Integer,Site> sitesHasVar(int index) {
Map<Integer,Site> sitesHasVar = new HashMap<Integer, Site> ();
for (int i: sites.keySet()) {
Site site = sites.get(i);
if (site.hasVariable(index)) {
sitesHasVar.put(i, site);
}
}
return sitesHasVar;
} |
c8bd2757-ee63-4ff9-a605-e45a8266917f | 2 | protected String getMapString() {
StringBuilder buf = new StringBuilder();
for (Tile[] map1 : map) {
for (int j = 0; j < map.length; j++) {
buf.append(map1[j].toString());
}
buf.append('\n');
}
return buf.toString();
} |
e04658dd-afa3-457b-8d34-c49744b69843 | 6 | @Test
public void readmeRequirement() {
Map<String, Integer> figureQuantityMap = new HashMap<>();
figureQuantityMap.put(KING.toString(), 2);
figureQuantityMap.put(QUEEN.toString(), 2);
figureQuantityMap.put(BISHOP.toString(), 2);
figureQuantityMap.put(KNIGHT.toString(), 1);
... |
f249ba07-14fe-4beb-904f-30f5bd50917f | 5 | public synchronized void updateHistogram() {
// System.out.println("quad is " + quad);
if (fixHoles) {
fixHoles = false;
int cnt = 0;
System.out.println("Hitting remaining pixels...");
for (int i = 0; i < ximlen; i++) {
for (int j = 0; j < yimlen; j++) {
if (img_alpha[i][j] == 0) {
int xi... |
39f0318f-2983-4ba0-8521-a6cbd2cb1806 | 3 | public ArrayList<Integer> getSingleInstances()
{
ArrayList<Integer> allPosNumbers = getAllPosNumbers();
int[] posNums = new int[9];
for(int i=0; i<allPosNumbers.size(); i++)
{
posNums[allPosNumbers.get(i).intValue()-1]++;
}
ArrayList<Integer> singleInstanc... |
2a7e7ec1-a392-43cd-8b3e-489311e023aa | 4 | public boolean fleetDestroyed()
{
if(fleet.size() == 0)
return false;
for(int y = 0; y < sea[0].length; y++)
{
for(int x = 0; x < sea.length; x++)
{
if(sea[x][y] == SHIP)
{
return false;
}
}
}
return true;
} |
c84b4a88-f982-4948-abed-6c351efcbb7d | 2 | public boolean doTransformations() {
StructuredBlock last = flowBlock.lastModified;
return super.doTransformations()
|| CombineIfGotoExpressions.transform(this, last)
|| CreateIfThenElseOperator.createFunny(this, last);
} |
708990d6-3ee7-431a-942f-3ec6d2d57720 | 3 | @Override
public Key next() {
if (!hasNext())
throw new NoSuchElementException();
Node node = stack.pop();
if (node.right != null)
stack.push(node.right);
if (node.left != null)
stack.push(node.left);
return node.key;
} |
ca4222e3-6920-4306-8c73-2e2fc220e3f9 | 0 | public static PrivateStaticFieldSingleton getInstance() {
return INSTANCE;
}; |
4f8a2b7b-2d61-404f-a2d7-e534fbd9c6ba | 8 | @Override
public void runOnEngine(FuzzyEngine engine) throws FuzzyEngineException {
IDomain domain = engine.getDomains().get(domainName);
FuzzySet old = engine.getSets().get(name);
double[] membership;
if(old == null) {
FuzzySet set = new FuzzySet(name, domain);
engine.getSets().put(name, set);
me... |
59948d86-09f5-4a8f-8308-876e12f18616 | 2 | public double[] rawItemTotals(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.rawItemTotals;
} |
f3e5d788-94c0-44ea-89b9-366520a79496 | 0 | public Train getTrain() {
return this._train;
} |
06cdbb87-5aa4-47a7-b7ee-ccfaacee5db7 | 2 | public static void doSessionTxWork( Work work ) {
SessionFactory factory = getSessionFactory();
// Non-managed environment idiom with getCurrentSession()
try {
factory.getCurrentSession().beginTransaction();
// do some work
work.work(factory.getCurrentSession());
... |
e413051f-fb31-44cb-a379-8ed96c59e125 | 1 | public void runFrameCreateAlgo(){
if(createAlgo == null){
createAlgo = new FrameCreateAlgo();
}
} |
5c3fb5ee-05b6-4961-a7e1-027c25dd21c4 | 4 | public RandomSystem() {
CelestialBody sun = new CelestialBody(1000, 500, 18000, 25);
sun.setColor(Color.BLACK);
addStar(sun);
int numOfPlanets = 60;
for (int x = 0; x < numOfPlanets; ++x) {
int mass = random.nextInt(200) + 300;
int xPos = random.nextInt(2000);
int yPos = random.nextInt(1000);
Cel... |
6cd2632e-0b73-4eb8-a813-f21d1e440f8c | 2 | public OptionPopup(final LessFileStatus lfs, final Runnable disablecall, final Runnable forcerender) {
if(Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
JMenuItem item1 = new JMenuItem("open " + lfs.getLessName());
this.add(item1);
item1.addActionListener(new ActionListener() {
@Overrid... |
a90ba4f8-5cc4-4cc6-b823-f4bdf7760ae9 | 2 | public IRemoteLoadable make(Class<?> _class)
throws InstantiationException, IllegalAccessException {
if (IRemoteLoadable.class.isAssignableFrom(_class))
return (_class.asSubclass(IRemoteLoadable.class).newInstance());
return (null);
} |
dcba070a-a63e-4341-85bd-571f8b2c7a03 | 6 | @Override
public void doStep() {
final ProcessBuilder n = new ProcessBuilder(ConfigManager.YOUTUBE_DL.getAbsolutePath(),
"-o", ConfigManager.TEMP_DIR.getAbsolutePath() + ConfigManager.DS
+ "%(title)s.%(ext)s", entry.getWebURL());
final CLI y = new CLI(n);
y.addProcessListener(new ProcessAdapter() {
... |
23beda0a-cff2-4beb-99fb-4e6ef0005e8b | 9 | public List<Variant> createVariantList(LIBSVMResult result) throws IOException {
//Check validity of result
File resFile = new File(result.getFilePath());
if (! resFile.exists()) {
throw new IllegalStateException("Result file " + result.getFilePath() + " does not exist");
}
if (result.getPositionsFile() =... |
ea414775-24a7-49ba-a997-02f0e852a499 | 4 | public void fixPosition() {
while(x <= -width) x += width;
while(x >= width) x -= width;
while(y <= -height) y += height;
while(y >= height) y -= height;
} |
62c49f64-2989-4e33-a43d-2f1b1b6d3963 | 5 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CustomCategoryColorPK that = (CustomCategoryColorPK) o;
if (accountId != that.accountId) return false;
if (categoryId != that.categoryId) retur... |
870f6f3d-3d51-47a1-a4b2-efa13645394f | 1 | public int maxDepthRec(TreeNode root) {
if(root == null) return 0;
return Math.max(maxDepthRec(root.left), maxDepthRec(root.right)) + 1;
} |
2bc45c1d-a49f-442b-afd4-b6772008c363 | 3 | protected void acceptPosition() {
handoverTurnJbtn.setEnabled(true);
acceptPositionJbtn.setEnabled(false);
withdrawJbtn.setEnabled(true);
submitJbtn.setEnabled(true);
debateSelected.setAcceptPositionTeam(teamType);
debate.editDebat(debateSelected);
turnLeftJlbl.setText("Turns left: " + debateSelected.getT... |
0ace7d02-820e-47f5-ae88-cbb1ff657182 | 8 | public void startElement(String uri, String localName, String qName, Attributes attributes)
throws FileFormatException {
if(qName.equals("bmoviesender")) {
// ignore
}
else if(qName.equals("sender")) {
String movie = attributes.getValue("movie");
if(movie == null) {
throw new FileFormatEx... |
717e5ec4-fb88-461d-bfe1-2789b3a10098 | 3 | private void loadDirectory(String folderName, String optionsFolder, String regexFormat) {
JFileChooser ubicacion = new JFileChooser();
ubicacion.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int seleccion = ubicacion.showOpenDialog(null);
if (seleccion == JFileChooser.APPROVE_OPT... |
fe44d103-468d-4906-b4a6-1f294deb6d13 | 5 | int minValue(Board cB, int ply) {
int[] moves = new int[7];
int lowest = 0;
for (int i = 0; i < 7; i++) {
moves[i] = Integer.MAX_VALUE;
if (cB.validMove(i)) {
cB.makeMove(i);
if ((cB.winnerIs() == 0) && ply>0) {
moves[i] = maxValue(cB,ply-1);
}
else {
moves[i] = -cB.... |
4a12ca8a-a9a4-47a0-a798-298b0179fab5 | 7 | public HtmlColor getFontHtmlColor(FontParam param, String stereotype) {
String value = null;
if (stereotype != null) {
checkStereotype(stereotype);
value = getValue(param.name() + "fontcolor" + stereotype);
}
if (value == null || HtmlColor.isValid(value) == false) {
value = getValue(param.name() + "fon... |
cdc1ab5b-d515-4a66-b729-60ea2038ab08 | 3 | public static void main(String[] args) {
System.out.println(args[0]);
System.out.println(args.length);
// Generation mode
if (args.length ==1) {
String printHash = generateHash(args[0]);
System.out.println(printHash);
System.out.println("\n");
}else {
try {
hashCode = args[0];
has... |
67a0ab76-5197-4b9a-af21-ea2dd45769ae | 0 | public int nextInt(int n) {
// calcualte next element in series
s.add(s.get(counter + 3).multiply(new BigInteger("22695477")).add(new BigInteger("1")));
// calculate series x from element i in s
//BigInteger result = (s.get(counter+4).divide(new BigInteger("65536"))) .mod(new BigInteger... |
380ca371-71b1-4f4b-bcb6-aed96721731e | 0 | public XStoreFault getFaultInfo() {
return xStoreFault;
} |
23cf6791-0c06-4fa3-9655-a8a2385f5332 | 7 | public List<Ability> returnOffensiveAffects(MOB caster, Physical fromMe)
{
final MOB newMOB=CMClass.getFactoryMOB();
final List<Ability> offenders=new Vector<Ability>(1);
for(int a=0;a<fromMe.numEffects();a++) // personal
{
final Ability A=fromMe.fetchEffect(a);
if((A!=null)
&&(A.canBeUninvoked())
... |
6e3544f3-5b4d-46f7-ba57-b9bd28972aed | 8 | public boolean update(int mx,int my){
boolean go = (mx>x+8 && mx<x+sx && my>y && my<y+sy && parent.isVisible() && visible);
if(go){
if(data!=null) mbi.action(name+data,parent);
if(data==null) mbi.action(name,parent);
}
return (go);
} |
3bfe47b3-7d64-4e8c-9745-222a4131da42 | 4 | public void transformSuperIfaces() {
if ((Main.stripping & Main.STRIP_UNREACH) == 0)
return;
Collection newIfaces = new LinkedList();
ClassIdentifier ancestor = this;
while (true) {
addIfaces(newIfaces, ancestor);
ClassIdentifier superident = Main.getClassBundle()
.getClassIdentifier(ancestor.sup... |
94d402a5-f284-43d7-b347-400e7ebc2416 | 5 | private void handleEntities() {
//List of entities to throw away later
List<Entity> trash = new LinkedList<Entity>();
for (Entity e: entities){
Entity other = getIntersectingEntity(e);
if(other != null) {
e.collide(other);
}
e.update();
if(e instanceof Destructible) {
Destructibl... |
b55d42ea-cfa6-466d-8c9b-a045ca167233 | 4 | public static Path writeMatrix(double[][] matrix, Path path,
HamaConfiguration conf) {
SequenceFile.Writer writer = null;
try {
FileSystem fs = FileSystem.get(conf);
writer = new SequenceFile.Writer(fs, conf, path, IntWritable.class,
VectorWritable.class);
for (int i = 0; i < matrix.length; i++) {
... |
3e5b8559-3139-42aa-b5d5-75af1ee859fd | 4 | @Override
public void drawAdditive(Graphics G, int viewX, int viewY)
{
if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
{
G.setColor(yes);
G.fillArc(((int)(X-radius)-viewX)*3, (int)((Y-radius)-viewY)*3, radius*6,radius*6, 0, 360);
}
} |
9a555e72-c3e4-4244-a825-ea0ec4ad0367 | 7 | protected synchronized boolean makeRoomForPacket()
{
Packet pkt;
int src_outputPort;
String src_outputPort_str;
int dst;
String dst_str;
boolean isFile = false;
int glID;
//String filename;
/***********
System.out.println("\n" + sup... |
15ad288d-d3ce-45b7-9151-b06190690023 | 4 | @RequestMapping(value = {"/SucursalBancaria/{idEntidadBancaria}"}, method = RequestMethod.POST)
public void insert(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse, @PathVariable("idEntidadBancaria") int idEntidadBancaria, @RequestBody String json) throws JsonProcessingException {
try... |
d9041318-11dc-4367-9ed2-583e8c73de4b | 5 | @Override public void setOption(String opname, boolean b){
if(opname == "Ages"){ages = b; if(b == false){outmode = 1; fades = false; if(active){age = 1;}else{age = 0;}}else{outmode = 2;}}
if(opname == "Fades"){fades = b; if(b){ages = true;}}
} |
e95223ea-fd0d-48a6-92fd-c18c4e2f39c1 | 1 | public void extractNumber(String input){
String numRegex = "(\\d+(\\.\\d*)?)";
// String numInput = ("3 + 2 / 4.0 * 1 ^ 17.34");
// Matcher p = Pattern.compile(numRegex).matcher(numInput);
p = Pattern.compile(numRegex);
m = p.matcher(input);
//extractNumbers("3 + 2 / 4.0 * 1 ^ 17.34") = [3, 2, 4.0, 1, 1... |
d24ad18e-b937-4155-b9a0-b7e2addcba9e | 4 | public void affectTache(PrintWriter out, String [] choix){
try{
if(choix[2] != null && taches.containsKey(Integer.parseInt(choix[1]))){
taches.get(Integer.parseInt(choix[1])).setAffectation(choix[2]);
taches.get(Integer.parseInt(choix[1])).setStatus("affectée");
if(!logins.contains(choix[2]))
logi... |
104f6b37-4f42-4e11-8066-979e731aa8b8 | 4 | private boolean createTable(Connection connection) {
try {
DatabaseMetaData meta = connection.getMetaData();
ResultSet rs = meta.getTables(null, "ORG", "MUSIC",new String[] {"TABLE"});
boolean foundIt = false;
if (rs.next()) {
foundIt = true;
}
if (!foundIt) {
... |
bf4a8f8c-7624-4059-a81d-b31b9e8e6b54 | 5 | @Override
public Job reserve(Integer timeoutSeconds) {
Job job = null;
String command = (timeoutSeconds == null) ? "reserve" : "reserve-with-timeout " + timeoutSeconds.toString();
Request request = new Request(command, new String[] { "RESERVED" }, new String[] { "DEADLINE_SOON",
"TIMED_OUT", }, null, Expecte... |
dfbaff8b-ec0b-4a17-99a5-4710b20baaa7 | 3 | private void parseStartLevel(Node node) throws TemplateException {
try {
XPath xPath = XPathFactory.newInstance().newXPath();
NodeList nodeList = (NodeList) xPath.evaluate("element/interleave/ref", node, XPathConstants.NODESET);
for (int i = 0, len = nodeList.getLength(); i < len; i++) {
Node currentNode... |
c9947dec-eac6-4f0d-958c-dd69fae56418 | 0 | @Test
public void afterPushPopStackIsEmpty() {
s.push(0);
s.pop();
assertTrue(s.isEmpty());
} |
9a3db55f-0224-4f6e-96e3-41d1f3153e8a | 9 | public boolean tryMove(double dx, double dy) {
byte ret = this.level.getPhysicHandler().checkCollision(level, this,
dx, dy);
if ((ret == WorldPhysicHandler.entityDies)) {
this.die();
return false;
}
boolean moveUp = false;
if ((ret & WorldPhysicHandler.allowedMovementHorizontally) == 0) {
// If... |
70fb58f5-16a6-421c-990d-8d4a79ddef9b | 1 | public InlineStats getInlineStats() {
if (inlineStats == null) {
inlineStats = new InlineStats();
}
return (inlineStats);
} |
793decde-29af-4c6f-ab00-0cdaad7d01a0 | 1 | public static void main(String[] args) throws Exception {
for (int i = 0; i < 10; i++) {
Thread daemon = new Thread(new SimpleDaemons());
daemon.setDaemon(true);
daemon.start();
}
System.out.println("All daemons started");
TimeUnit.MILLISECONDS.sleep(1... |
c87b1dbc-e59a-4e46-9531-8c486e896045 | 7 | public void run() {
try {
//System.out.println("Executing DispatchTask" + msg);
long oid = msg.getLongProperty(JMSRemoteSystem.MSG_PROP_OBJECT);
long requestId = -1;
if (!oneway) {
requestId = msg.getLongProperty(JMSRemoteSystem.MSG_PROP_REQUEST);
... |
1d645192-da0c-4488-ad72-a1ff1b5849f0 | 5 | public boolean verifierCoup(Coup coup) {
boolean ok = true;
if ((coup.pos.x > longueur) || (coup.pos.y > largeur)) {
ok = false;
} else if ((coup.pos.x <= 0) || (coup.pos.y <= 0)) {
ok = false;
} else if (etatPlateau[coup.pos.x][coup.pos.y] != 0) {
ok ... |
92e79b41-4c07-46bb-b7fe-ec4c3f06308c | 0 | public boolean equals(Card card) {
return (mySymbol.equals(card.getSymbol()));
} |
04382e29-a9e5-4879-af83-f99ec36eeba9 | 2 | public int getCostByPID(Statement statement,String PID)//根据PID获取预订费用
{
int result = -1;
sql = "select cost from Park where PID = '" + PID +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getInt("cost");
}
}
catch (SQLException e)
{
System.out.prin... |
b1471d69-db2a-4133-b4d4-cb415fd278b8 | 8 | private void parsePacket(byte[] data, InetAddress address, int port) throws UnknownHostException {
String message = new String(data).trim();
PacketTypes type;
try {
if (message.length() < 2) type = PacketTypes.INVALID;
else type = Packet.lookupPacket(Integer.parseInt(message.substring(0, 2)));
} catch (Nu... |
1bd2f0d7-6e27-4708-a3af-e5352c0c9d20 | 1 | public void afterReturn(JoinPoint joinPoint, Object retVal) {
try {
OperateLog log = this.generateLog(joinPoint);
LOGGER.info(log.toString());
} catch (Exception e) {
LOGGER.error("Fail to generate common operate log: "
+ e.getMessage());
}
} |
372df060-1db3-436c-8703-f5fc868c7729 | 8 | @Override
public boolean onCommand(CommandSender sender, Command cmd, String lable,
String[] args) {
Player p = (Player)sender;
if(cmd.getName().equalsIgnoreCase("deltele")){
if(p.hasPermission("zelonia.deltele") && p.isOp()){
if(args.length == 0){
String world = p.getWorld().getNam... |
749121c1-401c-41ab-99cd-6c7bea72792f | 0 | public DataStructures getStructureIn(){
return dataOut;
} |
40de374c-1d11-469e-bac9-1b29351efae0 | 1 | private boolean isMineshafterPresent() {
try {
Class.forName("mineshafter.MineServer");
return true;
} catch (Exception e) {
return false;
}
} |
e447e683-fd96-44ea-91d8-6f46090e5eed | 9 | protected void printTopWordsDistribution(int topK, String topWordFile) {
Arrays.fill(m_sstat, 0);
System.out.println("print top words");
for (_Doc d : m_trainSet) {
for (int i = 0; i < number_of_topics; i++)
m_sstat[i] += m_logSpace ? Math.exp(d.m_topics[i])
: d.m_topics[i];
}
Utils.L1Normaliza... |
d6041e50-0753-4310-80e9-c2776bdb358f | 5 | public int sqrt(int x) {
if (x<=0)
return 0;
if (x <4){
return 1;
}
int start = 1,end = x/2;
while(start<=end){
long mid = (start+end)/2;
if (mid*mid == x)
return (int)mid;
else if (mid*mid>x){
... |
dc695fed-6742-4598-b29a-f9010449f93e | 1 | private void jButtonModifieVilleValideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifieVilleValideActionPerformed
Ville ville = (Ville)this.jComboBoxModifieVilleList.getSelectedItem();
paysid =ville.getIdpays();
try {
Requetes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.