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 ComplicationController: NSObject, CLKComplicationDataSource { | |
func getComplicationDescriptors(handler: @escaping ([CLKComplicationDescriptor]) -> Void) { | |
// for graphicCircular | |
let descriptors = [ | |
CLKComplicationDescriptor(identifier: "graphicCircular", displayName: "graphicCircular", supportedFamilies:[ CLKComplicationFamily.graphicCircular]), | |
] | |
// Call the handler with the currently supported complication descriptors | |
handler(descriptors) | |
} |
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 ComplicationController: NSObject, CLKComplicationDataSource { | |
func getComplicationDescriptors(handler: @escaping ([CLKComplicationDescriptor]) -> Void) { | |
// for graphicCircular | |
let descriptors = [ | |
CLKComplicationDescriptor(identifier: "graphicCircular1", displayName: "graphicCircular1", supportedFamilies:[ CLKComplicationFamily.graphicCircular]), | |
CLKComplicationDescriptor(identifier: "graphicCircular2", displayName: "graphicCircular2", supportedFamilies:[ CLKComplicationFamily.graphicCircular]), | |
] | |
// Call the handler with the currently supported complication descriptors | |
handler(descriptors) |
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
(1)TW Tide | (2)Watch Mask | (3)vHub | ||
---|---|---|---|---|
WatchKit | heavy use | light use | ||
App Extension | heavy use | |||
SwiftUI State | heavy use | heavy use | heavy use | |
SwiftUI Shape and Path | heavy use | heavy use | ||
External API | heavy use | heavy use | ||
CloudKit | heavy use | |||
CoreData | heavy use | heavy use | ||
StoreKit | heavy use | heavy use | ||
Concurrency | light use | light use | light use |
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 pandas as pd | |
import numpy as np | |
def get_rank_df(df , station_column , time_column , sort_time_ascending = True ): | |
df.sort_values(by=[station_column , time_column] , ignore_index = True , inplace = True) | |
df = df.drop_duplicates(subset=[station_column , time_column]).reset_index(drop = True) | |
df["rank"] = df.groupby(station_column)[time_column].rank("dense", ascending= sort_time_ascending ) | |
df = df.astype({'rank': 'int32'} ) | |
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 pandas as pd | |
import numpy as np | |
def filter_time_windows(result_df , station_column , time_window_size ): | |
result_df['counts'] = result_df.groupby([station_column, 'rank_group'])['rank'].transform('size') | |
result_df = result_df[result_df.counts == time_window_size ] | |
return result_df | |
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 pandas as pd | |
import numpy as np | |
def get_feature_array(df , feature_column_list , time_window_size ) : | |
feature_count = len(feature_column_list ) | |
x = df.loc[: , feature_column_list ].to_numpy().reshape( -1 , time_window_size , feature_count ) | |
return x |
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 pandas as pd | |
import numpy as np | |
def get_grouped_df(df ,station_column , rank_group_column ): | |
gdb = df.groupby([station_column, rank_group_column ], sort = False).size() | |
y = pd.DataFrame(data = { station_column : gdb.index.get_level_values(0).tolist() , rank_group_column : gdb.index.get_level_values(1).tolist() }) | |
return 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
func testFetchResultIsFault()throws{ | |
for i in 0..<configurations.count{ | |
//given | |
let viewContext = try initViewContext() | |
let configuration = configurations[i] | |
let fetchRequest = getFetchRequest(configuration:configuration) | |
//when | |
let object = try viewContext.fetch(fetchRequest).first! as! NSManagedObject | |
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 SwiftUI | |
class AppDelegate: NSObject, UIApplicationDelegate { | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { | |
application.registerForRemoteNotifications() | |
let center = UNUserNotificationCenter.current() | |
center.requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in | |
if let error = error { | |
// Handle the error here. | |
} |
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 XCTest | |
import CoreData | |
@testable import labSingleStore | |
final class labSingleStoreTests: XCTestCase { | |
func testAutoConfiguredStore(){ | |
let container = PersistenceController.shared.container | |
assert(container.persistentStoreDescriptions.count == 1) |
OlderNewer