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 m2l(A, fname, type) | |
if nargin < 3 | |
type = 'bmatrix'; | |
end | |
[ m, n ] = size(A); | |
fp = fopen(fname, 'w'); | |
fprintf(fp, '\\begin{%s}\n', type); | |
for i = 1:m | |
fprintf(fp, '\t\\num{%.4g}', A(i, 1)); | |
for j = 2:n |
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
"""PYXFOIL: XFOIL AUTOMATION USING PYTHON | |
Logan Halstrom | |
EAE 127 | |
UCD | |
CREATED: 15 SEP 2015 | |
MODIFIED: 17 OCT 2018 | |
DESCRIPTION: Provides functions for automating XFOIL runs. | |
Each function will iteratively build a list of inputs. When you are ready, | |
use the RunXfoil command to run the input list |
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
@lazyglobal off. | |
function gravMag { | |
parameter alt is altitude,bdy is body. | |
return bdy:mu/(bdy:radius+alt)^2. | |
} | |
function gravVec { | |
parameter self is ship, alt is self:altitude. | |
return gravMag(alt,self:body)*-self:up:vector:normalized. |
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
@lazyglobal off. | |
function gravMag { | |
parameter alt,bdy. | |
return bdy:mu/(bdy:radius+altitude)^2. | |
} | |
function gravVec { | |
parameter self is ship. | |
return gravMag(self:altitude,self:obt:body)*-self:up:vector:normalized. |
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
@lazyglobal off. | |
function gravMag { | |
parameter alt,bdy. | |
return bdy:mu/(bdy:radius+altitude)^2. | |
} | |
function gravVec { | |
parameter self is ship. | |
return gravMag(self:altitude,self:obt:body)*-self:up:vector:normalized. |
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
//Code by Badsector, Nertea and veryinky | |
@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[FSfuelSwitch]] { | |
%LF = #$RESOURCE[LiquidFuel]/maxAmount$ | |
%OX = #$RESOURCE[Oxidizer]/maxAmount$ | |
%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ | |
@totalCap += #$RESOURCE[Oxidizer]/maxAmount$ |
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
ship = Untitled Space Craft | |
version = 1.0.4 | |
description = | |
type = SPH | |
size = 4.360162,1.51357,6.237043 | |
PART | |
{ | |
part = trussPiece1x_4294506064 | |
partName = Part | |
pos = 0.2202456,5.781522,1.642626 |
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)refresh:(id)sender | |
{ | |
double delayInSeconds = 5.0; | |
UIRefreshControl * __weak refreshControl = self.refreshControl; | |
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); | |
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ | |
// Calling [self.refreshControl endRefreshing] while tableView is | |
// decelerating causes it to stop abruptly. performSelector:...afterDelay: | |
// defers this until after decelerating completes. | |
[refreshControl performSelector:@selector(endRefreshing) |
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
@autoreleasepool { | |
NSCondition *cond = [[NSCondition alloc] init]; | |
[cond lock]; | |
@autoreleasepool { | |
// Use __block and uncomment below for this to work correctly. | |
NSManagedObjectContext * /*__block*/ context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; | |
NSManagedObjectContext * __weak weakContext = context; | |
NSManagedObject * __block obj; | |
[context performBlockAndWait:^{ | |
context.persistentStoreCoordinator = persitentStoreCoordinator(); |
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
javascript:window.document.location = 'http://raceshape.com/strava-segments/' + (jQuery('a.goto.only').attr('href') || document.location.toString()).split('/').pop() + '?rides=' + jQuery('#results a').map(function () { m = this.href.match(/.*segment_efforts\/(.*)/); return m && m[1]; }).get().slice(0,10).join('-'); |