text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void loopSoundThroughRobots(String paramString)
{
for (int i = 0; i < this.RobotsWereShootingAt.size(); i++)
{
Robot localRobot = (Robot)this.RobotsWereShootingAt.elementAt(i);
Vector localVector = localRobot.getLoopList();
int j = 0;
for (int k = 0; (k < localVector.size()) &... | 5 |
static public void receivedBeaconManager(String str){
if(ClientMain.runingRequester==true || ClientMain.runingProvider==true)
{
if(Integer.parseInt(str.split("BEACON DEVICE NUM:")[1]) == ClientMain.myID_Num); //Don't print own beacon
else if (ReceiverThread.ignoreBrokerList.contains(Integer.parseInt(str.sp... | 4 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Please enter a postfix expression: ");
String expression = in.nextLine();
String[] values = expression.split(" ");
Stack<Integer> operands = new Stack<Integer>();
for(String val : values){
i... | 9 |
@Override
public String toString() {
return "info.toegepaste.www.entity.Artikel[ id=" + id + " ]";
} | 0 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return super.okMessage(myHost,msg);
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS))
&&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL)
&... | 9 |
public void setEQ(float[] eq0)
{
this.eq = eq0;
if (eq==null)
{
eq = new float[32];
for (int i=0; i<32; i++)
eq[i] = 1.0f;
}
if (eq.length<32)
{
throw new IllegalArgumentException("eq0");
}
} | 3 |
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
String register = request.getParameter("register");
String loginn = request.getParameter("loginn");
String edit = request.getParameter(... | 8 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String)object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.... | 6 |
public void visit_lshl(final Instruction inst) {
stackHeight -= 3;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 2;
} | 1 |
public static void main(String [] args) {
CumulatedRevenue revenues = new CumulatedRevenue();
if (args.length < 1) {
quit("Usage: Main --scheduler [day]");
}
String policy = args[0].substring(2); //get rid of the leading "--"
if (args.length == 1 || args[1].equals("... | 7 |
public void testKeySet() {
int element_count = 20;
String[] keys = new String[element_count];
int[] vals = new int[element_count];
TObjectIntMap<String> raw_map = new TObjectIntHashMap<String>();
Map<String,Integer> map = TDecorators.wrap( raw_map );
for ( int i = 0; i <... | 6 |
private void setTactics() throws JSONException {
// Wenn Taktik erwünscht
if (Config.getTactics()) {
if (Config.getFightDebug())
Output.printTab("Suche nach Taktik für " + opponent.getName()
+ ": ", Output.DEBUG);
String[] tactics = TacticsLogFile.getTactics(opponent.getName());
if (tactics !... | 5 |
public void DijkstraAlgorithm() {
int s = startV; // s is the starting vertex
// mark s as explored
exploredNodes.add(s);
// int indexOfS = unexploredNodes.indexOf(s);
// unexploredNodes.remove(indexOfS);
// update the shorted path from s to s to be 0, and add s to the Path
// from s to s
shortestPath... | 5 |
private MoveMessageType getAppropriateMove(Board board, int playerID,
Position playerPos) {
PositionType forbiddenPos = board.getForbidden();
MoveMessageType message = new MoveMessageType();
Position treasurePos = board.getTreasurePos();
if (treasurePos == null) {
// Treasure on shift card
Map<MoveMe... | 8 |
public void addDirectory(File file) {
if(file == null || !file.isDirectory()) {
return;
}
exploreDirs.add(file);
} | 2 |
@Override
public void run()
{
// only attempt if a) there are 3 unchoked connections and b) there is at least one choked connection
// randomly choose choked peer
// out of active peers, choose one with least amount of pieces downloaded
// trade places with these two chosen peers
// set all the peers in... | 8 |
public synchronized void addUnsearchList(String url){
String filename = unarchedSitesFilePath;
try{
BufferedReader in = new BufferedReader(new FileReader(filename));
String tmpFileName = filename + ".tmp";
BufferedWriter bw = new BufferedWriter(new FileWriter(tmpFileName));
String line = "";
while((l... | 2 |
public void sortColorBetter(int[] nums) {
if (nums == null || nums.length <= 1) {
return;
}
int nr = 0, nb = nums.length - 1;
// find the fist element that is not red
while (nr < nums.length && nums[nr]==0) {
nr++;
}
// find the first element from left that is not blue
while (nb >=0 && nu... | 9 |
@SuppressWarnings("unchecked")
Renter(HashMap<String, Object> renter){
this.ID = java.util.UUID.randomUUID().toString().substring(0, 8);
if(renter.containsKey("PICTURE")) this.picture = (String)renter.get("PICTURE");
if(renter.containsKey("NAME")) this.name = (String)renter.get("NAME");
if(renter.containsKe... | 4 |
@Override
public void deserialize(Buffer buf) {
worldX = buf.readShort();
if (worldX < -255 || worldX > 255)
throw new RuntimeException("Forbidden value on worldX = " + worldX + ", it doesn't respect the following condition : worldX < -255 || worldX > 255");
worldY = buf.readShor... | 6 |
private void init() {
setLayout(new AbsoluteLayout());
this.setMinimumSize(new Dimension(161, 226));
this.setMaximumSize(getMinimumSize());
this.setPreferredSize(getMinimumSize());
this.setBorder(new BorderUIResource.EtchedBorderUIResource());
backButton.setFont(smallFon... | 3 |
@Override
public String execute(SessionRequestContent request) throws ServletLogicException {
String page = ConfigurationManager.getProperty("path.page.tour");
try {
Criteria criteria = new Criteria();
Tour currTour = (Tour) request.getSessionAttribute(JSP_CURRENT_TOUR);
... | 3 |
public void paint1(Graphics g) {
g.drawImage(background, 8, 30, this);
g.setFont(new Font("Serif", Font.BOLD, 34));
g.drawString("" + score, 220, 80);
if (avion != null) {
if (!perdio) {
Graphics2D g2d = (Graphics2D) g;
// Rotation informat... | 7 |
public boolean batchFinished() throws Exception {
if (getInputFormat() == null) {
throw new IllegalStateException("No input instance format defined");
}
if (m_removeFilter == null) {
// establish attributes to remove from first batch
Instances toFilter = getInputFormat();
int[] at... | 9 |
private HttpURLConnection getConn(Request request)
throws URISyntaxException, IOException, HmacException {
String path = String.format("%s/%s", request.getPathPrefix(),
subscriberId);
if (request.getPackageId() != null) {
path += "/" + request.getPackageId();
... | 9 |
public SearchFilter(ConnectionProcessor connectionProcessor, Properties config) {
super(connectionProcessor, config);
requireConfigKey(KEY_ACTION);
action = config.getProperty(KEY_ACTION);
if (!ACTIONS.contains(action)) {
throw new Error("unrecognized action: '" + action + "'... | 6 |
public void setHoraRecogida(String horaRecogida) {
this.horaRecogida = horaRecogida;
} | 0 |
@PostConstruct
public void init() {
System.out.println("PostConstruct");
} | 0 |
public GameLevel(String levelConfig) throws Exception
{
System.out.println(levelConfig);
if (levelConfig == null)
return;
entities = new ArrayList();
tiles = new ArrayList();
int currentY = 0;
boolean hasPacman = false;
String[] lines = levelConfig.split("\n");
for (int y = 0; y ... | 9 |
public static void trade(Player player, String[] args) {
// trade <player> <item> <amount> <money>
if (args.length == 4) {
Player target = Bukkit.getPlayer(args[0]);
if (target != null && target.isOnline()) {
String item = args[1];
int amount = Integer.parseInt(args[2]);
float money = Float.parseF... | 6 |
private void printTimeStamp(int level)
{
switch(level)
{
case ALWAYS:
{
psOut.print(MSG_ALWAYS+LOG_SEP);
break;
}
case ERROR:
{
psOut.print(MSG_ERROR+LOG_SEP);
break;
}
case INFO:
{
psOut.print(MSG_INFO+LOG_SEP);
break;
}
case VERBOSE:
{
psOut.print(MSG_... | 6 |
public static ArrayList<Proceso>[] obtenerProcesos(String nombreArch) {
ArrayList<Proceso>[] procesos = new ArrayList[101];
for (int i = 0; i < procesos.length; i++) {
procesos[i] = new ArrayList<Proceso>();
}
try {
File archivo = new File(nombreArch);
... | 6 |
@Override
public boolean accept(File file) {
return file.isDirectory() || file.getName().endsWith(".txt");
} | 1 |
private void sell(String command) {
currentCommand = "sell";
String[] commandComps = command.split("\\s+");
if (commandComps.length != 3) {
sendToUser("Invalid command");
return;
}
if (commandComps[0].equalsIgnoreCase("SELL")
&& commandComps[1].startsWith("<")
&& commandComps[1].endsWith(">")
... | 8 |
@Override
public void removeServerStopListener(ServerStopListener listener) {
serverStopListenerList.remove(ServerStopListener.class, listener);
} | 0 |
public ArrayList<Vector> getCollisions(Polygon polygon) {
if(polygon.min.greaterThan(max) || polygon.max.lessThan(min)) {
return null;
}
ArrayList<Vector> intersections = new ArrayList<Vector>();
Vector intersection;
for(Edge edge : edges) {
for(Edge otherEdge : polygon.edges) {
intersection = edge.... | 6 |
private boolean formatFilePaths(){
//If the inputFilePath is empty turn result false
boolean result = true;
if(inputFilePath.equals("")){
result = false;
} else {
String findExtension = "(.*)\\.txt$";
String pathName = "(.*)[^\\w+\\.txt]";
String fileName = "\\w+\\.txt$";
//String find... | 8 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=proficiencyCheck(mob,0,auto);
if(success)
{
final Room R=mob.location();
final CMMsg msg=CM... | 8 |
public void update(LineEvent e)
{
if(e.getType().equals(LineEvent.Type.OPEN))
{
playEntireButton.setEnabled(false);
playBeforeButton.setEnabled(false);
playAfterButton.setEnabled(false);
selectionPrevState = playSelectionButton.isEnabled();
playSelectionButton.setEnabled(false);
... | 5 |
private double distanceFromLine(double ax, double ay, double bx, double by, double cx, double cy)
{
double distance;
double r_numerator = (cx - ax) * (bx - ax) + (cy - ay) * (by - ay);
double r_denomenator = (bx - ax) * (bx - ax) + (by - ay) * (by - ay);
double r = r_numerator / r_denomenat... | 3 |
public void setSsn(String ssn) throws Exception{
if (ssn.length() <= MIN_INT_VALUE || ssn.toString() == null || ssn.length() > MAX_SSN){
throw new IllegalArgumentException(SSN_ERR);
}
this.ssn = ssn;
} | 3 |
public void addAgent() {
Random rand = new Random();
int x;
int y;
for (Integer i = 0; i < ((EnvironnementWator) environment).nb_agent_poisson; i++) {
do {
x = rand.nextInt(environment.taille_envi);
y = rand.nextInt(environment.taille_envi);
} while (((EnvironnementWator) environment).grille[x][y]... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Tag other = (Tag) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (val... | 9 |
private void ouverture() {
try{
InputStream in = new FileInputStream(filepath);
InputStreamReader inr = new InputStreamReader(in);
BufferedReader br = new BufferedReader(inr);
String ligne;
while ((ligne=br.readLine())!=null){
fichier +=ligne+" ";
}
br.close();
}
catch (Exception e){
... | 2 |
public void maj() {
System.out.println("MAJ DE L'INTERFACE");
int i;
Date dateDebut;
dateDebut = new Date(fabrique.getDebut());
Date.setText(dateDebut.toString());
System.out.println(fabrique.getDebut());
//on remet à zàro chaque chaine d'affichage
//chaine contenant tous les messages
chaine_affich =... | 2 |
private void actualizarTabla(){
if (a.getSizeArray() < 15) {
for (int i = 0; i < 15; i++) {
if (i < a.getSizeArray())
tabla.setValueAt(a.getProc(i).getNombre(), i, 0);
else
tabla.setValueAt("", i, 0)... | 7 |
@Test
public void testVersionDetection() {
testVersions("Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7d", new Version("2.8.5rel.1","2","8"));
testVersions("Mozilla/6.0 (compatible; Konqueror/4.2; i686 FreeBSD 6.4; 20060308)", new Version("4.2", "4","2"));
testVersions("Mozilla/5.0 (compatible; Konque... | 0 |
public String getReplacement() {return this.replacement;} | 0 |
public String getStato() {
return stato;
} | 0 |
public static int getRandMap() {
String path = mapDir, oldMapName = mapName;
File directory = new File(path);
File[] listOfFiles = directory.listFiles(new FilenameFilter() {
public boolean accept(File directory, String fileName) {
return fileName.endsWith(".txt");
}
});
while(mapName == oldMapNam... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
OpcodeChangedEvent other = (OpcodeChangedEvent) obj;
... | 5 |
public static ArrayList<Point> jarviz(ArrayList<Point> points) {
ArrayList<Point> copyArray = new ArrayList<Point>();
for (Shapes.Point point : points) {
copyArray.add(point);
}
ArrayList<Point> bestPoints = new ArrayList<Shapes.Point>();
Shapes.Point cP = points.get... | 5 |
public char nextClean() throws JSONException {
for (;;) {
char c = this.next();
if (c == 0 || c > ' ') {
return c;
}
}
} | 3 |
private void paintListLayered(Graphics g, int p0, int p1, Shape viewBounds,
JTextComponent editor, View view, List highlights) {
for (int i=highlights.size()-1; i>=0; i--) {
Object tag = highlights.get(i);
if (tag instanceof LayeredHighlightInfo) {
LayeredHighlightInfo lhi = (LayeredHighlightInfo)tag;... | 6 |
public List<Player> getRunningbackList() throws IOException, ParseException {
List<String> csvPlayers = retriveData(RB_PROJECTION_LINK);
List<Player> players = new ArrayList<Player>();
for (String playerString : csvPlayers) {
String[] split = playerString.split("\t");
i... | 2 |
public void method454(int arg0) {
for (anInt1570 += arg0; anInt1570 > spotAnimation.sequence.getFrameLength(anInt1569);) {
anInt1570 -= spotAnimation.sequence.getFrameLength(anInt1569) + 1;
anInt1569++;
if (anInt1569 >= spotAnimation.sequence.length && (anInt1569 < 0 || anInt1569 >= spotAnimation.sequence.le... | 4 |
private void initRenderables() {
// Init the reflection API
// Look for classes implementing the Renderable interface
Set<Class<? extends Renderable>> renderables = new Reflections("net.carmgate.morph").getSubTypesOf(Renderable.class);
// Iterate over the result set to initialize each renderable
for (Class<?... | 9 |
public void removeEdge(Object vertex1, Object vertex2) {
adjacent(vertex1).remove(vertex2);
adjacent(vertex2).remove(vertex1);
} | 0 |
public void setLineNumbers(final LineNumberDebugInfo[] lineNumbers) {
if (code != null) {
code.setLineNumbers(lineNumbers);
}
} | 1 |
public synchronized String decode(byte[] buffer) {
if (buffer == null) {
return null;
}
StringBuffer stringbuffer = new StringBuffer((buffer.length * 100) / 60);
f = buffer;
g = 0;
h = 0;
e = false;
Object aobj[] = b;
do {
if (e) {
break;
}
aobj = (Object[]) aobj[a()];
if (aobj[... | 6 |
@Override
public void display(UserInterface ui) {
ui.signalNeedToDisplayFunction();
} | 0 |
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource() instanceof JButton)
{
JButton bouton = (JButton) evt.getSource() ;
String texte = bouton.getText() ;
if (texte.equals(BTN_SOLO))
modelePanneau.setChoix(MENU_PSEUDO) ;
else if (texte.equals(BTN_MULTI))
modelePanneau.setChoix(MENU... | 6 |
public MetricsLite(Plugin plugin) throws IOException {
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
}
this.plugin = plugin;
// load the config
configurationFile = getConfigFile();
configuration = YamlConfiguration.loadCo... | 2 |
public int calculateValue(ArrayList<Card> player) {
if(isStraightFlush(player))
return 8;
else if(isFourOfAKind(player))
return 7;
else if(isFullHouse(player))
return 6;
else if(isFlush(player))
return 5;
else if(isStraight(player))
return 4;
else if(isThreeOfAKind(player))
return 3;... | 8 |
@Test
public void determineHighestStraight_whenHandContainsAto5_returnsWheelStraight() {
Hand hand = findHighestStraight(FourFlushWithWheelStraight());
assertEquals(HandRank.Straight, hand.handRank);
assertEquals(Rank.Five, hand.ranks.get(0));
} | 0 |
public Geometric2DNodeCollection(){
// Immediately stop execution if rMax is not defined in the xml config file.
try {
rMax = Configuration.getDoubleParameter("GeometricNodeCollection/rMax");
} catch(CorruptConfigurationEntryException e) {
Main.fatalError(e.getMessage());
}
double ratio = dimX / rM... | 3 |
public void updateSubTypes() {
argType = (type instanceof ArrayType) ? Type
.tSubType(((ArrayType) type).getElementType()) : Type.tError;
for (int i = 0; i < subExpressions.length; i++)
if (subExpressions[i] != null)
subExpressions[i].setType(argType);
} | 3 |
private boolean performOnce() {
if (tick > MAX_TICKS) {
label.setText("Time out!!!");
label.setVisible(true);
// print error message
System.err.println("[ERROR] The player is time out!");
next.setEnabled(false);
... | 1 |
private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed
if(JOptionPane.showConfirmDialog(rootPane, "Você tem certeza que deseja "
+ "sair ?","",JOptionPane.OK_CANCEL_OPTION) == 0){
this.dispose();
}
}//GEN-LAST:event_b... | 1 |
public void determineVelocity(Ball ball, boolean westCollision, boolean eastCollision){
if(westCollision && eastCollision){
ball.getVelocity().x = ball.getCenterPoint().x > rect.getCenterX() ? Maths.positive(ball.getVelocity().x) : Maths.negative(ball.getVelocity().x);
}
else if(westCollision){
ball.getVe... | 5 |
public static void main(String[] args)throws Exception {
// TODO Auto-generated method stub
Socket sock = new Socket("127.0.0.1", 3000);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
OutputStream os = sock.getOutputStream();
PrintWriter pw = new PrintWriter(os, true);
I... | 2 |
private void removeAllUpgrades(BodyPart bodyPart){
for(Upgrade u : bodyPart.getUpgrades()){
if(u != null){
this.removeUpgrade(u, bodyPart);
}
}
} | 2 |
public final void removeLocation(Location location)
{
Location remove = null;
for (Iterator<Location> tocheck = getLocs().iterator(); tocheck.hasNext(); ) {
Location loc = (Location)tocheck.next();
boolean world = loc.getWorld().getName() == location.getWorld().getName();
boolean x = loc.getBlockX() == lo... | 6 |
public Vector AStarSearch(Agent agent) {
PQ openQ = new PQ();
// initialize a start node
Node startNode = new Node();
startNode.location = startLoc;
startNode.costFromStart = 0;
startNode.costToGoal = pathCostEstimate(startLoc, goalLoc, agent);
startNode.totalCost = startNode.costFromStart + startNode.c... | 9 |
@Override
public int estimateCostToGoal(SearchState state) {
short[] board = state.board.board;
for (int y = 0; y < maxLines - 1; y++) {
boolean beforeCave = true;
boolean inCave = false;
for (int x = 0; x < Board.WIDTH; x++) {
if (isSet(board[y+1], x)) {
if (inCave)
... | 7 |
public static void storeChunkInCompound(Chunk var0, World var1, NBTTagCompound var2) {
var1.checkSessionLock();
var2.setInteger("xPos", var0.xPosition);
var2.setInteger("zPos", var0.zPosition);
var2.setLong("LastUpdate", var1.getWorldTime());
var2.setByteArray("Blocks", var0.blocks);
... | 4 |
public static void main(String[] args)
{
final float heapSizeMegs = Runtime.getRuntime().maxMemory() / 1024L / 1024L;
boolean start = false;
if (heapSizeMegs > MIN_HEAP || !start)
{
start = true;
}
else
{
try
{
... | 5 |
protected boolean checkSchema() throws NotValidXMLException
{
try
{
if ((xmlFileName != null) && (dtdFileName != null) && (xsdFileName != null))
{
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
File xsdFile = new File(xsdFileName);
Schema schema =... | 7 |
public void paint(Graphics g, int xMouse, int yMouse){
g.drawImage(frontBG, 0, 0, null);
if(xMouse>33 && xMouse<163 && yMouse>414 && yMouse<454)
g.drawImage(playM, 33, 415, null);
else if(xMouse>33 && xMouse<163 && yMouse>472 && yMouse<512)
g.drawImage(resumeM, 33, 473, null);
} | 8 |
public String data() {
StringBuilder sb = new StringBuilder();
for (Node childNode : childNodes) {
if (childNode instanceof DataNode) {
DataNode data = (DataNode) childNode;
sb.append(data.getWholeData());
} else if (childNode instanceof Element) ... | 3 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Post post = (Post) o;
if (id != post.id) return false;
return true;
} | 4 |
public ArrayList<String> getDoctorateTitles() {
return DoctorateTitles;
} | 0 |
public boolean optimize() {
init();
int k = 1; // the first step has been explore in init()
double gNorm, xNorm, fx_old, converge;//get the initial function value and gradient
//initial step for gradient descent
double fx = m_func.calcFuncGradient(m_g);
do {
fx_old = fx;
getSearchDirection(... | 5 |
public String getBrand() {
return brand;
} | 0 |
@Override
public Component getTreeCellRendererComponent(final JTree tree,
final Object value, final boolean sel, final boolean expanded,
final boolean leaf, final int row, final boolean hasFocusCurrently) {
// System.out.println(value);
super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf,
... | 4 |
protected void resizeDesktop() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
int x = 0;
int y = 0;
JScrollPane scrollPane = getScrollPane();
Insets scrollInsets = getScrollPaneInsets();
if (scrollPane != null) {
JInternalFrame allFrames[] = desktop.getAllFrames();
... | 7 |
public void sendFile(final String filePath) {
prepareConnection();
Thread queryThread = new Thread() {
public void run() {
try {
webResource = client.resource(address + "adminPanel/upload/");
webResource.addFilter(new ConnectionListenerFilter(
new SendPackageListenerFactory()));
Client... | 1 |
public void i() {
currentProgress++;
if(currentProgress < finalProgress) {
bar.setValue((int)((currentProgress/finalProgress)*100));
} else {
bar.setValue(100);
frame.setVisible(false);
}
} | 1 |
@Override
public void onEnable() {
setConstant(this);
long time = System.currentTimeMillis();
this.getDataFolder().mkdir();
this.saveDefaultConfig();
FileConfiguration config = getConfig();
log = config.getBoolean("Log.Enabled", true);
if (config.getDouble("Co... | 8 |
public void run() {
if(inKnowledge(endGoal) && (endGoal.getFrom() == null || endGoal.getFrom().getPremises().isEmpty())) {
Deduction d = new Direct(endGoal);
add(d);
}
if(!proven) {
forward();
backward();
}
} | 4 |
public void makeFrame() {
frame = new JFrame("Word Up");
frame.setMinimumSize(new Dimension(400, 200));
contentPane = frame.getContentPane();
buttonsPanel = new JPanel();
buttonsPanel.setLayout(new GridLayout(1,2));
submit = new JButton("Submit");
submit.addActionListener(new ActionListener()
{ public void ... | 2 |
public static Direction getMostFittingDirection(int dx, int dy) {
if (dx > 0) {
if (dx > Math.abs(dy)) {
return RIGHT;
} else {
return dy > 0 ? DOWN : UP;
}
} else {
if (-dx > Math.abs(dy)) {
return LEFT;
} else {
return dy > 0 ? DOWN : UP;
}
}
} | 5 |
@Override
public void actionPerformed(ActionEvent ae)
{
for(int i=0;i<tempStudentLinkedList.size();i++)
{
if(ae.getSource()==tempAddButtonList.get(i))
{
System.out.println("You Found A button was clicked in the waiting Dialog For Text");
new GeneralDialogBox(sf, tempStudentLinkedList.get(i... | 9 |
public void addArgument(Object argument) {
arguments.add(argument);
} | 0 |
public double comparePhases() {
int cycleListSize = (s1.numCycles() > s2.numCycles()) ? s1.numCycles() : s2.numCycles();
int match = 0;
int size = 0;
for (int i = 0; i < cycleListSize; i++) {
if (i >= s1.numCycles()) {
System.out.println("--CYCLE MISMATCH (IN... | 9 |
public Object getValueAt(int row, int col) {
Journal journal = journals.getBusinessObjects().get(row);
if (col == 0) {
return journal;
} else if (col == 1) {
return journal.getType();
} else if (col == 2) {
return journal.getId();
} else return... | 3 |
public boolean matches( Class<?> clazz )
{
return Modifier.isPrivate( clazz.getModifiers() );
} | 1 |
@Override
public void preform(int source){
switch(source) {
case(0): openNewGui(References.GUI_JOINSCREEN); break;
case(1): Rocket.getRocket().player.isHost = true; openNewGui(References.GUI_LOBBY); break;
case(3): Rocket.getRocket().isRunning = false; break;
}
} | 3 |
public void volcarDatos(ArrayList<Prestamos> rows){
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
while(model.getRowCount()>0)model.removeRow(0);
for(Prestamos row : rows){
Object[] fila = {
row.getFecha(),
row.getEstado(), ... | 2 |
public static void printExpressionString(PrintContext p, RDFNode node, boolean nested, boolean force, PrefixMapping prefixMapping, SPINModuleRegistry registry) {
if(node instanceof Resource && SPINFactory.asVariable(node) == null) {
Resource resource = (Resource) node;
Aggregation aggr = SPINFactory.asAggre... | 8 |
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.