"I just implemented Conway's Game of Life in two lines of code. #fml"
pad = x flip[stitch] 0, stitch 0, flip[cat] 0, cat 0
life = pad, neighborhoods[3 3], [ravel, [sum in?: [x @ 4, + 3; 3]]]/2
| CGFloat BNRTimeBlock (void (^block)(void)); |
| /* | |
| * Most NSString instances will actually be __NSCFString instances, so here are both NSString and __NSCFString implementations. | |
| * If you know how to create an NSString instance whose class is actually NSString please let me know. | |
| * Other possible concrete subclasses of NSString are: NSConstantString, __NSCFConstantString, NSPathStore2, NSSimpleCString and __NSLocalizedString. | |
| */ | |
| // CoreFoundation.framework 635.19.0 (Mac OS X 10.7.3) | |
| @implementation NSObject | |
| - (BOOL) isNSString__ |
| On April 5 2012, #0x10c-dev agreed to the following standard ABI: | |
| - Registers A, B, C are clobberable across calls | |
| - Registers I, J, X, Y, Z are preserved across calls | |
| - Return in A | |
| - J is used for base stack pointer (preserving the value of SP before allocating data for locals) |
| #!/bin/bash | |
| # Replaces classes in Android Package Files | |
| # (c) Sebastian Fischer, CC-BY | |
| # Can be used to rebuild an App with a modified version of a used library, | |
| # as required for closed works that link to an LGPL library. | |
| # Depends on: https://code.google.com/p/dex2jar/ |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| module Root | |
| FOO = 'Ayyyy!' | |
| end | |
| module Root::NotNested | |
| def self.speak | |
| puts FOO | |
| end | |
| end |
| // Copyright (c) 2012-2013 Peter Steinberger (http://petersteinberger.com) | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // | |
| // The above copyright notice and this permission notice shall be included in |
| // clang -framework Foundation -fobjc-arc -O3 test.m | |
| #import <Foundation/Foundation.h> | |
| @interface Slice : NSObject | |
| @property NSInteger start; | |
| @property NSInteger length; | |
| @end | |
| @implementation Slice |