Saturday, September 19, 2009

C++: Interoperability of Libraries Compiled by Different Compilers

Is it possible to link to libraries compiled with different compilers? I get asked this question a lot. Usually I ramble about this or that; I won't do that here. Rather, here's a nice concise answer from Rob K on stackoverflow. Quote:
The above quote is specific to MinGW and Visual Studio, but in general the same rules apply between any two compilers. Speaking of MinGW, the Mixing Compiler page on MinGW's Wiki (and the older page here) also address this issue.

Here are more resources:



Sunday, September 13, 2009

PyDev: Workaround for the Undefined Class/Static Attribute Error

PyDev will incorrectly identify class (static) attributes as "undefined" if they are dynamically added to a class. Consider the following class:
class Quantity:
    def __init__(self, name, unit):
        self.name = name
        self.unit = unit

# Add some class/static attributes after class creation

Quantity.VOLTAGE = Quantity("Voltage", "volts")
Quantity.COUNTS = Quantity("Counts" , "counts")
Now, if we use a class attribute, such as VOLTAGE, PyDev will flag it with an "Undefined variable from import: VOLTAGE" error, even though it is valid.
print(Quantity.VOLTAGE) # <-- Flagged as an error
To work around this, add the annotation @DynamicAttrs to the class's docstring, as follows:
class Quantity:
    """ @DynamicAttrs """
    def __init__(self, name, unit):
        self.name = name
        self.unit = unit
Reference: Fabio on PyDev's user list.

Joel Spolsky's Talk on Being Number One (Business of Software)

Can be viewed here. Some main points I captured from the presentation:
  • Make people happy.
    • Put the user in control.
    • Positive feedback.
  • Obsess over aesthetics.
    • Skins are not the answer.
    • Modernist architecture is not the answer (decadence is still important in the software industry).
    • Not the same as being pretty; capture and convey some message or theme.
  • Observe the culture code.
    • If necessary, define one and develop it.
    • Care about it, embrace it.