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
// here is how I created a libPoco xcframework | |
// | |
// after building libPoco | |
lipo iPhoneSimulator/arm64/libPocoJWT.a iPhoneSimulator/x86_64/libPocoJWT.a -create -output universal/libPocoJWT.a | |
lipo iPhoneSimulator/arm64/libPocoXML.a iPhoneSimulator/x86_64/libPocoXML.a -create -output universal/libPocoXML.a | |
lipo iPhoneSimulator/arm64/libPocoUtil.a iPhoneSimulator/x86_64/libPocoUtil.a -create -output universal/libPocoUtil.a | |
lipo iPhoneSimulator/arm64/libPocoCrypto.a iPhoneSimulator/x86_64/libPocoCrypto.a -create -output universal/libPocoCrypto.a | |
lipo iPhoneSimulator/arm64/libPocoFoundation.a iPhoneSimulator/x86_64/libPocoFoundation.a -create -output universal/libPocoFoundation.a | |
lipo iPhoneSimulator/arm64/libPocoNet.a iPhoneSimulator/x86_64/libPocoNet.a -create -output universal/libPocoNet.a | |
lipo iPhoneSimulator/arm64/libPocoNetSSL.a iPhoneSimulator/x86_64/libPocoNetSSL.a -create -output universal/libPocoNetSSL.a |
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
// Question: | |
//Given a list of strings, group together strings that decode to the same message, using Caesar cipher encryption. | |
// | |
//Ex: | |
//input: ['abc', 'bcd', 'bde', 'dfg', 'hjk'] | |
//output: [['abc', 'bcd'], ['bde', 'dfg', 'hjk']] | |
// | |
//A Caesar cipher is an encryption algorithm where rotation is applied to every character in the message. Shift value can be any number, but must be consistent across the message | |
// |
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
// | |
// ThreeFibonacciViewController.swift | |
// | |
// For the purposes of this problem, a Threebonacci sequence is a twist on the | |
// Fibonacci sequence where you would sum the previous three elements to get the | |
// next element. That is, if the Threebonacci function is defined as t, where n is the | |
// index of the element involved, t(n) = t(n-1) + t(n-2) + t(n-3). | |
// You can assume t(0) = 0, t(1) = 1, and t(2) = 1. With this information, please |
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/Cocoa.h> | |
@interface AddAliasToDesktopUtility : NSObject { | |
} | |
- (BOOL) addAliasNow; | |
@end |
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
// A telephone keypad has letters associated with each number (e.g. 2 = abc, 3 = def). | |
// Given a passphrase of "fb1" (e.g. one that you might use to log into a bank account), | |
// come up with an algorithm that would assemble an array that contains all the | |
// different possible letter combinations that, when typed into a telephone dial pad, | |
// would be equivalent to the original passphrase. That is, "fb1" equals "321" numerically; | |
// matching equivalent combinations include: "da1", "db1", "dc1", "ea1", "eb1", "ec1", "fa1" and "fc1". | |
// This can be dropped into an iOS Playground in Xcode |
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
/* The following was a coding question given during an interview for LinkedIn in March, 2017 */ | |
/* This class will be given a list of words (such as might be tokenized | |
* from a paragraph of text), and will provide a method that takes two | |
* words and returns the shortest distance (in words) between those two | |
* words in the provided text. | |
* Example: | |
* WordDistanceFinder finder = new WordDistanceFinder(Arrays.asList("the", "quick", "brown", "fox", "quick")); | |
* assert(finder.distance("fox", "the") == 3); | |
* assert(finder.distance("quick", "fox") == 1); |
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 UIKit | |
extension UIImage { | |
// colorize image with given tint color | |
// this is similar to Photoshop's "Color" layer blend mode | |
// this is perfect for non-greyscale source images, and images that have both highlights and shadows that should be preserved | |
// white will stay white and black will stay black as the lightness of the image is preserved | |
func tint(tintColor: UIColor) -> UIImage? { | |
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
// Copyright © 2016 Envoy. All rights reserved. | |
/* | |
Write a Swift playground that takes an n x n grid of integers. Each integer can be either 1 or 0. | |
The playground then outputs an n x n grid where each block indicates the number of 1's around that block, (excluding the block itself) . For Block 0 on row 0, surrounding blocks are (0,1) (1,0) and (1,1). Similary for block (1,1) all the blocks around it are to be counted as surrounding blocks. | |
Requirements: |
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
// The way I would approach this problem would be to save a set of two distinct dates to | |
// NSUserDefaults and if these three days (the two days from the set plus today's third date) lie within the last five days, | |
// I'll show the alert. If we have two dates in the set, replace the oldest with the newest/current date. | |
// I'm using NSSet because it's distinct dates, versus an array where we might have duplicate dates. | |
// I'm making JetDate as a subclass of NSDate where the time component of NSDate (02-17-2015 00:00:00 GMTz) | |
// is dropped and only the date is considered | |
- (BOOL) shouldShowRatingAlert |
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
@interface EncryptDecrypt (NSString) | |
- (NSString *) encrypt; | |
- (NSString *) decrypt; | |
@end | |
@implementation EncryptDecrypt { |
NewerOlder