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 ExternalRouter | |
{ | |
private: | |
static ExternalRouter *_instance; | |
protected: | |
ExternalRouter(); | |
public: | |
static ExternalRouter *instance(); |
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
language: objective-c | |
rvm: 1.9.3 | |
script: xctool -workspace [Your Workspace] -scheme [Your Specs Scheme] -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO |
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 LoginDialogDriver | |
{ | |
private String userName; | |
private String password; | |
private String message; | |
private int loginAttempts; | |
public LoginDialogDriver(String userName, String password) | |
{ | |
this.userName = userName; |
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
(defn- uniqueness [map key whatev] | |
(let [duplicate-projects (find-by-kind (:kind map) :filters [:= key (get map key)])] | |
(when-not (empty? duplicate-projects) | |
"must be unique"))) | |
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
// greatest variance between the opening and closing price. | |
// | |
// The following functions may be of use: | |
// | |
// abs - takes the absolute value of an argument | |
// | |
// System.Double.Parse - converts a string argument into a | |
// numerical value. | |
// | |
// The following function will convert a comma separated string |
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
require 'nokogiri' | |
system 'unzip Alliance.docx' | |
doc = Nokogiri::XML(open('word/document.xml')) | |
# Using Label Tag | |
doc.xpath("//w:fldSimple[contains(@w:instr, 'label_tag')]").each do |link| | |
command = link.attributes["instr"].value.match(/\#\{(.*)\}/)[1] | |
replacement_string = eval(command) | |
element.replace(Nokogiri::XML::Text.new(replacement_string, doc)) |
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
// Init the window | |
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
// cocos2d will inherit these values | |
[window setUserInteractionEnabled:YES]; | |
[window setMultipleTouchEnabled:YES]; | |
// must be called before any othe call to the director | |
// WARNING: FastDirector doesn't interact well with UIKit controls | |
// [Director useFastDirector]; |
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
-(void) initializeDirector | |
{ | |
// before creating any layer, set the landscape mode | |
// Initialize Director | |
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; | |
[[Director sharedDirector] setAnimationInterval:1.0/60]; | |
[[Director sharedDirector] setDisplayFPS:YES]; | |
// create an openGL view inside a window |
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
-(void) initializeDirectorWithScene:(Scene *) scene | |
{ | |
// before creating any layer, set the landscape mode | |
// Initialize Director | |
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; | |
[[Director sharedDirector] setAnimationInterval:1.0/60]; | |
[[Director sharedDirector] setDisplayFPS:YES]; | |
// create an openGL view inside a window | |
[[Director sharedDirector] attachInView:window]; |
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
-(void) initializeDirector | |
{ | |
[producer initializeDirectorWithWindow:window scene:[GameScene scene]]; | |
// before creating any layer, set the landscape mode | |
// Initialize Director | |
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; | |
[[Director sharedDirector] setAnimationInterval:1.0/60]; | |
[[Director sharedDirector] setDisplayFPS:YES]; | |
OlderNewer