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) 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 | |
{ | |
// 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) testRunsWithGameScene | |
{ | |
MockProducer *producer = [[[MockProducer alloc] init] autorelease]; | |
MadBomberAppDelegate *delegate = [[[MadBomberAppDelegate alloc] init] autorelease]; | |
delegate.producer = producer; | |
[delegate applicationDidFinishLaunching: nil]; | |
STAssertEquals([producer.initialScene class], [[GameScene scene] class], nil); | |
STAssertEqualObjects(producer.initialWindow, delegate.window, nil); |
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]; | |
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
# In App Delegate | |
-(void) initializeDirector | |
{ | |
[self.producer initializeDirectorWithWindow:window scene:[GameScene scene]]; | |
} | |
# In my Producer Object | |
-(void) initializeDirectorWithWindow:(UIWindow *) window scene:(Scene *) scene | |
{ | |
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; |
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 | |
{ | |
[[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]; | |
[[Director sharedDirector] runWithScene: [GameScene scene]]; |
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
657 void callback() { | |
658 // Lift = R(0, 1, 0) |K| (sin theta) | |
659 // Drag = -K (sin theta) | |
660 // Where theta is the angle between w (planes direction) and K | |
661 // This should be direction of - not velocity - | |
662 // You've got velocity * R (the rotation) u = R(velocity) | |
663 // K ends up as the actual direction of motion | |
664 // plane->K + plane->R * Vector(0, 0, +1) Add a constant | |
665 if (engineSpeed != 0) { | |
666 // Apply Thrust |
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
So I upgraded XCode | |
Which caused my build to fail | |
Which required upgrading Xamarin | |
Which caused my program to build, but crash | |
Which requires manually building monomac |
OlderNewer