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 PointOnCurve(TrackPoint &out, float t, TrackPoint p0, TrackPoint p1, TrackPoint p2, TrackPoint p3) | |
{ | |
float t2 = t * t; | |
float t3 = t2 * t; | |
float tension = 0.5f; | |
out.x = 0.5f * ( ( 2.0f * p1.x ) + | |
( -p0.x + p2.x ) * t + | |
( 2.0f * p0.x - 5.0f * p1.x + 4 * p2.x - p3.x ) * t2 + | |
( -p0.x + 3.0f * p1.x - 3.0f * p2.x + p3.x ) * t3 ); |
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 FullScreenActivity extends Activity | |
{ | |
@Override | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); |
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
@Override | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
// Full Screen | |
// | |
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); |
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
//Constructor. <em>this</em> is returned as new object and its | |
// internal [[prototype]] property will be set to the constructor's | |
// default prototype property. | |
// | |
var Circle = function(radius) | |
{ | |
this.radius = radius; | |
// Next line is implicit, added for illustration only. | |
// | |
// this.__proto__ = Circle.prototype; |
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
# python: how to flatten a tuple | |
# | |
# Basically the problem was that I wanted to create a flat tuple from a tuple and a single value like such: | |
# | |
val = 3 | |
tup = ( 'a', 3.14, "zzz" ) | |
# I wanted this: | |
# | |
# ( 3, 'a', 3.14, "zzz" ) |
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
# Split a list. | |
# Given [1,2,3,4,5,6,7,8] & 3 returns [[1,2,3], [4,5,6], [7,8]] | |
# | |
L = [1,2,3,4,5,6,7,8] | |
C = 3 | |
print [L:[i:i+C] for i in range(0, len(L), C)] | |
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
$csharp = @" | |
public class TakeAway | |
{ | |
public static int Minus(int a, int b) | |
{ | |
return (a - b); | |
} | |
} | |
"@ | |
Add-Type -TypeDefinition $csharp |
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
Task default -Depends Build | |
Task Build -Depends Init,Clean,Compile { | |
"build" | |
} | |
Task Compile -Depends Init,Clean { | |
"compile" |
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
<# | |
Create (if necessary) & returns a folder on the users desktop of the format yyyy-mm-dd which | |
can be used to export stuff into. | |
#> | |
function _get_exportFolder | |
{ | |
param() | |
$exportFolder = Join-Path (Join-Path $env:USERPROFILE "Desktop") (Get-Date -Format yyyy-MM-dd) |
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
#requires -version 2 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> |
OlderNewer