Wednesday, April 13, 2011

RGB support for google.maps.Polyline strokeColor gone?

Suddenly our sites stopped showing some of the polylines drawn on google maps components. I spent half a day debugging and then noticed that the ones that were missing used rgb value for setting the stroke color for the polyline, like so:


  var color = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")";
  return new google.maps.Polyline({

      path: path,
      geodesic: true,
      strokeColor: color,
      strokeOpacity: 1.0,
      strokeWeight: 2
  });

However, as of now (4/13/2011) this doesn't work anymore. I couldn't find anything official about this from google's docs. If somebody has any details on this, comments are welcome.

For the curious: the reason for this was that the polyline had a fading color, so that the end of the polyline was darker than the beginning.

Using oracle instant_client from Python on Ubuntu

I do a lot of Python development in different environments. Ubuntu is one of them. Oracle is not the easiest beast to deal with but the instant_client and cx_Oracle make it tolerable. The way I usually set this up is to do following:


  1. download instant_client basic lite and instant client sdk from oracle
  2. unzip both into same dir (e.g. /home/jedi/instant_client)
  3. export ORACLE_HOME=/home/jedi/instant_client
  4. export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
  5. cd $ORACLE_HOME
  6. ln -s libclntsh.so.11.1 libclntsh.so  (replace with your version number)
  7. sudo apt-get install python-dev python-setuptools libaio-dev
  8. sudo -E easy_install cx_Oracle
This should do it. You can test it with:

$> python

>>> import cx_Oracle
>>> conn = cx_Oracle.connect("username/password@//example.host.com/orasid")
>>> crsr = conn.cursor()
>>> crsr.execute("select * from mytable")
>>> for row in crsr: print repr(row)  # hit enter twice
...

>>> crsr.close()
>>> conn.close()
>>> quit()

Credits where credit's due:  Catherine's howto for XE

Initial import

This is my scrapbook of random coding notes, howtos and installation instructions. I used to store that kind of stuff on my home server but it crashed and even though I do have backups I just felt that it was too much work.