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
var _global = this; | |
(function() { | |
// constructor | |
function Logger() { | |
} | |
_global.Logger = Logger; | |
// _global.getLogger = function(){return Logger;}; | |
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
function Logger() { | |
} | |
try { | |
Logger.debug = console.debug; | |
} catch (e) { | |
Logger.debug = function() {alert('abesi')}; | |
} |
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
var _global = this; | |
(function() { | |
function Logger(logLevel) { | |
this.logLevel = logLevel; | |
} | |
_global.Logger = Logger; | |
Logger.LEVEL_DEBUG = 0; | |
Logger.LEVEL_INFO = 1; |
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
# http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
def getPrimes(num): | |
numbers = range(2, num) | |
primes = [1] | |
while(max(primes)*max(primes) <= max(numbers)): | |
p = numbers.pop(0) | |
primes.append(p) | |
for n in numbers: | |
if (n%p == 0): numbers.remove(n) | |
del primes[0] |
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 YTTextFieldCell : UITableViewCell<UITextFieldDelegate, YTCustomCell> { | |
id delegate; | |
UILabel *label; | |
UITextField *textField; | |
} | |
@property (nonatomic, assign) id delegate; | |
@property (nonatomic, retain) NSString *label; | |
@property (nonatomic, retain) NSString *value; | |
@property (nonatomic, retain) NSString *placeholder; |
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 <UIKit/UIKit.h> | |
#import "cocos2d.h" | |
// this definition enables type "kCurrentTurn" or "enum _kCurrentTurn" | |
typedef enum _kCurrentTurn { | |
kCurrentTurnNone = 0, | |
kCurrentTurnMaru = 1, | |
kCurrentTurnBatu = 2, | |
} kCurrentTurn; |
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 "SimpleAudioEngine.h" | |
#import "TicTacToeScene.h" | |
#import "MenuScene.h" | |
@implementation TicTacToeScene | |
-(id) init | |
{ | |
if(self = [super init]) |
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
_CLASSNAME = None | |
def _createDefaultNo(): | |
bloggers = _CLASSNAME.all().fetch(1000) | |
if len(bloggers) == 0: | |
return 1 | |
else: | |
return max(bloggers, key=lambda x:x.no).no + 1 | |
class Blogger(db.Model): | |
no = db.IntegerProperty(required=True, default=_createDefaultNo) |
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
class Blogger(db.Model): | |
class Helper: | |
model = None | |
@classmethod | |
def createDefaultNo(cls): | |
bloggers = cls.model.all().fetch(1000) | |
if len(bloggers) == 0: | |
return 1 | |
else: | |
return max(bloggers, key=lambda x:x.no).no + 1 |
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
# | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you 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 |
OlderNewer