$ erlc -S test.erl
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
import os | |
import sys | |
pid = os.getpid() | |
with open(f"/proc/{pid}/status") as fp: | |
for line in fp.readlines(): | |
if line.startswith("Cap"): | |
print(line.strip()) |
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
#include <zmq.hpp> | |
#include <string.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main (void) | |
{ | |
zmq::context_t context(1); | |
const char * protocol = | |
"tcp://localhost:5555"; |
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
#include <iostream> | |
#include <pthread.h> | |
using namespace std; | |
class ScopedLock { | |
public: | |
ScopedLock(pthread_mutex_t & m): mp(&m){ | |
pthread_mutex_lock(mp); | |
}; | |
~ScopedLock(){ |
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
import getpass | |
import os | |
import threading | |
import time | |
from urllib.parse import urlparse | |
import zipfile | |
import numpy | |
try: | |
from PIL import Image |
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/instrumentation/net/http/otelhttp/example/server/server.go b/instrumentation/net/http/otelhttp/example/server/server.go | |
index 7389c267..f128042b 100644 | |
--- a/instrumentation/net/http/otelhttp/example/server/server.go | |
+++ b/instrumentation/net/http/otelhttp/example/server/server.go | |
@@ -19,6 +19,7 @@ import ( | |
"io" | |
"log" | |
"net/http" | |
+ "sync" |
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
import java.util.function.Function; | |
import java.lang.Long; | |
class Bench { | |
public static void main(String[] args) { | |
bench("noop ", (l) -> ""); | |
bench("Long.toHexString()", (l) -> Long.toHexString(l)); | |
bench("byteString.... ", (l) -> sfy(l)); | |
bench("String.format(...)", (l) -> String.format("%016X", l)); |
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
class HelloWorld { | |
public static void main(String[] args) { | |
bench1(); | |
bench2(); | |
} | |
static void bench1() { | |
long repeat = 1000000000L; | |
long start = java.lang.System.currentTimeMillis(); | |
for (long i = 0; i < repeat; i++) { |
NewerOlder