How Does Google Desktop Decide What’s A Text File?

So I finally broke down and installed Google Desktop even though it won’t index my web pages or email since I use Firefox and Thunderbird. I installed it because of the potential to index all of my source code because I am always thinking to myself “I just know I’ve got some source around here to do that…”

So I installed it yesterday, but what I want to know is how does the indexer decide what is a text file and what isn’t? It obviously isn’t just looking for files ending in .txt, but it does seem to have a list of extensions that it checks. I have installed the tool on two different machines, and after over 24 hours, I still have no indexing of any Ruby, Lisp or C# files. I can see plenty of results inside Java, C, Perl and Python files, which is why I think they have a list of “approved” text file extensions. I could be wrong and it just hasn’t gotten to any of my Ruby or Lisp files yet, but I’ve got tons of Ruby files on my system, so it seems like a slim chance that it wouldn’t have run across any of them. I’ll keep an eye on it, but I’m doubtful at this point.

I really hope this is just a time issue. I think this tool will be really useful (despite the email and browser issues) but it needs to find the files I care about.

I Am Bushed…

Today is Day Three of RubyConf2004 and I’m tired. This has been a good conference. Lots of stuff to think about and play with. Lots of code flying around and lots of laptops all in one room. I was up until 02:00 this morning working on an ADO adapter for Active Record in order to talk to SQL Server. I’ve got about 40 failing tests right now (out of 143) so I’m closing in on finishing… It’s been interesting. I only just began looking at Active Record yesterday morning, so I think I’m doing pretty well. Active Record is an OR framework in Ruby that is really simple to work with. Very cool. It’s part of the Rails suite, which is an MVC framework for building websites in Ruby. Very intriguing.

Firefox/Thunderbird Extension: ULDebunk

Update: I’ve updated ULDebunk to work with the 1.0 final version of Firefox and the 0.9 version of Thunderbird.

Update: I’ve updated ULDebunk to work with Firefox 0.10 PR and Thunderbird 0.8. You can now

download it here.

Unfortunately, I still don’t have the updater working, so you’ll have to uninstall/reinstall.

This will probably be of use to no-one in the world but me, but…

I’ve just released a new extension (my first) for Mozilla Firefox and Thunderbird called ULDebunk. I started writing it last Wednesday in response to the never-ending torrent of emails containing urban legends. Typically when I would get one of those emails I would switch over to my browser, go to Snopes.com, type in some search terms and see if I got any hits. I thought that I should be able to automate that process… and here it is. After far more hours than I expected to spend, I give you version 0.1 of ULDebunk.

What this thing does is add a context-menu item that says “Debunk It!” and it will take whatever text you currently have selected and run it through an urban legend search engine. It defaults to using Snopes.com, but you can change this in the preferences. It comes pre-loaded with the proper search URLs for both Snopes.com and UrbanLegends.com, but you can add your own. If you add your own, you need to insert “xxx” (without the quotes) into the url; this is there to indicate where the search text should go.

Currently it works perfectly in Firefox (0.9.2), and it works in Thunderbird (0.7.3) assuming a browser window is already open. I’m not sure why, but that’s what it does. Of course most of us keep a browser open all the time anyway, right? 🙂 It’s also not currently updatable using the “Update” button in the extension manager; I’m still looking into that.

I have only tested it with the aforementioned versions of the apps. I have tested on both Windows2000 and XP, but I don’t know that it matters that much. As usual, this software is free with no warranties, etc.

Download it here.

Let me know if you use it and any problems you might have. Or suggestions for improvements.

Can Someone Help With These Eclipse Files?

Is anyone familar with the format of the files in .metadata/.plugins/org.eclipse.core.resources/.projects in the workspace of Eclipse 3.0? I have an Ant task that uses the .classpath file of a project, along with the JDT preferences to build an Ant classpath for a project with an external build file, and I’m now trying to support projects that depend on other projects. I can see from the .classpath file which projects are referenced, either as a “src” type or a “lib” type, depending on how you added it, but I need to actually FIND those projects and get their build info.

I poked around in my workspace and discovered the directory I mentioned above. For each project that Eclipse knows about there is a subdirectory for it. Inside each subdirectory is a file called .location. I can see by looking at this file with a hex editor, that it does indeed contain the full path to the project. But it’s a binary file, and I don’t know the format. Is it documented anywhere?

I also did a little poking around the Eclipse API. I found a ResourcePlugin which sounded useful, but experiments from within Jython were fruitless. I would also like to avoid hooking into the Eclipse API since I’m trying to support multiple versions of Eclipse, but if that’s the only way to get to the data, I’ll do it.

The question, then, can be broken down into three subparts:

  1. Does anyone know the file formats?
  2. Does anyone have a code snippet of using the proper Eclipse API outside of Eclipse to get to the info in those files?
  3. Does anyone have a better solution to this problem?

Since I’ve taken down the writeback feature of this blog, thanks to certain miscreants, if you have a suggestion, please email it to joey@joeygibson.com. Thanks.

Free Eclipse Classpath Ant Task

This software is no longer supported! I have neither used nor updated this software since I originally posted it, back in 2004. You are welcome to both the binary and source versions, but I no longer do anything with it or support it. If you need something changed, you will have to do it yourself, using the source. Sorry, but after I released it, I realized how little I really needed it, and thus stopped using it.

