Looking for writing-related posts? Check out my new writing blog, www.larrykollar.com!

Saturday, September 28, 2019 No comments

At last… breaking in our new old camper

Beats camping in a tent, says my 60 year old back.
Not quite everything came together last weekend, but good enough: Mason had fall break, I finally got a plate for the Starflyer, we have M.O. the B.B. (Massive Overkill, the Big Butt, aka The Boy’s moving truck)—and most important, we got a brief break in the constant 90F+ weather. Time to go camping, dangit!

There were a couple of maintenance items I wanted to deal with on the Starflyer before we left, so I opened it up in the driveway Thursday evening. I poked at things, and Mason figured since we had it set up, we might as well sleep in it.

Why not? Of course, that meant Charlie would be sleeping with us, but he thinks the camper is really fun to hang out in. So that’s what we did Friday night.

I’m not ready to go to sleep just yet!
I was worried about Charlie’s sleeping arrangements—he’s a flip-flopper in bed—but then I looked under the dining table. A little experimenting found that two of the seatback cushions fit perfectly in the space where the table (usually) goes, and a crib sheet fits perfectly over them. I put the table outside, and had Charlie’s sleep cave set up in no time.

Of course, when Mason got in bed (back-side bunk), Charlie decided that was the perfect place for him to sack out as well. Mason protested, but Charlie didn’t give him too much hassle and both the boys were asleep before too long. I scooped up Charlie and put him in his sleep cave, adding a cushion at his feet in case he decided to migrate. He woke up in the 3 a.m. hour, which isn’t unusual, but I understood his motivation. The low that night was around 58F, and there’s not a furnace in the camper, and one blanket wasn’t sufficient. Charlie likes his feet cold, but not that cold. I put him in bed with me, made sure he was covered, and tried to warm his feet up. He pulled up close until he got slightly warm, then rolled away.

Saturday morning rolled around, and Mason was itching to get on the ROAD. I had a similar itch, but knew there were a couple things I needed to take care of first. One was easier than expected, one was close to estimated effort, and one was beyond ridiculous.

The easy one turned out to be the weatherstrip under the front (large) bunk. It's basically a plastic angle bracket, and all but about 6 inches had detached and was laying loose. The previous owner just stuffed 2" A/C foam in the gap and called it good. At first, I thought I might have to push the bunk in a couple feet, lay on the floor, and staple it up—instead, pushing it in about a foot was enough to kneel on a cushion and do the job.

Next up was the sink faucet. Starcraft cut too much wood out of the countertop for the faucet, leaving the screws in the back trying to grab air. Someone came up with the “clever” idea of turning it backwards, allowing the hand pump to function… but with any torque in the opposite direction, the faucet lifted off the countertop. My clever idea was to use longer screws, because there was some wood for them to bite into down below, but it didn’t work. My solution was to replace the wood screws with long machine screws, using a washer and nut to hold it in place. It worked! Longer-term, I’m going to replace that countertop.

The hard one was the tires. They want 80PSI(!), and my air compressor had a cracked hose. Try as I might, I could not get more than 50PSI into the tires. Fortunately, I was trying this part on Friday evening, so I knew I needed to get a new air hose on Saturday. But then I had to find a connector that the air chucks would snap into, and find an air chuck that would actually push air into the tires. Fortunately, I had them here at the manor. The spare needs to be replaced, because it has cracks in the sidewalls, but the primary tires were fine and I was only going 40 miles.

Time for the main event! I backed M.O. the B.B. into position. A few years ago, I was coming home from work and found a drawbar with a 3-1/2" drop on the road… with a 2" ball, which just happens to be the Starflyer’s size. In a way, someone’s loss was part of what got me serious about finding a camper. I really need a 6" drop drawbar with this behemoth, but it got us there and back.

Now let me tell you about M.O. the B.B. Earlier this year, The Boy needed a truck to pull the 26' moving trailers he was using for his new business. Due to a number of circumstances, mostly having to do with my employer getting acquired, I had a large pool of cash in a brokerage account. I figured that (assuming the business worked out) I could get a better return on investing in Let’s Get Movin’ than any CD and most stocks. So we bought him this gigantic TPC: a Ram 3500 diesel dualie. I’m not exactly sure what the tow capacity is on this thing, but it’s measured in tons. The Starflyer’s empty weight is 1700 pounds, and I would have to pack lots of junk to get it to a single ton.

