Skip to content

Instantly share code, notes, and snippets.

View EddyLuten's full-sized avatar

Eddy Luten EddyLuten

View GitHub Profile

Keybase proof

I hereby claim:

  • I am eddyluten on github.
  • I am luten (https://keybase.io/luten) on keybase.
  • I have a public key ASAMlrRIzcCu0fP3u4rNAjZOl4N0At0yHpK53iyfBH3prQo

To claim this, I am signing this object:

@EddyLuten
EddyLuten / trace.rs
Created February 13, 2017 06:00
Trace.rs
use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
use std::error::Error;
struct Vector3D {
x: f32,
y: f32,
z: f32,
}
@EddyLuten
EddyLuten / resample.c
Created November 24, 2016 01:56
Resample using source area average (for downsampling)
#define UMAX(x, y) ((uint32_t)(x > y ? x : y))
#define UMIN(x, y) ((uint32_t)(x < y ? x : y))
static inline uint8_t* resample(
uint8_t* src,
uint32_t src_width,
uint32_t src_height,
uint32_t dest_width,
uint32_t dest_height
)
@EddyLuten
EddyLuten / nearest.c
Created November 23, 2016 09:39
Nearest neighbor 3-component image resizing function
static uint8_t* resize_nearest(
uint8_t* source_data,
uint32_t source_width,
uint32_t source_height,
uint32_t resized_width,
uint32_t resized_height
)
{
uint32_t x, y, di, si;
double px, py;
public static void main(String args[]) {
{
Scanner input = new Scanner (System.in);
int purchases = 0; // init purchases
char firstLetter;
do
{
// TODO: print some shit on the screen here
@EddyLuten
EddyLuten / build_error.rb
Created November 10, 2015 21:57
make check error 2.3.0-dev trunk 2015-11-10
[ 9905/15626] TestProcess#test_execopts_gid = 0.00 s
2) Error:
TestProcess#test_execopts_gid:
ArgumentError: can't find group for 804375733
/Users/xxx/git/ruby/test/ruby/test_process.rb:1792:in `getgrgid'
/Users/xxx/git/ruby/test/ruby/test_process.rb:1792:in `block in test_execopts_gid'
/Users/xxx/git/ruby/test/ruby/test_process.rb:1792:in `map'
/Users/xxx/git/ruby/test/ruby/test_process.rb:1792:in `test_execopts_gid'
@EddyLuten
EddyLuten / SNIP.Build.cs
Created June 1, 2014 08:19
Build Rules
// Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
namespace UnrealBuildTool.Rules
{
public class SNIP : ModuleRules
{
public SNIP(TargetInfo Target)
{
PublicIncludePaths.AddRange(
new string[] {
@EddyLuten
EddyLuten / gist:e2ba77b6225f5eab1cc7
Created June 1, 2014 08:18
UE 4.1 Linker Output
1>------ Build started: Project: UE4, Configuration: DebugGame_Editor x64 ------
1> Building UnrealHeaderTool...
1> Target is up to date.
1> Parsing headers for UE4Editor
1> Code generation finished for UE4Editor and took 2.629
1> Module.SNIP.cpp
1> link.exe UE4Editor-SNIP.dll
1> Creating library PATH\Engine\Plugins\SNIP\Intermediate/Build/Win64\Dynamic\UE4Editor\DebugGame\UE4Editor-SNIP.lib and object PATH\Engine\Plugins\SNIP\Intermediate/Build/Win64\Dynamic\UE4Editor\DebugGame\UE4Editor-SNIP.exp
1>Module.SNIP.cpp.obj : error LNK2001: unresolved external symbol "public: virtual struct FAttenuationSettings const * __cdecl USoundBase::GetAttenuationSettingsToApply(void)const " (?GetAttenuationSettingsToApply@USoundBase@@UEBAPEBUFAttenuationSettings@@XZ)
1>Module.SNIP.cpp.obj : error LNK2001: unresolved external symbol "public: virtual float __cdecl USoundBase::GetVolumeMultiplier(void)" (?GetVolumeMultiplier@USoundBase@@UEAAMXZ)
@EddyLuten
EddyLuten / chapter.4.issue.9.c
Created May 24, 2014 09:13
Chapter 4, Issue 9 - OpenGLBook.com
// https://github.com/openglbook/openglbook.com/issues/9
const Vertex VERTICES[8] =
{
{ { -.5f, -.5f, .5f, 1 }, { 0, 0, 1, 1 } }, // 0 L down front
{ { -.5f, .5f, .5f, 1 }, { 1, 0, 0, 1 } }, // 1 L up front
{ { .5f, .5f, .5f, 1 }, { 0, 1, 0, 1 } }, // 2 R up front
{ { .5f, -.5f, .5f, 1 }, { 1, 1, 0, 1 } }, // 3 R down front
{ { -.5f, -.5f, -.5f, 1 }, { 1, 1, 1, 1 } }, // 4 L down back
{ { -.5f, .5f, -.5f, 1 }, { 1, 0, 0, 1 } }, // 5 L up back
@EddyLuten
EddyLuten / chapter.4.38.c
Created May 21, 2014 03:03
Chapter 4, Snippet 38 - OpenGLBook.com
glGenBuffers(2, &BufferIds[1]);
ExitOnGLError("ERROR: Could not generate the buffer objects");