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
/* http://doc.geoffgarside.co.uk/kqueue/files/chatserv.c */ | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/event.h> | |
#include <sys/time.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> |
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
diff --git a/build-rr.sh b/build-rr.sh | |
index 8b5bdf4..3be2a0b 100755 | |
--- a/build-rr.sh | |
+++ b/build-rr.sh | |
@@ -217,6 +217,8 @@ EOF | |
# -mno-red-zone. | |
if [ "${PLATFORM}" = "xen" -a "${MACHINE_ARCH}" = "x86_64" ]; then | |
echo "CFLAGS+=-mno-red-zone" >> ${RUMPTOOLS}/mk.conf | |
+ elif [ "${PLATFORM}" = "hw" -a "${MACHINE_ARCH}" = "x86_64" ]; then | |
+ echo "CFLAGS+=-mno-red-zone" >> ${RUMPTOOLS}/mk.conf |
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
/** | |
* This source file is used to print out a stack-trace when your program | |
* segfaults. It is relatively reliable and spot-on accurate. | |
* | |
* This code is in the public domain. Use it as you see fit, some credit | |
* would be appreciated, but is not a prerequisite for usage. Feedback | |
* on it's use would encourage further development and maintenance. | |
* | |
* Due to a bug in gcc-4.x.x you currently have to compile as C++ if you want | |
* demangling to work. |
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
% erl -pa /usr/share/elixir/1.0.5/lib/*/ebin -elixir ansi_enabled true | |
application:ensure_all_started(elixir), | |
rr("/usr/share/elixir/1.0.5/lib/elixir/src/elixir.hrl"). | |
% A simplified version of 'Elixir.Code':eval_string/2 | |
% https://github.com/elixir-lang/elixir/blob/v1.2.0/lib/elixir/lib/code.ex#L159 | |
EvalString = fun(String, Binding) -> | |
% Converts a given string (char list) into quote expression | |
% https://github.com/elixir-lang/elixir/blob/v1.2.0/lib/elixir/src/elixir.erl#L252 |
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
#!java | |
import com.ericsson.otp.erlang.OtpErlangObject; | |
import com.ericsson.otp.erlang.OtpErlangLong; | |
() -> new Object() { | |
public OtpErlangLong main(OtpErlangLong aLong, OtpErlangLong bLong) { | |
java.math.BigInteger a = aLong.bigIntegerValue(); | |
java.math.BigInteger b = bLong.bigIntegerValue(); | |
java.math.BigInteger result = a.add(b); | |
return new OtpErlangLong(result); |
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
#!java | |
// Sample Java 8 function to return what was passed in as the first argument. | |
// Notice that this template works for the /post/<thisfun> interface, where | |
// json input is passed in the first argument postBody, while the response | |
// is a binary or a string, which must be json as well. | |
import java.nio.charset.StandardCharsets; | |
import com.ericsson.otp.erlang.OtpErlangAtom; | |
import com.ericsson.otp.erlang.OtpErlangBinary; |
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
#!python | |
# Sample Python 3 function to return what was passed in as the first argument. | |
# Notice that this template works for the /post/<thisfun> interface, where | |
# json input is passed in the first argument postBody, while the response | |
# is a binary or a string, which must be json as well. | |
from Pyrlang import term | |
import json | |
def main(data_binary, context_binary): |
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
#!elixir | |
# Sample Python 3 function to return what was passed in as the first argument. | |
# Notice that this template works for the /post/<thisfun> interface, where | |
# json input is passed in the first argument postBody, while the response | |
# is a binary or a string, which must be json as well. | |
fn (body, context) -> | |
decoded_map = :jiffy.decode(body, [:return_maps]) | |
# TODO process decoded_map | |
result = decoded_map |
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
#!erlang | |
%% Sample Erlang (OTP-20) function to return what was passed in as the first argument. | |
%% Notice that this template works for the /post/<thisfun> interface, where | |
%% json input is passed in the first argument postBody, while the response | |
%% is a binary or a string, which must be json as well. | |
fun (Body, Context) -> | |
DecodedMap = jiffy:decode(Body, [return_maps]), | |
%% TODO process decoded_map | |
Result = DecodedMap, |
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
#!efene | |
#_ "A sample efene code to return what was passed in as the first argument." | |
#_ "Notice that this template works for the /post/<thisfun> interface, where" | |
#_ "json input is passed in the first argument postBody, while the response" | |
#_ "is a binary or a string, which must be json as well." | |
#_ "" | |
#_ "Read about Efene at efene.org" | |
#_ "see http://efene.org/language-introduction.html" | |
#_ "" | |
#_ "Author: Neeraj Sharma <neeraj.sharma@alumni.iitg.ernet.in>" |
OlderNewer