Get list of static libraries used in an executable

Since ldd lists only the dynamic libraries, is there a way to extract the information about the static libraries used to create the executable? Answer ldd <exe filename> shows dynamically linked libraries nm <exe filename> shows the symbols in the file. To see which symbols come from static libraries requires running nm against those libraries … Read more

‘public static final’ or ‘private static final’ with getter?

In Java, it’s taught that variables should be kept private to enable better encapsulation, but what about static constants? This: public static final int FOO = 5; Would be equivalent in result to this: private static final int FOO = 5; … public static getFoo() { return FOO; } But which is better practice? Answer … Read more

Overriding a static method in python

Referring to the first answer about python’s bound and unbound methods here, I have a question: class Test: def method_one(self): print “Called method_one” @staticmethod def method_two(): print “Called method_two” @staticmethod def method_three(): Test.method_two() class T2(Test): @staticmethod def method_two(): print “T2” a_test = Test() a_test.method_one() a_test.method_two() a_test.method_three() b_test = T2() b_test.method_three() produces output: Called method_one Called … Read more

Python class static methods

I want to create a kind of utility class which contains only static methods which are callable by the name class prefix. Looks like I’m doing something wrong 🙂 Here is my small class: class FileUtility(): @staticmethod def GetFileSize(self, fullName): fileSize = os.path.getsize(fullName) return fileSize @staticmethod def GetFilePath(self, fullName): filePath = os.path.abspath(fullName) return filePath Now … Read more

Non-static method ….. should not be called statically

I have recently done an update to PHP 5.4, and I get an error about static and non-static code. This is the error: PHP Strict Standards: Non-static method VTimer::get() should not be called statically in /home/jaco/public_html/include/function_smarty.php on line 371 This is the line 371: $timer = VTimer::get($options[‘magic’]); I hope somebody can help. Answer That means … Read more