text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void oldVisualizer(String file_name) {
int days = 4; //days in the data
int frame_width = 800;
int frame_height = 480;
JFrame frame=new JFrame("CS 498 Data");
frame.setSize(frame_width,frame_height);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JCanvas canvas=new JCanvas();
fram... | 9 |
public ListNode swapPairs2(ListNode head) {
if (head == null || head.next == null)
return head;
ListNode pre = null;
ListNode ppre = null;
ListNode p = head;
boolean change = true;
while (p.next != null) {
ppre = pre;
pre = p;
p = p.next;
if (change) {
if (pre == head) {
head = p;
... | 5 |
private void dijkstra(int source, int[] dist, HashMap<Integer, HashMap<Integer, Integer>> g){
dist[source]=0;
PriorityQueue<NodeWithDist> q = new PriorityQueue<NodeWithDist>();
q.add(new NodeWithDist(source, dist[source]));
while(!q.isEmpty()){
int node = q.poll().node;
for(int neighbor:g.get(node).keySet... | 3 |
private void addTable() {
tableModel = new DefaultTableModel(new String[] { "id", "czas domyslny",
"domyslne punkty", "nazwa" }, 0);
table = new JTable(tableModel);
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 1) {
JTable target = ... | 1 |
public Character getPlayerCharacter(String info)
{
String[] parsedInstructions = info.split(" ");
if(parsedInstructions[0].compareTo("Player") != 0)
{
System.out.println("Error: Incorrect Player Character creation syntax");
return null;
}
Character c;
if(parsedInstructions.length == 3)
{
//c = ... | 6 |
private static void loadOrganizationFromFile() {
// get filename from user.
System.out.print("\nEnter the filename used (q to exit): ");
String filename = user_input.nextLine();
File file = new File(filename);
String[] path = filename.split("/");
String orgName = path[path.length - 1]; // get name of ... | 9 |
public double[][] LUDecomposition(double[][] matrix) {
int n = matrix.length;
// Luodaan ja alustetaan matriisit L ja U.
double[][] matrixL = new double[n][n];
double[][] matrixU = new double[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
... | 7 |
public void generateImage() {
int image_width, image_height;
try {
//Get the dimensions of the screen in order to determine how large to render the image
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
//Define the width and height of the image
... | 5 |
public synchronized void deleteWay(int pos, long wayId){
if (poligons.size()>pos)
ways.get(pos).remove(wayId);
} | 1 |
private void resetAll()
{
clear();
try
{
System.out.println("CAUTION!");
System.out.println("If continuing with resetting, all groups and matches will be deleted!");
System.out.println("Do you want to continue? Y/N");
Scanner sc = new Scanner(... | 5 |
public static boolean inGrid(int x, int y)
{
return x >= xOff && y >= yOff && x < fieldWidth + xOff && y < fieldHeight + yOff;
} | 3 |
static public double incompleteGammaComplement(double a, double x) throws ArithmeticException {
double ans, ax, c, yc, r, t, y, z;
double pk, pkm1, pkm2, qk, qkm1, qkm2;
if (x <= 0 || a <= 0) {
return 1.0;
}
if (x < 1.0 || x < a) {
return 1.0 - incomplet... | 8 |
public int getFloorValue(int[] arr, int start, int end, int number) {
// base case
if (start > end) {
return -1;
}
// if number less than start, no number found
if (number < arr[start]) {
return -1;
}
// if number is greater than end index number ,return last number
if (number >= arr[end]) {
re... | 9 |
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_... | 9 |
public int stochRsiLookback( int optInTimePeriod,
int optInFastK_Period,
int optInFastD_Period,
MAType optInFastD_MAType )
{
int retValue;
if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) )
optInTimePeriod = 14;
else if( ((int)optInTimePeriod < 2) || ((int)optInTimePerio... | 9 |
@Override
protected DataOut doInBackground() throws Exception {
return runTest();
} | 0 |
@Override
public Success<Expression> parse(String s, int p) {
Success<Expression> resBase = AtomParser.singleton.parse(s, p);
if (resBase == null)
return null;
Expression exp = resBase.value;
p = resBase.rem;
p = optWS(s, p);
// Parse any invocations.
... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if (command.equals("Save")) {
Contact contact = createContact();
if (!contact.getFirstName().equals("")){
this.contacts.add(contact);
this.gui.clearFields();
} else {
JOptionPane.showMessageDialog(nul... | 5 |
private boolean transmitPacket(byte[] buf, int j) {
int i = 0;
boolean packet_sent = false;
DatagramPacket ack_dtg = new DatagramPacket(new byte[1024], 1024);
while (i < 3 || packet_sent) {
DATAPacket data_packet = new DATAPacket(buf, this.getIp(), this.getPort_dest(), j);
... | 5 |
public void registerEffect(MapleStatEffect effect, long starttime, ScheduledFuture<?> schedule) {
if (effect.isHide()) {
this.hidden = true;
getClient().getSession().write(MaplePacketCreator.sendGMOperation(16, 1));
getMap().broadcastMessage(this, MaplePacketCreator.removePla... | 6 |
private void jBtGravarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtGravarActionPerformed
if (jTextFieldCdForma.getText().equals("")) {
JOptionPane.showMessageDialog(null, "A forma de pagamento é obrigatória!");
jTextFieldCdForma.grabFocus();
} else if (jT... | 9 |
public void testSwarm(File file){
System.out.println("shit");
swarm.setNumberOfParticles(numberOfParticles);
System.out.println(haltingCriteria.size());
int counter = 0;
for(int i = 0; i < haltingCriteria.size(); i++){
swarm.setHaltingCriteria(haltingCriteria.get(i));
System.out.println("halt");
coun... | 4 |
private boolean equals(byte[] a1, int offs1, byte[] a2, int offs2, int num) {
while (num-- > 0) {
if (a1[offs1++] != a2[offs2++]) {
return false;
}
}
return true;
} | 2 |
public void run(){
while(flag){
second++;
if(second==60){
second= 0;
minute++;
}
if(minute==60){
minute= 0;
hour++;
}
if(hour==24){
hour= 0;
}
... | 5 |
public List<Bill> findBillsByHousehold(Household household)
throws BillNotFoundException {
Set<Bill> bills = household.getBills();
List<Bill> result = new ArrayList<Bill>();
if (bills.size() == 0) {
throw new BillNotFoundException(household, "Bill");
}
result.addAll(bills);
Collections.sort(result);
... | 1 |
public void init() {
String colorstr = getParameter("pagecolor");
if (colorstr == null)
colorstr = "ffffff";
this.pageColor = new Color(Integer.parseInt(colorstr, 16));
colorstr = getParameter("bgcolor");
if (colorstr != null)
setBackground(new Color(Integer.parseInt(colorstr, 16)));
String cp = getPa... | 4 |
private void randomFood() {
FoodList listOfFood = null;
try {
ObjectInputStream listIn = new ObjectInputStream(new FileInputStream(new File("foodList.dat")));
listOfFood = (FoodList) listIn.readObject();
listIn.close();
} catch (FileNotFoundException e) {
System.err.println("Food List ... | 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... | 6 |
private Vector<String> loadTableEntry(final SettingsData settingsData) {
Vector<String> v = new Vector<String>();
v.add(settingsData.getModuleName());
AttributeGroup atg = settingsData.getAttributeGroup();
if(atg != null) {
v.add(atg.getNameOrPidOrId());
}
else {
v.add("");
}
Aspect asp = settings... | 7 |
public ArrayList<String> getTechTitles() {
return TechTitles;
} | 0 |
public static ArrayList<String[]> cars() {
String JDBC_DRIVER = "com.mysql.jdbc.Driver";
String DB_URL = "jdbc:mysql://localhost:1234/cars";
// Database credentials
String USER = "root";
String PASS = "wps14042";
Set<String> data = new HashSet<String>();
ArrayList<String[]> data2 = new ArrayList<Str... | 9 |
public void setNumeroInt(TNumeroInt node)
{
if(this._numeroInt_ != null)
{
this._numeroInt_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.par... | 3 |
public List<ReportEntry> getReport(Long from, Long to) {
if (from == null) {
throw new IllegalArgumentException("report start date cannot be null");
}
if (to == null) {
throw new IllegalArgumentException("report end date cannot be null");
}
if (to < fro... | 8 |
public static void stringInDetail(String s) {
System.out.println(s + " length: " + s.length());
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
System.out.printf("i : %2d \u202B%c\u202B \u202B%4X\u202B \n", i, s.charAt(i), (int) c);// Character.getNumericValue(c)
... | 1 |
private boolean validarCampos (){
boolean validos = true;
if (jTextField3.getText().equals("")){
jTextField3.requestFocus();
msj_Error("Ingrese una Razon Social.");
validos=false;
}
else{
if (!control_f .isFechaValida(campoFecha.ge... | 5 |
@Override
public void addClientConnectEventListener(ConnectListener listener) {
connectEventListenerList.add(ConnectListener.class, listener);
} | 0 |
protected void addDocumentEnd() {
try {
h.endDocument();
} catch (SAXException ex) {
throw new RuntimeException(ex.toString());
}
} | 1 |
public static Aikaslotti haeAikaslottiIdlla(int id) throws NamingException, SQLException {
Yhteys tietokanta = new Yhteys();
Connection yhteys = tietokanta.getYhteys();
String sql = "SELECT * FROM Aikaslotti WHERE id = ?";
PreparedStatement kysely = yhteys.prepareStatement(sql);
... | 4 |
void printSprite()
{
//Get the current sprite path
NodeList listOfMovesSprites = sprites_doc.getElementsByTagName("Move");
boolean sprite_found=false;
for(int s=0; s<listOfMovesSprites.getLength() ; s++)
{
Node move_node = listOfMovesSprites.item(s);
Element move_element = (El... | 6 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
int i = 0;
int numPalabras = 0;
String texto = textArea.getText();
texto += " ";
if(texto.length() > 0) {
do {
if(texto.charAt(i) != ' ' &... | 4 |
protected void rotateLeft(Node<T> node) {
Position parentPosition = null;
Node<T> parent = node.parent;
if (parent != null) {
if (node.equals(parent.lesser)) {
// Lesser
parentPosition = Position.LEFT;
} else {
// Greater
... | 6 |
public AboutDialog()
{
contentPane.setBorder(DefaultUIProvider.getDefaultEmptyEtchedBorder());
setContentPane(contentPane);
setModal(true);
getRootPane().setDefaultButton(buttonOK);
try
{
aboutTextPane.setPage(getClass().getResource("/config/about.html"))... | 6 |
private static Calendar convertToCalendar(String value, int killId) {
Calendar output;
try {
int year = Integer.parseInt(value.substring(0, 4));
int month = Integer.parseInt(value.substring(5, 7)) - 1;
int day = Integer.parseInt(value.substring(8, 10));
int hour = Integer.parseInt(value.substring(11, 13... | 1 |
public static Predicate.Op getOp(String s) throws simpledb.ParsingException {
if (s.equals("="))
return Predicate.Op.EQUALS;
if (s.equals(">"))
return Predicate.Op.GREATER_THAN;
if (s.equals(">="))
return Predicate.Op.GREATER_THAN_OR_EQ;
if (s.equals("<"))
return Predicate.Op.LES... | 9 |
@Override
public void run() {
myThread = Thread.currentThread();
log.debug("SystemThread: thread starting");
watchdog.start();
synchronized (this) {
state = recalcMode();
// Bring up the OCP Links
for (Link link : ... | 5 |
public static void Kuhn(Graph input) {
input.setState(States.ARR_ADJ);
Log.print(Log.system, "Kuhn algorithm:");
// init
int n = input.getNodeCountFirstPartite();
int k = input.getVertexCount() - n;
mt = new int[k];
used = new boolean[n];
Arrays.fill(mt, -1);
for (int i = 0; i < n; i++) {
Arrays.... | 3 |
public String getColumnName(int columnIndex)
{
// Devuelve el nombre de cada columna. Este texto aparecerá en la
// cabecera de la tabla.
switch (columnIndex)
{
case 0:
return "PID";
case 1:
return "PD";
case 2:
... | 4 |
private void relaxDriveTime(Edge e, Node prevNode)
{
Node nextNode;
if (prevNode.equals(e.getFromNode()))
{
nextNode = e.getToNode();
} else
{
nextNode = e.getFromNode();
}
double g_Score = prevNode.getDistTo() + e.getWeight();
if (g_Score < nextNode.getDistTo())
{
edgeTo.put(nextNode, e);... | 2 |
public int diferencaEmSegundos(Tempo t) {
return Math.abs(segundos() - t.segundos());
} | 0 |
public void init(byte player_mode){
players = new Player[2];
boolean hasP1 = (player_mode & PLAYER_MODE_P1_ONLY)==PLAYER_MODE_P1_ONLY;
boolean hasP2 = (player_mode & PLAYER_MODE_P2_ONLY)==PLAYER_MODE_P2_ONLY;
if (hasP1) players[PLAYER_ID_P1] = new Player(PLAYER_ID_P1);
if (hasP2) players[PLAYER_ID_P2] = new P... | 2 |
private int waehleZeile() {
int zahl = 0;
while (zahl < 1 || zahl > 16) {
try {
zahl = scan.nextInt();
} catch (InputMismatchException e) {
GamePrinter.printEingabeFehler();
scan.nextLine();
return waehleZeile();
}
if (zahl < 1 || zahl > 16) {
GamePrinter.printEingabeFehler();
}
... | 5 |
public ArrayList<Processo> Consultar(String situacao){
//("") - Pesquisa sem precisar de id.
ArrayList<Processo> processos = new ArrayList();
try {
if(situacao.equals("")){
String sql = "SELECT * FROM tb_processo";
ConsultarSQL(sql,true);
... | 8 |
public void render3(Graphics g)
{
if(window != null)
{
window.render(g);
}
else if(cX >= 0 && cY >= 0 && cX < Game.fieldWidth && cY < Game.fieldHeight) //Highlights the grid that the mouse is hovering over
{
g.setColor(selectColor);
g.fillR... | 9 |
public Enemy(int startX) throws SlickException{
// Initialises things.
this.startX = startX;
location = new Ellipse2D.Float((float)startX, (float)0,10,10);
location.setFrame((float)startX, 0, 10, 10);
// Sets the speed based on difficulty.
if(Settings.difficulty == 4){speed = 5;}
... | 4 |
public String getIsSortByName() {
if(sortByName){ return "true";} else{
return "false";}
} | 1 |
public static void main(String[] args) throws SQLException {
File file = new File(HOSPITALOUT);
conn = DriverManager.getConnection("jdbc:derby://localhost:1527/hospital", "sa", "sa");
dao = new PatientDAOJdbc(conn);
List<Patient> list = dao.findAll();
... | 6 |
private static byte[] readClass(final InputStream is) throws IOException {
if (is == null)
throw new IOException("Class not found");
try {
byte[] b = new byte[is.available()];
int len = 0;
while (true) {
int n = is.read(b, len,... | 7 |
@Override
public void execute(CommandSender sender, String[] args) {
if (args.length == 0) {
sender.sendMessage(new TextComponent(ChatColor.RED + "Usage: /say <message ...>"));
return;
}
StringBuilder msg = new StringBuilder();
for (String a : args) msg.append... | 4 |
private String getPOS(String label) {
if (ADJECT.contains(label)) {
return "ADJECT";
}
else if (DET.contains(label)) {
return "DET";
}
else if (PREP.contains(label)) {
return "PREP";
}
else if (NOUNS.contains(label)) {
... | 6 |
public Sound(String path) throws Exception {
InputStream in = new FileInputStream(path);
// create an audiostream from the inputstream
AudioStream audioStream = new AudioStream(in);
// play the audio clip with the audioplayer class
AudioPlayer.player.start(audioStream);
} | 0 |
public static void main(String[] args) {
int turn = -1;
Player[] players = {null, null};
Scanner in = new Scanner(System.in);
// set the number of games
System.out.println("Input the number of games to be played:");
turn = in.nextInt();
// set player objects
for (int i = 0; i < players.length... | 4 |
private Transition createOpenAnimation(final RadialMenuItem newSelectedItem) {
// Children slide animation
final List<RadialMenuItem> children = itemToValues.get(newSelectedItem);
double startAngleEnd = 0;
final double startAngleBegin = newSelectedItem.getStartAngle();
final ParallelTransition transition = new P... | 4 |
public ItemSelectorDialog(LegendaryCardMakerFrame parent)
{
super(parent);
setSize(400, 500);
setTitle("Select Items");
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
checklist = new JCheckList<LegendaryItem>();
for (Hero h : LegendaryCardMakerFrame.lcmf.lcm.heroes)
{
checklist.add... | 9 |
public static int computeStoredBoundOnRoleset(NamedDescription relation, Stella_Object instance, Keyword lowerorupper) {
{ Skolem roleset = NamedDescription.getRolesetOf(relation, instance);
Stella_Object cardinality = null;
edu.isi.powerloom.pl_kernel_kb.IntervalCache intervalcache = null;
Stella... | 9 |
public VueConnexion getVue() {
return vue;
} | 0 |
public static TreeMap<String, Integer> getShiptypesNameOccurrence(
ArrayList<Kill> killBoard, String attribute) {
ItemIdList.getInstance();
TreeMap<Integer, Integer> intermediary = getShiptypesIDOccurrence(
killBoard, attribute);
TreeMap<String, Integer> result = new TreeMap<String, Integer>();
Iterator<... | 1 |
private static void writeSetPrimitiveBeanPropertyFromArray(final Class cl,
final CodeVisitor mw,
final Method setter,
final Class returnT... | 8 |
boolean leaf()
{
int count = 0;
if ( null != parentEdge)
count++;
if ( null != leftEdge)
count++;
if ( null != rightEdge)
count++;
if ( null != middleEdge)
count++;
if ( count > 1 )
return false;
return true;
} | 5 |
public int getDlc() {
return dlc;
} | 0 |
public void walk(String path, FilenameFilter filter)
{
File root = new File(path);
File[] list = root.listFiles();
if (list == null)
return;
for (File f : list)
{
if (f.isDirectory())
{
walk(f.getAbsolutePath(), filter);
// System.out.println("Dir:" + f.getAbsoluteFile());
}
else
{... | 5 |
public void createGenFile( GenKbAuthorization Authorization,
GenKbGenFileBuff Buff )
{
GenKbGenItemPKey pkey = schema.getFactoryGenItem().newPKey();
pkey.setClassCode( Buff.getClassCode() );
pkey.setRequiredCartridgeId( Buff.getRequiredCartridgeId() );
pkey.setRequiredItemId( Buff.getRequiredItemId() );
... | 9 |
public static HashMap<String, byte[]> unpackZip(byte[] data) throws IOException {
ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
HashMap<String, byte[]> zipData = new HashMap<>();
... | 2 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DictionaryInfo that = (DictionaryInfo) o;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
... | 7 |
public void preferenceToLongerPaths()
{
Comparator<Route> comp = new Comparator<Route>() {
@Override
public int compare(Route o1, Route o2) {
// TODO Auto-generated method stub
if(o1.getRouteTravelTime() > o2.getRouteTravelTime())
{
return -1;
}
return 1;
}
};
Route.setTotalHop... | 8 |
public String next() {
current++;
return "'prefix" + (current - 1) + "'";
} | 0 |
public void createTask( String id,
String name,
String date,
String status,
String required,
String description,
String attendants) throws JAXBException, IOException{
//Probind that the data is comming correctly
/*System.out.println( "Id: "+id+
"Name: "+name+
... | 4 |
public static String escapeHTML(String text) {
text = StringTools.replace(text,"&","&");
text = StringTools.replace(text,"<","<");
text = StringTools.replace(text,">",">");
text = StringTools.replace(text,"\"",""");
return text;
} | 0 |
@Override
public final boolean shouldSpawn() {
if (mobTime < 0) {
return false;
}
// regular spawnpoints should spawn a maximum of 3 monsters; immobile spawnpoints or spawnpoints with mobtime a
// maximum of 1
if (((mobTime != 0 || immobile) && spawnedMonsters.get() > 0) || spawnedMonsters.get() > 1) {
... | 5 |
public Color getColor() {
switch(type) {
case COPPER:
return new Color(219, 63, 45);
case ALUMINUM:
return new Color(134, 134, 134);
case SILVER:
return new Color(180, 180, 180);
case GOLD:
return Color.YELLOW;
case BISMUTH:
return new Color(242, 242, 242);
case PLATINUM:
return new Colo... | 7 |
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("HashtableNaive {\n");
for (int i = 0; i < currentSize; i++) {
sb.append(" " + keys[i] + " => " + values[i] + "\n");
}
sb.append("}");
return sb.toString();
} | 1 |
@Override public void finishPopulate()
{
} | 0 |
@org.junit.Test
public void testSerialiseInt()
{
for (int size = 1; size <= 8; size++) {
int[] numvals = new int[]{0, 10, 127, 128, 255};
for (int idx = 0; idx != numvals.length; idx++) {
byte[] barr = ByteOps.encodeInt(numvals[idx], size);
int val = ByteOps.decodeInt(barr, 0, size);
org.junit.Ass... | 9 |
public static boolean segmentSuportSeparatesPoints(Segment s, Point P, Point Q) {
Point v1 = getVectorFromTo(P, s.P);
Point u1 = getVectorFromTo(P, s.Q);
Point v2 = getVectorFromTo(Q, s.P);
Point u2 = getVectorFromTo(Q, s.Q);
double prodV1U1 = crossProd(v1, u1);
double prodV2U2 = crossProd(v2, u2);
return... | 3 |
@Override
public void parse() {
appendURL();
String result = WebUtils.source(url.toString());
result = result.substring(0, result.indexOf("]]"));
String split[] = result.split("],\\[");
StringBuilder builder = new StringBuilder();
for(String sub : split){
String[... | 2 |
public void setOption(String option, Collection values) {
if (option.startsWith("keywords")) {
keywords = (String[]) values.toArray(new String[values.size()]);
} else if (option.startsWith("backup")) {
if (values.size() != 1)
throw new IllegalArgumentException("Only one backup is allowed");
backup = (R... | 3 |
public void printNthFromLast(Node root, int n) {
int i = n;
if (root == null) {
return;
}
if (i > size(root)) {
System.out.println("Not enough elements");
return;
}
Node node = root;
Node nodeback = root;
while ((node.getLink() != null) && (--i > 0)) {
node = node.getLink();
}
if (n... | 6 |
public double MacroPrecision() {
if (computed == 0) countStuff();
double mprec = 0;
for (int i=0; i<catnum; i++) {
if ((tp[i] != 0) && (tp[i]+fp[i] != 0))
mprec += tp[i]/(tp[i]+fp[i]);
}
... | 4 |
protected void drawHighlightedNodes(Graphics2D g2d, DrawableNode root) {
nodeStack.clear();
nodeStack.push(root);
g2d.setColor(highlightColor);
while(!nodeStack.isEmpty()) {
DrawableNode n = nodeStack.pop();
int x = translateTreeToPixelX(n.getX());
int y = translateTreeToPixelY(n.getY());
if... | 7 |
private static void countTodoAndFixmes(File directory) throws IOException {
for (File file : directory.listFiles()) {
if (file.isDirectory()) {
countTodoAndFixmes(file);
} else {
for (String currentEnding : CONFIG.getFileEndingsToCheck()) {
... | 8 |
public AutoApagadoManager(){
// Use an appropriate Look and Feel
try {
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
UIManager.setLookAndFeel(UIManager.getCross... | 4 |
private Boolean setupEconomy()
{
if( getServer().getPluginManager().getPlugin("Vault") != null ) {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null) {
economy ... | 2 |
public boolean run() {
sendEvent(new GameEvent(this, "RunFrame"));
for (int snakeArrayPos = activeSnakeList.size() -1;snakeArrayPos >= 0; snakeArrayPos--) {
Snake snake = activeSnakeList.get(snakeArrayPos);
snake.sendEvent(new GameEvent(snake, "RunFrame"));
Vector2d s... | 8 |
public void writeNewScore()
{
FileWriter fw = null;
try {
fw = new FileWriter(file);
String str ="" + best;
fw.write(str);
fw.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
finally {
try {
if (fw != null)
fw.... | 6 |
public boolean saveToFile(String Path){
try {
FileWriter f = new FileWriter(Path);
f.write(this.toString());
f.close();
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
} | 1 |
public static String numberToString(Number number)
throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
... | 6 |
protected void calculeReveilsTerminaisons(List<Tache> taches, Simulation environnement) {
for (Tache tache : taches) {
int reveil = tache.getRi();
environnement.addEvent(new Event(reveil, KIWI_INSTRUCTIONS.START_LINE, tache));
environnement.addEvent(new Event(reveil, KIWI_INSTRUCTIONS.START, tache));
... | 4 |
public static void main(String[] args) {
MyWorkerThreadFactory factory=new MyWorkerThreadFactory();
ForkJoinPool pool=new ForkJoinPool(4, factory, null, false);
int array[]=new int[100000];
for (int i=0; i<array.length; i++){
array[i]=1;
}
MyRecursiveTask task... | 3 |
@Override
public boolean setAllOffline() {
FileWriter writer = null;
try {
BufferedReader reader = new BufferedReader(new FileReader(new File(OnlineUsers.directory+OnlineUsers.flatfileData)));
String line = "";
StringBuilder toSave = new StringBuilder();
while ((line = reader.readLine()) != null) {
... | 5 |
public String getDepartmentName() {
return departmentName;
} | 0 |
protected void setup() {
int segundo = 5;
//comportamento para solicitar ao diretório falicitador por algum motoboy disponível para entregar a pizza
addBehaviour(new TickerBehaviour(this, segundo*1000)
{
protected void onTick()
{
... | 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.