Skip to content

Instantly share code, notes, and snippets.

View r4nx's full-sized avatar

Viacheslav H. r4nx

View GitHub Profile
@r4nx
r4nx / calc.cpp
Last active December 26, 2021 20:12
Parsing-based calculator in C++20
#include <cctype>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <map>
#include <stack>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <iostream>
#include <string>
#include <array>
#include <algorithm>
#include <cctype>
using namespace std;
int main()
@r4nx
r4nx / test.py
Created August 27, 2018 17:01 — forked from christianroman/test.py
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()