Tuesday, July 14, 2009

Firefox 3.5 and DenverLibPlus and CheckFox

If you are looking for updates for these, they are coming, I promise. They've been updated some time ago, and submitted to the Addons site, and are awaiting review.

In the meantime, if you cannot wait...I suggest using the Nightly Tester Tools to force an install of them.

I googled up this tutorial that explains how to do this...

Sunday, May 24, 2009

Reason #9,458 That Firefox Rules: LastFM Firefox Extension

Okay, so I've been using Pandora long before I ever used Last.FM. But after finding Last.FM, I'd get sort of irritated that I wasn't getting the "credit" for listening to tracks on Pandora.

Oh, and if you are even the slightest fan of music, and haven't heard of either site, well, what are you waiting for? ;)

I never really bothered to look into solving this problem of not getting credit until recently, but I found an elegant one. Though there is at least one site that sets out to resolve this - you have to give your login info for Last.fm to it...and it didn't seem to work, at least not for me.

Well, Firefox to the rescue! This plugin, the LastFM Firefox Extension, integrates with Pandora (and other sites) and sends info to Last.Fm for you.

Saturday, May 02, 2009

Reagan - Trying To Counter The Myths

All I can say is.....finally. There may be other books out there that try to set the record straight on Reagan, but I don't know if they are trying to do what The Man Who Sold the World: Ronald Reagan and the Betrayal of Main Street America does, and that is to try to use an understanding of just what a disaster Reagan was and use that information to understand why things are the way they are now, including, most especially, the economy, but also, the political climate.

My only beef is that it wasn't about twice as long and didn't go into more detail.

Wednesday, April 29, 2009

Screenscraping HTML With TagSoup and XPath

So, long story short: we have something we are trying to use that doesn't work as advertised, and so I had to build a quick n' dirty tool I could use to query one of that app's pages for things and act on that.

HOWEVER: that page is in, of course, HTML, and everyone that's worked in and around web development knows how well-formed that often is (HA!), even if the data I want is in an HTML table.

I'd like to turn the page into a DOM (somewhat reliably - though it doesn't have to be perfect for my uses) and search it with XPath, etc.

Turns out TagSoup seemed to come up in my searches, and I quickly found a way to use it to turn it into a DOM and pull out the bits I care about quite effortlessly with XPath.

Kudos to the author of TagSoup, and thanks for the TagSoup -> DOM writeup. Check write up link for more info and the imports, but it really boils down to this:

URL url = new URL(whatever);
XMLReader reader = new Parser();
reader.setFeature(Parser.namespacesFeature, false);
reader.setFeature(Parser.namespacePrefixesFeature, false);

Transformer transformer = TransformerFactory.newInstance().newTransformer();

DOMResult result = new DOMResult();
transformer.transform(new SAXSource(reader, new InputSource(url.openStream())),
result);

// here we go - an DOM built from abitrary HTML
return result.getNode();

Sunday, April 26, 2009

Transcendent Man

Prepare to evolve!

Looks like Kurzweil's movie, Transcendent Man, started showing this weekend - unfortunately, the "worldwide" premier seems to be all in NYC, though. Sigh.

Oh well, at least on the site for the movie Transcendent Man, you can sign up for upcoming dates in your neck of the woods, if you don't happen to live in the Big Apple.

Saturday, April 25, 2009

Denver Has a Maker Group!



Denver now has a Makers group! Its first meeting was this Thursday at Club Workshop. The next one is tentatively May 21st. They are going to try for the third Thursday of the month.

Turnout was HUGE, especially given this was the first meeting, and a little out of the way, even if right off of I-25 - i.e., not right in DTC, and not right downtown Denver. I got there right about 7, and parking lot for Club Workshop already appeared to be full, and people were parking on street or other parking lots.

The topic was by John Maushammer, talking about his Pong Watch. He gave an overview of how he decided on components - things like size, battery life, being rechargeable, the cpu, cost, etc...he detailed how he went about designing the watch case, how he first prototyped in wood, how he went from designing in CAD, and then having a sort of low-tech 3d printer (forget the brand - but it was something he got from Ebay and said was much like a Dremel, but hooked up to a computer) carve it out of the wood, then aluminum, (and later, plastic, I think, for the face of the watch) for him.

He talked about how he created the board himself from a kit, how he sautered. He talked about how the instructions he needed barely fit in the thousand instructions the CPU permits. The code was in C, so you don't know ahead of time how many instructions that will result in. I forget the CPU type. In fact, I didn't have any way to take notes except by Blackberry, so all this is from memory.

It was all very interesting. He of course brought in the pieces so people could come up and see them. The down side was that there was no PA system, so it was a bit hard to hear him at times, especially when people were coughing or talking. I had to leave early too - didn't stick around to mingle or take a look at all the things brought, since I just happened to be exhausted that day as it was.

A bunch of Denver Mad Scientists showed up, too. Since people were invited to also bring in their projects and/or talk about what they were working on, one of the Denver Mad Scientists talked about what they do. They are known for many things, but the most famous is having the first robot battles. They were also the first to have pumpkin guns on the Front Range.

One guy jumped up and talked about his experiences with using a laser product to engrave wood. Another jumped up to talk about his net gun.

Before the talks the folks from Club Workshop walked us through a short intro to what they do, and that sounds incredibly interesting, too. They offer all kinds of classes in all sorts of things. They even sound open to starting up classes based on interest. Someone during the meeting if anyone knows anything about patent lawyers, and the guy from Club Workshop (forget his name, but I think he owns it) asked if there was interest in a class on filing patents...

And the classes sound very - get this - affordable, so if/when I'm ready to tackle some of these things, I know right where I'm going. I'd really like to learn to weld, and they offer that. They also offer a yearly membership, in which a few classes seem to be included.

Tuesday, April 21, 2009

PDFTK - The PDF Toolkit

I recently found that I wanted to split a very large PDF document into two smaller documents, and copy the table of contents, or at least the parts relevant to the second half, into the second document, too. That's so I wouldn't have to go looking back and forth between the two documents. You can imagine similar scenarios for an index, too - you may want to copy this to the first document.

So, how does one do that? Well, I started searching around for open source tools, and at first my keywords didn't seem to be turning anything up fruitful. Add in "linux" to the search, and voila, I quickly came upon pdftk.

Splitting a file into two is a two step process. You first write the first part, by giving it a page range. Let's say your doc is 500 pages and you want to split it into two, 250 page, documents.

pdftk orig.pdf cat 1-250 output part1.pdf

Then you do the second part this way:


pdftk orig.pdf cat 251-500 output part2.pdf

Now you have two documents. In my case, I wanted to add the contents to the second part, as well.

I couldn't find a way to do that in one step - say by giving two page ranges - but I did just accomplish it by writing a temp file. Say the relevant parts I wanted to add to the part2.pdf were pages 10-20 of the orig doc. I would save those off this way:

pdftk orig.pdf cat 10-20 output contents.pdf

Then, I merged the contents.pdf and part2.pdf this way:

pdftk contents.pdf part2.pdf cat output final-part2.pdf

And I was done. Not bad, not bad at all.

This page is powered by Blogger. Isn't yours?