An Underscore Templates Primer
In April 2011, the jQuery team announced development on the popular jQuery Templates plugin would be delayed indefinitely. In need of a replacement, I began investigating alternatives and soon discovered Underscore, the “utility belt” library behind the awesome Backbone.js framework. The Underscore library includes an easy-to-use templating feature that easily integrates with any JSON data source, so read on to learn how easy it is to create JSON-backed templates.
Sending JSON data to a browser is outside the scope of this blog post, but, for reference, take a look at this collection of books:
[
{
"title":"Myst: The Book of Atrus",
"author":"Rand Miller"
},
{
"title":"The Hobbit",
"author":"J.R.R. Tolkien"
},
{
"title":"Stardust",
"author":"Neil Gaiman"
}
]
In this example, we’ll display this collection of books as a simple unordered list, but don’t let that stop you from experimenting!
The Template
First, we need to define our Underscore template, which we’ll do in a
If you’ve worked with tools like ASP.NET “WebForms” or Rails, you may recognize the “bee sting” operators (<%
and %>
), which Underscore uses to both output data to the rendered template and encapsulate behavior (as JavaScript). In this template, we first loop through the “books” collection (which we’ll define in the next section), pluck out each book as the loop progresses, and print out the
title and author of each as an unordered list item.
You’re free to inject as much JavaScript as you wish into your templates, but I find they’re most maintainable when the script is kept to a minimum (for me, this means mostly just loops and ternary operators, like the one below).
<% book.published ? print('(' + book.published + ')') : '' %>
(The print()
function is a handy alternative to the <%= %>
syntax for outputting values inside other functions, like we’re doing here.)
The Result
Now that we’ve defined our JSON source and the template for displaying our data, we need simply to tell Underscore to render the template and give us back the output HTML (using Underscore’s template()
function).
In our example, data
represents our JSON collection of books, but keep in mind your JSON data source may be named something different. We’ll tell Underscore to put this data inside the books
collection, which we’ve referenced in our template.
// Get the template's markup...
var tmplMarkup = $('#tmpl-books').html();
// ...tell Underscore to render the template...
var compiledTmpl = _.template(tmplMarkup, { books : data });
// ...and update part of your page:
$('#target').html(compiledTmpl);
Underscore kindly compiles the template with our well-formed data and produces the following output, ready for injection into our HTML page:

Myst: The Book of Atrus by Rand Miller

The Hobbit by J.R.R. Tolkien

Stardust by Neil Gaiman

Underscore’s templating feature quickly made its way onto my list of must-have tools for client-side Web development. Try your hand at a few JSON-backed templates using this versatile framework and it may appear on yours, as well.


And afterwards, directs the learner to...Oppia directs the learner to...
Please pick a card name consisting of alphanumeric characters, spaces and/or hyphens.
Refresher exploration ID (optional):
Refresher exploration id should be removed.
Prerequisite skill ID (optional):
Mention the skill that this state requires so that a learner who is stuck in the state can quickly learn the
required material and continue with the exploration.


