Skip to content

Instantly share code, notes, and snippets.

Sebastian Wick swick

Block or report user

Report or block swick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View icc-gamma.c
#include <stdio.h>
#include <lcms2.h>
#include <assert.h>
static void
degamma_from_gamma_lut(float target, int size, float *gamma, float *degamma)
{
int left = 0;
int right = size-1;
@swick
swick / injectso.sh
Created Apr 26, 2013
inject a shared object into a running process with gdb
View injectso.sh
#!/bin/bash
if [ $# -lt 2 ]; then
echo "bad args"
exit 1
fi
PID=$1
LIB=$2
MODE=1 # who knows? I hope it's RTLD_LAZY
View gist:2031473
[100%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/engine.cpp.o
Linking CXX executable ../../openmw
/usr/bin/ld: CMakeFiles/openmw.dir/__/__/libs/mangle/vfs/servers/ogre_vfs.cpp.o: undefined reference to symbol 'typeinfo for Poco::SystemException'
/usr/bin/ld: note: 'typeinfo for Poco::SystemException' is defined in DSO /usr/lib/libPocoFoundation.so.9 so try adding it to the linker command line
/usr/lib/libPocoFoundation.so.9: could not read symbols: Invalid operation
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [openmw] Fehler 1
make[1]: *** [apps/openmw/CMakeFiles/openmw.dir/all] Fehler 2
make: *** [all] Fehler 2
View gist:1782986
SELECT
(CASE post.comment_to WHEN 0 THEN "post" ELSE "comment" END) AS tl_type,
post.id AS id,
user.id AS user_id,
user.name AS user_name,
owner.id AS owner_id,
owner.name AS owner_name,
groups.id AS group_id,
groups.name AS group_name,
NULL AS type_name,
View gist:1331594
~$ GST_DEBUG=2 gst-launch-0.10 ximagesrc ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location="test.ogg"
0:00:00.030923560 5359 0x6b8080 WARN theoraenc gsttheoraenc.c:310:gst_theora_enc_class_init: Failed to determine settings for the speed-level property.
Leitung wird auf PAUSIERT gesetzt ...
Leitung ist aktiv und erfordert keinen VORLAUF …
Leitung wird auf ABSPIELEN gesetzt ...
New clock: GstSystemClock
0:00:00.659471400 5359 0xb49470 WARN bin gstbin.c:2380:gst_bin_do_latency_func:<pipeline0> did not really configure latency of 0:00:00.000000000
@swick
swick / gist:1208436
Created Sep 10, 2011
valgrind node_string.cc
View gist:1208436
==24233== 24 bytes in 1 blocks are definitely lost in loss record 473 of 1,064
==24233== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261)
==24233== by 0x52839D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (node_string.cc:35)
==24233== by 0x50E9E7: node::Load(int, char**) (node.cc:2075)
==24233== by 0x50F5B6: node::Start(int, char**) (node.cc:2396)
==24233== by 0x63FDEFE: (below main) (libc-start.c:226)
==24233==
==24233== 24 bytes in 1 blocks are definitely lost in loss record 474 of 1,064
==24233== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261)
==24233== by 0x52839D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (node_string.cc:35)
@swick
swick / gist:1208412
Created Sep 10, 2011
g_registered_type_info_get_g_type bt
View gist:1208412
#0 0x00007ffff64cbd05 in raise (sig=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff64cfab6 in abort () at abort.c:92
#2 0x00007ffff6504d7b in __libc_message (do_abort=2,
fmt=0x7ffff65ed400 "*** glibc detected *** %s: %s: 0x%s ***\n")
at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#3 0x00007ffff6511d7a in malloc_printerr (av=0x7ffff68271c0,
bytes=<value optimized out>) at malloc.c:6283
#4 _int_malloc (av=0x7ffff68271c0, bytes=<value optimized out>)
at malloc.c:4396
@swick
swick / gist:1181106
Created Aug 30, 2011
node-gir things
View gist:1181106
gir hierarchy
GIBaseInfo
* GICallableInfo
* GIFunctionInfo
* GISignalInfo
* GIVFuncInfo
* GIRegisteredTypeInfo
* GIEnumInfo
* GIInterfaceInfo
* GIObjectInfo
View gist:1120370
std::vector< std::pair<const std::string&, btVector3> > PhysicsSystem::doPhysics (float duration, MWWorld::World& world,
const std::vector<std::pair<std::string, Ogre::Vector3> >& actors)
{
...
std::vector< std::pair<const std::string&, btVector3> > response;
for(std::map<std::string,OEngine::Physic::PhysicActor*>::iterator it = mEngine->PhysicActorMap.begin(); it != mEngine->PhysicActorMap.end();it++)
{
/*OEngine::Physic::PhysicActor* act = it->second;
btVector3 newPos = act->getPosition();
@swick
swick / gist:1065117
Created Jul 5, 2011
node-gstreamer destructor
View gist:1065117
...
var bus = p.getBus();
bus.on("eos", function() {
// and now, there is a segfault
console.log("end of stream");
gst.end();
});
// now the destuctor is called but you would expect the event to fire
You can’t perform that action at this time.