Skip to content

Instantly share code, notes, and snippets.

View ZachOrr's full-sized avatar
🤖
TBA

Zachary Orr ZachOrr

🤖
TBA
View GitHub Profile
@ZachOrr
ZachOrr / NSCoreDataCoreSpotlightDelegate-ios-14.md
Last active December 14, 2020 18:03
Notes about the undocumented changes to NSCoreDataCoreSpotlightDelegate I've seen in iOS 14

There appears to be some undocumented changes to the NSCoreDataCoreSpotlightDelegate in iOS 14. I've been unable to find these changes documented in the NSCoreDataCoreSpotlightDelegate documentation or anywhere else online.

Debug Logging

There's quite a bit of debug logging around NSCoreDataCoreSpotlightDelegate now, including initialization and indexing requets.

Enable NSPersistentHistoryTrackingKey

NSCoreDataCoreSpotlightDelegate requires NSPersistentHistoryTrackingKey to be enabled in NSPersistentStoreDescription options. (NSInternalInconsistencyException)

Keybase proof

I hereby claim:

  • I am ZachOrr on github.
  • I am zor (https://keybase.io/zor) on keybase.
  • I have a public key whose fingerprint is 09E1 FFBE 919A 45EB 628E 5814 5B48 44C2 616E F3AF

To claim this, I am signing this object:

def match_sort_key(match):
COMP_LEVELS_PLAY_ORDER = {
'qm': 1,
'ef': 2,
'qf': 3,
'sf': 4,
'f': 5,
}
return "{}_{}".format(COMP_LEVELS_PLAY_ORDER[match['comp_level']], str(match['match_number']).zfill(3))
@ZachOrr
ZachOrr / NSManagedObject+Relationship.swift
Created March 11, 2019 01:23
Way to update sorted/unsorted NSManagedObject relationship
extension NSManagedObject {
func updateToManyRelationship<T: NSManagedObject & Managed, J: SetInitable & SetGettable>(relationship: String, newValues new: [T]?, setClass: J) {
// Store our old values so we can reference them later
let oldSet = value(forKeyPath: relationship) as? J
let oldValues = oldSet?.items as? [T]
// The ol' switcharoo
let newSet = Set(new ?? [])
setValue(J(set: newSet), forKey: relationship)
// Needs CoreImage.framework
- (UIImage *)blurredImageWithImage:(UIImage *)sourceImage{
// Create our blurred image
CIContext *context = [CIContext contextWithOptions:nil];
CIImage *inputImage = [CIImage imageWithCGImage:sourceImage.CGImage];
// Setting up Gaussian Blur
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
This file has been truncated, but you can view the full file.
2014-05-25 21:31:22.103 the-blue-alliance-ios[63826:3e03] Invalid CSV line: (
4,
"Gibbs CAM/SolidWorks\U2f00\U5300\U6100\U7700\U6900\U6e00\U6700\U2000\U5300\U6500\U7200\U7600\U6900\U6300\U6500\U7300\U2f00\U4e00\U4100\U5300\U4100\U2f00\U5700\U4100\U4100\U4700\U2f00\U4600\U7500\U6c00\U6c00\U2000\U5300\U6300\U6100\U6c00\U6500\U2000\U4500\U6600\U6600\U6500\U6300\U7400\U7300\U2f00\U5200\U6f00\U6200\U6500\U7200\U7400\U7300\U2000\U5400\U6f00\U6f00\U6c00\U2000\U4300\U6f00\U2e00\U2f00\U5400\U6800\U6f00\U6d00\U7300\U6f00\U6e00\U2000\U2600\U2000\U4800\U6900\U6700\U6800\U5400\U6500\U6300\U6800\U2d00\U4c00\U6f00\U7300\U2000\U4100\U6e00\U6700\U6500\U6c00\U6500\U7300\U2c00\U5400\U6500\U6100\U6d00\U2000\U3400\U2000\U4500\U4c00\U4500\U4d00\U4500\U4e00\U5400\U2c00\U2200\U5600\U6100\U6e00\U2000\U4e00\U7500\U7900\U7300\U2c00\U2000\U4300\U4100\U2c00\U2000\U5500\U5300\U4100\U2200\U2c00\U6800\U7400\U7400\U7000\U3a00\U2f00\U2f00\U7700\U7700\U7700\U2e00\U7400\U6500\U6100\U6d00\U3400\U6500\U6c00\U6500\U6d00\U6500\U6e00\U7400\U
This file has been truncated, but you can view the full file.
2014-05-25 21:31:29.592 the-blue-alliance-ios[63826:3e03] *** Terminating app due to uncaught exception 'Invalid CSV line: values count doesn't match key count', reason: 'keys(5) = (
"team_number",
name,
nickname,
location,
website
), values(2) = (
4,
"Gibbs CAM/SolidWorks\U2f00\U5300\U6100\U7700\U6900\U6e00\U6700\U2000\U5300\U6500\U7200\U7600\U6900\U6300\U6500\U7300\U2f00\U4e00\U4100\U5300\U4100\U2f00\U5700\U4100\U4100\U4700\U2f00\U4600\U7500\U6c00\U6c00\U2000\U5300\U6300\U6100\U6c00\U6500\U2000\U4500\U6600\U6600\U6500\U6300\U7400\U7300\U2f00\U5200\U6f00\U6200\U6500\U7200\U7400\U7300\U2000\U5400\U6f00\U6f00\U6c00\U2000\U4300\U6f00\U2e00\U2f00\U5400\U6800\U6f00\U6d00\U7300\U6f00\U6e00\U2000\U2600\U2000\U4800\U6900\U6700\U6800\U5400\U6500\U6300\U6800\U2d00\U4c00\U6f00\U7300\U2000\U4100\U6e00\U6700\U6500\U6c00\U6500\U7300\U2c00\U5400\U6500\U6100\U6d00\U2000\U3400\U2000\U4500\U4c00\U4500\U4d00\U4500\U4e00\U5400\U2c00\U2200\U5600\U6100\U6e00\U2000\U4e00\U7500\U7900\U7300\U2c00\U2000\U4
http://www.thebluealliance.com/event/2013marc
http://www.thebluealliance.com/event/2013mikk
http://www.thebluealliance.com/event/2013mibed
http://www.thebluealliance.com/event/2013mitry
http://www.thebluealliance.com/event/2013migbl
http://www.thebluealliance.com/event/2013miwfd
Kettering Kickoff 2012
MARC 2012
http://www.thebluealliance.com/events/2012
http://www.thebluealliance.com/event/2012gl
import requests
import xmldict
def main():
r = requests.get("http://www.chiefdelphi.com/forums/frcspy.php?xml=2")
matches = xmldict.xml_to_dict(r.content)
upset = 0
total = 0
@ZachOrr
ZachOrr / email.md
Created February 15, 2014 03:04
An email I sent to FIRST, highlighting some of the issues developers have with their platform

(I’m not sure if this will be used in a Frank Answers Friday, since this is the same email address, so I’ll provide the information usually asked for. My name is Zachary Orr. I’m a MC in Michigan - not associated with a team - and I run Megaphone, a service that provides FIRSTers with text messages in real time when their favorite teams win or lose their matches, and automatically updates their team’s Twitter account to keep friends and family up to date with how they’re doing at competitions)

Earlier on Twitter I asked @FRCTeams about an example event page for the 2014 season. A lot of developers (including but not limited to the hardworking developers behind The Blue Alliance, FRC Spyder, and FRC Tracker) rely on parsing these web pages, due to the lack of a publicly available API for ranking, award, and alliance selection information. In the past, there’ve been minor changes from o