Skip to content

Instantly share code, notes, and snippets.

View ilya-pimenov's full-sized avatar

Ilya Pimenov ilya-pimenov

View GitHub Profile
@ilya-pimenov
ilya-pimenov / rgb2hsl.lua
Created January 13, 2014 22:49
Lua function to convert RGB color representation to HSL
local function rgb2hsl(r, g, b)
local max, min = math.max(r, g, b), math.min(r, g, b)
local h, s, l = (max + min) / 2, (max + min) / 2, (max + min) / 2
if max == min then
h, s = 0, 0 -- achromatic
else
local d = max - min
local s = nil
if l > 0.5 then
@ilya-pimenov
ilya-pimenov / hsl2rgb.lua
Created January 13, 2014 22:48
Lua function to convert HSL color representation to RGB
local function hsl2rgb(h, s, l)
local r, g, b = nil, nil, nil
if s == 0 then
r, g, b = l, l ,l -- achromatic
else
local hue2rgb = function(p, q, t)
if t < 0 then
t = t + 1
end
@ilya-pimenov
ilya-pimenov / aggregateop.png
Last active February 17, 2016 11:09
Full article here — http://ilyapimenov.com/blog/2013/11/14/hyperloglog-with-cascalog.html. We’ll look shortly in how you would utilize awesomeness of both Cascalog and HyperLogLog in order to execute Hadoop M/R tasks with amounts of data too big to have them in their original form.
aggregateop.png