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
| [mysqld] | |
| datadir=/var/lib/mysql | |
| socket=/var/lib/mysql/mysql.sock | |
| # Disabling symbolic-links is recommended to prevent assorted security risks | |
| symbolic-links=0 | |
| # Settings user and group are ignored when systemd is used (fedora >= 15). | |
| # If you need to run mysqld under a different user or group, | |
| # customize your systemd unit file for mysqld according to the |
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 favoriteProgramingLanguage = "Swift" | |
| let year = 2014 // Int | |
| var version = 2.0 // Double | |
| var isAwesome = true // Bool | |
| var someString = "" |
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
| // Swift Functions | |
| func calculateArea(length: Int, width: Int) -> Int { | |
| let area = length * width | |
| return area | |
| } | |
| // Room 1 | |
| let areaOfRoom1 = calculateArea(10, width: 8) |
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 x1 = 0 | |
| let y1 = 0 | |
| let coordinate1: (x: Int, y: Int) = (0,0) | |
| coordinate1.x | |
| struct Point { | |
| let x: Int | |
| let y: Int | |
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 Point { | |
| var x: Int | |
| var y: Int | |
| init(x: Int, y: Int){ | |
| self.x = x | |
| self.y = y | |
| } | |
| } |
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
| struct User { | |
| var fullName: String | |
| var email: String | |
| var age: Int | |
| } | |
| var someUser = User(fullName: "Thanh Luu", email: "[email protected]", age: 27) | |
| var anotherUser = someUser |
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 week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] | |
| func weekdayOrWeekend(day: String) -> String { | |
| switch day { | |
| case "Saturday", "Sunday": return "Weekend" | |
| case "Monday", "Tuesday", "Wednesday", "Thursday", "Friday": return "Weekday" | |
| default: return "This isn't a valid day in the Western calendar" | |
| } | |
| } |
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
| struct Person { | |
| let firstName: String | |
| let middleName: String? | |
| let lastName: String | |
| func getFullName() -> String { | |
| if middleName == nil { | |
| return firstName + " " + lastName | |
| } else { | |
| return firstName + " " + middleName! + " " + lastName |
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 Point { | |
| var x: Int | |
| var y: Int | |
| init(x: Int, y: Int){ | |
| self.x = x | |
| self.y = y | |
| } | |
| } |
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 Address { | |
| var streetName: String? | |
| var buildingNumber: String? | |
| var apartmentNumber: String? | |
| } | |
| class Residence { | |
| var address: Address? | |
| } |