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 "ImnotyoursonURLProtocol.h" | |
| #import "User.h" | |
| #import "Article.h" | |
| #import "GenericItem.h" | |
| @implementation ImnotyoursonURLProtocol | |
| + (BOOL)canInitWithRequest:(NSURLRequest *)request | |
| { |
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/Foundation.h> | |
| @interface ImnotyoursonURLProtocol : NSURLProtocol | |
| @end |
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
| public class FFT { | |
| int n, m; | |
| // Lookup tables. recompute when size of FFT changes. | |
| double[] cos; | |
| double[] sin; | |
| double[] window; | |
| public FFT(int n) { |
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
| - (UIImage *)cutCircleImage { | |
| UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0); | |
| CGContextRef ctr = UIGraphicsGetCurrentContext(); | |
| CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height); | |
| CGContextAddEllipseInRect(ctr, rect); | |
| CGContextClip(ctr); | |
| [self drawInRect:rect]; | |
| UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| return image; |
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
| NSError *computationError; | |
| [audioFile readIntoBuffer:buffer frameCount:yourSampleRate / 2 error:&computationError]; | |
| if (computationError) { | |
| failure(computationError); | |
| return; | |
| } |
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
| NSError *computationError; | |
| AVAudioFile *audioFile = [[AVAudioFile alloc] initForReading:[NSURL fileURLWithPath:self.filePath] error:&computationError]; | |
| if (computationError) { | |
| failure(computationError); | |
| return; | |
| } | |
| AVAudioFormat *audioFormat = audioFile.processingFormat; | |
| UInt32 audioFrameCount = (UInt32) audioFile.length; | |
| AVAudioPCMBuffer *buffer = [[AVAudioPCMBuffer alloc] initWithPCMFormat:audioFormat frameCapacity:audioFrameCount]; |
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
| 68.52s$ bash <(curl -s https://codecov.io/bash) | |
| _____ _ | |
| / ____| | | | |
| | | ___ __| | ___ ___ _____ __ | |
| | | / _ \ / _` |/ _ \/ __/ _ \ \ / / | |
| | |___| (_) | (_| | __/ (_| (_) \ V / | |
| \_____\___/ \__,_|\___|\___\___/ \_/ | |
| 5ca7b8c | |
| (url) https://codecov.io | |
| (root) . |
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
| 36.79s$ bash <(curl -s https://codecov.io/bash) | |
| _____ _ | |
| / ____| | | | |
| | | ___ __| | ___ ___ _____ __ | |
| | | / _ \ / _` |/ _ \/ __/ _ \ \ / / | |
| | |___| (_) | (_| | __/ (_| (_) \ V / | |
| \_____\___/ \__,_|\___|\___\___/ \_/ | |
| 5ca7b8c | |
| (url) https://codecov.io | |
| (root) . |
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 fetchUserId() -> Observable<String> { | |
| return create{ (observer) -> Disposable in | |
| Client.fetchUserId() { [unowned self] | |
| (userId: String?, err: ErrorType?) -> Void in | |
| if let _ = err{ | |
| observer.on(Event.Error(err!)) | |
| } else { | |
| observer.on(Event.Next(userId)) | |
| observer.on(Event.Completed) | |
| } |
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
| // Method signatures | |
| // Promise resolves to User instance | |
| - (PMKPromise *)loginToRemoteServer:(NSString *)userId; | |
| // Promise resolves to NSDictionary of user data | |
| - (PMKPromise *)retrieveUserData:(User *)user; | |
| // Promise resolves to UIImage | |
| - (PMKPromise *)retrieveProfileImage:(NSURL *)imageURL; |