Skip to content

Instantly share code, notes, and snippets.

View jackmott's full-sized avatar

Jack Mott jackmott

  • Olo
  • Texas,USA
View GitHub Profile
@jackmott
jackmott / FastRust.rs
Created September 12, 2016 20:41
FasterRustGame
// Optimized game implementation in Rust
extern crate time;
use std::time::Duration;
use time::precise_time_ns;
use std::ops::{Add, Sub, Mul};
use std::{thread};
const BLOCKS_PER_CHUNK: usize = 65535;
@jackmott
jackmott / 3dmaze.lua
Created October 2, 2016 12:58
Computer Craft / Minecraft 3D Maze Builder
--TODO - distribute torches more intelligently?
--TODO - more efficient ladder placement? turtle makes many unecessary moves to place them
--TODO - better ladder placement? ladders sometimes switch sides of the maze
--USAGE
--for large mazes, set up 3 chests in a row, each with one block of space between them:
--Put blocks in chest 1, to the right in chest 2 put torches, and in chest 3 ladders
--put the turtle on top of chest 1
--fuel up your turtle
@jackmott
jackmott / simdnoise.cs
Last active November 3, 2016 17:03
SIMD Perlin C#
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Numerics;
using System.Runtime.CompilerServices;
namespace FastNoise
{
public struct NoiseOutput
@jackmott
jackmott / GalaxyText.cs
Created December 7, 2016 18:36
Turning a simple XML style format into a List of objects that MonoGame can render
public static List<GalaxyText> Parse(string text,
SpriteFont font,
SpriteFont fontBold,
SpriteFont fontItalic,
SpriteFont fontBoldItalic)
{
var result = new List<GalaxyText>();
var state = new Stack<ParseState>();
state.Push(new ParseState(font, Color.White));
@jackmott
jackmott / climate.md
Last active December 30, 2016 01:32
Climate Change Answer

So the immediate answer to your question is that pre 1900's climate data comes from a variety of sources. The instrumental record actually goes back at least as far as 1850 (That is how far the Koch Brothers/ Berkeley data set goes for instance. ) predating that, when we look at time scales of millions of years we have to use various proxies Which ones are used and how precise they are depends how far back in time you go. The geologic time record goes back at least far as 500 million years

On twitter you rightly point out that extrapolation of future results based on past results is invalid. Even if we did have 4 billion years of perfect climate record, we would not be able to just fit a trend curve or line to that data and predict the next 100 years of earth's climate. You state on twitter that this past climate data is the

@jackmott
jackmott / Imagine.md
Created December 31, 2016 16:23
Imagine

Imagine it from the experts point of view. They just traveled to the arctic to drill ice cores, to bring back for analysis to learn more about the climate. They have been built climate models they worked for years on, the code is published and available to the public, you aren 100 other experts have had a go at this and come up with roughly the same results, for decades. You hop on twitter and see someone who says "I think climate change is a liberal plot" or "I think climate science is bunk" and you reply with data. The response to your data is "but I read this blog with this other data that contradicts yours!" and you go and look at the blog. It was written by a guy who is paid by the heritage foundation (who is paid by exxon and so on) who has never been to the arctic to drill ice cores, who has never built a climate model, never done any actual work except take your data and crop it in a way to sell his message. You try to explain this but communicating your expertise takes days while skeptical memes ta

@jackmott
jackmott / response.md
Last active January 5, 2017 19:05
Climate response

Next we are told that science is impartial. Yet I just saw an article with an climatologist who is pretty well respected Science Academy William Happer and Duane Thresher and Judith Curry saying they had to play their cards close to their vests in regards to their doubts about the models to keep funding and not kill their career. That's not good science and it supports the distrust that many of us have that this may be political and not good science. It certainly makes a case that we aren't crazy for wondering if there is political bias. The article points out that much of the research they do must be funded by govt. Which means politics decides what is researched.

>I think the big difference we ha

@jackmott
jackmott / nonsense post.md
Last active January 11, 2017 14:59
nonsense climate scince blog post

Climate Models – the Strange Case of Missing Hardware September 9, 2016 By Leo Goldstein at Defeat Climate Alarmism

The General Circulation Models (GCM), alleged by IPCC to forecast climate, are computationally intensive computer programs that repetitively perform the same task: integrating specific sets of differential equations, such as the primitive equations of weather. In such situations, a normal practice is developing specialized hardware for performing that task. One example is video encoding hardware, which evolved from big boxes, making grainy and jumpy 640×480 moving pictures, to the tiny circuits inside of the CPUs of modern cell phone, producing smooth 1920×1080 full motion video.

Even more relevant example is development of specialized Bitcoin mining hardware. Bitcoin was invented in 2009. Initially, Bitcoin miners used conventional desktops, equipped with CPUs and GPUs. Within few years, multiple generations of Bitcoin-mining FPGAs and ASICs were developed and manufactured. In 2015, speciali

@jackmott
jackmott / files.fs
Created February 23, 2017 03:56
iterate over a file in F#
open System.IO
[<EntryPoint>]
let main argv =
//use gaurantees that the file handle is disposed when it goes out of scope
use s = new StreamReader ("c:\path\to\text.txt")
while not s.EndOfStream do
let s = s.ReadLine()
printfn "%s" s
@jackmott
jackmott / frogs.cpp
Last active March 7, 2017 22:04
Frog Jumping!
#include <stdio.h>
#include <string>
#include <iostream>
#include <chrono>
using namespace std;
typedef int lilly;
struct Move{