Skip to content

Instantly share code, notes, and snippets.

View jeremy-rutman's full-sized avatar

jeremy rutman jeremy-rutman

View GitHub Profile
@jeremy-rutman
jeremy-rutman / cut_bytes_from_file
Created September 25, 2019 14:20
cut bytes from file
tail -c +17 foo.bin > tail-out.bin
# coding: utf-8
"""
code to determine language (actually codeblock(s)) of string
https://www.unicode.org/charts/ official languages and blocks
https://en.wikipedia.org/wiki/Unicode_block ranges tabulated more easily for purposes of the ranges below
http://jrgraphix.net/research/unicode_blocks.php see the characters
"""
from collections import defaultdict
virtualenv -p /usr/bin/python2 env_name
@jeremy-rutman
jeremy-rutman / find_python_modules
Created September 11, 2019 14:08
find python module versions
pip freeze | grep modulename
from collections import defaultdict
def lang_from_codeblock(string):
"""
INPUT:
string: string to count
OUTPUT:
dict of counts in each block (see http://jrgraphix.net/research/unicode_blocks.php)
"""
lang_counts = defaultdict(int)
ranges = {'Basic Latin':(u'\u0020' , u'\u007F'), \
name: "VGG_ILSVRC_16_layers"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 224
input_dim: 224
layers {
bottom: "data"
top: "conv1_1"
name: "conv1_1"
name: "VGG_ILSVRC_16_layers_fc_reduced"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 500
input_dim: 500
layers {
bottom: "data"
top: "conv1_1"
name: "conv1_1"
@jeremy-rutman
jeremy-rutman / optics.py
Created September 19, 2017 16:46 — forked from ryangomba/optics.py
OPTICS clustering in Python
# Copyright (c) 2012, Ryan Gomba
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@jeremy-rutman
jeremy-rutman / test_frame_capture.c
Last active May 15, 2019 18:52 — forked from TobiSchr/test_frame_capture.c
Simple example to capture a frame with an uEye Camera under Linux; compile with: gcc -Wall test_frame_capture.c -lueye_api -o frametest
#include<string.h>
#include<stdio.h>
#include<stddef.h>
#include<ueye.h>
/********
This allows for changing cam and exposure.
Also an attempt is made to use monochrome cam at 10bits - actual image is 24bpp.
If you take the first (red) channel from this it appears ok, havent attempted to locate final 2 bits.
*********/
@jeremy-rutman
jeremy-rutman / test_frame_capture.c
Created August 1, 2017 20:02 — forked from ChristianUlbrich/test_frame_capture.c
Simple example to capture a frame with an uEye Camera under Linux; compile with: gcc -Wall test_frame_capture.c -lueye_api -o frametest
#include<stdio.h>
#include<stddef.h>
#include<ueye.h>
HIDS hCam = 1;
void main() {
printf("Success-Code: %d\n",IS_SUCCESS);
//Kamera öffnen