allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotationShapeShapeStreamTetris5044
allclasses-noframe.htmlAll ClassesAIBoardPlacementRandomModeRotationShapeShapeStreamTetris5044
constant-values.html
JavaScript is disabled on your browser.
Skip navigation linksPackageClassDeprecatedIndexHelpPrevNextFramesNo FramesAll ClassesConstant Field Values
Contentsedu.vt.*
edu.vt.*
edu.vt.cs5044.tetris.BoardModifier and TypeConstant FieldValuepublic static final intHEIGHT24public static final intHEIGHT_LIMIT20public static final intWIDTH10Skip navigation linksPackageClassDeprecatedIndexHelpPrevNextFramesNo FramesAll Classes
deprecated-list.html
JavaScript is disabled on your browser.
Skip navigation linksPackageClassDeprecatedIndexHelpPrevNextFramesNo FramesAll ClassesDeprecated API
ContentsSkip navigation linksPackageClassDeprecatedIndexHelpPrevNextFramesNo FramesAll Classes
edu/vt/cs5044/tetris/Tetris5044.html
JavaScript is disabled on your browser.
Skip navigation linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFramesNo FramesAll ClassesSummary: Nested | Field | Constr | MethodDetail: Field | Constr | Method
edu.vt.cs5044.tetris
Class Tetris5044ObjectApplicationTetris5044public class Tetris5044
extends Application
The main application class; for internal use only.
Version:1.0Nested Class SummaryNested classes/interfaces inherited from class Application
Application.ParametersField SummaryFields inherited from class Application
STYLESHEET_CASPIAN, STYLESHEET_MODENAConstructor Summary
Constructors Constructor and DescriptionTetris5044() Method Summary
All Methods Static MethodsInstance MethodsConcrete MethodsModifier and TypeMethod and Descriptionstatic voidmain(String[] args)
For internal use only.
voidstart(Stage primaryStage)
For internal use only.
Methods inherited from class Application
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitConstructor DetailTetris5044public Tetris5044()Method Detailstartpublic void start(Stage primaryStage)
throws Exception
For internal use only.
Specified by:start in class ApplicationParameters:primaryStage - for internal use only.Throws:Exception - for internal use only.mainpublic static void main(String[] args)
For internal use only.
Parameters:args - ignored.Skip navigation linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFramesNo FramesAll ClassesSummary: Nested | Field | Constr | MethodDetail: Field | Constr | Method
edu/vt/cs5044/tetris/RandomMode.html
JavaScript is disabled on your browser.
Skip navigation linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFramesNo FramesAll ClassesSummary: Nested | Enum Constants | Field | MethodDetail: Enum Constants | Field | Method
edu.vt.cs5044.tetris
Enum RandomMode.
Question 1 1 pts Skip to question text.As part of a bank account.docxamrit47
Question 1 1 pts Skip to question text.
As part of a bank account implementation, there is an account class and a checking account class. These two classes should be related by:
polymorphism
abstract classes
both composition and inheritance
inheritance
composition
Flag this Question
Question 2 1 pts
When using OOP, which of the following terms refers to a mechanism for a behavior, basically how it’s implemented?
composition
inheritance
polymorphism
dynamic binding
Flag this Question
Question 3 1 pts
To access an element in an Array object,
Use the ArrayList's get() method.
Use the ArrayList's element() method.
Individual elements in an ArrayList can’t be accessed without doing a sequential query getSequential(), returning every element up to and including the element requested.
Use square brackets around an index value.
Flag this Question
Question 4 1 pts
To access an element in an ArrayList object,
Use square brackets around an index value.
Use the ArrayList element() method.
Use the ArrayList get() method.
Individual elements in an ArrayList can’t be accessed without doing a sequential query getSequential(), returning every element up to and including the element requested.
Flag this Question
Question 5 1 pts
What term below is defined as a message that tells the program that something has happened?
an interaction
a listener
an action
an event
Flag this Question
Question 6 1 pts
Which item below is defined as an object?
A String
An Array
All of the above
An ArrayList
Flag this Question
Question 7 1 pts
When a text-box-enter event occurs, which method and parameter are required to handle this type of action? (1 point)
actionEvent with an actionperformed parameter
actionListener with an interfaceID parameter
windowListener with an eventID parameter
actionPerformed with an actionEvent parameter
Flag this Question
Question 8 1 pts
Which class includes the setTitle and setSize methods?
JFrame
JWindow
JBox
JOptionpane
Flag this Question
Question 9 1 pts
Before utilizing the binary search method, __________ must be done to the array?
indexing
splitting
sorting
importing
Flag this Question
Question 10 1 pts
Which layout manager implements a one-compartment layout scheme?
GridlessLayout
GridBagLayout
GridLayout
FlowLayout
BorderLayout
Flag this Question
Question 11 1 pts
What is the default layout manager for a JFrame window?
GridBagLayout
GridLayout
FlowLayout
GridlessLayout
BorderLayout
Flag this Question
Question 12 1 pts
To call the superclass constructor, super() must be the first line in a constructor.
True
False
Flag this Question
Question 13 1 pts
Method overriding is when a method has the same name, same sequence of parameter types, and the same return type as a method in a superclass.
True
False
Flag this Question
Question 14 1 pts
Type casting, also known as promotion is ...
Groovy's AST Transformation is a compile time meta-programming technique and allows developer to hook into compilation process and add new fields or methods, or modify existing methods.
Question 1 1 pts Skip to question text.As part of a bank account.docxamrit47
Question 1 1 pts Skip to question text.
As part of a bank account implementation, there is an account class and a checking account class. These two classes should be related by:
polymorphism
abstract classes
both composition and inheritance
inheritance
composition
Flag this Question
Question 2 1 pts
When using OOP, which of the following terms refers to a mechanism for a behavior, basically how it’s implemented?
composition
inheritance
polymorphism
dynamic binding
Flag this Question
Question 3 1 pts
To access an element in an Array object,
Use the ArrayList's get() method.
Use the ArrayList's element() method.
Individual elements in an ArrayList can’t be accessed without doing a sequential query getSequential(), returning every element up to and including the element requested.
Use square brackets around an index value.
Flag this Question
Question 4 1 pts
To access an element in an ArrayList object,
Use square brackets around an index value.
Use the ArrayList element() method.
Use the ArrayList get() method.
Individual elements in an ArrayList can’t be accessed without doing a sequential query getSequential(), returning every element up to and including the element requested.
Flag this Question
Question 5 1 pts
What term below is defined as a message that tells the program that something has happened?
an interaction
a listener
an action
an event
Flag this Question
Question 6 1 pts
Which item below is defined as an object?
A String
An Array
All of the above
An ArrayList
Flag this Question
Question 7 1 pts
When a text-box-enter event occurs, which method and parameter are required to handle this type of action? (1 point)
actionEvent with an actionperformed parameter
actionListener with an interfaceID parameter
windowListener with an eventID parameter
actionPerformed with an actionEvent parameter
Flag this Question
Question 8 1 pts
Which class includes the setTitle and setSize methods?
JFrame
JWindow
JBox
JOptionpane
Flag this Question
Question 9 1 pts
Before utilizing the binary search method, __________ must be done to the array?
indexing
splitting
sorting
importing
Flag this Question
Question 10 1 pts
Which layout manager implements a one-compartment layout scheme?
GridlessLayout
GridBagLayout
GridLayout
FlowLayout
BorderLayout
Flag this Question
Question 11 1 pts
What is the default layout manager for a JFrame window?
GridBagLayout
GridLayout
FlowLayout
GridlessLayout
BorderLayout
Flag this Question
Question 12 1 pts
To call the superclass constructor, super() must be the first line in a constructor.
True
False
Flag this Question
Question 13 1 pts
Method overriding is when a method has the same name, same sequence of parameter types, and the same return type as a method in a superclass.
True
False
Flag this Question
Question 14 1 pts
Type casting, also known as promotion is ...
Groovy's AST Transformation is a compile time meta-programming technique and allows developer to hook into compilation process and add new fields or methods, or modify existing methods.
Need help coding MorseCode in JavaCreate Class MorseCodeClient. T.pdffastechsrv
Need help coding MorseCode in Java:
Create Class MorseCodeClient. This represents a Client that allows a user communicate with a
server across a network. The server saves the message and then relays the message to another
client This is a JFrame application and should extend JFrame and Implement Runnable. The
client application should allow the user to type English-language phrases in a JTextArea. When
the user sends the message, the client application encodes the text into Morse code and sends the
coded message through the server to the other client. Create class MorseCodeClientTest, this is a
test class for morse code client and uses the main method to created new instance of
MorseCodeClient.
Solution
package MorseCode;
import java.util.ArrayList;
public class MorseCodeConverter extends javax.swing.JFrame {
/**
* Creates new form MorseCodeConverter
*/
public MorseCodeConverter() {
initComponents();
}
@SuppressWarnings(\"unchecked\")
// //GEN-BEGIN:initComponents
private void initComponents() {
mainWindowContainer = new javax.swing.JPanel();
userSentence = new javax.swing.JTextField();
inputLabel = new javax.swing.JLabel();
outputLabel = new javax.swing.JLabel();
inputConfirmButton = new javax.swing.JButton();
outputField = new javax.swing.JTextField();
title = new javax.swing.JLabel();
javax.swing.GroupLayout mainWindowContainerLayout = new
javax.swing.GroupLayout(mainWindowContainer);
mainWindowContainer.setLayout(mainWindowContainerLayout);
mainWindowContainerLayout.setHorizontalGroup(
mainWindowContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGap(0, 100, Short.MAX_VALUE)
);
mainWindowContainerLayout.setVerticalGroup(
mainWindowContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGap(0, 100, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(204, 204, 255));
userSentence.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
userSentenceActionPerformed(evt);
}
});
inputLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
inputLabel.setText(\"Enter your sentence here\");
outputLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
outputLabel.setText(\"This is your sentence in Morse Code\");
outputLabel.setToolTipText(\"\");
inputConfirmButton.setText(\"OK\");
inputConfirmButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
inputConfirmButtonActionPerformed(evt);
}
});
outputField.setFont(new java.awt.Font(\"Tahoma\", 0, 16)); // NOI18N
title.setFont(new java.awt.Font(\"Simplified Arabic\", 0, 18)); // NOI18N
title.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
title.setText(\"Morse Code Converter\");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGrou.
Leveraging Scala Macros for Better ValidationTomer Gabel
A talk given at Scalapeño 2014 and JavaOne 2014 (video links to follow).
Data validation is a common enough problem that numerous attempts have been made to solve it elegantly. The de-facto solution in Java (JSR 303) has a number of shortcomings and fails to leverage the powerful Scala type system. The release of Scala 2.10.x introduced a couple of experimental metaprogramming features, namely reflection and macros. In this talk I'll introduce macros by way of a practical example: implementing a full-blown data validation engine, utilizing def macros and a Scala DSL to enable elegant validator definition syntax and call-site.
Below is the assignment description and the file I have written..pdfinfo673628
Below is the assignment description and the file I have written. I would love to test this file to
make sure that everything is satisfied (vector with all modes in ascending order). I\'m having a
really hard time constructing a main method to test it. Help!!
-------------------------------------------------------
The mode is the value that appears most often in a set of data. Write a function named findMode
that takes as parameters an array of int and the size of the array, and returns a vector containing
the mode(s). If there is just a single most frequent value, the vector will only contain that one
value, but if multiple values tie for maximum frequency, the vector will need to contain all such
values. This includes the case where every number in the array appears only once. Each mode
should appear only once in the vector. The values in the vector that is returned must be in
ascending order. If you need to sort a vector, it\'s similar to sorting an array, but specifying the
beginning and end of the vector look a little bit different. If your vector is named result, then it
would look like this: \"std::sort(result.begin(), result.end());\".
-------------------------------------------------------
#include // needed for the sort() function
#include // needed to use the vector type
#include // needed for the main function
using std::vector;
using std::sort;
vector findMode(int array[], int size)
{
int maxFreq = 1; // initalizing the largest frequency to be 1
vector result; // results is an empty vector
//Initializing the loop through the integer array
for (int i = 0; i < size; i++)
{
int count = 1; //started the counter at 1
//started the the loop after the 1st entry, looking for matches with the value at index i.
for (int j = i + 1; j < size; j++)
{
//if an entry matches another, then add one to the counter
if (array[i] == array[j])
{
count++;
}
}
//when the counter is equal to the max frequency, the integer is added to the result vector.
if (count == maxFreq)
{
result.push_back(array[i]);
}
//when the counter for i is greater than the max frequency, updates the maxFreq, clear the values
stored in the result vector, and push the value to the empty vector.
if (count > maxFreq)
{
maxFreq = count;
result.clear();
result.push_back(array[i]);
}
}
//sort the modes in ascending order
sort(result.begin(), result.end());
return result;
Below is the assignment description and the file I have written. I would love to test this file to
make sure that everything is satisfied (vector with all modes in ascending order). I\'m having a
really hard time constructing a main method to test it. Help!!
-------------------------------------------------------
The mode is the value that appears most often in a set of data. Write a function named findMode
that takes as parameters an array of int and the size of the array, and returns a vector containing
the mode(s). If there is just a single most frequent value, the vector will only contain that one
value, but if mult.
Allison Rogers
Professor Koenig
COMM 3313
October 12th, 2018
How My Race Has Impacted My Life
I. Introduction
a. How being white has affected my life in many ways
i. Positive factors from experience
ii. Negative factors from experience
iii. How this has impacted my communication
iv. Are my communication skills stronger or weaker from these experiences?
II. Positive factors from experience
a. Job market is more available to me
a. Opportunities come in simpler form to me
III. Negative factors from experience
a. Assumptions of me being white thinking my life is a breeze from others
b. The unfairness I see every day makes me feel guilty for being white
IV. How this has impacted my very own communication
a. I see things from a general point of view
b. I try my best to be personal when communicating.
c. I remember that we are all human beings who deserve equality.
V. Are my communication skills stronger or weaker?
a. Stronger – My experiences growing up have helped me communicate with everyone equally.
VI. Conclusion
a. The boundaries my race sets me in
b. The opportunities I have because of my race.
Works Cited
Orbe, M. P., & Harris, T. M. (2015). Interracial communication theory into practice. Los Angeles, CA: Sage.
https://www.psychologytoday.com/us/blog/listen/201803/being-white-in-age-color
https://www.tolerance.org/magazine/fall-2018/what-is-white-privilege-really
https://money.cnn.com/2016/04/13/media/whiteness-project/index.html
https://everydayfeminism.com/2015/11/lessons-white-privilege-poc/
https://www.bustle.com/articles/146867-how-white-privilege-affects-8-people-of-color-on-a-day-to-day-basis
Allison Rogers
Professor Koenig
COMM 3325
October 20th, 2018
Research Paper Conceptual Document:
“The Meaning of July Fourth for the Negro” by Frederick Douglas
1. What is the event or rhetorical moment I will be analyzing and why. Give a brief summary.
· I will be analyzing a speech by Fredrick Douglas that he gave on July 5th in 1852 called, “The Meaning of July Fourth for the Negro”. I chose this speech because I first read this speech this past spring semester in my gender studies class and it was so well written and worded that it literally just brought me to tears with so much emotion behind it. I want to analyze how Douglas put this together and his rhetorical process that he used in order to touch so many people with his words.
2. What methods of evaluation will I be looking for?
· The methods of evaluation I will be looking for in this speech are the following:
(I) The speech objective
(II) The audience and context of the speech
(III) The speeches context and structure
(IV) The delivery skills and techniques he used
(V) Intangibles
3. 8 sources:
· https://www.artofmanliness.com/the-meaning-of-july-fourth-for-the-negro-by-frederick-douglas/
· http://masshumanities.org/files/programs/douglass/speech_abridged_med.pdf
· http://redandgreen.org/speech.htm
· https://www.pbs.org/wgbh/aia/part4/4h2927.html
· https://liber.
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docxsimonlbentley59018
Allen 1
Kiah Allen
Professor Hirsch
ENG101
8 Feb. 2018
Deforestation
The Amazon forest alone creates 20% of the worlds oxygen. It has decreased by 17% in the past 50 years because of deforestation (conserve-energy-future.com). Forest’s in general only cover 30% of the world (conserve-energy-future.com ). Deforestation is killing the trees that produce oxygen, without it humans can’t survive. Deforestation should be prohibited because large plants such as trees recycle air.
If deforestation is such a problem, why does it happen? Deforestation extracts the forest of its resources. It turns the forests into farms, ranches, or urban areas. The wood from trees are used for building or could be sold as fuel. Another big cause of deforestation is quarry’s. Quarry’s take up a lot of land, and once the quarry is abandoned is almost impossible to fix. Hydropower requires dams to be built. Dams create an enormous amount of flooding, which kills thousands of trees. The increase of population is also a cause of deforestation. The more people that are on earth the more land and resources we demand.
If deforestation continues it will have a huge negative impact on our air supply. Everyday a piece of the forests is being destroyed. The more trees that are being destroyed the less oxygen can be produced. Trees use photosynthesis to covert carbon dioxide into oxygen. Photosynthesis is the main producer of oxygen, and respiration and decay remove it. Urban areas have less oxygen then rural areas, because they don’t have many plants. Throughout history oxygen levels have been steadily decreasing. Once the oxygen levels hit 7% the air is too low to support human life (thenaturalhealthplace.com). Finding ways to apply reforestation would help increase oxygen.
There are many ways to apply reforestation to reverse the harm that’s been don’t to the world. One way is to plant trees. There are some cities who have made vertical forests. They plant trees and plants that surround the building. Going paperless would help as well. Since technology has advanced, paper isn’t really needed as often. Recycling and buying recycled products will help as well. The more that people recycle there will be less demand for natural resources and trees. Reforestation will help to reduce the concentration of carbon dioxide in the air.
Deforestation does have a huge negative impact on our world, but there are quite of bit of positive too. The positive effects of deforestation are that it does gives humans space to grow. With growth comes civilizations which means more jobs and revenue. Deforestations also gives us more food and resources to satisfy our needs. It means a more comfortable life for humans. The consequences of deforestation is not worth the temporary comfort that humans get from it.
Deforestation is a serious problem to maintain life on this planet. The decrease in oxygen could eventually mean the end to human kind. If we don’t do anything abo.
More Related Content
Similar to allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docx
Need help coding MorseCode in JavaCreate Class MorseCodeClient. T.pdffastechsrv
Need help coding MorseCode in Java:
Create Class MorseCodeClient. This represents a Client that allows a user communicate with a
server across a network. The server saves the message and then relays the message to another
client This is a JFrame application and should extend JFrame and Implement Runnable. The
client application should allow the user to type English-language phrases in a JTextArea. When
the user sends the message, the client application encodes the text into Morse code and sends the
coded message through the server to the other client. Create class MorseCodeClientTest, this is a
test class for morse code client and uses the main method to created new instance of
MorseCodeClient.
Solution
package MorseCode;
import java.util.ArrayList;
public class MorseCodeConverter extends javax.swing.JFrame {
/**
* Creates new form MorseCodeConverter
*/
public MorseCodeConverter() {
initComponents();
}
@SuppressWarnings(\"unchecked\")
// //GEN-BEGIN:initComponents
private void initComponents() {
mainWindowContainer = new javax.swing.JPanel();
userSentence = new javax.swing.JTextField();
inputLabel = new javax.swing.JLabel();
outputLabel = new javax.swing.JLabel();
inputConfirmButton = new javax.swing.JButton();
outputField = new javax.swing.JTextField();
title = new javax.swing.JLabel();
javax.swing.GroupLayout mainWindowContainerLayout = new
javax.swing.GroupLayout(mainWindowContainer);
mainWindowContainer.setLayout(mainWindowContainerLayout);
mainWindowContainerLayout.setHorizontalGroup(
mainWindowContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGap(0, 100, Short.MAX_VALUE)
);
mainWindowContainerLayout.setVerticalGroup(
mainWindowContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGap(0, 100, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(204, 204, 255));
userSentence.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
userSentenceActionPerformed(evt);
}
});
inputLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
inputLabel.setText(\"Enter your sentence here\");
outputLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
outputLabel.setText(\"This is your sentence in Morse Code\");
outputLabel.setToolTipText(\"\");
inputConfirmButton.setText(\"OK\");
inputConfirmButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
inputConfirmButtonActionPerformed(evt);
}
});
outputField.setFont(new java.awt.Font(\"Tahoma\", 0, 16)); // NOI18N
title.setFont(new java.awt.Font(\"Simplified Arabic\", 0, 18)); // NOI18N
title.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
title.setText(\"Morse Code Converter\");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGrou.
Leveraging Scala Macros for Better ValidationTomer Gabel
A talk given at Scalapeño 2014 and JavaOne 2014 (video links to follow).
Data validation is a common enough problem that numerous attempts have been made to solve it elegantly. The de-facto solution in Java (JSR 303) has a number of shortcomings and fails to leverage the powerful Scala type system. The release of Scala 2.10.x introduced a couple of experimental metaprogramming features, namely reflection and macros. In this talk I'll introduce macros by way of a practical example: implementing a full-blown data validation engine, utilizing def macros and a Scala DSL to enable elegant validator definition syntax and call-site.
Below is the assignment description and the file I have written..pdfinfo673628
Below is the assignment description and the file I have written. I would love to test this file to
make sure that everything is satisfied (vector with all modes in ascending order). I\'m having a
really hard time constructing a main method to test it. Help!!
-------------------------------------------------------
The mode is the value that appears most often in a set of data. Write a function named findMode
that takes as parameters an array of int and the size of the array, and returns a vector containing
the mode(s). If there is just a single most frequent value, the vector will only contain that one
value, but if multiple values tie for maximum frequency, the vector will need to contain all such
values. This includes the case where every number in the array appears only once. Each mode
should appear only once in the vector. The values in the vector that is returned must be in
ascending order. If you need to sort a vector, it\'s similar to sorting an array, but specifying the
beginning and end of the vector look a little bit different. If your vector is named result, then it
would look like this: \"std::sort(result.begin(), result.end());\".
-------------------------------------------------------
#include // needed for the sort() function
#include // needed to use the vector type
#include // needed for the main function
using std::vector;
using std::sort;
vector findMode(int array[], int size)
{
int maxFreq = 1; // initalizing the largest frequency to be 1
vector result; // results is an empty vector
//Initializing the loop through the integer array
for (int i = 0; i < size; i++)
{
int count = 1; //started the counter at 1
//started the the loop after the 1st entry, looking for matches with the value at index i.
for (int j = i + 1; j < size; j++)
{
//if an entry matches another, then add one to the counter
if (array[i] == array[j])
{
count++;
}
}
//when the counter is equal to the max frequency, the integer is added to the result vector.
if (count == maxFreq)
{
result.push_back(array[i]);
}
//when the counter for i is greater than the max frequency, updates the maxFreq, clear the values
stored in the result vector, and push the value to the empty vector.
if (count > maxFreq)
{
maxFreq = count;
result.clear();
result.push_back(array[i]);
}
}
//sort the modes in ascending order
sort(result.begin(), result.end());
return result;
Below is the assignment description and the file I have written. I would love to test this file to
make sure that everything is satisfied (vector with all modes in ascending order). I\'m having a
really hard time constructing a main method to test it. Help!!
-------------------------------------------------------
The mode is the value that appears most often in a set of data. Write a function named findMode
that takes as parameters an array of int and the size of the array, and returns a vector containing
the mode(s). If there is just a single most frequent value, the vector will only contain that one
value, but if mult.
Similar to allclasses-frame.htmlAll ClassesAIBoardPlacementRandomModeRotati.docx (20)
Allison Rogers
Professor Koenig
COMM 3313
October 12th, 2018
How My Race Has Impacted My Life
I. Introduction
a. How being white has affected my life in many ways
i. Positive factors from experience
ii. Negative factors from experience
iii. How this has impacted my communication
iv. Are my communication skills stronger or weaker from these experiences?
II. Positive factors from experience
a. Job market is more available to me
a. Opportunities come in simpler form to me
III. Negative factors from experience
a. Assumptions of me being white thinking my life is a breeze from others
b. The unfairness I see every day makes me feel guilty for being white
IV. How this has impacted my very own communication
a. I see things from a general point of view
b. I try my best to be personal when communicating.
c. I remember that we are all human beings who deserve equality.
V. Are my communication skills stronger or weaker?
a. Stronger – My experiences growing up have helped me communicate with everyone equally.
VI. Conclusion
a. The boundaries my race sets me in
b. The opportunities I have because of my race.
Works Cited
Orbe, M. P., & Harris, T. M. (2015). Interracial communication theory into practice. Los Angeles, CA: Sage.
https://www.psychologytoday.com/us/blog/listen/201803/being-white-in-age-color
https://www.tolerance.org/magazine/fall-2018/what-is-white-privilege-really
https://money.cnn.com/2016/04/13/media/whiteness-project/index.html
https://everydayfeminism.com/2015/11/lessons-white-privilege-poc/
https://www.bustle.com/articles/146867-how-white-privilege-affects-8-people-of-color-on-a-day-to-day-basis
Allison Rogers
Professor Koenig
COMM 3325
October 20th, 2018
Research Paper Conceptual Document:
“The Meaning of July Fourth for the Negro” by Frederick Douglas
1. What is the event or rhetorical moment I will be analyzing and why. Give a brief summary.
· I will be analyzing a speech by Fredrick Douglas that he gave on July 5th in 1852 called, “The Meaning of July Fourth for the Negro”. I chose this speech because I first read this speech this past spring semester in my gender studies class and it was so well written and worded that it literally just brought me to tears with so much emotion behind it. I want to analyze how Douglas put this together and his rhetorical process that he used in order to touch so many people with his words.
2. What methods of evaluation will I be looking for?
· The methods of evaluation I will be looking for in this speech are the following:
(I) The speech objective
(II) The audience and context of the speech
(III) The speeches context and structure
(IV) The delivery skills and techniques he used
(V) Intangibles
3. 8 sources:
· https://www.artofmanliness.com/the-meaning-of-july-fourth-for-the-negro-by-frederick-douglas/
· http://masshumanities.org/files/programs/douglass/speech_abridged_med.pdf
· http://redandgreen.org/speech.htm
· https://www.pbs.org/wgbh/aia/part4/4h2927.html
· https://liber.
Allen 1Kiah AllenProfessor HirschENG1018 Feb. 2018Defo.docxsimonlbentley59018
Allen 1
Kiah Allen
Professor Hirsch
ENG101
8 Feb. 2018
Deforestation
The Amazon forest alone creates 20% of the worlds oxygen. It has decreased by 17% in the past 50 years because of deforestation (conserve-energy-future.com). Forest’s in general only cover 30% of the world (conserve-energy-future.com ). Deforestation is killing the trees that produce oxygen, without it humans can’t survive. Deforestation should be prohibited because large plants such as trees recycle air.
If deforestation is such a problem, why does it happen? Deforestation extracts the forest of its resources. It turns the forests into farms, ranches, or urban areas. The wood from trees are used for building or could be sold as fuel. Another big cause of deforestation is quarry’s. Quarry’s take up a lot of land, and once the quarry is abandoned is almost impossible to fix. Hydropower requires dams to be built. Dams create an enormous amount of flooding, which kills thousands of trees. The increase of population is also a cause of deforestation. The more people that are on earth the more land and resources we demand.
If deforestation continues it will have a huge negative impact on our air supply. Everyday a piece of the forests is being destroyed. The more trees that are being destroyed the less oxygen can be produced. Trees use photosynthesis to covert carbon dioxide into oxygen. Photosynthesis is the main producer of oxygen, and respiration and decay remove it. Urban areas have less oxygen then rural areas, because they don’t have many plants. Throughout history oxygen levels have been steadily decreasing. Once the oxygen levels hit 7% the air is too low to support human life (thenaturalhealthplace.com). Finding ways to apply reforestation would help increase oxygen.
There are many ways to apply reforestation to reverse the harm that’s been don’t to the world. One way is to plant trees. There are some cities who have made vertical forests. They plant trees and plants that surround the building. Going paperless would help as well. Since technology has advanced, paper isn’t really needed as often. Recycling and buying recycled products will help as well. The more that people recycle there will be less demand for natural resources and trees. Reforestation will help to reduce the concentration of carbon dioxide in the air.
Deforestation does have a huge negative impact on our world, but there are quite of bit of positive too. The positive effects of deforestation are that it does gives humans space to grow. With growth comes civilizations which means more jobs and revenue. Deforestations also gives us more food and resources to satisfy our needs. It means a more comfortable life for humans. The consequences of deforestation is not worth the temporary comfort that humans get from it.
Deforestation is a serious problem to maintain life on this planet. The decrease in oxygen could eventually mean the end to human kind. If we don’t do anything abo.
All workings, when appropriate, must be shown to substantiate your.docxsimonlbentley59018
All workings, when appropriate, must be shown to substantiate your answers.
Question 1 [14 marks]
Financial statement disclosures
You are the financial accountant for Superstore Ltd, and are in the process of preparing its financial statements for the year ended 30 June 2018. Whilst preparing the financial statements, you become aware of the following situations:
1. On 1 July 2017, the directors made a decision, using information obtained over the last couple of years, to revise the useful life of an item of manufacturing equipment. The equipment was acquired on 1 July 2015 for $800,000, and has been depreciated on a straight-line basis, based on an estimated useful life of 10 years and residual value of nil. Superstore Ltd uses the cost model for manufacturing equipment. The directors estimate that as at 1 July 2017, the equipment has a remaining useful life of 6 years and a residual value of nil. No depreciation has been recorded as yet for the year ended 30 June 2018 as the directors were unsure how to account for the change in the 2018 financial statements, and unsure whether the 2016 and 2017 financial statements will need to be revised as a result of the change.
2. In June 2018, the accounts payable officer discovered that an invoice for repairs to equipment, with an amount due of $20,000, incurred in June 2017, had not been paid or provided for in the 2017 financial statements. The invoice was paid on 12 July 2018. The repairs are deductible for tax purposes. The accountant responsible for preparing the company’s income tax returns will amend the 2017 tax return, and the company will receive a tax refund of $6,000 as a result (30% x $20,000). No journal entries have been done as yet in the accounting records of Superstore Ltd, as the directors are unsure how to account for this situation, and what period adjustments need to be made in.
3. Superstore Ltd holds shares in a listed public company, ABC Ltd, which are valued in the draft financial statements on 30 June 2018 at their market value on that date - $600,000. A major fall in the stock market occurred on 10 July 2018, and the value of Superstore’s shares in ABC Ltd declined to $250,000.
4. On 21 July 2018, you discovered a cheque dated 20 April 2018 of $32,000 authorised by the company’s previous accountant, Max. The payment was for the purchase of a swimming pool at Max’s house. The payment had been recorded in the accounting system as an advertising expense. You advise the directors of this fraudulent activity, and they will investigate.
Assume that each event is material.
Required:
i) State the appropriate accounting treatment for each situation. Provide explanations and references to relevant paragraphs in the accounting standards to support your answers. Where adjustments to Superstore Ltd’s financial statements are required, explain which financial statements need to be adjusted (ie. 2016, 2017, 2018 or 2019).
ii) Prepare any note disclosures and adjusting j.
All yellow highlight is missing answer, please answer all of t.docxsimonlbentley59018
All yellow highlight is missing answer, please answer all of the questions in detail. *** Please redo question#4 and answer them relate to the questions.
Thank you
Anna in the Tropics
Literature has the power to affect even the humblest of lives. Anna in the Tropics
presents the story of a family of Cuban cigar rollers whose lives in the 1920s Florida are
brightened up and disturbed at the same time by a stranger, a lector, who reads aloud about
the passions of Tolstoy and his heroine Anna Karenina. It is common practice for employees
at the factory run by this Cuban family to be entertained by as they carry out the mundane
chores at hand – those of rolling of cigars and sorting tobacco leaves. But as those in the
factory begin to get caught up in Tolstoy’s classic, willingly or not, the book begins to work
subtle and profound changes in their emotional lives. This essay will analyze the themes
covered in Anna in the Tropics, even as it seeks to explore the various ways in which the
play’s characters are affected as the lector reads to them – along with their fellow workers, to
educate and stimulate their minds in the course of the doldrums of their repetitive tasks.
One of the very first things to note in this story is how certain tensions between old
traditions and new ways are reflected. The factory workers, for instance, are threatened by
new, mechanical cigar rolling machines because they themselves roll cigars by hand, which is
the traditional way (Cruz 19). It is not just the workers whose future is uncertain, however.
Even the very tradition of the lector, who reads out loud to the cigar rollers so that any tedium
in the factory may be broken, while at the same time facilitating the ease of passing time, is at
risk (Cruz 8). Since listening to the lector is often the closest thing to a formal education that
cigar-rollers might experience, the ending of this tradition, in particular, could signify the
demise of an informal method of learning (Aiello).
The significance of the lector is not only about giving factory workers some
semblance of an informal education, however, but it is also reflective of the theme of Cuban
heritage that is present throughout the play. The Cuban culture and traditions comprise a key
theme because first, the play is set within the Cuban American community which is living in
Ybor City in Tampa, Florida (Cruz 2). Second, it is apparent that Cuban Americans prefer to
stay within their own cultural community whenever they can help it, which explains how they
have been able to keep their old traditions. Their cigar-rolling factory, for instance, is not run
in the same fashion that American companies are, what with a lector being availed to
entertain the workers – as demanded by Cuban traditions (Cruz 9). The characters in this
story are defined and destroyed against the standard of Cuban heritage.
As the play begins, the previous lector has jus.
All models are wrong. Some models are useful.—George E. P. B.docxsimonlbentley59018
All models are wrong. Some models are useful.
—George E. P. Box (1919–2013)
Statistician
Describing and explaining social phenomena is a complex task. Box’s quote speaks to the point that it is a near impossible undertaking to fully explain such systems—physical or social—using a set of models. Yet even though these models contain some error, the models nevertheless assist with illuminating how the world works and advancing social change.
The competent quantitative researcher understands the balance between making statements related to theoretical understanding of relationships and recognizing that our social systems are of such complexity that we will always have some error. The key, for the rigorous researcher, is recognizing and mitigating the error as much as possible.
As a graduate student and consumer of research, you must recognize the error that might be present within your research and the research of others.
To prepare for this Discussion:
Use the Walden Library Course Guide and Assignment Help found in this week’s Learning Resources to search for and select a quantitative article that interests you and that has social change implications.
As you read the article, reflect on George Box’s quote in the introduction for this Discussion.
For additional support, review the
Skill Builder: Independent and Dependent Variables
, which you can find by navigating back to your Blackboard Course Home Page. From there, locate the Skill Builder link in the left navigation pane.
By Day 3
Post a very brief description (1–3 sentences) of the article you found and address the following:
1. Describe how you think the research in the article is useful (e.g., what population is it helping? What problem is it solving?).
2. Using Y=
f
(X) +E notation, identify the independent and dependent variables.
3. How might the research models presented be wrong? What types of error might be present in the reported research?
Frankfort-Nachmias, C., & Leon-Guerrero, A. (2018).
Social statistics for a diverse society
(8th ed.). Thousand Oaks, CA: Sage Publications.
· Chapter 1, “The What and the Why of Statistics” (pp. 1–21)
Wagner, W. E. (2016).
Using IBM® SPSS® statistics for research methods and social science statistics
(6th ed.). Thousand Oaks, CA: Sage Publications.
· Chapter 1, “Overview”
Dietz, T., & Kalof, L. (2009).
Introduction to social statistics: The logic of statistical reasoning
. West Sussex, United Kingdom: Wiley-Blackwell.
Introduction to Social Statistics: The Logic of Statistical Reasoning, 1st Edition by Dietz, T.; Kalof, L. Copyright 2009 by John Wiley & Sons - Books. Reprinted by permission of John Wiley & Sons - Books via the Copyright Clearance Center.
·
Chapter 1, “An Introduction to Quantitative Analysis” (pp. 1–31)
Dietz, T., & Kalof, L. (2009).
Introduction to social statistics: The logic of statistical reasoning
. West Sussex, United Kingdom: Wiley-Blackwell.
Introdu.
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED .docxsimonlbentley59018
ALL WORK MUST BE ORIGINAL, CITED, IN APA FORMAT & WILL BE SUBMITTED TO TURN-IT-IN. THIS IS A DISCUSSION POST. DUE DATE IS SUNDAY, 06/21/22 @ 2PM EASTERN STANDARD TIME.
Discussion Question #2:
If you had the authority, what steps would you take to secure America's digital infrastructure?
.
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED.docxsimonlbentley59018
ALL WORK MUST BE ORIGINAL, CITED IN APA FORMAT AND WILL BE SUBMITTED TO TURN IT IN. MINIMUM WORD COUNT IS 1500 NOT INCLUDING THE TITLE PAGE. DUE DATE IS MONDAY 06/22/20 @ 12 NOON EASTERN STANDARD TIME.
Assignment:
1. The first sentence of Chapter 2 reads, “The saying that ‘people receive the kind of policing they deserve” ignores the role power plays in the kind, quality, and distribution of police service.” Discuss what this sentence means in the context of contemporary policing in the United States.
2. Beginning in 1929, August Vollmer, as head of the National Commission on Law Observance and Enforcement, established 10 principles vital in reforming the police. Discuss the importance of the principles in providing the underpinnings for modern policing.
3. Explain how technology has affected communities of interest in the United States.
4. Explain the contributions of the Chicago School in studies of the community.
.
All Wet! Legacy of Juniper Utility has residents stewingBy Eri.docxsimonlbentley59018
All Wet!
Legacy of Juniper Utility has residents stewing
By Erin Foote Marlowe
·
·
Last Friday, a collection of men and women sat in Marion Palmateer's plush Southeast Bend living room and told a story of frustration, talking over one another and becoming increasingly angry about their understanding of the legacy of Juniper Utility and what it means to them.
These folks who gathered on Palmateer's soft white couch and chairs consider themselves the modern-day victims in the more- than-a-decade-old saga of Juniper Utility Co., a water service provider formerly owned by housing developer Jan Ward in Southeast Bend. In 2002, it was condemned by Bend for what the city said was risk of catastrophic failure.
Money and "authority" are at the core of the story now for this group, as opposed to the low water pressures of a decade ago—a problem that became so egregious that, by 2001, it became a challenge to take a shower or fill a washing machine. Water lines routinely broke down.
The people in Palmateer's living room, "a loose collection of individuals," as they call themselves, are residents of neighborhoods formerly served by Juniper Utility, including Timber Ridge, Mountain High, Tillicum Village and Nottingham Square. They are frustrated with a history they felt they had no control over but is now costing them in water bills they believe will cost them thousands more per year than they ever expected.
In 2004, homeowners association representatives from their neighborhoods signed an agreement with the city that said the owners of the roughly 700 homes of the neighborhoods would pay 100 percent of the costs associated with providing water to the neighborhoods, including making improvements to the system.
But this group of residents feels the agreement wasn't in their best interest and they had no say in the decision. An HOA board member at the time said a ballot was not sent out to homeowners for approval and, because there was no vote of homeowners, these frustrated residents believe this 2004 agreement could be illegal. Further underscoring the issue, it appears the agreement was never recorded with the county clerk's office. So, when these new people bought houses in these neighborhoods, the tab for paying to upgrade the water system didn't show up in their title searches.
"Think of the banks that lent against it," said Dan Kehoe, a resident of Mountain High who has taken a lead role in challenging the agreements between the HOAs and the city. "That's called bank fraud and people go to jail for it."
But although frustrations over this agreement are evidently fresh for these residents, it would appear that the issue should be moot because in 2011 the HOAs and the city reached a new agreement—one that should reduce costs for residents.
"We moved them from a bad agreement to a good agreement," said city of Bend Finance Director Sonia Andrews. "From something that would cost them a lot to something that would be more reasonable."
Each homeowne.
All three of the Aristotle, Hobbes, and Douglass readings discussed .docxsimonlbentley59018
All three of the Aristotle, Hobbes, and Douglass readings discussed power in different ways. How is power related to justice? How should it be shifted in order to better serve all citizens? Please reflect on this idea of power and refer to at least two of the three philosophers listed.
Note: You should write enough to make your point, but can aim form 6-8 sentences or so (but there is no minimum or limit).
.
All rights reserved. No part of this report, including t.docxsimonlbentley59018
All rights reserved. No part of this report, including
the trends presented in this report, may be
reproduced or transmitted in any form or by any
means whatsoever (including presentations, short
summaries, blog posts, printed magazines, use
of images in social media posts) without express
written permission from the author, except in the
case of brief quotations (50 words maximum and
for a maximum of 2 quotations) embodied in critical
articles and reviews, and with clear reference to
the original source, including a link to the original
source at http://eventmb.com/Event-Trends-2018.
Please refer all pertinent questions to the publisher.
COPYRIGHT
TABLE OF
CONTENTS
:: 2 COPYRIGHT
5 INTRODUCTION
7 MACRO TRENDS AFFECTING THE EVENT INDUSTRY. A FORECAST.
8 10 Trends in EVENTTECH
Julius Solaris
23 10 Trends in VENUES
Pádraic Gilligan
35 10 Trends in EVENT MARKETING AND SOCIAL MEDIA
Becki Cross
54 10 Trends in DESTINATIONS
Julius Solaris and Pádraic Gilligan
65 10 Trends in EVENT EXPERIENCE
Roger Haskett
80 10 Trends in EVENT DECOR AND STYLING
Kate Patay, CPCE
91 10 Trends in DESTINATION MANAGEMENT COMPANIES (DMCS)
Cindy Y. Lo, DMCP
102 ABOUT THE AUTHORS
105 CMP CREDITS
105 CREDITS AND THANKS
105 DISCLAIMER
AD
http://eventmb.com/2A6WKga
The event industry is navigating through the strongest wave of change of
the past 10 years. Never before has this industry experienced this level
of transformation in so many aspects of the event planning process.
Attendees, suppliers and event planners have to deal with ‘new’ and
‘different’ on many levels.
As a segue from last year’s report, we are again looking at the five major
areas impacted by this change:
G TECHNOLOGY
G EVENT MARKETING
G VENUES
G DESTINATIONS
G EVENT DESIGN
We are also looking at two new categories of trends:
G EVENT STYLING
G DESTINATION MANAGEMENT COMPANIES
(DMCS)
The spend for these items represent a massive input for the industry and we
feel times are mature enough to analyze developments on a yearly basis.
:: INTRODUCTION
10 EVENT
TRENDS FOR
2018
Julius Solaris
10 Event Trends for 2018
:: 5
AD
http://eventmb.com/2iVmZfW
MACRO TRENDS AFFECTING THE
EVENT INDUSTRY. A FORECAST.
There are common themes you will find in the following categories of
trends. We refer to these as macro trends. They are inherent to the
economic, political, social and technological developments happening
around us. Here are the most significant affecting the event industry:
G Sexual Harassment. With the explosion worldwide of the #metoo
movement and the very public charges against many celebrities,
politicians and people of influence, it seems it is finally time for the event
industry to reflect on sexual harassment. Many reports have popped up
of events being at the ideal stage for harassment or violence to happen.
As a result there is increased pressure to step up the measures to protect
attendees against perpetrators. A mo.
All PrinciplesEvidence on Persuasion Principles This provides som.docxsimonlbentley59018
All PrinciplesEvidence on Persuasion Principles: This provides some guidance how much confidence you can place on the principles Analyzed by J. Scott Armstrong on December 8, 2010; re-analyzed by Elliot Tusk on May 26, 2011Common senseReceived wisdomNo evidenceExpert opinionNon-experimental evidenceSingle experimentSome experimental evidenceMuch experimental evidenceCommentsSUMNumberPrinciple1INFORMATION1.1Benefits1.1.1Describe specific, meaningful benefits111.1.2Communicate a Unique Selling Principle (USP)1111.2News1.2.1Provide news, but only if it is real111.2.2If real news is complex, use still media11.3Product or service1.3.1Provide product information that customers need11.3.2Provide choices11.3.3When there are many substantive, multi-dimensional options, organize them and provide guidance11.3.4Make the recommended choice the default choice11.3.5Inform committed customers that they can delete features, rather than add them11.3.6To reduce customer risk, use a product-satisfaction guarantee11.4Price1.4.1State prices in terms that are meaningful and easy to understand111.4.2Use round prices111.4.3Show the price to be a good value against a reference price11.4.4If quality is not a key selling point, consider advertising price reductions11.4.5Consider partitioned prices when the add-on prices seem fair and small relative to the base price11.4.6To retain customers, consider linking payments to consumption11.4.7Consider separating payments from benefits- if the payments are completed before the benefits end11.4.8State that the price can be prepaid if it might reduce uncertainty for consumers111.4.9Use high costs to justify high prices11.4.10When quality is high, do not emphasize price11.4.11Use high prices to connote high quality111.4.12For inexpensive products, state price discounts as percentage saved; for expensive products, state price discounts as dollars saved- or present both11.4.13Minimize price information for new products11.4.14Consider bundling prices of features or complementary products or services if they are desirable for nearly all customers11.4.15Advertise multi-unit purchases for frequently purchased low-involvement products if it is also in the consumers' interest11.5Distribution1.5.1Include information on when, where and how to buy the product111.5.2Feature a sales channel when it is impressive11.5.3Use the package to enhance the product11.5.4If a product is desirable, specify delivery dates rather than waiting times11.5.5Tell customers they can achieve benefits over a long time period if you want to reduce the use of an offer- and vice versa12INFLUENCE2.1Reasons2.1.1Provide a reason12.1.2For high-involvement products, the reasons should be strong12.2Social Proof2.2.1Show that the product is widely used12.2.2Focus on individuals similar to the target market112.3Scarcity2.3.1State that an attractive product is scarce when it is true12.3.2Restrict sales of the product112.4Attribution2.4.1Attribute favorable behavior and traits.
All papers may be subject to submission for textual similarity revie.docxsimonlbentley59018
All papers may be subject to submission for textual similarity review to Turnitin.com for the detection of plagiarism
those are the two quistions
What are the disadvantages of Henrietta in particular and her colleagues, pursuing careers in astronomy during this time period? Choose one scene and describe how character relationships and the outcome of the play would change if the central characters were male instead of female.
--
I don't have the book , i need someone who can have it and answer the two questions
silent sky by lauren gunderson
answer 2 questions in 4 pages double space
.
All of us live near some major industry. Describe the history of an .docxsimonlbentley59018
All of us live near some major industry. Describe the history of an industry in the city you live in or a nearby city.
How has the industry changed over the last fifty years?
What cultural changes have occurred to drive those changes?
What do you see as the future of industry in the city?
.
All of Us Research Program—Protocol v1.12 IRB Approval Dat.docxsimonlbentley59018
All of Us Research Program—Protocol v1.12
IRB Approval Date: 23 October 2019
Protocol Title All of Us Research Program 1
Principal Investigator(s) Joshua Denny, M.D., M.S.
Vanderbilt University Medical Center
+1 615 936-5033
Sponsor National Institutes of Health (NIH)
Primary Contact John Wilbanks
Sage Bionetworks
+1 617 838-6333
Protocol Version Core Protocol v.1.12 pre02
Date 16 October 2019
IRB reference AoU IRB Protocol # 2017-05
IRB Approval date v1.5: May 20, 2017
v1.6: Feb 13, 2018
v1.7: Mar 28, 2018
v1.8: Jul 11, 2018
v1.9 Oct 19, 2018
v1.10 Mar 05, 2019
v1.11 Aug 12, 2019
v1.12 Oct 23, 2019
1 Precision Medicine Initiative, PMI, All of Us, the All of Us logo, and “The Future of Health Begins
with You” are service marks of the U.S. Department of Health and Human Services.
All of Us Research Program—Protocol v1.11 pre02
IRB Approval Date
2
Program Leadership and Governance
Leadership
The All of Us Research Program (AoURP) is a large collaborative initiative sponsored by the
National Institutes of Health (NIH). The research program functions as a consortium of awardees
from multiple institutions. Its governance involves representation from each awardee and
participant representatives. The consortium also includes the program director and project
scientists/specialists from NIH. Each awardee has responsibilities commensurate with expertise. See
Table 0–1: Program Unit Awardees for a list of NIH-funded awardees and contact Principal
Investigators (PIs).
Dr. Joshua Denny of Vanderbilt University Medical Center serves as the Principal Investigator on
behalf of the consortium.
Governance
The Steering Committee (SC) is the primary governing body of AoURP. The SC recommends
strategic directions for the program and oversees planning, coordination, and implementation of the
program’s overall operations. Its 50 voting members include PIs from each awardee as designated
in the notice of award; representation from NIH, comprising of the deputy director and chief
officers of AoURP; representation from community partners and participants (see section 3.1); and
additional representation as needed to ensure balanced representation of stakeholders. The
governance also includes an Executive Committee (EC) which is a small governing body composed
of 17 members, that ensures the program is effectively meeting its objectives and mission. The EC
proposes solutions to challenges and provides the Director with strategies, options, and information
to aid in programmatic decisions. The Director has discretion to delegate specific decisions to the
EC. Membership of the EC is determined by the Director and reflects the awardees within the
consortium with balanced interests to ensure effective deliberation.
The Steering Committee may appr.
All participants must read the following article ATTACHED Agwu.docxsimonlbentley59018
All participants must read the following article: ATTACHED
* Agwu, E. & Ohaegbu, V.A. (2015). Strategic management of the benefits and challenges of HR outsourcing in effective organizational management. Journal of Business Studies Quarterly, 7, 2, 85-108. Retrieved from http://jbsq.org/wp-content/uploads/2015/12/December_2015_6.pdf
Participants will be assigned to groups.
Within each group, members will assume the role of a VP of Human Resources. In this role, list both the organizational opportunities and challenges of utilizing some level of outsourcing of at least 2 HR processes.
* Your list should include a minimum of three (3) opportunities and challenges for each process, especially as they pertain to driving enterprise goals, and organizational culture.
* Provide supporting statements from the article, our texts and other readings/resources, for your positions.
Reporting and Valuation for
Undergraduates
1
Below is a 2-part question. Please create a word document and/or spreadsheet to answer the following
prompts. Upload your response according to the directions.
Part I: Reporting and Financial Statement Analysis
1. Given the following income statements, calculate the estimated cash flow for years 20x1 and 20x2.
2. Given the following income statements, calculate the interest coverage (time interest earned) ratio
for years 20x1 and 20x2.
3. Given the following income statements, calculate the net profit margin ratio for years 20x1 and
20x2.
Income Statement for years 20x1 and 20x2
20x1 20x2
Sales $5,450 $5,000
Operating Costs excluding Depreciation and Amortization 4,775 4,250
EBITDA 675 750
Depreciation and Amortization 40 180
EBIT $635 $570
Interest Expense 62 200
EBT $573 $370
Taxes (40%) 229 148
NI $344 $222
4. Based solely on the following balance sheets, calculate the current ratio for years 20x1 and 20x2?
5. Based solely on the following balance sheets, calculate the debt ratio for years 20x1 and 20x2.
Balance Sheet ending December 31 for years 20x1 and 20x2
20x1 20x2
Assets:
Cash $275 $250
Short Term Investments 55 50
Accounts Receivable 375 250
Inventories 825 750
Total Current Assets $1,530 $1,300
Net Plant and Equipment 2,925 2,750
Total Assets $4,455 $4,050
Liabilities:
Notes Payable $192 $100
Accounts Payable 580 100
Miscellaneous Payables 245 250
Total Current Liabilities $1,017 $450
Long-Term Debt 550 500
Total Liabilities $1,567 $950
Reporting and Valuation for
Undergraduates
2
Common Stock 2154 2,600
Retained Earnings 734 500
Less Treasury Stock 46 0
Total Shareholder Equity $2,888 $3,100
Liabilities and Shareholder Equity $4,455 $4,050
6. Based on both the income statements and balance sheets, calculate the return on assets (return on
investment) ratios for years 20x1 and 20x2.
7. Based on both the income statements and balance sheets, calculate the total asset turnover ratio
for years 20x1 and 20x2. .
ALL of the requirements are contained in the attached document. T.docxsimonlbentley59018
ALL
of the requirements are contained in the attached document. The Veronica case study is attached also.
To prepare:
Review "Working With Survivors of Human Trafficking: The Case of Veronica." Think about how one might become an ally to victims of human trafficking . Then go to a website that addresses human trafficking either internationally or domestically.
Post
a brief description of the website you visited (Websites contained below). Explain how you might support Veronica and other human trafficking victims incorporating the information you have found. Explain how you can begin to increase your awareness of this issue and teach others about human trafficking victims. Describe opportunities to get involved and become an ally to those who have been trafficked. Identify steps you can take to begin to support this group.
.
All five honorees cared greatly about the success of Capella lea.docxsimonlbentley59018
All five honorees cared greatly about the success of Capella learners and most were heavily involved in bettering their communities and others. Dr. Ford in particular fulfilled this desire by helping others to help themselves. Describe how you plan to use your education to better your community or help others to help themselves, and how receiving this scholarship will help you in doing so? 250-750 word essay
All of our honorees brought great personal and professional successes to their work environment. What would you consider one of your greatest professional successes? How did your success benefit your organization and its people? 250- 750 word essay
Respond to Tawnya and Noeme post
Creating the ideal marketing plan requires many steps and gathering data. “Knowing the needs of the customer and having a clearly articulated mission will help to target the message to an audience who will be most interested in the service that is being provided” (Sciarra, Lynch, Adams, & Dorsey (2016) p. 340). To find these needs, a needs assessment can be done. After gathering the results, a plan can start to form. Creating a Strength, Weakness, Opportunities, and Threats chart (SWOT) will give you a broader view on how to target your population.
“The first step in conducting SWOT analysis is to identify your stakeholders and data that has already been collected” (Sciarra, (2016) p. 340). Your stakeholders will guide you into the right direction for a plan of action. Looking at the type of population including the children, families, and staff members will give you the data to create your SWOT. Moving forward with the data, now to breakdown your SWOT data analysis and create a marketing plan. Strengths; reviewing this section will give you an objective overview of any changes needing to be made. Strengths can consist of staff, location, cliental, and possibly opportunities. If there are areas of weakness this gives us the ability to make changes. Moving forward with those changes leads us to Weakness, do we see a pattern of areas? What can we do to upgrade or change these areas we have identified? Moving on next to Opportunities, what options do we have beyond what we have now? Is there room for growth both financially and structurally? Finally, Threats to evaluate. Are we looking at opening a facility next door to two other highly rated centers that may cause us competition and difficulty building a successful business? Is there a possibility that the area is losing population and economic strength? Gathering the data and taking a step back and reviewing all the pro’s and con’s will give us a bigger picture when deciding which way to market our audience.
Taking a look at the strengths from all the gathered data will give you a good direction to follow for reaching protentional public relations opportunities. For an example, location, your childcare facility has a prime location in your town and your coming up on your grand opening soon. Planning an.
All of the instructions will be given to you in a document. One docu.docxsimonlbentley59018
All of the instructions will be given to you in a document. One document is the guidelines and the other is a sample to help guide you (and to make it a little more easier). For the background information summary, the section titled Significant assessment findings during days of care can be placed in a table. Also the medications can be placed in a table as well. I will also attach a NANDA Nursing Diagnosis to help for the "Risk for".
.
All financial statement audits will include an audit of the inve.docxsimonlbentley59018
All financial statement audits will include an audit of the inventory cycle. You should plan for the audit by setting the audit objectives. For this assignment, write and submit 300–400 words that set specific internal controls that should be included to meet the following management assertions:
Existence
Completeness
Accuracy or valuation
Rights and obligations
Presentation and disclosure
.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
2. JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrevNextFramesNo Fra
mesAll ClassesDeprecated API
ContentsSkip navigation
linksPackageClassDeprecatedIndexHelpPrevNextFramesNo Fra
mesAll Classes
edu/vt/cs5044/tetris/Tetris5044.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
edu.vt.cs5044.tetris
3. Class Tetris5044ObjectApplicationTetris5044public class
Tetris5044
extends Application
The main application class; for internal use only.
Version:1.0Nested Class SummaryNested classes/interfaces
inherited from class Application
Application.ParametersField SummaryFields inherited from
class Application
STYLESHEET_CASPIAN,
STYLESHEET_MODENAConstructor Summary
Constructors Constructor and DescriptionTetris5044() Method
Summary
All Methods Static MethodsInstance MethodsConcrete
MethodsModifier and TypeMethod and Descriptionstatic
voidmain(String[] args)
For internal use only.
voidstart(Stage primaryStage)
For internal use only.
Methods inherited from class Application
getHostServices, getParameters, getUserAgentStylesheet, init,
launch, launch, notifyPreloader, setUserAgentStylesheet,
4. stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, waitConstructor
DetailTetris5044public Tetris5044()Method
Detailstartpublic void start(Stage primaryStage)
throws Exception
For internal use only.
Specified by:start in class ApplicationParameters:primaryStage
- for internal use only.Throws:Exception - for internal use
only.mainpublic static void main(String[] args)
For internal use only.
Parameters:args - ignored.Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
edu/vt/cs5044/tetris/RandomMode.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Enum
5. Constants | Field | MethodDetail: Enum
Constants | Field | Method
edu.vt.cs5044.tetris
Enum
RandomModeObjectEnum<RandomMode>RandomModeAll
Implemented Interfaces:Serializable,
Comparable<RandomMode>public enum RandomMode
extends Enum<RandomMode>
Enumerates the modes of randomness used for generating
shapes for games of tetris.
Enum Constant Summary
Enum Constants Enum Constant and DescriptionNORMAL
Stream of randomness that is not repeatable.
TEST1
Repeatable stream of randomness number 1.
TEST2
Repeatable stream of randomness, number 2.
TEST3
Repeatable stream of randomness, number 3.
TEST4
6. Repeatable streams of randomness, number 4.
Method Summary
All Methods Static MethodsConcrete MethodsModifier and
TypeMethod and Descriptionstatic
Set<RandomMode>getTestSet()
Fetch the set of all test-related values.
static RandomModevalueOf(String name)
Returns the enum constant of this type with the specified name.
static RandomMode[]values()
Returns an array containing the constants of this enum type, in
the order they are declared.
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass,
hashCode, name, ordinal, toString, valueOfMethods inherited
from class Object
getClass, notify, notifyAll, wait, wait, waitEnum Constant
DetailNORMALpublic static final RandomMode NORMAL
Stream of randomness that is not repeatable.
TEST1public static final RandomMode TEST1
Repeatable stream of randomness number 1.
7. TEST2public static final RandomMode TEST2
Repeatable stream of randomness, number 2.
TEST3public static final RandomMode TEST3
Repeatable stream of randomness, number 3.
TEST4public static final RandomMode TEST4
Repeatable streams of randomness, number 4.
Method Detailvaluespublic static RandomMode[] values()
Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (RandomMode c : RandomMode.values())
System.out.println(c);
Returns:an array containing the constants of this enum type, in
the order they are declaredvalueOfpublic
static RandomMode valueOf(String name)
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters
are
not permitted.)
Parameters:name - the name of the enum constant to be
returned.Returns:the enum constant with the specified
8. nameThrows:IllegalArgumentException - if this enum type has
no constant with the specified nameNullPointerException - if
the argument is nullgetTestSetpublic
static Set<RandomMode> getTestSet()
Fetch the set of all test-related values.
This set includes all RandomMode values except NORMAL.
Returns:set of test-related values.Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Enum
Constants | Field | MethodDetail: Enum
Constants | Field | Method
edu/vt/cs5044/tetris/package-frame.htmledu.vt.cs5044.tetris
InterfacesAI
ClassesBoardPlacementShapeStreamTetris5044
EnumsRandomModeRotationShape
edu/vt/cs5044/tetris/Placement.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
9. ethodDetail: Field | Constr | Method
edu.vt.cs5044.tetris
Class PlacementObjectPlacementpublic class Placement
extends Object
Represents a single possible placement of a shape.
The placement is specified by a rotation along with the
horizontal location of the
left-most block of the rotated shape
Constructor Summary
Constructors Constructor and
DescriptionPlacement(Rotation rotation,
int column)
Construct a new object with the specified parameters.
Method Summary
All Methods Instance MethodsConcrete MethodsModifier and
TypeMethod and Descriptionbooleanequals(Object obj)
Test for equality with another Placement.
intgetColumn()
Fetch specified column.
10. RotationgetRotation()
Fetch specified rotation.
inthashCode()StringtoString()
Generates a simple human-readable representation of this
object.
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait,
waitConstructor
DetailPlacementpublic Placement(Rotation rotation,
int column)
Construct a new object with the specified parameters.
Parameters:rotation - number of rotations to apply to the
shape.column - left-most block of the rotated shape goes in this
column.Method DetailgetRotationpublic Rotation getRotation()
Fetch specified rotation.
Returns:rotation.getColumnpublic int getColumn()
Fetch specified column.
The left-most column of the board is 0.
The left-most block of the rotated shape goes in the specified
column.
Returns:column.toStringpublic String toString()
11. Generates a simple human-readable representation of this
object.
Overrides:toString in class ObjectReturns:simple representation
of this object.equalspublic boolean equals(Object obj)
Test for equality with another Placement.
Two placements are equal if and only if they contain the same
column and rotation values.
Overrides:equals in class ObjectParameters:obj - the other
placement.Returns:true if the placements are equivalent; false
otherwise.hashCodepublic int hashCode()Overrides:hashCode in
class ObjectSkip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
edu/vt/cs5044/tetris/Board.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
12. edu.vt.cs5044.tetris
Class BoardObjectBoardpublic class Board
extends Object
Represents a Tetris game board, including all fixed blocks.
This class is effectively immutable, because there are no public
mutators.
Field Summary
Fields Modifier and TypeField and Descriptionstatic
intHEIGHT
Height of all game boards, in blocks.
static intHEIGHT_LIMIT
Height limit of all game boards, in blocks.
static intWIDTH
Width of all game boards, in blocks.
Constructor Summary
Constructors Constructor and DescriptionBoard()
Construct a new empty board with no fixed blocks.
Board(String... initialBlocks)
Construct a new board with the specified initial blocks.
13. Method Summary
All Methods Instance MethodsConcrete MethodsModifier and
TypeMethod and Descriptionbooleanequals(Object obj)
Test for equality with another Board.
BoardgetResultBoard(Shape shape,
Placement place)
Generate a new board that is the result of placing a shape in this
board.
inthashCode()booleanisBlockAt(int col,
int row)
Check for a fixed block at a specified location.
StringtoString()
Generate a multi-line ASCII art visualization of this board.
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitField
DetailWIDTHpublic static final int WIDTH
Width of all game boards, in blocks.
See Also:Constant Field ValuesHEIGHTpublic static final int
HEIGHT
Height of all game boards, in blocks.
See Also:Constant Field ValuesHEIGHT_LIMITpublic static
14. final int HEIGHT_LIMIT
Height limit of all game boards, in blocks.
If any block becomes fixed at or above this row index, the
game ends.
See Also:Constant Field ValuesConstructor
DetailBoardpublic Board()
Construct a new empty board with no fixed blocks.
Boardpublic Board(String... initialBlocks)
Construct a new board with the specified initial blocks.
Specify a variable number of String values as arguments.
Each String represents one row of the board.
The last row is placed at the bottom of the board.
No more than HEIGHT_LIMIT rows may be specified.
If fewer rows are specified, the unspecified rows will be empty.
Each row must have exactly WIDTH characters.
The first character represents the left edge of the board.
Each character must be either a space ' ' or a hash '#'.
A hash means a single fixed block exists at that position.
A space means no fixed block exists at that position.
Parameters:initialBlocks - blocks to include in the boardMethod
DetailisBlockAtpublic boolean isBlockAt(int col,
int row)
Check for a fixed block at a specified location.
15. Parameters:col - column number; left-most column is zerorow -
row number; bottom-most row is zeroReturns:true if a fixed
block is at this location; false
otherwisegetResultBoardpublic Board getResultBoard(Shape sh
ape,
Placement place)
Generate a new board that is the result of placing a shape in this
board.
First a copy of this board is created.
The shape is placed at the top of this copy, rotated according to
the placement,
then moved horizontally such that the left-most block is in the
specified column.
The block is then dropped until it locks into place, then all
completely full rows (if any)
are cleared as in normal play. The result of this activity is
returned.
Note: This method is not a mutator; it does not change this
board object.Parameters:shape - the Shape to place.place - a
Placement containing the rotation and location of the
shape.Returns:a new Board representing the result of the
placement.toStringpublic String toString()
Generate a multi-line ASCII art visualization of this board.
The walls of the board are represented as '*' characters above
the
HEIGHT_LIMIT, and as '|' characters otherwise.
The bottom of the board is represented by a row of '-'
16. characters.
Fixed blocks are represented by '#' characters.
Overrides:toString in class ObjectReturns:a rudimentary
depiction of the board.equalspublic boolean equals(Object obj)
Test for equality with another Board.
Two boards are equal if and only if they contain the same
arrangement
of fixed blocks.
Overrides:equals in class ObjectParameters:obj - the other
board.Returns:true if the boards are equivalent; false
otherwise.hashCodepublic int hashCode()Overrides:hashCode in
class ObjectSkip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
edu/vt/cs5044/tetris/AI.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
17. edu.vt.cs5044.tetris
Interface AIpublic interface AI
Interface the game engine uses to communicate with AI
implementations.
You must develop an implementation of this interface.
Method Summary
All Methods Instance MethodsAbstract MethodsModifier and
TypeMethod and
DescriptionPlacementfindBestPlacement(Board currentBoard,
Shape shape)
Calculate the best placement available for a shape in a board.
intgetColumnHeightVariability(Board board)
Return the variability of column heights of a board (see
academic note).
intgetMaximumBlockHeight(Board board)
Compute the maximum block height of a board (see academic
note).
intgetTotalBlockCount(Board board)
Compute the total block count of a board (see academic note).
intgetTotalGapCount(Board board)
Compute the total gap count of a board (see academic note).
18. Method
DetailfindBestPlacementPlacement findBestPlacement(Board cu
rrentBoard,
Shape shape)
Calculate the best placement available for a shape in a board.
All possible columns for all possible rotations of the given
shape should be considered.
For each combination, implementations should call
Board.getResultBoard(Shape, Placement)
to generate the resultant board after a hypothetical placement.
The implementation must calculate a relative cost value for ech
resultant board,
then return the Placement object associated with the lowest
cost (most preferable).
Parameters:currentBoard - the existing board.shape - the shape
to be placed in the board.Returns:the best move as computed by
the
implementation.getMaximumBlockHeightint getMaximumBlock
Height(Board board)
Compute the maximum block height of a board (see academic
note).
Finds the height of the upper-most block within a board.
Note that a block in row r has a height of r+1.
ACADEMIC NOTE: This method would normally be declared
as private.
We're exposing it as public only for testing
19. purposes.Parameters:board - the Board to evaluate.Returns:the
height of the of block in the largest row
number.getTotalBlockCountint getTotalBlockCount(Board boar
d)
Compute the total block count of a board (see academic note).
Counts the total number of blocks residing within a board.
ACADEMIC NOTE: This method would normally be declared
as private.
We're exposing it as public only for testing
purposes.Parameters:board - the Board to evaluate.Returns:the
total number of
blocks.getTotalGapCountint getTotalGapCount(Board board)
Compute the total gap count of a board (see academic note).
Counts the number of gaps residing within a board.
A gap is a location without a block, where a block exists in any
higher row
of the same column.
ACADEMIC NOTE: This method would normally be declared
as private.
We're exposing it as public only for testing
purposes.Parameters:board - the Board to evaluate.Returns:the
number of
gaps.getColumnHeightVariabilityint getColumnHeightVariabilit
y(Board board)
20. Return the variability of column heights of a board (see
academic note).
The variability is defined here as the sum of the absolute
values of differences in
heights of adjacent columns, as measure from either edge of the
board to the other.
Note that for a board width w, there are w-1 adjacent column
heights.
ACADEMIC NOTE: This method would normally be declared
as private.
We're exposing it as public only for testing
purposes.Parameters:board - the Board to evaluate.Returns:the
variability of column heights.Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
edu/vt/cs5044/tetris/package-summary.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev PackageNext Packa
geFramesNo FramesAll ClassesPackage edu.vt.cs5044.tetris
21. This package holds the internal components necessary for the
game.
See: Description
Interface Summary InterfaceDescriptionAI
Interface the game engine uses to communicate with AI
implementations.
Class Summary ClassDescriptionBoard
Represents a Tetris game board, including all fixed blocks.
Placement
Represents a single possible placement of a shape.
ShapeStream
Used to generate a stream of random shapes for a game of
Tetris.
Tetris5044
The main application class; for internal use only.
Enum Summary EnumDescriptionRandomMode
Enumerates the modes of randomness used for generating
shapes for games of tetris.
Rotation
Enumeration representing each of the four distinct rotations in
Tetris.
Shape
Enumeration representing each of the seven distinct tetromino
22. shapes.
Package edu.vt.cs5044.tetris Description
This package holds the internal components necessary for the
game.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev PackageNext Packa
geFramesNo FramesAll Classes
edu/vt/cs5044/tetris/ShapeStream.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
edu.vt.cs5044.tetris
23. Class ShapeStreamObjectShapeStreampublic class ShapeStream
extends Object
Used to generate a stream of random shapes for a game of
Tetris.
Constructor Summary
Constructors Constructor and
DescriptionShapeStream(RandomMode mode)
Construct a new ShapeStream in the specified RandomMode.
Method Summary
All Methods Instance MethodsConcrete MethodsModifier and
TypeMethod and DescriptionShapenextShape()
Fetch the next random Shape from this stream.
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, waitConstructor
DetailShapeStreampublic ShapeStream(RandomMode mode)
Construct a new ShapeStream in the specified RandomMode.
Parameters:mode - specifies the strategy for generating the
random sequence; must not be null.Method
DetailnextShapepublic Shape nextShape()
24. Fetch the next random Shape from this stream.
Returns:the next random Shape from this stream.Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Field | Constr | M
ethodDetail: Field | Constr | Method
edu/vt/cs5044/tetris/Shape.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Enum
Constants | Field | MethodDetail: Enum
Constants | Field | Method
edu.vt.cs5044.tetris
Enum ShapeObjectEnum<Shape>ShapeAll Implemented
Interfaces:Serializable, Comparable<Shape>public enum Shape
extends Enum<Shape>
25. Enumeration representing each of the seven distinct tetromino
shapes.
Enum Constant Summary
Enum Constants Enum Constant and DescriptionI
The "I" shape.
J
The "J" shape.
L
The "L" shape.
O
The "O" shape.
S
The "S" shape.
T
The "T" shape.
Z
The "Z" shape.
Method Summary
All Methods Static MethodsInstance MethodsConcrete
MethodsModifier and TypeMethod and
DescriptionSet<Rotation>getRotationSet()
Get the set of valid rotations for this shape.
intgetWidth(Rotation r)
26. Get the width of this shape, in blocks, after applying a specified
rotation.
static ShapevalueOf(String name)
Returns the enum constant of this type with the specified name.
static Shape[]values()
Returns an array containing the constants of this enum type, in
the order they are declared.
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass,
hashCode, name, ordinal, toString, valueOfMethods inherited
from class Object
getClass, notify, notifyAll, wait, wait, waitEnum Constant
DetailIpublic static final Shape I
The "I" shape.
Opublic static final Shape O
The "O" shape.
Tpublic static final Shape T
The "T" shape.
Jpublic static final Shape J
27. The "J" shape.
Lpublic static final Shape L
The "L" shape.
Spublic static final Shape S
The "S" shape.
Zpublic static final Shape Z
The "Z" shape.
Method Detailvaluespublic static Shape[] values()
Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (Shape c : Shape.values())
System.out.println(c);
Returns:an array containing the constants of this enum type, in
the order they are declaredvalueOfpublic
static Shape valueOf(String name)
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters
are
not permitted.)
28. Parameters:name - the name of the enum constant to be
returned.Returns:the enum constant with the specified
nameThrows:IllegalArgumentException - if this enum type has
no constant with the specified nameNullPointerException - if
the argument is
nullgetRotationSetpublic Set<Rotation> getRotationSet()
Get the set of valid rotations for this shape.
Returns a set of Rotation values that can be applied to this
shape to result in
distinct orientations.
Returns:the a set of Rotation
values.getWidthpublic int getWidth(Rotation r)
Get the width of this shape, in blocks, after applying a specified
rotation.
The rotation parameter must be contained in the Set returned by
getRotationSet().
Parameters:r - the rotation to apply.Returns:the width of the
rotated shape, in blocks.Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Enum
Constants | Field | MethodDetail: Enum
Constants | Field | Method
edu/vt/cs5044/tetris/Rotation.html
29. JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
amesNo FramesAll ClassesSummary: Nested | Enum
Constants | Field | MethodDetail: Enum
Constants | Field | Method
edu.vt.cs5044.tetris
Enum RotationObjectEnum<Rotation>RotationAll Implemented
Interfaces:Serializable, Comparable<Rotation>public enum
Rotation
extends Enum<Rotation>
Enumeration representing each of the four distinct rotations in
Tetris.
Enum Constant Summary
Enum Constants Enum Constant and DescriptionCCW_180
Rotate 180° counter-clockwise.
CCW_270
Rotate 270° counter-clockwise.
30. CCW_90
Rotate 90° counter-clockwise.
NONE
No rotation; the default orientation.
Method Summary
All Methods Static MethodsConcrete MethodsModifier and
TypeMethod and Descriptionstatic
RotationvalueOf(String name)
Returns the enum constant of this type with the specified name.
static Rotation[]values()
Returns an array containing the constants of this enum type, in
the order they are declared.
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass,
hashCode, name, ordinal, toString, valueOfMethods inherited
from class Object
getClass, notify, notifyAll, wait, wait, waitEnum Constant
DetailNONEpublic static final Rotation NONE
No rotation; the default orientation.
CCW_90public static final Rotation CCW_90
Rotate 90° counter-clockwise.
31. CCW_180public static final Rotation CCW_180
Rotate 180° counter-clockwise.
CCW_270public static final Rotation CCW_270
Rotate 270° counter-clockwise.
Method Detailvaluespublic static Rotation[] values()
Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (Rotation c : Rotation.values())
System.out.println(c);
Returns:an array containing the constants of this enum type, in
the order they are declaredvalueOfpublic
static Rotation valueOf(String name)
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters
are
not permitted.)
Parameters:name - the name of the enum constant to be
returned.Returns:the enum constant with the specified
nameThrows:IllegalArgumentException - if this enum type has
no constant with the specified nameNullPointerException - if
the argument is nullSkip navigation
linksPackageClassDeprecatedIndexHelpPrev ClassNext ClassFr
32. amesNo FramesAll ClassesSummary: Nested | Enum
Constants | Field | MethodDetail: Enum
Constants | Field | Method
help-doc.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrevNextFramesNo Fra
mesAll ClassesHow This API Document Is Organized
This API (Application Programming Interface) document has
pages corresponding to the items in the navigation bar,
described as follows.
Package
Each package has a page that contains a list of its classes and
interfaces, with a summary for each. This page can contain six
categories:Interfaces
(italic)ClassesEnumsExceptionsErrorsAnnotation Types
Class/Interface
Each class, interface, nested class and nested interface has its
own separate page. Each of these pages has three sections
33. consisting of a class/interface description, summary tables, and
detailed member descriptions:Class inheritance diagramDirect
SubclassesAll Known SubinterfacesAll Known Implementing
ClassesClass/interface declarationClass/interface
descriptionNested Class SummaryField SummaryConstructor
SummaryMethod SummaryField DetailConstructor
DetailMethod Detail
Each summary entry contains the first sentence from the
detailed description for that item. The summary entries are
alphabetical, while the detailed descriptions are in the order
they appear in the source code. This preserves the logical
groupings established by the programmer.
Annotation Type
Each annotation type has its own separate page with the
following sections:Annotation Type declarationAnnotation Type
descriptionRequired Element SummaryOptional Element
SummaryElement Detail
Enum
Each enum has its own separate page with the following
sections:Enum declarationEnum descriptionEnum Constant
SummaryEnum Constant Detail
Deprecated API
The Deprecated API page lists all of the API that have been
deprecated. A deprecated API is not recommended for use,
generally due to improvements, and a replacement API is
usually given. Deprecated APIs may be removed in future
implementations.
Index
The Index contains an alphabetic list of all classes, interfaces,
constructors, methods, and fields.
Prev/Next
34. These links take you to the next or previous class, interface,
package, or related page.
Frames/No Frames
These links show and hide the HTML frames. All pages are
available with or without frames.
All Classes
The All Classes link shows all classes and interfaces except
non-static nested types.
Serialized Form
Each serializable or externalizable class has a description of its
serialization fields and methods. This information is of interest
to re-implementors, not to developers using the API. While
there is no link in the navigation bar, you can get to this
information by going to any serialized class and clicking
"Serialized Form" in the "See also" section of the class
description.
Constant Field Values
The Constant Field Values page lists the static final fields and
their values.
This help file applies to API documentation generated using the
standard doclet.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrevNextFramesNo Fra
mesAll Classes
index-all.html
35. JavaScript is disabled on your browser.
Skip navigation
linksPackageClassDeprecatedIndexHelpPrevNextFramesNo Fra
mesAll ClassesABEFGHIMNPRSTVW
AAI - Interface in edu.vt.cs5044.tetris
Interface the game engine uses to communicate with AI
implementations.
BBoard - Class in edu.vt.cs5044.tetris
Represents a Tetris game board, including all fixed blocks.
Board() - Constructor for class Board
Construct a new empty board with no fixed blocks.
Board(String...) - Constructor for class Board
Construct a new board with the specified initial blocks.
Eedu.vt.cs5044.tetris - package edu.vt.cs5044.tetris
This package holds the internal components necessary for the
game.
equals(Object) - Method in class Board
Test for equality with another Board.
equals(Object) - Method in class Placement
Test for equality with another Placement.
36. FfindBestPlacement(Board, Shape) - Method in interface AI
Calculate the best placement available for a shape in a board.
GgetColumn() - Method in class Placement
Fetch specified column.
getColumnHeightVariability(Board) - Method in interface AI
Return the variability of column heights of a board (see
academic note).
getMaximumBlockHeight(Board) - Method in interface AI
Compute the maximum block height of a board (see academic
note).
getResultBoard(Shape, Placement) - Method in class Board
Generate a new board that is the result of placing a shape in this
board.
getRotation() - Method in class Placement
Fetch specified rotation.
getRotationSet() - Method in enum Shape
Get the set of valid rotations for this shape.
getTestSet() - Static method in enum RandomMode
Fetch the set of all test-related values.
getTotalBlockCount(Board) - Method in interface AI
Compute the total block count of a board (see academic note).
getTotalGapCount(Board) - Method in interface AI
37. Compute the total gap count of a board (see academic note).
getWidth(Rotation) - Method in enum Shape
Get the width of this shape, in blocks, after applying a specified
rotation.
HhashCode() - Method in class BoardhashCode() - Method in
class PlacementHEIGHT - Static variable in class Board
Height of all game boards, in blocks.
HEIGHT_LIMIT - Static variable in class Board
Height limit of all game boards, in blocks.
IisBlockAt(int, int) - Method in class Board
Check for a fixed block at a specified location.
Mmain(String[]) - Static method in class Tetris5044
For internal use only.
NnextShape() - Method in class ShapeStream
Fetch the next random Shape from this stream.
PPlacement - Class in edu.vt.cs5044.tetris
Represents a single possible placement of a shape.
Placement(Rotation, int) - Constructor for class Placement
38. Construct a new object with the specified parameters.
RRandomMode - Enum in edu.vt.cs5044.tetris
Enumerates the modes of randomness used for generating
shapes for games of tetris.
Rotation - Enum in edu.vt.cs5044.tetris
Enumeration representing each of the four distinct rotations in
Tetris.
SShape - Enum in edu.vt.cs5044.tetris
Enumeration representing each of the seven distinct tetromino
shapes.
ShapeStream - Class in edu.vt.cs5044.tetris
Used to generate a stream of random shapes for a game of
Tetris.
ShapeStream(RandomMode) - Constructor for class
ShapeStream
Construct a new ShapeStream in the specified RandomMode.
start(Stage) - Method in class Tetris5044
For internal use only.
TTetris5044 - Class in edu.vt.cs5044.tetris
The main application class; for internal use only.
Tetris5044() - Constructor for class Tetris5044toString() -
Method in class Board
39. Generate a multi-line ASCII art visualization of this board.
toString() - Method in class Placement
Generates a simple human-readable representation of this
object.
VvalueOf(String) - Static method in enum RandomMode
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum Rotation
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum Shape
Returns the enum constant of this type with the specified name.
values() - Static method in enum RandomMode
Returns an array containing the constants of this enum type, in
the order they are declared.
values() - Static method in enum Rotation
Returns an array containing the constants of this enum type, in
the order they are declared.
values() - Static method in enum Shape
Returns an array containing the constants of this enum type, in
the order they are declared.
WWIDTH - Static variable in class Board
Width of all game boards, in blocks.
ABEFGHIMNPRSTVWSkip navigation
linksPackageClassDeprecatedIndexHelpPrevNextFramesNo Fra
40. mesAll Classes
index.html
package-list
edu.vt.cs5044.tetris
script.js
function show(type)
{
count = 0;
for (var key in methods) {
var row = document.getElementById(key);
if ((methods[key] & type) != 0) {
row.style.display = '';
row.className = (count++ % 2) ? rowColor : altColor;
}
else
row.style.display = 'none';
}
updateTabs(type);
}
function updateTabs(type)
{
for (var value in tabs) {
var sNode = document.getElementById(tabs[value][0]);
var spanNode = sNode.firstChild;
if (value == type) {
sNode.className = activeTableTab;
spanNode.innerHTML = tabs[value][1];
}
else {
sNode.className = tableTab;
spanNode.innerHTML = "<a href="javascript:show("+
58. div.block span.emphasizedPhrase,
div.block div.block span.interfaceName {
font-style:normal;
}
div.contentContainer ul.blockList li.blockList h2{
padding-bottom:0px;
}
Commenting guidelines
Documenting Your Classes and Methods
It is important always to document your code clearly. For Java
programmers, some general commenting conventions have been
established by a tool called javadoc (Links to an external
site.)Links to an external site., the Java API documentation
generator. This tool can automatically extract documentation
comments from source code and generate HTML class
descriptions, like those in the Sofia API (Links to an external
site.)Links to an external site.. This tool is so popular and so
commonly used that it has set the standard for how people
document the externally visible features in their Java code. (See
the Sun article on "How to Write Doc Comments for the
Javadoc Tool" (Links to an external site.)Links to an external
site..)
JavaDoc (Links to an external site.)Links to an external site.
Comments
The javadoc tool expects comments to be written in a particular
way--other comments are ignored. JavaDoc comments (also
called just "doc comments") always start with "/**" and end
with "*/". Any other comments are ignored when generating
documentation for your code. Further, a JavaDoc comment
describing something always appears immediately before the
thing it documents.
Within a JavaDoc comment, special tags can be embedded to
signal particular kinds of information. These doc tags enable
59. complete, well-formatted API documentation to be
automatically generated from your source code. All JavaDoc
tags start with an at-sign (@).
If you already know some HTML, you can even embed simple
HTML markup inside your JavaDoc comments, and it will
appear in the generated documentation for your classes. This is
handy if you want to add bullet lists in a class description, or
wish to make part of your comment stand out in boldface, and
so on.
Describing a Class
You should place a descriptive JavaDoc comment just before
the start of each class you write:
/**
* Write a one-sentence summary of your class here.
* Follow it with additional details about its purpose, what
abstraction
* it represents, and how to use it.
*
* @author Stephen Edwards (stedwar2)
* @version 2011.01.30
*/
public class UserProfile
. . .
{
. . .
}
Class descriptions typically use two tags: @author indicates
who wrote the file, and @version indicates the "version" of this
file or project. You can use your full name, or just PID, in an
@author tag. In this course, it is fine to use the date when the
file was written as the version information in the @version tag.
When using tags like @author and @version, make sure to put
them at the beginning of the line within the doc comment.
For the @author line be sure to list your user name (PID) as
well as your first and last name. Also, if you started off with a
default comment generated by the IDE (like the example above)
60. don't forget to replace the text inside the comment with your
own. The javadoc tool will use the very first sentence of your
comment as a one-sentence summary of your class, and will use
the entire text of your comment as the full class description.
Remember that if you just write regular comments, they won't
be recognized as "official" descriptive text for document
generation:
// This comment describes what this class does, but because it
// uses //, it won't be recognized as a JavaDoc comment.
public class UserProfile
. . .
{
. . .
}
Documenting a Method
You should place a descriptive JavaDoc comment just before
each method or constructor you write:
/**
* Move the robot forward to the next HTML heading.
*/
public void advanceToNextHeading()
{
. . .
}
As with other JavaDoc comments, make sure this appears just
before the method it describes. For methods that have
parameters, you should also include a brief description of what
each parameter means. For example, we might have a
UserProfile class that provides a setter method for its name:
/**
* Set the profile's name to the given value.
*
* @param newName The new name for this profile.
*/
public void setName(String newName)
{
61. . . .
}
Here, a @param tag has been used to give a description of the
meaning and use of the parameter. Use a separate @param tag
to describe each parameter in the method (or constructor). Be
sure to start these tags at the beginning of a comment line, and
group all of the tags with the same name together (i.e., all
@param tags should be next to each other).
Again, javadoc will take the first sentence in your comment as a
one-sentence summary of what the method does. The remainder
of the comment will be used in generating a full description of
the method.
Some methods have return values--that is, they give back
information to their caller. For example, a getName() method
might return a String containing the user profile's current name.
You can document what information is returned using a @return
tag:
/**
* Get this profile's name.
*
* @return This profile's name
*/
public String getName()
{
. . .
}
Generating Your Documentation
Within an Eclipse project, you can use the Project->Generate
Javadoc... command to generate full documentation for your
own project straight from your source code. Click Next twice,
and in the final screen check to "Open generated index file in
browser" near the bottom. Once complete, a new tab will open
showing all of the generated documentation for your classes.
Other Comments in Your Code
JavaDoc comments are "public" documentation of the externally
accessible features of your classes. Often, you may also wish to
62. include "internal" (that is, private) documentation that is only
useful to someone reading the source code directly. Any
comment that does not begin with /** is treated as private,
purely for someone with access to the source code. You are free
to use such comments where ever you like to improve the
readability of your code, but ...
Internal Comments Are the Documentation Technique of Last
Resort
Choose all names carefully so that a naïve reader's first
interpretation will always be right. Do not choose names that
might mislead someone about what a method is supposed to do,
or what information a variable holds. Choosing poor names or
convoluted logic structure and then trying to explain it in
lengthy comments does little to improve readability. This is
doubly true for methods, because half the time a reader will see
your method name where it is called, not when they are reading
your method itself. If it is not immediately clear what the
method should do, that affects the readability of all the code
calling this method, no matter how many comments you put in
the method itself.
Strive to write code that is clear and understandable on its own,
simply by virtue of the names you have chosen and the structure
you use. If you feel you have to add an internal comment to
explain something, ask yourself what needs explaining. If you
need to explain what a name refers to or how you intend to use
it, consider choosing a better name. If you have to explain a
complex series of if statements or some other convoluted
structure, ask yourself (or a TA) if there is a better way. Only
after considering these alternatives should you add descriptive
comments.
Redundant Comments Are Worse Than No Comments
Consider these comments:
user = new UserProfile(); // Create a new user profile
x = x + 1; // Add one to x
63. user.setName("Ben"); // change the profile name
These are examples of useless comments. Many students add
comments to their code just to "make sure everything is
documented," or because they believe copious comments are
what the instructor is looking for. Comments like this just get in
the way of reading the code, however. You should only add
comments when they express something that isn't already
evident from the code itself. Comments are more information
that the poor reader has to wade through, so you need to
carefully balance their benefits against the cost of having to
read them. This reader might be - and often will be - you, so a
good mental model to adopt is that you are writing comments as
messages to your future self. This future you will be more
experienced than the current you when it comes to
programming, but will have forgotten the details of the code
written even a week ago. You should write your comments with
an eye towards minimizing the mental effort this future you has
to expend to be able to understand and maintain your code.
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Implementation-Title: Tetris 5044
Permissions: sandbox
Codebase: *
JavaFX-Version: 8.0
Class-Path:
Created-By: JavaFX Packager
64. Implementation-Vendor:
Main-Class: edu.vt.cs5044.tetris.Tetris5044
edu/vt/cs5044/tetris/AI.classpackage edu.vt.cs5044.tetris;
publicabstractinterface AI {
publicabstract Placement findBestPlacement(Board, Shape);
publicabstract int getMaximumBlockHeight(Board);
publicabstract int getTotalBlockCount(Board);
publicabstract int getTotalGapCount(Board);
publicabstract int getColumnHeightVariability(Board);
}
edu/vt/cs5044/tetris/Board.classpackage edu.vt.cs5044.tetris;
publicsynchronizedclass Board {
publicstaticfinal int WIDTH = 10;
publicstaticfinal int HEIGHT = 24;
publicstaticfinal int HEIGHT_LIMIT = 20;
privatefinal java.util.Set blockSet;
public void Board();
Board getCopy();
publictransient void Board(String[]);
private boolean isCollision(Piece, Coordinate);
public boolean isBlockAt(int, int);
public Board getResultBoard(Shape, Placement);
void clear();
boolean isValidMove(Placement, Piece);
java.util.Set getBlockSet();
void addBlocks(java.util.Set);
private boolean isRowFilled(int);
private void shiftRowsDownTo(int);
65. int clearRows();
public String toString();
public boolean equals(Object);
public int hashCode();
}
edu/vt/cs5044/tetris/Box$1.classpackage edu.vt.cs5044.tetris;
synchronizedclass Box$1 extends
javafx.beans.binding.ObjectBinding {
void Box$1(Box);
protected Number computeValue();
}
edu/vt/cs5044/tetris/Box$2.classpackage edu.vt.cs5044.tetris;
synchronizedclass Box$2 extends
javafx.beans.binding.ObjectBinding {
void Box$2(Box);
protected Number computeValue();
}
edu/vt/cs5044/tetris/Box$3.classpackage edu.vt.cs5044.tetris;
synchronizedclass Box$3 extends
javafx.beans.binding.ObjectBinding {
void Box$3(Box);
protected Number computeValue();
}
edu/vt/cs5044/tetris/Box.classpackage edu.vt.cs5044.tetris;
synchronizedclass Box extends javafx.scene.shape.Rectangle {
privatefinal Coordinate coord;
privatefinal GameManager manager;
void Box(GameManager, Coordinate);
66. Coordinate getCoordinate();
}
edu/vt/cs5044/tetris/Coordinate.classpackage
edu.vt.cs5044.tetris;
finalsynchronizedclass Coordinate {
privatefinal int x;
privatefinal int y;
static Coordinate at(int, int);
private void Coordinate(int, int);
int getX();
int getY();
Coordinate shiftLeft();
Coordinate shiftRight();
Coordinate shiftUp();
Coordinate shiftDown();
Coordinate relativeTo(Coordinate);
public String toString();
public boolean equals(Object);
public int hashCode();
}
edu/vt/cs5044/tetris/GameManager$1.classpackage
edu.vt.cs5044.tetris;
synchronizedclass GameManager$1 {
static void <clinit>();
}
edu/vt/cs5044/tetris/GameManager.classpackage
edu.vt.cs5044.tetris;
synchronizedclass GameManager {
privatefinal javafx.scene.layout.Pane gamePane;
privatefinal javafx.scene.layout.Pane innerPane;
74. interface package-info {
}
Project 3 - Play Tetris
Overview
Tetris (Links to an external site.)Links to an external site. was
arguably the most popular single-player computer game of all
time by the early 1990's. It's incredibly simple and fun to play,
and even to this day it's widely considered to be among the best
games of all time.
In case you've never seen it, the game consists of a 10-unit wide
by 24-unit tall well, into which randomly-selected geometric 4-
unit pieces begin to fall one at a time. The player manipulates
each piece as it falls, by moving it horizontally within the well,
and rotating it in 90° increments. Once the piece can fall no
further, it becomes locked in place, taking up space in the well.
However, if the player forms one or more full horizontal (10-
unit by 1-unit) rows, those rows are removed, with all rows
above shifting downward. The goal is to continue playing as
long as possible, so the player must attempt to pack the pieces
strategically. Eventually, though, the well fills upward to a
limit line, and if any portion of a piece is locked in place above
this line, the game is over.
You'll see all of this in action soon enough, and it's actually
quite easy to understand once you've played it for just a few
minutes.
Requirements
Building a full-functional Tetris application requires a little
more Java than what we've covered yet this term, so you'll be
provided a working application that you can download and
play. It's a somewhat simplified version, with a very
rudimentary scoring mechanism, but it's still just as enjoyable
and challenging as the original.
So, if the application is already provided, what is this
assignment all about? The goal here is to develop a basic
75. Artificial Intelligence ("AI") system, capable of controlling the
game as if it were the player.
Implementing an Interface
In previous assignments, you were given a class file with
method declarations, Javadoc comments, and placeholder
implementations. In this assignment, you'll be given an
interface instead. An interface contains the method declarations
and the Javadoc comments, but no code at all (not even
placeholders). Your task is to implement this interface, which
means you'll develop a class that provides code for all the
methods declared in the interface. In addition to the methods
specified by the interface, you will likely need to develop
several private helper methods in order to fully implement it
without redundancies.
System Description
The interface you will implement is called
edu.vt.cs5044.tetris.AI and your implementation class must be
called edu.vt.cs5044.TetrisAI. You will need to develop the
code needed to implement the methods defined by the interface.
One of the methods will be the overall AI system. This method
receives some parameters, defining the current state of the game
board and the shape to be placed, and will need to find the
"best" placement for that shape. The other methods are
responsible for intermediate calculations. These methods would
normally be private, and not specified by the interface, but for
academic purposes we're exposing these methods to ease the
testing requirements. Speaking of tests, your JUnit test file
must be called edu.vt.cs5044.TetrisAITest.
Downloads
tetris5044.jar library file containing all the compiled game
engine classes
tetris5044-api.jar library file containing the Javadocs for the
game engine
Setting up Eclipse
76. Download the provided files to your computer, and place them
in a convenient folder. Open Eclipse and create a new Java
Project for this assignment. Right-click the project and select
Build Path | Configure Build Path, then select the Libraries tab.
Click Add External JARs and navigate to where you placed the
downloaded JAR files, select tetris5044.jar, and click OK. You
should now see that file listed just above the JRE System
Library. Now click the little triangle to expand the new file,
select Javadoc location: (None), and click the "Edit..." button.
Here be sure to select "Javadoc in archive" first, then click
Browse. Navigate again, this time selecting tetris5044-api.jar,
and click Validate. It should tell you the location is likely
valid, so click OK, then OK, then OK to get back to your
project. Your should see a new Referenced Libraries section,
which you can expand to see the tetris5044.jar file.
Shall We Play a Game? (better than tic-tac-toe)
At this point, you can right-click your project and select Run As
| Java Application to play Tetris! Go ahead and try it now...
A window should appear with an empty game board and a
prompt to type P to play. Once you type P, you will see a new
random piece near the top, slowly falling toward the bottom of
the well. There are several alternative keyboard controls you
can use, but for now just type J and L to move the piece left and
right, and type I to rotate the piece. Once the piece is situated
as you wish, you can use K or the space bar to drop the piece
immediately, or you can just enjoy watching the piece fall
gently into place.
Zombie (brains?)
You can type '?' into the game at any time to produce a listing
in the Eclipse console of all of the available options and
keyboard controls. Some of these options will be extremely
useful during the assignment. Try that now. You'll probably
notice some interesting options, including a way to enable the
Player AI by typing Ctrl-P. When you enable this mode, just
before a new shape appears in the game, the AI is asked how to
77. best rotate then position the shape. Go ahead and attempt that
now. Nothing will happen, except you'll see a warning in the
console that your implementation couldn't be found, which is
perfectly understandable at this point.
Trying to Take Over the World (no, not that Brain)
Close the game for a moment now, while we get some of the
basics for the code in place. First, create a new package in your
src folder called edu.vt.cs5044 then right-click within that
package select New Class. Before you enter the class name,
click the "Add..." button to the right of the Interfaces section.
In the search box at the top, type AI and you should soon see
the AI interface (in the edu.vt.cs5044.tetris package) selected.
Click Ok to add that interface, and now you can enter the class
name TetrisAI and click Finish.
Notice that the new file declaration says public class TetrisAI
implements AI. This is what tells Java that we intend to be
compatible with any system that can work with the AI
interface. You'll also notice Eclipse is already showing an error
on the class declaration line. Click the tiny red X in the margin
and double-click "Add unimplemented methods" from the pop-
up. This asks Eclipse to generate all the method placeholders
for you! Save the file, and check out your implementation. It's
already compatible with the game system, even though all it
does is return placeholders. That's not very useful, of course,
but it's actually enough to get started. Let's see if it's
recognized by the game engine.
Launch the application again, type Ctrl-P to activate the Player
AI, and confirm that the console says the Player AI is now on.
If so, go ahead and type P to start the game. Well, that's not
very exciting. The console just keeps saying that the AI
selected an invalid move for each shape, and we still have to
manually place the pieces. That's fair enough, since all we have
are placeholders that Eclipse generated for us, but at least we
know the game found our AI and seems to be communicating
with it. Close the game again now so we can code a little more.
78. Let's at least provide a valid suggestion, even if it's always
exactly the same suggestion. In the findBestPlacement()
method, let's replace the placeholder:
return null;
with this:
return new Placement(Rotation.NONE, 0);
Eclipse will complain that it doesn't know about the Rotation
class yet, so again click the tiny X in the margin and double-
click to import the Rotation class from the edu.vt.cs5044
package. That should resolve the error, so save your file again.
This really doesn't seem like much of an improvement, but we'll
try it anyway.
Launch the game and use Ctrl-P then P to check it out. So, now
it's just placing everything against the left edge (column 0)
without any rotation, which is still fairly lame, but it's clear that
our AI is actually placing the pieces automatically for us!
Things can only get better from here. Close the game once
you're ready to code again.
Need More Input (accidental AI, maybe)
Obviously we need to examine the shape and the state of the
board in order to make some reasonable decisions. Let's take a
look at all those Javadocs that make up the API. In your source
file click within the word AI of "implements AI" and type Shift-
F2. This should open the Javadocs for the AI interface using an
internal browser within Eclipse. You can set it to use an
external browser, if you prefer, but this is fine for now.
Reading the Javadocs, click the findBestPlacement() method
and you'll see it actually provides a brief outline of a strategy.
We apparently need to iterate over each possible rotation, and
for each rotation we need to iterate over every possible column
placement. For each of these, we need ask the Board object to
tell us what the result of any hypothetical move would be.
Click the method Board.getResultBoard() to see how that
works. The Javadocs say that the original board instance is not
modified, and we'll get a new board instance that we can
79. examine.
That will meet our needs, but how do we examine one of these
hypothetical results? There are only a few other methods
available in the Board class. One provides a human-readable
rendering of the board, which might prove very useful to
visualize what's happening while debugging, and another
promising method seems to let us query any location within the
board to see which locations are occupied by fixed blocks.
There are also some static constants that tell us the overall size
of the board, plus two constructors. One of the constructors
allows us to generate arbitrary board configurations, which is
exactly what we'll need in order to create some nice test cases.
Click the Package link at the very top of any Javadoc page to
see the package overview, then navigate throughout the various
pages to see what each class and enum can do, along with the
requirements for the interface. A fundamental part of this
assignment is to learn how to use Javadocs to explore unknown
libraries, as well as to see how a somewhat larger scale system
is divided into multiple classes, each with its own purpose.
Note that class Tetris5044 is for internal use only; you won't
need it at all. Also, classes RandomMode and ShapeStream are
only needed for the optional "challenge" section below.
Strategy Games
There's no such thing as a perfect Tetris strategy, so we won't
even try. We are necessarily taking the heuristic (Links to an
external site.)Links to an external site. approach to this
problem, and there will necessarily be trade-offs involved. In
every placement decision, there are advantages and
disadvantages. How can we hope to find the "best" placement?
Now is probably a good time to look at those other methods in
the interface.
Costs and Benefits
From the API, it seems the remaining methods of the interface
are related to making some measurements to evaluate a board
position. The idea here is that we'll compute four distinct
80. "cost" scores, or factors, which tell our system something about
how bad (or good) a particular placement might be. We'll need
to develop those method first, before we can hope to have a
working AI system.
We're still focusing on TDD, so start with some fairly
straightforward test cases to ensure the individual scoring
methods work. Just construct a test board object, then assert
the cost score you expect your implementation to compute.
Once all of your individual cost scoring methods are working
properly as expected, its time to put it all together. The
findBestPlacement() method will need to iterate through all the
possible placements, and for each it will combine these
individual cost scores in a weighted sum, then choose the lowest
cost to return to the game engine. The weightings are important
so that certain factors can have more influence on the overall
decision than others. At first you can just set all the weights to
1, by simply summing the individual scores together, even
though eventually we'll need to adjust the weights to achieve
better results.
Strategic Default
Luck plays a starring role in Tetris. Even with the best of
strategies, it's critical to recognize that some games simply
provide a more fortunate sequence of shapes than others. Thus
it can be difficult to objectively judge exactly how good a
particular strategy might be. To help with this, our
implementation provides a set of 4 repeatable test sequences we
can use as a benchmark. The average number of pieces placed
from these 4 test sequences will act as a very reasonable metric
of how well our strategy is working overall.
Teaching to the Test
Eventually we'll be making a linear combination of our four
scores, which just means we multiply each score by some
weight, then add the weighted scores. The equation is very
straightforward:
overallCost = weight1*score1 + weight2*score2 +
weight3*score3 + weight4*score4
81. Computing the individual scores really isn't too bad, but what
about the weights? As noted above, we can start by simply
setting all the weights to 1, and indeed that strategy will place
an average of just above 100 pieces for each of the provided test
sequences.
Standards of Learning
Can we do better? Sure! As a start, reasonable weight ranges
for the selected factors will be 0 through 15. You can just use
trial-and-error if you wish; watch your AI play the test games
and try to figure out which factors need more or less emphasis.
For example, if your AI is creating too many unnecessary gaps,
try to increase the weight of the gap count score. Be sure to use
Turbo mode and all the Random TEST modes.
Your AI must be able to place at least 200 pieces, on average,
across the provided test sequences. Try adjusting your weights
in increments of 5, meaning weight values of 0, 5, 10, and 15.
Of the 256 possible combinations of 0, 5, 10, and 15 as weights,
about 10% will result in this level of performance. You don't
need to provide a JUnit test to demonstrate this performance,
but Web-CAT will check whether your system meets this
minimum or not.
More than Full Coverage
Unlike in the previous assignment, creating JUnit tests to cover
all of your code will be very straightforward, since there aren't
very many branches involved in the solution. You can likely
achieve full coverage with just one well-designed test case that
asserts something about each method. As a result, complete
coverage is not nearly enough to ensure you have correctly
implemented your code. Therefore, you must generate at least 5
test cases for each interface method, with non-trivial tests and
non-trivial assertions. You can satisfy this by creating at least
5 distinct test boards to be shared among assertions involving
all methods. Just be sure the test boards cover a reasonably
wide range of scenarios. Note that Web-CAT won't (and can't)
enforce this requirement, but the human grader will definitely
be looking for this.
82. Functional Decomposition
Judicious use of helper methods can significantly reduce the
overall amount of code you need to develop. For example, you
might want to create a helper method that returns the height of
one specified column. You can then call that method from
within a loop of all columns, and use the return value to help
compute some of the cost factors your. Your code will be
inspected during the human review for redundancies, so be sure
to develop helper methods wherever appropriate.
Automating the Automation
You might have noticed that it can get somewhat tedious to try
every combination of 0, 5, 10, and 15 for each of the weights,
even in Turbo mode. You might have also noticed that you've
been given sufficient tools to run entire simulated games
without the user interface at all.
As a challenge, see if you can identify the very best
combination of 0, 5, 10, and 15 weights, by writing a separate
class file called edu.vt.cs5044.WeightFinder with its own
main() method. This file will be completely ignored by Web-
CAT, and you don't need to generate any tests for it at all.
You'll also need to add a public method, such as setWeights(int
w1, int w2, int w3, int w4) to your TetrisAI implementation, to
apply the various weight combinations. This method will need
to be exercised by a single assert, just to be sure it's covered
within your own JUnit tests.
Once you've found the optimum combination, you'll need to
hard-code those values back into your AI as the defaults, in
order to watch them in action. The best weights among these
combinations will place an average of over 480 pieces for the
test sequences. That's quite an improvement, unless you
happened to get very lucky in your trial and error phase!
Confirm that this is all working as expected, and that you're
placing 480+ pieces on average for the test sequences before the
next part of the challenge. It should be a simple change to your
code to try stepping by 3 instead of 5 (meaning you should test
every combination of 0, 3, 6, 9, 12, and 15 for every weight).
83. This process takes about 5-10 times longer to run than stepping
by 5. However, if everything was already working properly,
you'll only need to do this once, and you'll discover that your
newly-tuned weights will average over 1,900 pieces placed for
the test sequences. We'll call that a definite win!
Still not satisfied? You can always try stepping by 1 instead.
Again it's a trivial code change, but note that this process takes
about 50-100 times longer to run than stepping by 3, so we're
likely talking about a few hours at this point. However, your
newly-optimized AI possess the astonishing capability of
averaging over 6,100 pieces placed for the test sequences! You
might be somewhat amazed when you discover the optimum
weightings. Also, you're in for a bit of a surprise when you
watch this in action, specifically comparing the results of the
TEST1 sequence to those of the TEST2 sequence.
If you make any progress with this OPTIONAL challenge,
please add a brief write-up in the comments of your
WeightFinder class, just to let us know what you did, along with
any thoughts you'd like to share about the experience. Of
course you may also discuss this in Piazza, although please
don't post your code (or any weightings you find) to the entire
class, so as not to spoil the fun for anyone else.
Hopefully you enjoyed this challenge!
Submit to Web-CAT
Submit your solution to Web-CAT (Links to an external
site.)Links to an external site. via Eclipse or the web interface.
Please feel free to improve and resubmit your code as many
times as you like (before the deadline) in order to improve your
score.
Important Notes:
· Your submission will be evaluated both by Web-CAT (40
points) and by human (40 points). As such, Web-CAT's
automated score will show at most 40/80 points.
· Your JUnit test class will be evaluated by Web-CAT to ensure
complete coverage of you implementation code, but it will NOT
be evaluated for style. Web-CAT will also use its own internal
84. test suite (that we've developed) to evaluate your system.
· Carefully review your feedback. In the summary, you will see
a table listing each of your source files with a green/red bar by
each non-test file. If the bar for any file is not completely
green, then some code in that file was not exercised by your
own tests. Click the file name to view your source code and
look for lines that are highlighted in a pink color. Hover your
mouse over highlighted lines for additional information. You
will need to add at least one test case to exercise the highlighted
code. This includes testing the same actions you've already
tested, but starting from different initial conditions.
· See the program grading rubric for full details on the grading
criteria applied to this assignment.
CS 5044
Object-Oriented Programming with Java
Q&A Session
Midterm Exam
• Exam is split into three parts, all due Monday (7/3) at noon ET
– Each part has a 30 minute time limit for 20 multiple-choice
questions
– Each part covers a cross-section of all materials from Module
1 through Module 5
– See also Piazza @166 (and posts linked from there) for a few
more details
85. Project 3 - Play Tetris
• Tetris!
– We've been tasked to develop an artificial intelligence (AI)
that can play Tetris
• An "interface" has been provided; you will implement the
interface
– We'll learn more about interfaces in several weeks, but for
now:
• An interface is just a way in Java to specify required methods,
without any code
• To implement the interface, we develop a class with actual
code in these methods
– Eclipse can generate the placeholder methods for us
automatically
• Once that's done, it becomes just like our previous projects
• Plus, the compiler will ensure we don't accidentally change
the method headers
Meet the Cast of Players
• enum Shape
– One value for each of the seven geometric pieces involved:
– Each Shape provides a set of distinct Rotation values (default
orientations shown above)
– You can also request the width of the shape (in blocks) after
applying any valid Rotation
• enum Rotation
– One value for each 90° rotation:
86. • NONE
• CCW_90
• CCW_180
• CCW_270
Game On
• class Placement
– A Placement just holds a Rotation value and a column number
together
– This is what our AI needs to return to the game engine, for
any Shape:
• First the Rotation will be applied to the Shape
• Then the rotated Shape will be moved horizontally
– The left-most block will be placed in the specified column
– Invalid Placement objects will be rejected (and ignored) by
the game engine
• class Board
– Represents the state of the playing board at any given time
– Provides static int values: WIDTH, HEIGHT, and
HEIGHT_LIMIT
– Contains a collection of fixed blocks; allows us to query via
isBlockAt(col, row)
– We can ask the board to show us the hypothetical result of
placing another piece
• The piece will be placed and dropped, then any full rows will
be cleared
• Creates a new Board object; does not mutate the existing
Board
87. – We can also construct new Board objects with arbitrary blocks
for testing
• ShapeStream and RandomMode are only used for the optional
challenge
• Tetris5044 is for internal use only, by the game engine itself
Mind Games
• interface AI
– This is what we need to implement!
– public Placement findBestPlacement(Board currentBoard,
Shape shape)
• This is how the game engine asks our AI what to do
– The remaining methods need to compute "cost" factors for a
given board:
• int getColumnHeightVariability(Board board)
• int getMaximumBlockHeight(Board board)
• int getTotalBlockCount(Board board)
• int getTotalGapCount(Board board)
• Academic Note: Normally these would be private, and not
required by the interface
– The individual cost factor methods should be developed (and
tested!) first
– Once you've completed at least one cost factor method, to find
the best placement:
• For every possible placement of this shape
– Get the board that would result from this placement
– Calculate cost factors for result board and combine with
weights
– If this is the lowest overall cost so far, consider this
88. placement as the new best
• Return the best placement to the game engine
– Adjust the weights to meet minimum average performance
requirements in TEST modes