Not All Data is Linear

Similar documents
Maps Chris Piech CS106A, Stanford University. Piech, CS106A, Stanford University

A Week at the Animal Shelter (4th Grade)

Lipsey Clinic fills a need with low-cost vet care at SPCA

NC State Fair Annual Youth Market Turkey Show

BIOLOGY 436: WATERFOWL BIOLOGY AND WETLAND MANAGEMENT COURSE SYLLABUS

FFA BEEF CATTLE Superintendent: Jeremy Kennedy Assistant Superintendents: Keith Frost

Finch Robot: snap level 4

Ssssneaky, Pesssky, S speciesss! Objectives: Sneak Peek Aligned with the following Sunshine State Standards and FCAT Benchmarks for grades 6-8:

doi: /

CURRICULUM GUIDE. Wake Up, Color Pup. Taia Morley

Judging Schedule Valley Hills Obedience Club AKC All Breed Agility Trial December 7-9, 2018

City of McHenry McBark Dog Park. SPONSORED BY GARY LANG SUBARU 2500 N. Richmond Road McHenry, IL 60050

Wildlife Explorers. Did You Know? canalrivertrust.org.uk Canal & River Trust is a charity registered with the Charity Commission no.

SISKIYOU GOLDEN FAIR JUNIOR LIVESTOCK INDEPENDENT EXHIBITOR PROGRAM

Optimal Efficient Meta Heauristic Based Approch for Radial Distribution Network

How to Guide Pet Waste Station Community Program

DEPARTMENT 6: GOATS Goat Regulations

X-bar Node Flavors Introduction to syntax. Noun Phrase

now in COLOUR We invite you to enjoy the first collection of True Colours auction from ALROSA

ONE DAY TWO SENIOR DOE SHOWS, TWO JUNIOR DOE SHOWS. JUDGES: Ring 1: Kristopher Fraley and Ring 2: Joe Kimmel

HERPETOLOGY BIO 404 COURSE SYLLABUS, SPRING SEMESTER, 2001

Lowell Parks & Recreation Connection

WHAT S NEW AT THE 2017 CALIFORNIA MID-STATE FAIR California Mid-State Fair Livestock Show

Get ready to start your Expedition!

Animal Health POPM*4230 Fall Course Outline

Integer Operations Long-Term Memory Review Grade 7 Review 1

By Matthew Van Fleet. Dear Bookseller, Teacher, or Librarian,

August 1, RE: McBark Park Dog Park Renewal

Pigeonhole Principle

March Mammal Madness

General Judging Standards & Course Design for UKI

2018 Pasco County Fair Youth Poultry Show

ACTIVITY KIT. But something is up. There are strange bone-shaped toys lying about...

Rusty Blackbird Visual Identification Tips For Spring Migration

EVOLUTIONARY GENETICS (Genome 453) Midterm Exam Name KEY

Illinois State 4-H Dog Show INFORMATION FOR EXHIBITORS & STAFF

SPONSOR CONTRACT WORKINGDOGMAGAZINE.COM JULY 16, 17, HILTON ST. LOUIS AT THE BALLPARK

ENGINEERING DOCUMENT. LivePerson KAPLAN UNIVERSITY IT DEPARTMENT. version Microsoft Software

IRISH WOLFHOUND CLUB OF AMERICA, INC.

TSVR Newsletter December 2017 Winter Roads

HERDING REGULATIONS FOR SV HERDING COMPETITIONS

Analysis of Sampling Technique Used to Investigate Matching of Dorsal Coloration of Pacific Tree Frogs Hyla regilla with Substrate Color

WEEKLY SALES NEWS STOCK SOLD DURING THE WEEK MONDAY 20TH JULY 2015 FOSCOTE PRIME SHEEP SALE TO COMMENCE AT 10.30AM

2018 Livestock Schedule

ONE DAY THREE RINGS ONE YOUTH RING AND 2 OPEN RINGS SENIOR DOE SHOWS JUNIOR DOE SHOWS

The City School. Learn Create Program

Rick Klaus (360)

SBI3U: Exploring Modes of Inheritance. Purpose

Onomatopoeia Bingo Instructions

PLEASE PUT YOUR NAME ON ALL PAGES, SINCE THEY WILL BE SEPARATED DURING GRADING.

Survey options Toad surveys Great Crested Newt edna survey: Great Crested Newt full survey:

August LSU AGCENTER STATE LIVESTOCK SHOW VALIDATION PROCEDURE

AK9U DOCK-DIVING EVENT at the 62ND FORD INDIANAPOLIS BOAT, SPORT & TRAVEL SHOW February 19, 2016 February 28, 2016

RED CAT READING. Leveled Reading Assessment

OMCBA Squirrel Hunt Rules

Activity Report on the Dutch Caribbean Nature Alliance Sea Turtle Satellite Tracking Project 2005

April 5-9, 2017 Purina Farms Gray Summit, Missouri

DOWNLOAD OR READ : LOST AND FOUND DOGS CATS AND EVERYDAY HEROES AT A COUNTRY ANIMAL SHELTER PDF EBOOK EPUB MOBI

COAHOMA COMMUNITY COLLEGE Summer 2018 Class Schedules Summer First Term

Pasco County Fair Youth Rabbit Rules 2018

American K-9 in Your Home

Peter Pan Relaxed Performance Friday 4 January 2.30pm

American K-9 in Your Home

Furwear Product Range

PARADE COLLEGE Mathematics Methods 3&4-CAS Probability Analysis SAC 2

Social Listening Among Pet Parents CASE STUDY

Free Supplemental Lesson Pack 3

Onomatopoeia Bingo Instructions

Onomatopoeia Bingo Instructions

Pasco County Fair Youth Rabbit and Cavy Rules 2017

4--Why are Community Documents So Difficult to Read and Revise?

Dachshund Club of St. Louis, Inc. Denny Van Hook, Field Trial Secretary 3 Deerwood Trail Fairview Heights, Illinois 62208

JUNIOR DIVISION SHEPHERDS AND SHEEP IN WOOL LEAD CLASS

LynnDees Dog Training Center N Colville Road, Spokane, WA (509) Training Schedule

Comparison of Parallel Prefix Adders Performance in an FPGA

CITATION AND NOTIFICATION OF PENALTY. We believe that you violated the Animal Welfare Act (7 U.S.C et seq.) (AWA), as described below.

Going to a Show Milwaukee Youth Arts Center AT T H E

Pasco County Fair Youth Rabbit Rules 2019

Sample Paper HEC CAT A

1 Turtle Graphics Concepts

Project outline Essential dates... 2 Poultry care Tasks for submission... 4

HOUSTON CAT CLUB, INC.

TROY FAIR OPEN DAIRY CATTLE SHOW 27, :00 AM. & 29, :00 AM.

Public Qualifying & Try Outs: Information Sheet Purina Farms, Gray Summit, Missouri September 30 th, 2016

Pete s Eats Alan s Diner Sarah s Snackbar Total Dissatisfied Satisfied Total

EDU 315 Literature Focus Unit Teha Haisley

Hairy Maclary. Visual Arts. Key learning Area: Visual Arts Date Topic and focus: Texture and shape Year 1-2

Broiler Derby Participants 2017 Information Sheet

Dear Rabbit & Cavy Exhibitors, September 2018

Midterm Exam For Anatomy And Physiology Chapter File Type

Rabbit General Rules

Compassionate Dog Training & Daycare. Daycare

MACHINE PROBLEM 8 -"IN THE MIDDLE, A CAULDRON BOILING" CS xxx - Fall Quarter yyyy - Dr. Estell - DUE AT CLASSTIME mm/dd/yyyy

November General Meeting & Holiday Party

Written and illustrated by Anne Curtis Photographs by Neil Denham Designed by Lotti Gecaite

COUNTY OF ALBEMARLE STAFF REPORT SUMMARY

SWINE. Swine. Yorkshire Duroc

CS108L Computer Science for All Module 7: Algorithms

PROGRESS REPORT for COOPERATIVE BOBCAT RESEARCH PROJECT. Period Covered: 1 April 30 June Prepared by

drive to get to the movies and stores, but can do different activities near home. Both the country and the city are interesting places to live.

Transcription:

HashMap

Not All Data is Linear

HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); To animals.get("dog"); To add // add a Returns a key/value key/value pair "bark" pair to to a a HashMap, HashMap, use use the the syntax syntax animals.put("dog", "woof"); println(animals.get("fox")); // map.put(key, Returns null animals.containskey("cat"); // value) Returns true

