This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Precondition: 1. "obj is not allowed to contain references pointing to itself" | |
// (function calls itself recursively, so this precondition | |
// must be matched by all contained objects) | |
// | |
function deepCopy(obj) | |
{ | |
if (typeof obj !== 'object' || obj === null) | |
return obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# BUILD library which contains all modules of the package | |
echo "Build package.o from module1.c and module2.c" | |
gcc -c -o module1.o module1.c | |
gcc -c -o module2.o module2.c | |
ld -o package.o -r module1.o module2.o | |
symbols=(`nm package.o`) | |
for((i=0;i<${#symbols[*]};i=i+1)) do | |
if [ "${symbols[$i]}" != "T" ]; then continue; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generic Makefile (c) 2013 Jörg Seebohn | |
# Version 1.0 | |
# Use it at your own risk ! | |
# This Makefile depends on GNU make. | |
# The clean command uses "@echo rm -rf $(TargetDir)" | |
# remove the echo if you know that $(TargetDir) is set to a valid value. | |
# The target test builds the project in Release mode and starts it. | |
# Adapt project specific part to your own project. | |
# Adapt compiler specific part to your own compiler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
____ _____ | |
/\__ \ /\ ___\ | |
\/__/\ \ \ \ \__/_ | |
\ \ \ \ \____ \ | |
_\_\ \ \/__/_\ \ | |
/\ _____\ /\ _____\ | |
\/______/ \/______/ | |
Copyright (C) 2011 Joerg Seebohn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sets the transparency of the toplevel window. | |
* An alpha value of 1 draws the window opaque a value of 0 makes | |
* it totally translucent. | |
* If alpha is set to a value outside of [0..1] EINVAL is returned. */ | |
static int settransparency_helper(Display * display, Window win, double alpha) | |
{ | |
int err ; | |
if ( alpha < 0 | |
|| alpha > 1) { |