Skip to content

Instantly share code, notes, and snippets.

View fador's full-sized avatar

Marko Viitanen fador

View GitHub Profile
__constant sampler_t sampler =
CLK_NORMALIZED_COORDS_FALSE
| CLK_ADDRESS_CLAMP_TO_EDGE
| CLK_FILTER_NEAREST;
const int BLOCKSIZE = 16;
const int ME_RANGE = 32;
const int ME_RANGE_x2 = 64;
__kernel void motion_est(
@fador
fador / build.bat
Created August 8, 2012 13:02
Mineserver VC2010 autocompilation script
@echo off
set gitcmd="%ProgramFiles(x86)%\Git\bin\git.exe"
set sevenzipcmd="%ProgramFiles%\7-Zip\7z.exe"
rem goto onlybuild
del /S /Q mineserver
rd /S /Q mineserver
%gitcmd% clone git://github.com/fador/mineserver.git
:onlybuild
@fador
fador / java-sha1.c
Created August 6, 2012 10:34
Java-like hex digest generation in C using openssl / libssl
/*
for mineserver ( https://github.com/fador/mineserver/ )
[email protected]
*/
#include <stdio.h>
#include <string.h>
#include <openssl/sha.h>
int main()
{
@fador
fador / Minecraft client block placement
Created November 13, 2010 13:00
1.2.2 client sends another block placement with illegal data
Packet 1
0f
Packet 2
00 03 ff ff fe ff 41 ff ff ff 17 05 12 00 00 00 01 01 0f 00 03 ff ff ff ff ff ff ff ff ff ff
Analysis
0f = block placement
00 03 = item id, dirt
ff ff fe ff = X coordinate, -257