gocart

The Go Kart

Another true story from my childhood, that I call “The Go-Kart”. Enjoy:


I wheeled the Go-kart out from behind the shed. One could be forgiven for thinking it was a dune-buggy with its two rear tractor tires, its heavy-duty metal frame and roll bar. But it wasn’t a dune buggy. It was a go-kart – our go kart. My Uncle Ray had built it for us a few years prior, but it was never completed. In its current state, I suppose, it would be more correct to call it a soap box since it’s motor wasn’t functional. But I prefer to define things by their potential, not by their shortcomings, so I’ll call it a go-kart here. But I digress.

The seat was a single, curvy piece of lime-green fiberglass that was moulded into the shape of a cock-pit. It looked a little bit like a bathtub with a high back and a steering wheel. The steering column was moulded into the fiberglass’ contour, protruding up in the center, so that, when sitting in the driver seat, you would slide your legs into position on either side of it – the right foot on the gas pedal, and the left foot on the brake. Behind the seat, on the frame, was mounted a lawnmower motor.

The front wheels, in contrast to the rear tractor tires, were smaller (about 8”), rounder, and far less grooved. They looked like proper go-kart wheels.

She had been collecting dust underneath the lean-to roof behind our shed for years. Occasionally we would pull it out and push it around for a bit, but it was hard work because of its weight, so it mostly just sat waiting for the day when we had the wherewithal to get it “working”. Today was that day. Today was the day that my friend, Ezra, and I were going to finally take her out for a spin.

It was the summer after grade 7, and we had plenty of free time to tinker with the go kart. We had a goal, which was to “fix” the go kart’s engine, which had never been operational, but the plan was half-baked at best.

Ezra yanked on the engine’s starting cord a few times. It didn’t start, but it sounded like it almost did.

“I think we just need to pull faster. If we pull fast, and then let it go real quick, I think that’ll get it going.”

I gave it a couple of feeble pulls with no success, then Ezra took over again. Ezra was bigger and stronger than me, he was usually assigned these brute-force tasks.

Nothing.

“Check the gas”, Ezra said, “maybe it needs more”.

I found the grease-covered gas cap on the top of the motor and turned it to take a peek inside.

“Is it empty?”, Ezra asked.

“I dunno. Can’t tell. Too dark”.

Just to be sure, I fetched the jerry can from the back of the shed that we used for the lawnmower, and topped up the gas tank.

“That oughta do it.”, I said as I twisted the cap back on then wiped my greasy palms with my jeans pocket.

Ezra dug in with his foot on top of the go kart’s metal frame so that he could pull extra hard, then he gave it a tug.

The engine turned and sputtered a bit as the cord was pulled out, but it refused to add its own force and, like all the times before, just whirred down to a stop again.

“Maybe it needs to have a chain”, I said, pointing at the naked gears of the motor that were clearly intended to link up with the rear axle.

I thought for a minute, while Ezra continued to tug on the starting cord. Where could I find a chain? Hmm… Then it came to me. Our old swing set had chains that were used to connect the swings to the monkey-bar frame. Perhaps I could use that chain to link the gears of the motor and axle.

It took a bit of digging in the garage, but after rummaging through a dozen or so drawers of junk, and screws, and old light switches, I finally found the chain that I was looking for. This chain wasn’t the kind of chain that would typically be used in motors. This chain was more like the ones that they used at Zellers to rope off a closed checkout lane. I recognized that it wasn’t quite right, but I still naively hoped that it could be adapted. MacGyver once made a record player out of an Earring. If he could do that, then there was a chance, even a tiny one, that I could make this chain work.

Ezra took one look at the chain, and said “That’s not going to do it. It’s the wrong kind of chain”.

“I know”, I said, “but….”. I trailed off as I began my futile, and frustrating attempt to fit this square chain onto the round gear.

Ultimately I was forced to concede defeat to my cruel and humorless opponent, also known as reality.

This was a set-back.

We stood there for a moment, trying to think of an alternate solution. We had been planning for today. The goal was to take the kart out for a ride, and we weren’t going to return empty-handed. But without a working motor, there could be no “ride”.

Unless…

“The walkway!”, I said excitedly, referring to the fire lane at the end of the cul-de-sac. If we could push it up to the top of the hill, we could let gravity be our engine. Just let it roll down the hill and hang on tight.

“And it’s closed off to cars, so it would be “safe”, I added.

Small detail, but relevant here: The go-kart, despite having a brake pedal, had no working brakes. “No matter”, we reasoned. “The bottom of the fire lane leveled out and should give us plenty of time to coast to a stop before we hit traffic.”

We discussed all of these safety concerns with sober consideration, and decided unanimously to proceed.

We used our combined might to roll the kart out of the back yard. Ezra walked along side of the driver seat and applied pressure on the steering wheel so that he could steer.. I pushed from the back, both hands on the frame. The first few hundred yards went smoothly because it was mostly level ground.

My house was situated at the “bottom” of our neighborhood. The entrance was at the “top”. By this I mean that if you drive into the neighborhood, the road follows a steady descent in the shape of a wishbone. When you reach the cul-de-sac at the “end” of the neighborhood, you find yourself at the bottom of the hill, and as proof of this, there is a rather dauntingly steep walkway at the end of the cul-de-sac, which leads directly back up-hill to the entrance of the neighborhood. If not for the fallen tree branches littering the path, and its rounded hockey-stick shape, this walkway would have made a fine venue for Olympic ski jumps. There was even a storm drain about three quarters of the way down that made for a perfect jump.