The other thing: I had hoped The Boy would come with us on this trip. I had planned to give him and Mason the big bunk up front, and I’d go to the back of the camper. It would have been worth it.

But I digress. As expected, the truck was going “Trailer? I’m pulling a trailer? Really?” all the way to the campground, LOL. The dualie’s big butt is wider than the 7-foot camper; so I knew if I could see stripes in the side-view mirrors, the Starflyer was on the road. It inspired confidence… which evaporated as soon as I tried to back into the site we selected. I need lots of practice backing a trailer. This was something I was hoping The Boy would help me learn. But I figure he was having a good laugh at my expense, as Mason kept going “You’re about to hit the TREE!” and similar sentiments. Eventually, I got it backed in, detached, and we got set up. I had a leveler and extreme-heavy-duty extension cord, but neither were needed. There was some drama associated with the water hookup, most of which was debris in the threads, but I think a new washer will fix it. The A/C was less easy to deal with: it spun up, but I didn’t feel any air coming out the vents (cold or otherwise). After about 15 minutes, it shut down and would not start again. I think something froze up and blew a fuse.

Otherwise, I think the spot I selected was perfect: right across from the bath house (the Starflyer has a Porta-Potti, but that’s for late-night needs), almost across from the playground, and a short walk to the lake. Of course, the lakeside sites were occupied, but we had plenty of space. Mason spent a lot of time fishing (no luck) and meeting other kids more or less his age (better luck). I cooked meals, rode my bike around a little, and had some quality time with my Kindle. If you’ve never been camping, and have kids, you’re missing out on a huge opportunity. The kids take off, and leave you with lots of quiet time. I remember this from the camping trips we took when I was a kid… thankfully, some things don’t change.

Sunday had us going to Newnan for Zoey’s birthday party. That ran longer than I expected (and Mason hoped), but we still had lots of fun and I let Mason stay up late to compensate. He rode his bike around the dark campground until 10:30 or so, then he was ready to pack it in for the night.

Breakfast, anyone?
Each morning. I used the inside stove to heat water for my French press, and poured the excess into a pump pot for washing and the like. For everything else, I have this three-burner Coleman white-gas stove that the father in law gave me. It must be close to 50 years old, at a minimum. I replaced the pump seals a year or two ago, and there was still pressure in the tank when I opened it Saturday morning to add fuel! Bacon and eggs in the morning… breakfast of champions.

As expected, Mason made himself scarce for the breaking-camp part on Monday morning, despite me telling him we had a pretty tight schedule (I had a work call at noon). I got him to chuck a couple things into the truck, but that was about it. Fortunately, I had planned for that. I got camp broke down, and we got on the road in good order.

The big question now is: how soon can we get out again? The way things are going this year, we should have good camping opportunities (weather-wise) well into November and maybe later.

Sunday, August 18, 2019 2 comments

All the boys

I found this after the fact: Mikel, Mason, and Charlie, all in one pic. It was from last December, when he came up to spend Christmas with us. This is one of the few shots I have of all three of my boys in one place… and almost certainly the latest.

The boys hanging out

Gotta love the Pocahontas pillowcase that I gave Mikel that night!

Friday, August 16, 2019 5 comments

The Boy takes the exit

This is one of the hardest things I’ve ever had to write: The Boy has begun his longest journey. A permanent TB01. You-know-what this.

A walking Father's Day card;
My oldest and youngest;
The last pic I have of us together.

Mikel lived for 31 years and change. We might think of that as a short lifespan nowadays, but he lived more in those 31 years than do some who get three times that. Even on the day he was born, he wasn’t messing around. At age 5 minutes, he launched himself right out of my arms—fortunately straight at the pediatrician. (That inspired the birth scene in Pickups and Pestilence, of course.) On the way to the hospital room, I noticed how he was watching everything.

He never let up, really. He said his first words at 9 months: “ite” (light), “da-dahhhh” (me), “uht-ohhh,” and by 18 months he was speaking in complete sentences. He was also climbing before he was walking. He hated barriers—and would always try to figure out a way to get around, over or through—but loved the challenge.

