| Subcribe via RSS

GreaseMonkey: Hide the ToC on search.cpan.org Module Pages

July 31st, 2009 | No Comments | Posted in CPAN, GitHub, JavaScript

I love it when tools do exactly what they’re supposed to, do it effectively, and in doing so let me do things quickly and easily.

Like any serious Perl programmer, I use search.cpan.org several times a day. Indeed, I even have it as a search plug-in for Firefox. But when I am looking at the manual pages for modules, I find the auto-generated table of contents to be cumbersome. I always just scroll past it to get at the meat. Yes, I could click on the links to jump to sections, but then browser-back has to be clicked that many more times to get back to the main distribution page, search results page, etc.

So I did the obvious thing: I set out to write a GreaseMonkey script to scratch this particular itch. And in this case, JavaScript was just easy-enough to use, and GM just helpful-enough, that before I knew it the task was done. I had initially planned to just put together the basic framework, make sure it was locating the needed <div> tags, etc. But that worked right the first time, so I thought I’d go ahead and have it hide the ToC. That took even less time, so I went ahead and put in a clickable <span> tag to toggle the hidden/exposed state of the ToC. And before I realized it, I’d pretty much finished the whole task.

There were two “gotchas,” of sorts, that I had to spend a little time fixing:

  • Seems that you can’t set the style for CSS pseudo-selectors, “:hover” in this case, via JavaScript. So I solved this by creating an additional element, a <script> tag, to provide hover-styling for the clickable text.
  • The <span> tag displayed as a block object, and as such the “hot” area actually extended well to the right of the text. I solved this part by just wrapping the span in another <div>. Then the span was treated as inline, and the “hot” part is limited to the bounding-box of the text only.

So, the script is being tracked on GitHub, the project page is here. Also, I uploaded it to userscripts.org, and you can install it from it’s page there.

Tags: , , ,

OSCON Day 3: All Over Except the Crying

July 24th, 2009 | No Comments | Posted in Conferences, Perl

(Just to be clear, there’s no crying at OSCON!)

As is usual, the last day of the show is a short one, with only one pair of session-tracks. I skipped the first one as I was deep in conversation with Andy Lester about designing plug-ins for ack. On a side-note, if you’re a developer and you aren’t using ack, you aren’t getting the most you could out of file searching, period. We talked at length about just where and when in the flow hooks should be made, things like that. It’s still quite early, and to be honest I don’t think we’ll have a truly definitive scheme of things until a few plug-ins that are inherently diverse have been written, each contributing their unique needs to the design.

The second set of sessions was a no-brainer: I went to “The Damien Channel” to see what Damien Conway has been up to lately. And what has he been? How about blending regular expressions and recursive-descent grammars into one combined entity. In a more general sense, the talk was about duality in expression and purpose, and in this the new module he introduced succeeds amazingly. As I said in my Twitter stream, I didn’t even TRY to take notes for fear I’d miss something important while looking at the keyboard. I don’t even know yet how I’d actually use this in anything, but I’m dying to try it out just to get a feel for it. It does require that you are running the 5.10.0 version of Perl, though. Not a problem personally, as my desktop and laptop both are based off of the most-current Ubuntu. However, none of my CPAN modules are utilizing 5.10.0 features because I’m not ready to force my users to move up. But that’s a topic for a later post.

As I’ve said more than a few times, I was just glad to be back at OSCON after a long absence. Regardless of where it’s held next year, I hope it doesn’t take me another 6 years to make it again.

Tags: ,

OSCON Day 2, Part 2: Improving Error Reporting

July 24th, 2009 | No Comments | Posted in Conferences, Perl, PHP

(Or, “This is a lot easier to do when I’ve had more sleep the night before.”)

The highlight of the second day, for most if not all in the Perl community, was Larry Wall’s annual “State of the Onion” talk. Larry’s talks are not the kind you can easily summarize with a handful of quickly typed/scribbled notes. The basic gist of it, though, could be summarized as focusing on improving the quality and timeliness of error reporting in Perl 6 and the Parrot grammar/parsing engine. As is usually the case with Larry’s talks, it provided a good deal of food for thought in areas above and beyond the examples that were shown.

As to the rest of the day, for me, it was largely PHP-tastic. The first session I attended was Patrick Michaud’s talk on building compilers with the Parrot Compiler Tools. This session cleared up a lot of questions I had, and I hope to find the bandwidth to explore these tools some over the next few months. The other three sessions I got to were all PHP; one on building distributed systems with PHP (that actually focused more on proper configuration, care and feeding of memcached), one on PHP best practices (which was doubly-interesting in that the pair giving the presentation have been doing it for years, and in their slides they showed how the impression of “best practices” has evolved as PHP itself has), and finished the day with a session on the PHP Xdebug extension. I found this one the most interesting, as I am still such a novice with PHP.

In addition to the above, and as I mentioned in my previous post, I took a leap of faith and did my first-ever lightning talk. These are talks limited (STRICTLY!) to 5 minutes each. You can go back to the previous post for the links to the topic I spoke on, and you can peruse my slides here. (The slides are done using the fantastic S5 system by Eric Meyer. Took me about 3 minutes to get the feel for it and start focusing on actual slides-content.)

Tags: , ,

OSCON Day 2, Part 1: Lightning Talks

July 23rd, 2009 | No Comments | Posted in ChangeLogML, Conferences, Perl, XML, XSLT