I used to love riding my bike down hills. I would take my hands off the handlebars and hold out my arms like a bird stretching its wings as the force of the wind blew against my body. I was a kite flying in the wind. But I never dared to ride my bike down this walkway. Too steep. Too narrow. Too crazy for my blood. And my bike had brakes.

We rolled the kart to the entrance of the walkway with ease. We were slowed for a moment while we steered around the gate posts, which had presumably been installed to prevent people from taking vehicles onto the walkway. The kart’s steering worked, but it was a little stiff, so it took a couple of attempts to thread the needle, and soon we were cruising again.

To make things fair, Ezra and I switched positions. I took the steering wheel to guide us up the landing, or the “blade” part of the hockey stick shaped run. Once we started rounding the heel, things got far more difficult, and we both had to push from the back to maximize our effective power output. From here on up, every step of the climb would be hard fought. I’m not sure how heavy the go-kart was, but it had to be at least a few hundred pounds. The frame alone was heavier than Ezra and I put together.

We reached the storm drain, and rested the go kart on the ledge that it formed so that we could take a short break and collect ourselves for the remainder of the climb. Beads of sweat were dripping off my brow and down the ridge of my nose. I looked back at the ground that we’d covered, then I looked up at the path ahead, and felt, for a moment, like we were in over our heads. Only a hundred yards to go. Maybe a hundred and fifty. But when every step is a battle, a hundred yards feels like a mile.

Luckily we had nothing else on our schedule for the day, so the length of the climb didn’t matter. If we kept pushing forward, eventually we would get to the top. And we did.

I recall an immense feeling of accomplishment as we approached the top of the path. We reached a second set of gate posts there, but we didn’t have to steer through this time. We carefully performed a 9 point turn with the kart and rolled it to the starting line. This is where we finalized the details.

It was already decided that Ezra would drive. I would stand on the back frame and hold onto the rollbar. We didn’t go immediately as we were exhausted from the climb, and wanted to rest. We also wanted to take in the experience for a while before moving onto the next thing. I suppose we were also a little scared. But what was there to be scared of really?

To recap, there were no brakes. Neither of us had helmets. I don’t recall if there was a seat belt, but if there was it would have been a loose-fitting lap belt. From one perspective, these details demonstrate a clear cause to be scared. But, looking at it another way, it demonstrates that we didn’t consider these things to be important, and thus, we didn’t think there was anything to fear.

We went in with eyes wide open. Before finally deciding to launch, we both took a last look down the path.

“That curve might be tricky”, I said.

“Yeah.”, said Ezra. “I’ll try to take it wide”.

“And watch out for that storm drain”, I warned. “If we hit that, I’ll go flying off the back for sure.”

We laughed for a minute at the ridiculous image of my flying through the air, arms flailing. We made up a few scenarios like the kart flying off the cliff and into the ravine. (Did I mention that the walkway had a cliff on one side with a hundred and fifty foot drop down to a river).

“That would suck”, we both agreed.

“We’d never be able to get it out of there.”

And we laughed some more.

Then things got serious as we prepared ourselves for the final countdown. We backed up the kart as much as we could, then Ezra climbed into the driver seat. I pulled on the back of the frame to prevent a premature start.

“Three, two, one…” I counted down.

“Go!”

I gave it a little push – a very little push as I wanted to make sure I was still able to climb onto the back before it gained too much velocity. It started to roll, so I jumped up onto the frame, and held on for dear life.

There’s a scene in Indiana Jones and the Last Crusade where the Nazi opens the hatch of the army tank just as it is about to roll over a cliff. This was me after about the first twenty feet, so I bailed out. But the kart continued, with Ezra at the helm.

The uncontrolled acceleration I felt in those first few yards had ignited a new fear in me, as I realized that brakes were a good thing. And a lack thereof was a very, very bad thing. I watched from the top of the hill as Ezra swerved from side to side and his momentum increased. The steering was a little tricky, and we’d never tested it at these high speeds before. Perhaps that is why Ezra’s plan to avoid the storm drain and take the curve “wide” didn’t pan out. Or perhaps he thought “what the hell!”, and decided to take the drain head-on. Whatever the reason, he went directly into that jump, and the kart was catapulted 5 feet into the air. I watched for that short eternity as Ezra and the cart sailed through the air.

Amazingly the cart stayed level, and straight. Unfortunately, the path began to curve underneath him, so that the further he flew on his trajectory, the closer he came to the curb.

The run had begun as “Days of Thunder”, but had suddenly morphed into “Top Gun”. Its success hinged on Ezra’s ability to land the aircraft. In slow motion, the harrier jet descended on the runway, inching closer and closer to the edge. And just when it looked like a spectacular crash was inevitable… he landed it! It touched asphalt just inside the curb which served as a sort of roller-coaster rail, guiding the kart around the heel of the hockey stick and into the home stretch. At the moment of touch-down, the universe returned from its suspended animation to a sort of “Three-stooges”-like fast frame mode. (You know, the effect where they speed up the film speed to make it look like the characters are running really fast, and movements become comically jerky). The friction from the tires scraping against the curb caused Ezras head to appear to bobble back and forth, like a small child hanging onto a jack-hammer.

