Archive for the ‘Neat Stuff’ Category

Web crawling with Ruby

Friday, June 15th, 2007

Learned a little bit about scRUBYt! today (damn thats hard to type!).

It looks like a pretty cool way to do web crawlers. To use it, you define a “learning” crawler using the scRUBYt! DSL, which combined with the actual site at a specific point in time, creates the real crawler to do the dirty work - essentially, example text gets converted to xpath expressions. The cool thing about this is that when the site changes, one has to do minimal changes to create a new working crawler, not to mention that creating the crawler in the first place is a lot easier.

(more…)

Python with readline on OS X

Tuesday, January 30th, 2007

I used to have python with readline support working on my powerbook before I swtiched to a macbook. Unfortunately, I couldn’t get it working with the macbook as I couldn’t find a binary that worked with the stock os x python (these instructions no longer worked), and python wouldn’t load the binary I compiled on my own. For various reasons I need the stock os x python and can’t just install one of the new python runtimes that include readline.Fortunately I discovered the rlwrap program which allows one to run any console app with readline support ,a quick “port install rlwrap” (using darwinports) and “alias python=’rlwrap python’” and I’m back to having full readline support in my python console.

Cool firefox plugins

Wednesday, April 19th, 2006

 

My two new favorite firefox plugins:

  • firebug: Combines so much useful functionality that I used to use multiple plugins for before, plus more that is not avaiable elsewhere. Basically lets you dynamically see sections of your page (css, html src, dom, etc) when you mouse over, regardless of if that section was generated dynamically with javascript!
  • Tamper Data: Lets you see request/response headers/data like the Live HTTP Headers plugin, but also lets you mess with the data before submitting it back to the server.

Testing/debugging code on the fly in eclipse

Thursday, May 5th, 2005

Sometimes its useful to be able to run a piece of code to see if it does what you want without having a test case for it.

Eclipse makes this easy to do with its Scrapbook Page feature. To create a Scrapbook Page, New (Ctrl-N) -> Java -> Java Run/Debug -> Scrapbook page. This brings up an editor into which you can add snippets of java code which you can then execute by selecting them, RC->Inspect/Display/Execute

But did you know you could also debug the code you are executing from a scrapbook? Since the scrapbook actually runs the code in a jvm running in a debugger, all you have to do is set breakpoints at the locations you care about. This makes it extremely easy for one to figure out if a utility method is doing what it should (but you should really write a test case ;), or inspect the execution of some javadoc deficient thirdparty code to figure out what it actually does before you make your code depend on it.

TiddlyWiki AJAX example

Thursday, April 21st, 2005

Shawn pointed me to TiddlyWiki as an AJAX example. Looks pretty cool.