-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparams.json
7 lines (7 loc) · 18.2 KB
/
params.json
1
2
3
4
5
6
7
{
"name": "iOS App Development with Swift",
"tagline": "Harvard Pre-College Program CSCI S-14600, Session I",
"body": "### Jump to:\r\n**Week 0:** [Day 0](#day-0), [Day 1](#day-1), [Day 2](#day-2), [Day 3](#day-3), [Day 4](#day-4)<br />\r\n**Week 1:** Day 5, [Day 6](#day-6), [Day 7](#day-7), [Day 8](#day-8), [Day 9](#day-9)\r\n\r\n## Description\r\nThis course is an introduction to programming using Swift, Apple's new programming language for Macs and iOS devices. Through Swift, we explore the basics of programming and introduce fundamental computer science topics like abstraction, algorithms, basic data structures, and recursion. The course also features practical programming topics such as scripting, command line interfaces, application programming interfaces, debugging, integrated development environments, understanding documentation, and developing software both in isolation and as a team. By the end, each student designs and implements an app that can be deployed to iOS devices, like an iPhone or an iPad. Students must bring a MacBook, MacBook Air, or MacBook Pro running Mac OS10.11 or higher.\r\n\r\n## Accessibility\r\n\r\nThe Summer School is committed to providing an accessible academic community. The [Accessibility Services Office](http://summer.harvard.edu/campus-life/accessibility-student-services) offers a variety of accommodations and services to students with documented disabilities.\r\n\r\n## Academic Integrity\r\n\r\nYou are responsible for understanding [Harvard Summer School policies on academic integrity](http://summer.harvard.edu/policies/student-responsibilities) and how to use sources responsibly. Please be sure to read through the responsibilities, as not knowing the rules or misunderstanding the rules are not acceptable excuses. Please contact the staff if you have any questions about academic honesty.\r\n\r\n## Schedule\r\nThis course is held during Session I of the 2016 Harvard Pre-College Program which runs from Monday, 27 June through Friday, 8 July. Class is held Monday through Friday from 8:30am to 11:30am in [1 Story Street room 304](https://goo.gl/maps/bVi9HwpQVRt).\r\n\r\n## Office Hours\r\n\r\nOffice Hours are held by one or more TFs from 7PM to 9PM in the Dunster House dining hall on the dates listed below!\r\n\r\nWeek|Days\r\n----|----\r\n0|Monday, Tuesday, Wednesday, Thursday\r\n1|Sunday, Tuesday, Wednesday, Thursday\r\n\r\n### Day 0\r\nAbstraction, algorithms, pseudocode, source code, compilation and interpretation. Swift basics: variables, boolean expressions, logical operators, arithmetic, and control flow.\r\n\r\n#### Documentation and Source\r\n1. [Apple's Swift documentation](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html)\r\n1. [Notes from today's class](https://docs.google.com/document/d/1DvVNcu0GrCt8P07lOlHY0SGr5rBMmm7yazXnN4-tYMk/edit#). Thanks, [Annie](#staff)!\r\n1. Today's source code:\r\n * [Basics](https://raw.githubusercontent.com/danallan/swift-precop/master/day-0/0-src/0-basics.playground/Contents.swift)\r\n * [Types](https://raw.githubusercontent.com/danallan/swift-precop/master/day-0/0-src/1-types.playground/Contents.swift)\r\n\r\n#### Homework\r\n1. Install Xcode 7.3.1 (on Mac OS X 10.11.5, if possible).\r\n1. Attempt the below problems. You must complete one, try to complete two!\r\n\r\n* _Temperature conversion_. Create a new playground and save it as \"Celsius\". In this playground, write a few lines of code that converts a variable containing some degrees in Fahrenheit, called `f`, to Celsius. And then implement the reverse, to convert back! Be sure to test your code. Below is a code fragment to get you started.\r\n```\r\n// YOUR NAME HERE\r\n// you@email.com\r\n//\r\n// Fahrenheit converter\r\n\r\nvar f = 32\r\nlet Celsius = // your code here, using the `f` variable\r\n\r\nvar c = 10\r\nlet Fahrenheit = // your reverse code here\r\n```\r\n\r\n* _Diamonds_. In a new playground called Diamond, generate a Diamond using Swift as shown below. You can open the console by opening the Debug area in the following menu: **View > Debug Area > Show Debug Area**.\r\n\r\n![diamond](images/diamond.png)\r\n\r\nThe input should be the number of lines. To get you started, begin with this:\r\n```\r\n// YOUR NAME HERE\r\n// you@email.com\r\n//\r\n// Diamonds!\r\n\r\nlet NUM_LINES = 11\r\n\r\n// for loops here\r\n```\r\nBe sure to pay close attention to how many stars are on each line. Use `for` loops to create this design! You might first try creating pyramid shapes to get started:\r\n\r\n![pyramid](images/pyramid.png)\r\n\r\nHint: The `print()` adds a line break to the end of the print statement by default. To turn this off, use the `terminator:\"\"` parameter, like so: `print(\"your string here\", terminator:\"\")`.\r\n\r\n* Credit card verification. If you want to ramp up the challenge, attempt the following (only in the \"Bad Credit\" section) but in Swift, rather than C! [Bad Credit](https://cdn.cs50.net/2015/spring/psets/1/hacker1/hacker1.html#bad_credit)\r\n\r\nNote: Swift doesn't (easily) allow for input from standard in, so don't use the GetLongLong function (which doesn't exist anyway). Instead, just input it as a 64-bit int like so:\r\n\r\n```\r\nlet card = 378282246310005\r\n```\r\n\r\n### Day 1\r\nLoops, arrays, functions, optionals, tuples.\r\n\r\n#### Source\r\n1. Diamond staff solutions. [Cheng](https://raw.githubusercontent.com/danallan/swift-precop/master/day-1/1-ans/diamond-cheng.playground/Contents.swift) (TF from last year. Thanks, [Cheng](https://linkedin.com/in/ummcheng)!), [Dan](https://raw.githubusercontent.com/danallan/swift-precop/master/day-1/1-ans/diamond-dan.playground/Contents.swift).\r\n1. [Arrays, Functions, Optionals, `zip` student-supplied solution, modified to include tuples](https://raw.githubusercontent.com/danallan/swift-precop/master/day-1/1-src.zip)\r\n\r\n#### Homework\r\n\r\nAt a minimum, complete the first three.\r\n\r\n1. Adapt your `zip` solution (finishing it, if necessary!) to return a type of `[(Int?, Int?)]`, which will allow two lists of different lengths. You may optionally provide names to the tuple, like `[(zeroth: Int?, first: Int?)]`.\r\n1. Create a simple gradebook program based on dictionaries.\r\n 1. First, read Apple's documentation on [dictionaries](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html#//apple_ref/doc/uid/TP40014097-CH8-ID113).\r\n 2. Second, re-familiarize yourself with the gradebook functionality from today's [Functions source](https://raw.githubusercontent.com/danallan/swift-precop/master/day-1/1-src.zip) from class to use dictionaries. Specifically, note that we have implemented two functions: `printGradeCount()` and `average()`. We intentionally did not go over dictionaries in class so that you gain some experience reading documentation to achieve a particular programming goal!\r\n 3. Write a program that allows categorization of grades. For example, a class might have `exam` grades, `homework` grades, `participation` grades, etc. You could model this with a dictionary by having a dictionary key represent every category.\r\n 4. For this program, `printGradeCount()` should accept a dictionary and it should then print the number of grades for each category. `average()` should accept a dictionary and print the grade average for every category. For example:\r\n ```\r\nlet grades = [\"exams\": [100, 90], \"homework\": [50, 85, 67]]\r\nprintGradeCount(grades)\r\naverage(grades)\r\n ```\r\n Should print:\r\n ```\r\nexams: 2\r\nhomework: 3\r\nexams: 95\r\nhomework: 67.3333333333333\r\n ```\r\n1. [Download this Playground](https://github.com/danallan/swift-precop/blob/master/day-1/1-hw/morseCode.playground.zip?raw=true) and follow the directions to complete the problems, which are a collection of functions related to encoding and decoding morse code. Thanks, [Hari](#staff)!\r\n1. If you still have time, finish completing the Bad Credit exercise from [Day 0](#day-0). Or, if you've already completed it, revisit it and see if you can improve the design of the code, incorporating any lessons from today to make the code more idiomatic.\r\n\r\n### Day 2\r\nTheory of computation, programming paradigms. Closures, lambdas, higher-order functions.\r\n\r\n#### Source\r\n1. [Staff solutions](https://github.com/danallan/swift-precop/blob/master/day-2/2-ans.zip?raw=true) for zip with optional ints and Morse.\r\n1. [Closures, anonymous functions, and higher-order functions](https://github.com/danallan/swift-precop/blob/master/day-2/2-src.zip?raw=true)\r\n\r\n#### YouTube\r\n\r\nProvided for fun, each offers a little more information on topics addressed in class.\r\n\r\n1. [Halting problem](https://www.youtube.com/watch?v=92WHN-pAFCs)\r\n1. [Vsauce: how to count past infinity](https://www.youtube.com/watch?v=SrU9YDoXE88)\r\n\r\n#### Homework\r\n\r\nTry to complete all of the below problems.\r\n\r\n1. Create a `reduce` function that is higher-order. It should accept an array of doubles (`[Double]`), an initial value `i` of type `Double`, and a function `f`, which itself takes as parameter two `Double` values and returns a `Double`. The function calls `f` first with the initial condition and the first element in the list, and stores the output. It then takes the output, and calls `f` with the output and the next element in the list, and so on. In short, it combines all of the elements in the list to a single value by relying on a function `f` to do the combination. Below is a sample of how you might call the function, which when run should return the value `10.0`, since it sums the values in the list.\r\n ```\r\nreduce([1.0, 2.0, 3.0, 4.0], i: 0.0, f: { $0 + $1 })\r\n ```\r\n1. Use the `mapper`, `filter`, and `reduce` HOFs to achieve the following:\r\n 1. Multiply all elements of a list together.\r\n 1. Transform an array of values represented in Fahrenheit to Celsius.\r\n 1. Find the largest element of a list.\r\n 1. Transform a double array into it's reciprocal values. Be sure to get rid of 0s! For example: `[-0.5, 0, 8]` should become to `[-2, 0.125]`\r\n1. Write a function called `quickSort` that takes in an unsorted `Double` array and outputs a sorted `[Double]`. [Quicksort works](https://www.khanacademy.org/computing/computer-science/algorithms/quick-sort/a/overview-of-quicksort) by selecting a \"pivot\" element, partitioning the array into three categories: all elements smaller than or equal to the pivot, the pivot, and all elements larger than the pivot, and then recursively applying quicksort to each category. Because it is recursive, quicksort has a base case when the array size is 1: it should just return the array. As a small hint, this function should use at least one of the higher order functions we discussed in class!\r\n1. Write a function, called `curry`, that accepts a function that normally requires two `Double` parameters (like `pow`), and allows partial application of that function. In other words, although we'd normally call `pow(x, y)`, after we pass it to curry we should get a new function, `exp`, that allows `exp(x)(y)`. More specifically, although we'd normally run `pow(2, 3)`, perhaps we only want to partially apply the function as follows:\r\n```\r\nlet exp = curry(pow)\r\nlet base = exp(2)\r\nbase(3) // outputs 8\r\n```\r\n\r\n### Day 3\r\nASCII, Unicode, representing values with binary and hexadecimal. Aliasing types, generics, `inout` parameters.\r\n\r\n#### Source\r\n1. [Staff solutions](https://github.com/danallan/swift-precop/blob/master/day-3/3-ans.zip?raw=true) for zip with optional ints and Morse.\r\n1. [Generics, Color, and an obfuscated swap function showing `inout`](https://github.com/danallan/swift-precop/blob/master/day-3/3-src.zip?raw=true) (Thanks, [Jack](#staff), for generics and swap!)\r\n\r\n#### YouTube\r\n\r\nProvided for fun, each offers a little more information on topics addressed in class.\r\n\r\n1. [Minute Physics: Computer Color is Broken](https://www.youtube.com/watch?v=LKnqECcg6Gw)\r\n\r\n#### Homework\r\n\r\nComplete at least the first two problems of this [Day 3 Homework playground](https://github.com/danallan/swift-precop/blob/master/day-3/3-hw.zip?raw=true)!\r\n\r\nYou may find the following YouTube videos useful to understand the homework problems:\r\n\r\n1. [CS50: Caesar cipher](https://www.youtube.com/watch?v=36xNpbosfTY)\r\n1. [CS50: Vigenère cipher](https://www.youtube.com/watch?v=9zASwVoshiM)\r\n\r\n\r\n### Day 4\r\nBasic encryption. Algorithmic complexity, parallelism. Game of Fifteen, Xcode, iOS, Storyboards, constraints.\r\n\r\n#### Source\r\n\r\n1. [Solutions to Day 3 homework](https://github.com/danallan/swift-precop/blob/master/day-4/4-ans.zip?raw=true)\r\n1. [MapReduce (includes exercises)](https://github.com/danallan/swift-precop/blob/master/day-4/4-src/MapReduce.zip?raw=true)\r\n1. [Hello World iOS Application](https://github.com/danallan/swift-precop/blob/master/day-4/4-src/HelloWorld.zip?raw=true)\r\n1. [Gallery app](https://github.com/danallan/swift-precop/blob/master/day-4/4-src/gallery.zip?raw=true). Loads images over the internet; we will cover this in more detail on Tuesday.\r\n\r\n#### Homework\r\n\r\nAttempt MapReduce exercise. Begin Game of Fifteen exercises. You may choose how far along you wish to complete the Game of Fifteen exercises, but keep in mind: the more of these you do now, the more time you will have to polish your Game of Fifteen iOS app next week!\r\n\r\n1. [MapReduce (exercises include in source code showed in class)](https://github.com/danallan/swift-precop/blob/master/day-4/4-src/MapReduce.zip?raw=true). Pay close attention to the instructions to discover how to set up the `aliceinwonderland.txt` file so it can be discovered by the Playground.\r\n1. [Game of Fifteen exercises](https://github.com/danallan/swift-precop/blob/master/day-4/4-hw.zip?raw=true)\r\n1. Send all homework for Week 0 (Days [0,3]: Monday through Thursday) [to Dan](mailto:danallan@cs.harvard.edu) in zip files. If you have already sent, thank you! No need to do so again.\r\n\r\n### Day 5\r\n_4 July, 2016: Independence Day holiday_\r\n\r\n### Day 6\r\nSwift classes, enums, and structs. iOS, continued, and the application lifecycle, multi-threaded applications. Programmatic creation of UI elements.\r\n\r\n#### Source\r\n\r\n1. Updated and discussed [day 4's gallery app](https://github.com/danallan/swift-precop/blob/master/day-4/4-src/gallery.zip?raw=true).\r\n1. [Skeleton code for Game of Fifteen](https://github.com/danallan/swift-precop/blob/master/day-6/6-src.zip?raw=true)\r\n\r\n#### Homework\r\n\r\nHaving now switched to project mode, we're working towards implementing a Game of Fifteen app for iOS.\r\n\r\n1. Take skeleton code from class and attempt to put constraints on the game board so that it appears square and fully centered on the device screen, sized appropriately for the device.\r\n1. Create the 15 tiles programmatically, sizing them correctly inside the game board.\r\n1. Continue working on Game of Fifteen exercises from [day 4](#day-4), if you haven't yet finished them.\r\n\r\n### Day 7\r\nDebugging. UI element practice including bounds, frames, animation, timers. \r\n\r\n#### Source\r\n1. [Staff class](https://github.com/danallan/swift-precop/blob/master/day-7/7-src/Staff.zip?raw=true) that provides `isBoardSolvable()`\r\n1. [Animations, countdown, alerts](https://github.com/danallan/swift-precop/blob/master/day-7/7-src.zip?raw=true)\r\n\r\n#### Homework\r\n\r\nContinue working on Game of Fifteen project, bundling the exercises into an app, drawing the board, and connecting the elements.\r\n\r\n### Day 8\r\nUI elements, continued: alerts and action sheets. Placing apps on your phone.\r\n\r\n#### Compile your app on phone\r\n\r\n1. Create a free [Apple Developer](https://developer.apple.com) account.\r\n1. Fetch your device's identifier from Xcode: connect your phone to your computer with a USB cable, unlock it and tap \"Trust\". On your computer, Open Xcode, click the \"Window\" menu and open \"Devices\", select your device, and copy the **full string** named \"Identifier\".\r\n1. Submit both the email address you used to create the Developer account and the device's identifier to [this Google form](https://docs.google.com/forms/d/11ft2ep3fJwALsciZTDPBxncYSZg_8GNa_jSoDTP-7rQ/viewform). We'll then invite you.\r\n\r\n#### Homework\r\n\r\nComplete and put finishing touches on your Game of Fifteen app!\r\n\r\n### Day 9\r\nWrap-up. \r\n\r\n#### Source\r\n\r\n1. Look at Annie's phenomenal write-up on [women in Computer Science](https://docs.google.com/document/d/1Bc59qEGDKaDeI-j-vXnvBy5UgMf3x44xaUau8CMx-8M/edit), which includes resources and a personal perspective on being a minority in the field.\r\n1. Download the [staff solution](https://github.com/danallan/swift-precop/blob/master/day-9/staff-nPuzzle.zip?raw=true) to the Game of Fifteen, which we've called _nPuzzle_ since it can generate boards of different sizes. Compare how we implemented the project compared to your own work!\r\n\r\n## Staff\r\n\r\n | | | | \r\n------|------|------|------|-----\r\n![Dan](http://www.gravatar.com/avatar/18ab7e51859c303fd34aae011de9f326?s=75&d=retro)|**Dan Armendariz**|Instructor|[Email](mailto:danallan@cs.harvard.edu)|[Web](http://www.danallan.net), [Instagram](https://instagram.com/danallan)\r\n![Hari](http://www.gravatar.com/avatar/c3110d65e4b139c1ab420ecd1e148be9?s=75&d=retro)|**Hari Anbarasu**|Teaching Fellow|[Email](mailto:hari.anbarasu@yale.edu)|[Facebook](https://www.facebook.com/hari.anbarasu)\r\n![Annie](http://www.gravatar.com/avatar/3ab17dca94fba6848f0ba833920b53b2?s=75&d=retro)|**Annie Chen**|Teaching Fellow|[Email](mailto:annie.chen@yale.edu)|[Chrome Store](http://tiny.cc/catcaller)\r\n![Jack](http://www.gravatar.com/avatar/0875dba2e3ba4e44ac87eaf70df51f51?s=75&d=retro)|**Jack Deschler**|Teaching Fellow|[Email](mailto:deschler.jack@gmail.com)| \r\n![AJ](http://www.gravatar.com/avatar/f54bf6725c211425d0835686c5412e53?s=75&d=retro)|**Arturo J. Real**|Teaching Fellow|[Email](mailto:arturo@cs50.harvard.edu)|[Twitter](http://www.twitter.com/arturojreal)\r\n![Stelios](http://www.gravatar.com/avatar/e05a8396dff43d20b2a251187ea06696?s=75&d=retro)|**Stelios Rousoglou**|Teaching Fellow|[Email](mailto:stelios@cs50.net)|[LinkedIn](https://www.linkedin.com/in/steliosrousoglou), [Facebook](https://facebook.com/steliosrousoglou)",
"google": "",
"note": "Don't delete this file! It's used internally to help with page regeneration."
}