method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
5ff805ed-c03c-4910-bee3-c5c3b1d57b88 | 9 | public static QuestionGeneration[] general() throws Exception {
int[] categoryID = randomGeneration("categories");
String[] category = new String[10];
DatabaseResult db;
int[] quesID = new int[10];
for (int i = 0; i < 10; i++) {
db = new DatabaseResult("categories")... |
14bc291f-082d-402c-b05e-f844bd96b170 | 6 | public void keyPressed(KeyEvent e) {
int x = e.getKeyCode();
// Exit if the user hit <ESC>
if (x == KeyEvent.VK_ESCAPE) {
System.exit(0);
}
int prevDir = game.pacman.getDirection();
// Movement controls
if (x == KeyEvent.VK_LEFT) {
... |
1b74ffe2-cd4c-47df-b19a-b9951b6ffed3 | 6 | public static void inv( DenseMatrix64F mat , DenseMatrix64F inv ) {
double max = Math.abs(mat.data[0]);
int N = mat.getNumElements();
for( int i = 1; i < N; i++ ) {
double a = Math.abs(mat.data[i]);
if( a > max ) max = a;
}
if( mat.numRows == 2 )... |
0de80c13-a136-4421-9a63-49f770d1ff2e | 6 | @Override
public int match(String[] argsToTest) {
for (String testArg : argsToTest) {
if (isCommandArg(testArg)) {
boolean argIsOK = false;
for (String allowedElem : allowed) {
if (testArg.equals(allowedElem)) {
argIsOK = true;
}
}
if (!argIsOK) {
addMismatch(testArg);
}... |
1d6a7bde-6d48-49f6-8e46-48c19e277460 | 4 | public static void main(String[] args) {
NullPlumbus nullPlumbus = new NullPlumbus(); // standard null plumbus created as such
IPlumbus nameBrandPlumbus = new NameBrandPlumbus("The Original Plumbus", 5.99); // plumbus interface created as a NameBrandPlumbus
NullPlumbus offBrandPlumbus = new OffB... |
843099ce-a6f7-4e0f-bab3-0d63b90b28ef | 5 | private int searchrow(int[][] matrix,int target,int b,int e)
{
if (b >= e) return -1;
if (b == e-1 ) return b;
int mid = (b + e) /2;
if (matrix[mid][0] <= target && target <= matrix[mid][matrix[mid].length -1] ) return mid;
if (matrix[mid][0] > target ) return searchrow(matrix,target,b, mid);
return searc... |
a42ed544-6877-4cf0-8102-1fb12e6ca1bd | 0 | @Override
public String toString() {
return "[someStrArray=" + Arrays.deepToString(someStrArray)
+ ", someObjArray=" + Arrays.deepToString(someObjArray)
+ ", someList=" + someList + ", someMap=" + someMap + "]";
} |
d0a540ca-1ee6-47b4-8500-e0cb2447da65 | 1 | @SuppressWarnings("unchecked")
protected ResourceBag() {
Type t = this.getClass().getGenericSuperclass();
Type param = ((ParameterizedType) t).getActualTypeArguments()[0];
if (!(param instanceof Class)) {
throw new IllegalArgumentException("Field to detect our type!");
}
... |
b487e371-0dce-44e4-91d2-b56cb7efa703 | 2 | public void tallennaOsaamistasonTunniste() {
if (tokaTekstikentta.getText().equals("melkein")){
osaamistasonTunniste = "\tMELKEIN";
} else if (tokaTekstikentta.getText().equals("ei")){
osaamistasonTunniste = "\tEI";
} else {
osaamistasonTunniste = ""; //jos kä... |
0d620f71-1cb7-4631-9abc-3db3bca904f0 | 9 | public static void writeToStream(String text, Buffer stream) {
if (text.length() > 80)
text = text.substring(0, 80);
text = text.toLowerCase();
int i = -1;
for (int c = 0; c < text.length(); c++) {
char character = text.charAt(c);
int characterCode = 0;
for (int l = 0; l < validChars.length; l++) {
... |
5859e82f-1d68-4fe9-8812-f18b9d333509 | 8 | public boolean checkUserData() {
if (logView.getUsername().equals("")
&& logView.getPassword().equals("")) {
JOptionPane
.showMessageDialog(
logView,
"Bitte korrigieren Sie Ihren Kundennamen und Ihr Kundenpasswort!",
"Kein Kundennamen und Passwort angegeben",
JOptionPane.ERROR_... |
3001eeb1-09ed-48a6-994b-0083a5d1b360 | 6 | @EventHandler
public void EndermanSlow(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEndermanConfig().getDouble("Enderman.Slow... |
b27be9a5-06b5-4093-ae06-f77ad4475f8a | 7 | public void forwardSelect(boolean withReplacement, Instances instances,
int metric) throws Exception {
double bestPerformance = -1.0;
int bestIndex = -1;
double tempPredictions[][];
for (int i = 0; i < m_bagSize; ++i) {
// For each model in the bag
if ((m_timesChosen[i] == 0) || w... |
d6214e33-a70a-4234-a8ed-9eca12a3c532 | 1 | protected Rectangle getAutomatonBounds() {
Rectangle rect = drawer.getBounds();
if (rect == null)
return new Rectangle(getSize());
return rect;
} |
e52ba609-a47c-4152-a73e-1e9b8825e5ee | 6 | public static void main(String[] args) {
ArrayList<WeightedItem<String>> itemList = new ArrayList<WeightedItem<String>>();
itemList.add(new WeightedItem<String>("A", 30));
itemList.add(new WeightedItem<String>("B", 45));
itemList.add(new WeightedItem<String>("C", 5));
itemList.add(new WeightedItem<String>("D"... |
0009beee-c50f-4b0e-b7d2-1c64d23b386f | 8 | public int setNeighbourNull(TetrahedronElt3D element, ScalarOperator sop) {
TetrahedronElt3D neighbour = this.getNeighbour(0);
if (neighbour != null && neighbour.isGeometryEquivalent(element, sop)) {
this.eltZero = null;
return 0;
}
neighbour = this.getNeighbour(1);
if (neighbour != null && neighbour... |
d86dbdbd-134b-40a7-a43a-c84b2b7fd0d0 | 0 | public int getColumnCount() {
return terminals.length + 2;
} |
c4d05f4e-4bae-4cdf-b75a-7b9fdacbc10d | 8 | public void undo()
{
if (DEBUG) log("Attempting to undo TaskEdit");
if (taskViewsToUpdate != null)
{
if (DEBUG) log("currentState Completed? " + currentState.isCompleted());
if (DEBUG) log("previousState Completed? " + previousState.isCompleted());
if (DEBUG) log("Revert task to previous... |
0334068b-a471-48fe-9481-edaba1523dd8 | 6 | @EventHandler
public void BlazeInvisibility(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getBlazeConfig().getDouble("Blaze.Invis... |
ca29102f-ccd1-4a7e-9b37-e20e3b850627 | 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... |
710fed96-cb00-4455-82ba-568c0e0981bc | 5 | public void load() {
cookieslap.chat.log("Loading map " + this.name + ".");
usable = false;
this.file = new File(cookieslap.getDataFolder(), this.name + ".yml");
try {
if (!this.file.exists())
this.file.createNewFile();
} catch (IOException e) {
}
this.setConfig(YamlConfiguration.loadConfigura... |
d2190a12-3d6b-4a1c-88c2-0ca9711d5759 | 9 | public void loadTowerTypes(){
int x = 1;
try {
while(true){
InputStream is = Main.class.getResourceAsStream(RES_DIR + "towers/" + x + ".cfg");
if(is==null){break;}
byte[] b = new byte[Main.class.getResource(RES_DIR + "towers/" + x + ".cfg").openConnection().getContentLength()];
is.read(b);
is... |
bf84ce11-d317-4ed1-8e9a-b81306138834 | 8 | private void flipVertical() {
switch(direction)
{
case EAST:
case WEST:
break;
case NORTH:
setDirection(Direction.SOUTH);
break;
case SOUTH:
setDirection(Direction.NORTH);
break;
case NORTHEAST:
setDirection(Direction.SOUTHEAST);
break;
case NORTHWEST:
setDirection(Direction.SOUT... |
d0a97472-d172-42e0-87d4-681a34237d45 | 0 | public Frame() {
container = this.getContentPane();
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth = (int) dim.getWidth() / 3;
int screenHeight = (int) dim.getHeight() / 3;
container.setLayout(new BoxLayout(container, BoxLa... |
39e675e6-4fc2-440f-b03a-f19da00161df | 2 | public void addHunterListListener(final HunterListListener listener) {
if (listener != null && !listenersHunter.contains(listener)) {
this.listenersHunter.add(listener);
}
} |
d13a5af3-eb28-4846-829f-ef9e35392ea9 | 8 | void updateMyMovement(Player player, Stream outStream) {
synchronized (player) {
if (player.mapRegionChanged) {
sendMapRegion();
}
if (player.playerTeleported) {
outStream.createFrameVarSizeWord(81);
outStream.initBitAccess();
outStream.writeBits(1, 1);
outStream.writeBits(2, 3);
outS... |
feffdbcb-ba29-403e-abdf-de7fca6b0bed | 2 | public void print(Object... objects) {
System.out.print(String.format("%-30s: ", this.getClass()
.getSimpleName()));
if (objects != null) {
for (Object obj : objects) {
System.out.print(obj);
System.out.print(" ");
}
System.out.println();
}
} |
53dbfd31-0e56-40fb-a9ec-75e5bbb44aeb | 1 | @Around("demo.spring.aop.DemoIntercepter.anyPublicOperation()")
public Object aroundTest(ProceedingJoinPoint target ) {
try {
Object[] args = target.getArgs();
System.out.println("mae[" + array2Str(args) + "]");
Object result = target.proceed(args);
System.out.println("ato[" + result + "]");
... |
6cad5c0b-d23d-40f9-8412-b909db1c8179 | 1 | @Override
public void handleEvent(Event event) {
if (event.getType().equals(StateUpdateEvent.TYPE)) {
handleStateEvent((StateUpdateEvent) event);
}
} |
8896f693-9f00-450d-b7fb-f8a4eddc5646 | 7 | public void addCity() {
int max=getPreference(WORLD.map[0][0]);
ArrayList<Point> best=new ArrayList<Point>();
best.add(WORLD.map[0][0]);
for (int y=0;y<WORLD.HEIGHT;y++)
for (int x=0;x<WORLD.WIDTH;x++)
if (WORLD.map[x][y].owner==null)
if (getPreference(WORLD.map[x][y])>max) {
best.clear();
... |
28ef1c0e-633f-469d-aeda-ebfcf0aaecdd | 2 | @Override
public CommandResponse executeCommand(RequestType requestType, List<Pair<String,String>> headers, String commandName, Object commandParameters, Class<?> responseCastClass){
CommandResponse result;
if(requestType.name().toLowerCase().equals("get")) {
result = doGet(commandName, headers, commandParamete... |
90eb3a14-092c-4396-9b6e-a8aaddfa268f | 8 | public Move AlphaBetaSearch(Board board, GamePlay game, int color,
int alpha, int beta, int depthLimit, int depth) {
game.setColor(color);
if ((depthLimit <= depth) || (game.isGameOver())) {
int[] scores = game.getScores();
Move m = new Move(color, false, new Point(0, 0));
m.setScore(scores[2]);
re... |
4f5a8b7f-7595-4a95-811b-63feda15c991 | 5 | public Entiteetti luoEntiteetti(EntiteettiTyyppi tyyppi, int x, int y) {
switch (tyyppi) {
case PALLO:
return luoPallo(x, y);
case PELAAJA_MAILA:
return luoPelaajanMaila(x, y);
case TEKOALY_MAILA:
return luoTekoalyMaila(x, y);
... |
8e1d83f3-f2ec-4e30-bf62-f83d55c99237 | 0 | public ChartPanel getChartPanel(){
//створюємо панель для графіка
final ChartPanel chartPanel = new ChartPanel(getChart());
//встановлюємо розмір діаграми (можна також скористатись методами JFreeChart цього)
chartPanel.setPreferredSize(new java.awt.Dimension(380, 350));
//дода... |
d0eb217e-cc1c-42c3-b259-cd89ce214cdd | 0 | public Vasara() {
} |
830589f2-0409-4ead-821b-f50e15db8edb | 5 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockFromTo(BlockFromToEvent e) {
CBlock conBlock = parent.getControllerBlockFor(null, e.getToBlock()
.getLocation(), null, Boolean.valueOf(true));
if (conBlock == null) {
return;
}
if (conBlock.isBeingEdited()) {
i... |
116fe114-3230-41b9-b0a0-837a61369ba9 | 7 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)))
{
switch(msg.sourceMinor())
{
case CMMsg.TYP_ADVANCE:
unInvoke();
break;
}
}
else
if((msg.amITarget(affected))
&&(msg.ta... |
a9919054-64e6-443a-98e5-ffedfcd0919e | 4 | public void render(Screen screen){
for(Button b : buttons) b.render(font, screen);
for(TextField tf : textFields) tf.render(screen);
for(Label l : labels) l.render(screen);
if(error != "") font.render(error, 10, 10, 0xffff0000, 1, true, screen);
} |
2cc1de43-27d4-40c3-88ad-a0fc39c5c6a0 | 9 | @Override
public void visitFieldInsn(final int opcode, final String owner,
final String name, final String desc) {
mv.visitFieldInsn(opcode, owner, name, desc);
if (constructor) {
char c = desc.charAt(0);
boolean longOrDouble = c == 'J' || c == 'D';
sw... |
1c2c3039-e26e-4794-bb55-be08abe2303f | 0 | public String getOutput()
{
return ((MooreMachine) (to.getAutomaton())).getOutput(to);
} |
54419671-7d51-43b7-8ff3-5a28afeaada4 | 2 | public void open() {
Display display = Display.getDefault();
createContents();
shlNewPolicy.open();
shlNewPolicy.layout();
while (!shlNewPolicy.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
} |
3efa9027-75f6-4711-9b48-0bafb1c5ee84 | 1 | public String getDownloadPath(){
if (prop.getProperty("downloadPath").isEmpty()) return System.getProperty ("user.dir");
return prop.getProperty("downloadPath", System.getProperty ("user.dir"));
} |
20e1f833-d836-4fe0-a140-850c90999a1b | 6 | @Override
public void map(LongWritable key, Text value, OutputCollector<UserIdPairWritable, UserRatingPairWritable> output, Reporter reporter) throws IOException {
StringTokenizer tokenizer = new StringTokenizer(value.toString(), ";");
Vector<Integer> vec = new Vector<Integer>();
int i, j, x, y;
// Loop over ... |
9d767f47-f1de-404e-a451-6c560e1728a1 | 2 | @Override
public Grid generateGrid() {
playerFactory.generate();
// Give the players some items to start
for (Player player : grid.getAllPlayersOnGrid()) {
final LightGrenade item1 = new LightGrenade(grid);
player.getInventory().add(item1);
final IdentityDisc item2 = new IdentityDisc(grid);
player.... |
e98e35ae-78ed-45cb-9463-56d1224a8078 | 3 | public static double effectiveSampleNumberConjugateCalcn(Complex[] ww) {
Complex[] weight = Conv.copy(ww);
if (Stat.weightingOptionS) {
ArrayMaths am = new ArrayMaths(ww);
am = am.pow(2);
am = am.invert();
weight = am.array_as_Complex();
}
int n = weight.length;
double nEff = Double.NaN;
if (St... |
857dff5d-91ab-4623-ad5d-8335907873a2 | 0 | @Override
public boolean isDisconnect() {
return disconnect;
} |
76d7501a-77c9-4625-ba7a-d9d112bf25ea | 2 | public ArrayList<Pair<String, Color>> getSectionColors(String section, String pref) {
ArrayList<Pair<String, Color>> buf = new ArrayList<Pair<String, Color>>();
for (String j : map.keySet()) {
String[] val = j.split("\\.");
if (val[0].equals(section)) {
buf.add(new Pair<String, Color>(pref + val[1], Color... |
a4199a9f-5858-4c60-9c7f-71a22b8072e3 | 8 | @Override
public void draw(Graphics g, int x, int y, int side) {
Graphics2D g2d = (Graphics2D) g;
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .35f));
g.drawImage(ResourceManager.getImage("shadow"), x, y, side, side, null);
g2d.setComposite(AlphaComposite.getI... |
7b72bb9b-8606-4ead-b0c9-ab45803a62d8 | 6 | public boolean write(aos.apib.OutStream out, aos.apib.Base o) {
AuthenticationResult v = (AuthenticationResult)o;
int i = -1;
while ((i = out.nextField(i, this)) >= 0) {
switch (i) {
case 0:
out.putBool(v.authentication, i, __def.authentication, this);
break;
case 1:
out.putOther(v... |
3d05cab8-379d-4135-804f-029292595790 | 5 | private void tramsformToHtml(Transformer transformer, File xmlFile) {
if (transformer != null) {
File html = new File("logs/html/" + xmlFile.getName() + ".html");
if (!html.exists()) {
boolean success;
try {
success = html.createNewFile... |
cd99f25d-45a7-4c07-8be9-b76a63c9b50e | 0 | public JTextField getjTextFieldVilleNom() {
return jTextFieldVilleNom;
} |
a10f8e95-5be2-4619-acf2-fe9687cc2a01 | 6 | public void actionPerformed(ActionEvent e){
//When the upload button is pressed
if (e.getSource()==generateButton) {
treasureModel.clear();
if((Integer) levelSpinner.getValue() > 30 || (Integer) levelSpinner.getValue() < 1){
JOptionPane.showMessageDialog(
RunGenerator.this,
... |
d1068529-75c6-4786-833a-ec80c4f62b5d | 5 | @Override
public void setProgress(int i) {
// Need to sleep since NT4.0 doesn't share so well with threads, and it's likely that this dialog
// is running in a different thread from the process updating things. Note: when setProgress is
// called it is executing in the thread from the process calling the method... |
cf382b8e-3bbc-4af9-8e4d-a2235b6e04dc | 8 | public boolean isEqual(LiteralLabel value1, LiteralLabel value2) {
if (value1.getDatatype() instanceof XSDDouble && value2.getDatatype() instanceof XSDDouble) {
Double n1, n2;
n1 = null;
n2 = null;
Object v1 = value1.getLexicalForm();
Object v2 = value2.getLexicalForm();
boolean v1... |
b56b24db-7a6a-4309-920d-404db8b18209 | 1 | protected void processWindowEvent(
WindowEvent event )
{
if (event.getID() == WindowEvent.WINDOW_CLOSING)
{
actionCancel();
}
super.processWindowEvent(event);
} |
c86fb9ea-2bc7-4730-9b3f-79e206273b02 | 3 | public List<Ant> placeAnts(AntBrain blackBrain, AntBrain redBrain) {
List<Ant> list = new ArrayList<>();
int id = 0;
for (int[] cell : anthillCells) {
if (getCell(cell).anthill.equalsIgnoreCase("black")) {
Ant black = new Ant(blackBrain, true, id++);
b... |
e09b6140-cc04-4a6b-93b4-a5c0132e3b76 | 0 | public LED(int port) {
_led = new PWM(port);
} |
30d39c4b-a51b-4ba7-bdfd-83ff5a13a497 | 4 | public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{
// Draws the "You're dead" message on the screen.
g.drawString(dead, 50, 50);
// Draws the name TextField on the screen and instructions.
if (addScore && !added){
g.drawString("Enter your name and hit enter", 50, 3... |
74ca4c33-864c-42dd-9ba0-63e74628190f | 5 | private static void loadExecutionPlansForSQLStatements(List<DeltaSQLStatementSnapshot> sqlStatementsToLoad) {
Connection connection = null;
try {
connection = ConnectionPoolUtils.getConnectionFromPool();
PreparedStatement sqlExecutionPlansStatement = connection
... |
18bc7558-dc63-4d48-b44b-c0773cbd730c | 6 | @Override
public void rotationPiece()
{
if(largeur==2 && matrice[0][0]!=null)
{
positionX--;
positionY++;
}
else if(largeur==3 && matrice[0][0]!=null){
positionY--;
}
else if(largeur==3 && matrice[0][0]==null){
... |
709d01bb-2e9f-4d9d-97d9-fe528cdbf242 | 8 | public void load(String fileName){
try{
Scanner input = new Scanner(new File(fileName));
shapeList.clear();
selindex = -1;
int count = Integer.parseInt(input.nextLine());
while(input.hasNext()){
String line = input.nextLine();
String [] params = line.split(":");
int x = Integer.par... |
9cdd7985-0731-49de-a16d-6bff40fedd26 | 7 | boolean isValidMessage(String identifier) {
return "cantPick".equals(identifier) ||
"cantTraverse".equals(identifier) ||
"cantDo".equals(identifier) ||
"didntUnderstand".equals(identifier) ||
"pickedUp".equals(identifier) ||
"emptyInventory".equals(identifier) ||
"changedLocation".equals(iden... |
86da0b08-6e34-4891-abc4-1627fb528936 | 2 | public Book createBook(int bookNum) {
Book b = null;
Card d0 = new Card(bookNum, 'h');
Card d1 = new Card(bookNum, 'c');
Card d2 = new Card(bookNum, 's');
Card d3 = new Card(bookNum, 'd');
if (checkBook()) {
b = new Book(bookNum);
Card[] bookCards = b.getCards();
Card c = null;
try {
bookCar... |
b66d81ed-b17b-428d-b96c-3ae5088a0808 | 2 | public static String readString() {
if (isEmpty()) throw new RuntimeException("Reading from empty input stream");
StringBuilder sb = new StringBuilder();
while (!isEmpty()) {
char c = readChar();
sb.append(c);
}
return sb.toString();
} |
523fa607-d661-4516-b763-68ad7c5c8043 | 5 | float getRadius() {
/*
* cloud radius is a function of it's age.
* here's the model...
*
* volume of rising air, dv ~ constant.
* decay ~ surface area.
* dynamic equilibrium, dv = decay, at maturity.
* dv = 0 at old age.
*/
float f... |
651614bd-15da-4d70-b571-51aed52e35d6 | 6 | public boolean isNewer (String onlineVersion, String storedVersion) {
if (storedVersion == null || storedVersion.isEmpty())
return true;
String[] oV = onlineVersion.split("[._-]");
String[] sV = storedVersion.split("[._-]");
Logger.logInfo(onlineVersion + " " + storedVersion)... |
42f387e1-666d-4ac8-b6c1-d3ce4e53e1f6 | 2 | public void testGetInstantMillisInvalid() {
try {
StringConverter.INSTANCE.getInstantMillis("", (Chronology) null);
fail();
} catch (IllegalArgumentException ex) {}
try {
StringConverter.INSTANCE.getInstantMillis("X", (Chronology) null);
fail();
... |
eb3950de-511e-4324-813c-c3248fffe42c | 5 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof MeetingImpl)) return false;
MeetingImpl meeting = (MeetingImpl) o;
if (meetingID != meeting.meetingID) return false;
if (!meetingAttendees.equals(meeting.meetingAttendees)) return fal... |
2ef08507-b74c-4bd6-ae2c-7999f76ce4b4 | 1 | public void putLabelConfiguration( ConnectionLabelConfiguration name, DefaultConnectionLabelConfiguration config ) {
if( config == null ) {
labelConfigurations.remove( name );
} else {
labelConfigurations.put( name, config );
}
} |
87efc6e1-1604-4d80-9390-c1e96c1de17f | 6 | private void updateScreen(Player player, boolean ifFriendly) {
if (!ifFriendly) {
sendInventory(player);
stake.clear();
stake2.clear();
}
player.getPackets().sendItems(134, false, stake);
player.getPackets().sendItems(134, true, stake2);
player.getPackets().sendItems(94, false,
player.getInventor... |
cea6caa1-9e4d-4b28-b903-7e6d74835063 | 5 | public static void main(String[] paramArrayOfString) {
try {
MyProxyLogon localMyProxyLogon = new MyProxyLogon();
String str = null;
logger.setLevel(Level.ALL);
System.out
.println("Warning: terminal will echo passphrase as you type.");
... |
b8904462-b5b8-465a-b289-506d54e14d33 | 6 | public void rMayusCentrosLocal(double paramDistancia,double paramRadio)
{
Iterator elemFuente;
Elemento entrada,salida;
Iterator elemDestino = destino.listaElementos();
double sumaDistancias,sumaValores,distancia,ponderacion,rMayor;
double dist[];
int count;
... |
6807c5cb-45d7-43c1-a3d5-108c65c7b680 | 4 | public static long getDateTime(String buffer) {
if (buffer != null) {
buffer = buffer.trim();
for (int i = DateFormat.FULL; i <= DateFormat.SHORT; i++) {
for (int j = DateFormat.FULL; j <= DateFormat.SHORT; j++) {
try {
return DateFormat.getDateTimeInstance(i, j).parse(buffer).getTime();
} c... |
e0c1c03a-367d-4f26-907d-c1b692a638b9 | 1 | public Boolean close() {
try {
this.con.close();
return true;
} catch (SQLException e) {
log.severe("Couldn't close Connection: ");
LogHandler.writeStackTrace(log, e, Level.SEVERE);
return false;
}
} |
8bc1799d-bac2-41f4-bff2-d57322bf89e3 | 0 | public void setPlainValue(String value) {
this.plainValue = value;
} |
b8b07492-0919-4cc8-8bb9-6ae010cf97bd | 3 | @Override
public Event next() {
String input = null;
try {
input = br.readLine();
} catch (IOException e) {
}
if(input == null || input.equals("")){
return new DefaultState(as);
}
else{
return new UserHomeState(as, input);
}
} |
26f63ef3-9ce8-4083-805a-de5be05b9aad | 9 | @Override
public void update(MiniGame game)
{
if (calculateDistanceToTarget() < INTERSECTION_RADIUS)
{
stopMovingToTarget();
if (pathIndex < path.size() - 1 && !movingBackToFirst && currentIntersection.open)
{
... |
4a980756-37e3-4cf5-a1ee-687b7b718c97 | 9 | public List<Node> getPublicDialogList() {
List<Claim> claimList = claimDao.getClaimList();
List<Claim> counterclaimList = null;
List<Claim> subclaimList = null;
List<Evidence> evidenceList = null;
List<Evidence> counterevidenceList = null;
List<BipolarQuestion> bipolarQuestionList = null;
List<BipolarQues... |
17a78546-ec3f-4b58-b593-29935c946fce | 0 | public void setName(String name)
{
nameLabel.setText(name);
} |
aac23e5a-f9cc-4a78-974a-edee4c5f332f | 1 | public void visitTryCatchBlock(final Label start, final Label end,
final Label handler, final String type) {
if (type != null) {
cp.newClass(type);
}
mv.visitTryCatchBlock(start, end, handler, type);
} |
82904be7-c874-4df5-bb48-1ac6c4515897 | 7 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... |
50df328e-ca9b-4eec-bb7f-28d8118606a1 | 4 | public ComplexMatrix getPropagationMatrix(int index, double energy) {
ComplexMatrix mx = ComplexMatrix.identityMatrix(2);
for (int i = index; i < intervals.size() - 1; i++) {
try {
mx = mx.multiply(getLocalPropagationMatrix(i, energy));
if (VERBOSE) {
... |
ad9295dc-b0bc-4025-afa9-593ece0f4521 | 8 | public String toStringSummary() {
String result;
String titles;
int resultsetLength;
int i;
int j;
if (m_NonSigWins == null)
return "-summary data not set-";
result = "";
titles = "";
resultsetLength = 1 + Math.max((int)(Math.log(getColCo... |
6eb64b11-d7d2-4edf-a8ff-56563a5b6ced | 9 | public static void main(String[] args) throws Exception {
Globals.lockManager = new LockManager();
Globals.bufferManager = new BufferManager(Globals.PAGES + 3);
Globals.index = new BPlus(1); // xactionId whatever you want
Globals.threads = new HashMap<Long, Thread>();
Globals.threadResults = new HashMap<Long,... |
ec1bc580-2c97-49ef-be66-0d31c000f66b | 1 | public static void main(String[] args) {
ResourceConsumer consumer0 = new ResourceConsumer();
// usage of consumer0
// ...
consumer0.clean();
consumer0 = null;
ResourceConsumer consumer1 = new ResourceConsumer();
consumer1 = null;
new ResourceConsumer();
System.gc();
try {
Thread.sl... |
2ae79366-119d-48ad-8517-d88cb019680f | 8 | public float[] center()
{
if (parts.size() <= 0) return null;
float minX = parts.get(0).posX,
maxX = parts.get(0).posX,
minY = parts.get(0).posY,
maxY = parts.get(0).posY,
minZ = parts.get(0).posZ,
maxZ = parts.get(0).posZ;
for (int i = 0; i < parts.size(); i++)
{
if (parts.get(i).p... |
d5eb73dc-859d-45f2-8bc3-1402296c3bb2 | 7 | @Override
public void mouseDragged(MouseEvent e) {
mouseDown = true;
GCThread.increaseGCFlag(5);
if (SwingUtilities.isLeftMouseButton(e) && !e.isShiftDown()) {
x2 = e.getX();
y2 = e.getY();
double newUpperLeftX = upperLeftX-((x2-x1)*(75/factor));
double newUpperLeftY = upperLeftY+((y2-y1)*(... |
cbff3805-7abe-436d-bc93-8e46dda1481c | 6 | public void COME(int bet) {
if (money > 0 && bet <= money && bet >= 0 && count != 0) {
if (combinedRoll == 7 || combinedRoll == 11) {
player.addMoney(bet);
info.updateMoney();
} else {
player.loseMoney(bet);
info.updateMoney();
}
}
} |
f72f8848-302b-40aa-b198-1c4a0c33400a | 4 | public Edge getFirstEdgeAtPosition(int x, int y, Node n) {
for(Edge e : n.outgoingConnections) {
if(e.isInside(x, y, pt)) {
Edge opposEdge = e.getOppositeEdge();
if(opposEdge != null){
//find out which one we want to delete.
pt.translateToGUIPosition(e.endNode.getPosition());
Position oneEnd... |
68a671b4-78ce-4c81-8464-5269e5aa5775 | 2 | private ArrayList<String> getFilesNamesFromFolderWithJPG(){
ArrayList<String> filesNames = new ArrayList<String>();
File folderWithJPG = new File(this.folderWithJPG);
File[] files = folderWithJPG.listFiles();
for(File f:files){
if(f.isFile()){
filesNames.add(getFileNameWithoutExtension(f));
System.ou... |
d00207ad-de3c-44ff-b174-46101a8e8fd1 | 9 | public void parseParameters(String paramstring) throws MaltChainedException {
if (paramstring == null) {
return;
}
final String[] argv;
String allowedFlags = "sceB";
try {
argv = paramstring.split("[_\\p{Blank}]");
} catch (PatternSyntaxException e) {
throw new LiblinearException("Could not split t... |
038630f6-189e-4bab-8fb5-9c9b4307dcfe | 7 | private final void method1025
(int[] is, int[] is_404_, int i, int i_405_, int i_406_, float f,
float f_407_, float f_408_, float f_409_, float f_410_, float f_411_,
float f_412_, float f_413_, float f_414_, float f_415_, float f_416_,
float f_417_, float f_418_, float f_419_, float f_420_, float f_421_,
float... |
2eb45eca-38af-44f8-8295-0cca5364c340 | 0 | @XmlElement
public void setAge(int age) {
this.age = age;
} |
b56a7527-0d75-46cf-9ef3-9ab17590590f | 2 | public void zoomIn() {
if (tileSize + TILE_SIZE_STEP > TILE_MAX_SIZE)
return;
int oldSize = tileSize;
Container c = GraphicPanel.this.getParent();
int newX, newY;
tileSize += TILE_SIZE_STEP;
revalidateScroll();
if (c instanceof JViewport) {
JViewport jv = (JViewport) c;
Point pos = jv... |
42811677-ce5a-4464-a8f5-cffce06a1e3b | 3 | public void newNPCDrop(int npcType, int dropType, int Items[], int ItemsN[]) {
// first, search for a free slot
int slot = -1;
for (int i = 0; i < maxNPCDrops; i++) {
if (NpcDrops[i] == null) {
slot = i;
break;
}
}
if(slot == -1) return; // no free slot found
NPCDrops newNPCDrop = new NPCDr... |
d3d7e3e0-e466-4f94-b9d6-6d2ee3f171f8 | 0 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Float.floatToIntBits(x);
result = prime * result + Float.floatToIntBits(y);
result = prime * result + Float.floatToIntBits(z);
return result;
} |
cfcc9435-5d05-4267-8a5b-7ff28295c2a4 | 2 | public void moveClouds(){
// Move the clouds
for(int i=0; i<clouds.size(); i++){
Cloud cld2 = clouds.get(i);
if(cld2.getDone()){
clouds.remove(cld2);
clouds.add(new Cloud());
}
else{
cld2.move();
... |
2a1bb784-f0e6-4be7-b482-31a10f7abf0f | 0 | public String toString() {
return "" + id + ", " + firstName + ", " + lastName + ", " + age;
} |
0e43a265-52ff-445a-b0a4-76f2f24f761f | 5 | private void updateAddDragObject(String name) {
CategoryType actCategory = guiBuilder.getDragObjectByName(name)
.getCategory();
if (actCategory == CategoryType.BASS) {
this.animationCountArray[0] += 1;
this.animationArray[0] = true;
} else if (actCategory == CategoryType.BEATS) {
this.animationCountA... |
da4f30b2-14d2-4c50-8b61-4993763ba219 | 8 | private boolean kingInCheck(PlayerNum playerNum, int x, int y) {
if (!inBounds(x, y)) {
return false;
}
//Iterates through the board and check each pieces movesets
for (int i = 0; i < board.length; ++i) {
for (int j = 0; j < board[0].length; ++j) {
if (!inBounds(i, j)) {
continue;
}
boole... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.