I ran down the hill, screaming “Oh my God!”, and as the go kart started to decelerate on the landing, my fear converted itself into elation.

“That was awesome!”, I yelled. Still running down the hill.

When I reached the bottom, we celebrated briefly, and shared with each other what the view was like from our respective seating positions.

“You got so much air, man!”, I said. “Like 10 feet.”

“Yeah”, said Ezra with an air of new-found experiential wisdom, “I didn’t think I was going to land that”.

“You could have been killed”, I exclaimed, not stating the obvious at all.

I don’t remember who said it, or if it was said out loud at all, but we both heard it.

“Let’s not do that again.”

SSD Upgrade on my Windows Box

I have a Windows 10 box that I used for Windows development. I generally use Microsoft Remote Desktop to remote into it from my main development machine (a Mac Pro). The windows box is running a 6-core AMD FX6300, with 8 gigs of RAM and a 1TB HDD. It is dog slow, but it does the job.

I’m in the process of trying to build CEF (Chromium Embedded Framework) from source. It has been a difficult process on every platform, but I saved Windows to the last. The build instructions are involved, and it takes hours of compiling and downloads before you hit an error message, so it can take some time to get it right. So far I’ve been working on the Windows build for about 2 weeks (!!).

All of my attempts so far have failed with strange errors that even Google doesn’t know what to do with. My next strategy is to try out this docker repo set up for the CefSharp project.

The requirements for building CEF with this are staggaring:

At least 20GB of ram dedicated to this would recommend 30GB total with page file to make sure you don’t run out (older builds like 63 were 32GB with 40GB total). You can have any amount of that 20/30GB as a page file, just beware the less actual ram the much slower linking will be.

My 8gigs of RAM totally would not be up to the task.

Upgrades

So I went on Amazon and bought 16 gigs of RAM, to top my box up to 24 gigs, and I picked up a 1TB SSD. I have long been frustrated by how slow this computer is, and I have the same class of CPU (FX6100) running on UBUNTU and it runs lightning fast. So I’m guessing that the hard drive is the bottleneck.

Physical installation was no problem for both RAM and SSD. All I needed to do was to clone my old HDD onto the new SSD. I thought this was a formality, and surely Windows would have a built-in tool to do this like Mac and Linux do. Boy was I wrong!

Windows doesn’t seem to have a built-in way to clone a drive. You need to download a third party tool. A google search contains many suggestions for such tools, but many were out of date – pointing to software that used to be free, but now is not free.

I added “Open Source” to my search queries to try to find some open source solutions, and found a few – all of which were linux apps, which you were directed to install onto a USB flash drive to boot your computer with.

I created such a boot flash drive with Tux bootloader (which uses CloneZilla), but was unable to get my computer to boot to it. It took a while to get into the BIOS at all as none of the BIOS keys I tried seemed to work. Turned out I needed to connect my PS/2 keyboard in order to access the BIOS – USB keyboard won’t work.

Finally, after a lot of futzing around, I found AOMEI Backupper which seems to clone disks in its free version. It’s running right now as I type, and it had a pretty straight forward interface.

I still find it mind boggling that Windows doesn’t include this functionality with a built-in tool.

IMG_7163 copy

The Advent Calendar

This post is another in my series of personal anecdotes and reflections from my childhood. If you read my blog for my posts about Software development, you can safely disregard this 😉

Christmas is one of the most memorable parts of childhood. There is a sort of lifecycle and growth pattern to the child Christmas experience. The first 3 Christmases you don’t really know what’s going on. You don’t really think about it, or plan for it.. You just wake up one day and find that there are a whole bunch of presents for you. For the fourth Christmas, you’re more aware. At least, I was more aware. That was the year that I started snipping the toys that I wanted out of the Sears Catalog, and started to look forward to the traditions, like watching Rudolph the Red-nosed reindeer when it aired in early December.

The 10 years that seemed to pass between my fourth and fifth Christmas gave me plenty of time to prepare. I decided, this time, not to cut anything out of the Sears catalog so as to preserve its integrity. The snippets I had cut out the year before (of He-man figures, race car track sets, and the C.H.I.P.S. ride-on motorcycle) didn’t fare well, and likely found their way to the garbage prematurely, leaving a completely dysfunctional catalog with everything except the stuff I liked. I would continue this discipline (of NOT cutting up the catalog) for every Christmas thereafter.

In my sixth and seventh Christmases, I began to grasp just how much time elapsed between them. While it still felt like the sixth would never come, when it finally did come I decided that the wait was objectively shorter than it had been for the fifth. And the wait for the seventh, shorter still.

Still, time would seem to seem to stop on Christmas eve. I recall lying in bed, looking out the window at the snow falling through the street lights and trying so hard to to fall asleep because I just wanted Christmas Day to arrive. I imagined that falling asleep was like entering a time machine that would beam me directly to Christmas morning. In entertaining these thoughts, I stumbled into my first ominous glimpse of mortality. if only for a brief moment, I was keenly aware that all would come to pass if I wait. Christmas day would come soon enough, and so too would the next Christmas, and, in fact, all the moments of our lives would surely come and go – both the things we dream, and the things that we dread. It was lying here in bed on Christmas eve, that I first imagined, deep in my mind’s eye, the day that my dad died.
But that wouldn’t happen for a long time. For all intents and purposes, an eternity would pass before I saw that day come. Although these thoughts feel like the distant past to me now, it does not feel like an eternity has passed. But I guess that is the enigma of time. A single moment can last forever, while a lifetime can pass by in what seems like an instant.

