I hereby claim:
- I am jverkoey on github.
- I am featherless (https://keybase.io/featherless) on keybase.
- I have a public key whose fingerprint is F94C 449D 7054 635A 03FE BE95 A674 C56D 3DD7 D554
To claim this, I am signing this object:
// A NINetworkImageView is a subclass of UIImageView. We can provide an image to the initializer | |
// and it will be displayed until the network image is loaded. In this example we won't set an | |
// initial image. | |
NINetworkImageView* imageView = [[NINetworkImageView alloc] initWithFrame:CGRectZero]; | |
imageView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; | |
// We don't set an initial image so let's create a nice-looking "frame" effect on the view. | |
// This will show a translucent background with a highlighted border. | |
imageView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2]; | |
imageView.layer.borderColor = [UIColor colorWithWhite:1 alpha:0.1].CGColor; |
[NIInterapp phone]; // Open the Phone app | |
[NIInterapp phoneWithNumber:@"555-0102"]; // Make a call | |
NIMailAppInvocation* invocation = [NIMailAppInvocation invocation]; | |
invocation.recipient = @"jverkoey@gmail.com"; | |
invocation.subject = @"Nimbus made me do it!"; | |
[NIInterapp mailWithInvocation:invocation]; | |
// Open Twitter with the composer and a given message. | |
[NIInterapp twitterWithMessage:@"I'm playing with the Nimbus sample apps! http://nimbuskit.info"]; |
const char* cstr = [string UTF8String]; | |
void* anon = mmap(0, sizeof(char) * (string.length + 1), PROT_WRITE|PROT_READ, MAP_ANON|MAP_PRIVATE, 0, 0); | |
if (anon == MAP_FAILED) { | |
NSLog(@"Failed to map memory."); | |
return; | |
} | |
strcpy(anon, cstr); | |
// How do I get a file descriptor for use here? |
// | |
// Copyright 2013 Jeff Verkoeyen | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software |
- (CGSize)sizeOfContentsWithSize:(CGSize)size | |
shouldLayout:(BOOL)shouldLayout { | |
// Calculate frames. | |
if (shouldLayout) { | |
// Update frames. | |
} | |
return // size | |
} |
# format: | |
# -------------- | |
# date (mm/dd/yy) | |
# assignment | |
# assignment | |
# ... | |
# | |
# date | |
# assignment | |
# ... |
// Add this to your app delegate. | |
// Neither `UINavigationController` nor `UITabBarController` have the slightest decency to ask their | |
// visible view controller whether IT would like to rotate and just go on and do whatever the hell | |
// they please. This'll show 'em. | |
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { | |
UIViewController* topViewController = window.rootViewController; | |
do { | |
// Navigate modal controllers. |
// A quick-and-dirty implementation of Newton's method. Could use some tlc. May loop infinitely for certain inputs. | |
typedef CGFloat (^CalculateEquationBlock)(CGFloat x); | |
CGFloat NIFindRoot(CalculateEquationBlock fn, CalculateEquationBlock fndx, CGFloat guess) { | |
CGFloat root = guess; | |
while (1) { | |
CGFloat newRoot = root - fn(root) / fndx(root); | |
if (fabsf(newRoot - root) < 0.001) { // or whatever epsilon you want | |
return newRoot; |
// NOTE: I've decided to use a much simpler approach to this as the complexity was starting to consume | |
// too much energy. Leaving this here for historical context. | |
// Building an Underdamped Harmonic Oscillator | |
// | |
// All equations derived from this wonderful paper by David Morin: | |
// http://www.people.fas.harvard.edu/~djmorin/waves/oscillations.pdf | |
// | |
// Note on mass: In order to simplify our calculations I'll assume that mass (m) is always 1. Where | |
// m would otherwise be written I've folded it into the expression. |
I hereby claim:
To claim this, I am signing this object: