Skip to content

Instantly share code, notes, and snippets.

View hotzenklotz's full-sized avatar

Tom Herold hotzenklotz

View GitHub Profile
@hotzenklotz
hotzenklotz / spritemaker
Created March 5, 2013 21:17
use imagemagick to merge all images in a folder to produce a spritesheet
#!/bin/bash
# use imagemagick to merge all images in a folder to produce a spritesheet
# use conver -append for vertical stacking and
# convert +append for horizontal
if [ $# -gt 0 ]
then
if [ $2 ]
Stopping b2g
adb shell stop b2g
adb shell rm -r /cache/*
rm failed for /cache/*, Permission denied
python build/install-gaia.py "adb" "/data/local" "profile"
push: profile/webapps/bluetooth.gaiamobile.org/manifest.webapp -> /data/local/webapps/bluetooth.gaiamobile.org/manifest.webapp
failed to copy 'profile/webapps/bluetooth.gaiamobile.org/manifest.webapp' to '/data/local/webapps/bluetooth.gaiamobile.org/manifest.webapp': Permission denied
Traceback (most recent call last):
File "build/install-gaia.py", line 188, in <module>
install_gaia()
# Copyright (c) 2013 Georgios Gousios
# MIT-licensed
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use stackoverflow;
create table badges (
Id INT NOT NULL PRIMARY KEY,
UserId INT,
@hotzenklotz
hotzenklotz / gist:6f93e974cd2e69a3385a
Created January 23, 2015 10:40
ConcurrencyKit RW-Cohort-Lock
#include <ck_pr.h>
#include <ck_spinlock.h>
#include <ck_cohort.h>
#include <ck_rwcohort.h>
/* Create cohort methods with signatures that match the required signature */
static void ck_spinlock_lock_with_context(ck_spinlock_t *lock, void *context){
(void)context;
ck_spinlock_lock(lock);
return;
reader:
CohortLock.acquire()
ReadIndr.arrive()
CohortLock.release()
<read-critical-section>
ReadIndr.depart()
@hotzenklotz
hotzenklotz / # opencv3 - 2016-04-05_21-45-55.txt
Created April 5, 2016 19:46
opencv3 (homebrew/science/opencv3) on Mac OS X 10.11.3 - Homebrew build logs
Homebrew build logs for homebrew/science/opencv3 on Mac OS X 10.11.3
Build date: 2016-04-05 21:45:55
@hotzenklotz
hotzenklotz / image_duplicate_detection.py
Created May 1, 2016 11:45
Find and show all duplicate images from a directory. Duplicate detection works by measuring the Chi Squared Distance of two image histograms.
#!/usr/bin/env python
import os
import argparse
from multiprocessing import Pool
# install through pip
import numpy as np
import matplotlib.image as mpimg
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
@hotzenklotz
hotzenklotz / webKnossos_datasets.py
Last active February 3, 2022 17:18
webKnossos Python library example: working with webKnossos datasets. https://docs.webknossos.org/webknossos-py/examples/dataset_usage.html
import numpy as np
import webknossos as wk
def main() -> None:
#####################
# Opening a dataset #
#####################
from time import gmtime, strftime
import numpy as np
from skimage import data
import webknossos as wk
from webknossos.dataset import COLOR_CATEGORY
def main() -> None:
import os
from functools import partial
from time import gmtime, strftime
import numpy as np
from skimage import feature
from skimage.future import TrainableSegmenter
import webknossos as wk