Fast forward to 1987. By this time I was a pro at Christmas. I knew exactly when the Sears catalog was expected to arrive in the mail, and when the TV Times came out in the first week of December, I would highlight all of the christmas specials that I didn’t want to miss. I was among the seven grade threes in Mrs. Toth’s three/four split class that year. For those familiar with Peterson Road, our classroom was the end room of the east wing of the school with windows facing north toward the tetherball poles and intermediate playground. The back corner of the classroom was the reading area where we would gather for group activities such as non-silent reading and interactive lessons. In December, this was also the location of a daily ritual where a student would be chosen to open a door in the Advent calendar. This lucky student would get to keep whatever was hidden behind the door. For a grade three, this was a lot of fun. With each door opening, we were a day closer to Christmas. Translating time into this visual format makes it more tractable somehow. I mean to an eight year old, it can be hard to quantify how long 3 weeks is, but it was easy to see that, when only 3 doors remain in the advent calendar, we’re getting really close to Christmas.

Mondays were extra special because the doors for Saturday and Sunday would be opened as well – meaning there were three lucky student helpers on those days; but more importantly, we were three days closer to the big event.

When my turn came, I was hoping secretly that the prize behind my door would be some candy other than chocolate as I was allergic to chocolate. Unfortunately that was not to be. I got a chocolate just like everyone else. I didn’t mention that I couldn’t have it. I just put it in my pocket, and sat back down. I didn’t really mind. I was just happy to have a turn.

I’m sure I’ve participated in the opening of many advent calendars since this one, but none are so memorable for some reason. I’m not sure why that is. It could be because this was my first exposure to the Advent calendar (as far as I recall we didn’t do them in my family). It could be because I was at the peak age for appreciation of such things. The spirit of Christmas is palpable at that age. And I would bask in anticipation for the entire month of December, so anything that fueled that build-up would make an appreciable impression on me. The secret may also lie in aspects that escape my conscious memory, but have embedded themselves into my emotional memory. For example, I think this ritual was combined with other Christmas activities such as reading Christmas stories and poems, like “‘Twas the Night Before Christmas”. Whatever the contributing factors, they have congealed into a perfect snow-globe memory for me.

Thank you, Mrs. Toth for making that Christmas season just a little bit more magical.

Men_at_work_ver2

The Hustler

I was never much for gambling, but there were times when I wanted to be. The movies made it look like so much fun. A popular plot device in 80’s film and television was for the protagonist to win an improbable jackpot on a horse race or card game to usher in a happy ending, against all odds. Maverick comes to mind but there are countless other examples. I even watched a Highway to Heaven episode that featured this device – though it was framed as the power of God putting his thumb on the scales of probability.

As a child, I understood that television wasn’t real, but I still believed that it was a relatively accurate reflection of reality. I understood that there was no actual person named Brett Maverick who won a poker tournament by wishing real hard for an Ace of Spades. But I believed that there were people like Brett Maverick, and that, while pulling the exact card he needed at the climax of the final poker game was improbable, it was still possible.

With this as a backdrop I’d like to share a short story about the time I got hustled by my sister. I was probably 11 years old, which would make her 13. We weren’t avid card players. We would play games like 31 and crazy eights during camping trips, but we didn’t often play at home. And we didn’t often gamble. We were kids, after all, and didn’t have any money of our own to speak of. The few times that we did incorporate gambling into our card play, it would be in the form of buttons from our mom’s spare buttons bag. (E.g. I’ll see your button, and I’ll raise you two buttons).

For whatever reason, this one time, we started playing card games for real money. I must have had a few dollars that I earned from allowance or doing chores. I don’t remember exactly what the game was. It wasn’t poker. It was probably 31. We started out betting for small change. I lost. She offered “double or nothing”, and I agreed.

As the losses mounted, I started to feel the temperature in my ears and head rising, and I began to worry that I had lost more money than I could comfortably afford.

“Do you want me to loan you more money to bet?”, she asked, after I was out of money.

Of course! I needed to win my money back. So she loaned me more money. And I lost again.

At this point I was in way over my head. Not only had I lost all of my money, but I now was in dept to her for substantial amounts of money. I don’t recall dollar amounts, but I remember thinking that it was so much money that I would never be able to pay off the debt.

There had to be a way out. I wished I had never started this foolish game. If only I could return to the moment just before we started betting. I decided to take my case before the court of “Mom”.

“Mom”, I said, “We’re not supposed to be gambling at all. So Erin should have to give me my money back, right?”

“No”, she said. “If you agreed to it, you have to pay it. This will be a good lesson to you about gambling.”

I’m sure there was some back and forth on this – as I surely would have attempted all angles to get this debt cancelled. But effectively, my appeal was denied. My debts would not be cancelled – at least not by this judge.

It all seemed hopeless, until my merciful sister offered me a way out.

“Steven, I’ll give you another chance to win your money back, with one more bet”, she offered.

“What’s the bet”?, I asked, skeptical – but frankly full of naive hope that this could be the stroke of luck that changed my fortunes.

“I’ll bet you that Charlie Sheen and Emilio Estevez are brothers”, she replied.

Now, before I go on, please understand that in 1989/1990, Wikipedia wasn’t a thing. Also understand, that in my world, brothers always had the same last name. I mean, do the math. Brothers with the same dad (I clarified that they had the same dad before proceeding into the bet) should have the same last name, right? Right??

Having done the math in my head, I said “You’re on!”

And for about 2 seconds, I was sure that I had managed to climb out from under this mountain of debt. Then:

“You’re wrong. They’re brothers.”, she said.

“No they’re not!”, I said.

Eventually this went to the panel (my Dad), who confirmed that Emilio Estevez and Charlie Sheen were, in fact, brothers.

I’m sure that I accepted this decision with a Trumpian display of grace and class.

There’s a silver lining to this tragedy, however. The following year, “Men at Work”, starring Emilio Estevez and Charlie Sheen, was released, which gave me ample opportunity to share this fun piece of movie trivia.

“They’re brothers, you know”, I would say to anyone who would listen.

The Fight

Normally I use my blog to write about software development, but I’ve decided to branch out a bit with this entry. In order to help my fading memory, I’ve decided to try write about small episodes that I can still remember from my life so that I can “record” them for later.

The ones that are suitable for public consumption, I may post on my blog.

So the first instalment of this follows:


The Fight

Everyone loves a good fight. Or at least all men enjoy a good fight. Or, at the very least, all boys love a good fight. So when word spreads that two boys are going to get into a fight at lunch time in grade 7, everyone marks it on the calendar.
I don’t recall the reason for the fight, but it didn’t really matter. All that mattered was that Trevor and Kris were going to have a fight at lunch time. Real fights were a very rare and precious thing. Of course, we were all experienced “play” fighters, but that was different than a real fight. The fact that we had never had a “real” fight at school didn’t didn’t feel like a fact at all. Television had provided us with vicarious memories of countless “real” fights, so I felt like I was a veteran at this fight-watching game.

At 5 foot 10, Kris was the tallest boy in my grade, but not particularly stocky. Trevor was more typical in height. Frankly I don’t remember what a typical height was for a boy in grade 7. I know Kris’ height because he was the tallest. I was 4’11”, which I remember because I was, well, me. And because I was one of the shortest boys in my grade consistently up to that point. I even had the honor of holding the class placard during class photos a few times. So when I say that Trevor was a typical height for a boy that age, I would guess he must have been between 5’2” and 5’6”.

Given the height difference, the smart money was on Kris winning the fight. There was no talk about what the rules were. At least that I can remember. Fight rules were considered self-evident to a 12 year old boy. We imagined that the fight would be over when one of the boys was knocked down or started crying, or “tapped” out. Having grown up with a steady diet of Rocky, I didn’t imagine a “knock-out” was a real possibility. Despite my Dad’s insistence that no human being could withstand the kind of punches that Rocky took by the dozen – I preferred to believe the humans could take 15 rounds of heavy-weight level punches to the face and walk away with only a few bruises.

The morning of the fight, every boy in Ms. Rempel’s grade 7 class was looking up at the clock more frequently than usual. We were counting down the seconds to the 12 o’clock lunch bell so that we could attend the highly anticipated “fight”. Finally, the bell rang so we could get our lunches from the cloak room. Only 15 more minutes… we had to eat our lunches inside the classroom. The 12:15 bell signaled that it was time to go outside to fight… er.. play.

As I mentioned before, this was the first scheduled fight that had ever happened at Peterson Road, so there was no protocol in place. No agreed upon time or place. Only an agreement that it would happen. The first 10 minutes of lunch were spent wandering around the field with everyone asking each other if they knew when or where it was happening. Pairs of us roamed the field, then merged with other pairs and continued roaming as a group until most of the grade 7 (male) student body was roaming the field together. We settled on a venue near the back of the field. Somewhere sufficiently remote that the school supervisors wouldn’t notice what was going down. At some point the group fanned out into a circle to give the combatants a makeshift ring inside which they could safely “fight”. For a good long while, though, Trevor and Kris just stood there at the perimeter of the ring, both acting shy, as if this were an elementary school dance where the boys and girls just stood on opposite sides of the gym – too shy to ask anyone on the other side to dance. At least that’s what our elementary school dances looked like, but I digress..

At some point someone, probably John, said “so is there gonna be a fight or what?”. John was always good at frank ice-breakers. Trevor slowly approached his taller opponent and wound up with a punch

Truth be told, this happened nearly 30 years ago, so I can’t provide an accurate blow by blow. I do remember that each boy landed at least one punch, and the consensus was that Trevor had fared much better than we expected – and in fact may have even won the fight. It was not a stellar display of martial arts skills. It resembled a hockey fight, where both players spend most of the fight all tied up in their own jerseys. Neither fighter had any ground game, which would have come in handy once it morphed into a wrestling match with Trevor and Kris rolling around on the grass.

