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
import Data.List (intersperse) | |
data Op = Add | Sub | Mul | Div | |
deriving (Eq) | |
instance Show Op where | |
show Add = "+" | |
show Sub = "-" | |
show Mul = "*" | |
show Div = "/" |
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 Money ( | |
Money | |
, cents | |
, dollars | |
, amount | |
, fromCents | |
, fromDollars | |
, ($+$), ($+), (+$) | |
, ($-$), ($-), (-$) | |
, ($/$) |
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
package main | |
import( | |
"fmt"; | |
"math"; | |
) | |
type Point interface { | |
DistanceFromPoint(point Point) float64; | |
DistanceFromCartesian(x, y float64) float64; |
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
package main | |
import "./specify" | |
var spec MySpec; | |
type mySpec struct { | |
specify.Specification; | |
} |
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
diff --git a/Rakefile b/Rakefile | |
index 3ab2592..96c8c83 100644 | |
--- a/Rakefile | |
+++ b/Rakefile | |
@@ -49,7 +49,7 @@ Rake::GemPackageTask.new(gemspec) do |pkg| | |
end | |
namespace :test do | |
- Rake::TestTask.new :all => [:extension] do |t| | |
+ Rake::TestTask.new :all => [:test_extension] do |t| |
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
blocking_resolver_lookup_service: _xmpp-client._tcp.localhost | |
Error while parsing srv response in blocking_resolver_lookup_service | |
./vertebra-rb/bin/../lib/vertebra/agent.rb: line 220 | |
(null)-CRITICAL **:lm_resolver_new_for_host: assertion `host != NULL' failed | |
./vertebra-rb/bin/../lib/vertebra/agent.rb:220: [BUG] Bus Error | |
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.4.0] | |
Abort trap | |
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
blocking_resolver_lookup_service: _xmpp-client._tcp.localhost | |
Error while parsing srv response in blocking_resolver_lookup_service | |
./vertebra-rb/bin/../lib/vertebra/agent.rb: line 220 | |
(null)-CRITICAL **:lm_resolver_new_for_host: assertion `host != NULL' failed | |
./vertebra-rb/bin/../lib/vertebra/agent.rb:220: [BUG] Bus Error | |
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.4.0] | |
Abort trap | |
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(clusterl_dedup). | |
-export([init/0, first/1]). | |
-define(TABLE, ?MODULE). | |
-define(DELETION_TIMEOUT, 3600000). % 1 hour | |
init() -> | |
ets:new(?TABLE, [public, named_table]). |
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(clusterl_dedup). | |
-export([init/0, first/1]). | |
-define(TABLE, ?MODULE). | |
-define(DELETION_TIMEOUT, 3600000). % 1 hour | |
init() -> | |
ets:new(?TABLE, [public, named_table]). |
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
-define(ANNOUNCE(Id, Port), {announce, Id, Port}). | |
handle_info({radio_signal, Ip, Port, ?ANNOUNCE(Id, Port)}, State) -> | |
#state{id=MyId} = State, | |
case Id of | |
MyId -> ignore; | |
_ -> | |
error_logger:info_msg("Received PING from ~p~n", [Id]), | |
clusterl_radio:transmit(Ip, Port, ?ANNOUNCE(Id, Port)) | |
end, |