Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Meeting 2 - 10/17/12

Avatar for Andrew Berls Andrew Berls
October 18, 2012

Meeting 2 - 10/17/12

Avatar for Andrew Berls

Andrew Berls

October 18, 2012
Tweet

More Decks by Andrew Berls

Other Decks in Programming

Transcript

  1. November 6 //Green Hills Software Internships Looking for talented programmers!

    (That means you!) Develops: - Compilers - Debuggers - Operating systems Works in embedded systems. Customers include: Toyota, Boeing, HP, Nintendo, Lockheed Martin, and NASA Submit your resume on Gaucho Link before October 26th! Info session: 11/5/12, 6pm in the UCen SB Mission Room
  2. Mission Linen Internship • Mission Linen Supply is seeking a

    .NET Software Test Engineer Intern at their Santa Barbara office • Build your skills in the latest Microsoft tools including Visual Studio, SQL Server, C# • Use agile development methodology and write code in a team environment • Flexible hours around your class schedule, $16/hr • Send a resume to: [email protected]
  3. ACM-ICPC Regional Contest • Intercollegiate team-based programming competition in Riverside

    • The regional contest is coming up and we need people to sign up! • Teams of 3 - sign up with a group or we can match you with people • Talk to one of us or email [email protected]
  4. Raspberry Pi • An ARM GNU/Linux box for $25 that

    plugs into a TV/keyboard • Can play HD video! • Anybody ever used one?
  5. • Racks made of lego hold 64 units in a

    cluster • Total memory: 1TB (16GB SD cards on each unit) • Uses Message Passing Interface (MPI) over Ethernet • First task: Calculate Pi on the Raspberry Pi using MPI Raspberry Pi - "supercomputer" cluster
  6. WebcamSwiper • An experiment using getUserMedia to watch for swipes

    left and right with a hand • Demo: http://iambrandonn.github.com/WebcamSwiper/ • Blog post + link to source: http://tripleequals.blogspot. com/2012/09/webcam-swiper.html
  7. • Write us a pizza calculator! • Write a function

    called numPizzas, that takes the number of people present, the number of slices in a pizza, and the time of day, and returns the number of pizzas to buy (as a whole integer). • More info is on handouts - grab a copy! Coding Time!
  8. int num_pizzas(unsigned int num_people, unsigned int slices_per_pizza, unsigned int time)

    { unsigned int num_slices; num_slices = num_people; if (11 <= time && time <= 22) num_slices *= 2; return (int)(num_slices / (float)slices_per_pizza + 1); } C
  9. def numPizzas(numPeople, slicesPerPizza, time) total_slices = (time.between?(11, 22)) ? (numPeople

    * 2) : numPeople (total_slices / slicesPerPizza .to_f).ceil end between?(x, y) useful for range checking • 2.between?(0, 10) => true ◦ Calling a method on integer literal 2 - everything is an object in Ruby! Ruby
  10. Haskell nPizza p s t = ceiling $ (/ s)

    $ if t `elem` [11..22] then p * 2 else p Background: • $ calls the function (which is the left argument) on the value which is the right argument • if-statements are expressions that evaluate to values • backticks apply a function using infix notation ◦ plus 1 2 is equivalent to 1 `plus` 2 ◦ No parens around args for function calls So: • (/ s) generates a function which takes the value to the right of the $ and divides it by s • ceiling is then evaluated on the result
  11. • I live really far away from CSIL • ssh

    is my friend! :) Start a remote session! • ssh <username>@csil.cs.ucsb.edu Or log on to a specific machine: ssh <username>@<machine>.cs.ucsb.edu Ex: ssh [email protected] Connecting to CSIL
  12. • scp - Secure Copy • Transfer files from your

    computer to your CSIL account File: scp hello.txt <username>@<csil.cs.ucb.edu:hello.txt Directory: scp test/ <username>@<csil.cs.ucb.edu:test • Then you can remote login for turnin, etc Sort of a pain. (I cheat and use a GUI FTP client like FileZilla) http://filezilla-project.org/ Uploading Files
  13. • Uploaded your files but need to make a quick

    change? • Pain to edit locally and re-upload. Time to break out <insert favorite command line editor here!> Remote Editing vs
  14. • I am a huge Sublime Text fanboy • iTerm

    is a nice Terminal replacement for Macs • Homebrew is a pretty cool package manager too. • What's your setup? Local Dev Environment +