Skip to content

Instantly share code, notes, and snippets.

View jgehring's full-sized avatar

Jonas Gehring jgehring

View GitHub Profile
------------------------------------------------------------------------
r4 | test | 2009-11-16 23:09:43 +0100 (Mon, 16 Nov 2009) | 1 line
Changed paths:
D /dir1
A /dir2 (from /dir1:2)
D /dir2/file1
D /dir2/file2
A /dir2/file3
A /dir2/file4
R /dir2/subdir (from /dir1/subdir:3)
@jgehring
jgehring / fixed-check-for-libjs.patch
Created March 6, 2012 11:00
Fixed check for libjs [for mediatomb-svn in Arch Linux]
From d27abc679432e35b16c6635e2c1d308e9cebfb81 Mon Sep 17 00:00:00 2001
From: Jonas Gehring <jonas.gehring@boolsoft.org>
Date: Tue, 6 Mar 2012 11:57:00 +0100
Subject: [PATCH] Fixed check for libjs
Arch Linux provides a js and a spidermonkey package. The correct
library for mediatomb is lib libmozjs185 (from js) and not libjs (from
spidermonkey). If both packages are installed, mediatomb would pick the
wrong one.
@jgehring
jgehring / return-value-check-patch
Created April 2, 2012 11:56
Fixed return value check in snappy_uncompress_iov()
diff --git a/snappy.c b/snappy.c
index 3f0e159..aba8990 100644
--- a/snappy.c
+++ b/snappy.c
@@ -1383,7 +1383,7 @@ bool snappy_uncompress_iov(struct iovec *iov_in, int iov_in_len,
.base = uncompressed,
.op = uncompressed
};
- return internal_uncompress(&reader, &output, 0xffffffff);
+ return (internal_uncompress(&reader, &output, 0xffffffff) == 0);
@jgehring
jgehring / reorder-libraries.patch
Created April 10, 2012 21:13
Re-order libraries
diff --git a/src/Makefile.am b/src/Makefile.am
index c88ca59..75f2986 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,8 @@ rsvndump_SOURCES = \
localedir = $(datadir)/locale
-AM_LDFLAGS = $(APR_LIBS) $(APU_LIBS) $(SVN_LDFLAGS) $(COMPAT_LIBS) $(LIBINTL)
+AM_LDFLAGS = $(SVN_LDFLAGS)
@jgehring
jgehring / itoa.cpp
Created June 15, 2012 17:43
itoa speed test
#include <cstdlib>
#include <sstream>
int main(int argc, char **argv)
{
std::string s;
clock_t start, end;
char buf[10];
for (int j = 0; j < 2; j++) {
@jgehring
jgehring / sub_common_prefix.py
Created July 19, 2012 23:25
Regression test for #3544240
#
# Test database for rsvndump
# written by Jonas Gehring
#
import os, shutil
import test_api
@jgehring
jgehring / logistic_sgd_leak.patch
Created January 9, 2013 17:00
Reproducable memory leak with "Classifying MNIST digits using Logistic Regression"
--- logistic_sgd.py 2012-09-21 22:59:49.000000000 +0200
+++ logistic_sgd_leak.py 2013-01-09 17:56:02.000000000 +0100
@@ -287,7 +287,7 @@
# the same time updates the parameter of the model based on the rules
# defined in `updates`
train_model = theano.function(inputs=[index],
- outputs=cost,
+ outputs=classifier.errors(y),
updates=updates,
givens={
#include <memory>
#include <ponder/class.hpp>
#include <ponder/classbuilder.hpp>
class Test1 {
public:
Test1() {
value = 5;
}
from tempfile import NamedTemporaryFile
import imageio
import pybullet as p
import pybullet_data
# Test MCJF file
df = NamedTemporaryFile()
df.write('''
<mujoco>
<worldbody>