-
The Voice interface will be mastered. We will be talking to computers and they will understand the meaning/context of our words, and help us live our lives. Siri is where it starts.
-
Fully articulable, brain-controlled artificial limbs will be in existence. Amputees will have limbs replaced with an artificial limb, and continue to live fully enabled. Price would still be high at this time. There is already great progress in this area.
-
Driverless cars will start to gain popularity. People who purchase an autonomous vehicle (e.g. Google's driverless car) will be sitting in their cars, working/entertaining themselves with mobile devices while they are driven around. Google is close to launching their autonomous car for sale. They are way ahead of the competition. Google will be heavy in the automotive game. They are lobbying to legalize Autonomous Vehicles in the US.
-
We will have devices with morphable, touchable interface
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
def check_sudoku(grid, p_info = False, gridsize = 9): | |
'''sudoku checker - enter True as second func. argument | |
to print more info | |
about check failures''' | |
def check_sudoku_complete_results(grid, gridsize = 9): | |
if type(grid) != list: return None, 'function accepts list, got %s instead' % (str(type(grid))) | |
if gridsize % 3 != 0: return None, 'incorrect size' | |
if len(grid) != gridsize: |
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
#define POP_ALERT(title, msg) [[[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]autorelease] show] | |
/* | |
Usage: | |
POP_ALERT(@"Title Here", @"Message Here"); | |
*/ |
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
- (void)motionBegan:(UIEventSubtype)motion | |
withEvent:(UIEvent *)event | |
{ | |
#define STRINGIFY(js) #js | |
NSString *js = @ STRINGIFY( | |
var $elements = $('.leftArea_container>div'), | |
$rand = $elements.not(':first').eq(Math.floor(Math.random() * $elements.length)); | |
$rand.slideUp(500,function(){ $(this).insertBefore($elements.first()); }).slideDown(); | |
); |
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
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@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
Here's what the GCD (and ARC) version looks like: | |
+ (id)sharedInstance | |
{ | |
static dispatch_once_t pred = 0; | |
__strong static id _sharedObject = nil; | |
dispatch_once(&pred, ^{ | |
_sharedObject = [[self alloc] init]; // or some other init method | |
}); | |
return _sharedObject; | |
} |
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
#define OC(str) [NSString stringWithCString:(str) encoding:NSUTF8StringEncoding] | |
#ifdef DEBUG | |
# define LOG(fmt, ...) do { \ | |
NSString* file = [[NSString alloc] initWithFormat:@"%s", __FILE__]; \ | |
NSLog((@"%@(%d) " fmt), [file lastPathComponent], __LINE__, ##__VA_ARGS__); \ | |
[file release]; \ | |
} while(0) | |
# define LOG_METHOD NSLog(@"%s", __func__) | |
# define LOG_CMETHOD NSLog(@"%@/%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)) |
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
- (void)_updateResults:(void (^)(void))block caller:(dispatch_queue_t)callerqueue | |
{ | |
__unsafe_unretained NUData* wself = self; | |
dispatch_sync(_serial_results_queue, ^{ | |
NSManagedObjectContext* ctx = updateContext; | |
__block NSArray* results = nil; | |
[ctx performBlockAndWait:^{ |
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
//"modern Objective-C" syntax | |
//new enum-macros for better autocompletion, switch statement, more precise warnings, ... | |
typedef NS_ENUM(NSInteger, MyViewContentMode) { | |
MyViewContentModeLeft, | |
MyViewContentModeRight, | |
MyViewContentModeTopLeft, | |
MyViewContentModeTopRight, |
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
void printfTreeLevelOfView(UIView *view, int maxLevel) | |
{ | |
UIView *tempView; | |
NSArray *subViews = [view subviews]; | |
static int level = 0; | |
level++; | |
for(tempView in subViews) | |
{ | |
if ( level <= maxLevel) { | |
for (int i = 0; i < level; i++) |