For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(week227). | |
| -compile([export_all]). | |
| -include_lib("eunit/include/eunit.hrl"). | |
| join(Xs, Ys) -> | |
| accumulate(shunt(Xs, []), Ys). | |
| shunt([], Ys) -> | |
| Ys; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(w2lists). | |
| -export([prod/1,mymax/1,test/0]). | |
| %Moddified according Elbrujohalcon: | |
| %Removed the "list is emty" function clause as we will let it crash. | |
| %prod([]) -> | |
| % "list is empty"; | |
| prod([H|T]) -> | |
| prod(T,H). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Game do | |
| use GenServer | |
| def init(game_id) do | |
| {:ok, %{game_id: game_id}} | |
| end | |
| def start_link(game_id) do | |
| GenServer.start_link(__MODULE__, game_id, name: {:global, "game:#{game_id}"}) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(assignment1). | |
| -include_lib("eunit/include/eunit.hrl"). | |
| -export([hypotenuse/2, area/1, perimeter/1, enclose/1, bits/1, bits_tail/1]). | |
| % You can run test with: | |
| % c(assignment1). | |
| % assignment1:test(). | |
| % Available shapes: | |
| % {circle, {X,Y}, R} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %%============================================================================== | |
| %% Mergesort implementation in Erlang | |
| %% | |
| %% Author: Shawn Debnath | |
| %%============================================================================== | |
| %%---------------------------------------------------------------------- | |
| %% msort/1 | |
| %% | |
| %% Mergesort (recursive), implements split and merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule State.Counter do | |
| use GenServer | |
| def start_link(opts \\ []) do | |
| GenServer.start_link(__MODULE__, :ok, opts) | |
| end | |
| ## Client API | |
| @doc "Gets the counter's current value." |