Unfortunately, our fighting circle was not as inconspicuous as we had hoped. It only took a minute or two for the noon hour supervisors to descend on us and stop it. Trevor and Kris were pried apart. No big bruises. No blood. Both had red faces partly from the exertion, and partly from having taken a blow or two to the face.

After Kris and Trevor were led on a perp walk to the office, some of the rest of us were summoned to principal Swoboda’s office as well.

Now, in my recollection, there were between 5 and 10 of us in the principal’s office, waiting for him. In retrospect, that number doesn’t jive with my earlier image that the “entire male grade 7 student body” was attending the fight, as there were about 30 boys in my grade. I can think of a few explanations for this discrepancy, but in any case, there were 5 or 10 of us in the principal’s office. I remember specifically Steve (the other Steve), John, Ezra ,and Quinn, but there were others.

Mr. Swoboda, always a busy guy, burst through the door and sat down at his desk.

“Do you know why you’re here?”, he asked, rhetorically.

We all looked around at each other – knowing that it wasn’t wise to volunteer to become the spokesperson for this group. “You’re here because, if not for you, this fight would never have happened. The people who watch a fight are just as much, or more, of a problem than the fighters themselves.”

He then began to address each of us individually. Asking questions like “do you think it’s smart to be encouraging your friends to fight” etc…

When he came to me, he asked. “And you! I’m surprised to see you here. What do you have to say for yourself?”

My response: “I guess I fell into peer pressure”.

New Mobile Theme for Xataface

During my two week “vacation” from Codename One, I’ve been madly working on a new project using Xataface. For this project, I really needed the mobile interface to be smooth, so I decided to finally make Xataface’s core theme responsive. Along the way, I also made numerous improvements to the flow of the UI especially in relation to sorting and filtering results. Before I go into detail about the new features, here are some screenshots of my app, which uses this new mobile theme.

The new login screen is much cleaner and mobile friendly.
The new login screen is much cleaner and mobile friendly.
The mobile registration form - fields generated based on the fields in the users table.
The mobile registration form – fields generated based on the fields in the users table.
The list view for the "News Feed" table.
The list view for the “News Feed” table.

Screen Shot 2020-08-30 at 7.21.34 AM

Let me unpack that above screenshot of the list view to highlight the various aspects you can see here.

  1. The “tables” menu is rendered along the bottom of the screen as tabs.Table tabs
  2. Sorting and filtering buttons are rendered at the top of the list. Sort and filter buttons When you scroll down the page, these buttons are converted into floating buttons: Floating sort and filter buttons
  3. Notice the Floating Action Button in the lower right for adding new records. Floating Action Button. By default this shows the “New” and “Delete” actions, but you can add your own actions to this menu using the “table_actions_menu” category.
  4. Notice that action icons below each row. These are rendered from the “list_row_actions” category. List row actions

Sorting

Clicking on the “Sort” button displays a sheet with the various options available for sorting.The sort dialog. You can select which columns should be sortable in the fields.ini file using the new sortable directive.

Filtering

Clicking on the “Filter” button displays a sheet with the various options available for filtering.

Screen Shot 2020-08-30 at 7.40.27 AM

This filter dialog is “live”. The button at the bottom that says “Show 977 Results” will dynamically update as you enter your query so that you can see how many results there will be.

Optional Search Header

On some tables you may want the header to be a “search” field. This can be achieved using the the new fieilds.inii “search_field_header” directive, as demonstrated in this table:

Search Header

New/Edit Record Forms

Forms are Xataface’s bread and butter, so they need to be very mobile friendly. I’ve completely revamped the stylesheet to be responsive so that forms are a pleasure to use on the smaller displays.

New Record Form

I’ve also added a new feature to help reduce clutter on forms. You can now make field groups “hidden” by default. Hidden field groups are collapsed into buttons that are rendered at the bottom of the form:

Fieldgroups menu

The user can display a hidden field group by clicking on the corresponding icon. E.g. In the example form shown above, the user might want to edit the “narration”. They can do so by clicking on the “Narration” icon at the bottom of the form, which will reveal the narration-related fields.

Narration field group

More to Come

This is just a quick post to share some of the work. There are tons of new features that I didn’t cover here. I’ll be blogging more about them soon.

I’ve been slowly assembling a “definitive” guide for Xataface. You can see the current version (in progress) at https://shannah.github.io/xataface-manual/

After I’ve ported all of the existing documentation into this manual, I’ll be using it as the basis for a new website. There is lots of new stuff in the pipe for Xataface, so stay tuned.

Things I Like #1: The Retroist

For 2019, I’ve decided to start blogging about things I like. For my first entry, I’d like to share “The Retroist Podcast”, and associated media. The Retroist podcast is devoted to pop-culture from the late 70’s to early 90’s mostly. Each episode is about 20 minutes long, and covers a single topic, such as a TV series, a movie, a video game, a fad, or some other relevant bit of culture from yesteryear. The episode archive goes back as far as 2009 and is quite comprehensive. At this point, he’s already covered just about every prominent (and obscure) TV series, movie, and video game from 1980 to 2000.

