Skip to content

Instantly share code, notes, and snippets.

View SiarheiFedartsou's full-sized avatar

Siarhei Fedartsou SiarheiFedartsou

View GitHub Profile
const NSUInteger testCount = 1000000;
{
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
GLKMatrixStackRef stack = GLKMatrixStackCreate(NULL);
GLKMatrixStackLoadMatrix4(stack, GLKMatrix4Identity);
for (NSUInteger i = 0; i < testCount; i++) {
GLKMatrixStackPush(stack);
GLKMatrixStackMultiplyMatrix4(stack, GLKMatrix4Identity);
GLKMatrixStackPop(stack);
}
Какое значение вернёт вызов функции на языке Java count(32767)?
private BigInteger g(BigInteger n, BigInteger g)
{
if (g.compareTo(BigInteger.ONE) <= 0 || g.compareTo(n.subtract(BigInteger.ONE)) >= 0){
return BigInteger.ONE;
}
BigInteger result = BigInteger.ONE;
BigInteger c = BigInteger.valueOf(2);
while (c.compareTo(g) <= 0){
@interface Foo : NSObject
{
NSData* _data;
}
@end
@implementation Foo
- (void) download
{
struct Stack<T> : Sequence {
struct StackNode
{
var value: T
var next: Any? = nil
}
struct StackGenerator : Generator {
var top : StackNode? = nil
extension Array {
func each(closure: ((item: T, idx: Int) -> Void)) {
var idx : Int = 0
for item in self {
closure(item: item, idx: idx)
idx += 1
}
}
}
#ifdef DEBUG
/// Tests if .xctest bundle is loaded, so returns YES if the app is running with XCTest framework.
inline BOOL IsUnitTesting() __attribute__((const));
inline BOOL IsUnitTesting()
{
NSDictionary *environment = [NSProcessInfo processInfo].environment;
NSString *injectBundlePath = environment[@"XCInjectBundle"];
return [injectBundlePath.pathExtension isEqualToString:@"xctest"];
}
#endif
curl --max-time 1800 http://testflightapp.com/api/builds.json -F file=PATH_TO_IPA -F dsym=PATH_TO_DSYM -F api_token="API_TOKEN" -F team_token="TEAM_TOKEN" -F notes=$filename -F replace=True -F notify=True
@implementation Foo
{
__weak id lastRequest_;
}
-(id) buildRequest
{
lastRequest_ = [PARequestLobbyTournamentsPlayers requestWithFilter:self.filter from:self.offset amount:self.amount];
return lastRequest_;
}
objc[6539]: Class Foo is implemented in both /private/var/mobile/Containers/Bundle/Application/FBDC29F1-5447-47B0-B898-02E6714F319E/App.app/App and /private/var/mobile/Containers/Bundle/Application/FBDC29F1-5447-47B0-B898-02E6714F319E/App.app/App. One of the two will be used. Which one is undefined.
#import <Foundation/Foundation.h>
#import <libkern/OSAtomic.h>
typedef struct {
BOOL scheduled;
OSSpinLock lock;
} PAScheduleOnceToken;
static char PAScheduleOnceTokenKey;