Skip to content

Instantly share code, notes, and snippets.

@mlt
mlt / tls_client.c
Last active September 13, 2024 18:06 — forked from mmozeiko/tls_client.c
simple example of TLS socket client using win32 schannel api
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <windows.h>
#define SECURITY_WIN32
#include <security.h>
#define SCHANNEL_USE_BLACKLISTS
#include <subauth.h>
#include <schnlsp.h>
#include <shlwapi.h>
#include <assert.h>
@mlt
mlt / table.shingle.R
Last active August 29, 2015 13:58 — forked from MrFlick/table.shingle.R
Update example with origin and legend
table.shingle<-function(..., as.data.frame=F) {
dots<-list(...)
stopifnot(all(sapply(dots, class) %in% c("shingle","factor")))
stopifnot(length(unique(sapply(dots, length)))==1)
dims<-sapply(dots, nlevels)
varnames<-tail(lapply(match.call(), deparse),-1)
varnames["as.data.frame"] <- NULL
res<-array(0, dims, `names<-`(lapply(dots, function(x) as.vector(sapply(levels(x), paste, collapse=":"))), varnames))
isinlevel<-function(z, ints) {
if(is.factor(z)) {