Skip to content

Instantly share code, notes, and snippets.

View matthill's full-sized avatar

Matthew Hill matthill

View GitHub Profile
#!/usr/bin/python
import beanstalkc
import json
from pprint import pprint
beanstalk = beanstalkc.Connection(host='localhost', port=11300)
TUBE_NAME='alprd'
#include <iostream>
#include <asio/ssl/context.hpp>
#define ASIO_STANDALONE 1
#include "websocketpp/config/asio_client.hpp"
#include "websocketpp/config/debug_asio.hpp"
#include "websocketpp/client.hpp"
//#include "websocketpp/transport/asio/security/tls.hpp"
typedef websocketpp::client<websocketpp::config::debug_asio_tls> client;
@matthill
matthill / beanstalk_test.cpp
Last active September 8, 2016 12:31
Beanstalk library crashes when beanstalk is stopped/started
/*
* File: beanstalk_test.cpp
* Author: mhill
*
* Created on September 8, 2016, 7:20 AM
*/
#include <cstdlib>
#include <iostream>
#include <stdexcept>
import openalpr_api
from base64 import b64encode
apiclient = openalpr_api.DefaultApi()
with open("/storage/projects/alpr/samples/testing/car1.jpg", 'r') as img:
b64content = b64encode(img.read())
response = apiclient.recognize_post("sk_DEMODEMODEMODEMODEMODEMO", "plate,makemodel,color", image="", image_bytes=b64content, country="us")