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
import Foundation | |
import Combine | |
protocol CaloriesServiceProtocol { | |
func start() // New method to start the service after a 2-second delay | |
func caloriesPublisher() -> AnyPublisher<Int, Never> | |
} | |
class CaloriesService: CaloriesServiceProtocol { | |
private var calories: Int = 10 |
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
import ExpoModulesCore | |
import BackgroundTasks | |
import AVFoundation | |
import Foundation | |
import UserNotifications | |
import UIKit | |
import AudioToolbox | |
import MediaPlayer | |
public class RNAlarmModule: Module { |
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
import Foundation | |
import Combine | |
protocol CaloriesServiceProtocol { | |
func caloriesPublisher() -> AnyPublisher<Int, Never> | |
} | |
class CaloriesService: CaloriesServiceProtocol { | |
private var calories: Int = 10 | |
private var timer: Timer? |
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
import Foundation | |
import CoreData | |
import Combine | |
class DailyLogsViewModel: ObservableObject { | |
// MARK: - Properties | |
private let context = PersistenceController.defaultContext | |
@Published var foods: [Food] = [] | |
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
from collections import defaultdict | |
n, m = [int(x) for x in input().split()] | |
k = int(input()) | |
c = defaultdict(lambda: []) # connections (graph) | |
p = set() # processing (visited list in bfs terms) | |
for i in range(k): | |
a, b = [int(x) for x in input().split()] |