Google Docs generates yucky HTML

29
Sep/07
0

In Google Docs you can create an outline. You know, using our old buddies UL and LI. Hi UL! Hi LI!

But they do something nasty. They close their LI tags, and then if there is a nested list, they put that between the list elements. So you get:

<ul>
  <li>
    Foo
  </li>
  <ul>
    <li>
      Bar
    </li>
  </ul>
  <li>
    Baz
  </li>
</ul>

See that close li right after “Foo”? Wrong! It should be:

<ul>
  <li>
    Foo
    <ul>
      <li>
        Bar
      </li>
    </ul>
  </li>
  <li>
    Baz
  </li>
</ul>

Or the li close tags could be omitted altogether. They’ve tried to be a little bit XHTML, but it’s just not right, because they are putting something that should be contained inside a list element in between list elements.

So now I have to resort to sculduggery to get my stylesheet right, or transform the HTML.

At first Google Docs looked like a good tool, because it seemed to generate clean and simple HTML. But it doesn’t. In addition to this issue, they like to pop in extraneous <br/> tags.

For what it’s worth, the cute little HTML editor in the newest versions of WordPress gets it right.

I suppose that HTML generation code was written by a summer intern at Writely before they were picked up by Google: It just smells bad.

Filed under: Uncategorized

Top Feeds

29
Sep/07
0

My students asked me about my fave feeds, so I obliged them.

Filed under: Uncategorized

Ruby and recursive arrays

28
Sep/07
0

Doubtless this would offend some, but the fact that Ruby is sensitive to a recursive array brightens my day:

irb(main):001:0> x = []
=> []
irb(main):002:0> x << x
=> [[...]]
irb(main):003:0>
Filed under: Uncategorized

Axis2 1.3: Slow stub generation

28
Sep/07
0

Apache Axis2 has been very frustrating going from version to version. It seems to be better recently, but get this:

We generate Axis2 1.3 stubs with org.apache.axis2.tool.ant.AntCodegenTask. I noticed in the switchover from 1.2 to 1.3 that my stub generation was taking 10 minutes instead of 10 seconds. Wonder why?

It turns out that the Axis2 1.3 team tossed jalopy — a Java pretty-printer — into their stub generation process. My stubs are gigantic, so pretty-printing that is slow. But, worse, jalopy works on the current directory and everything below it. So suddenly all of my Java client code was getting pretty-printed. And there’s a lot of it. So none of my files were matching subversion… Chaos!

The solution was to just exclude the jalopy jar from my Axis2 classpath:

<path id=”axis.classpath”>
<fileset dir=”${env.OTS}/axis2-${axis2Version}/lib”>
<include name=”**/*.jar”></include>
<exclude name=”**/*jalopy*.jar”>
</exclude>
</fileset>
</path>

Still, this kind of made me want to cry. Lucky I didn’t check in the “pretty” code!

A recent post to the Axis2 e-mail list says you can also set -Daxis2.jalopy=false — but sheesh, it’s not really documented, and the default should be false! Isn’t that common sense?

Filed under: Uncategorized

Amazon Web Services – EC2 – Wow!

28
Sep/07
4

Yesterday afternoon I went to Amazon’s presentation for their “Start-Up Project,” where the main event was a set of presentations by companies that are leveraging Amazon Web Services, and in particular EC2, Amazon’s “elastic cloud.” It was at the MIT Hotel (oops, Hotel@MIT). There was good attendance. Some of the usual suspects were there (hi, Chris Marstall).

EC2 provides for provisioning a Linux system from the command line. After a 30 second wait (ymmv), you can log into it, prepare it, and then save a copy for later use. Then, if you like, you can fire up 20 of these babies and create your own server farm. If you contact Amazon, you can provision a lot more. One of the presenters talked about provisioning 100 in 5 minutes.

The pricing is $0.10 per instance hour, which isn’t bad. You also have to pay for storing any custom instances.

In any case, the convenience is the incredible part. Only do regression testing 3 days a week? Fire up the instances, do your work, and only pay for server utilization during that period.

Need to create a new multi-server staging environment without destabilizing your current operation? Provision your new test instances and get to work!

There was also a lot of creativity leveraging EC2 to support production environment. Geezeo, located in Boston, have put everything on EC2: Front-end, app-servers, and database. Because MySQL replication and clustering is relatively easy, they could set up a small MySQL farm and then do frequent off-site backups to S3 (Amazon’s Simple Storage Service — you pay for that, but it’s not too expensive). Geezeo is sort of a mix of Quicken and Facebook. I’d been very leery of Geezeo because I don’t think I want my bank data up in the cloud. But after this presentation, I think they may have a good architecture for security; I might actually try them now. Which is saying a lot, because if you had told me their service was in EC2 before I saw their presentation, it would have actually increased my worry. They have SSL in the right places, and, apparently, private IPs running in EC2. Nice job.