dog bark HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark cat meow HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark cat meow HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); To To look look up up the the value value animals.get("dog"); // Returns "bark" associated with with a key: key: animals.put("dog", "woof"); println(animals.get("fox")); // Returns null animals.containskey("cat"); // Returns map.get(key) true

dog bark cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog bark cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); println(animals.get("fox")); animals.containskey("cat"); // Returns null // Returns true

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); If If you you put a animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns key/value "bark" pair pair where where animals.put("dog", "woof"); the the key key exists, the the old old println(animals.get("fox")); // Returns value null animals.containskey("cat"); // Returns value is true is replaced.

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); animals.get("fox"); // Returns null animals.containskey("cat"); // Returns true

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); If If you you get a key key that that animals.get("dog"); // Returns "bark" isn't isn't in in a map, map, the the animals.put("dog", "woof"); animals.get("fox"); // Returns method null returns null. animals.containskey("cat"); // Returns true

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); animals.get("fox"); animals.containskey("cat"); // Returns null // Returns true

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); animals.get("fox"); // Returns null animals.containskey("cat"); // Returns true

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); You animals.put("nubian ibex", "(silence)"); You can can check check whether whether a a animals.get("dog"); // Returns key key exists exists "bark" in in the the map: map: animals.put("dog", "woof"); map.containskey(key) animals.get("fox"); // Returns null animals.containskey("cat"); // Returns true

dog woof cat meow nubian ibex (silence) HashMap<String, String> animals = new HashMap<String, String>(); animals.put("dog", "bark"); animals.put("cat", "meow"); animals.put("nubian ibex", "(silence)"); animals.get("dog"); // Returns "bark" animals.put("dog", "woof"); animals.get("fox"); // Returns null animals.containskey("cat"); // Returns true

Basic HashMap Operations HashMap has two type arguments: HashMap<KeyType, ValueType> To insert a key/value pair: map.put(key, value) To look up the value associated with a key: map.get(key) To check whether a key exists: map.containskey(key)

Making HashMap Shine

Exploring the US

Time-Out for Announcements!

Friday Four Square! Today at 4:15PM at Gates CS

Midterms Graded Midterms graded, available for pickup in a filing cabinet in the Gates B Wing. Right inside the entrance marked Stanford Engineering Venture Fund Laboratories. If you'd like to submit your exam for a regrade, attach a coversheet letting us know what to look at and hand your exam to Vikas or Keith. Deadline: next Wednesday at 3:15PM.

Assignment 5 Assignment 5 (Array Algorithms) is due one week from today. Recommendation: Complete Steganography by Monday and start working on Tone Matrix.

Back to CS106A!

Making Music

The Keyboard File Format note-file-name x y width height is white key?

The xkcd Color Survey

The xkcd Color Survey Volunteers (online) were shown a randomly-chosen color and asked to name the color. The result is (after filtering) about 2.8 million RGB triplets and their names. What do people think the colors are?

The Color File Format color-name red green blue

Displaying Colors The HSB Color Format Choose the hue (what color), saturation (how intense), and brightness (absolute brightness). Each choice in the range from 0.0 to 1.0.

How to Structure the Data? blue 15 137 255 0 0 127 88 88 190 red 166 14 7 99 55 5 255 0 0 gray 154 156 157 243 242 254 140 143 148 associate each color name with a list of RGB triplets

How to Structure the Data? blue 15 137 255 0 0 127 88 88 190 red 166 14 7 99 55 5 255 0 0 gray 154 156 157 243 242 254 140 143 148 HashMap<color name, list of RGB triplets>

How to Structure the Data? blue 15 137 255 0 0 127 88 88 190 red 166 14 7 99 55 5 255 0 0 gray 154 156 157 243 242 254 140 143 148 HashMap<String, list of RGB triplets>

How to Structure the Data? blue 15 137 255 0 0 127 88 88 190 red 166 14 7 99 55 5 255 0 0 gray 154 156 157 243 242 254 140 143 148 HashMap<String, ArrayList<RGB triplet>>

How to Structure the Data? blue 15 137 255 0 0 127 88 88 190 red 166 14 7 99 55 5 255 0 0 gray 154 156 157 243 242 254 140 143 148 BHashMap<String, ArrayList<int[]>>B

For More Information http://blog.xkcd.com/2010/05/03/color-survey-results/