Gnome Stock Ticker info: Gtik History, FAQ and etc.

Gnome Stock Ticker (gtik) Screenshots

[Originally published  2006 12 18 at my old blog: jayson.monjayaki.org still viewable via internetarchive.org’s wayback machine  http://web.archive.org/web/20081013171643/http://jayson.monjayaki.org/2006/12/18/gnome-stock-ticker-info-gtik-history-faq-and-etc/ . Reading Miguel de Icaza’s post about the History of GNOME (http://primates.ximian.com/~miguel/gnome-history.html) made me think to post this back here]

So way back when Gnome was pretty new and there were not a lot of applets, around the middle of 1999, I got a book at Linux World on Developing GTK applications. I then took the Slashdot applet source and the idea behind this Perl application that was available at the time called “quote” and created the first version of the Gnome Stock ticker. I then post it to the Gnome site. They had this contributions area where you could post links to Gnome related projects. Well, it soon got a LOT of downloads, I was pretty surprised, but then again it was the middle of the Dot Com boom and Stocks were on everyone minds (including mine and that is why I made the thing in the first place, to watch my own stocks.)

Soon afterwards I was starting to get emails with suggestions for features. Some good, some crazy and then I got two with actual CODE ATTACHED! These turned out to be from Linux/GTK hackers Jim Garrison and Rached Blili. They were interested in continuing to work on it and so I added them to the authors and we were three. Rached hosted the site where we would distribute it from (still alive: http://www.dread.net/gtik/ ) and the three of us all added things for a while.

Then Jim, who had some contact with other Gnome developers, got us accepted into the Gnome source tree and repository. That is when trouble started for me. It start to get harder and harder to build and to add features or fix bugs. Also at this time, the Dot Com boom was starting to become the Dot Com Bomb and I was changing Dot Com jobs quite a bit and pretty busy, so I ended up getting away from the Gtik development. Jim and Rached pretty much did it all for a while. Then we lost contact with Jim, and after that Rached got real busy too and we all pretty much stopped doing much with the Ticker.

Well some time pass and emails stopped coming in. I went to Linux World one day around that time and it was pretty cool to see out ticker running on most of the desktops in the vendor booths, on all kinds of platforms. Even Sun’s booth had us running. You would see it in the presentations, on the big screens, and even touted as a feature by the presenter: “watch your stocks with GNOME”. I was not getting any email from Gtik users at that time so I thought all was well and people were happy with it as it was. But seeing it at Linux World made me want to work on it again and I set out to do something with it that I had always wanted to do:  make it able to use ANY site, and to allow the user to create templates for parsing their favorite site (the app to that point only used Yahoo Finance for it’s data source). The idea was that the user would create a template for parsing the data from their favorite finance site and they would load this template with the URL to their site and maintain that themselves. I put several nights into that development on the last source tree I had on my machine at the time (though it was terribly out of date I would soon find.) So I finished that work and was pretty proud of myself. It was pretty slick and I could use gtik with ANY site I wanted. I had templates for Yahoo and Quote.com and ETrade at that time. THEN, THE END FOR ME.

I went to add this latest change to the source tree, and logged into my account at Gnome CVS. Well I thought I should get the latest source and edit that with my changes and then re-upload. Well …. something was strange. The source tree looked quite different than when I had last seen it. So I took a look in the change log. Boy, people were busy. I found that a LOT of other developers had started maintaing the code and had port the whole thing to Gnome 2.0 which I found was quite different than what we were working with before. I could not even figure out how to set up the development environment at first then I found NONE OF MY MACHINES could even run the new Gnome nicely, it was a very heavy application, and I had all these 486s and early Pentiums at the time. So I just gave up. I had no time as it was and could not spend time to learn about Gnome 2.x and get new hardware to do it.

Well, so there it is; my silly history of the Gnome Stock Ticker out there for all to see. For me, I am probably done with it (UPDATE: Gnome later changed their applet framework and the ticker was killed and the rest of this post was written before so it might seem out of place ), though my name is still associated with it. It had it ups, but more downs.

One cool thing I’ll never forget was that the person that emailed me my login and password for CVS was Miguel de Icaza himself. That was pretty cool. I later got to be able to build the thing and I did do a few little little changes for people that were using the old version for some reason and needed something added, but I am not contributing to the CVS source and not sure if I ever will. If I had it all to do over, I would not have asked to have it put into Gnome’s source tree and would have kept it pretty simple, but such is life.

So… if your looking to suggest features, here is a list of the people that are working on it lately. This is just the email entries from the Change Log at http://cvs.gnome.org/viewcvs/gnome-applets/gtik/ . I suggest you download the change log before email any of these people, as some are doing translation work and others are coding GUI and others still are coding other things like Gnome API updates and such.

Other people who worked on Gtik, since 2001: (from the change log at http://cvs.gnome.org/viewcvs/gnome-applets/gtik/ )

Maintainers list:
2006-01-28  Francisco Javier F. Serrador
2006-01-21  Vincent Untz
2006-01-06  Vincent Untz
2005-12-03  Vincent Untz
2005-09-29  Ryan Lortie
2005-09-28  Ryan Lortie
2005-09-08  Ryan Lortie
2005-09-07  Ryan Lortie
2005-08-19  Ryan Lortie
2005-07-21  Ryan Lortie
2005-07-20  Davyd Madeley
2005-07-01  Davyd Madeley
2005-03-14  Kjartan Maraas
2005-02-24  Kjartan Maraas
2005-01-10  Davyd Madeley
2005-01-06  Davyd Madeley
2004-09-29  Davyd Madeley
2004-09-13  Shaun McCance
2004-08-24  Davyd Madeley
2004-08-15  Kjartan Maraas
2004-06-17  Dennis Smit
2004-06-16  Dennis Smit
2004-06-16  Dennis Smit
2004-06-09  Dennis Smit
2004-06-03  Dennis Smit
2004-03-20  Arvind Samptur
2004-03-17  Glynn Foster
2004-03-16  Glynn Foster
2004-03-15  Glynn Foster
2004-03-11  Dennis Smit
2004-02-23  Dennis Smit
2004-02-19  Jody Goldberg
2004-02-18  Kevin Vandersloot
2004-02-11 Breda McColgan
2004-01-30  Chee Bin HOH
2004-01-19 Vijaykumar Patwari
2004-01-18  Jason Leach
2004-01-09  Kevin Vandersloot
2003-12-12  Padraig O’Briain
2003-09-18  Kevin Vandersloot
2003-07-23  Kevin Vandersloot
2003-07-21  Dennis Cranston
2003-06-19  Kevin Vandersloot
2003-06-16  Kevin Vandersloot
2003-06-15  Kevin Vandersloot
2003-06-12  Kevin Vandersloot
2003-06-12  Kevin Vandersloot
2003-06-01  Kevin Vandersloot
2003-05-30  Kevin Vandersloot
2003-05-07  Dennis Cranston
2003-04-25  Dennis Cranston
2003-04-21  Kevin Vandersloot
2003-04-20  Kevin Vandersloot
2003-03-07  Mark McLoughlin
2003-03-03  Kevin Vandersloot
2003-01-23  Irene Ryan
2003-01-21  Arvind Samptur
2002-12-14  Fernando Herrera
2002-12-02  Christian Neumair
2002-11-27  Kevin Vandersloot
2002-11-27  Kevin Vandersloot
2002-11-27  Kevin Vandersloot
2002-09-15  Juan Salaverria
2002-10-29  Rajkumar Sivasamy
2002-09-19  Mark McLoughlin
2002-08-31  Glynn Foster
2002-08-24  Kevin Vandersloot
2002-08-22  Kevin Vandersloot
2002-08-22  Kevin Vandersloot
2002-08-22  Kevin Vandersloot
2002-08-21  Kevin Vandersloot
2002-08-14  Mark McLoughlin
2002-07-18  Mark McLoughlin
2002-07-11  Mark McLoughlin
2002-07-10  Mark McLoughlin
2002-07-01  Kevin Vandersloot
2002-06-03  Arvind Samptur
2002-05-31 Kevin Vandersloot
2002-05-31  Kjartan Maraas
2002-05-29  Kevin Vandersloot
2002-05-23  Kevin Vandersloot
2002-05-20  Kevin Vandersloot
2002-05-18  Kevin Vandersloot
2002-05-17  jacob berkman
2002-05-13  Satyajit Kanungo
2002-05-10  Deepa Natarajan
2002-05-09  Kevin Vandersloot
2002-05-09  Kevin Vandersloot
2002-05-06  Jagadeesh B.G.
2002-05-03  Kevin Vandersloot
2002-04-27  Dennis Cranston

Batch resize images with imagemagick (convert)

I am often asked how to resize a directory full of images, for free. This is definitely possible and probable there are many ways to do it, but I like to use ImageMagick for this. ImageMagick is available for almost any OS here:

http://www.imagemagick.org/script/index.php

Here is an example of converting a directory of JPEGs using a little scripting and imagemagick:

for i in $( ls *.jpg); do convert $i -resize 1024x768 sm_$i; done;

DOM Document – get or extract contained document (or Node) as XML Source

Something I have to do every once in a while, and can never remember how (especially when under some tight deadline, with people standing over my shoulder asking “is it done yet, is it done?” “how much longer?” etc.) is to extract a fragment of one DOM document to get the XML source of the nested or contained document. So I am going to add a note here, for everyone’s easy reference.

First step is to get a Node to be the Root Node of the new Document. Using methods like Document’s getElementsByTagName(String) and Node.getChildNodes(), or using XPathAPIs and CachedXPathAPI class’ selectSingleNode(Node n, String xPath).

Next we can use a StringWriter and a Transformer to covert the Node to XML Source. Better than a rambling explanation, a simple source example should be do the trick. You can use a method something like the nodeToXMLString example below.

  private String nodeToXMLString(Node node) throws TransformerException
  {
    StringWriter sw = new StringWriter();

    Transformer serializer = TransformerFactory.newInstance().newTransformer();
    serializer.transform(new DOMSource(node), new StreamResult(sw));

    return (sw.toString());
  }

Do a retroactive branch in CVS

You have a source tree that is not branched, and you suddenly need to get a previous version (maybe it is in production at that point, but the trunk has moved on since and is waaaaaaaaaaaay out of sync). What to to? Well if you could branch from back then, back in time to that revision …. well you get the idea, and I am calling this a retroactive branch, because instead of the branch being a the current revision or HEAD, it is from some date/revision/point in the past.

This is something that I sometimes find I must do with CVS but seems to be a bit of an obscure function, as there are not a lot of posts about it online. Therefore I am going to post about it here.

Here are the steps, I use, to do a retroactive branch in CVS.

1) Checkout using the tag for the previous revision that you want to start
a branch from.

for example:

    cvs co -r MY_TAG_V01-1 com/example/myapp/build.xml

2) Find out the date according to CVS for the tagged revision
I use “cvs log” to see the date of the tagged revision I wanted

for example:

  cd com/example/myapp/
  cvs log build.xml

In the result I see that my revision for this tag was 1.4 and the date was:
1970/01/01 01:00:00 (this is UTC I assume)

If your doing a bunch of files, then find the most recent date and use that. You can find a date that is older than the most recent date in the files you want to retro branch, and not as recent as any next revisions and use that.
3) Add a branch tag based on the date
an example, for one file:

    cvs tag -D "1970-01-01 01:00:00+00" -b branch_tag build.xml

