Skip to content

Instantly share code, notes, and snippets.

test() ->
Years = [1,2],
Sex = [male,female],
Age = [toddler, teen, grownup],
Headers = [something,or_other,and_also],
Excpected [
{1,male,toddler,something,{or_other,and_also},
{1,male,teen,something,{or_other,and_also},
{1,male,grownup,something,{or_other,and_also},
{2,female,toddler,something,{or_other,and_also},
test() ->
Years = [1,2,3,4],
Sex = [male,female],
Age = [toddler, teen, grownup],
Headers = [origin,citizenship,other],
[H|T] = Headers,
lists:foldl(fun(Y,YAcc) ->
YG = lists:foldl(fun(S,SAcc) ->
SG = lists:foldl(fun(A,AAcc) ->
Ag = list_to_tuple(T),
note(a).
note(b).
note(c).
%note(d).
%note(e).
%note(f).
%note(g).
%note(csharp).
%note(asharp).
%note(dsharp).
@nisbus
nisbus / gist:4733580
Last active December 12, 2015 06:59
Learning prolog...
%%% Why does this return X = [something,something,something,something|_G610].
%%% when I call it with
%%% ?- add_elems(5,X).
%%%
%%% What is the uninstantiated variable at the end and how do I get rid of it?
add_elems(0,_).
add_elems(N,Out) :-
NewN is N-1,
server {
server_name couchdb.nisbus.com www.couchdb.nisbus.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:5984;
proxy_redirect default;
proxy_set_header Host $host:$proxy_port;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Origin' '*';
server {
server_name couchdb.nisbus.com www.couchdb.nisbus.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:5984;
proxy_redirect default;
proxy_set_header Host $host:$proxy_port;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Origin' '$http_origin';
server {
server_name couchdb.nisbus.com www.couchdb.nisbus.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:5984;
proxy_redirect default;
proxy_set_header Host $host:$proxy_port;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Origin' '*';
month(<<"J",_/binary>>) ->
1;
month(<<"F",_/binary>>) ->
2;
month(<<"Apr",_>>) ->
4;
month(<<"Mar",_>>) ->
5;
month(<<"M",_/binary>>) ->
3;
%%% -*- mode: erlang -*-
{sys, [
{lib_dirs, ["../..",
"../deps"]},
{rel, "bonds_service", "0.0.1",
[
kernel,
inets,
stdlib,
sasl,
<metro:MetroWindow x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Routing="clr-namespace:ReactiveUI.Routing;assembly=ReactiveUI.Routing"
xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro" AllowsTransparency="False">
<i:Interaction.Behaviors>
<behaviours:BorderlessWindowBehavior ResizeWithGrip="True" EnableDWMDropShadow="True" />
</i:Interaction.Behaviors>