Agenda Announcements List comprehension Set Password example - - PowerPoint PPT Presentation

agenda
SMART_READER_LITE
LIVE PREVIEW

Agenda Announcements List comprehension Set Password example - - PowerPoint PPT Presentation

Agenda Announcements List comprehension Set Password example 1/14/2013 CompSci101 Peter Lorensen 1 List comprehension [ element for element in sequence if element ] [ [ ] x for loop if pay = [850.0, 1250.0, 900.0, 1400.0,


slide-1
SLIDE 1

Agenda

  • Announcements
  • List comprehension
  • Set
  • Password example

1/14/2013 CompSci101 Peter Lorensen 1

slide-2
SLIDE 2

List comprehension [ [

1/14/2013 CompSci101 Peter Lorensen 2

]

[ element for element in sequence if element ]

for loop if x

pay = [850.0, 1250.0, 900.0, 1400.0, 1100.0] lowPay = [ pay for pay in salary if pay < 1000.00 ] >>[ 850.0, 900.0 ]

slide-3
SLIDE 3

Set

  • Set is similar to a list, but can only have unique

elements.

  • Set are unordered. No index.
  • Use set() or set(list) to create a set. Then add.

1/14/2013 CompSci101 Peter Lorensen 3

passengers = set([“John”, “Bob”, “Lisa”]) passengers.add(“peter”) >> set([“John”, “Bob”, “Lisa”, “peter”])

slide-4
SLIDE 4

Set

We often use for comparison

1/14/2013 CompSci101 Peter Lorensen 4

Operation Function Short Union set1.union( set2 ) | Intersection set1.intersection( set2 ) & Difference set1.difference( set2 )

  • Symmetric

difference set1.symmetric_differe nce( set2 ) ^

slide-5
SLIDE 5

Daphne Koller

Computers learn to diagnose breast cancer?

  • AI and Machine Learning

– http://www.youtube.com/watch?v=DX2_9ntOcQI – http://med.stanford.edu/ism/2011/november/compu ter.html

1/14/2013 CompSci101 Peter Lorensen 5

"But to practice problem-solving, a student must first master certain concepts. By providing a cost-effective solution for this first step, we can focus precious classroom time on more interactive problem-solving activities that achieve deeper understanding — and foster creativity." Coursera Founder, NY Times, December 5, 2011

slide-6
SLIDE 6

1/14/2013 CompSci101 Peter Lorensen 6

12 MILLION 2011

slide-7
SLIDE 7

Passwords

1/14/2013 CompSci101 Peter Lorensen 7

http://zd.net/ME10pW http://bit.ly/XSGIaT http://on.mash.to/MjlDRs http://bit.ly/YPlrWn

slide-8
SLIDE 8

Passwords

Troy Hunt analysis of leaked Sony password

(http://bit.ly/kr2jpL):

  • People re-use their passwords on different sites.

1/14/2013 CompSci101 Peter Lorensen 8

“The only secure password is the one you cant remember”

(http://bit.ly/hhwE4n)

slide-9
SLIDE 9

Duke IT Strategies for good passwords

Use lines from a childhood verse: Verse Line: Yankee Doodle went to town Password: YDwto#town Use lines from a favorite song: Lyric: How Much is that Doggie in the Window? Password: H$itditw? City Expression: Chicago is my kind of town Password: CimYKot! Foods disliked during childhood: Food: rice and raisin pudding Password: ric&raiPudng

Note: Obviously, you shouldn't use any of the passwords used as examples in this document. Treat these examples as guidelines only.

1/14/2013 CompSci101

Peter Lorensen 9

slide-10
SLIDE 10

Password lists on the Internet

1/14/2013 CompSci101 Peter Lorensen 10

  • Accessible list of passwords on the Internet:

https://dazzlepod.com/site_media/txt/passwords.txt

  • Disclosure Project

by Dazzlepod “The disclosures on this website have been made available publicly so that users can find out if they were exposed as a result of the releases made by hackers.”

(https://dazzlepod.com/disclosure/)