id
stringlengths
36
36
text
stringlengths
1
1.25M
cd3497d4-3f59-4c6d-bcca-3b65a74fdf0b
public void setPointsPerConversion(double pointsPerConversion) { this.pointsPerConversion = pointsPerConversion; }
042b7bf3-f3a2-48c3-9ee5-95bad449100d
public double getPointsPerReturnYard() { return pointsPerReturnYard; }
4231ff2d-ca91-4072-bae1-001216686907
public void setPointsPerReturnYard(double pointsPerReturnYard) { this.pointsPerReturnYard = pointsPerReturnYard; }
351b4324-adbf-4778-abc9-06b2a67b864e
public double getPointsPerRecievingYard() { return pointsPerRecievingYard; }
4ac522cd-2d22-43fb-a421-473bcd5924aa
public void setPointsPerRecievingYard(double pointsPerRecievingYard) { this.pointsPerRecievingYard = pointsPerRecievingYard; }
33f68ada-7fdc-4f9b-a66b-1e30b01c42ba
public double getPointsPerRecievingTouchdown() { return pointsPerRecievingTouchdown; }
c72eeb5a-55dc-4e59-9045-0594b8003456
public void setPointsPerRecievingTouchdown(double pointsPerRecievingTouchdown) { this.pointsPerRecievingTouchdown = pointsPerRecievingTouchdown; }
d01a202c-ef16-4f0b-b63a-9466e4721aad
public FantasyProsProjectionParser() { }
17290167-33cc-4d17-a4e4-e5f57186c6be
private List<String> retriveData(String projectionLink) throws IOException { List<String> playerData = new ArrayList<String>(); InputStream input = new URL(projectionLink).openStream(); try (BufferedReader br = new BufferedReader(new InputStreamReader(input, "UTF-8"))) { // skips...
ac09ae03-9cad-478f-a2b1-e0000e33a689
public List<Player> getQuarterbackList() throws ParseException, IOException { List<String> csvPlayers = retriveData(QB_PROJECTION_LINK); List<Player> players = new ArrayList<Player>(); for (String playerString : csvPlayers) { String[] split = playerString.split("\t"); i...
c50d3f7d-796a-403b-91e3-14f355f8c32d
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...
90e47ec0-8fdd-43cc-8bc2-1d98ca9c5aeb
public List<Player> getWideRecieverList() throws IOException, ParseException { List<String> csvPlayers = retriveData(WR_PROJECTION_LINK); List<Player> players = new ArrayList<Player>(); for (String playerString : csvPlayers) { String[] split = playerString.split("\t"); ...
a3dd04f0-272f-4fbe-93a5-230328514eb8
public List<Player> getTightEndList() throws IOException, ParseException { List<String> csvPlayers = retriveData(TE_PROJECTION_LINK); List<Player> players = new ArrayList<Player>(); for (String playerString : csvPlayers) { String[] split = playerString.split("\t"); if (...
02192e7e-7e7b-4a13-8e52-0713ea4028cd
public List<Player> getKickerList() throws IOException, ParseException { List<String> csvPlayers = retriveData(K_PROJECTION_LINK); List<Player> players = new ArrayList<Player>(); for (String playerString : csvPlayers) { String[] split = playerString.split("\t"); if (spl...
373b01e0-a89b-4a44-9bdd-13e078546cd1
public List<Player> getDefenseList() throws IOException { // List<String> csvPlayers = retriveData(DEF_PROJECTION_LINK); List<Player> players = new ArrayList<Player>(); return players; }
543a3770-8fed-4531-b44b-9fc57cee0927
public boolean isWriteToFile() { return writeToFile; }
fd812b3f-656d-495f-aaed-0a62fa2ffca8
public void setWriteToFile(boolean value) { writeToFile = value; }
224c777c-6f2e-4fde-b54c-9ea38a8d79c6
private double prepareDouble(String input) throws ParseException { NumberFormat format = NumberFormat.getInstance(Locale.US); Number number = format.parse(input); return number.doubleValue(); }
fbd9b08b-5733-4397-bd37-dce69501533b
public List<Player> getRoster() throws Exception { List<Player> players = new ArrayList<>(); players.addAll(getQuarterbackList()); players.addAll(getRunningbackList()); players.addAll(getWideRecieverList()); players.addAll(getTightEndList()); players.addAll(getDefenseLis...
0e2f7256-d84b-4fbe-a88e-262585f032cb
List<Player> getQuarterbackList() throws Exception;
03fb9bdc-89fc-4110-873b-740ee6e07ec8
List<Player> getRunningbackList() throws Exception;
ace1e861-d4c4-4424-bb06-6522c5249181
List<Player> getWideRecieverList() throws Exception;
3fc0ad30-6df8-454e-9e49-7038cd6ae9ef
List<Player> getTightEndList() throws Exception;
ef9bd641-167f-4872-91f0-11491263effa
List<Player> getKickerList() throws Exception;
7936cc65-375b-46cf-8319-895e680e545b
List<Player> getDefenseList() throws Exception;
80af225e-21c7-4c36-93c7-a1aaf749c6e3
List<Player> getRoster() throws Exception;
61387eb7-ebd1-4dba-b9b2-2e52b35cb657
public FormatChangeException(String message) { super(message); }
dd96a98c-9ca5-4375-b8a0-06887723c660
public static void main(String[] args) throws Exception { FantasyProsProjectionParser parser = new FantasyProsProjectionParser(); List<Player> player = parser.getRoster(); LeagueConfigurationLoader configLoader = new LeagueConfigurationLoader(); LeagueConfiguration config = configLoade...
23678e0c-b87c-44a8-9c69-010ccdf9af77
public static void main(String[] args) throws IOException, URISyntaxException, ParseException { FantasyProsProjectionParser parser = new FantasyProsProjectionParser(); List<Player> player = parser.getQuarterbackList(); System.out.println(player.get(0)); }
254869e1-607b-4151-a8de-45591ef26e53
public static void main (String[] args) { book b1, b2, b3, b4, b5; b1 = new book("From Russia With Love", "Greg Hines"); b2 = new book("Living Smart", "Rita Langill"); b3 = new book("Singing in the Rain", "Harry Connor"); b4 = new book("Good Housekeeping", "Pat Burns"); ...
f026cafd-1c7c-4eb2-9613-da3c0d94e6be
public GuessingGame() { initComponents(); machine =new GuessMachine(); }
4815ca2f-dfc4-4501-91c6-cadc2e4e076d
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); txtguess = new javax.swing.JTextField(); lblresult = new javax.swing.JLabel(); btnsubmit =...
a8adfa13-ba92-4eac-9415-91b540e4c86b
public void actionPerformed(java.awt.event.ActionEvent evt) { txtguessActionPerformed(evt); }
023aa768-8e89-450a-a362-f721d707ff50
public void actionPerformed(java.awt.event.ActionEvent evt) { btnsubmitActionPerformed(evt); }
6845b43f-24f7-41a6-aeec-b9387bd499d4
private void txtguessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtguessActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtguessActionPerformed
838b60e5-1231-4d59-9bae-ab845f37eba5
private void btnsubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsubmitActionPerformed guess = Integer.parseInt(txtguess.getText()); if (machine.setGuess(guess)) { lblresult.setText(machine.giveHint()); lblattempts.setText("" + machine.g...
03218952-ace5-4f0a-a6e6-1912fbaeb678
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...
0ae73848-2003-4009-bf95-f5034fce9787
public void run() { new GuessingGame().setVisible(true); }
0fd13aa4-406b-401c-b3b5-5db460810b7e
public static void main(String[] args) { KeyboardReader k=new KeyboardReader(); Employee emp; String name; int type; double rate; int hours; String prompt; emp=new Employee(); while (true){ System.out.println("Enter employee data"); name=k.readLine(" Name (or <enter> to quit): "); if...
9a1f9688-8c18-4409-857f-19e258d51ab1
public Employee() { name=""; type=0; rate=0; hours=0; }
2529a3d7-c575-4de8-a1e1-fa21a2985270
public String getTypeRules() { return "1 or 2"; }
1ce3db75-e03b-43eb-aa81-c07b6d3f2e91
public String getNameRules() { return "nonblank"; }
26c17d57-25ad-4e77-ae1e-5c57d67a81c6
public String getRateRules() { return "between 6.75 and 30.50, inclusive"; }
f7b47848-7bed-4361-baff-c77991f4ac3b
public String getHourRules() { return "between 1 and 60, inclusive"; }
b803eb63-413a-4c2d-aa0f-56e27b0ba5ec
public boolean setName(String nm) { boolean blank=(nm.equals("")); if(blank) { return false; } else { name=nm; return true; } }
305f7a0d-fbd7-4ea1-8f12-ce7f606a3439
public boolean setType(int tp) { boolean oneortwo=(tp==1||tp==2); if(oneortwo) { type=tp; return true; } else { return false; } }
52ce8659-3814-47b6-bad9-697236747e19
public boolean setRate(double rt) { boolean rateok=(rt>=6.75&& rt<=30.50); if(rateok) { rate=rt; return true; } else { return false; } }
372a3dda-c9b3-4d7a-9b35-f2461c2bd77a
public boolean setHours(int hrs) { boolean hoursok=(hrs>=1&&hrs<=60); if(hoursok) { hours=hrs; return true; } else return false; }
fd869db4-82fe-4253-8eb3-1391c66a9c21
public String getName() { return name; }
b84ce9e2-45a1-4efb-9449-56c7f068f61c
public double getPay() { double pay; boolean noovertime=(hours<=40||type==2); if(noovertime) { pay=rate*hours; } else pay=(hours-40)*(rate*2)+rate*40; return pay; }
9011bd51-000a-4cb6-bc11-ca0dce832e94
public book(String a,String b) { Name = a; author = b; }
a83beb92-828a-4e57-9df6-57b6505eb949
public String getTitle() { return Name; }
419bf84d-111e-4c36-b382-2b2e6d805b32
public void setup(){ setSize(400,400); background(255); f = new Face(this,200,200); button1 = new GButton(this,22,20,80,30); button1.setText("Move the Face"); button2 = new GButton(this,119,20,80,30); button2.setText("Resize the Face"); button3 = new GButt...
914da488-7c2e-44fd-8517-bcf103c17b6a
public void handleButtonEvents(GButton button, GEvent event){ if(button==button1){ while(true){ //ask for new x-y location x = Float.parseFloat(JOptionPane.showInputDialog(this, "Enter new x:")); y = Float.parseFloat(JOptionPane.showInputDialog(this, "Enter new y:...
f03fbdbc-6dec-4cfd-8f7d-6088ca283b63
public void draw() { f.draw(); }
75241f7b-b5d6-4999-98bf-ae621598555a
public Face(PApplet p, float x, float y) { xPosition = x; yPosition = y; radius = 100; color = Color.red; pen=p; int mood = 0; }
3eee5418-eee4-4d29-a39a-8b25ad075b34
public void draw() { pen.stroke(0); pen.fill(color.getRed(), color.getGreen(), color.getBlue()); drawCircle (xPosition,yPosition,radius,radius);//head //yellow eyes pen.fill(255,255,0); drawCircle(xPosition-radius/5, yPosition-radius/5, radius/4, radius/4); drawCircle(xPosition+radius/...
f354ccdb-c9e6-4535-943e-06e7ec27c0b9
private void drawCircle(float x, float y, float r, float ht) { }
2ddacc3d-7b9c-4887-9f71-b4d4a0a8003b
private void drawLine(double x1, double y1, double x2, double y2) { pen.line((float)x1,(float)y1,(float)x2,(float)y2); }
a720dc03-4b42-4a7c-9d35-9205e9aa0b22
public void erase() { pen.fill(255); pen.noStroke(); pen.ellipse(xPosition, yPosition, radius+5, radius+5); }
430b4f20-12db-4b94-9f21-733bdf7a3c61
public void move(float x, float y) { xPosition = x;yPosition=y; }
5de6c669-818c-4b48-a0e0-443c9e5a3c2e
public void changeSize(float changedSize) { radius = changedSize; }
475c6f2f-27a8-4305-81e9-a71aa20e4845
public void setThecolour(Color changedColour) { color = changedColour; }
5bd1a736-57db-4513-852e-23ac83fe50a3
public void setThemood (float changedMood) { float mood = changedMood; }
ca7adc0a-0a92-4860-af40-3793b0dce171
public patron(String N) { Name = N; b1=null; b2=null; b3=null; }
ec697c85-fa00-48e1-9f38-f4e71376ca2b
public boolean inStock (book b) { if (b1 == b) { return true; } else if (b2 ==b) { return true; } else if (b3 == b) { return true; } else ...
a602fddd-c6f4-437a-85a6-6048cad5f75f
public boolean lend (book b) { //make sure that the book can be borrowed boolean canbeborrowed = (b1 == null || b2 == null ||b3 ==null); if (canbeborrowed) { if (b1==null) { b1=b;...
cac033d2-058b-4db0-86d0-bfb226545122
public String BookName() { return Name; }
cb210bf7-1c86-484b-bff6-010fd9e277d7
public boolean Return (book b) { if (inStock(b)) { if (b1 == b) { b1 =null; } else if (b2 == b) { b2 = null; ...
1d1dfeba-718e-4db3-bcf3-be263c24c245
public GuessMachine(){ number =(int)(Math.random()*100)+1; guess=0; numguesses = 0; //to do - add methods //givehints(), setGuess(), getNumGuesses() }
de794e61-4b90-4c77-8623-ff272a418e93
public boolean setGuess(int guesses) { if (guesses>=1&&guesses<=100) { numguesses++; guess=guesses; return true; } else return false; }
851afdf3-2fcc-46f1-8867-64a465bdb4c1
public String giveHint() { if (guess>number ) { return "too high"; } else if (guess<number ) { return "too low "; } else return " you guessed correctly!"; }
5d679169-43d3-4a03-8d3a-ba6f1335a335
public int getNumGuesses() { return numguesses; }
8e05b5a7-09df-4fae-beeb-74027b0530c6
public Job(double priority, double complexity){ this.setId(tempId); this.setPriority(priority); this.setComplexity(complexity); this.setTimestamp(new Date().getTime()); tempId++; }
f40b607c-8528-460e-a1d2-07b39953e86b
public long getTimestamp() { return timestamp; }
4611d8ca-4a12-484c-a679-127bd4a5701b
public void setTimestamp(long date) { this.timestamp = date; }
3f34935c-3031-4b66-a74f-ccc39cf25fb6
public double getComplexity() { return complexity; }
8bfa904b-71a7-4f32-bda7-15d38ebae09f
public void setComplexity(double complexity) { this.complexity = complexity; }
09b3e579-9e96-4edd-9fdd-d1fbfaf321b3
public double getPriority() { return priority; }
559c46f2-d3b7-4274-be3b-7dd15a581382
public void setPriority(double priority) { this.priority = priority; }
12eccfe7-26e5-4939-8a2b-dd1ecbeeecd1
public int getId() { return id; }
58bb7a0e-33a5-4307-b4f8-d42024733441
public void setId(int id) { this.id = id; }
7e561259-df75-4079-873c-af0bcf935ff1
public String toString(){ String tempString = ""; tempString += "\n\n***JOB OBJECT***"; tempString += "\nID: "+this.getId(); tempString += "\nTime: "+this.getTimestamp(); tempString += "\nComplexity: "+this.getComplexity(); tempString += "\nPriority: "+this.getPriority(); return tempString; }
59c5a766-e842-46a4-922e-5d38aa3d6d08
public Map<String, ArrayList> getCurrentThermalMap() { return currentThermalMap; }
001d627a-d9ac-4c52-b989-17447af3a24c
public void setCurrentThermalMap(Map<String, ArrayList> currentThermalMap) { this.currentThermalMap = currentThermalMap; }
e5c26a18-5b7d-4f12-be45-18b0065b7628
public ArrayList<CPU>getCurrentSchedule() { return currentSchedule; }
c875e6f1-a46b-4ed8-926e-f9291b150218
public void setCurrentSchedule(ArrayList<CPU> currentSchedule){ this.currentSchedule = currentSchedule; }
a640d036-6767-4f0a-a011-52f2711b85b1
public int getCurrentPowerCracTemp() { return currentPowerCracTemp; }
24299122-93b5-4544-89ee-c297553523ba
public void setCurrentPowerCracTemp(int currentPowerCracTemp) { this.currentPowerCracTemp = currentPowerCracTemp; }
95460257-8516-4856-bdfb-efac0c3e0abc
public int getRequiredCracTemp() { return requiredCracTemp; }
5eef75d4-3832-426e-9581-5ba1190f0f6c
public void setRequiredCracTemp(int requiredCracTemp) { this.requiredCracTemp = requiredCracTemp; }
7bdd48d2-900b-4112-8d7e-12ac52238144
public DataControl(){}
0f61e360-af9f-4cde-98cf-f0f31f1ae74e
public ArrayList<Job> getJobQueue() { return jobQueue; }
9c21b465-08ac-4b3d-b0fc-c7f31f5389ac
public void setJobQueue(ArrayList<Job> jobQueue) { this.jobQueue = jobQueue; }
2e214e1a-5187-4666-aa9a-b51d23f03d41
public Batch getBatch() { return batch; }
0582a88f-84ad-4673-83e4-aaed2d2a227b
public void setBatch(Batch batch) { this.batch = batch; }
ff3d4d36-5eb4-478f-9df3-ceab7c5f8f5e
public Server getServer() { return server; }
e4bf8f57-7095-4238-b4f1-424d0bbf1c6d
public void setServer(Server server) { this.server = server; }
7a41b5eb-e371-4136-a5a9-00007cb8f7f5
public void receiveJobs(String path){ JSONParser parser = new JSONParser(); try { JSONArray a = (JSONArray) parser.parse(new FileReader("file/"+path+".json")); for (Object o : a){ JSONObject job = (JSONObject) o; double complexity = Double.parseDouble((String)job.get("complexity")); double p...
2393352b-3203-4c17-b29b-5c94d6e62e1d
public void addToBatch(int batchsize){ ArrayList<Job> tempList = new ArrayList<Job>(); for (int i=0; i<batchsize; i++){ tempList.add(this.getJobQueue().get(i)); this.getJobQueue().remove(i); } batch.getJobs().addAll(tempList); tempList=null; }