Posts Tagged: programming


14
May 10

Python 2.5 distutils, snow leopard and xcode making gcc happy

As many Python folks have discovered, upgrading to Snow Leopard can cause some pain for development. For the most part, this involves reinstalling a bunch of things (macports, python itself and whatever python packages you use). This has been a hassle for me, but up until today it was just time consuming, rather than actually difficult. Apparently if you upgrade xcode (like I did for the new iphone stuff), unless you explicitly choose the old SDK, xcode blows it away.

So today, while trying to compile multiprocessor on Python 2.5, I got this:

Compiling with an SDK that doesn’t seem to exist: /Developer/SDKs/MacOSX10.4u.sdk
Please check your Xcode installation

Which left me staring at the screen thinking “how the f**k do I fix THAT?” After poking through every file in multiprocessor and then googling quite a bit I finally found this message on the epd-users mailing list, which got me to the promised land.

From what I can gather there are two ways to fix this. One is to reinstall xcode and choose to include the older SDK. The other (and possibly scarier, depending on your taste for mucking around inside installed stuff) is to point distutils at the newer SDK. I did the latter: in a text editor, open up:

/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile

Then find all the instances of MacOSX10.4u.sdk and change that to something you do have installed. To see them just do

$ ls -la /Developer/SDKs/

If there’s nothing there, well, then you need to install xcode or you’re SOL. There should be four places to make the change in the Makefile. Finally, the newer compiler doesn’t seem to like the “-Wno-long-double” flag, so I had to the delete that as well. And voila, multiprocessor compiled (and I hope any other Python package that I try to install that needed the gcc).


7
Jul 09

Okay, I’m fiddling with Scala next

I’m sold on trying out Scala, after seeing James Strachan state:

I’m very impressed with it! I can honestly say if someone had shown me the Programming Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I’d probably have never created Groovy.

Strachan created the very cool Groovy and is one of the few big Java guys (along with Jerome Louvel) who has some good perspective on the language and has been doing cool stuff.

I even have a couple of small projects I’m fiddling with where I can try it out. For client work I will still be using Python and straight up Java for the time being.


2
Jun 08

Fiddling with neo4j

So I’ve been fiddling quite a bit with neo4j for an idea I had. I can say I definitely like how fast and intuitive it is to use. I’m a bit worried about storage. I created 1000 nodes with 100 relationships each and my database folder ballooned to 250 megs. That isn’t huge, but it is quite a bit larger than I expected. I’m new to the framework, so I may have done something wrong in that test.


2
Jan 08

Qi4j

Qi4j is a new framework I’ve been looking at. As my friend Nick put it, “it’s mixins for Java!” which is, well, true; but here’s the description from the site:

Qi4j is a framework for domain centric application development, including evolved concepts from AOP, DI and DDD.

Qi4j is an implementation of Composite Oriented Programming, using the standard Java 5 platform, without the use of any pre-processors or new language elements. Everything you know from Java 5 still applies and you can leverage both your experience and toolkits to become more productive with Composite Oriented Programming today.

Next question is “what is composite oriented programming” right?

Many objects has life cycles that are more extensive than the simple model that Object Oriented Programming model wants us to believe. A few simple examples;

  • An egg becomes a chicken which in turn becomes food.
  • I am a programmer at work, a father+husband at home, a victim in a traffic accident and hunter and pray in the jungle.

But it is more to it than that. The composition of the object may change over time. My home now has a garage and my car have different kind of problems with their own state related to it.
In the programming world, we are constantly faced with change of requirements. These changes are often not related to any real world changes, but people coming to new insights of the problem domain. OOP makes those changes a big deal, and often we have to tear up large chunks of the model and redo the work.

But wait, there is more.

Some objects traverses different scope boundaries to the extreme. For instance, a Person will have its attributes changing slightly over time, new abilities be learnt and so forth, that is mentioned above. But the Person will eventually die, but that doesn’t mean that the Person object should be deleted from a system, since the “memory of” that Person may live on for a long time. In a OOP system, we would need to transfer some of the state from a LivingPerson class to a DeadPerson class. In Composite Oriented Programming, it is the same object with different behavior.

We think that one of the the main flaws in OOP is that it is not object oriented at all, but in fact class oriented. Class is the first class citizen that objects are derived from. Not objects being the first-class citizen to which one or many classes are assigned.

I can’t wait to play with this, but I have not yet had time… :(