Skip to content

Instantly share code, notes, and snippets.

🎯
Elixir/OTP

Jakub Godawa vysogot

🎯
Elixir/OTP
Block or report user

Report or block vysogot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vysogot
vysogot / croissant.rb
Created Jul 5, 2011
croissant ordering
View croissant.rb
bar.receive_order(client.put_words_in_mouth('Un croissant, por favor.').speak_up)
@vysogot
vysogot / croissant.pl
Created Jul 5, 2011
croissant equation in eclipse clp
View croissant.pl
:- lib(ic).
croissant(X,Y,Z) :-
(X^2+Y^2+Z^2+7*sqrt(5)/2-11/2)^2 - ((1+sqrt(5))*X-7+3*sqrt(5))^2-(1+sqrt(5))^2*Y^2 $= 0,
locate([X,Y,Z], 1e-5).
# one of the solutions
croissant(X,Y,Z).
X = X{0.0 .. 7.4073630564431975e-6}
Y = Y{1.066573563196598 .. 1.0665754743970506}
@vysogot
vysogot / permset.rb
Created Jul 4, 2011
permute sets with acumulators
View permset.rb
def permute(*args)
# initialize the register for each array
# with [array itself, offset, its size]
memory = []
perm_count = 1
args.each do |array|
size = array.size
memory << [array, 0, size-1]
You can’t perform that action at this time.