Another company that presented was AideRSS. First off, I had encountered this product shortly after their launch, and it’s great. It will check your feeds for the good stuff (based on their own metrics based on net-wide readership), and then you can subscribe to their filter. They also have some neat widgets.

Their footprint in EC2 is significant. I’m hoping they send me a copy of their slides, but I believe they said that at times they have had as many as 100 instances running (this was before optimization — now they run on 20-30 instances), which they needed shortly after getting slashdotted. They also have some compute-intensive spidering operations, and they also leverage the Amazon queuing service.

Yet another neat thing I saw was the lastest offering from RightScale. I’d used them before and liked the product. They provide a web-based interface for setting up and managing your instances (for raw EC2, you use command-line tools). Slick. Their newest thing is a pre-built cluster, so you can launch a set of instances running, say, MySQL replication on 3 servers.

New Sebastians in Kendall; and about black coffee

28
Sep/07
1

Wow, there’s another new restaurant in Kendall Square; I guess the tech economy is overheated! It’s a Sebastians. No apostrophe. Wonder why they do that. Anyway they serve salads and crêpes. But they call them crepes. I guess spelling is not their strong suit. If only it had been a Wagamama’s.

In any case, I have a ritual with new restaurants that are open in the morning. I order a cup of black coffee in the mildest roast they have. I have been drinking black coffee since I was 14. When you drink a lot of black coffee, you tend to want a mild roast. When coffee when upscale/European in big American cities in the 80s (before going nationwide in the 90s), the roasts became much darker because European coffee styles, except for espresso, usually have milk. So the dark roast is ok because the coffee is diluted.

But if you drink a lot of black coffee, that won’t work. (Why won’t it work? You will kill your stomach. Your breath will become noxious. But do what you want, I’m not your mother.)

In Boston, the only chains that really understand this are Dunkin’ Donuts and Au Bon Pain. All of the Dunkin’ coffee is pretty mild, and ABP has something called Morning Blend. Outside of Boston, Tim Horton’s is good, too, but you have to drive to Rhode Island (or Canada!) for that, at least for now.

Sebastians’s milder roast is ok. Too roasted for my taste, but it might do in a pinch. The bad ones are Starbucks and Rebecca’s. Their mildest coffees pretty much require milk.

coffeewars.jpg

Filed under: Kendall Square

Rails vs. PHP

23
Sep/07
2

Interesting article on Rails vs. PHP:

http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html

Clearly learning Rails was great for the author’s brain; hence, the great pedagogical value of learning Rails even if you end up not using it.

It sounds as though his MVC framework is home-grown. This strikes me as a real problem. While it may be the case that he was able to accomplish his re-write in two months, would a new developer be able to understand the frameworky aspects of the code? Would that developer be able to go to a book to learn how it all works — or transfer the framework knowledge to a new job? If you have a home-grown framework, you’re really doing your developers a disservice. I suppose it’s a strategy for employee lock-in.

One of his reasons for sticking with PHP was his difficulties getting multi-lingual to work in Rails: A definite issue; can’t wait until that objection is finally and completely removed in a standard way…

Filed under: Technology

WordPress: How to enable comments on *pages*

23
Sep/07
3

I needed to turn on comments on WordPress pages (as opposed to just blog posts) for my course blog.

Here’s how to do it:

Find your theme’s page.php. Then inside “the loop” (if (have_posts(), etc.) you need to add a call to comments_popup_link. This provides the display of the number of comments (if any) and the link to the comments section or the popup, as appropriate. In my page.php, it looks like this:


  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">
        <h2><?php the_title(); ?></h2>
        <div class="post-content">

          <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

Then go to wp-includes/comment-template.php, and find


	if ( is_single() || is_page())

Remove the check against is_page(), i.e.,


	if ( is_single() // || is_page()
              )
		return;

That is all. Once this is done, page comments go into the comments feed as usual.

Filed under: Technology

Obnoxious popup strategy of mlb.com

23
Sep/07
0

I occasionally go to the Red Sox web site and want to run their Gameday application, which provides stats and a live summary of game action. But it’s a popup, so I have “allow popups” for redsox.com.

But once I do that, then I get those #^@&^!! ad popups. Really obnoxious.

Doubtless I could figure out a way to create a direct link to Gameday, or figure out some mechanism to allow that popup but not the others, but it’s just not worth my time. So I guess no Gameday for me for awhile.

Filed under: Technology

The Sound of Our Town (Book Review)

17
Sep/07
0

Brett Milano, The Sound of Our Town: A History of Boston Rock & Roll (2007). $24.95. [Amazon]

Brett Milano, frequent contributor to the Boston Phoenix, the Boston Herald, and other publications, has written a great little history of Boston rock and roll. If you have friends who saw a lot of local music in the 60s, 70s, 80s, or 90s, this would be a wonderful holiday gift: Tell them to start with the chapters on their decades. The opening chapters are more straight history, and the latter are a bit more of a “scene” history with insider anecdotes and reports of famously-gossipped-about events. You’ll learn something here about the key perfomers from the 50s to the present: Freddy Cannon, the Remains, the Lost, the “Bosstown Sound,” Aerosmith, J. Geils, Boston, the Modern Lovers, the Mezz, the Real Kids, DMZ, the Lyres, Mission of Burma,the Throwing Muses, the Pixies, Dinosaur, Jr., Morphine, Buffalo Tom . . . they’re all here. Much to Milano’s credit, he doesn’t fall prey to the mistake of Legs McNeil’s Please Kill Me or Clinton Heylin’s From the Velvets to the Voivoids which provide the scensters way too much leeway to alter history with varnished versions of what really happened. Milano also knows many of the people he reports on as friends, and he does a good job of telling a true story that is also not inflammatory or embarassing to its subjects.

One thing Milano tunes into that was plausible to me but not something I’d cough up if you asked me to characterize the Boston sound is that Boston bands have written a lot of sad songs. Occasionally Milano mentions New England weather and overcast skies. He’s right. There is a real tradition of get-out-the-razorblades songs (many disguised with upbeat melodies).

There are some oddities: Salem 66 and November Group get their major mentions in the chapter on 1977-1980 (I guess because as gurls they get bundled in with Robin Lane and the Bristols, who are discussed in that era); the Neats are sadly neglected (a few brief mentions; they were terribly misunderstood and under-appreciated: I wish Milano had set the record straight here); ditto for Scruffy the Cat; Nat Freedberg doesn’t really get as much attention as he deserves; and Milano uses the Turbines “Wah Hey” as a way to introduce a chapter, but you don’t really get the details on why they were so compelling. But these are quibbles; having griped a bit here, there are bits that Milano gets so right. For example:

Most Lyres fans can recall the night they’ve dragged some music-snob friend, or maybe just a timid girlfriend to one of their less coherent shows and gotten only a puzzled look: you really think this could be one of Boston’s greatest bands? Damn right they are. You just have to see them on a good night, when those elemental chords are pounded out like the future of civizilization depends on it. (p. 110)

This is true. I was a lucky one who dragged someone to the Rat to see Lyres and they were spectucularly on and crazy, igniting a quasi-mosh pit frenzy. But talk about hit or miss . . . So everywhere in the book past 1980 or so Milano brings a valuable “you are there” perspective to what he narrates.

In fact, the book could (should?) have been twice as long, and I sincerely hope there will be a second edition (there has to be, right? Boston rock doesn’t stop!). There are a lot of opportunities to “drill down” on individual bands. Take Dumptruck, for example: Milano calls it Seth Tiven’s band (p. 190), but the shared leadership of Kirk Swan was crucial in their early years — and I can recall stories of their origins in two New Haven kids trading licks in their bedrooms: How else could you get that kind of guitar interplay? I am sure there was a page limit Milano was fighting against. Just for example, Milano touches on Big Dipper, but never mentions the connection to the Embarrassment; that’s a flaw, because there are going to be readers who are catching up on the Boston scene who know well the Embarrassment’s importance in mid-America. Yet another thing that would have helped would be to have given the street addresses of the clubs that have disappeared: Milano mentions the Unicorn, which was near the Pru. Really? Wow. Where!?

Also missing from this volume is a discographical essay. Brett! This is your chance to sort through it all and pick and choose and help out all of us hopeless record collector slime! An annotated discography would be a great thing (maybe one could be written for the book’s web site?); an accompanying CD would be even better.

The last thing I wish could appear in an expanded edition would be a “where are they now” section. Just for example, it has always pained me that people are still toiling away on the local scene with only occasional but sometimes astounding appearances (e.g., the Bags) — a word or two about how they’re still getting out there, what their day jobs are: That’s real life, and it has a place in a book that is so generous about the scene.