March 30, 2008
· Filed under Apple, Personal, Technology

Leopard comes with Python 2.5.1. And it’s nice to be able to use easy_install to add python packages, but it can happen that some of those libraries depend in their C/C++ counterparts, and they are a bit outdated in Leopard.
My case was with pycurl. Leopard python doesn’t come with pycurl. However it includes cURL and libcurl version 7.16.3.
$ curl –version
curl 7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: GSS-Negotiate IPv6 Largefile NTLM SSL libz
If I try to install pycurl from easy_install, I get this message regarding the version of the C version of the library
$ sudo easy_install-2.5 pycurl
…
Using curl-config (libcurl 7.16.3)
src/pycurl.c:55:4: error: #error “Need libcurl version 7.16.4 or greater to compile pycurl.”
I have also macports, so I tried to install the version requiered through macports. It´s not an upgrade, because you continue having the original Leopard version plus the new one in the /opt directory.
$ port search curl
…
curl net/curl 7.18.0 Tool for transferring files with URL syntax
$ sudo port install curl
—> Fetching curl
—> Verifying checksum(s) for curl
—> Extracting curl
—> Configuring curl
—> Building curl with target all
—> Staging curl into destroot
—> Installing curl 7.18.0_0
—> Activating curl 7.18.0_0
—> Cleaning curl
Seems that everything is ok. But before you run to run easy_install again, you have to realize that easy_install doesn’t know anything about your new curl installation of curl in /opt. easy_install will use curl-config to determine the location of the curl library. So, if you update your PATH (if you don’t ave it already) adding the /opt entry in the beginning, everything will be solved.
$ curl-config –version
libcurl 7.16.3
$ export PATH=/opt/local/bin/:$PATH
$ curl-config –version
libcurl 7.18.0
Now the installation will proceed:
$ sudo easy_install pycurl
Searching for pycurl
Reading http://pypi.python.org/simple/pycurl/
Reading http://pycurl.sourceforge.net/
Reading http://pycurl.sourceforge.net/download/
Best match: pycurl 7.16.4
Downloading http://pycurl.sourceforge.net/download/pycurl-7.16.4.tar.gz
Processing pycurl-7.16.4.tar.gz
Running pycurl-7.16.4/setup.py -q bdist_egg –dist-dir /tmp/easy_install-f4LJrU/pycurl-7.16.4/egg-dist-tmp-9l6i1M
Using curl-config (libcurl 7.18.0)
ld: warning in /opt/local/lib/libcurl.dylib, file is not of required architecture
ld: warning in /opt/local/lib/libz.dylib, file is not of required architecture
zip_safe flag not set; analyzing archive contents…
Adding pycurl 7.16.4 to easy-install.pth file
.
Installed /Library/Python/2.5/site-packages/pycurl-7.16.4-py2.5-macosx-10.5-i386.egg
Processing dependencies for pycurl
Finished processing dependencies for pycurl
And we’re ready to rock’n'roll:
>>> import pycurl
>>> pycurl.version
‘libcurl/7.18.0 zlib/1.2.3′
>>> c = pycurl.Curl()
>>> c.setopt(pycurl.URL, “http://www.google.com”)
>>> c.setopt(pycurl.FOLLOWLOCATION, 1)
>>> c.perform()
… (dumped html) …
>>> c.getinfo(pycurl.HTTP_CODE)
200

Tags:curl, leopard, macos, pycurl, python »
March 29, 2008
· Filed under Greece, Opinion, Work

It’s the first hour of the Saturday and I’m still awake listening to the rain beating on the floor of my alley.
It’s late but I’m still finishing some “job” tasks. This happens when you go commando in programming (but with underwear), and if everything goes well you´ll only make another 4 extra hours, but if something fails you´ll be doomed. A 7 instead of a four made me to stay until now connected (The good and the bad of the Virtual Private Networks).
As always I leave my Blog a bit abandoned. Some times it’s because the lack of free time, but other times it’s because I’m lazy. Not in the mood these days to do much.
I’m still in Athens and still working for that marvellous company who helps me to pay the bills every month. The good of working in a big IT company is that:
- You learn how to move between multiple manager levels.
- You can play the hot potato game with the problems. There is always someone to forward the email.
- You improve your skills in how to solve problems quickly.
- Your definition of dirty coding changes.
- Yeah, it’s my first job here, so it’s experience for my résumé.
- I have in the office 2×20″ screens, making a total resolution of 3200×1200 pixel.
- You save the company with your skills.
The bad:
- You learn how it feels to arrive home at 2:30am after all the day working.
- You receive hot potatoes and you run out of addresses to forward them to.
- You improve your skills to solve problems quickly and in a dirty way.
- You forget about good coding.
- You realize that your résumé needs the experience, not you.
- It tooks 3 months to get a computer.
- After you saved the company. You don’t see a part of the profit.
About friends and life. From time to time I meet the “International Pizza” to go for ouzo and food. The “International Pizza” is a mix of greeks and foreigners who meet to have good time
As objectives to accomplish:
- To learn Greek. C’mon! One year here and I cannot speak it. It’s not so difficult.
- To go to the gym. And also add an excuse to escape from the office.
- To continue some personal projects/ideas. Not only talk about them when going for beers.
And from here send greetings to:
- Sascha, Panos and the International Pizza.
- Kat, her mac, and her 1001 stories. Life is long but I guess she lived twice or three times more experiences than anyone.
- Nazgul2, from Palencia but working and living in another two different places.
- Graci, and his amazing adventures in Belgium.
- Alberto, and his never ending PhD problems.
- Seattle and Andoni, or the two guys who got the job they were waiting for.
- And you, who are reading this.
Note: Believe me if I tell you that I pressed the publish button like 5 times, and 5 times the post appeared in the front page. Then I leave, check the next day and It’s not there. Grrrrr.
Tags:Athens, Greece, IT, life, Mac, VPN, Work »
March 3, 2008
· Filed under Technology

As I wrote the last time I talked about this. I had some problems with the connection between my mac and my LCD TV. The problem was with the HDMI cable. I wasn’t able to get a good picture in the screen because resolution problems.
Well, the time passed and I didn’t give up (Perhaps the money given for the DVI -> HDMI cable did help). I tried the same setup in Windows XP. And here comes the surprise, this time the HDMI connection was crystal clear, but the VGA was quite awful. I noticed that ATI drivers in Windows have a special setting for HDTV connections, and the TV was detected as a HDTV when using the HDMI cable.
So today I was using the TV through the VGA connector, and I decided to give another try to Leopard + HDMI. It worked without touching anything. The overscan was active but this time it wasn’t overscaling so much. I got the perfect resolution and I don’t know why.
I applied some updates in Leopard, perhaps that’s the difference. Also I realized that even if the resolution is advertised as 1366×768 in the samsung webpage. The manual says 1360×768, and that’s what I have working right now. And after some color calibration DVI -> HDMI was working perfect.
In fact I rebooted and I plugged only the HDMI cable. I got a strange blinking effect in the top. Change to a different resolution and again back solved the problem.
The updated facts are:
- Windows XP works with HDMI but not with VGA
- MacOS works with VGA and HDMI.
Any difference beween VGA and DVI? Well, VGA was really sharp with good colors. But DVI is just better. I was difficult in the beginning, but I was staring at the TV and thinking: “my eyes feel something different”. They were right: more sharp image.
I feel a bit dumb because twice I tried and twice I failed, but the third was the good one 