Skip to content

Instantly share code, notes, and snippets.

View zeryx's full-sized avatar

zeryx zeryx

View GitHub Profile
@zeryx
zeryx / CMakeLists.txt
Created October 11, 2018 17:21
minimal pytorch 1.0 pytorch -> C++ full example demo image at: https://i.imgur.com/hiWRITj.jpg
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(cpp_shim)
set(CMAKE_PREFIX_PATH ../libtorch)
find_package(Torch REQUIRED)
find_package(OpenCV REQUIRED)
add_executable(testing main.cpp)
message(STATUS "OpenCV library status:")
message(STATUS " config: ${OpenCV_DIR}")
@zeryx
zeryx / http_api_example.cs
Last active January 10, 2017 16:01
example C# script for interfacing with algorithmia using application/text I/O
using System;
using System.Net;
using System.IO;
public class Program
{
public static void Main()
{
// C# from http://stackoverflow.com/questions/25306570/convert-curl-to-c-sharp
@zeryx
zeryx / example.php
Last active December 16, 2016 17:32
posting a summarizer request with CURL
# A very simple PHP example that sends a HTTP POST to a algorithmia and summarizes text.
#
#available input content types:
# application/json for json
# text/plain for simple string
# application/octet-stream for binary
<?php
$ch = curl_init();
$data ='Your big document of text to get summarized, you could import this as a file as well.';
@luispedro
luispedro / bloomfilter.py
Created August 7, 2010 22:07
Bloom filter in python
import numpy as np
def insert_bit(array, index):
inner = (index % 64)
index //= 64
array[index] |= (1 << inner)
def is_set(array, index):
inner = (index % 64)
index //= 64