Instantly share code, notes, and snippets.

View shared.cc
// g++ -std=c++11 shared.cc
#include <iostream>
#include <memory>
#include <sys/time.h>
#include <sys/resource.h>
class A {
private:
View gist:e6b76998faabc09497b8bd16e502f9cd
Version Information
Data exported 2018-12-20T14:03:16.679Z
Chrome version Chrome/73.0.3645.0
Operating system Windows NT 10.0.17134
Software rendering list URL https://chromium.googlesource.com/chromium/src/+/b2e486f0d5a83d34bd6bdd72ebbe2005063a8133/gpu/config/software_rendering_list.json
Driver bug list URL https://chromium.googlesource.com/chromium/src/+/b2e486f0d5a83d34bd6bdd72ebbe2005063a8133/gpu/config/gpu_driver_bug_list.json
ANGLE commit id 4638dc9def81
2D graphics backend Skia/73 6f27489c650284c9488d0a82ab03b31dc48656cc-
Command Line chrome.exe --enable-webgl2-compute-context --use-angle=gl --flag-switches-begin --flag-switches-end
Driver Information
View simple_mjpeg_streamer_http_server_v3.py
#!/usr/bin/env python
'''
Author: Igor Maculan - n3wtron@gmail.com
Modifier: Yoshihiro Yamazaki - yoya@awm.jp
A Simple mjpg stream http server
'''
import cv2
from PIL import Image
import threading
from http.server import BaseHTTPRequestHandler,HTTPServer
View iterator_test.cpp
// g++ -std=c++11 iterator_test.cpp
#include <iostream>
#include <vector>
#include <algorithm>
class my_vector {
public:
std::vector<int> m_vec;
my_vector(int len, int value): m_vec(len, value) { ; }
View iterator_test.cpp
// g++ -std=c++11 iterator_test.cpp
#include <iostream>
#include <vector>
#include <algorithm>
class my_vector {
public:
std::vector<int> m_vec;
my_vector(int len, int value) {
View iterator_test.cpp
// g++ -std=c++11 iterator_test.cpp
#include <iostream>
#include <vector>
#include <algorithm>
class my_vector {
public:
std::vector<int> m_vec;
my_vector(int len, int value) {
View gist:9a320b24d9370913786a9e1e2f0d1ec1
% # Nearest Neighbor
% convert xc: -define filter:verbose=1 -filter box -resize 8 null: | awk '$1==0{s+=$2} $1>0{s+=$2*2} END {print s/100}'
1.01
% # Bi-Linear
% convert xc: -define filter:verbose=1 -filter triangle -resize 8 null: | awk '$1==0{s+=$2} $1>0{s+=$2*2} END {print s/100}'
1
% # Mitchell-Netravali (Bi-Cubic B:1/3, C:1/3)
% convert xc: -define filter:verbose=1 -filter mitchell -resize 8 null: | awk '$1==0{s+=$2/2} $1>0{s+=$2*2} END {print s/100}'
View imaging_resize.go
package main
import (
"flag"
"github.com/disintegration/imaging"
"image/png"
"os"
)
func main() {
View pil_imageops_equalize_gamma.py
from PIL import Image, ImageOps
import sys
import numpy as np
def gamma_correction(im, gamma):
arr = np.asarray(im)
arr = 255.0 * (arr / 255.0)**(gamma)
return Image.fromarray(np.uint8(arr))
im = Image.open(sys.argv[1])
View pil_imageops_equalize.py
from PIL import Image, ImageOps
import sys
im = Image.open(sys.argv[1])
im = im.convert("YCbCr")
yy, cb, cr = im.split()
yy = ImageOps.equalize(yy);
im = Image.merge("YCbCr", (yy, cb, cr))