This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function is a Special type of Closure. | |
| Function is a named closure | |
| // This is a function that takes an Int and prints it. | |
| let a = {(i: Int) -> (Int) in i * 3} | |
| //{(parameters) -> (return type) in expression statements} | |
| a(3) | |
| let x = [1, 2, 3, 4, 5] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://wireframe.cc/DMi11X | |
| You work for Apple Inc headed by CEO Tim Cook. | |
| He hires you as a Data Analytics CTO. You are responsible for helping Tim Cook run reports on Sales Dept as well and Accounting to see Profit and Loss. | |
| Tim Cook says welcome to you and says I need a report on all product lines iOS, MacBook, and Apple Watch. A Total of 6 reports. | |
| Tim says: There are certain things I want, which is I want them emailed to me, I want the font to be the font of Late Steve Jobs and I don't want it more than one page per report. | |
| But I'm not going to micromanage this process I'm going to let my Senior Vice Presidents dictate the rest. | |
| https://www.apple.com/pr/bios/ | |
| Senior Vice President of Sales |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var airports: [String: String] = ["YYZ": "Toronto Pearson", "DUB": "Dublin"] | |
| airports["LHR"] = "London" | |
| for airportCode in airports.keys { | |
| println("Airport code: \(airportCode)") | |
| } | |
| Talk about relationship to JSON and JSON Viewer. Show him Currency App |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Classes vs Structs | |
| struct Resolution { | |
| var width = 0 | |
| var height = 0 | |
| } | |
| class VideoMode { | |
| var resolution = Resolution() | |
| var interlaced = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Currencies: NSObject { | |
| class func getExchangeRate(#baseCurrency: String, foreignCurrency:String){ | |
| let baseURL = kAPIEndPoint | |
| let query = String(baseCurrency)+"_"+String(foreignCurrency) | |
| var finalExchangeRate = 0.0 | |
| if let url = NSURL(string: baseURL + query) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [HRData] | |
| GO | |
| /****** Object: StoredProcedure [dbo].[usp_Calculate_PTOAccrual] Script Date: 02/27/2015 10:46:35 ******/ | |
| SET ANSI_NULLS ON | |
| GO | |
| SET QUOTED_IDENTIFIER ON | |
| GO | |
| ALTER PROCEDURE [dbo].[usp_Calculate_PTOAccrual] ( | |
| @UserID INT = NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let pickedImage:UIImage = "SOME IMAGE" | |
| let scaledImage = scaleImageWith(pickedImage) | |
| let imageData = UIImagePNGRepresentation(scaledImage) | |
| let imageFile:PFFile = PFFile(data: imageData) | |
| PFUser.currentUser().setObject(imageFile, forKey: "imageFieldName") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -> JPUserTableViewCell! { | |
| let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as JPUserTableViewCell | |
| cell.imageView.hidden = true | |
| (cell.viewWithTag(1) as PFImageView).image = kProfileDefaultProfileImage | |
| dispatch_async(dispatch_get_main_queue(),{ | |
| //cell.textLabel?.text = object["username"] as? String | |
| if let profileImageData = object["profileImage"] as? PFFile { | |
| println(profileImageData) | |
| cell.imageView.file = profileImageData |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // JPUsersTableViewController.swift | |
| // BaseballCardSocialNetwork | |
| // | |
| // Created by Eric Gu on 2/19/15. | |
| // Copyright (c) 2015 Eric Gu. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func checkWinCondition (column: Int, row: Int){ | |
| let alert = UIAlertView() | |
| alert.title = "Four In a Row! Game Over!" | |
| alert.addButtonWithTitle("OK") | |
| for row in 0..<gameBoard.rows { | |
| for column in 0..<gameBoard.columns { | |
| //horizontal | |
| if(isLinearMatch(column: column, row: row, stepX: 1, stepY: 0)){ |