I’ve just released version 1.0 of a free Ant custom task to make it a little easier to work on a project using both Ant and Eclipse. What this task does is read the .classpath file that Eclipse uses to maintain your project’s classpath, combines that with your Eclipse preferences to expand classpath variables and then creates a path-like structure in your Ant project that you can compile against.

I wrote this because I use Eclipse and I always also have a build file. Keeping the two in sync, classpath-wise, was always a hassle. Now I can simply update the classpath inside Eclipse, and whenever I do an Ant build it will automatically be in sync.

I wrote it against Eclipse 3.0 M8 originally. Then I upgraded to M9 and it stopped working. So with a bit of futzing about, I got it to work with both 3.0 versions and 2.1.3, all three of which keep the preferences file in completely different places with completely different names. But that’s taken care of now. I have also tested on both WindowsXP and Linux, but more on XP than Linux.

To use it, drop the jar file (plus jdom.jar if you don’t already have it) in ANT_HOME/lib. Then taskdef the task

  <taskdef resource="com/joeygibson/ant/eclipseclasspath.properties"/>  

Then call the task. There are several optional attributes, but if you want the classpath to end up in a path called “classpath”, then you can probably get by with just this

  <eclipsecp workspace="/home/me/workspace"/>  

If you are on Windows, and using Eclipse 3.0 M8 or later and you keep your workspace in C:/Eclipse/workspace then you don’t even have to do that much. You can get by with

  <eclipsecp/>   

Once you’ve executed the task, just reference the newly-created path from your javac task or anything else that takes a path as an argument.

You can read more about it in the README.txt

I’ve got several downloadable versions available, in both zip and tar.gz formats, with and without source, and with and without jdom.jar. If you use it and like it/don’t like it/have suggestions, please let me know.

Downloads
Binary only ect.zip
ect.tar.gz
Binary w/ JDOM ect-with-jdom.zip
ect-with-jdom.tar.gz
Source only ect-src.zip
ect-src.tar.gz

I’ve heard there are other tools out there that do this, but I didn’t find them, so I wrote my own. Please email me with any comments you have about it.

Ant Talk At CJUG

I want to thank the folks at CJUG for having me up last night to speak on Ant. I thought the talk went well, though I did run long. I must say it’s rather embarrassing to discover that your presentation, which is supposed to fit in about an hour and a half, in reality needs three hours to be done right… I need to pare it down so this doesn’t happen again. Those in attendance didn’t seem to mind too much, and everyone stuck around a bit longer than planned, which was nice to see.

What I’d really like to do is to extract a subset of the slides into a smaller presentation, yet still have them linked so that I would only have to revise the slides in one PowerPoint file instead of two. Does anyone know if that’s possible?

Stick To 80 Columns. Please?

I know we’re not still living in the 1970’s, nor are we still working with 80 column punch cards, but please, for the love of all that is good in the world try to limit your code to 80 characters per line or thereabouts! I’ve been looking at some code recently that has line lengths of 250 characters or more, and that just ain’t right. Not all of us have 60″ flat-panel monitors that will allow us to see those huge lines without horizontal scrolling and it’s damned annoying to have to scroll sideways to see the code. Now I understand that there are times when there just isn’t a good place to break a line to keep it to 80 characters; but that should be the exception and not the rule. Please people, break your lines into reasonable lengths. And don’t put 400 lines of code in a single method either. But that’s another story…

Atlanta Ruby User Group

If you read my stuff very often then you know that I am a huge fan of the Ruby programming language. I write a ton of Ruby code and went to RubyConf 2003, so there was only one other direction to take my love of Ruby: start a user group. So, I have started the Atlanta Ruby User Group. Our first meeting will be Tuesday, March 30 2004, at my office in Norcross. There is a map at the web site and a mailing list. Rather than try to restate the meeting announcement, I’m just going to repost the email I sent to the mailing list here. If you want more info, drop me an email and/or visit the group site. If you are within range of Atlanta, please come on out for the meeting.

Our first meeting will be Tuesday March 30 at 7:00 PM. The meeting location is at my office in Norcross, on Peachtree Industrial Blvd. There is a map on the website. We have classrooms, so it will be a comfortable environment.

This meeting will be a "get to know each other" type meeting where we can discuss what, if anything, we've done with Ruby so far. I will then present the first part of an introduction to Ruby, and then discuss the future direction of the group. The meeting should be finished at 8:30 PM.

Things we need to discuss are meeting frequency, topics, presenters and commitments from group members as far as attendance goes. I'm not suggesting that everyone must commit to being at every meeting, but with a small group, if several people miss each meeting, there won't be much "group" to the group, if you know what I mean. As for frequency, I'm currently thinking a meeting every other month (6 per year) but I'm open to suggestions.

Anyway, Sams Publishing has agreed to send me a few copies of The Ruby Way and Teach Yourself Ruby in 21 Days, so I will have those to hand out. (The Ruby Way is an excellent book [thanks, Hal]; I haven't seen the 21 Days book.) I will provide drinks and some snacks for the first meeting, but if we decide to have food at subsequent meetings, then we need to also decide how we are going to pay for it. Lots to discuss, eh?

So, be sure to mark Tuesday, March 30 on your calendar as we kick off the Atlanta Ruby User Group!