Skip to content

Instantly share code, notes, and snippets.

View suvirbhargav's full-sized avatar
👋

suvirb suvirbhargav

👋
View GitHub Profile
@suvirbhargav
suvirbhargav / main.cpp
Created August 25, 2020 07:24
Using webcam video as texture in OpenGL + some modification to run it with current opencv on Linux.
// Original gist was here: https://gist.github.com/Ashwinning/baeb0835624fedc2e5b809d42417b70e
// Modified from "Video Texture" code
// Copyright (C) 2009 Arsalan Malik (arsalank2@hotmail.com)
//
// On Mac OS X, compile with:
// g++ -o VideoTexture VideoTexture.cpp -framework OpenGL -framework Glut -I
// /usr/local/include/opencv/ $(pkg-config --libs opencv)
//////////////////////////////////////////////////////////////////////////////
// On Linux,
// g++ -o example-opengl example-opengl.cpp -I/usr/include/opencv4
Sample of writing runnable for firefox xulrunner based code.
Header
=======
#ifndef PROFILER_RUNNABLES_H_
#define PROFILER_RUNNABLES_H_
#include <vector>
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
" This is the Vundle package, which can be found on GitHub.
" For GitHub repos, you specify plugins using the
" 'user/repository' format
Plugin 'gmarik/vundle'
execute pathogen#infect()
syntax on
colorscheme darcula
filetype plugin indent on
set guifont=Monospace\ 12
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_previous_completion=[]
autocmd vimenter * NERDTree
autocmd StdinReadPre * let s:std_in=1
vim \
-c 'hardcopy > output.ps' \
-c quit <input_file>
'''
so, i saw c++11 example on nvidia blog about using threads for doing things in parallel.
don't know about the speed, but the code isn't that intuitive, so i wrote one python as multiprocessing feels easier and cleaner in python.
'''
import multiprocessing
import time
def process_article(single_character):