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
// trim from start | |
static inline std::string <rim(std::string &s) { | |
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); | |
return s; | |
} | |
// trim from end | |
static inline std::string &rtrim(std::string &s) { | |
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); | |
return s; |
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
df= pd.DataFrame(np.random.randn(10,4)) | |
df[4]= [[df[2][x],df[3][x]] for x in range(df.shape[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
In [26]: s | |
first second third | |
bar doo one 0.404705 | |
two 0.577046 | |
baz bee one -1.715002 | |
two -1.039268 | |
foo bop one -0.370647 | |
two -1.157892 | |
qux bop one -1.344312 |
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
from IPython.display import HTML | |
HTML('''<script> | |
code_show=true; | |
function code_toggle() { | |
if (code_show){ | |
$('div.input').hide(); | |
} else { | |
$('div.input').show(); | |
} |
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
BEGIN TRANSACTION; | |
CREATE TEMPORARY TABLE t1_backup(a,b); | |
INSERT INTO t1_backup SELECT a,b FROM t1; | |
DROP TABLE t1; | |
CREATE TABLE t1(a,b); | |
INSERT INTO t1 SELECT a,b FROM t1_backup; | |
DROP TABLE t1_backup; | |
COMMIT; |
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 Update () { | |
//this.transform.RotateAround(this.transform.parent.position, this.transform.parent.up, 1); | |
MyRotateAround(this.transform.parent.position, this.transform.parent.up, 1); | |
} | |
void MyRotateAround(Vector3 pos, Vector3 up, float degree) | |
{ | |
Quaternion q = Quaternion.AngleAxis(degree, up); | |
this.transform.position = q * (this.transform.position-pos) + pos; |
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
/* | |
CSVReader by Dock. (24/8/11) | |
http://starfruitgames.com | |
usage: | |
CSVReader.SplitCsvGrid(textString) | |
returns a 2D string array. | |
Drag onto a gameobject for a demo of CSV parsing. |
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
Shader "Sprites/Gray" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 | |
} | |
SubShader |
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
Shader "Sprites/Clipped" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 | |
_ClipX ("Clip X", Range(0.0, 2000.0)) = 0 | |
_ClipY ("Clip Y", Range(0.0, 1000.0)) = 0 | |
_Width ("Width", Range(0.0, 2000.0)) = 2000 |
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
Homebrew build logs for homebrew/versions/protobuf250 on macOS 10.12 | |
Build date: 2016-09-23 11:33:58 |
OlderNewer