- В приорітеті реалізувати додавання і видалення записів, редагування як бонус.
- На вибір дається три завдання, тобто в кожного буде ідивідуальне завдання, обирати однакові теми не допустимо.
- Завдання даються з прицілом на самостійний R&D, тому не даються ні повні описи структур ні типів і т.д.
- Приклади допустимих запитів описують потенційно допустимі зв'язки між сущностями, а не являються такими які обов'язково треба реалізувати в такому вигляді в якому вони описані.
This file contains 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
import 'package:flutter/material.dart'; | |
import 'dart:math' as math; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
This file contains 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
import 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
class DiscData { | |
static final _rng = Random(); | |
final double size; | |
final Color color; | |
final Alignment alignment; |
This file contains 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
set currentValue to ¬ | |
(do shell script ¬ | |
"defaults read com.apple.menuextra.clock 'IsAnalog'") ¬ | |
as integer as boolean | |
do shell script ¬ | |
"defaults write com.apple.menuextra.clock 'IsAnalog' -bool " & (not currentValue) & ";" | |
This file contains 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
import Cocoa | |
let session = URLSession(configuration: URLSessionConfiguration.default) | |
var getTask = URLSessionTask() | |
var request = URLRequest(url: URL(string: "https://itunes.apple.com/search?term=jack+johnson&limit=25")!) | |
request.httpMethod = "GET" | |
getTask = session.dataTask(with: request, completionHandler: { (data, response, error) in | |
debugPrint("(data \(data != nil), response \(response), error \(response)") |
This file contains 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
private func highlight(_ substring: String, in string: String, color: UIColor = UIColor(named: "Blue")!) -> NSAttributedString { | |
let defaultAttributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14.0), | |
NSAttributedString.Key.foregroundColor: UIColor.white] | |
let text = NSMutableAttributedString(string: string, attributes: defaultAttributes) | |
if let fillableRange = string.nsRange(of: substring) { | |
text.addAttribute(NSAttributedString.Key.font, value: UIFont.boldSystemFont(ofSize: 14.0), range: fillableRange) | |
text.addAttribute(NSAttributedString.Key.underlineColor, value: color, range: fillableRange) | |
text.addAttribute(NSAttributedString.Key.underlineStyle, value: 1, range: fillableRange) |
This file contains 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
extension KeyedDecodingContainer { | |
func decode(_ type: [String: Any].Type, forKey key: K) throws -> [String: Any] { | |
let container = try self.nestedContainer(keyedBy: JSONCodingKeys.self, forKey: key) | |
return try container.decode(type) | |
} | |
func decodeIfPresent(_ type: [String: Any].Type, forKey key: K) throws -> [String: Any]? { | |
guard contains(key) else { | |
return nil |
This file contains 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 application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
if let userInfo = launchOptions?[.remoteNotification] as? [AnyHashable: Any] { | |
// Parsed notification here | |
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "openPush"), object: nil, userInfo: userInfo) | |
} else { | |
// Ordinary opened app | |
} | |
return true | |
} |
This file contains 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
protocol Chainable { | |
var id: String? { get set } | |
var afterId: String? { get set } | |
} | |
extension Array where Element: Chainable { | |
func chained() -> [Element] { | |
let ids: [String] = self.flatMap{ return $0.id ?? "-1" } | |
let afterIds: [String] = self.flatMap{ return $0.afterId ?? "-1" } |
NewerOlder