|
This is one of my journal's many "channels." |
|
Rich read the Why I Wrote a JavaScript Module for BBEdit story, but like everyone else at Bare Bones decided to respond to me directly instead of posting something on the site. (Jim Correia has been guilty of this so many times it's now an old joke.) Anyway, he suggests that list the other languages/modules I've added to BBEdit since the JavaScript module
They are, in no particular order:
My favorite is still the JavaScript module. My least favorite is definitely the Markdown module (see Markdown.pl's source code and look for the author's comment, "This is an aspect of Markdown's syntax that's hard to parse perfectly without resorting to mind-reading" and maybe you'll understand my issues with it.)
My second favorite is the Python module, because Guido van Rossum wrote the gold standard of language specifications. He doesn't just describe the language syntax with near perfect clarity, he also has implementor hints! It's like he was in the room with me when I wrote that module, telling me what I should do here or there. His work made my work better, and there have been very few bugs reported in the Python module since its release.
My second least favorite module is YAML, for the same (or opposite) reason. The specification is obtuse, repetitive, unclear and unrealistic. It's full of internal language which you can only comprehend by looking for definitions elsewhere in the document, and inevitably those definitions have more internal language. (I'm working on an update to the YAML module, and the authors of YAML actually admitted to these problems in several IRC chats we had in the last few weeks).
I have various other unfinished language modules sitting around on my computer, waiting for me to make time for them, but all of the above have been released with BBEdit 8.5, 8.6, or 8.7.
Bare Bones just released version 8.7.2 of BBEdit. This is a free maintenance update for anyone who owns a license to 8.5 or newer. Here are the release notes.
I had a small hand in this update. In the release notes is a list of fixed bugs, two of which are mine:
Fixed bug in which TeX syntax coloring would get out of whack if "Color Math Strings" was turned off and the scanner encountered certain constructs in the document.
Fixed bug in which the JavaScript function scanner could crash on certain malformed (usually because of in-progress edits) constructs.
There's lots more good stuff in store (way more than just bug fixes!), but some of the fixes in this release needed to get into people's hands sooner than later.
(Remember the BBEdit Disclaimer.)
Over the years I've written this code in a few different languages: take some HTML input, process it according to some of the basic rules a browser would use, and spit out plain text (no tags or HTML entities). By "basic rules a browser would use," I mean that e.g. a series of <p> tags should not result in a long blank gap, but a series of <br /> tags should. Line breaks (r or n) don't matter except within a pre-formatted section. Etc., etc.
My first attempt, I think, was in straight UserTalk. Then i rewrote it a couple of times with regular expressions (still UserTalk) to make it faster. Then a client needed it in a language that could be used on any Mac OS X box, so I rewrote it in Perl, which was faster still (and was much better about converting the HTML entities to UniCode).
The Perl script uses lots of regular expressions, and so makes many passes over the input, changing the text in place. It worked well enough for most HTML, but long documents with a very high ratio of tags-to-text (that is, very tag heavy) would process very slowly. Unfortunately the script was run automatically in the background by a "regular" GUI application, and so the app would seem to freeze up for a little while as it processed one of these pathological cases.
Over the last week I rewrote it again, this time in pure C++. It's a command line tool with the same basic interface that the Perl script had: you can pass it an argument to specify the input file and output files. Omitting either one causes it to use standard input and/or output.
The new tool makes a single pass through the text, doesn't use any regular expressions, and generates slightly better output. Actually, it's more honest to say that it makes three passes through the text: first it converts UTF-8 to UTF-16 (but that's an OS API service), then it processes the UTF-16, then it converts back to UTF-8 (again, just done by the OS) for output.
The timing results speak for themselves. These tests use the worst, most pathological example we had. It's a 200 KB file that's about 90% tags (specifically, it's a long email exchange where everybody top-posted and quoted everything else, and everyone used HTML messages.)
$ time striphtmltags.pl - < ./striphtmltags.input.html > ./striphtmltags.output.txt # old one real 0m20.201s user 0m19.774s sys 0m0.352s $ time newstriphtml < ./striphtmltags.input.html > ./striphtmltags.output.txt # new one real 0m0.048s user 0m0.039s sys 0m0.010s
They wanted it faster. For this worst-case scenario, it's 420 times faster. Zoom.
One of my clients has recently signed up for an online shopping cart system to work with his catalog (which is based on Conversant).
When a customer buys something through this shopping cart system, they're shown a confirmation page with a link back to a specific page on the vendor's site. That's totally standard.
The link appears to use JavaScript to submit a form which POSTs the sale's data (minus the truly private info like credit card number) back to a page on the vendor's site. Still pretty common (except their implementation doesn't actually work).
They claim that it only works in IE. Not in Firefox, not in Safari, not in Opera. Why worry about those, they're just a small percentage of the marketplace, right?
I'm sorry, but those people are morons.
Without even testing it, I can tell you that they're wrong: it doesn't work in ANY browser, not even IE. How do I know? The link just runs the script, and the script just causes the browser to navigate to the vendor's thankyou page: it never does anything with the form at all.
The form is all hidden fields, looking something like this:
<form action="url/of/thank-you/page" name="postData">
<input type="hidden" name="firstName" value="Seth" />
etc., etc., etc.
The form's action is pointing to the correct URL... but the form is never used. The script looks like this:
function submitForm()
{
window.location.href="url/of/thank-you/page";
return true;
}
If you understood the above, then you know how easy it would be to fix:
function submitForm()
{
document.forms.postData.submit();
return true;
}
Sigh. (Even easier: do away with the javascript entirely, and replace the link with an actual submit button.)
My intent at the start of my travels for MacWorld 2007 was to provide daily updates on my goings-on and derring-dos. Hah. With all the hours in the show hall, and Dinners (with a capital D) every night, I quickly learned that there was almost no time for writing.
This entry will attempt to provide those details which I can recall…
My previous entry finished on Monday morning, and mentioned my plans for the day. This is where we'll pick it up.
Bare Bones rented a 2-meter booth in the "overflow hall". There was room there for two presentation stations, or one station and stacks of literature, window stickers, and CD's. They chose the latter.
When I arrived (30 minutes early), nobody and nothing was at the booth. No boxes, no computer, no literature, nobody from Bare Bones. Nobody. So, I spent some time chatting with the guys from provue (makers of Panorama), and then went back to my hotel room.
Back to the booth again at 2:30. The "media rental" guy was there, and was annoyed that we hadn't received anything yet, so he made a call and five minutes later the computer (Dual G5 tower) and the display (30" Apple Cinema) were delivered.
The mac had the wrong display card for that display (only 64 MB of vRam), so it was only able to drive it at 1200x800. I thought that was actually a *good thing*, as it was for presentations, not "daily use." Eventually everybody agreed (or at least agreed to give it a shot), and I'm glad: the display looked great if you were standing back a few feet. We often had large crowds watching our demos, and the low-resolution display made it possible for them to see everything we were doing.
Brian arrived in the area a bit early, but I couldn't leave until 3 so he found a parking space over on Mission St. and then walked over.
We met up outside, and I took him downstairs to the show entrance. Couldn't take him past the doors for the lack of an Exhibitor badge, and the 90 year old security guard was clearly prepared to Take Him Out.
Eventually Rich came out, they met, we all chatted for a minute, and then Brian and I found his car so we could go…
Oh the tourist-trappiness. It was nearly overwhelming. Every shop offered kitsch at off-season discounts.
In the mid-nineties, while traveling all over the country at the behest of RR Donnelley's sales people, I'd been to San Francisco with Dirk Samuelson (an RRD employee). We found a shop, somewhere, with some very high quality sweatshirts and I bought a couple for my girlfriend, Corinne. Only recently did those sweatshirts wear out enough to require dumping, so I picked up a couple more. I couldn't find anything quite as nice as the old ones (isn't that always the way?), but I did my best by looking at the offerings of every single store.
Brian picked up some chocolate for his girlfriend (whose name happens to meet Macrobyte's standards, even though he hasn't worked at Macrobyte in many years ;-). Then we dropped our packages at his car and returned to Pier 39 for some pictures of the sea lions and us in front of Alcatraz.
After the pictures, he drove me back to the Marriott and then headed back out of the city.
Brian worked for me at Macrobyte for over a year, and we've been friends for over a decade, but that was only the second time I've met him!
Breakfast at the Garden Terrace again, this time with Patrick Woolsey (Rich Siegel's partner at Bare Bones) and Ciaran Benson (who worked the booth with us all week).
After eating, Patrick and I went down to the hotel's Shipping & Receiving dept. to pick up the t-shirts and schlep them over to the hall. Ciarnan went to the printer to pick up data sheets of BB's products.
Once we were all at the booth, we only had two things to do: collate all the data sheets and media kits, and fold a couple hundred t-shirts. Ciarnan worked on the paper while I folded.
Eventually, I figured out how to fold the shirts so that the Bare Bones logo was centered on the front. I showed Patrick and a volunteer from another booth how to fold them. With three folders we made short work of the pile.
Then I helped Ciarnan finish with the media kits and data sheets, just as hundreds of visitors swarmed the show floor.
Rules of the booth: drink a lot of water, use the Purel (hand sanitizer), and ask everybody if they have a question. Most will say "no," immediately before asking a question.
A bunch of Rich's friends came to the booth toward the end of the day, expecting that Rich would join them for dinner. He had other plans already (see below), but they still hung out at the booth for at least an hour. The bantering was fun.
Someone fussed that BBEdit doesn't support a certain, very simple file type used by Mac programmers. So that night I started throwing a module together, hoping to finish it by the end of the show. Didn't quite get there, but I did have it fully functional by Sunday night. (In fact, it's already in that gentleman's hands and is being beta tested.)
Brent had written to a small group on Monday night about having dinner on Tuesday. In his words, "A post-keynote, post-first-day dinner with a few smart folks sounds like just the thing." Apparently, a typo resulted in my receiving the invitation also, but rather than point it out I simply accepted. ;-)
So, Tuesday night we met at the top of the escalators before walking to the restaurant. Attendees included Brent Simmons, Buzz Andersen, Gus Mueller (his page mentions meeting me, in a funny way), John Gruber, Niall Kennedy, Patrick Woolsey, Paul Kafasis, Rich Siegel, Ted Leung, myself, and possibly one or two others whose names I can't remember (sorry!).
Update: Here is Ted's picture of the dinner.
I don't remember what I ordered, but it was terrible. Yuck. Niall — sitting right next to me — made me very jealous with his gigantic, juicy hamburger. Wah.
After the introductions, we mostly talked about the death of Apple Computer, Inc. (the pundits were right all along!), the new Apple TV, and the iPhone. Most notably, the lack of 3rd party app support on the iPhone, which bit everybody in that group right in the tuckus.
Oh, and I told my...
What John Gruber story? OK, here:
BBEdit 8.6 added support for the Markdown language. (Markdown is like HTML shorthand, basically.)
Writing the Markdown support for BBEdit was very challenging. This is a language that's designed to be processed once, to convert the markdown to HTML. Speed of processing was not a consideration. However, I (that is, BBEdit's Markdown module) need to process at least part of the Markdown content with every keypress, so as to figure out what to color and how to color it.
While John was beta testing the module for us, he had a bunch of very particular bug reports and feature requests. He wanted everything to be just so. It was tiring, but I appreciated it because we needed a lot of testing very quickly.
Then he submitted one last bug report. Apparently, inline links can have titles (which I knew), and those titles are delimited by quotes. Here's an example:
This is some [linked text](<link_url> "link title").
The syntax docs on John's site said that inline link's titles were delimited by double quotes. Markdown.pl, John's implementation of Markdown in perl — the canonical Markdown interpreter — used double quotes to delimit link titles.
John's bug? He pointed out that even though it's not documented, and the interpreter doesn't actually support it, it's (somehow) a bug that BBEdit did not support 'single-quote delimiters' around the link titles.
(I still think it's funny, but I guess I can see why nobody else would.)
I don't remember much about Wednesday except the MacSB dinner, which was a couple blocks from the show.
After walking down there, I almost went into the wrong place. The restaurant I could see had a sign that said "Chaam Cafe," so I assumed I'd been given the wrong name. However, as I drew near I saw another restaurant next door, and the part of the sign I could read said, "t Cafe". I found out Thursday that others actually went into Chaam Cafe, and two of those with whom I spoke enjoyed a Mac-related party with a bunch of people they didn't know, and got a free meal out of it!
I ate with Paul Kafasis of Rogue Amoeba, Jerry Kayne, and Willian Van Hecke from The Omni Group. However, the restaurant was very crowded and I was tired, so I left as soon as I was done eating.
As with every other day on the show floor, we had breakfast at the Marriott. Rich joined us this time, and Agnes (one of the Omelette chefs) recognized him immediately and asked where he's been all week!
"The Fetch guys" sat with us.
Rich was the captain of the developers team for this year's edition of the Macworld game show, which pit the developers against the reporters with trivia questions. Chris Breen was the host.
At the last question — which was actually a challenge, not a question — the teams were tied. The challenge was to send Chris an electronic birthday greeting from their computer (one computer per team), without using email and with the understanding that his laptop was completely off the air.
The solution was to send an SMS message to his cell phone, from iChat. The contact info had been pre-loaded onto both machines, but you had to know how to use iChat with SMS. The reporters tried to use text-to-speech to have their mac deliver the message to Chris vocally, but that answer wasn't accepted. (This really annoyed Andy Inhatko.) Frankly, I think the only reason it wasn't accepted is that it's not the answer they expected. The question should have specified that the solution had to work whether Chris was in the room or 1,000 miles away.
Anyway, the developers won.
My Yojimbo demo was in full swing by this point.
The last couple days of the show mostly blurred together, but I think this is the day that Merlin Mann interviewed Patrick at the booth for about fifteen minutes. You can watch the video, here.
Patrick is about 6' 4" (Update: that said 6' 1" originally. Sorry Patrick. All you little guys look the same!) and weighs a good and very solid 280-290 pounds. Throw in the dark hair, the beard, and the low, rumbly voice and you'll see why I call him Paul Bunyan. :-) Put a knit cap on his head, a plaid, flannel shirt on his shoulders, and an axe in his hand...
Rich wasn't around for most of the day. He spent all day meeting with press people, being interviewed about BBEdit and Yojimbo.
Rich made dinner reservations for us at a Chinese restaurant, Brandy Ho's. I walked all the way (a couple miles) in, which felt great. Man, what a city for people-watching. (Corinne wouldn't have enjoyed the walk quite so much, but as I walked I thought about how much she would have loved seeing all the people.)
In attendance at dinner: Rich, Patrick, Naomi (BB's PR person), Sandy (former BB marketer), Sal Sahogian.
Yeah, that's right. I had dinner with Saul, who you all know. :-D
He told a very funny and very memorable story about his days as a nightclub manager in NYC. No room to retell it here, but the best line was, "Sal, I'm starting to get upset," said in a very quiet voice.
After dinner, Rich joined me for the walk back and we mostly talked shop until we had to split for our separate hotels.
Friday was a blur of exhaustion, sore throats, and Yojimbo-demo-burnout. ;-)
The show ended at 4 PM on Friday instead of 6 like the rest of the week, and most of the hall was rolled up by 4:30!
I couldn't find anybody at the show who was actually selling iPods (how crazy is that?), so after the show I walked to the Apple store to buy one for Corinne. Picked up a 30 GB black (which she seemed to really like when I gave it to her Saturday).
Update: I met Apollo on Friday, for the first time ever. Not sure how I forgot this when I first wrote it up, except that I was tired of writing!
(Apollo is a cyclist from the bay area, who has made some very generous donations to my PMC fundraising efforts in the last couple of years. He also had a horrendous bike accident that nearly ended his cycling for good.)
He works right down the street from the Moscone Center, so he took an extra-long lunch break to meet me and see the show. Rich and I were out wandering the show floor (after a friendly, thirty minute chat with the tm boys). We had stopped to talk to a known BBEdit user who happened to be 6' 6" tall (Rich said he felt like a hyphen between us), when this stranger walked up and said, "You must be Seth Dillingham!" He figured it out based solely on the fact that there were two guys there wearing BBEdit t-shirts, and I was really tall!
The most notable moment for Apollo, though, was clearly when the cute Australian boothbabe stepped in front of him and offered him some information about some product. Let's just say she could have sold him any software... ;-)
Apollo went back to the BB booth with me, experienced The Yojimbo Demo, took a couple pictures, and went back to work. Nice to meet you finally, Apollo!
Bare Bones took us out for a huge steak dinner at Harris' Restaurant. A little too far to walk (I was told), but totally worth whatever it takes to get there. Wow. Second best steak dinner I've ever had, and certainly the best ever at a restaurant. This was a celebratory "family dinner," with Rich and Patrick, Naomi, Ciaran, and myself.
Saturday morning I packed my suitcase and caught a cab. There were five people in line ahead of me for the cab, but they all got on a shuttle.
Took the taxi to Rich's hotel to pick him up, and then to the airport. So far, it was all smooth...
My itinerary said United Airlines, but when I tried to check in with United they told me I was supposed to go to US Air. GRRRRRRRRR. That's in another terminal about 500 miles away. So I said goodbye to Rich and hurried over there (though I had plenty of time).
Check-in took forever because my bag was overweight. This also cost me $50. It took them 20 minutes to print the receipt for that $50. This meant that by the time I got to the security line, I was already pretty frustrated.
Beep! That's me, trying to go through the metal detector.
"Sir, you'd better take off your watch and your belt. If you beep a second time, we have to do a personal inspection." That sounded ominous.
Beep! That's me, trying to go through the same metal detector with a tiny, forgotten pillbox in my pocket. I had to strip down to just shorts and t-shirt and stand in a phone booth which is rigged to detect eplosive residue. After that, the "personal inspection." I had to stand with my arms out the sides, palms up, while they wanded me from head to toe. This is all done right out in the open, of course. For your protection.
I checked my anger. Humiliation is the order of the day when you fly, now. It's the next best thing to security!
On the flight to Philly, I sat next to a Java programmer who was very jealous of how fast my MacBook Pro could wake from sleep (he had a Dell), and an old consultant to the printing industry who knew all about the startup of the RR Donnelley Lancaster West plant (which is where I met Corinne). He even thought he recognized her picture.
Philly to Providence was just a 40 minute flight, and I sat next to a couple who cuddled and made out the entire time. Touched down in Providence just a few minutes early, and walked straight to the baggage claim...
... and right past Corinne, who stood there looking amused. I realized what I'd done just a second too late. ;-) (In my defense, I was expecting her to be waiting for me outside, and I was trying to read the signs to see where my bags would come in.)
Thank you, Bare Bones, for letting me help out at the booth. It was a great week! (And it's even better to be home!)
| August, 2008 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | ||||||
| Mar Sep | ||||||
|
TruerWords
is Seth Dillingham's personal web site. From now on, ending a sentence with a preposition is something up with which I will not put. - WC |