This file contains 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
// Created by Thomas Visser on 10/10/2009. | |
#import "cocos2d.h" | |
#import "Loadable.h" | |
@interface GraphicObject : CocosNode <Loadable> { | |
} | |
@end |
This file contains 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
// Created by Thomas Visser on 10/10/2009. | |
#import "GraphicObject.h" | |
#import "LoadableDelegate.h" | |
@implementation GraphicObject | |
- (void) loadWithDelegate: (id <LoadableDelegate>) delegate { | |
// called by the Loader created in GameLayer | |
for( int i = 0; i < 100000000; i++ ) { } |
This file contains 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
// first read is called, then write | |
// how to wait without blocking the serial GCD queue 'queue'? | |
- (void) read { | |
dispatch_sync(queue, ^{ | |
while( [connectedFiles count] == 0 ) { | |
// wait here: how? | |
} | |
[connectedFiles removeAllObjects]; | |
}); |
This file contains 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
import java.util.Random; | |
public class ExceptionTest { | |
private static final int TESTS = 10000000; | |
public static void main(String[] args) { | |
Random rand = new Random(); | |
String str = null; |
This file contains 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
abstract class Super { | |
public void identify() { | |
System.out.println(this.getClass()); | |
} | |
} | |
class Child extends Super { | |
} |
This file contains 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
public class ShardedCounter implements Serializable { | |
private static final long serialVersionUID = 1L; | |
@Transient | |
private transient ObjectifyFactory of; | |
@Unindexed | |
private String name; | |
private ShardedCounter() { |
This file contains 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
interface HasReferences { | |
// just an interface, | |
} | |
@Entity | |
public class Person implements HasReferences { | |
// ... | |
} | |
@Entity |
This file contains 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
import java.io.*; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.sql.Timestamp; | |
import java.util.Date; | |
public class IsTheIPhoneDeveloperCenterDown { | |
public static void main(String[] args) throws java.lang.InterruptedException { | |
try { |
This file contains 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
curl -b <(sqlite3 -separator $'\t' ~/Library/Application\ Support/Google/Chrome/Default/Cookies "select host_key, 'TRUE','/', 'FALSE', expires_utc, name, value from cookies where host_key like '%apple.com%'") <file_url> -o <output_file_url> -C - |