And man, did he ever tackle the physical challenges. By age 4, he thought nothing of being 30 feet up in a tree. I used to joke that he was born with a No Fear sticker in his hand. At a birthday party back then, a bunch of boys were climbing a tall pine tree in the host’s front yard. A 12 year old shouted “Get out of the way!” at Mikel, as he was climbing up. “No!” Mikel retorted, and scrambled even higher. The older boy started after him, then looked down… and back at Mikel, continuing to gain height, back down, back up (he was still climbing)… and decided he was going to sit this one out. Fortunately, early on I taught him that whatever he got up, he could get back down. That probably saved me a few heart attacks, and one or two calls to the fire department.

Intellectual challenges were tougher. He and his mom (and Mason) love to butt heads, and they went at it with gusto in his teen years. But in the end, those are emotional challenges. Part of his many problems, that I chronicled in the early years of this blog, likely were because Sector 706 doesn’t exactly abound with intellectual challenges. I don’t have to repeat those years here; you can go check out the archives if you want all the gory details.

I believe the turning point was his two years in Manitowoc. When I went to see him in 2012, it was obvious things had turned out the way I had hoped they would. He had become the adult of the house, perhaps because he no longer had the old safety net to rely on. It also helped that he finally made a permanent break with Snippet (who wasn’t and isn’t an evil person, it’s just that Mason is about the only good thing to come out of that relationship). Wednesday, my sister in law said that she noticed how happy I was during the time I spent on the east side of Lake Michigan after I got off the ferry.

Some time after, he returned to Planet Georgia, and it wasn’t long before he met his wife to be. They got married, and I keep laughing every time I re-read the phrase “we smelled like dead water buffaloes by the end of the evening.” August on Planet Georgia is not the time to spend hours outside.

Actually, it would be best if one could sleep the entire month away. Like the song doesn’t quite say, August in Georgia is just no place to be.

But I digress.