I will be giving a lightning talk (possibly two) in the Perl Lightning Talks session at 4:30. The talk I am definitely doing is on ChangeLogML and the Perl module I have for it. If their time and schedule permit, I will also give a talk on my testing module, Test::Formats.

Tags: , , , ,

OSCON, Day 1

July 22nd, 2009 | No Comments | Posted in Conferences, Perl

(First rule of blogging: sometimes you have to write that post you promised yourself you’d write, even if you’re exhausted and don’t feel like it.)

I can’t describe how genuinely good it felt to be back at OSCON. Quite possibly the best part was all the people that recognized me, and made sure to say how glad they were to see me again. It’s nice to feel like people enjoy having you around!

Started the day with the keynote talks, though I missed most of Allison Randal’s (as I was getting my registration packet and all). Of the talks, the high point (upheld by the amount of Twitter traffic it generated) was Tim O’Reilly’s announcements of http://opensourceforamerica.org and http://www.data.gov — both parts of the open government initiative he’s been participating in. The goal is to move the (U.S.) government towards both open source (to save on expenditures) and open data reporting, formats, etc. (to promote transparency and openness). While Tim cited that both the President and his designated “national CTO” were in strong support of the plan, he also feels as though if the program doesn’t prove itself within the first year, it won’t be able to survive or make a difference.

For the first round of sessions, I took in Jacinta Richardson’s comparison of Perl MVC frameworks, and Tim Bunce’s overview of Devel::NYTProf. Both sessions were excellent, and I was sure to rate both highly on the conference site. But Tim’s work on the profiler is just stunning. I was tempted to skip lunch in favor of playing around with the module. (But I didn’t… the food smelled far too heavenly.)

After lunch, I took some time to check out the vendors. There seems to be a lot of focus not just on cloud computing in general, but in making it as easily accessible and easily manageable as possible. Several vendors seemed to be competing in this space, whether offering their own complete stacks or just offering slick UIs on top of Amazon or Google clouds. I wandered back to the sessions rooms in time to catch a very nice presentation on sharing and serializing complex data with YAML. As a format, it is capable of a lot more than I have given it credit for. Clearly, I could be getting much more and better use out of it, if I can apply some of the things I learned.

After the last break, I took in two sessions. Or meant to, at least– the first of these was “Perl, UTF-8 and You”. I have a lot of interest in learning how to properly manage character encodings, but the planned speaker was apparently unable to make it, and the replacement person just stood up there and read the slides off to us. So I left and went ahead to the room where Allison Randal would be doing a talk on the Parrot VM. Much of it was material I had seen or read before, but much of it was new to me, as well, in particular the way she explained the register-based nature of Parrot, versus the stack-based nature of most existing hardware and virtual machines (including the JVM and .Net’s CLR). The explanation/comparisons of closures vs. continuations vs. coroutines was also very illuminating.

At this point, fatigue started to catch up to me strongly in the form of a sudden and powerful headache, so I reluctantly passed on the evening’s parties and BoF sessions. Tomorrow is another day, and better rest should help me get more out of it…

Tags: , ,

A Blog is Hatched, or, Why It Took Me So Long

July 22nd, 2009 | No Comments | Posted in Meta-Posts

Welcome to the inauguration of my latest effort at avoid real work or responsibility: my blog devoted to software, programming and miscellaneous related things.

I am kicking this effort off in sync with my return to the O’Reilly & Associates Open Source Convention. I have attended these gatherings, though not contiguously, since the very first Perl Conference in 1997. Little did I know, when I came to San Jose in 1997 for that conference, how many things would shake out and change either as a result or at least helped along by it.

Firstly, it lead to my first published writings on Perl (as opposed to papers I had written that were focused on software configuration management that happened to be implemented in Perl), as Jon Orwant recruited me to write a column for The Perl Journal. During the week I was in SJ, I met some local folks who shared my hobby, and made fast friends with them. This would prove handy, as I found myself relocating to San Jose area just a few months later in October.

Since then, I’ve been on a fairly-typical roller-coaster ride of one small(-ish) company after another. Along the way, I did some journaling via use.perl.org, but was never very active or consistent about it. (That said, my first successful SOAP application was a Perl filter to post to my journal, that in turn was tied to some Emacs Lisp code, allowing me to post directly from a scratch-buffer in XEmacs.) As chance would have it, I’ve been on something of a health-related roller-coaster as well. This is a project that I’ve wanted to do for well over two years, but I just haven’t been able to do it before now. (I’m not 100% sure that now is a great time, either…)

Skipping ahead to (hopefully) avoid boring anyone, I’m starting this project because it offers me the chance to have tools that will hopefully help me to write more often, tools that will give me more exposure to PHP (which I am having to use for the first time at $DAY_JOB), and also allow me to easily share my content with various aggregators based on that over-used concept, tags. Initially, it’s going to look pretty rough around here; I don’t know PHP that well, and I know sweet fuck-all about WordPress. For example, I like the aesthetics of this theme, but need to fix some things or it just won’t work for me. And I’m pretty intimidated by the unwashed hoards of WP plug-ins out there… it’s almost as bad as trying to pick a templating solution on CPAN!

Over time, though, I hope to make this thing work, both content-wise and visually. Read long-enough, and I’m sure to either interest you or offend you. And if I do things right, I should accomplish both.