or for many files:

    cvs tag -D "1970-01-01 01:00:00+00" -b branch_tag build.xml

That is it. Whala. In your favorite cvs app you should see your a new revision history for your source tree. I use ViewCVS and after doing these steps on a file in the source tree, then navigating to that tree and using the "Show files using tag" select control, I can see my "branch_tag" tag and chosing that tag to view by, I see a whole new revision history for my test file.

cvs update -r branch_tag updates only the new revision with the sub-revision

editing the source just given a new branch and commiting again creates new sub-revisions,

for example:

cvs commit
cvs commit: Examining .
Checking in build.xml;
/var/lib/cvsroot/com/example/myapp/build.xml,v  <--  build.xml
new revision: 1.4.4.1; previous revision: 1.4
done

Apache XMLBeans – output XML without a namespace

This is again something that I need to know how to do but never remember how when time it tight.

Apache XMLBeans http://xmlbeans.apache.org/ is a great tool for working with XML in Java, but it requires the XML Schema being used to create the objects from XML to have a Namespace. The namespace ends up being part of the package structure for the Objects created and I guess having a unique path for these is a good idea. However, this requirement can be a bit of a pain, when working with some simple XML structures that do not have a namespace. Especially when your ready to persist the XML Bean objects to XML source. If a namespace is added to your XML Schema that the XML Bean objects are created from, XML source generated from them will by default also have the namespace. I can never remember how to output the XML source without a namespace and so I am writing it down here where I can get at it with a click, and maybe this will help someone else as well.

There are two key steps to remove the Namespace when outputting XML Source.

  1. Tell it to use the default namespace:
           xmlops.setUseDefaultNamespace();
       
  2. Tell it that you have already declared the default namespace:
           dnsMap.put("", "http://example.com/schemas/DefaultNnameSpace");
           xmlops.setSaveImplicitNamespaces(dnsMap);
      

After this, you can output as normal:

      xmlops.setSavePrettyPrint();
      xmlops.setSaveNamespacesFirst();
      retString = myXMLDoc.xmlText(xmlops);
      return retString;

Note: the research and testing to solve this was done using XMLBeans v2.4.0