When I first discovered this series, about 6 months ago, I binged on it, listening the the ones that covered all of my favourite TV shows. I started with the Night Court episode because it was the one that I happened to stumble upon first. The episode was full of interesting facts about the series, but it was the introduction/opening anecdote that made me take notice. He connected Night Court to his own personal memories of the time, sharing anecdotes about how Harry Anderson’s comedic brand of magic sparked his imagination as a child. While it only lasted a few minutes, it briefly transported me back to my childhood when I would sometimes tune into Night Court late at night (when I was watching TV after my bed time). His story-telling style is calm, fluent and descriptive.

I went on to binge on the extensive library of past episodes, listening to all of my favourites. Another “thing I like” is going for walks around town while listening to podcasts, so this podcast fit right in with my schedule.

Every episode follows the same structure. He opens with a short introduction and anecdote with a personal connection to the topic. These are always my favourite parts. He follows this with an “info-packed episode” full of facts and trivia bits. Most of the episode just the Retroist talking, but most episodes include a segment by another contributor (e.g. Vic Sage’s “Also-ran” segment that lists the ‘other’ movies or TV shows that were running at the same time as the episode’s subject), and some even include an interview with someone affiliated with the subject.

I’m fairly well versed in 80’s and 90’s pop culture – especially TV and Movies of that era; but I’m not in the same league as the Retroist. This guy is uniquely qualified to run a podcast like this, as his commitment (particularly to TV) is truly next level. He has a personal library of old TV recordings on VHS, that must take up a room or 5 in his house. His episodes’ commercial breaks are used for airing old toy commercials and the like. In one of his episodes he shares that he once informed his coach that he wouldn’t be able to attend Saturday morning practices because he had to watch Saturday morning cartoons. He also likes to watch edited-for-TV versions of some movies (e.g. Halloween), even preferring them to their theatrical release. I had never heard of this before, but apparently this is a thing.

He typically releases one new episode per month. I’m sure he must be running into some difficulty thinking of topics by now since he’s covered just about everything I can think of already. Browse the archive – it’s all there.

When I was a kid, I used to listen to Jack Cullen’s “Network Replay” late at night on CKNW. It used to play old radio shows from before the TV era. I think it would be really cool if some network would pick up the Retroist and let him host a similar thing with his extensive library – providing some context and background for each movie or TV show that he airs. He really has a knack for painting a dreamy, nostalgic picture of the context surrounding all things retro.

It is worth noting that the Retroist also has a website where he and contributors post stories about 80’s and 90’s pop-culture. It is pretty active, with a new post every few days. He is also on Facebook and Twitter.

JAXB Hell on JDK 9+

JAXB has been removed from JavaSE starting in JDK 9, so we’ve had to make some changes to some of our code to work around this. We have some custom ANT tasks that use JAXB to process some XML. The task it used inside an ANT script using the <taskdef> tag as follows:

<taskdef name="myCustomTask" 
    classname="com.example.tasks.MyCustomTask" 
    classpath="MyCustomTask.jar"/>

Then laster the task us run using syntax like:

<myCustomTask />

If you try to run these ANT tasks on JDK 9 or higher, you just get a big ClassNotFound error when it tries to load the JAXB classes. So the obvious solution is to bundle the JAXB classes into our jar. This, however, only solves part of the problem. This will, indeed, allow the task to load, but when we try to run the task, it says

javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.

Which is strange because we have the API (jaxb-api.jar) and implementation (jaxb-impl.jar, jaxb-core.jar, activation.jar) embedded inside our MyCustomTask.jar file, which should be available on the classpath.

After banging my head against this problem for a few hours, I discovered that the problem is the way which JAXB looks for the implementation. It uses the threads classloader for searching for an implementation, rather than the classloader for our task. When running inside an ANT task, this will be the root classpath for Ant, and not the classpath for my custom ant task.

For example, we have some code like:

JAXBContext componentContext = JAXBContext.newInstance(ComponentEntry.class);

This will fail to find the JAXB implementation (unless we included the JAXB jars in Ant’s classpath – which is not portable in our case, because ANT will usually be run inside an IDE like Netbeans).

I ultimately worked around this problem by wrapping all of my JAXB code inside my own spawned thread. E.g.

private String processFileWithJAXB(final File xmlFile, final boolean full) throws JAXBException {
        final JAXBException[] error = new JAXBException[1];
        final String[] result = new String[1];

        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    result[0] = processFileWithJAXBInternal(xmlFile, full);
                } catch (JAXBException ex) {
                    error[0] = ex;
                }
            }

        });
        ClassLoader cl = getClass().getClassLoader();
        t.setContextClassLoader(getClass().getClassLoader());
        t.start();

        try {
            t.join();
        } catch (InterruptedException ex) {
            Logger.getLogger(MyClass.class.getName()).log(Level.SEVERE, null, ex);
        }
        if (error[0] != null) {
            throw new JAXBException(error[0]);
        }
        return result[0];
    }

In this example, all of my JAXB stuff is inside the processFileWithJAXBInternal() method. The processFileWithJAXB method creates a thread, sets its context classloader to the current classes class loader, and runs it. And magically, it can find my bundled JAXB implementation.

Posting in my blog to help my memory as I’m bound to run into this issue again.

PSA: Prefer to use AdoptOpenJDK’s jdk-11 builds for embedding in Mac Apps

