-
Open the Terminal
-
Use
mysqldumpto backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql -
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
| fun main(args: Array<String>) { | |
| val simran = Person("Simran", "Singh") | |
| simran.greet() | |
| simran.completeAddress("Mohali", "Punjab", zip = "160063", country = "India") | |
| // As the 'getCompleteAddress()' is returning an Optional String, we are using 'elvis' operator to check for | |
| // 'null' value, and if it is null than use some default method. | |
| println(simran.getCompleteAddress() ?: "Unknown") | |
| // Another way of doing this is using 'let' expression | |
| simran.getCompleteAddress().let { |
| extension Data { | |
| // Converts JSON data to specified object | |
| func fromJsonData<T : Decodable>(to type: T.Type) throws -> T { | |
| return try JSONDecoder().decode(T.self, from: self) | |
| } | |
| } | |
| struct AccResponse : Codable { | |
| let acc: Acc |
| import UIKit | |
| class ViewController: UIViewController { | |
| // TOP LEFT | |
| let view1 : UIView = { | |
| let view = UIView() | |
| view.translatesAutoresizingMaskIntoConstraints = false | |
| view.backgroundColor = .red | |
| return view |
| import Foundation | |
| import SystemConfiguration.CaptiveNetwork | |
| func getWiFiSsid() -> String? { | |
| var ssid: String? | |
| if let interfaces = CNCopySupportedInterfaces() as NSArray? { | |
| for interface in interfaces { | |
| if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? { | |
| ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String | |
| break |
| override func viewWillTransition(to size: CGSize, | |
| with coordinator: UIViewControllerTransitionCoordinator) { | |
| if UIDevice.current.orientation.isLandscape { | |
| print("Landscape") | |
| chatButton.removeTarget(self, action: #selector(handleChatButtonClick), for: .touchUpInside) | |
| } else { | |
| print("Portrait") | |
| chatButton.addTarget(self, action: #selector(handleChatButtonClick), for: .touchUpInside) | |
| } | |
| } |