Skip to content

Instantly share code, notes, and snippets.

View sevanspowell's full-sized avatar

Samuel Bennett (Evans-Powell) sevanspowell

  • Australia
View GitHub Profile
// CSV contents is a 2D array, each line has it's own row and each row is made up of the fields found in that line.
Vector< Vector<std::string> > csvContents;
std::ifstream infile(fileName.c_str());
// Load elements of CSV into Vector.
while(infile.good())
{
std::string line;
std::getline(infile, line);
std::stringstream lineStream(line);
@sevanspowell
sevanspowell / boot.lua
Created December 8, 2016 04:49
DraygonTensor - example Lua script
function init()
print("Script: init called!")
cam = Script.spawn_prefab("player", Vector3(0, 0, 0))
Script.spawn_prefab("box", Vector3(0, 0, -10))
end
function shutdown()
print("Script: shutdown called!")
end
@sevanspowell
sevanspowell / config.json
Created December 9, 2016 01:19
Draygon Tensor - An example config file
{
"Video": {
"redBits": 8,
"greenBits": 8,
"blueBits": 8,
"alphaBits": 8,
"depthBits": 24,
"stencilBits": 8,
@sevanspowell
sevanspowell / .prefab file
Last active December 9, 2016 01:20
DraygonTensor - An example prefab file
{
"components": {
"cameraComponent": {
"projection": "perspective",
"vertical_fov": 1.04719,
"near_clip": 0.1,
"far_clip": 700.0
},
"scriptComponents": {
"scriptPaths": {
@sevanspowell
sevanspowell / error.txt
Last active May 3, 2018 10:18
Nix package configuration
...
Configuring quickcheck-instances-0.3.16...
Setup: Encountered missing dependencies:
QuickCheck ==2.10.*
builder for ‘/nix/store/vqqckyhfizaljp0k4zjg1zq1s2z79x1d-quickcheck-instances-0.3.16.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/7aasasy36xzhqcbikp8wc6dmnffarrq7-aeson-1.2.3.0.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/7aasasy36xzhqcbikp8wc6dmnffarrq7-aeson-1.2.3.0.drv’ failed
Trying to isolate the problem, adding the expression:
let a = Address default_
I get:
• Couldn't match type ‘Columnar f0 Int’
with ‘QGenExpr ctxt0 expr0 s0 a0’
Expected type: C f0 Int
Actual type: QGenExpr ctxt0 expr0 s0 a0
The type variables ‘f0’, ‘ctxt0’, ‘expr0’, ‘s0’, ‘a0’ are ambiguous
• In the first argument of ‘Address’, namely ‘default_’
In the expression: Address default_
amazonka = nixpkgs.fetchFromGitHub {
owner = "brendanhay";
repo = "amazonka";
rev = "c9d8a62118b2269fb54b1e89c4e92106e8243050";
sha256 = "1nxdgg69fjn6b4nik99mmsa6hrv9737kwls00jyfnwwavqxik49q";
};
@sevanspowell
sevanspowell / default.nix
Created October 4, 2018 06:32
mypkgs default.nix
{ system ? builtins.currentSystem }:
let
pkgs = import <nixpkgs> { inherit system; overlays = [ (import ./my-overlay.nix) ]; };
in pkgs
@sevanspowell
sevanspowell / shell.nix
Created October 4, 2018 22:46
Example shell.nix
{ compiler ? "ghc822" }:
let
pkgs = import <mypkgs> { };
drv = pkgs.haskellPackages.my-private-package;
in
if pkgs.lib.inNixShell then drv.env else drv
@sevanspowell
sevanspowell / errors
Last active October 11, 2018 01:30
Haskell static linking
Linking dist/build/my-package/my-package ...
/nix/store/k8b9hqv58dd1z0j4ikak24ykndcm91s6-binutils-2.28.1/bin/ld: cannot find -lcrypto
/nix/store/k8b9hqv58dd1z0j4ikak24ykndcm91s6-binutils-2.28.1/bin/ld: cannot find -lssl