Vulkan is a low-overhead, cross-platform 3D graphics and compute API.
Vulkan targets high-performance realtime 3D graphics applications such as games and interactive media across multiple platforms providing higher performance and lower CPU usage.
// $ em++ -lwebsocket.js -o index.html main.cpp | |
#include <emscripten/emscripten.h> | |
#include <emscripten/websocket.h> | |
#include <stdio.h> | |
EM_BOOL onopen(int eventType, const EmscriptenWebSocketOpenEvent *websocketEvent, void *userData) { | |
puts("onopen"); | |
EMSCRIPTEN_RESULT result; |
// | |
// cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out | |
// | |
#include <SDL.h> | |
#import <Metal/Metal.h> | |
#import <QuartzCore/CAMetalLayer.h> | |
int main (int argc, char *args[]) | |
{ | |
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal"); |
Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.
This is how you can take an OpenVPN .ovpn config file and extract the certificates/keys required to import the profile into NetworkManager.
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
newmtl cube | |
Ns 10.0000 | |
Ni 1.5000 | |
d 1.0000 | |
Tr 0.0000 | |
Tf 1.0000 1.0000 1.0000 | |
illum 2 | |
Ka 0.0000 0.0000 0.0000 | |
Kd 0.5880 0.5880 0.5880 | |
Ks 0.0000 0.0000 0.0000 |