If you are planning to distribute a Java app on Mac, you should avoid using the JDK builds from jdk.java.net as they won’t necessarily work on Mac OS older than 10.13. This is because the libjvm.dylib is build with MACOSX_MIN_VERSION set to 10.13. This doesn’t necessarily cause a problem until you try to run a signed app on Yosemite or older (10.10). Your app just won’t open. Checking the logs you’ll receive an error like:

​Error: dl failure on line 542
Error: failed /Applications/MyApplication.app/Contents/Java/jre//lib/server/libjvm.dylib, because dlopen(/Applications/MyApplication.app/Contents/Java/jre//lib/server/libjvm.dylib, 10): no suitable image found.  Did find:
    /Applications/MyApplication.app/Contents/Java/jre//lib/server/libjvm.dylib: code signature invalid for '/Applications/MyApplication.app/Contents/Java/jre//lib/server/libjvm.dylib'

Now, you might be fine if you’re building the app on 10.10 or older, but not sure. This particular issue is a combination of:

  1. libjvm.dylib set with a min version of 10.13.
  2. codesign on 10.11 and higher automatically signs libs targeting 10.11 and higher with a different signature than is can be understood by gatekeeper pre 10.11.
  3. Gatekeeper barfing when it hits this signature.

So, If you’re building (signing) your app on the latest Mac OS and you want to be able to distribute it to older versions of OS X, you need to make sure that all of your libraries are built with the MACOSX_MIN_VERSION set to 10.10 or lower.

You can verify this using otool. Inside the standard openjdk build on jdk.net, you can go into the Contents/Home/lib directory, and run:

$ otool -l  */libjvm.dylib | grep VERSION -A 5 | grep version
  version 10.13
  version 0.0

(Note: libjvm.dylib is the only problematic one. All the other dylibs are built with 10.8 min version).

However, if you download the build from AdoptOpenJDK, and do the same thing, you’ll find

$ otool -l  */libjvm.dylib | grep VERSION -A 5 | grep version
  version 10.8
  version 0.0

Just another reason to use AdoptOpenJDK for your Java distro.

iTunes DRM Begone!

My storage room is filled with boxes of CD jewel cases with all of the music I purchased before the digital revolution. At a certain point, it just became easier to just buy music digitally. In fact, In many cases I repurchased music digitally because I didn’t want to be bothered digging through boxes to find my CD version. Unfortunately, much of that music was purchased on iTunes, and Apple frequently decides to not let me listen to the music I purchased from them.

Let me illustrate by recounting my Tuesday experience.

It was the first snow of the year, so I decided to do some coding in my front room so I could look out the front window and enjoy the view. One last thing to make the moment perfect: Music.

So I open up iTunes and browse through my library until I find a song. I press “play” on the song, only to be greeted by a login dialog. I enter my apple ID and password and it informs me that I have already authorized 5 out of 5 computers for listening to this song. Well, that’s inconvenient. I have no idea which computers I have authorized, so, after some Google searching, it seems I need to deauthorize all of my computers. I log into my apple account and find the button I need to click to deauthorize all my computers, then I start again.

I return to the song that I want to play, and am greeted with a login dialog again. This time, after typing in my password, it informs me that I have authorized 1 out of 5 computers for this song. And then… nothing happens.

So I click the song again. It again pops up with login dialog, so I enter my username and password again. And…. nothing happens.

Rinse and repeat a few times – each time accompanying the login with louder and more creative profanity. Log out of iTunes. Log in….

Still cannot play this song. For the love of God! This was just supposed to be ambiance, and now it has derailed my day.

I go and try to play the song on my other computer where it used to work.. And, of course, it no longer works because of the deauthorization I initiated a few steps before. But I have now authorized the song on two computers – whatever that means – it obviously doesn’t mean I can play the songs.

Then a small breakthrough. I notice that one of the login dialogs is prompting me to sign in with my old university email address (which I amalgamated into my new email address about 8 years ago). When I logged in with that old address, it required me to again authorize it. But that appears to be under a different accounting system than my new address, because it insisted that the song had been authorized on 5 of 5 computers.

So I follow the same deauthorization procedure with my old address and start again.

I go back to the song and try to play it. I fill in the login dialog (with my old email address), and it informs me that I have authorized one out of 5 computers. And then…. it plays!

Yay! Clearly this is some computer glitch in Apple’s system with respect to my email addresses. The old address was supposed to cease existence when I switched it those many years ago. And it appears to be linked in some ways (e.g. It works with the new password that I set on my new address recently — so the password is linked), but my music authorization doesn’t work.

So problem solved right?

Actually, now, for some reason, I need to log in to play every single song I’ve ever purchased from Apple. One might think I just need to login once, and everything would work. But no, I need to login each time I want to play a song. In many cases I need to use my old email address to play the some. In some cases I need to use my new address, and in another bunch of cases, I still can’t play the song at all.

I’ve spent time with Apple support in the past (years ago), and never really found a solution. Since this is just ambiance, I’m reluctant to waste a day going through those steps again.

All I can do is:

  1. Never purchase another digital product from Apple again. It’s too risky.
  2. Find the CD copy in my storage room, and rip that onto my computer.

One funny thing about this incident, is that when time came to vent to my wife later, it turned out that she had a similar experience that same day where 2 songs had just been “removed” from her library for no apparent reason (songs she had purchased!!). They’re gone. Hmmm

Ramblings about Xataface, Java, and other software development issues