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
// MARK - Motion Tracking Logic | |
func startTrackingMotionActivity(handler: @escaping (CMMotionActivity) -> Void) { | |
manager.startActivityUpdates(to: .main) { (activity) in | |
guard let activity = activity else { return } | |
if let lastActivity = self.currentActivity, lastActivity.automotive { | |
self.stoppedDrivingAt = Date() // now | |
} | |
self.currentActivity = activity | |
handler(activity) |
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
// Define the content of the notification | |
let content = UNMutableNotificationContent() | |
content.title = place.title | |
content.body = place.blurb | |
content.sound = UNNotificationSound.default() | |
// Define the region | |
let region = CLCircularRegion(center: place.coordinate(), radius: place.radius ?? 100, identifier: place.identifier) | |
region.notifyOnEntry = true | |
region.notifyOnExit = false |
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 spacy | |
nlp = spacy.load("en_core_web_sm") | |
article = "This is the content of the article. It consists of many sentences." | |
doc = nlp(article) | |
[sent.text for sent in doc.sents] | |
# Output: [‘This is the content of the article.’, ‘It consists of many sentences.’] |
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 spacy | |
nlp = spacy.load("en_core_web_sm") | |
article = "I have lived in Philadelphia for most of my life. I went to school in New York City." | |
doc = nlp(article) | |
[sent for sent in doc.ents] | |
# Output: [Philadelphia, New York City] |
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
{ | |
"id": 302228, | |
"content": "Philadelphia reported 126 new COVID-19 cases and 17 deaths Friday.", | |
"bert_tags": [ | |
"Philadelphia" | |
], | |
"identifier": "default", | |
"article_id": 5097 | |
} |
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
{ | |
"URL Schemes": { | |
"Apple Music": [ | |
{ | |
"description": "Opens an album in Apple Music", | |
"url": "music://geo.itunes.apple.com/us/albums/<albumID>" | |
}, | |
{ | |
"description": "Opens an artist in Apple Music", | |
"url": "music://geo.itunes.apple.com/us/artists/<artistID>" |
OlderNewer