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
% 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
#!python | |
# | |
# py_test_stdout_stderr_with_exceptiuon | |
# | |
# Author: Neeraj Sharma | |
""" | |
Demonstrate logging via stdout and stderr. Take special note of | |
usage of traceback, which gives very nicely formatted call | |
traceback in case of errors. |
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. | |
// Additionally, this function can be used to test stdout and stderr logs. | |
import java.nio.charset.StandardCharsets; | |
import com.ericsson.otp.erlang.OtpErlangAtom; |
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 | |
# @doc 10 minutes to pandas, so lets have some fun | |
# | |
# py_10_min_to_pandas | |
# | |
# see https://pandas.pydata.org/pandas-docs/stable/10min.html | |
# see https://gist.github.com/neeraj9/970e73412a893ddaed7be31e84199c29 | |
# | |
# Dependencies: | |
# |
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 | |
%% @doc Intent Analysis via Microsoft Luis | |
%% | |
%% run nlp_microsoft_luis(<<"I want to travel to Europe. Can you give me possible locations?">>) | |
%% | |
fun(Msg) -> | |
%% The json configuration must be set for this function (TBD) | |
Config = beamparticle_dynamic:get_config(), | |
Endpoint = erlang:binary_to_list(maps:get(<<"endpoint">>, Config)), | |
Key = erlang:binary_to_list(maps:get(<<"key">>, Config)), |
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
{ | |
"endpoint": "00000000-0000-0000-0000-000000000000", | |
"key": "00000000000000000000000000000000" | |
} |
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
{ | |
"entities": [ | |
{ | |
"endIndex": 25, | |
"entity": "europe", | |
"score": 0.986519933, | |
"startIndex": 20, | |
"type": "builtin.geography.continent" | |
} | |
], |
OlderNewer