Skip to content

Instantly share code, notes, and snippets.

View shakkhar's full-sized avatar

Mashiat Shakkhar shakkhar

View GitHub Profile

CSC 2/458, 4-11 Feb. 2008

Moir & Shavit, Herlihy & Shavit


combining trees scale but poor latency under low load blocking counting networks get rid of the blocking problem diffracting trees are basically counting networks that use randomization

@shakkhar
shakkhar / v4l2_capture.c
Last active April 25, 2024 03:25
Using Libav API to capture from V4L2 device. (This is based on doc/examples/demuxing_decoding.c from FFmpeg codebase. I had to modify it because FFmpeg does not ship with Ubuntu.)
/*
* Copyright (c) 2012 Stefano Sabatini
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@shakkhar
shakkhar / python_internals
Created March 25, 2014 21:41
Useful links to learn Python internals
http://nedbatchelder.com/text/whirlext.html
http://tech.blog.aknin.name/category/my-projects/pythons-innards/
http://eli.thegreenplace.net/category/programming/python/python-internals/
http://jessenoller.com/good-to-great-python-reads/
http://akaptur.github.io/blog/categories/python-internals/
http://tomlee.co/wp-content/uploads/2012/11/108_python-language-internals.pdf
http://www.troeger.eu/files/teaching/pythonvm08.pdf
@shakkhar
shakkhar / smtpsender.py
Created July 21, 2013 03:55
Sending emails from python using smtplib
import smtplib
from email.mime.text import MIMEText
msg = MIMEText("this is a test message")
s = smtplib.SMTP("__SMTP_SERVER_ADDRESS__")
s.starttls()
s.login("__SMTP_USER_NAME__","__SMTP_PASSWORD__")
s.sendmail("__SENDER_EMAIL__", ["__RECIPIENT_EMAIL__"], msg.as_string())
s.close()
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct param {
const char *text;
int len;
} param;
param params[256];