The marriage was fitting for Mikel: another challenge, but one they both overcame in the end. We have Zoey (aka Grandkid #2), and (like Charlie) she adores Mason. Good people, and I won’t let anyone diss my daughter in law. BTW, Daughter Dearest has Grandkid #3 on the way…


Last year was the beginning of the end. In prehistoric times (aka before I started blogging), Mikel became diabetic at 16, and he wasn’t happy about it (is anyone?). I can still remember that day he kept going down, and going down, and I finally made an executive decision to take him to the ER. I had to help him walk into the hospital, and that wasn’t easy because he was a heavy kid back then. Turns out I’d not helped things by giving him sports drinks to fix his dehydration symptoms—his glucose level measured around 1600 (normal is below 100)… so his blood was basically fruit punch. His survival was touch and go, but once again he overcame the challenge. One of the funnier things I remember about that whole ordeal was the presentation the hospital put on. I don’t know if Mikel paid attention or not; I just remember a black girl a couple of rows up turning around to check him out. A lot. (She was cute, but I think Mikel was too busy trying not to pay attention to anything to notice. I hope she’s doing OK, whoever and wherever she is today.)

But again, I digress.

In the last year or so, Mikel finally found his purpose. He got a job with Hewes Family Movers, and was soon a crew chief. I need to call this guy and thank him. He encouraged Mikel to start his own moving company, Let’s Get Movin’. We helped him get a truck—and he was by-God paying us back for it. Mr. Hewes would loan him trailers if he needed them, and Mikel was working on getting one or two trailers of his own. That didn’t come to pass, which might have been for the best under these circumstances. But it was obvious to us that Mikel had finally found his niche in life. He not only had an occupation that didn't keep him in one place, he was THE BOSS. We had planned to set up his website in the next few weeks…

Mikel’s pancreas did him in, in the end. In the last year or so, he started having seizures. The seizures got really bad last November, and he spent Thanksgiving in the hospital. That’s when my wife and his really got together and made sure he was getting the care he needed. His short term memory got clobbered, even worse than mine, in the end. The neurologist told them Mikel would probably not survive another one. And then…


Lately, Mikel had been coming up to FAR Manor a lot to visit us. I don’t know if part of him knew what was coming, and who cares if it’s important? The fact was, he was around. He and I got to hang out mostly on weekends, and he and his mom got to hang out on weekdays. When the engine in Sizzle’s truck lunched out, and they found a motor somewhat north of Nashville, he and Daughter Dearest took a road trip to pick it up.

He made a point of telling us he loved us—one could say it was redundant, because his presence made that clear, but it’s always good to say it. We had been talking about things we were going to do in the upcoming months: he had costumes for all of us picked out for the Ren Faire (he as a barbarian, daughter in law a wood elf, me as a mage, and Mason a hobbit). In turn, I planned a trip to a campground/microbrewery/disc golf course in North Carolina next summer, and even talked about a Big Road Trip to Montana (my dad did that for a few summers to fish). Mikel said he always wanted to go out West to try snowboarding. Obviously, none of that will happen exactly as planned. But I want to at least do some of those outings in his honor.

It was a hard thing to tell Mason about it. Mikel had called his mom Thursday night, telling us he was going to go to Zoey’s orientation, then come up. So we all had expected him to be at FAR Manor Friday evening… but he never woke up. Mason took the news very silently, but cried later that night. The wife laid down with him after dropping a restless Charlie off with me.

There’s a lot of him in Mason—especially the intelligence, and the love of butting heads—and maybe there are at least some token intellectual challenges for Mason nowadays. Mason has the head for numbers that might have skipped Mikel (the way visual art skipped me), and he fortunately hasn’t started to put on weight the way his dad and aunt did.

Tonight, or maybe tomorrow night, I’m going out to the graveyard with a lawn chair and a couple of beers. I’ll have one, and give him the other one. I’m not sure what I’ll tell him, but I know he’ll hear it. He probably has a busy schedule right now: helping the wife’s mom in the garden in the mornings, fishing with my dad in the evenings, and snowboarding and disc golfing in the afternoons. Then at night, he jams with the Heavenly Choir. I hope he tells Johnny Cash how much I appreciated his music during the breaks. God willing, I’ll have 20–30 years before I join him.

Tuesday, July 02, 2019 5 comments

Tech Tuesday: Y'all Watch This

While we were cleaning up the house, a Casio wristwatch turned up. Sizzle didn’t claim it, and I had never seen it before. Mason thought he might like to have it, once it had a battery in it. It has an analog face with a small LCD display, not terribly geeky-looking. I’m used to Casio watches having a tiny keypad and a zillion functions.

So I got out the little tools and the magnifying light, and popped the back off. There was the battery, but the number (16xx) was a new one, and there was a small metal clip holding it down. Not seeing an obvious way to get it off, I did what anyone does these days: Googled for instructions. The watch is a Wave Ceptor, and the first thing that popped up is “this watch has a solar panel and a rechargeable battery.” It was a bright sunshiny day, so I put it back together and stuck it in the window. Sure enough, after a few hours, the little display coughed to life, showing what I thought at first was t  1.

We get signal.
Having no idea what to do next, I headed back to Google to find a manual. That’s when I found out you need only set the timezone and the watch does the rest, using a long wave receiver at night to download the time from WWVB (if using a North American timezone). The link has all the gory details, but WWVB transmits time data at a blazing 1 bit per second (actually, it's a tri-state, with values of 0, 1, or marker—does that make it a trit?). The watch tries receiving at the top of each hour from midnight to 4 a.m.

Just for grins, I watched it the other night. Sure enough, it showed its “receiving” display at 1 a.m., made a small adjustment, and moved on.

The other thing I found out was that the first display I saw wasn’t a lowercase T, it was 土 (an abbreviation for Saturday in Japan). The watch’s epoch (first time) is January 1, 2000. It also has a “Y2.1K” problem, in that its year doesn’t go past 2099. If it’s still around then, I guess one of Mason’s kids will have it.

So once again, Casio made a geeky watch—but this time, they hid the geekiness on and under the face. Oh, and it does have a stopwatch, alarms, and a “world time” mode (uses the little LCD to show the time in a second timezone). It has a light, but the hands and numbers are phosphorescent, so you can at least see what time it is in the dark without using the battery. Putting it in a sunny window for half an hour is more than enough to keep it running another day.

So we tried to put it on Mason, and his wrist is too skinny for a large-face watch like this one. I’d been wearing an iFitness watch for a while, but it often misses steps and has lately developed a habit of trying to pop out of the band (I lost it for over a week that way). It has a decent sleep monitor, and my phone does a better job of counting steps, so now I wear it at night and the Wave Ceptor during the day.

Thursday, June 27, 2019 2 comments

Adventures of a #techcomm Geek: A Cautionary Tale of an Acquisition

Pull up a chair, young’uns. Today, I bring you a tale from a time when years started with a 1. It was a technologically backward time, before email had yet to completely replace paper memos and USENET or BBSes were how most people “went online.” But the technology we had, we used well. It didn’t require LinkedIn to help empty out an office when things went to #3||.

The 80s were in our rearview, although its music lives on to this day, and the corporate merger and acquisition binge was starting to cool off. Still, buying and selling is the lifeblood of a corporation, and sometimes what they sell is pieces of themselves. So, on to this particular place. None of the players are around anymore, so let’s call it Don’t Care Anymore (DCA). It was a “coulda been” company—I’ve worked at a couple of them. DCA, with some vision and luck, coulda been Cisco. The founder held the (now expired) patent for statistical multiplexing, and they did good business building and selling serial port multiplexers. (Remember, this was a technologically backward time, when some people still had serial terminals on their desks).

But even then, Ethernet was beginning to worm its way out of the server rooms and developer offices, and into the office as a whole. There were competing networking technologies, most notably Token Ring (mainly in IBM shops), and Ethernet at the time required relatively expensive coaxial cable. Many companies still thought serial terminals connected to a VAX or IBM mainframe were adequate; some had PCs for word processing and spreadsheet software (“Lotus 1-2-3,” look it up, kiddies), but the PCs still had a serial connection. You see, networking applications like email, file sharing, and (for forward-looking companies) USENET were things that ran on mainframes.

There were some good ideas going on—the serial concentrators got an Ethernet card, and DCA bought a company making a T-1 transceiver (basically a really high-speed modem that could carry data, voice calls, or any combination). The developers were also working on what amounted to an Internet router. Had executive management given it more focus, things might have been different… but what they called “networking” was only one part of the company, and the execs considered it the unimportant (if original) part. They were focused on selling a hardware/software combo that allowed a PC to emulate an IBM3270 terminal. It was an amazingly high-margin product for the PC market, and the execs had little headspace for anything up-and-coming (despite handwriting on the wall, like a declining market for IBM mainframes and chipsets that would slash the cost of the hardware component to nearly nothing).

So, the execs found a buyer, and sold the networking division to another company. Let’s call that outfit Really-Moronic (R-M), for reasons that shall soon become obvious. Long story short: there was a lot of goodwill on our part, because we felt like we were actually wanted, and they threw it down a rathole.

You see, DCA had a pretty decent benefits package. The Boy and Daughter Dearest were both born when I worked there. Wife-unit was working as well, and her benefits were on par with mine. The upshot was, “childbirth” was covered at 80% for each of us. So one package picked up 80% of the bills, and the other got 80% of the remaining 20%… which meant a $10,000 hospital bill became $400 out of pocket.

It was a good thing we had our kids before the acquisition. R-M’s healthcare package, compared to DCA’s, was terrible. I ran the numbers, and it amounted to a 7% pay cut. It didn’t help that R-M’s VP of HR (are we choking on the acronyms yet?) both misled and outright lied to us about the benefits:

  • We got yearly bonuses at DCA. When asked about that, he replied “Sure, I get a bonus.” He neglected to mention that only management got bonuses. Deliberately misleading. So on top of the 7% pay cut on the healthcare front, we lost a bonus averaging another 7% per year.
  • Asked about the healthcare package, he replied “it’s comparable to yours.” An outright lie, unless he meant “our package looks terrible by comparison,” or management had a better package.
  • They moved our office to Dunwoody, claiming it was a more central location—another lie, they chose the office to avoid building out a computer room. One of the things people liked about DCA was that exurbia had little traffic. It was an easy commute. People moved nearby to take advantage of low(er) housing costs. Dunwoody added a good half-hour or more to the commute time, each way. We shared a high-rise with a couple other companies, including AT&T. Ma Bell’s kids were really nice people, who invited us to their company BBQs and the like. Having good corporate neighbors took some of the edge off the relocation, but certainly not enough to make up for the increased commute time.

The benefits disparity had to come up during the due diligence that any company has to do when they’re buying another company (or a large part of one). Did R-M think that people would just shrug and take a pay cut on top of the overt disrespect, especially the highly-talented engineers and support staff who do the magic that makes a tech company profitable? Did they really believe that skills aren’t transferable? Or were they so arrogant that they thought it wouldn’t matter?


A round of layoffs hit. One manager, told he had to cut one person in his department, laid himself off. After that, no layoffs were needed; the talent started draining out the door. R-M made a few half-hearted efforts to stem the outflow, paying out a token one-time bonus and hiking the raises to cover some of the difference in the benefits packages. But we were still taking a significant pay cut for a longer commute, and word got back that the new owners considered us “losers and whiners.” That, as you might imagine, did nothing positive on the goodwill front.

Our boss was the first of the documentation department to depart. The new boss was several hours away (by plane), which meant we mostly managed our own affairs. We became Resume Central for the rest of the office, in between our own job hunts and departures. After a few months of searching, I hooked up with a reputable contract house and spent about a year bouncing around from place to place. R-M sank like a stone, and nobody remembers them. Ironically, the parent company retooled and is an important customer of the place I work at now. DCA also disappeared, bought by a competitor who did a better job of understanding the changing landscape.

Moral of the story: employees aren't stupid. They recognize a significant pay cut when it happens, and they recognize a lack of respect. Combine that with a robust tech job market, and you might find money you spent on that big acquisition going down the drain… and taking you (and your CEO’s reputation) with it.

Sunday, May 19, 2019 1 comment

Fixing supper

The local Kroger recently set up a refrigerated kiosk with “Home Chef” meals. These are boxed meals with two servings, running $17-$20 per box depending on what’s in the box. I’ve seriously been considering setting something up with Hello Fresh, or any of the myriad other players in this space, so I picked up a box to see how things would go. It featured (boneless) pork chops, mashed potatoes, and snap peas. Sounded pretty good, anyway.

Saturday evening, I got the box out and got to work. Now I had expected everything to be mostly ready to go—sure, I’d have to fire up the oven and what-not—but reality smacked me over the head with a raw pork chop. What was in the box was: raw ingredients, and a recipe. I had to string the pea pods, cut up two whole potatoes, put the breading on the pork chops, and cook the sauce. So what this amounted to was, a box of raw ingredients and a recipe card. The card said this was “intermediate” difficulty (gee, that would have been nice to put on the outside of the box), but I didn’t have any trouble putting it together. My technical writer (a/k/a work) side pointed out where the recipe sequence could be improved. The recipe did say to add some stuff like olive oil, salt, and pepper. I substituted NoSalt for the salt, and nothing turned weird colors or exploded.

Except that midway through cooking the potatoes (that I had to dice up myself), I realized I’d forgotten the second spud. In an inspired moment of panic, I cut up Tater#2 and threw it in the microwave for 3 minutes, then chucked it in the pot with the other one. This was the first time in my entire life that I made mashed potatoes from scratch, and in the end it was okay.

So was the rest of it. It actually turned out to be a pretty pleasant meal; we had our dinners, and Charlie sat between us and deconstructed a liverwurst sandwich. (Hey, if he eats the meat before the bread, fine.) The wife isn’t a big fan of snap peas, but Mason will have a side dish when he comes home (he went home with The Boy tonight). She also pointed out that russet taters are white, and you need to peel white potatoes (red potatoes are fine if you include the peels). The recipe card said “cut up the potatoes,” and the picture showed the peels still on, so that’s how I went. I thought the cream sauce that the chops floated on did a fine job of mitigating that bitter taste that comes with russet peels, but what the package provided wasn’t enough to cover them.

The upside is, the recipe card provides the ingredients list… so I can do this again, and improve on things instead of buying the box. Maybe I’ll double the recipe so there’s four servings (which would cover Mason plus some leftovers for work), and double-double the sauce/gravy recipe. Substitute red potatoes for the russets, or peel the russets.

Anyway… if this is what pre-packaged meals offer, I don’t see a lot of value. In the end, I might just mosey over to Publix instead. They provide recipes for meals like this, and give you the list for all the stuff you need (some of which you may already have). No pretense, and (especially) no markup for what amounts to packaging. But it was a valuable experience. Now I know what to do with Panko breadcrumbs, I can smash potatoes with the best of 'em, and maybe I’ll substitute a carrots/onions combo for the snap peas if I make this again. I’m sure it will end up with a lot less sodium than the original.

In the end: three stars. The food was fine, but doing some of the prep work would have been nice. I’m certain the value proposition is heavily weighted in favor of buying the ingredients individually.

What I really need to do is go back to my single days: plan out the meals for the week, figure out what I don’t have, then shop accordingly.

Thursday, May 16, 2019 No comments

Adventures of a #techcomm Geek: Sharp Edges when Rounding

One of the advantages of using a text-based markup grammer for documentation—these days, often XHTML or some other XML, but could be Markdown, Restructured Text, Asciidoc, or even old-sK001 typesetting languages like troff or TeX—is that they’re easy to manipulate with scripts.

There are quite a few general-purpose scripting languages that do a fine job of hunting down and acting on patterns. I’m conversant with Perl, and am learning Python; but when I need to bang something out in a hurry and XML is (mostly) not involved, Awk is how I hammer my nails. Some wags joke Awk is short for “awkward,” and it can be for those who are used to procedural programming. Anyone exposed to event-based programming—where the program or script reacts to incoming events—will find it much more familiar. Actually, “awk” is the initials of the three people who invented it: Aho, Weinberger, Kernighan (yes, that Brian Kernighan, he who also co-invented the C language and was a major player on the team that invented Unix).

Instead of events, Awk reacts to patterns. A pattern can be a plain string, a variable value, a regular expression, or combinations. Other cool things about Awk:
  • Variables have whichever type is most appropriate to the current operation. For example, your script might read the string “12.345,” assign it to x, then you can use a statement like print x + 4 and you’ll get 16.345.
  • The language reference (at least for the original Awk) fits comfortably in a manpage, running just over 3 pages when printed. Even the 2nd edition “official” reference is only 7 pages long.
  • It’s a required feature in most modern Unix specifications. That means you’ll always have some version of Awk on an operating system that has some pretensions to be “Unix-like” unless it’s a stripped, embedded system. On the other hand, even BusyBox-based systems include a version of Awk. Basically, that means Awk is everywhere except maybe your phone. Maybe.
If your operating system is that Microsoft thing, you can download a version of Awk for it. If you install the ISH app, you can even have it on an iPhone.

Now what am I going to do with it?

Okay. I told you all that to tell you this.

I’m working on something that extracts text from a PDF file, and formats it according to rules that use information such as margin, indent, and font. It requires an intermediate step that transforms the PDF into a simple (but very large) XML file, marking pages, blocks, lines, and individual characters.

“But wait a minute!” you say. “I thought Awk only worked on text files. How does it parse XML?”

Like many useful utilities first released in the 1970s, Awk has been enhanced, rewritten, re-implemented from scratch, extended, and yet it still resembles its ancestral beginnings. The GNU version of Awk (commonly referred to as gawk) has an extensions library and extensions for the most commonly-processed textual formats, including CSV (still beta) and XML. In fact, the XML extension is important enough that gawk has a special incantation called xmlgawk that automatically loads the XML extension.

The neat thing about xmlgawk, at least the default way of using it, is that it has a very Awk-like way of parsing XML files—it provides patterns for matching beginnings of elements, character data, and ends of elements (and a lot more). This is basically a SAX parser. If you don’t need to keep the entire XML file in memory, it’s a very efficient way to work with XML files.

So. In most cases, I only need the left margin of a block (paragraph). Sometimes, I need the lowest extent of that block as well, to throw out headers and footers. I need to check the difference between the first and second line (horizontally), and possibly act upon it.

In the document I used for testing, list items (like bullets) have a first line indent of –18 points. “Cool,” I said. “I can use that to flag list items.”

All well and good, except that it only worked about 10% of the time. I started inserting debugging strings, trying to figure out what was going on, and bloating the output beyond usefulness. Finally, I decided to print the actual difference between the first and second lines in a paragraph, which should have been zero. What I found told me what the problem was.

    diff=1.24003e-18

In other words, the difference (between integer and floating point numbers) was so miniscule as to matter only to a computer. Thus, instead of doing a direct comparison, I took the difference and compared that to a number large enough to notice but small enough to ignore—1/10000 point.

And hey presto! The script behaved the way it should!

It’s a good thing I’ve been doing this at home—that means I can soon share it with you. Ironically, it turns out that we might need it at the workplace, which gives me a guilt-free opportunity to beta-test it.

LinkWithin

Related Posts Plugin for WordPress, Blogger...