iPhone
Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en-gb)
AppleWebKit/534.46.0 (KHTML, like Gecko)
CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
r""" | |
gotham | |
~~~~~~ | |
Gothic Poetry Generator | |
""" | |
import marshal |
- (void)fizzBuzzObjectiveC | |
{ | |
for(int i = 1; i <= 100; i++) { | |
NSString *output = @""; | |
if(i % 3 == 0) | |
output = [output stringByAppendingString:@"Fizz"]; | |
if(i % 5 == 0) | |
output = [output stringByAppendingString:@"Buzz"]; |
Memoization is fundamentally a top-down computation and dynamic | |
programming is fundamentally bottom-up. In memoization, we observe | |
that a computational *tree* can actually be represented as a | |
computational *DAG* (the single most underrated data structure in | |
computer science); we then use a black-box to turn the tree into a | |
DAG. But it allows the top-down description of the problem to remain | |
unchanged. | |
In dynamic programming, we make the same observation, but construct | |
the DAG from the bottom-up. That means we have to rewrite the |
#!/bin/bash | |
#Usage: ./defconvid-downloader.sh $id | |
#Where $id is the conference number | |
wget -c -nc -e robots=off --wait 5 -i -- `curl "http://defcon.org/html/links/dc-archives/dc-$1-archive.html" | grep -o "https.*\.m4v" | sed 's/ \+/%20/g'` |
// | |
// NSObject+setValuesForKeysWithJSONDictionary.h | |
// SafeSetDemo | |
// | |
// Created by Tom Harrington on 12/29/11. | |
// Copyright (c) 2011 Atomic Bird, LLC. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
#import <AppKit/AppKit.h> | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
@interface NSBitmapImageRep (Mapping) | |
- (void)map:(void (^)(NSUInteger[4]))aBlk; | |
@end | |
@implementation NSBitmapImageRep (Mapping) | |
- (void)map:(void (^)(NSUInteger[4]))aBlk | |
{ |
#import <Foundation/Foundation.h> | |
NSDictionary *dictionaryForURL(NSURL *aURL) | |
{ | |
NSLog(@"scheme = %@ host = %@ port = %@ fragment = %@ lastPathComponent = %@ parameterString = %@ " | |
@"query = %@ user = %@ password = %@ resourceSpecifier = %@", | |
[aURL scheme],[aURL host],[aURL port],[aURL fragment],[aURL lastPathComponent],[aURL parameterString], | |
[aURL query],[aURL user],[aURL password],[aURL resourceSpecifier]); | |
NSLog(@"absoluteString = %@",[aURL absoluteString]); |
CGFloat red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; | |
[someColor getRed:&red green:&green blue:&blue alpha:&alpha]; | |
[someLabel setText:[NSString stringWithFormat:@"#%02X%02X%02X", (int) red * 255.0f, (int) green * 255.0f, (int) blue * 255.0f]]; |