Before Change
role = "Agency Staff",
)
ftable = s3db.pr_forum
forums = db(ftable.name.belongs(("Cases",
"Donors",
"Reserves"))).select(ftable.pe_id,
ftable.name,
)
for forum in forums:
if forum.name == "Cases":
add_membership(user_id = user_id,
role = "Cases Admin",
After Change
// Affiliate with Groups Forum to allow management by AGENCY & ORGADMINs
ftable = s3db.pr_forum
forum = db(ftable.name == "Groups").select(ftable.pe_id,
limitby = (0, 1)
).first()
try:
master = forum.pe_id
except AttributeError:
current.log.error("Unable to link Group to Groups Forum: Forum not Found")
return
s3db.pr_add_affiliation(master, realm_entity, role="Realm Hierarchy")


Book-A-Meal
Menus
New Menu
Manage Menu
Meals
New Meal
Manage Meals
Orders
Pending Orders
Order History
Order Summary
Welcome, Stephen
My Profile
Logout
☰
Add / Edit Meal
Meal Name
Meal Price ₦
Upload Image
Cancel


Enter the details of the person we should contact if we have questions about your licence application.
What role do they have in relation to your business?


The Program Educational Objectives (PEOs) of the Computer Engineering Department are as follows:
I.To prepare the students for successful professional careers in IT industry and higher studies by training them to adapt to the evolving technologies leading to excellence by providing strong fundamentals of mathematical, computing and engineering principles.
II.To provide an environment for students to work on multidisciplinary aspects of computer science to enhance their coordination and communication skills along with their team building capabilities like leadership, motivation and teamwork throughout their professional life.
III.To inculcate among students entrepreneurial skills, introduce them to professional ethics and codes of professional practice and create a sense of social awareness and responsibility in them.
IV.To provide students experience with the multifaceted aspects of using computers along with developing an eagerness for lifelong learning and adapting new knowledge for problem solving and develop professional application software(s) for some industry/society requirements by applying strong software engineering principles.
The Program Specific Outcomes (PSOs) of the Computer Engineering department are as follows:
PSO1.Graduates will be able to apply analytical skills to identify a problem and generate alternate solutions. They will be able to design the same by selecting appropriate Data Structures and Algorithms and implement them using structured and/or Object Oriented Programming skills along with advanced tools and techniques.
PSO2.Graduates will be able to analyze and design analog and digital systems meeting desired needs using both hardware and software components.
PSO3.Graduates will be able to apply effective communication skills and demonstrate professional and ethical skills to execute social responsibilities. They will be broadly educated to have an understanding of the impact of engineering solutions towards the environment and exhibit awareness on contemporary issues.
PSO4.Graduates will be able to identify and solve real time problems in distributed and interconnected environments by learning and adapting advanced concepts. They will be able to coordinate efficiently in teamwork with a strong entrepreneurial approach.
PSO5.Graduates will apply knowledge of applied mathematics, applied physics, applied chemistry, engineering drawing and mechanics, basic workshop practices, basic electronics and fundamentals of Computer Engineering in real time applications.
Program Outcomes (POs) for Computer Engineering are defined as follows:
The POs formulated for each program must be consistent with the Graduate Attributes mentioned in Washington Accord. Graduates Attributes (GAs) form a set of individually assessable outcomes that are the components indicative of the graduate's potential to acquire competence to practice at the appropriate level. The GAs are exemplars of the attributes expected of a graduate of an accredited program. The Graduate Attributes of the NBA are as following:
PO1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO2. Problem analysis: Identify, formulate, review research literature, and analyze complex engineering problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences.
PO3. Design/development of solutions: Design solutions for complex engineering problems and design system components or processes that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmental considerations.
PO4. Conduct investigations of complex problems: Use research-based knowledge and research methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions.
PO5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering and IT tools including prediction and modeling to complex engineering activities with an understanding of the limitations.
PO6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering practice.
PO7. Environment and sustainability: Understand the impact of the professional engineering solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development.
PO8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the engineering practice.
PO9. Individual and team work: Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings.
PO10. Communication: Communicate effectively on complex engineering activities with the engineering community and with society at large, such as, being able to comprehend and write effective reports and design documentation, make effective presentations, and give and receive clear instructions.
PO11. Project management and finance: Demonstrate knowledge and understanding of the engineering and management principles and apply these to one's own work, as a member and leader in a team, to manage projects and in multidisciplinary environments.
PO12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in independent and life-long learning in the broadest context of technological change.


New danger for corals in warming oceans: Metal pollution
| Source: | Cornell University |
| Summary: | Metal copper from agricultural runoff and marine paint leaching from boat hulls poses an emerging threat to soft coral sea fans in the waters around Puerto Rico. |
Metal copper from agricultural runoff and marine paint leaching from boat hulls poses an emerging threat to soft coral sea fans in the waters around Puerto Rico.
In a Cornell-led study, published in the journal Ecological Applications, scientists report evidence of metal pollution creating danger for the soft coral sea fans.
"We know warming oceans pose an existential threat to coral reefs around the world," said ecologist Allison Tracy, who conducted this work with Drew Harvell, professor of marine biology. "Action to alleviate the impact of warming oceans is a priority, but understanding the role of pollutants in coral disease and mortality gives us more options for solutions."
While plastics and microplastics are a well-known threat to the world's oceans, the effect of metal contamination is poorly understood, according to the researchers. Increased copper pollution can be a result of agricultural runoff and marine paint leaching from boat hulls.
Over a one-year period, the researchers tracked 175 individual sea fan colonies with varying levels of copper concentrations found in the sediment at 15 coral reef sites around Puerto Rico. They found that reefs with higher copper concentrations in the sediment suffered a reduction in recovery from multifocal purple spots disease — a disease that can plague the sea fans.
In the laboratory, Tracy found that sea fans initially launched an immune response to a damaging infection at low levels of copper and temperature stress. But when copper concentrations were boosted, sea fans' immune response failed, which suggests that copper stressed the sea fans and eliminated their immune potential, she said.
"The patterns we saw in immune markers are important because they show a mechanism through which copper and warming oceans can impair the corals' health," Tracy said.
This research supplied novel data on the role of environmental stressors in coral disease and may provide a toolkit for combatting coral disease on a local scale.
"We can't manage the climate damage to coral reefs until we better understand how pollution and disease magnify the impacts of heat stress," Harvell said. "Although healthy corals in thriving ecosystems also experience low levels of disease, the concern is that changing ocean conditions and increased pollution have led to increased disease outbreaks. As a result, corals may be losing the battle with their pathogens as ocean stressors tip the balance in favor of disease."
make a difference: sponsored opportunity
Story Source:
Materials provided by Cornell University.
Note: Content may be edited for style and length.
Journal Reference:
- Allison M. Tracy, Ernesto Weil, C. Drew Harvell. Warming and pollutants interact to modulate octocoral immunity and shape disease outcomes. Ecological Applications, 2019; DOI: 10.1002/eap.2024
Cite This Page:
| MLA | Cornell University. "New danger for corals in warming oceans: Metal pollution." ScienceDaily. ScienceDaily, 19 November 2019. <www.sciencedaily.com/releases/2019/11/191119161457.htm>. |
| APA | Cornell University. (2019, November 19). New danger for corals in warming oceans: Metal pollution. ScienceDaily. Retrieved November 20, 2019 from www.sciencedaily.com/releases/2019/11/191119161457.htm |
| Chicago | Cornell University. "New danger for corals in warming oceans: Metal pollution." ScienceDaily. www.sciencedaily.com/releases/2019/11/191119161457.htm (accessed November 20, 2019). |


Week One
Discussion
I can't help but wonder how technology is the one thing that can always evolve yet we can't find solutions to all the problems going on in the world. For that reason I have illustrated each webpage dedicated to on-going issues that are either the child of climate change, the reason behind it or issues that we continously face dailys. Along with that I will link some sort of data visualisation website that will show users clearly how bad the effect really is. I want to use technology as a means of showing what is truly going on in this world rather than focusing on the different ways of achieving a certain number of likes and followers on a platform that will eventually seize to exist.
go to home page


source = (JSlider)evt.getSource() ; if ( !source.getValueIsAdjusting() ) { if ( source.getName()().equals("sliderA") ) textA.setText( source.getValue() + " " ); if ( source.getName()().equals("sliderB") ) textB.setText( source.getValue() + " " ); }
For fun, modify the previous program to see the result of this patch.
Here are a few other sometimes useful methods from
class JSlider
.
For additional discussion go to
How to Use Sliders in Sun's on-line Java Tutorial.
int getMaximum() // Returns the maximum value supported by the slider.
int getMinimum() // Returns the minimum value supported by the slider.
These two methods are useful when the application methods must scale their output proportional to the possible range of values.
void setInverted(boolean b) //Set to true to reverse the order of values on the slider
This method with a horizontal slider makes the values ascend going from right to left (the revers of the usual order).


| Interface | Description |
|---|---|
| GraphCloneable |
Implemented by objects in an object graph that support graph cloning, i.e., deep copies without
duplicates and preserving reference topology.
|
| Predicate |
A boolean predicate.
|
| PrimitiveSwitch<R> |
Visitor pattern interface for
Primitive s. |
| Class | Description |
|---|---|
| EnumUtil |
Utility methods for
Enum s. |
| GraphCloneRegistry |
A registry for copies of
GraphCloneable objects used during graph cloning operations. |
| IdGenerator |
Registry of unique IDs for objects.
|
| MethodAnnotationScanner<T,A extends Annotation> |
Scan a class hierarchy for annotated methods in an override-aware manner.
|
| ObjectComparator |
A
Comparator that creates a stable, total ordering of all Java objects. |
| Primitive<T> |
Simple utility enumeration for working Java
Class instances representing primitive types (including void ). |
| PrimitiveSwitchAdapter<R> |
Adapter class for
PrimitiveSwitch implementations. |
| ProcessRunner |
Handles external process I/O and async execution.
|
| SerializableMethod |
Wrapper that makes a
Method Serializable . |
| ThreadLocalHolder<T> |
Manages a thread local whose lifetime matches the duration of some method call.
|
| ThreadParkingLot |
A place for threads to be parked and unparked.
|
| TimedWait |
Utility class for performing timed waits on objects.
|
| Enum | Description |
|---|---|
| ErrorAction |
Enumeration of possible actions to take when an error of some kind is detected.
|
| Exception | Description |
|---|---|
| CheckedExceptionWrapper |
Wraps checked exceptions so they can be thrown across API methods that don't declare them.
|
Copyright © 2019. All rights reserved.


Weekly Newsletter
Monday, October 24, 2016
Waves crashing over an experimental sea wall built to protect homes during high tide in Isle of Palms, S.C., last year.
President Obama’s effort to reduce carbon emissions by coal-burning power plants could be undone when President-elect Donald J. Trump takes office in January.
Researchers are investigating whether dogs share the more complex kind of memory like humans and a few other animals.
Two adult female rhesus macaques. A new study investigated the role of social status on health in the primates.
A bloom of algae near Wrangel Island in the Arctic Ocean. The ocean’s levels of algae have rapidly increased.
The 18 mirrors that make up the heart of NASA’s James Webb Space Telescope, at the Goddard Space Flight Center.
David Kaiser, is a fifth-generation Rockefeller and the head of a family fund fighting Exxon Mobil.
Part of the work at the Flatiron Institute involves complicated numerical simulations of exploding stars, as shown here.
Scans that illustrate the differences in three brains: a person who’s brain is healthy, left, one with mild cognitive impairment, center, and one with Alzheimer’s disease.
© Georgia Institute of Technology


Syllabus
Introduction to Data Science (Fall 2020)
CS 109a, AC 209a, Stat 121a, or CSCI E-109a
Course Heads
Pavlos Protopapas (SEAS), Kevin Rader (Statistics), & Chris Tanner (SEAS)
Instructor: Eleni Kaxiras (SEAS)
Lectures: Mon, Wed, Fri at 9am-10:15am and 3pm-4:15pm
Sections: Fri 1:30-2:45 pm and Mon 8:30-9:45 pm. (identical material) [starts 9/11]
Advanced Sections: Wed at 12pm [starts 9/23]
Office Hours: (TBD)
Format: Exclusively online, but we aim to foster enriching interactions and collaboration as much as possible.
Prerequisites: You are expected to have programming experience at the level of CS 50 or above, and statistics knowledge at the level of Stat 100 or above (Stat 110 recommended). HW #0 is designed to test your knowledge on the prerequisites. Successful completion of this assignment will show that this course is suitable for you. HW #0 will not be graded but you are required to submit.
Welcome to CS109a/STAT121a/AC209a, also offered by the DCE as CSCI E-109a, Introduction to Data Science. This course is the first half of a one‐year course in data science. The course focuses on the analysis of messy, real-life data to perform predictions using statistical and machine learning methods.
Throughout the semester, our content continuously centers around five key facets:
1. data collection ‐ data wrangling, cleaning, and sampling to get a suitable data set;
2. data management ‐ accessing data quickly and reliably;
3. exploratory data analysis – generating hypotheses and building intuition;
4. prediction or statistical learning; and
5. communication – summarizing results through visualization, stories, and interpretable summaries.
Only one of CS109a, AC209a, or STAT121a can be taken for credit. Students who have previously taken CS109, AC209, or STAT121 cannot take CS109A, AC 209A, or STAT121A for credit.
Course Components
The lectures will be live-streamed and can be accessed through the Zoom section on Canvas. Video recordings of the live stream will be made available within 24 hours after the event, and will be accessible from the Lecture Video section on Canvas.
Lectures
The class meets, virtually, three days a week for lectures (M, W, F). The same lecture will be given twice each day: once in the morning and again in the afternoon, to accommodate students in different time zones. Mondays and Wednesdays will be mostly lecture content with some hands-on coding, whereas Fridays will be the inverse (mostly hands-on coding). Attending and participating in lectures is a crucial component of learning the material presented in this course.
What to expect
A lecture will have the following pedagogy layout which will be repeated:
- Asynchronous pre-class exercises of approxmately 30 min. This will include, reading from the textbooks or other sources, watching videos to prepare you for the class.
- Approx. 10 minutes of Q&A regarding the pre-class exercises and/or review of homework and quiz questions.
- Live online instruction followed by a short Q/A session
- Hands-on exercises, on the ED platform. Sessions will help students develop the intuition for the core concepts, provide the necessary mathematical background, and provide guidance on technical details. Sessions will be accompanied by relevant examples to clarify key concepts and techniques.
Quizzes
At the end of each lecture, there will be a short, graded quiz that will cover the pre-class and in-class material; there will be no AC209a content in the quizzes. The quizzes will be available until the next lecture.
25% of the quizzes will be dropped from your grade.
Exercises
Lectures will include one or more coding exercises focused on the newly introduced material; there will be no AC209a content in the exercises. The exercises are short enough to be completed during the time allotted in lecture but they will remain available until the beginning of the following lecture to accomodate those who cannot attend in real time.
25% of the exercises will be dropped from your grade.
Sections
Lectures are supplemented by sections led by teaching fellows. There are two types of sections:
Standard Sections :
This will be a mix of review of material and practice problems similar to the HW. The material covered on Friday and Monday is identical.
Advanced Sections
The course will include advanced sections for 209a students and will cover a different topic per week. These are 75-min lectures and will cover advanced topics like the mathematical underpinnings of the methods seen in lecture and hands-on exercises, along with extensions of those methods. The material covered in the advanced sections is required for all AC209a students.
Note: Sections are not held every week. Consult the course calendar for exact dates.
Exams
There are no exams in this course.
Projects
Students will work in groups of 2-4 to complete a final group project, due during the Exams period. See Calendar for specific dates.
Homework Assignments
There will be 9 graded homework assignments. Some of them will be due one week after being assigned, and some will be due two weeks after being assigned. You have the option to work and submit in pairs for all the assignments except HW4 and HW7, which you will do individually.
You will be working in Jupyter Notebooks, which you can run in your own environment or in the SEAS JupyterHub cloud.
Instructions for Setting up Your Environment
Instructions for Using JupyterHub
On weeks with new assignments, the assignments will be released by Wednesday 3pm.
Standard assignments are graded out of 5 points.
AC209a students will have additional homework content for most assignments worth 1 point.
Instructor Office Hours
Pavlos: (TBD)
Kevin: (TBD)
Chris: (TBD)
Eleni: (TBD)
Participation
Students are expected to be actively engaged with the course. This includes:
- Attending and participating in lectures (or the follow-up session later in the day)
- Making use of resources such as office hours and sections
- Participating in the Ed discussion forum — both through asking thoughtful questions and by answering the questions of others
Despite being remote, we aim to make this course as interactive, stimulating, and fun as always, and we rely on each of you to contribute your awesome uniqueness.
Recommended Textbook
An Introduction to Statistical Learning by James, Witten, Hastie, Tibshirani.
The book is available here:
Free electronic version: http://www-bcf.usc.edu/~gareth/ISL/ (Links to an external site).
HOLLIS: http://link.springer.com.ezp-prod1.hul.harvard.edu/book/10.1007%2F978-1-4614-7138-7
Deep Learning, Vol. 1 & 2: From Basics to Practice by Andrew Glassner
Deep Learning by Ian Goodfellow and Yoshua Bengio and Aaron Courville (MIT Press, 2016)
Course Policies
Getting Help
For questions about homework, course content, package installation, JupyterHub, and after you have tried to troubleshoot yourselves, the process to get help is:
1. Post the question in Ed and get a response from your peers. Note that in Ed questions are visible to everyone. The teaching staff monitors the posts.
2. Go to Office Hours; this is the best way to get direct help.
3. For private matters send an email to the Helpline<EMAIL_ADDRESS>The Helpline is monitored by the teaching staff.
4. For personal and confidential matters send an email to the instructors.
Collaboration Policy
We expect you to adhere to the Harvard Honor Code at all times. Failure to adhere to the honor code and our policies may result in serious penalties, up to and including automatic failure in the course and reference to the ad board. If you work with a partner on an assignment make sure both parties solve all the problems. Do not divide and conquer. You are expected to be intellectually honest and give credit where credit is due. In particular:
- if you work with a fellow student but decide to submit individual assignments, include the name of each other in the designated area of the submission.
- if you work with a fellow student and want to submit the same assignment, you need to form a group prior to the submission. Details in the assignment. Remember, not all assignments will permit group submissions.
- you need to write your solutions entirely on your own or with your collaborator (e.g., not entirely from Google search results)
- you are welcome to take ideas from code presented in lecture or section, but you need to change it, adapt it to your style, and ultimately write your own. We do not want to see code copied verbatim from the above sources.
- if you use code found on the internet, books, or other sources you need to cite those sources.
- you should not view any written materials or code created by other students for the same assignment;
- you may not provide or make available solutions to individuals who take or may take this course in the future.
- if the assignment allows it you may use third-party libraries and example code, so long as the material is available to all students in the class and you give proper attribution. Do not remove any original copyright notices and headers.
Late or Wrongly Submitted Assignments
There are no late days in homework submission. We will accept late submissions only for medical (if accompanied by a doctor's note) or other official University-excused reasons.
To submit after Canvas has closed or to ask for an extension, send an email to the Helpline with subject line "Submit HW1: Reason=the flu" replacing 'HW1' with the name of the current assignment and "the flu" with your reason. You need to attach the note from your medical provider otherwise we will not accept the request. Email the instructors if you have other University-excused reasons.
If you forgot to join a Group with your peer and are asking for the same grade we will accept this with no penalty up to HW3. For homeworks beyond that we feel that you should be familiar with the process of joining groups. After that there will be a penalty of -1 point for both members of the group provided the submission was on time.
Grading Guidelines
Homework will be graded based on:
1. How correct your code is (the Notebook cells should run, we are not troubleshooting code)
2. How you have interpreted the results — we want text not just code. It should be a report.
3. How well you present the results.
The scale is 0 to 5 for each assignment.
Re-grade Requests
Our graders and instructors make every effort in grading accurately and in giving you a lot of feedback.
If you discover that your answer to a homework problem was correct but it was marked as incorrect, send an email to the Helpline with a description of the error. Please do not submit regrade requests based on what you perceive is overly harsh grading, The points we take off are based on a grading rubric that is being applied uniformly to all submissions.
If you decide to send a regrade request, send an email to the Helpline with subject line "Regrade HW1: Grader=johnsmith" replacing 'HW1' with the current assignment and 'johnsmith' with the name of the grader within 48 hours of the grade release.
Zoom Expectations:
Despite being remote and distributed, we want everyone to participate and engage with fellow classmates and staff. To this end, we request for everyone to leave his/her/their video on during class. We fully understand that some may be uncomfortable or unable to do so, for various personal reasons. We respect your decision and empathize for any situation that may arise. Nonetheless, if possible, we strongly ask for you to please leave your video on.
Many are getting accustomed to Zoom for the first time. While it is understandable to have some glitches, mistakes, and faux pas, some mistakes can be largely disruptive to such a large audience like that of our class. Please familiarize yourself to Zoom before the semester begins. In particular, please:
- keep your video on (see above)
- keep your mic muted by default, until you speak
- be mindful of overtly distracting actions that your video may cause (this isn't a large issue, but it's akin to students' laptops distracting those who sit nearby)
- be mindful of your mic settings after returning to the main room from a break-out room, as it tends to un-mute each person's mic.
Communication from Staff to Students
Class announcements will be through Ed. All homework and will be posted and submitted through Canvas. Quizzes are completed on Ed as well as all feedback forms.
NOTE: make sure you adjust your account settings so you can receive emails from Canvas.
Submitting an assignment
Please consult Homework Policies & Submission Instructions [Update link]
Course Grade
Your final score for the course will be computed using the following weights:
| Assignment | Final Grade Weight |
|---|---|
| Homework 0 | 1% |
| Paired Homework (7) | 42% |
| Individual Homework (2) | 20% |
| Quizzes | 6% |
| Exercises | 6% |
| Project | 25% |
| Total | 100% |
Software
We will be using Jupyter Notebooks, Python 3, and various python modules. You can access the notebook viewer either on your own machine by installing the Anaconda platform (Links to an external site) which includes Jupyter/IPython as well all packages that will be required for the course, or by using the SEAS JupyterHub from Canvas. Details in class.
Auditing the Class
If you would like to audit the class, please send an email to the Helpline indicating who you are and why you want to audit the class. You need a HUID to be included to Canvas. Please note that auditors may not submit assignments for grading or make use of other limited student resources such as office hours.
Academic Integrity
Ethical behavior is an important trait of a Data Scientist, from ethically handling data to attribution of code and work of others. Thus, in CS109A we give a strong emphasis to Academic Honesty. As a student your best guidelines are to be reasonable and fair. We encourage teamwork for problem sets, but you should not split the homework and you should work on all the problems together. For more detailed expectations, please refer to the Collaborations section above.
Accommodations for Students with Disabilities
Students needing academic adjustments or accommodations because of a documented disability must present their Faculty Letter from the Accessible Education Office (AEO) and speak with the professor by the end of the second week of the term, (fill in specific date). Failure to do so may result in the Course Head's inability to respond in a timely manner. All discussions will remain confidential, although Faculty are invited to contact AEO to discuss appropriate implementation.
Diversity and Inclusion Statement
Data Science and Computer Science have historically been representative of only a small sliver of the population. This is despite the contributions of a diverse group of early pioneers - see Ada Lovelace, Dorothy Vaughan, and Grace Hopper for just a few examples.
As educators, we aim to build a diverse, inclusive, and representative community offering opportunities in data science to those who have been historically marginalized. We will encourage learning that advances ethical data science, exposes bias in the way data science is used, and advances research into fair and responsible data science.
We need your help to create a learning environment that supports a diversity of thoughts, perspectives, and experiences, and honors your identities (including but not limited to race, gender, class, sexuality, religion, ability, etc.) To help accomplish this:
-
If you have a name and/or set of pronouns that differ from those in your official Harvard records, please let us know!
-
If you feel like your performance in the class is being impacted by your experiences outside of class, please do not hesitate to come and talk with us. We want to be a resource for you. Remember that you can also submit anonymous feedback (which will lead to us making a general announcement to the class, if necessary, to address your concerns). If you prefer to speak with someone outside of the course, you may find helpful resources at the Harvard Office of Diversity and Inclusion.
-
We (like many people) are still learning about diverse perspectives and identities. If something was said in class (by anyone) that made you feel uncomfortable, please talk to us about it.
-
As a participant in course discussions, you are expected to respect your classmates’ diverse backgrounds and perspectives.
Our course will discuss diversity, inclusion, and ethics in data science. Please contact us (in person or electronically) or submit anonymous feedback if you have any suggestions for how we can improve.


java.lang.Comparable
which do not override equals()
. If equals()
is not overridden, the equals()
implementation is not consistent with
the compareTo()
implementation. If an object of such a class is added
to a collection such as java.util.SortedSet
, this collection will violate
the contract of java.util.Set
, which is defined in terms of
equals()
.
For example:
class Length implements Comparable<Length> {
private int cm = 0;
@Override
public int compareTo(@NotNull Length o) {
if (cm == o.cm) return 0;
return cm < o.cm ? -1 : 1;
}
}
After the quick fix is applied, the result looks like this:
class Length implements Comparable<Length> {
private int cm = 0;
@Override
public int compareTo(@NotNull Length o) {
if (cm == o.cm) return 0;
return cm < o.cm ? -1 : 1;
}
@Override
public boolean equals(Object o) {
return o instanceof Length && compareTo((Length) o) == 0;
}
}


Hello my name is Grace, I live in Lynchburg, VA. I am 18 years old, and I am a 12th grader at VAVA. I am new to this program and am excited to be a part of this program as this will give me more insight on how online schooling is. The reason I joined this program is because of Covid-19 and needed a flexible schedule. I am very used to brick and molder school, where the bell rings once class is finished and stuff like that so this will be a huge change for me.
My hobbies/interests consist of playing video games in my free time such as Final Fantasy 14, GW2, and a lot more. I also like to read books occasionally and watch Netflix. I have a few other hobbies/interests as well such as Digital Drawing, programming, exercising, and playing with my pets. These things bring me joy outside of work/ school.
My plans after graduating from VAVA are to go to a community college for 2 years and probably study in Information System Technologies/ General studies (either one will be first). After my 2 years at Community College, I plan to go to a university and get my bachelors and study to become a Front-End Web Developer or something regarding that field. Some things that I want you to know about me to help me in class, is that I work a part-time job at Walmart and work mostly in the evenings, I might need help in getting reminded about assignments and when they are due but regarding all that, that's all I can think of that is about me.


Authentication
public class Authentication
Current state of user authentication for the app.
One instance of this should be created when the app moves to try and authenticate the user.
The global instance of this object is in Authentication.shared
.
-
The shared instance.
Declaration
Swift
public private(set) static var shared: Authentication?
-
The id for the users mobile device. This is used for APN and should be set by the app. If this
deviceId
value is set when the user is authenticated then then theaddDeviceId
call will automatically send the value to the Auth server.Declaration
Swift
public static var deviceId: String?
-
Error object thrown for some auth related problems.
See moreDeclaration
Swift
public struct Error : Swift.Error, CustomStringConvertible
-
The token returned by the auth server after successful authentication. When set, this value will be written to UserDefaults.
Declaration
Swift
public var token: TokenAcquiredResponse? { get set }
-
The authenticated user. If this is nil then the user is not authenticated.
Declaration
Swift
public var user: AuthenticatedUser? { get set }
-
Init an Authentication.
Declaration
Swift
public init()
-
Checks if the user is logged in and that the current token is valid. The response will be delivered to the provided callback.
Declaration
Swift
public func checkLoggedIn(callback: @escaping (APIResponse<Bool>) -> ())
-
Retrieves up to date information for the current user. The response will be delivered to the provided callback.
Declaration
Swift
public func getMe(callback: @escaping (APIResponse<AuthenticatedUser>) -> ())
-
Remove all current authentication state. The response will be delivered to the provided callback.
Declaration
Swift
public func logout(callback: @escaping (APIResponse<Void>) -> ())
-
Attempt to log in with the given address and password. The response will be delivered to the provided callback.
Declaration
Swift
public func login(email: String, password: String, callback: @escaping (APIResponse<Void>) -> ())
-
Complete a device local password recovery operation. The
password
parameter will be the new password to set. Thetoken
will have been obtained by The response will be delivered to the provided callback.Declaration
Swift
public func completeRecoverPassword(address: String, password: String, token: String, callback: @escaping (APIResponse<Void>) -> ())
-
Begin a password recovery operation. If the user has previously logged in on the device and an APNS device token was successfully set on the server then a device local recovery will be attempted. The response will be delivered to the provided callback.
Declaration
Swift
public func startRecoverPassword(address: String, callback: @escaping (APIResponse<Void>) -> ())
-
Get the meta-data attached to the account. Currently only
fullName
is supported. The response will be delivered to the provided callback.Declaration
Swift
public func getMeta(callback: @escaping (APIResponse<AccountPublicMeta>) -> ())
-
Set meta-data for the account. Currently only
fullName
is supported. The response will be delivered to the provided callback.Declaration
Swift
public func putMeta(data: AccountPublicMeta, callback: @escaping (APIResponse<Void>) -> ())
-
Attempt to register a new account. If successful this will also set the full name meta value. The response will be delivered to the provided callback.
Declaration
Swift
public func register(email: String, password: String, fullName: String, callback: @escaping (APIResponse<Void>) -> ())
-
Send the device id to the server. It will be stored with the user’s account and used for push notifications. The response will be delivered to the provided callback.
Declaration
Swift
public func addDeviceId(_ id: String, callback: @escaping (APIResponse<Void>) -> ())
-
Abstracted handler maker.
Declaration
Swift
typealias OAuthURLHandlerMaker = (OAuth2Swift) -> OAuthSwiftURLHandlerType
-
Attempt to log in through Google OAuth. The response will be delivered to the provided callback.
Declaration
Swift
func loginOAuthGoogle(handlerMaker: OAuthURLHandlerMaker, callback: @escaping (APIResponse<Void>) -> ())
-
Attempt to log in through Facebook OAuth. The response will be delivered to the provided callback.
Declaration
Swift
func loginOAuthFacebook(handlerMaker: OAuthURLHandlerMaker, callback: @escaping (APIResponse<Void>) -> ())
-
Attempt to log in through Linkedin OAuth. The response will be delivered to the provided callback.
Declaration
Swift
func loginOAuthLinkedin(handlerMaker: OAuthURLHandlerMaker, callback: @escaping (APIResponse<Void>) -> ())