method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
74ecad50-9908-423b-9a75-ccbb29a825f6 | 2 | @Override
public void doLogic() {
if (inputList[0] == true){
this.power = true;
this.solved = true;
} else {
this.power = false;
}
if (solved == false){
inputList[0] = false;
}
} |
5e9095c6-c38e-416e-99e4-e962ddb14484 | 3 | public static void quizConnectionsChanged(ArrayList<QuizDataObject> quizList) {
for (QuizDataObject q : quizList) {
for (QuestPoint p : campaign.getQuizes()) {
if (Integer.parseInt(q.getId()) == p.getId()) {
p.setWrong(q.getWrong());
p.setGoTo(q.getCorrect());
break;
}
}
}
} |
15ada20e-501d-42d7-9e1c-8cc6b8194269 | 1 | @Override
public void setLayout(LayoutManager mgr) {
if (mgr instanceof PrecisionLayout) {
super.setLayout(mgr);
} else {
throw new IllegalArgumentException("Must use a PrecisionLayout."); //$NON-NLS-1$
}
} |
540e4aee-1623-4fb7-8115-3ac043ecf0a9 | 6 | public LinkedList<Theater> getAllTheaters(int zone){
LinkedList<Theater> result;
switch(zone){
case 1:
result = TheaterCatalog.getAllTheaters(zone);
if(result == null)
result = loadTheatersFromDisk(NorthTheatersFile);
TheaterCatalog.addTheater(result);
return result;
case 2:
result = The... |
250f2fc9-07b2-49ab-a037-db0de28270e5 | 2 | public static Integer getInteger(Object obj){
if(obj == null) return null;
try {
Integer i = Integer.parseInt(obj.toString());
return i;
}
catch(Exception e){
return null;
}
} |
da808071-09e1-4108-bb41-556ac2b0f551 | 9 | static void sortWith0(long[] a, int fromIndex, int toIndex, LongComparator cmp) {
final int length = toIndex - fromIndex + 1;
if (length < 2)
return;
if (length == 2) {
if (cmp.gt(a[fromIndex], a[toIndex])) {
long x = a[fromIndex];
a[fromIn... |
b0fdd520-79e7-474a-963c-101ea2ff6819 | 2 | public boolean matches( Class<?> clazz )
{
return Modifier.isAbstract( clazz.getModifiers() ) && !clazz.isInterface();
} |
feeac2bc-abc0-4883-9c63-3585c7206474 | 6 | public static Surrogate cachedGoalOperator(Proposition goal) {
{ Keyword testValue000 = goal.kind;
if ((testValue000 == Logic.KWD_ISA) ||
((testValue000 == Logic.KWD_PREDICATE) ||
(testValue000 == Logic.KWD_FUNCTION))) {
{ GeneralizedSymbol operator = goal.operator;
if... |
3fc3fe9e-3012-4d33-8e6e-1a06cf312552 | 9 | public static void invokeGetTransactionStatus(AmazonFPS service, GetTransactionStatusRequest request) {
try {
GetTransactionStatusResponse response = service.getTransactionStatus(request);
System.out.println ("GetTransactionStatus Action Response");
... |
72943971-2af5-48cd-8f10-8b9000634ffb | 1 | public void rotCW() {
// Rotations : (a;b) (b;-a) (-a;-b) (-b;a)
// Rotation : (a;b) (a-x;b-y) (b-y;x-a) (b-y+x;x-a+y)
synchronized (this) {
for (int i = 0; i < etat.length; i++) {
etat[i].setValue(etat[i].get(1) - centre.get(1) + centre.get(0), centre.get(0) - etat[i... |
97d11f87-c5c0-4ccb-8a64-6dcb64d6f4ee | 9 | public void actionPerformed(ActionEvent e)
{
JButton b = (JButton)e.getSource();
if (b == roll)
{
if (player.getCanRoll()) player.rollDice();
}
if (b == upgrade)
{
if (player.getCanUpgrade()) player.upgrade();
else JOptionPane.showMessageDialog(null,"Yo... |
75c858e5-39c0-416c-b122-71548531669a | 1 | public static void main(final String[] args) {
final String data = getDefaultDataFile();
try {
call(data);
} catch (final Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
9cb3b796-1e67-486f-b7bd-db38dba882ff | 3 | private static void createDictionary() {
System.out.println("You are starting with the new dictionary. Start to enter words and deffinitions.");
System.out.println("To finnish, do not enter new word, but just hit enter.");
sc = new Scanner(System.in);
while(true){
System.out.print("Enter new word : ");
... |
238fd1f2-d21e-4750-b7ce-734c7a678ff5 | 8 | private static final String[] getNamesInternal(Map props) {
String[] all = new String[] {
Registry.SASL_SRP_MECHANISM,
Registry.SASL_CRAM_MD5_MECHANISM,
Registry.SASL_PLAIN_MECHANISM,
Registry.SASL_ANONYMOUS_MECHANISM
};
List result = new ArrayList(4);
int i;... |
bcaef807-9fa0-465b-88e8-f0f11beb6ba0 | 0 | public void setGetAccountRequest(GetAccountResponse getAccountResponse) {
this.getAccountResponse = getAccountResponse;
} |
76a8462f-a746-443c-b59d-eee55c6fc274 | 7 | public double weightedVariance_of_ComplexImaginaryParts() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
boolean hold2 = Stat.nEffOptionS;
if (nEffReset) {
if (nEffOptionI) {
Stat.nEf... |
2589f252-74f9-477c-bc21-4dcf92ac2d09 | 1 | public static void show(ArrayList<Long> graf){
int packSize = Params.nPacks * Params.packSize;
for(int i = 0 ; i < Params.nTests ; i++)
System.out.print(Integer.toString(packSize * (i+1)) + ":" + Long.toString(graf.get(i)) + "\n");
} |
9e7cc732-d136-4056-a58f-d18f9b89d406 | 3 | private void laskeUusiRivihinta(ArrayList<Tilausrivi> tilausrivit,
int kplmaara, int i) {
if (tilausrivit.get(i).getJuoma() != null) {
JuomaService service = new JuomaService();
double rivihinta = service.laskeRivihinta(tilausrivit.get(i).getJuoma(), tilausrivit.get(i).getKokoStr(), kplmaara);
til... |
3fa3e3c7-690a-4297-9afd-20eac95d6513 | 8 | public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
if (var2 >= -32000000 && var4 >= -32000000 && var2 < 32000000 && var4 <= 32000000) {
if (var3 >= 0) {
if (var3 < 128) {
if (this.chunkExists(var2 >> 4, var4 >> 4)) {
... |
84181b5f-79ec-45d8-80b8-6a5d443b4ce0 | 7 | public ArrayList<Book> searchBook(int searchType, String criterion) {
ArrayList<Book> searchList = new ArrayList<>();
for (Book book : bookList.getBookList()) {
if (searchType == 0) {
if (book.getTitle().contains(criterion)) {
searchList.add(book);
}
} else if (searchType == 1) {
if (book.get... |
8633a810-a03a-4f8a-aac4-5a71fa4504a7 | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Graphics other = (Graphics) obj;
if (height != other.height)
return false;
if (id != other.id)
return false;
if (rotation != other.rota... |
42cd4b37-57e4-4069-92ab-67091cdec62b | 3 | private void doXObject(PDFObject obj) throws IOException {
String type = obj.getDictRef("Subtype").getStringValue();
if (type == null) {
type = obj.getDictRef ("S").getStringValue ();
}
if (type.equals("Image")) {
doImage(obj);
} else if (type.equals("Form... |
525bd709-db27-48da-98e2-e0a2a59b1fe0 | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(mob.isInCombat()&&(mob.rangeToTarget()>0))
{
mob.tell(L("You are too far away to touch!"));
return false;
}
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
... |
9574a1a0-6b4f-4ee6-864e-cf5a97b1575a | 1 | public int getPages(int intRegsPerPag, ArrayList<FilterBean> alFilter, HashMap<String, String> hmOrder) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getPages("entrada", intRegsPerPag, alFilter, hmOrder);
oMysql.desconexion();
... |
f5a65287-1133-42cd-83af-da21eb791bfe | 8 | private void unfilterPaeth(byte[] curLine, byte[] prevLine) {
final int bpp = this.bytesPerPixel;
int i;
for(i = 1; i <= bpp; ++i) {
curLine[i] += prevLine[i];
}
for(int n = curLine.length; i < n; ++... |
1764c533-73da-4863-b68b-77c518ebceb0 | 5 | public static void main(String... args) {
System.out.println("Startng ProtocolTester v0.1");
Scanner input = new Scanner(System.in);
System.out.println("Please enter hostname to connect to:");
String hostname = input.next();
System.out.println("Please enter the port to connect ... |
09fc3638-e9b7-4218-8de7-71a0ec2ffb09 | 9 | public void mouseReleased(MouseEvent mouseEvent) {
if (treePane.getDragRectangle() != null) {
Set<Node> selectedNodes = treePane.getNodesAt((Graphics2D) treePane.getGraphics(), treePane.getDragRectangle().getBounds());
if (!mouseEvent.isShiftDown()) {
treePane.clearSelec... |
3d4fd144-abe8-4cf4-87f7-76b6c00e07f9 | 5 | public static String expectedRemotePath(Case CASE) {
String result = null;
switch (CASE) {
case CASE_1:
result = "0001";
break;
case CASE_2_3:
result = "001";
break;
case CASE_4:
result = ... |
0a05168d-e18b-488e-b9e3-4e692dd08cab | 6 | private synchronized SSLContext ctx() {
if (ctx == null) {
TrustManagerFactory tmf;
KeyManagerFactory kmf;
try {
ctx = SSLContext.getInstance("TLS");
tmf = TrustManagerFactory.getInstance("PKIX");
kmf = KeyManagerFactory.getInst... |
ce33637c-291f-444f-96c5-3ff316402e75 | 6 | private static int[][] triangulate(int[] sides) {
boolean[] discard = new boolean[sides.length];
List<int[]> triangles = new ArrayList<>();
int index = 0;
for (int i = 0; i < sides.length - 2; i++) {
int[] tri = new int[3];
for (int j = 0; j < 3; j++) {
if (index < sides.length) {
if (!discard... |
66d3baf5-0e83-44aa-8c1a-3311dea10453 | 9 | public boolean codeExists(String code, String currentPack) {
if(code == null || code.equals("")) return false;
ArrayList<ModPack> packs = FileUtils.packFromCode(code);
if(packs != null) {
ModPack pack = packs.get(0);
if(pack.shortName != null &&
!pack.shortName.equals("") && !currentPack.equals(pack.s... |
398b4577-467d-4cca-8761-68924d155978 | 0 | public List<Destination> getDestination() {
return destination;
} |
a54beaac-b1e1-4e48-9ae8-36b115bf133c | 6 | public void draw(Graphics g) {
String[] data = this.data.split(":");
g.setColor(Color.white);
int v = 0;
for (int i = 20; i < 360; i += 100) {
g.drawRect(20, i, 200, 40);
for (int j = 0; j < 3; j++) {
if (!"".equals(this.data)) {
... |
cec99f81-5b5e-4c07-b563-d4f4fcf912bc | 9 | public void reloadPlugin(CommandSender sender, String args) {
if (args.equalsIgnoreCase("xpShop")) {
plugin.PlayerLogger((Player) sender, "Please wait: Reloading this plugin!", "Warning");
}
if ("all".equalsIgnoreCase(args) || "*".equalsIgnoreCase(args)) {
for (Plugin pl : Bukkit.getPluginManager().getPlug... |
4f429eaa-5df0-4c87-aaa6-e85603e9fdbd | 7 | public void useIndexesToDuplicateTables() {
System.out.println("Creating table duplicates based on indexes");
logger.info("Creating table duplicates based on indexes");
List<Table> listOfTables = new ArrayList<Table>(schema.getTables());
for (Table table : listOfTables) {
if (!table.isDeleted()) {
Table... |
e8617fa4-06f7-451e-9d0b-ffaf2be2da45 | 5 | public static HashSet<Integer> testAtt(ResultSet rs, double percent) throws SQLException {
int columnCount = rs.getMetaData().getColumnCount();
int[] testAtt = new int[columnCount];
int rowCount = 0;
HashSet<Integer> passAtt = new HashSet<>();
while (rs.next()) {
for ... |
82339c1f-bc94-4474-873a-01826b99c9ce | 8 | public void actionPerformed (ActionEvent e){
String c = e.getActionCommand ();
if (c.equals ("choose_infile")){
fchooser.showOpenDialog (this);
inf = fchooser.getSelectedFile();
infileL.setText ("Input file: " + inf.getAbsolutePath());
String infname = inf.getAbsolutePath();
if (infname.contains(".mo... |
de984624-3648-4989-ae29-34a1da99018e | 8 | public Object [][] getDatos(){
Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String ca... |
ae842468-fd99-4211-bae1-8eae9d762766 | 0 | public Vesper(int room) {
super(new DarknessJupitel(), new SuicideBombing(), 50.0*room, 160.0*room, 70.00*room, 2.0*room, 100.0*room, 30.0*room, "Vesper");
} // End DVC |
f0f55e2a-8aef-4f62-bcf2-ceaa3a6e3b92 | 4 | public void copyTo(GameActor a) {
for(BaseComponent bc : components.values()) {
BaseComponent bc2 = a.getComponent(bc.getName());
if(bc2 != null) {
bc.copyTo(bc2);
}
}
for(String comp : enabledComponents.keySet()) {
if(enab... |
68247c96-6573-42c4-b2ed-028d22956582 | 2 | public void visitCallStaticExpr(final CallStaticExpr expr) {
for (int i = 0; i < expr.params.length; i++) {
if (expr.params[i] == from) {
expr.params[i] = (Expr) to;
((Expr) to).setParent(expr);
return;
}
}
expr.visitChildren(this);
} |
2f352517-7496-4cd5-8b34-d680d8174868 | 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 fe... |
77d4edc2-d796-4b0d-98fa-b491d819b9c0 | 0 | public DDALine(Excel ex1, Excel ex2)
{
begin = ex1;
end = ex2;
this.setColoredExes();
} |
4b0f21cc-a105-458c-9f3b-99f609a015f4 | 5 | public final BooleanProperty selectedProperty() {
if (null == selected) {
selected = new BooleanPropertyBase() {
@Override protected void invalidated() {
if (null != getToggleGroup()) {
if (get()) {
getToggleGrou... |
d79f8b66-e992-4708-875b-0610493b64a4 | 2 | public String toString() {
StringBuilder result = new StringBuilder(":");
result.append(c);
result.append("(");
for (Data data : d) {
result.append(data);
}
result.append(")");
if (next != null)
result.append(next);
return result.to... |
cd246eb3-eb88-4e09-936c-e73ece6ec3fe | 3 | public double[] getCoordinates(StringTokenizer tokenizer)
throws ParseException {
List<Double> coordinates = new ArrayList<Double>();
while (tokenizer.hasMoreElements()) {
coordinates.add((double) getInteger(tokenizer));
}
// Throw exception if missing coordinate.
if (coordinates.size() % 2 == 0) {
... |
ecfe5e0c-53db-42fb-b1d3-ea392c3a18cb | 9 | public void reduce(Text key, Iterable<Text> values, Context context) {
String strKey = key.toString();
if(strKey.startsWith("target_")){
Double sum = 0.0;
for (Text value : values){
sum += Double.parseDouble(value.toString());
}
try {
context.write(new Text(key.toString()), new Text(sum.toStr... |
5d782deb-aac4-4058-ba39-65ba808cb68f | 7 | @Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof Attaque && super.equals(obj)) {
Attaque att = (Attaque) obj;
return this.nom.equals(att.nom) && this.degats == att.degats
&& this.bonus_char == att.bonus_char
&& this.description.equals(att.description)
&& this.energ... |
5aed906c-4235-4eeb-a33f-a35d05e38143 | 3 | private GameState freedSlaveNightAction(GameState state, Card card, boolean output)
{
GameState end = new GameState(state);
Color faction = card.getFaction();
Player player = end.getPlayer(faction);
int val = card.getValue();
int extraGold = 0;
for(Card c : player.getDen())
{
if(c.getValue() > val)... |
95148dc7-f56f-493f-9cda-9e2d765af640 | 8 | @Override public String reasonForIllegality(State s) {
if (s.currentPlayer() != player) return "it's not your turn";
PlayerState p = s.playerState(player);
if (p.drawn_card != null) return "you drew a card and now must decide what other card to draw";
if (p.drawn_missions != null) return "you drew mission cards... |
3fea1c51-579f-4637-a2bc-f28ad987cf66 | 7 | @Override
public void rotate(double winkel) {
if (winkel > 0) {
if (arc + winkel > 360) {
winkel = (winkel + arc) - 360;
Movement.rotate(Movement.Type.TURN_LEFT);// TURN_RIGHT
while (arc > winkel)
;
} else {// ok
winkel = winkel + arc;
Movement.rotate(Movement.Type.TURN_LEFT);
}
... |
a3533c7c-86e3-44c6-ab05-b672c058fd3e | 9 | public WeightedMapGraph(List<Edge> edges)
{
graph = new HashMap<>();
directionKeys = new LinkedHashSet<>();
for (final Edge edge : edges)
{
// checks for bad values
if (edge.getFromNode().getID() < 0 || edge.getToNode().getID() < 0 || edge.getLength() < 0 || edge.getWeight() < 0
|| edge.getLength() ... |
c4a74fc8-f6d8-43bd-9bfa-165c2cc7f378 | 0 | @Override
public ISocketServerConnection getConnection(int aIndex) {
return (ISocketServerConnection)getConnections().get(aIndex);
} |
75c9413b-6ada-46a3-9609-198189dce2e5 | 7 | public void mouseReleased(MouseEvent e) {
//Adjust values as if the board was set in the top left corner at (0,0)
int mx = e.getX() - Game.LEFT_MARGIN;
int my = e.getY() - Game.TOP_MARGIN;
//We only want to check clicks within the bounds of the playing part of the board
... |
ea1e1d1a-3262-4007-9dfa-651b0ed4d27e | 6 | SigmoidNetwork(int inputs, int outputs, int hiddenLayers, int neuronsPerLayer, double inputCompFactor, double compFactor, double multFactor)
{
/**
* Construct the input layer, one connection per neuron
*/
inputLayer = new Layer();
for(int i = 1; i <=... |
e959e2b6-7bcd-47fa-bc70-a5f942060974 | 1 | protected void reload() {
try {
rootElement = $( new File(filename) );
} catch (Exception e) {
// config file doesn't exist
}
} |
1881ad3b-173e-4cdc-af6e-5fa29caf452a | 1 | private void keyScroll(TreeRow row) {
if (row != null) {
Rectangle bounds = getRowBounds(row);
Rectangle viewBounds = getContentViewBounds();
bounds.x = viewBounds.x;
bounds.width = 1;
scrollContentIntoView(bounds);
}
} |
4f2388bd-91b3-4063-aa4d-8aafd53b7dce | 5 | protected void removeUsedCards(Deck deck)
{
for (PlayerProfile profile : this.profiles) {
if (profile.getHandType () == HandType.EXACTCARDS) {
Card[] pcards = profile.getCards();
for (Card pcard : pcards) {
deck.removeCard(pcar... |
c5fa9a60-527e-4408-a7ff-91ae09ade6b2 | 2 | public static CoachSubmodesOfTransportEnumeration fromValue(String v) {
for (CoachSubmodesOfTransportEnumeration c: CoachSubmodesOfTransportEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} |
dea1ea9b-b73e-492e-af24-113567860355 | 3 | public Double getLeadership(String playerName) {
if (leadershipCache.containsKey(playerName))
return leadershipCache.get(playerName);
Double leadership = Config.leadershipSkillDefault;
String SQL = "SELECT `leadership` FROM " + tblSkills + " WHERE `player` = ? AND `leadership` IS NOT NULL";
Connection con ... |
1324834f-12e4-4253-970e-c2385d8dda3f | 3 | void createHTMLTransfer(Composite copyParent, Composite pasteParent){
// HTML Transfer
Label l = new Label(copyParent, SWT.NONE);
l.setText("HTMLTransfer:"); //$NON-NLS-1$
final Text copyHtmlText = new Text(copyParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
copyHtmlText.setText("<b>Hello World</b>"... |
7a9230cc-a749-43d0-9b1f-5c1d539d0910 | 7 | void assignColor() //assigns color to a piece according to it's brickType
{
switch( brickType )
{
case 0: //square, "T" = yellow
case 2:
red = green = 1.0F; blue = 0.0F;
break;
case 1: //stick, 2x2 = blue
case 5:
blue = 1.0F; red = green = 0.0F;
break;
case 3: //3x1 = purple
blue = red = 1... |
13dd1951-1b7b-4043-9d32-6846f1ce03f2 | 8 | private String generateName(String ns, TargetNamespace tn, String base, boolean isElement) {
Set<String> movedStructureNameSet = isElement ? tn.movedElementNameSet : tn.movedAttributeNameSet;
String name = base;
for (int n = 1;; n++) {
if (!movedStructureNameSet.contains(name)) {
Definition de... |
0e5e25d1-9f30-4e0b-b0c8-0db915fb5f22 | 3 | private void changeLabel() {
int label = isOverWhichLabel(mySketch.mouseX, mySketch.mouseY);
if (label != -1) {
if (label == X_AXIS) {
xAttributeIndex++;
xAttributeIndex %= QuestionData.getFeatureNames().size();
}
if (label == Y_AXIS) {
yAttributeIndex++;
yAttributeIndex %= QuestionData.get... |
2a4aaeef-ea79-41a1-99de-6ef7ae36b452 | 2 | public String Rule(String s)
{
for (int i = 0; i < word.size(); ++i)
{
if (word.get(i).equals(s))
{
s = "N";
return s;
}
}
return s;
} |
cdcd1a82-9894-437e-bce4-47e88ab575a8 | 6 | @EventHandler(priority = EventPriority.LOWEST)
public void onDispense(BlockDispenseEvent event) {
if (event.isCancelled()) return;
// loop through containers
for(InfiniteContainer dispenser : this.plugin.getContainerDatabase().getContainerList()) {
Location currentPosition = dispenser.getLocation();
... |
840434c8-811f-4bd4-b7bc-871e36440ea1 | 1 | public List<Afecta> ObtenerAfecta(String consulta){
List<Afecta> lista=new ArrayList<Afecta>();
if (!consulta.equals("")) {
lista=cx.getObjects(consulta);
}else {
lista=null;
}
return lista;
} |
957564a0-9e17-4cfe-bea0-97f43aa83fbd | 0 | public void setFileds(List<ModelFiledDesc> fileds) {
this.fileds = fileds;
} |
23d9fc0b-d207-4cbc-8a76-5602e22f204f | 7 | public static void enterFightKiln(Player player, boolean quickEnter) {
if(!player.isCompletedFightCaves() || player.getInventory().containsOneItem(23653, 23654, 23655, 23656, 23657, 23658))
return;
Familiar familiar = player.getFamiliar();
if(familiar != null && ((familiar.getBob() != null && familiar.getBob()... |
e91568a2-1d7d-4bbd-96fc-eac3600c79b1 | 5 | public File downloadFile(URL resourceOnWeb, File downloadedLocation) throws IOException
{
// Make all directories for the downloaded file.
dlLogger.info("Making parent directories for " + downloadedLocation + "...");
downloadedLocation.getParentFile().mkdirs();
// If the file exists, remove it.
if(downloa... |
389ff769-4599-43ae-bf0e-03961b9820b2 | 0 | @Override
protected EntityManager getEntityManager() {
return em;
} |
f6d35cb0-26ba-47b4-8856-ca3f7bf728d3 | 7 | public boolean move(int xa, int ya) {
if (xa != 0 || ya != 0) {
boolean stopped = true;
if (xa != 0 && move2(xa, 0)) stopped = false;
if (ya != 0 && move2(0, ya)) stopped = false;
if (!stopped) {
int xt = x >> 4;
int yt = y >> 4;
level.getTile(xt, yt).steppedOn(level, xt, yt, this);
}
re... |
f429009b-d259-45ae-bf63-04025f45744d | 5 | public void trySpawn(int count) {
for (int i = 0; i < count; i++) {
Mob mob;
int minLevel = 1;
int maxLevel = 1;
if (depth < 0) {
maxLevel = (-depth) + 1;
}
if (depth > 0) {
minLevel = maxLevel = 4;
}
int lvl = random.nextInt(maxLevel - minLevel + 1) + minLevel;
if (random.nextInt... |
ea8eb950-e246-4049-b837-7d7930a6281d | 9 | private boolean crossingInternal(Point2DInt direction1, Point2DInt direction2) {
if (angles.size() < 2) {
return false;
}
final double angle1 = convertAngle(new LineSegmentInt(center, direction1).getAngle());
final double angle2 = convertAngle(new LineSegmentInt(center, direction2).getAngle());
Double las... |
157d045a-86c7-4e5f-bd47-216bbb391b30 | 0 | public DirCbolTest() {
} |
4fb6f86e-40a6-42f7-92b1-836177c56058 | 9 | final Object[] getNames(boolean getAll, Object[] extraEntries)
{
Object[] names = null;
int count = 0;
for (int id = 1; id <= maxId; ++id) {
Object value = ensureId(id);
if (getAll || (attributeArray[id - 1] & DONTENUM) == 0) {
... |
222e9374-7e42-4acd-8da0-e9528697d39c | 6 | public Coordinate normalizeCoordinate() {
Coordinate newCoordinate = null;
switch (z) {
// If the z coordinate is either 0 or 1, the coordinate is already
// on the top right or right of a tile, so just return the current
// coordinate
case 0:
case 1:
... |
0734f880-03e3-4fb8-9a8c-9fa7b38289e5 | 6 | public static void main(String[] args) {
Scanner inFile = null;
try {
// Create a scanner to read the file, file name is parameter
inFile = new Scanner(new File(System.getProperty("user.dir") + "/src/Files/numsort.dat"));
} catch (FileNotFoundException e) {
System.out.println("File not found!");
// St... |
4e10939f-b71a-4b0b-a94b-73287976c3f0 | 4 | public List<Object> excuteQuery(String sql, Object[] params) {
ResultSet rs = executeQueryRS(sql,params);
ResultSetMetaData rsmd = null;
int columnCount = 0;
try {
rsmd = rs.getMetaData();
columnCount = rsmd.getColumnCount();
} catch (SQLException e1) {
... |
12bb184f-4c52-4cd2-b040-c6dd6e439746 | 6 | static final void method1090(byte[][] is, int i,
Class237_Sub1 class237_sub1) {
try {
anInt1802++;
int i_13_ = Class347.mArchiveSrcs.length;
if (i == 65536) {
for (int i_14_ = 0; i_14_ < i_13_; i_14_++) {
byte[] is_15_ = is[i_14_];
if (is_15_ != null) {
int i_16_
= (64 * (Cl... |
fb48dee6-2cfe-4f1a-a673-834193cb4eaf | 3 | public boolean equals(Object o){
if(o != null && o instanceof HexPoint)
return this.x == ((HexPoint)o).x && this.y == ((HexPoint)o).y;
else return false;
} |
8c6e64d1-b6c0-45b9-ab72-60f596c9752c | 4 | @Override
public Drawable getMirror(int xSky, int ySky, int xsSky, int ysSky) {
String newDirect = "";
switch (direction) {
case "n":
newDirect = "s";
break;
case "s":
newDirect = "n";
break;
case "e"... |
a4af80fa-2055-4164-a5bc-b325da8e4d36 | 8 | public void dispose(boolean cache, boolean imageRecoverableElsewise) {
// empty the image store
if (imageStore != null) {
// We don't look at if( !cache && isCached ) to delete
// the temp file, because the CacheManager handles it
// cache to disk for fast access a... |
46fab779-0bf6-494f-b18a-e3c93b45c01d | 0 | @Override
public String toString() {
return name;
} |
46a7d5d1-2316-42ec-bfeb-c9eeaea53ee0 | 1 | private int screenToTile(int x, int bound) {
//convert x/y coordinate into a tile coordinate
//if x is negative, make them one tile's width lower
//this is because the next step uses integer division, which
//rounds down to lowest ABSOLUTE value and not lowest ACTUAL value
if(x ... |
c6f3a36c-f2f2-43f2-96f4-8cf47b49ca93 | 2 | public void setRouteNodes(List<Node> routeNodes)
{
this.routeNodes = routeNodes;
if(routeNodes != null && !routeNodes.isEmpty())
{
zoomtoRouteArea();
}
} |
8467bae7-a684-48e7-8a4e-e55ebc4713df | 6 | public long getMax(long start, long end) {
if (this.start == start && this.end == end)
return maxVal;
long mid = (this.start + this.end) / 2;
if (start <= mid && end <= mid)
return left.getMax(start, end);
if (start > mid && end > mid)
return right.getMax(start, end);
return Math
.max(le... |
02a32c5e-0ecc-41dc-a614-252f494f436e | 6 | public void calculateApparentPlace(double t) throws JPLEphemerisException {
StateVector svObserver = null;
Vector EB = null;
Vector SB = new Vector();
Vector QB = new Vector();
Vector P = new Vector();
Vector Q = new Vector();
Vector E = new Vector();
double c = 173.1446;
double factor = 2.0 * 9.87e... |
bc8fb7f2-5dc3-41e1-8084-da1c735d3c5d | 7 | @Override
public void epoch(Player p){
if (TRAIN && !USE_RAND){
drawNet.export(drawNet_file);
playNet.export(playNet_file);
}
//Deep learning stopping criteria
//Don't use the random player for stopping criteria
//If no improvement, add another deep learning layer
if (false && TRAIN && !USE_RAND ... |
0672321e-7d9c-41a8-803c-7aaa1780c09e | 9 | public void run() {
PropertiesDB propertiesDB = PropertiesDB.getInstance();
String oldIPAddress = propertiesDB.getMyOldIPAddress();
AddressDB addressList = new AddressDB(kAddressList);
String[] entries = addressList.getListOfAddressCache();
String[] ... |
b4af1ee3-f069-49ae-b6a9-71671278df54 | 4 | public void AddService(Object service) throws Exception {
if (service == null) {
throw new IllegalArgumentException("service");
}
this._list.add(service);
if (service instanceof IObjectWithSite) {
((IObjectWithSite) service).setSite(this);
}
if (service instanceof IService && this._initialized) {
... |
782be268-fc3c-4a99-8ce8-b57113755144 | 9 | public static String getMouseName(int mouseCode) {
switch (mouseCode) {
case MOUSE_MOVE_LEFT: return "Mouse Left";
case MOUSE_MOVE_RIGHT: return "Mouse Right";
case MOUSE_MOVE_UP: return "Mouse Up";
case MOUSE_MOVE_DOWN: return "Mouse Down";
case MOUSE... |
badfe4cb-abc1-435c-a717-379aaa340c10 | 8 | @Override
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
if (source.equals(btnOpen)) {
JFileChooser jfc = new JFileChooser();
jfc.setMultiSelectionEnabled(false);
jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int option = jfc.showOpenDialog(this);
if (... |
71024ae4-c500-4e3d-bc2f-010c4cc50efa | 8 | public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
case '"':
case '\'':
return nextString(c);
case '{':
back();
return new JSONObject(this);
case '[':
... |
b6c0c167-84fa-41a6-ac59-54b1d8ae22ba | 1 | public void nextStep() {
if (this.state != null) {
this.state.nextStep(this);
}
} |
7f0e6272-8ea0-458c-833b-bb7fba20734f | 0 | public CoffeescriptScanner( ColorManager colorManager ) {
IToken keywordToken = new Token(new TextAttribute(colorManager.getColor( new RGB( 0xFF, 0x56, 0x00 ) ), null, SWT.NORMAL));
IToken memberToken = new Token(new TextAttribute(colorManager.getColor( new RGB( 0xA5, 0x35, 0xAE ) ), null, SWT.NORMAL));
IToken l... |
2d7d09cc-1e79-4d45-9bbb-0e876963f92c | 1 | public synchronized void setChild2(EquationBTreeNode node) {
if (node != null) {
node.setParent(this);
}
this.child2 = node;
} |
75b0f4cb-0648-4717-9a9e-3b8cc643f3ce | 4 | public boolean actOn(int x, int y){
if (this.selected.getPos().distance(x, y) > this.selected.getPortee()){
return(false);
}
if (map[x][y].estLibre()){
deplaceSoldat(new Position(x, y), this.selected);
}
else if (this.selected.getPos().equals(new Position(... |
0d7ea75c-41d8-4fb3-b844-8cbac821db6c | 0 | public String getGroupName(){
return this.groupName;
} |
fc1d8c1a-b300-41cd-bbea-8ba86569856a | 4 | @Override
public void onDraw(Graphics G, int viewX, int viewY) {
if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
{
G.setColor(Color.darkGray);
int deg = r.nextInt(360);
G.fillArc((int)(X-1)-viewX, (int)(Y-1)-viewY, 2, 2, deg, 60);
deg = r.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.