This file contains 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
proc addTwoIntegers(a, b: int): int {.importc.} | |
when isMainModule: | |
echo addTwoIntegers(3, 7) |
This file contains 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
<html> | |
<body> | |
<script type="text/javascript"> | |
function addTwoIntegers(a, b) | |
{ | |
return a + b; | |
} | |
</script> | |
<script type="text/javascript" src="calculator.js"></script> |
This file contains 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
{.compile: "logic.c".} | |
proc addTwoIntegers(a, b: cint): cint {.importc.} | |
when isMainModule: | |
echo addTwoIntegers(3, 7) |
This file contains 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
int addTwoIntegers(int a, int b) | |
{ | |
return a + b; | |
} |
This file contains 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/rand" | |
"time" | |
) | |
func main() { | |
for i := 0; i < 10; i++ { |
This file contains 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
(ns async-example.core | |
(:require [clojure.core.async :refer :all]) | |
(:gen-class)) | |
(defn -main [& args] | |
(doseq [i (range 10)] | |
(go | |
(Thread/sleep (rand-int 1000)) | |
(println i))) |
This file contains 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
require "rubygems" | |
require "bunny" | |
require "json" | |
# Returns a connection instance | |
conn = Bunny.new ENV['CLOUDAMQP_URL'] | |
# The connection will be established when start is called | |
conn.start | |
# Create a channel in the TCP connection |
This file contains 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
require "rubygems" | |
require "bunny" | |
require "json" | |
# Returns a connection instance | |
conn = Bunny.new ENV['CLOUDAMQP_URL'] | |
# The connection will be established when start is called | |
conn.start | |
# create a channel in the TCP connection |
This file contains 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
require "kafka" | |
logger = Logger.new($stderr) | |
brokers = ENV.fetch("KAFKA_BROKERS") | |
# Make sure to create this topic in your Kafka cluster or configure the | |
# cluster to auto-create topics. | |
topic = "text" | |
kafka = Kafka.new( |
This file contains 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
require "kafka" | |
# We don't want log output to clutter the console. Replace `StringIO.new` | |
# with e.g. `$stderr` if you want to see what's happening under the hood. | |
logger = Logger.new(StringIO.new) | |
brokers = ENV.fetch("KAFKA_BROKERS").split(",") | |
# Make sure to create this topic in your Kafka cluster or configure the | |
# cluster to auto-create topics. |