Skip to content

Instantly share code, notes, and snippets.

View khenidak's full-sized avatar
💭
"If we're going to be damned, let's be damned for what we really are."

Khaled Henidak (Kal) khenidak

💭
"If we're going to be damned, let's be damned for what we really are."
View GitHub Profile
@khenidak
khenidak / PriorityQueue.cs
Created September 30, 2019 19:34
thread safe C# priority queue
/*
we depend on the discipline List<T> have (or not) arround allocating arrays
if you are dealing with known length then modify to have a cap parameter and pre allocate your List<T>
*/
using System;
using System.Threading;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
git log --pretty=format:"%h" <base branch>..<target branch> | xargs -I {} git diff-tree -v --name-status -r {}
// src https://www.cs.cmu.edu/afs/cs/academic/class/15213-f99/www/class26/tcpserver.c
// modified to show the impact of bind(2) v listen(2) on tcp connection as visible by netstat -atp
/*
* tcpserver.c - A simple TCP echo server
* usage: tcpserver <port>
*/
#include <stdio.h>