Welcome to IS 313 ! When the course was over, I knew it was a good thing. We don't have strong enough words to describe this class. Information Technology an advocate of concrete computing - New York Times Review of Courses - US News and Course Report We give this course two thumbs! - Ebert and Roeper
About myself Who Zach Dodds Harvey Mudd College Where What Research includes robotics and computer vision Contact Information Office Hours: Friday afternoons, 2-4 pm or set up a time... When Mondays 4-7 pm here in ACB 108 HMC Olin 1255
TMI? fan of low-tech games fan of low-level AI
“Quiz” Name Preferred A place you consider home Your favorite _____ is _____. Your least favorite _____ is _____. Are you working at a company now? Do you use computer programming? take a movie of yourself saying Where? How/what? your name & where you're from
“Quiz” Name Preferred A place you consider home Your favorite _____ is _____. Your least favorite _____ is _____. Are you working at a company now? Do you use computer programming? Zachary Dodds Pittsburgh, PA drama Burn Notice coffee decaffeinated Harvey Mudd java/C++/python Where? How/what?
IS 313 What?Why?
IS 313 What?Why? CS for IS all of CS in one semester! CS == Computer Science
IS 313 What?Why? CS for IS IS is about bridging and leveraging technologies all of CS in one semester! but what is CS ? CS? Hmmm Let me check Google… Credit Suisse? Counter-Strike C 10 H 5 ClN 2 : CS gas CompuServe Computer Science Cultural Survival
CS != programming programming : CS ::
CS != programming programming : CS :: "not equal to"
CS != programming programming : CS :: bookkeeping : business unicycling : HMC grammar : literature equations : mathematics a vehicle, not a destination Programming CS
CS == complexity science Study of complexity How can it be done? How well can it be done? Can it be done at all? What's it ? "is equal to"
CS == complexity science Study of complexity How can it be done? How well can it be done? Can it be done at all? What's it ? Information
Study of complexity How can it be done? How well can it be done? Can it be done at all? "Make3d" What information is being transformed here? Andrew Ng ~ Computers and Thought award, 2009
What Google thinks I look like First 4 Google Image hits (8/29/10) for a search of "Zach Dodds HMC"
What Google thinks I look like First 4 Google Image hits (8/29/10) for a search of "Zach Dodds HMC"
What Google thinks I look like "Zach Dodds" Images are difficult! First Google Image hit (8/30/09) for a search of
Information Study of complexity How can it be done? How well can it be done? Can it be done at all? The N-body problem: lots of interactions! What information is being tracked here?
Information Study of complexity How can it be done? How well can it be done? Can it be done at all? Protein Folding The 3d structure of a protein is completely determined by its 1d amino acid sequence. Understanding this sequence-structure relationship has been referred to as the "second half of the genetic code." Information: sequence and pose of amino acids
CS Research ? my own…
Why CS ? Information is our fundamental building block. CS is a set of fundamental techniques for understanding and leveraging this information… Genetic Code: DNAOur senses and experiences GTAGCACAITTAGC… More coffee required… us “constructing with”
CS’s motto ? print 'hv', print 'dcle\naemdoe' print 'ryu', print 'lg!' print 'whtvo\na', print 'eub\neraeo' print 'yraoo\negdne' details are temporary……but CS thinking isn’t !
CS vs. IS and IT ? greater integration system-wide issues smaller details machine specifics
CS vs. IS and IT ? Where will IS go?
CS vs. IS and IT ?
IT ? Where will IT go?
IT ?
Why IS313 ? Yes, if you’re retired No, if you’re not… without programming or computer science ? looking to manage, analyze, engineer, lead, innovate at the next Google / Facebook / OnLive … Intuition about all the details you’ll be organizing, managing, and/or using will make you more effective at all of the above.
About IS313 …
Course Details Web Page: Assignments, online text, necessary files, lecture slides are linked First week’s assignment: Starting with Python and Picobot Programs: python and IDLE Textbooks! CS 5 website How to think like a computer scientist greenteapress.com/thinkpython/ Try installing v2.7 now…! optional and online
Try it… Go to the course page Click on the HW page Install Python 2.7 get & run the file hw0pr1.py F5 runs!
Homework Assignments ~ 2-5 problems/week ~ 100 points extra credit available Due Tuesday of the following week (anytime) - or by 11:59 pm. Assignment 1 due Tuesday, September week + 1 day… No class next Monday, September 6: Labor Day
Homework Working on programs: Problems may be done in groups of 2-3. Divide the work at the keyboard evenly! Assignments ~ 2-5 problems/week ~ 100 points extra credit available Due Tuesday of the following week (anytime) - or by 11:59 pm. Assignment 1 due Tuesday, September 14. Submitting programs: at the submission website Today's Lab: install software Python & ensure accounts are working try out Python - the HW is officially due on 9/14
Grading Grades Exams if score >= 0.95: grade = “A” if score >= 0.90: grade = “A-” if score >= 0.60: grade = “P” Final Exam/Project at the end of the semester. the last 2-3 weeks will work towards a larger, final project (this is the "exam") there will be a short design phase and a short final presentation I'd encourage you to connect Python to other information technology that you use/need/like, etc. Based on points percentage ~ 900 points for assignments see the 313 syllabus for the full list... ~ 300 points for the final exam
Resources Instructor Other Students Zach Dodds Office: Harvey Mudd’s Olin 1255 Phone: x71813 ( ) Official Office Hours: F 2-4 pm or consulting with others (except team members or myself) is encouraged, but has to be limited to discussion of problems. Sharing of written, electronic, or verbal solutions/files/code is a violation of CGU’s academic honesty policy. Harvey Mudd Lecture is offered TTh from 9:35-10:50 am or 1:15-2:30 pm IS 313 is similar to (but not identical to) CS 5 at Harvey Mudd CS 5 == IS 313 is not quite true… in Linde Activities Center
Resources Instructor Other Students Zach Dodds Office: Harvey Mudd’s Olin 1255 Phone: x71813 ( ) Official Office Hours: F 2-4 pm or consulting with others (except team members or myself) is encouraged, but has to be limited to discussion of problems. Sharing of written, electronic, or verbal solutions/files/code is a violation of CGU’s academic honesty policy. Harvey Mudd Lecture is offered TTh from 9:35-10:50 am or 1:15-2:30 pm IS 313 is similar to (but not identical to) CS 5 at Harvey Mudd for the purposes of many websites, documents, etc. "is equal to" CS 5 == IS 313 in Linde Activities Center
Questions ?
Programming… ?! Information Technology an advocate of concrete computing When the course was over, I knew it was a good thing. We don't have strong enough words to describe this class. - New York Times Review of Courses - US News and Course Report We give this course two thumbs! - Ebert and Roeper
Programming… ?! Computer Psychology an advocate of concrete computing Information Technology
Not the goal… ouch! a = ['print "a =", a', 'for s in a: print s'] print "a =", a for s in a: print s knowing crazy coding details…
Goals thinking like a machine ouch! ENIAC, UPenn, 1945 a = ['print "a =", a', 'for s in a: print s'] print "a =", a for s in a: print s
What is programming ? Programming as recipe-writing vs. Programming as learning a foreign language
What is programming ? Baggage ! Programming as recipe-writing vs. Programming as learning a foreign language 1) Expect it to be different! 2) Don’t feel you need to memorize it 3) Immersion == Experimentation
Python and IDLE Editor window: code Shell window: running code Here, you can try things out at the command prompt >>> Here, you can save and change programs. Hitting F5 runs your program over in the shell
The foreign language of python… Homework 0, problem 1 hw0pr1.py name = raw_input('Hi... what is your name? ') print # prints a blank line if name == 'Z' or 'Ran': # is it Z or Ran? print 'Um, I\'m "offline." Try later.' elif name == 'Zach': # is it Zach? print "But I wanted to meet Cody!" else: # in all other cases... print 'Welcome', name, '!' my_choice = random.choice( [ 'R','P','S' ] ) print 'My favorite object is', my_choice, "!"
What is programming ? Baggage ! Programming as recipe-writing vs. Programming as learning a foreign language 1) Expect it to be different! 2) Don’t feel you need to memorize it 3) Immersion == Experimentation
The foreign language of python… syntax?semantics?intent? How it looksWhat it doesWhat it should do name = raw_input('Hi... what is your name? ') print # prints a blank line if name == 'Z' or 'Ran': # is it Z or Ran? print 'Um, I\'m "offline." Try later.' elif name == 'Zach': # is it Zach? print "But I wanted to meet Cody!" else: # in all other cases... print 'Welcome', name, '!' my_choice = random.choice( [ 'R','P','S' ] ) print 'My favorite object is', my_choice, "!"
What about me? 'Zach' 'Chris' Zach Chris Z or Ran Zach ‘Z’ or ‘Ran’
The foreign language of python… syntax?semantics?intent? How it looksWhat it doesWhat it should do Syntax how punctuation is used the language keywords that are used use of whitespace peculiarities of formatting how behavior is affected …
How Python looks… name = raw_input('Hi... what is your name? ') print # prints a blank line if name == 'Z' or 'Ran': # is it Z or Ran? print 'Um, I\'m "offline." Try later.' elif name == 'Zach': # is it Zach? print "But I wanted to meet Cody!" else: # in all other cases... print 'Welcome', name, '!' my_choice = random.choice( [ 'R','P','S' ] ) print 'My favorite object is', my_choice, "!"
Hw 0, Problem 2 syntax?semantics?intent? How it looksWhat it doesWhat it should do Save hw0pr1.py under a new name, hw0pr2.py Change hw0pr2.py to play rock-paper-scissors. Feel free to add to the dialog, if you wish… It does not have to play fair! Submit your hw0pr2.py in the usual way. Stepping back for a moment…
Why Python ? Python is a general-purpose computer language
Why Python ? Python is a general-purpose computer language Physics: LabView Biology: Lasergene, DNA* Business: SAP, all sorts of Microsoft products, and many, many other business solutions Also: Excel, Word, SQL Other general-purpose languages C, C++, C#, J#, Java, Javascript, Cobol, Fortran, Perl, Ruby, Visual Basic,... see
Language is language int main() { std::cout << "Hello, world!"; } PLEASE DO,1 <- #13 DO,1 SUB #1 <- #238 DO,1 SUB #2 <- #112 DO,1 SUB #3 <- #112 DO,1 SUB #4 <- #0 DO,1 SUB #5 <- #64 DO,1 SUB #6 <- #238 DO,1 SUB #7 <- #26 DO,1 SUB #8 <- #248 DO,1 SUB #9 <- #168 DO,1 SUB #10 <- #24 DO,1 SUB #11 <- #16 DO,1 SUB #12 <- #158 DO,1 SUB #13 <- #52 PLEASE READ OUT,1 PLEASE GIVE UP v >v"Hello world!"0<,: (DEFUN HELLO-WORLD () (PRINT (LIST 'HELLO 'WORLD))) print "Hello, World!"; Perl C++ LISP/Scheme Befunge Intercal Python Perl doesn’t seem too alien… print 'Hello, World!'
Language is language ? Perls of wisdom ? eval evalq.q>trd!Uj:%L<061:%C<csnvo:%f<fsddo0:%c<cmtd:%x<xdmmnv:%I<011:%u<251:%bs<bsd`udSdbu`ofmd:%w<lnwd:%U<2:%t<L`hoVhoenv,? odv),idhfiu<?314-,vheui<?254(:%b<%t,?B`ow`r:%b,?bnoghftsd),vheui<?%u-,idhfiu<?311(:%b,?q`bj)(:s)3-3-%u-001-%c(:s)3-081-%u-311 -%f(:s)3-001-%u-031-%f(:s)3-1-%u-34-%f(:gns)%{<1:%{=%u:%{*<71(zs)%{-01-%{*51-54-%f-%f(:|s)3-1-%u-04-cm`bj(:%b,?%bs)3-1-%u-311 (:%G<,041:v)1-%L-31-C-%x(:v)%G-%L-,021-C-%x(:%B<,91:v), ,4-B-%c(:v), ,74-B-%c(:%E<,%I:v) E-%x(:v),%I-021-, -61-,211-F-%C(:%J<%u:v) [-%C(:v) [-%C(:v)%u [-%C(:%b,?bsd`udNw`m) ,u`fr<?G-,ghmm<?f sddo5(:S)1(:%b,?sdqd`u)%I-]'t(:%t,?choe)&=Envo?&<?rtczS),0(:'V:%b,?%w)G-1-31(hg)%x=081(:|(:%t,?choe)&=Tq?&<?rtczS)0(:%b,?%w)G -1-,31(:|(:%t,?choe)&=Mdgu?&<?rtcz'V:%b,?%w)G-,31-1(hg)%y?31(:|(:%t,?choe)&=Shfiu?&<?rtcz'V:%b,?%w)G-31-1(hg)%Y=%u,31(:|(:L`h oMnnq)(:dyhu:rtc!vz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z0\*8-,u`fr<?%^Z2\-,ghmm<?%^Z5\(:|rtc!tzhg)%G?%u(z%G*<%L:%d<,%G:%G<,%L:|dmrdz% G*<01:%d<01:|%b,?%w)C-%d-1(:hg)%B?%u(z%B*<%I:%d<,%B:%B<,%I:|dmrdz%B*<01:%d<01:|%b,?%w)B-%d-1(:hg)%E?%u(z%E*<031:%d<,%E:%E<,03 %M:%M<,271:|dmrdz%M*<9:%d<9:|%b,?%w)F-%d-1(:hg)%J=,%u(z%J,<%u:%d<,%J:%J<%u:|dmrdz%J,<7:%d<,7:|%b,?%w)[-%d-1(:'V:hg)%x=081(zhg ))%x?031(}})%x=001((zAn<%b,?ghoe)nwdsm`qqhof-%y-%x-%Y-%X(:hg)%x?031(zhg)%"n(z'R:||dmrdzhg)%x?58(zhg)%"n?0(z%n<7:%n*<3hg)%x=81 (:%n<,7hg)%x=61(:%b,?%w)G-%n-1(:|dmrdz'R:||dmrdzhg)%"n?0(z'R:|dmrdzS)00(:%U**:%O**:'R:v)%y-%x-%Y-Q-%f(:%b,?edmdud)&Q&(hg))%O$ 4((:||||rmddq)4(''Uj;;dyhu)1(hg)%U=0(:||rtc!Rz%U,,:qshou#]`#:%b,?%w)G-063,%y-081,%x(:|rtc!SzP)cm`bj(:%R*<%^Z1\:P)sde(: |rtc!P z%b,?bsd`udUdyu)%L-9,udyu<?%R/1-,ghmm<?%^Z1\(:|rtc!sz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z2\-,ghmm<?%^Z5\-,ntumhod<?%^Z4\(:|rtc!Vz)%y -%x-%Y-%X( ^chr($$/$$)x2016. Perl might be a little bit TOO flexible a language!
Language is language ? Perls of wisdom ? eval evalq.q>trd!Uj:%L<061:%C<csnvo:%f<fsddo0:%c<cmtd:%x<xdmmnv:%I<011:%u<251:%bs<bsd`udSdbu`ofmd:%w<lnwd:%U<2:%t<L`hoVhoenv,? odv),idhfiu<?314-,vheui<?254(:%b<%t,?B`ow`r:%b,?bnoghftsd),vheui<?%u-,idhfiu<?311(:%b,?q`bj)(:s)3-3-%u-001-%c(:s)3-081-%u-311 -%f(:s)3-001-%u-031-%f(:s)3-1-%u-34-%f(:gns)%{<1:%{=%u:%{*<71(zs)%{-01-%{*51-54-%f-%f(:|s)3-1-%u-04-cm`bj(:%b,?%bs)3-1-%u-311 (:%G<,041:v)1-%L-31-C-%x(:v)%G-%L-,021-C-%x(:%B<,91:v), ,4-B-%c(:v), ,74-B-%c(:%E<,%I:v) E-%x(:v),%I-021-, -61-,211-F-%C(:%J<%u:v) [-%C(:v) [-%C(:v)%u [-%C(:%b,?bsd`udNw`m) ,u`fr<?G-,ghmm<?f sddo5(:S)1(:%b,?sdqd`u)%I-]'t(:%t,?choe)&=Envo?&<?rtczS),0(:'V:%b,?%w)G-1-31(hg)%x=081(:|(:%t,?choe)&=Tq?&<?rtczS)0(:%b,?%w)G -1-,31(:|(:%t,?choe)&=Mdgu?&<?rtcz'V:%b,?%w)G-,31-1(hg)%y?31(:|(:%t,?choe)&=Shfiu?&<?rtcz'V:%b,?%w)G-31-1(hg)%Y=%u,31(:|(:L`h oMnnq)(:dyhu:rtc!vz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z0\*8-,u`fr<?%^Z2\-,ghmm<?%^Z5\(:|rtc!tzhg)%G?%u(z%G*<%L:%d<,%G:%G<,%L:|dmrdz% G*<01:%d<01:|%b,?%w)C-%d-1(:hg)%B?%u(z%B*<%I:%d<,%B:%B<,%I:|dmrdz%B*<01:%d<01:|%b,?%w)B-%d-1(:hg)%E?%u(z%E*<031:%d<,%E:%E<,03 %M:%M<,271:|dmrdz%M*<9:%d<9:|%b,?%w)F-%d-1(:hg)%J=,%u(z%J,<%u:%d<,%J:%J<%u:|dmrdz%J,<7:%d<,7:|%b,?%w)[-%d-1(:'V:hg)%x=081(zhg ))%x?031(}})%x=001((zAn<%b,?ghoe)nwdsm`qqhof-%y-%x-%Y-%X(:hg)%x?031(zhg)%"n(z'R:||dmrdzhg)%x?58(zhg)%"n?0(z%n<7:%n*<3hg)%x=81 (:%n<,7hg)%x=61(:%b,?%w)G-%n-1(:|dmrdz'R:||dmrdzhg)%"n?0(z'R:|dmrdzS)00(:%U**:%O**:'R:v)%y-%x-%Y-Q-%f(:%b,?edmdud)&Q&(hg))%O$ 4((:||||rmddq)4(''Uj;;dyhu)1(hg)%U=0(:||rtc!Rz%U,,:qshou#]`#:%b,?%w)G-063,%y-081,%x(:|rtc!SzP)cm`bj(:%R*<%^Z1\:P)sde(: |rtc!P z%b,?bsd`udUdyu)%L-9,udyu<?%R/1-,ghmm<?%^Z1\(:|rtc!sz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z2\-,ghmm<?%^Z5\-,ntumhod<?%^Z4\(:|rtc!Vz)%y -%x-%Y-%X( ^chr($$/$$)x2016. Perl might be a little bit TOO flexible a language! Goal: expression, not language details.
The results thinking computationally, not language details
Picobot area already covered area not covered (yet!) inspiration? walls Goal: whole-environment coverage with only local sensing … Picobot the unofficial HMC mascot HW problems 3 and 4
inspiration! Picobot area already covered area not covered (yet!) walls Goal: whole-environment coverage with only local sensing … iRobot's Roomba vacuum
Surroundings Picobot can only sense things directly to the N, E, W, and S For example, here its surroundings are NxWxNxWx N E W S N E W S Surroundings are always in NEWS order.
How many distinct surroundings are there? N E W S Surroundings
How many distinct surroundings are there? N E W S xxxxNxxxxExxxxWxxxxSNExxNxWxNxxS xEWxxExSxxWSNEWxNExSNxWSxEWSNEWS (won’t happen) == 16 possible … 2424 Surroundings
State Picobot's memory is a single number, called its state. State is the internal context of computation. State and surroundings represent everything the robot knows about the world Picobot always starts in state 0. I am in state 0. My surroundings are xxWS.
Rules Picobot moves according to a set of rules: state I am in state 0. My surroundings are xxWS. surroundings 0 xxWS 0N directionnew state If I'm in state 0 seeing xxWS, Then I move N orth, and change to state 0. Aha! I should move N. I should enter state 0.
Wildcards Asterisks * are wild cards. They match walls or empty space: 0 x*** 0N statesurroundingsdirectionnew state here, EWS may be wall or empty space I am in state 0. My surroundings are xxWS. Aha! This matches x*** here, there numst be nothing to the N
What will this set of rules do to Picobot? 0 x*** 0N 0 N*** 0X statesurroundingsdirectionnew state Picobot checks its rules from the top each time. When it finds a matching rule, that rule runs. -> What happens here? how do we get back down?
What will this set of rules do to Picobot? 0 x*** 0N 0 N*** 1X 1 ***x 1S 1 ***S 0X statesurroundingsdirectionnew state Picobot checks its rules from the top each time. When it finds a matching rule, that rule runs. -> What do states 0 and 1 mean in this case?
What will this set of rules do to Picobot? 0 x*** 0N 0 N*** 1X 1 ***x 1S 1 ***S 0X statesurroundingsdirectionnew state Picobot checks its rules from the top each time. When it finds a matching rule, that rule runs. -> What do states 0 and 1 mean in this case?
To do Write rules that will always cover these two rooms. (separate sets of rules are encouraged…) but your rules should work regardless of Picobot's starting location hw0, Problem #3 hw0, Problem #4
Alter these "up & down" rules so that Picobot will traverse the empty room… "Quiz" #2 the empty room Plan your strategy then try it out at: or login and submit from
Ideas for the maze? the maze
Computer Science Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it “create with”
Computer Science Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it How to measure these rooms' complexity? “create with”
Computer Science our best: 4 states, 8 rulesour best: 3 states, 6 rules How many states and rules are really necessary ? Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it “create with” How to measure these rooms' complexity?
Computer Science file size: ~20000 bytesfile size: ~5000 bytes How many states and rules are really necessary ? How much information does each system contain ? Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it “create with” How to measure these rooms' complexity?
The purpose of computing is insight, not numbers. – Richard Hamming
The big picture Weeks 0-3 Sculpting Clay Week 1 Week 2 Week 3 Weeks 4-6 Analysis Weeks 7-9 Synthesis introduction functions / data composition Week 4 Week 5 Week 6 recursion representation machine-level Week 7 Week 8 Week 9 variables arrays of variables arrays of arrays details? See syllabus
The bigger picture Weeks Objects Week 10 Week 11 Week 12 Weeks Final Projects classes vs. objects methods and data inheritance Week 13 Week 14 Week 15 final projects What? No breaks?!
Lab time… The 2nd part of each evening is dedicated to lab work. I welcome you to stay for the lab! But it is not required. 1) check out the site at Today: 2) navigate your way to the HW pages… 3) continue on Problems #1, 2, or 3 "Introduction” “RPS” or “Picobot” I will be available for help on things… Try to have Rock-Paper-Scissors working before leaving… This webserver can be spacey -- I should know!
Lab !
Happy Picobotting! Remember Office hours at the LAC computers: Friday 2:30-4:00 Tutoring hours all weekend… Off-campus student? Please hand in your account request forms… I'll you your submission account. me with any account/web/other problems.
Getting help! Graders + Tutors = Grutors You can also or Goes to all of the CS 5 tutors and profs. My office hours 2:30-4:00 on Friday afternoon at HMC's Linde Activities Center lab Lots of help available over the weekend.
Ungoals… Programming will solve problems for you Python is the ultimate programming language Programming saves time and effort - but it’s not all bad - as a tool, however, it is crucial… Scott Adams’s take on this is pretty good
Why CS ? Information is life’s fundamental building block. CS is a set of fundamental techniques for understanding and leveraging this information… Genetic Code: DNAOur senses and experiences GTAGCACAITTAGC… More coffee required… us “constructing with”
Language is language int main() { std::cout << "Hello, world!"; } PLEASE DO,1 <- #13 DO,1 SUB #1 <- #238 DO,1 SUB #2 <- #112 DO,1 SUB #3 <- #112 DO,1 SUB #4 <- #0 DO,1 SUB #5 <- #64 DO,1 SUB #6 <- #238 DO,1 SUB #7 <- #26 DO,1 SUB #8 <- #248 DO,1 SUB #9 <- #168 DO,1 SUB #10 <- #24 DO,1 SUB #11 <- #16 DO,1 SUB #12 <- #158 DO,1 SUB #13 <- #52 PLEASE READ OUT,1 PLEASE GIVE UP v >v"Hello world!"0<,: (DEFUN HELLO-WORLD () (PRINT (LIST 'HELLO 'WORLD))) print"Hello, World!" Perl C++ LISP/Scheme Befunge Intercal Python Perl doesn’t seem too alien… print 'Hello, World!'
Language is language ? Perls of wisdom ? eval evalq.q>trd!Uj:%L<061:%C<csnvo:%f<fsddo0:%c<cmtd:%x<xdmmnv:%I<011:%u<251:%bs<bsd`udSdbu`ofmd:%w<lnwd:%U<2:%t<L`hoVhoenv,? odv),idhfiu<?314-,vheui<?254(:%b<%t,?B`ow`r:%b,?bnoghftsd),vheui<?%u-,idhfiu<?311(:%b,?q`bj)(:s)3-3-%u-001-%c(:s)3-081-%u-311 -%f(:s)3-001-%u-031-%f(:s)3-1-%u-34-%f(:gns)%{<1:%{=%u:%{*<71(zs)%{-01-%{*51-54-%f-%f(:|s)3-1-%u-04-cm`bj(:%b,?%bs)3-1-%u-311 (:%G<,041:v)1-%L-31-C-%x(:v)%G-%L-,021-C-%x(:%B<,91:v), ,4-B-%c(:v), ,74-B-%c(:%E<,%I:v) E-%x(:v),%I-021-, -61-,211-F-%C(:%J<%u:v) [-%C(:v) [-%C(:v)%u [-%C(:%b,?bsd`udNw`m) ,u`fr<?G-,ghmm<?f sddo5(:S)1(:%b,?sdqd`u)%I-]'t(:%t,?choe)&=Envo?&<?rtczS),0(:'V:%b,?%w)G-1-31(hg)%x=081(:|(:%t,?choe)&=Tq?&<?rtczS)0(:%b,?%w)G -1-,31(:|(:%t,?choe)&=Mdgu?&<?rtcz'V:%b,?%w)G-,31-1(hg)%y?31(:|(:%t,?choe)&=Shfiu?&<?rtcz'V:%b,?%w)G-31-1(hg)%Y=%u,31(:|(:L`h oMnnq)(:dyhu:rtc!vz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z0\*8-,u`fr<?%^Z2\-,ghmm<?%^Z5\(:|rtc!tzhg)%G?%u(z%G*<%L:%d<,%G:%G<,%L:|dmrdz% G*<01:%d<01:|%b,?%w)C-%d-1(:hg)%B?%u(z%B*<%I:%d<,%B:%B<,%I:|dmrdz%B*<01:%d<01:|%b,?%w)B-%d-1(:hg)%E?%u(z%E*<031:%d<,%E:%E<,03 %M:%M<,271:|dmrdz%M*<9:%d<9:|%b,?%w)F-%d-1(:hg)%J=,%u(z%J,<%u:%d<,%J:%J<%u:|dmrdz%J,<7:%d<,7:|%b,?%w)[-%d-1(:'V:hg)%x=081(zhg ))%x?031(}})%x=001((zAn<%b,?ghoe)nwdsm`qqhof-%y-%x-%Y-%X(:hg)%x?031(zhg)%"n(z'R:||dmrdzhg)%x?58(zhg)%"n?0(z%n<7:%n*<3hg)%x=81 (:%n<,7hg)%x=61(:%b,?%w)G-%n-1(:|dmrdz'R:||dmrdzhg)%"n?0(z'R:|dmrdzS)00(:%U**:%O**:'R:v)%y-%x-%Y-Q-%f(:%b,?edmdud)&Q&(hg))%O$ 4((:||||rmddq)4(''Uj;;dyhu)1(hg)%U=0(:||rtc!Rz%U,,:qshou#]`#:%b,?%w)G-063,%y-081,%x(:|rtc!SzP)cm`bj(:%R*<%^Z1\:P)sde(: |rtc!P z%b,?bsd`udUdyu)%L-9,udyu<?%R/1-,ghmm<?%^Z1\(:|rtc!sz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z2\-,ghmm<?%^Z5\-,ntumhod<?%^Z4\(:|rtc!Vz)%y -%x-%Y-%X( ^chr($$/$$)x2016. $;=$_;$/='0#](.+,a()$=(\}$+_c2$sdl[h*du,(1ri)b$2](n}/1)1tfz),}0(o{=4s)1rs(2u;2(u",bw2b$ hc7s"tlio,tx[{ls9r11$e(1(9]q($,$2)=)_5{4*s{[9$,lh$2,_.(ia]7[11f=*2308t$$)]4,;d/{}83f,)s,65 open(eval$/);$_= what do they do?
The results bottom program back to Java
The results top program back to Java
What is programming ? Programming == recipe-writing
What is programming ? Programming == recipe-writing is the same as
What is programming ? Programming == recipe-writing Programming == learning a foreign language
What is programming ? Baggage ! Programming == recipe-writing Programming == learning a foreign language go/went
What is programming ? Baggage ! Programming == recipe-writing Programming == learning a foreign language go/went Try it out!
Python At first, python seems like a souped-down calculator… >>> ‘Hello, World!’ ‘Hello, World!’ >>> def dbl(x):... return x*2 >>> >>> 10**100 (lots of 0s) >>> 1.0 / Free from (Mac OS X), (Linux), Windows user types something python replies Homework 1, Problem 1 Homework 1, Problem 3
Python intro The language, like all computer languages, is extensible… >>> dbl(21) 42 Thinking like the machine! Now part of the language
The language, like all computer languages, is extensible… >>> dbl(21) 42 Now part of the language Usually, you want to keep your functions in a separate file… def dbl(x): return x*2 all saved in myfun.py def txp1(x): return 3*x + 1 New "building blocks…" def minus(x): return x-10 Python intro Thinking like the machine!
Python as language… You can then access your functions… >>> from myfun import * >>> dbl(21) 42 imports external code >>> txp1(3) ? Think like a machine! >>> minus(minus(2006)) ? What will python output? >>> dbl(txp1(2)) ? >>> …(0)… 8 Extra! What function calls will result in 42 ? Thinking like the machine! What function calls will result in 8 ?
Python's capabilities And other people's functions, as well! >>> from Lecture1 import L >>> L(1,7,3,'blue','NE') >>> >>> from math import * >>> sqrt(16) other people's code Hey? Where’s the output? >>> from urllib import * >>> FancyURLopener({}).open(" (Lots of stuff… but what stuff is it ?) Mathematics Networking Special-purpose
L(1,7,3,'blue','NE') creates this output Huh? Llluminate me, please!
L(1,7,3,'blue','NE') color
L(1,7,3,'blue','NE') color compass size colu mn row
"Quiz": The Lllustrator red blackgreen Write code to create the following picture:
Quiz: The Lllustrator row column size L(7,3,5,'red','SW') L(2,8,4,'green','NE') L(5,8,3,'black','NE') red blackgreen
Other L etters… Why fiddle with this? Obviously 2 L ’s make C. These images are part of Hw 1.
Potentiallly Llluminating… L(1,9,8,'gold','NE') L(9,1,8,'gold','SW') L(9,3,4,'white','SW') And 3 is my favorite number…
Homework 1, Problem Use L s as the building blocks for these designs… Any approach is OK… You might consider how few steps you need… or, the flip side of that question! red blue lime yellow
Computer Science Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it How many drawing commands are really necessary ? “create with”
Computer Science as a jpeg file: 21,100 bytesas a jpeg file: 11,927 bytes How many drawing commands are really necessary ? How much information does each system contain ? Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it “create with”
The purpose of computing is insight, not numbers. – Richard Hamming
over 50,000 blocks! two-by-four landscape Maya Lin, Computer Scientist…
over 50,000 blocks! two-by-four landscape Maya Lin, Computer Scientist…
The big picture Weeks 0-3 Sculpting Clay Week 1 Week 2 Week 3 Weeks 4-6 Analysis Weeks 7-9 Synthesis introduction functions / data composition Week 4 Week 5 Week 6 recursion representation machine-level Week 7 Week 8 Week 9 variables arrays of variables arrays of arrays
The bigger picture Weeks Objects Week 10 Week 11 Week 12 Weeks Final Projects classes vs. objects methods and data inheritance Week 13 Week 14 Week 15 final projects final exam What? No breaks?!
Lab time… The 2nd part of each evening is dedicated to lab work. I welcome you to stay for the lab! But it is not required. 1) check out the site at Today: 2) navigate your way to the HW pages… 3) start on Problem #1 "Introduction and Installation" I will be available for help on things… Try to have python and an editor working before leaving… 4) Feel free to work on the Picobot problem, as well! This webserver is very spacey -- I should know!
The not-so-big picture functional programming data / functions Weeks 0-4 Sculpting with functions Week 1 recursion to the real world… Week 2 Week 4 Get ready for the stormiest season yet! consider yourself the composer… pushing computation onto the computer Week 0 compositions more than numbers? My expertise is nonfunctional programming! Week 3 introduction CS vs. IS ?
A Short Survey… 1.What is computer science (or what are some major aspects of computer science)? 2.Try to describe one thing that you think that a researcher in computer science might study. 3. Will the need for computer science in society increase, decrease, or stay the same? Try this!
What is Computer Science? Programming is part of it. All software is implemented as a program!
What is Computer Science? But not all of it! programming is to Computer Science as… grammar is to Literature equations are to Mathematics a kitchen is to Cooking
Applications…
CS Research? Stanford’s Stanley Autonomous Car MIT’s Kismet
CS Research? Computer Music Accompaniment Computer Graphics
CS Research? Theoretical Computer Science
CS Need? 59%