Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivan Uemlianin llaisdy

View GitHub Profile
View logic-problem.lp
%%%% Boys in the Hood
%%%% The world.
episode(1..5).
victim(friar_tuck; little_john; maid_marian; much; will_scarlet).
location(inn; dungeon; lodge; gaol; stocks).
disguise(abbot; shepherd; phantom; prince_john; washerwoman).
%% For each Episode, there is one (V,L,D) combination,
%% and the four variables together make a story.
View drop31.ex
defmodule Drop do
def clown1(x) do
5 * x
end
def clown2a(x) do 5 * x end
def clown2b (x) do 5 * x end
def clown2c x do 5 * x end
View rebar.compile.gcc48
$ env CC=gcc ./rebar compile
==> rdma_dist-master (compile)
Compiling c_src/rdma_drv.c
In file included from c_src/rdma_drv.c:17:0:
/usr/include/arpa/inet.h:27:1: error: unknown type name ‘__socklen_t’
typedef __socklen_t socklen_t;
^
/usr/include/arpa/inet.h:35:1: error: unknown type name ‘in_addr_t’
extern in_addr_t inet_addr (__const char *__cp) __THROW;
^
View sortable_demo.html
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"/></head>
<body>
<h1>Sortable Demo</h1>
<div id="demo"></div>
<div id="jsfooter">
<script src="https://fb.me/react-0.13.3.min.js"></script>
View ht.pl
% hex tiles puzzle
% - https://chris-lamb.co.uk/posts/giants-causeway-puzzle
% - https://llaisdy.wordpress.com/2015/01/13/that-giants-causeway-puzzle-in-prolog/
:- use_module(library(clpfd)). %% for all_different/1
%% tile(Name, Colours).
% tiles from picture
@llaisdy
llaisdy / gist.erl
Last active Dec 17, 2015
folding functions over context
View gist.erl
-module(gist).
-export([authenticate/3]).
authenticate(UserName, Pass, IPAddress) ->
Checks = [fun user_ok/1,
fun password_ok/1,
fun ipaddr_ok/1
],
{Result, _} = lists:foldl(
fun(_CheckFun, {{error, Reason}, _}) ->
You can’t perform that action at this time.