Skip to content

Instantly share code, notes, and snippets.

@manuel
manuel / stuns
Created March 16, 2014 17:48 — forked from zziuni/stuns
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@manuel
manuel / webrtc logs
Last active August 29, 2015 13:57
webrtc logs
PC 1: Chromium Version 31.0.1650.63 Built on Debian 7.2, running on Debian 7.3 (238485)
PC 2: Chrome Version 33.0.1750.149, Mac OS X
PC 1 (manuel28):
Creating local peer: manuel28 bbrtc.js:51
Creating RTCPeerConnection. bbrtc.js:33
Listening for ICE candidates. bbrtc.js:33
Listening for `negotiationneeded` bbrtc.js:33
Listening for data channel bbrtc.js:33
;; Causes stack overflow:
(def p 'p)
(def (spawn-thread)
(push-prompt p
(loop
(sleep))))
(def (sleep)
// lambda trampoline
#include <stdio.h>
void foo(char *s)
{
__asm("foo_label:");
printf("%s\n", s);
}
// lambda trampoline. crashes with gcc -O2 and -O3.
#include <stddef.h>
#include <stdio.h>
void
foo(char *s)
{
__asm("foo_label:");
printf("%s\n", s);
print "You have no mail.\n"
10000.times {
'$ '.display
gets.each do | e |
if (e == "uname\n")
puts "Runix 1.0"
elsif (e == "halt\n")
exit
else
// mutually recursive listener and broadcaster types with
// f-bounded polymorphism
class ListenerType<L extends ListenerType<L, B>, B extends BroadcasterType<L, B>> {
}
class BroadcasterType<L extends ListenerType<L, B>, B extends BroadcasterType<L, B>> {
}
class Listener extends ListenerType<Listener, Broadcaster> {
}
class Broadcaster extends BroadcasterType<Listener, Broadcaster> {
}
#include <stdio.h>
#define CALL(name, ...) \
{ \
int the_args[] = { __VA_ARGS__ }; \
name(sizeof(the_args) / sizeof(int), the_args); \
}
void the_fun(unsigned nargs, int *args)
{
(defclass (term A))
(defclass literal-term ((term number))
((value number))
(:constructor ((value number))))
(defclass is-zero-term ((term boolean))
((subterm (term number)))
(:constructor ((subterm (term number)))))
abstract class Term<T> {
abstract T eval();
}
class IntegerTerm extends Term<Integer> {
Integer value;
IntegerTerm(Integer value) { this.value = value; }
Integer eval() { return value; }
}