Skip to content

Instantly share code, notes, and snippets.

View TranquilMarmot's full-sized avatar
🛸
Better Nate than Lever

Nate Moore TranquilMarmot

🛸
Better Nate than Lever
View GitHub Profile
#include<stdio.h>
#include<time.h>
int main(){
time_t now, then;
time(&now);
int i;
for(i = 0; i < 1000000; i++){
// do nothing?
@TranquilMarmot
TranquilMarmot / gist:5456079
Created April 24, 2013 22:19
What in sam hill
public void setColor (float r, float g, float b, float a) {
int intBits = ((int)(255 * a) << 24) | ((int)(255 * b) << 16) | ((int)(255 * g) << 8) | ((int)(255 * r));
float color = NumberUtils.intToFloatColor(intBits);
if (color == this.color) return;
this.color = color;
float[] vertices = this.vertices;
for (int i = 2, n = idx; i < n; i += 5)
vertices[i] = color;
}
@TranquilMarmot
TranquilMarmot / arnold_fortune
Last active December 14, 2015 18:38
Arnold fortune
"It's showtime!"
%
"Alright everyone, chill."
%
"Allow me to break the ice."
%
"I need you clothes, your boots and your motorcycle."
%
"What the hell did you do to him, man?"
"I did nothing. The pavement was his enemy."
int fib(int x){
if(x <= 0)
return 0;
if(x == 1)
return 1;
return fib(x - 1) + fib(x - 2);
}
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">
FATAL EXCEPTION: main
java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:1981)
at com.bitwaffle.guts.android.input.touch.TouchHandler.move(TouchHandler.java:90)
at com.bitwaffle.guts.android.input.touch.TouchHandler.touchEvent(TouchHandler.java:71)
at com.bitwaffle.guts.android.SurfaceView.onTouchEvent(SurfaceView.java:44)
at android.view.View.dispatchTouchEvent(View.java:7239)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)