text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static mxFibonacciHeap union(mxFibonacciHeap h1, mxFibonacciHeap h2)
{
mxFibonacciHeap h = new mxFibonacciHeap();
if ((h1 != null) && (h2 != null))
{
h.min = h1.min;
if (h.min != null)
{
if (h2.min != null)
{
h.min.right.left = h2.min.left;
h2.min.left.right = h.min.right;
... | 5 |
private static List<VoieDeCirculation> parcoursGraphe(Intersection intersectionPrecendente, Intersection depart, Intersection arrivee) {
List<VoieDeCirculation> parcours = new ArrayList<VoieDeCirculation>();
parcours.add(depart);
for (Route r : depart.getRoutes()) {
List<VoieDeCircul... | 6 |
public User getUser(String ID) {
for (User u : allUsers) {
if (u.getID().equalsIgnoreCase(ID)) {
return u;
}
}
return null;
} | 2 |
public void zerosFit(){
this.bestBinsCount = 100;
this.bestFitBinsCount = 100;
} | 0 |
public void testMaximumValue() {
DateMidnight dt = new DateMidnight(1570, 1, 1);
while (dt.getYear() < 1590) {
dt = dt.plusDays(1);
YearMonthDay ymd = dt.toYearMonthDay();
assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
assertEqual... | 1 |
public ProtocolResultFromServer() {
isAccept = false;
mClientContacts = null;
} | 0 |
public static void floodFill(int r, int c) {
for (int i = 0; i < dir.length; i++)
if (r + dir[i][0] >= 0 && r + dir[i][0] < n && c + dir[i][1] >= 0
&& c + dir[i][1] < m
&& map[r + dir[i][0]][c + dir[i][1]] == '@') {
map[r + dir[i][0]][c + dir[i][1]] = '*';
floodFill(r + dir[i][0], c + dir[i][1]);... | 6 |
private void deleteCache(Object[] args) throws CacheUnreachableException {
List<CacheDeleteDefinition> deletes = cacheDefinitionCollection.getCacheDeleteDefinitions();
if (deletes == null) {
return;
}
// 根据cacheDefinitionCollection中配置的所有删除缓存操作,循环调用,删除缓存
for (CacheDeleteDefinition definition : deletes) {
... | 3 |
public int compareTo(LessFileStatus other) {
long diff = getLastModified() - other.getLastModified();
return diff > 0 ? -1 : (diff < 0 ? 1 : other.getLessName().compareTo(getLessName()));
} | 2 |
public double pow(double x, int n) {
if (x == 1) {
return 1;
}
if (x == -1) {
return (n % 2 == 0) ? 1 : -1;
}
if (n < 0) {
return pow(1 / x, -n);
}
if (n == 0) {
return 1;
} else if (n == 1) {
r... | 7 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
private void fillZipEntries(int nr) {
Enumeration zipEnum = zips[nr].entries();
zipEntries[nr] = new Hashtable();
while (zipEnum.hasMoreElements()) {
ZipEntry ze = (ZipEntry) zipEnum.nextElement();
String name = ze.getName();
// if (name.charAt(0) == '/')
// name = name.substring(1);
if (zipDirs[nr... | 5 |
@Override
protected void updateAnimation(double p) {
double dTheta;
switch (rotationStrategy) {
case (ROTATE_CLOCKWISE): {
dTheta = (fTheta - iTheta >= 0) ? (fTheta - iTheta) : ((fTheta - iTheta) % (2 * Math.PI) + (2 * Math.PI));
break;
}
... | 5 |
public void endElement(String uri, String localName, String qName) throws SAXException {
String elementName = localName;
if ("".equals(elementName)) {
elementName = qName;
}
if(elementName.equals("systemlist")){
currentElement = ProcessingElement.NONE;
}
else if (elementName.equals("system")){
... | 3 |
private static int bcd(char digit) {
if (digit >= '0' && digit <= '9') {
return digit - '0';
}
switch (digit) {
case '.':
return 10;
case '-':
return 11;
case '+':
return 12;
default:
return 13;
}... | 5 |
public static void battleEvent(Character hero, NPC baddie)
{
while (baddie.getHealth() > 0)
{
hero.attack(baddie);
System.out.println("baddie HP: " + baddie.getHealth() + "\n");
// Test whethdkafj baddie is dead already b4 we continue
if (baddie.getHealth() <= 0)
{
... | 3 |
public static void checkChangesInTestPlan() {
GuiPackage guiPackage = GuiPackage.getInstance();
if (guiPackage.isDirty()) {
int chosenOption = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(),
"Do you want to save changes in current test-plan?",
... | 3 |
public Expression simplify() {
if (!staticFlag) {
subExpressions[0] = subExpressions[0].simplify();
subExpressions[0].parent = this;
if (subExpressions[0] instanceof ThisOperator) {
FieldAnalyzer field = getField();
/*
* This should check for isFinal(), but sadly, sometimes jikes
* doesn't ... | 6 |
public static boolean getMouseDown(int mouseButton)
{
return getMouse(mouseButton) && !lastMouse[mouseButton];
} | 1 |
final void setAppWindow(AppWindow appWindow) {
if (mAppWindow != appWindow) {
mAppWindow = appWindow;
adjustForAppWindow(mAppWindow);
}
} | 1 |
public String getProperty(String property) {
return properties.getProperty(property);
} | 0 |
@Override
public ArrayList<Integer[]> crossover(ArrayList<Integer[]> population, int size, double crossProbability) {
int popSize = population.size();
ArrayList<Integer[]> newPopulation = new ArrayList<>();
Integer[] t1;
Integer[][] t;
for (int i = 0; newPopulation.size() < s... | 5 |
public List<String> getSourceTree(String commitID)
{
try
{
List<String> fileList = new ArrayList<String>();
List<CommitFamily> commitPath = getCommitPathToRoot(commitID);
List<CommitFamily> shortestCommitPath = new ArrayList<CommitFamily>();
Map<String, List<String>> commitCaches = getCommitCachesFromC... | 8 |
public double getAccuracy(Matrix features, Matrix labels) {
double sum = 0;
for (int i = 0; i < labels.getNumRows(); i++) {
List<Double> result = predict(features.getRow(i));
if (labels.getNumCols() != result.size()) {
throw new MLException(String.format(
... | 5 |
public void checkWin(){
for (PlayerPawn v : playerPawns){
if (v.checking){
//Only shows if it's the only player left
if (playerPawns.size()==1){
JOptionPane.showMessageDialog(frame, "Player " + v.getId() + " wins!, game exiting");
//Sends the client the exit comma... | 3 |
public void stop(){
if(isMovingRight() == false && isMovingLeft() == false){
speedX = 0;
}
if(isMovingRight() == false && isMovingLeft() == true){
moveLeft();
}
if(isMovingRight() == true && isMovingLeft() == false){
moveRight();
}
} | 6 |
@Override
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
if(args[0] != null && sender instanceof Player) {
Player player = (Player)sender;
plugin.getLogger().info(""+plugin.kitsList.size());
if(plugin.checkIsKit(args[0]) == true) {
Kits kits = plugi... | 5 |
public void mouseMoved(MouseEvent e) {
super.mouseMoved(e);
if (getHyperlinksEnabled()) {
if ((e.getModifiersEx()&linkScanningMask)!=0) {
isScanningForLinks = true;
Token t = viewToToken(e.getPoint());
Cursor c2 = null;
if (t!=null && t.isHyperlink()) {
hoveredOverLinkOffset = t.offs... | 6 |
public void readModelFromFile(String fileName) throws IOException{
BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
//read smoothingValue
in.readLine();
smoothingValue = Double.parseDouble(in.readLine());
//read featureValueRelativeRoleFrequency
in.readLine();
featureValueRel... | 2 |
@Test
public void test() {
if (!MongoHelper.delete(proposal, "proposals")) {
TestHelper.failed("delete failed");
}
if (MongoHelper.fetch(proposal, "proposals") != null) {
TestHelper.failed("proposal was not deleted");
}
System.out.println("Deleted p... | 2 |
public void run() {
if (SystemTray.isSupported()) { //only launch if supported
MouseListener mouseListener = new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) { //show and hide the server window when left-click on the tray icon
... | 3 |
public String getAtTime() {
return AtTime;
} | 0 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player)sender;
if(commandLabel.equalsIgnoreCase("feed"));
if(sender.hasPermission("basics.command.feed.self") || sender.isOp()) {
if(args.length == 0) {
player.setExhaustion(20);
pl... | 7 |
private static Customer CustomerObject(ResultSet rs) {
Customer newCustomer = null;
try {
newCustomer = new Customer(rs.getInt(rs.getMetaData().getColumnName(1)),
rs.getString(rs.getMetaData().getColumnName(2)),
... | 1 |
private TMState getAutomatonFromFile(int i, Point point) {
TMState block = new TMState(i, point, this);
Serializable serial = OpenAction.getLastObjectOpened();
File lastFile = OpenAction.getLastFileOpened();
if (lastFile == null || OpenAction.isOpened() == false) {
return null;
}
// block = putBl... | 2 |
public static int getNumber(Scanner scanner, String message) {
int number = 0;
System.out.println(message);
while (!scanner.hasNextInt()) {
System.out.println("Error: incorrect data.\n" + message);
scanner.next();
}
number = scanner.nextInt();
retu... | 1 |
public void replace(PumpingLemma pl)
{
for(int i = 0; i < myList.size(); i++)
{
if(pl.getClass().equals(myList.get(i).getClass()))
{
myList.remove(i);
myList.add(i, pl);
}
}
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
Numbers numbers = (Numbers) obj;
if (id != null ? !id.equals(numbers.id) : numbers.id != null) {
... | 7 |
static Vector square(int face, float bottom, float left, float top, float right, float d) {
Vector<Vector3d> sq = new Vector<>();
Vector3d[] ps = new Vector3d[5];
for (int i = 0; i < 5; i++) {
ps[i] = new Vector3d(d, d, d);
sq.addElement(ps[i]);
}
switch... | 7 |
public AutomataNoteEvent(Automaton auto, Note note,
boolean add, boolean change) {
super(auto);
myNote = note;
myAdd = add;
myChange = change;
} | 0 |
public Object getValue(Object self) {
try {
Object[] params = {};
if (readMethod != null) {
return readMethod.invoke(self, params);
} else if (field != null) {
return field.get(self);
} else {
throw new RuntimeExcept... | 4 |
public final void setNeedDraw(Boolean needDraw) {
this.needDraw = needDraw;
this.repaint();
} | 0 |
public void sendMessage(ChatPlayer player, String message) {
message = formatMessage(player, message);
for (String data : members) {
ChatPlayer cp = plugin.getChatPlayer(data);
if (!cp.ignoringPlayer(player.getName()) || cp.isChatSpying())
cp.getPlayer().sendMessage(message);
}
for (String d... | 6 |
@EventHandler
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
event.getPlayer().setDisplayName(event.getPlayer().getName());
int rank = 0;
try {
rank = HyperPVP.getStorage().readInt32("SELECT rank FROM users WHERE username = '" + event.getPlayer().getName() + "'");
} catch (SQLException e... | 7 |
@Override
public String getResourceDescriptor() {
return resourcedescriptor == null ? "" : resourcedescriptor;
} | 1 |
protected static ChattyGroup matchChatGroup(MOB meM, String myName, ChattyGroup[] chatGroups)
{
myName=myName.toUpperCase();
if(myName.equals("DEFAULT"))
return chatGroups[0];
for(final ChattyGroup CG : chatGroups)
{
if(CG.entries!=null)
{
for(final String name : CG.groupNames)
{
if(name.... | 8 |
public static boolean isAdmin(String uid) {
boolean result = false;
Connection con = DBUtil.getConnection();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = con.prepareStatement("select u_admin from mstx_user where uid=?");
pstmt.setInt(1, Integer.parseInt(uid));
rs = pstmt.execut... | 2 |
SingleRevisionIterator(final String elementType, final Object elements, final boolean getContentImmediately) {
if ((elementType == null) || (elementType.length() == 0))
throw new IllegalArgumentException("elementType is null or empty");
if (!((elements instanceof String[]) || (elements instanceof long[])))
... | 5 |
public void poistaPalaute(int palauteID) throws DAOPoikkeus {
//Avataan tietokantayhteys
Connection yhteys = avaaYhteys();
try {
//Suoritetaan haku
String sql = "DELETE from Palaute WHERE palauteID=?";
//Alustetaan sql-lause
PreparedStatement lause = yhteys.prepareStatement(sql);
... | 1 |
@Override
public void keyPressed(KeyEvent arg0) {
int code = arg0.getKeyCode();
if(code < 0 || code >= keys.length)return;
keys[code] = true;
} | 2 |
public synchronized void agree(String x){
Utils.out(pid,"x " + x);
for ( int i = 1 ; i <= getNo(); i++){
if ( i == pid){
if ( i == 4){
while (true);
}
broadcast(Utils.CONSENSUS,x);
}
else if (collect(i)){
x = buffer[i-1];
}
}
Utils.out(pid,"decided " + x);
} | 5 |
public String getResultValue(int index) {
if (!value) return null;
if (index < 0 || index >= getResultCount()) throw new IllegalArgumentException(CLASS + ": illegal value for index");
return values.get(index);
} | 3 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
config = plugin.getConfig();
if (args.length == 1){
if (sender instanceof Player) {
Player player = (Player) sender;
if (commandLabel.equalsIgnoreCase("ctp")) {
if (sender.hasPermission("darkcommand.coo... | 6 |
public String getStringItem(String... names) throws ReaderException {
return getItem(names).toString();
} | 0 |
boolean isHbonded(int indexDonor, int indexAcceptor) {
if (indexDonor < 0 || indexDonor >= monomerCount ||
indexAcceptor < 0 || indexAcceptor >= monomerCount)
return false;
return ((min1Indexes[indexDonor] == indexAcceptor &&
min1Energies[indexDonor] <= -500) ||
(min2Index... | 7 |
public String sendToServer(String str) throws IOException {
if (client_socket != null) {
try {
os.println(str);
String line = is.readLine();
return line;
} catch (SocketException e) {
return "connection problem...";
... | 2 |
public void portCheck(){
String p = socket.getRemoteSocketAddress().toString();
int i = p.indexOf(':');
p = p.substring(0, i);
for(int j = 100; j <= 65535; j++){
try (ServerSocket mal = new ServerSocket(j)) {
System.out.println(currentUser + " has a vulenerable port on: " + j);
mal... | 2 |
public List<RoomEvent> findRoomEventsBySpecialityId(final Long specialityId) {
return new ArrayList<RoomEvent>();
} | 0 |
public WindowButtons(final Stage stage) {
super(4);
this.stage = stage;
this.getStyleClass().add("window-buttons");
Button closeBtn = new Button();
closeBtn.getStyleClass().add("window-close");
closeBtn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent... | 0 |
private boolean versionCheck(String title) {
if (this.type != UpdateType.NO_VERSION_CHECK) {
final String version = this.plugin.getDescription().getVersion();
if (title.split(" v").length == 2) {
final String remoteVersion = title.split(" v")[1].split(" ")[0]; // Get the ... | 5 |
public Cluster rest(int i) {
Cluster c = new Cluster();
c.merge(this);
c.remove(i);
return c;
} | 0 |
void createExampleWidgets () {
/* Compute the widget style */
int style = getDefaultStyle();
if (topButton.getSelection ()) style |= SWT.TOP;
if (bottomButton.getSelection ()) style |= SWT.BOTTOM;
if (borderButton.getSelection ()) style |= SWT.BORDER;
if (flatButton.getSelection ()) style |= SWT.FLAT;
... | 6 |
void blendingBenchmark(String[] args) {
int iterations = args.length > 1 ? Integer.valueOf(args[1]) : 100;
int testW = args.length > 2 ? Integer.valueOf(args[2]) : 512;
int testH = testW;
CPLayer l1 = new CPLayer(testW, testH), l2 = new CPLayer(testW, testH);
System.out
.println("Benchmarking layer blend... | 5 |
public void pickup()
{
// by iterating backwards, removing objects won't break the remaining
// loop cycles.
for (int i = _gumballs.size() - 1; i >= 0; i--)
{
if (isDownLow(_gumballs.get(i)))
{
_gumballs.remove(i);
}
}
} | 2 |
public ArrayList<Resource> getFilled() {
ArrayList<Resource> res = new ArrayList<>();
for (Resource r : Resource.values())
if (getF(r) != 0) res.add(r);
return res;
} | 2 |
public static void Parser_comand(String cmd)
{
int length_cmd = cmd.length();
StringBuilder aaa = new StringBuilder();
char str;
for (int k=11; k<length_cmd-9;k++)
{
str= cmd.charAt(k);
aaa.append(str);
}
cmd = aaa+"";
WritePaymen... | 7 |
public boolean similar(Object other) {
if (!(other instanceof JSONArray)) {
return false;
}
int len = this.length();
if (len != ((JSONArray)other).length()) {
return false;
}
for (int i = 0; i < len; i += 1) {
Object valueThis = this.ge... | 8 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CanDDeliveryOrder other = (CanDDeliveryOrder) obj;
if (!Objects.equals(this.szDocId, other.szDocId)) {
... | 3 |
public void mousePressed(MouseEvent event) {
JButton source = (JButton) event.getSource();
Point point = buttonMap.get(source);
if(!running) { // activate mouse listener when program isn't running
if(SwingUtilities.isLeftMouseButton(event)) {
lifeModel.changeCell(point.x, point.y, Color.RED);... | 4 |
private void getMainPage(HttpServletResponse response, UserSession session, Map<String, Object> pageVariables) throws ServletException, IOException {
Long userId = (session != null) ? session.getId() : null;
if (userId != null) {
pageVariables.put("userId", userId);
pageVariables... | 2 |
public void move(Direction dir) {
double change;
if (modify instanceof Player) {
change = ((Player) modify).getStats().moveSpeed;
} else {
change = 1.0;
}
Level level = modify.getLevel();
switch (dir) {
case UP:
if (level.tryMove(this, x, y - change)) {
y -= change;
}
break;
case DO... | 9 |
static Type valueOf(int i) {
for(Type t: Type.values()) {
if (t.val == i)
return t;
}
return null;
} | 2 |
public void processDoneString() {
String doneString[] = input.split(" ");
String date = IsValidDate.validateDate(doneString[0]);
if (!date.equals("") && !date.equals("overdue")
&& !date.equals("archives")) { // Check Date
setDate(date);
if (doneString.length == 1) { // Check Empty File
String index ... | 8 |
public static Complex[] fft(Complex[] x) {
int N = x.length;
// base case
if (N == 1)
return new Complex[] { x[0] };
// radix 2 Cooley-Tukey FFT
if (N % 2 != 0) {
throw new RuntimeException("N is not a power of 2");
}
// fft of even terms
Complex[] even = new Complex[N / 2];
for (int k = 0; k ... | 5 |
public static void printMeanConnectedDistance(double maxDist) {
double total = 0.0;
double count = 0.0;
// double maxDist = 10000;
double totalNumCon = 0.0;
double countNumCon = 0.0;
HashMap<Integer,Double> cLocsX = new HashMap<Integer,Double>(10000);
HashMap<Integer,Double> cLocsY = new HashMap<Integer,Do... | 8 |
public void displayDbProperties() {
java.sql.DatabaseMetaData dm = null;
java.sql.ResultSet rs = null;
try {
con = this.getConnection();
if (con != null) {
dm = con.getMetaData();
System.out.println("Información del controlador");
... | 3 |
public void setAccButtonPosition(Position position) {
if (position == null) {
this.buttonAccess_position = UIPositionInits.ACC_BTN.getPosition();
} else {
if (!position.equals(Position.LEFT) && !position.equals(Position.RIGHT) && !position.equals(Position.NONE)) {
... | 6 |
private void init() {
pid = 0;
pcluster = 0;
pparent = 0;
if (parts.length < 4) {
LOGGER.error("invalid argument!!!");
} else {
for (int i = 0; i < parts.length; i++) {
if ("ID".equals(parts[i])) {
pid = i;
... | 8 |
public void act()
{
// Add your action code here.
if (Greenfoot.isKeyDown(" ")){
fire();}
if (Greenfoot.isKeyDown("left")){
move(-speed);}
if (Greenfoot.isKeyDown("right")){
move(speed);}
if (bullet != null)
{
... | 5 |
public static void save(Skin skin) {
if ((skin != null)) {
if (!model.saveSkinToDefaultDirectory(skin)) {
showProblemMessage("Main.save: Skin was not saved!");
}
} else {
throw new InvalidParameterException();
}
} | 2 |
public ControlImpl(String prefix) {
this.name = prefix;
this.pid = Configuration.lookupPid(Configuration.getString(prefix + "."
+ ControlImpl.PROTOCOL));
if (Configuration.contains(prefix + "." + ControlImpl.PAR_INIT_STEP)) {
this.initStep = Configuration.getInt(prefix + "." + ControlImpl.PAR_INIT_STEP);
... | 9 |
public static boolean deleteDirectory(File directory) {
if(directory.exists()){
File[] files = directory.listFiles();
if(null!=files){
for(int i=0; i<files.length; i++) {
if(files[i].isDirectory()) {
deleteDirectory(files[i]);
}
... | 4 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
int ItemId = Main.DecodeInt();
if (ItemId == 4896)
{
if(Main.Data.Credits < 10)
{
Environment.InitPacket(68, Main.ClientMessage);
Environment.Append(true, Main.Cl... | 4 |
public void escribirObjeto (String path, String nom, Object ob) /*throws FileNotFoundException, IOException*/ {
File f = new File("./Data/Barrios/" + path);
if (!f.exists()) {
f.mkdirs();
}
f = new File("./Data/Barrios/" + path + nom + ".o");
try{
FileOutp... | 2 |
@Override
public int compare(PersonModel lhs, PersonModel rhs) {
if (lhs.exp > rhs.exp) {
return -1;
} else {
return 1;
}
} | 1 |
@Test
public void testComplexComputation(){
calculator.pushOperand(3.0);
calculator.pushOperand(4.0);
calculator.pushOperand(7.0);
calculator.pushPlusOperator();
calculator.pushTimesOperator();
calculator.evaluateStack();
assertEquals(33.0, calculator.popOperand(), 0);
} | 0 |
public Capabilities(CapabilitiesHandler owner) {
super();
setOwner(owner);
m_Capabilities = new HashSet<Capability>();
m_Dependencies = new HashSet<Capability>();
// load properties
if (PROPERTIES == null) {
try {
PROPERTIES = Utils.readProperties(PROPERTIES_FILE);
}
... | 7 |
protected void setParams( BasicType[] params ) {
if( params == null || params.length == 0 ) {
this.params = new ArrayList<BasicType>( 1 );
} else {
this.params = new ArrayList<BasicType>( params.length );
for( int i = 0; i < params.length; i++ )
this.params.add( params[i] );
}
} | 3 |
public void writeChar(char character) {
buffer.deleteCharAt(tapeHead);
buffer.insert(tapeHead, character);
cachedHash = 0xdeadbeef;
} | 0 |
public DayRoute GetProbableRoute(String mode)
{
double groupSel = Math.random()*100;
int grpIndex = 0,leftVal=0;
ArrayList<DayRoute> groupSet = new ArrayList();
Random routePicker = new Random();
for(Double groupFactor : GroupLoading)
{
//System.o... | 7 |
@Override
public double getJoystickAxis(int joystick, int axis) {
int numAxes = getNumJoystickAxes(joystick);
if (axis < 0 || axis >= numAxes) {
return 0.0;
}
return (double) joystickAxes[joystick].get(axis);
} | 2 |
public void onEnable() {
getServer().getPluginManager().registerEvents(getEvents(), this);
files.loadConfiguration();
if (!wgClass.checkWorldGuard()) {
this.getLogger().info("WorldGuard has not been found. Custom flags cannot be used!");
}
if (!wgClass.checkWGCustomFlags()) {
this.getLogger().info("WGC... | 5 |
public Square(char c) {
if(c == '#' || c == '.' || c == '$' || c == '*' || c == '@' || c == '+' || c == ' ') {
setValue(c);
} else {
throw new IllegalArgumentException("Invalid square type");
}
} | 7 |
public void run() {
if (url != null) {
// Obtain the results of the project's file feed
if (readFeed()) {
if (versionCheck(versionTitle)) {
String fileLink = getFile(versionLink);
if (fileLink != null && type != UpdateType.NO_DOWNLOAD) {
String name = file.getName();
// If it's... | 6 |
@Override
public void caseABooleanType(ABooleanType node)
{
for(int i=0;i<indent;i++) System.out.print(" ");
indent++;
System.out.println("(BooleanType");
inABooleanType(node);
if(node.getBoolean() != null)
{
node.getBoolean().apply(this);
}... | 3 |
public ListNode removeNthFromEnd(ListNode head, int n) {
// Start typing your Java solution below
// DO NOT write main() function
if (n < 1 || head == null)
return null;
ListNode newHead = new ListNode(0);
newHead.next = head;
ListNode cur = head, pre = newHead;
while (n > 0 && cur != null) {
cur = ... | 6 |
public double defuzzify() {
double result;
boolean isValid = this.enabled && !this.fuzzyOutput.getTerms().isEmpty();
if (isValid) {
result = this.defuzzifier.defuzzify(fuzzyOutput, minimum, maximum);
} else {
//if a previous defuzzification was successfully perfor... | 8 |
@Override
public Float getFloatProp(String key, Float value) {
Float result = value;
String propValue = getProperty(key);
if (null != propValue)
result = new Float(propValue);
return result;
} | 1 |
private Node divideTree(int left, int right, BoundingBox bbox) {
Node node = new Node();
// If too few objects remain, then make this a leaf node.
if (right - left <= maxPointsInOneLeafNode) {
node.child1 = node.child2 = null;
node.leftObjectIndex = left;
node.rightObjectIndex = right;
// Compute bo... | 7 |
final ItemDefinition method1560(int i, byte i_33_) {
if (i_33_ != 97)
((ItemDefinition) this).anIntArray2762 = null;
anInt2768++;
if (((ItemDefinition) this).anIntArray2762 != null
&& (i ^ 0xffffffff) < -2) {
int i_34_ = -1;
for (int i_35_ = 0; i_35_ < 10; i_35_++) {
if (i >= ((ItemDefinition) ... | 7 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.