My Lockdown Project: Plestacks

Today is day 17 of a four-day lockdown. Lots of extra time on my hands means time to devote to my hobbies. This week I combined two of my hobbies, learning Chinese and web programming, to make a new flashcard app.

If you are learning Chinese, chances are that you’re using an app called “Pleco.” It’s a great dictionary app, really the gold standard of Chinese dictionary apps. And it’s loaded with features like live OCR, animated character drawing, and flashcards. I’ve been a happy user of Pleco for over ten years.

One of my many personality quirks is that I am a collector. The Chinese language, with tens of thousands of unique characters, is a hoarder’s dream nightmare. I have many, many “collections” of words that I’ve come across, and want to remember. When it comes to saving Chinese characters for later reference, I’m like that eccentric person who keeps every newspaper and magazine he’s ever bought, for years and years, cluttering up his house, just in case I want to read them later. Pleco enables this quirk with the function to create custom collections of words that you can review later, using the flashcards app. I have many, many collections.

I diligently organize my collections of Chinese characters, but each collection has hundreds of characters in it. If I use the flashcards function, it can take too long to get through a whole stack. Sometimes I have a few minutes, and want to spend it reviewing some of my collections. With Pleco’s flashcard system, you have to do the whole collection, no matter how many words it contains. It’s too cumbersome.

So I made my own flashcard app, that imports cards made with Pleco, and makes custom stacks of words to review. I call my creation Plestacks.

Plestacks is a web app; you can use it on a phone or a desktop computer. If you don’t use Pleco, then it’s pretty useless for you. I estimate that about seven people in the world will find this useful. However, I am one of those seven people, and in the immortal words of Dr. Frank N. Furter:

This was a fun project. I learned some new database functionality of modern web browsers, and applied some new web programming skills that I’ve been learning. If you’re a learner of Chinese and a user of Pleco, feel free to use Plestacks. You can access the program here: https://plestacks.denniehoopingarner.com/.

A Man’s Past is More Important to Him than his Future

That was a throwaway line in a TV show that I saw a long time ago. I don’t think it was meant to be a profound statement of truth, but it really resonated with me. Because it’s true, to some extent, at least for me. I think about my past quite a bit, especially the bad times. I try to draw lessons from those experiences, insight that will help me do better in the future. But it isn’t easy.

Today is a strange anniversary for me. It’s hard to believe it’s been ten years since I was pushed out of the nest. Ten years ago, I lost a job that I loved, at a place I had planned to stay for the rest of my working life. But the job ended, suddenly and without warning. As a result, I was forced to reevaluate myself, to move in a new direction. I had to to leave my comfort zone and reinvent myself. It was a painful period in my life. But I got through it. I have since moved on, and not only to a different job. In many ways, I have an even more meaningful and fulfilling life now. But of course at the time, I didn’t know how things would work out. At the time, it was devastating.

Having the rug suddenly, unexpectedly, and unceremoniously yanked out from under my feet left a mark. I won’t rehash the unfortunate circumstances that made me leave my job at the university (for context, you can read the open letter that I wrote). It was a life-changing experience. The process of adjusting to my new reality, trying to get back on track, looking for a job, was stressful and frightening. We had a mortgage. Our older son was just about to start college, and our younger son was still in high school. We didn’t know what would happen. We didn’t know if I would be able to get a job that would maintain our lifestyle, if we could keep our house, if we could keep our son in school. As we were trying to move forward through this scary time, my wife cried, more than once, out of worry for our financial stability, for our future. I lost a lot of sleep, too. It was a low point in our lives.

We’re in a good place now, but it took some time and effort to refocus and rebuild. It took some sacrifice, too. I had to take a job that was not nearly as prestigious. But it supported my family, and was a good bridge to my current career.

It’s easy to look to the past, and it can be useful to reflect, but you have to do it the right way.

My past is meaningful to me, but is my past more important than my future? Maybe it can be, but maybe it shouldn’t be. We carry memories of our past with us as we move through life. In that way, our past is always with us. For better, but more often, and too often, for worse. It should be that we use our happy memories, the memories of our successes, to prop ourselves up, make us believe in ourselves. That perfect test score, that time when we made someone smile, the time we won the foot race, the births of our children. Those memories should make us feel confident, give us inspiration and courage to take a chance or to be bold. But it doesn’t always work that way. Sure, the good memories are here, but the bad memories seem to have extra power. Stupid choices that we made, times when we made fools out of ourselves, when we did and said things that we are ashamed of. Those memories can dominate our thoughts, casting shadows of doubt on our confidence, sometimes on our self-esteem. Memories of bad times seem to be more vivid, more prominent. They’re the first things that pop into our minds, especially when we have a setback. Self-doubt and the resulting blow to our self-confidence make us our own worst enemies.

Yes, my past is important, and I try to learn from it. But right now, I choose to make my past less important than my future. A ten-year anniversary is also a good time to look to the future. This year I turned 56. My current career has a mandatory retirement age of 65. In ten years, I will have already retired. That reality might be stressful for some people. To me, it’s liberating. I know that my family will be financially stable after we retire. I don’t have to worry about money. I can focus on how I want to use the remaining time that I have in my career. On the experiences I want to have, on how I can help my coworkers, friends, and the people in the countries where I work. In ten years, when I am retired, I want to look back on the memories that I’m building now with a sense of satisfaction. I want to be lifted up by happy memories, not weighed down by regrets.

Rather than struggling with unhappy memories about the past, I’m focusing on my future. I’m doing everything I can to make my future memories as rich and uplifting as possible. The past is written, it can’t be changed. The future is full of possibilities, and that is where I’m putting my attention. My future is more important to me than my past.

Hunkered Down in Dhaka

Four years ago this month, there was a serious security incident in Dhaka. After that, the Embassy enacted some serious security restrictions on Embassy personnel. It was years before the security officer determined that it was safe for Americans to go outside alone, walk around, go to restaurants, etc. By the time I arrived at post, things were getting back to normal. We still couldn’t walk around alone after dark, there were still no-go areas in the city. But we could do some normal daily tasks like grocery shopping, for example. We found a restaurant where we liked to have weekend brunch. Post even got the go-ahead for officers to bring their young children to post. The international school in Dhaka enjoys a reputation as an excellent school. Things were getting back to “normal.”

Then the worldwide pandemic hit. Suddenly “normal” was thrown out the window. A city-wide curfew shut down the city for weeks. No more eating out at restaurants. They were closed. Many went out of business. The legendarily impossible Dhaka traffic vanished. The city was like a ghost town. The State Department ordered all Embassies to stop all routine visa services, in the interest of safety. The feeling when walking to work in a deserted city was eerie, like a post-apocalyptic scene from a movie.

We went through the excitement of evacuating Americans on seven different repatriation flights, during which more than half of my fellow officers also returned to the United States. After that, those of us who stayed behind hunkered down to wait for things to get better.

And we’re still waiting.

We adjusted our staffing plans so that people only came to work for essential work. Most of us are teleworking. Today I saw one of my coworkers in person for the first time in five weeks. Even in the Consular section, we have a skeleton crew in the office at any time. We are still providing essential U.S. citizen services.

I’m still busy. There’s always work to be done. But I’m sad that I can’t do more of the visa work that I came to Bangladesh to do. We are doing a very small number of mission-critical visas. This week I issued visas to three doctors to work in U.S. hospitals. We’re processing a handful of immigrant visas for spouses of U.S. citizens. Nothing close to the volume that we were doing back in March, though.

Because of the curfews and closures, Dhaka’s already-limited entertainment options have been reduced to almost nothing. We go to work in the morning, go home at night, and sit in our house. Luckily, we have a big house. But even a gilded cage is still a cage. I’ve been spending time on TripAdvisor, planning a vacation that we might not be able to take until next year. Which is still six months away.

We had some fun last week, moving our home office from the smaller unused bedroom to the larger. This room also enjoys better natural light.

Before: a storage room.
After: an airy and bright office. Another desk is coming tomorrow, it will be in the window alcove on the left.

So after that excitement, what’s next? Back to hunkering down.

My Lockdown Project: Resurrecting Audio Recording on the Web

In my previous career in academia, I developed software programs to facilitate language teaching and learning. It was a rewarding job. I loved putting my programs into the hands of teachers and students, and seeing the students benefit from my work.

I found a niche to specialize in: web-based audio recording. Our center’s most popular tool was a simple audio recorder that a teacher could put into any web page. Students used the “audio dropboxes” to submit their speaking homework for the teacher to evaluate.

The technology required the Flash plugin, because plain HTML didn’t have a way to access the computer’s microphone. Flash was THE technology in the early 2000s.  But it didn’t last.  The introduction of the iPhone was the death sentence for Flash.  It probably isn’t an overstatement to say that Steve Jobs killed Flash. Apple made the decision not to support Flash on the iPhone. When mobile started to overtake desktop computers, Flash was in trouble. So was my suite of tools.

Fast-forward several years. Flash is now disabled by default on desktops. I doubt any cell phones support Flash. Adobe recently announced that Flash will officially die (again) at the end of this year. But while Flash was dying, HTML was growing up.  HTML’s capabilities have largely caught up with Flash. The HTML specification has matured so much that it’s possible to do a lot of what Flash had been used for. Including native audio capture.  Even on the iPhone!

Like the rest of the planet on lockdown, I have some extra some time on my hands lately. Because I’m a nerd, I recently decided to see if I could reproduce Flash’s audio capture functions with native HTML. My goal was to be able to capture audio on my iPhone, and then upload the file to a remote server. All in native HTML.  Essentially, I want to reproduce my old Flash-based functionality on an iPhone.

It’s been several years since I did any serious web programming. Javascript has matured and advanced.  My old brain has matured and decayed. Besides refreshing my programming knowledge, I had to learn some new programming protocols before I could dig into the guts of the new WebAudio specification. It all came back to me, though (eventually). After several weeks of work, mostly on evening and weekends, my universal audio recorder is ready for beta testing. I call it the Dencorder, because shut up, it’s mine, and I can call it whatever I want.

The Dencorder, beta release, as it appears on an iPhone. This is 100% HTML, CSS, and Javascript. Even the graphics are generated by Javascript code.

 

The code is as pure and standards-based as I could keep it.  I didn’t use any frameworks or libraries (not even JQuery).  It’s just plain, vanilla HTML, CSS, and Javascript.  On desktop computers and Android devices, this should just work.  If you’re using an Apple device (iPhone or iPad), you will have to make a setting change in Safari to enable the new MediaRecorder function. But once that’s set, the recorder should work fine.   And the whole thing, Javascript code and web page, is all less than 600 lines of code.  I could probably shave another 100 lines off if I were a good programmer.  But I’m not a good programmer, just a clever amateur.

Feel free to play with it.  See if you can break it.  There is an “upload” function, which will put your audio file onto my server.  If you choose to upload your audio file, please don’t record anything naughty.  You can access the Dencorder here:  https://denniehoopingarner.com/audiocontext/recorder/.  I had a lot of fun making this, and to experience how far HTML has come in the last ten years.

I have proof that this was not my fault

Security is a real thing when you’re posted overseas, especially in so-called “high threat” areas. Where we’re living now is a high threat area. Besides garden-variety crime, terrorism is a real concern. That’s why my house has a high wall around it, and why there are guards on duty on the grounds 24/7.

In this scenario, getting locked out of one’s house is a big deal. An obvious corollary is that losing one’s house keys is also a pretty big deal.

When a certain member of my household first arrived at post, she wasn’t quite clear on the whole “lock the doors and carry your keys with you” arrangement. We were on our way home after work one day, and she suddenly realized that she didn’t have the house keys. When she left the house that morning, the housekeeper was still home, so she didn’t think to bring our keys with her. Waiting in our driveway while the post’s security folks drove over with an emergency key, swatting the mosquitos, will not make my Top Ten Highlights of this tour.

This week it was my turn. I felt pretty stupid when I couldn’t find my keys. Luckily, by this time, we each had a set, so we weren’t locked out of our house (THIS TIME). Still, I lost the moral high ground when I had to admit that I couldn’t find my keys. She was pretty cool about it, didn’t lord it over me (too badly). But I was mad at myself for being so irresponsible.

The regional security office wasn’t impressed, either. “Time to change the locks” was the official declaration. So the facilities folks had to come over and change the locks. I got charged for the core change. I suspect that I was also branded as “one of those irresponsible State Department fools.” But at least we each had a set of house keys, and The Bad Guys wouldn’t be able to enter our house.

They say that washing your car is the best way to make it rain. By the same logic, maybe changing the locks is the best way to find your keys.

But this time it wasn’t my fault. She found the keys in the pocket of her pants. Not my pants. Hers. I have proof. And even better, she admits that it wasn’t my fault. Of course she doesn’t quite admit that it’s her fault, but I’ll still count that as a win.

Busted

Me: Blathering on, for a good five minutes, about my favorite pen. It’s a great pen, it’s a perfect pen, I used to import them from Japan because I couldn’t find them in America, and I’m so bummed that they’re not making them anymore, and I’ve been looking for a new favorite kind of pen, but I can’t find one, so I’m really bummed about that…

Co-worker: Were you ever a teacher at some point in your life?

Household Help

Americans in general have an egalitarian mindset. I definitely do, myself. We don’t like the idea of social classes, or even social positions. I think part of our fascination with TV shows like “Downton Abbey” is the strangeness of a clear line between the nobility and the servile class. As a matter of pride, we don’t like hierarchy. For example, I have never called a boss by anything other than their first name (except the Ambassador, of course, but that’s different).

I sometimes wonder if that’s why we in the foreign service call our servants “household help.”

In my first tour, I hired an “auntie” to come to my apartment once a week to do my laundry and mop my floors. I was pretty low-maintenance then, and my apartment was quite small. I didn’t need more than a once-a-week cleaning lady. In my second tour, we lived in a serviced apartment. The building’s cleaning staff came in almost every day to clean the apartment. We did our own laundry and cooking, but again, I’m low maintenance, and in addition, it was easy in that country to go grocery shopping for my own food.

This tour, though, the situation is quite different. Security restrictions limit where we can go. Also, for the first time, I don’t speak the local language. That, and the fact that I don’t understand the local culture, complicates my life quite a bit. But the biggest difference for me is that for the first time in the foreign service, I live in a huge house. I don’t know exactly how big it is, but it has to be at least 2,500 square feet. It wouldn’t be practical for me to do all the work that’s necessary to maintain this house (plus, I don’t want to).

It seems to be common here in Bangladesh to employ servants household help. Even the locally-engaged staff in the Embassy have housekeepers. Many of them have drivers, too. Part of it is because life here is pretty complicated. Another reason is because labor is very cheap in this country.

My housekeeper has been working for Embassy employees for years. I “inherited” her from an officer who left post right after I arrived. She was able to start working for me with only a few weeks of unemployment. Her English is good enough to communicate, she knows all about Americans’ strange lifestyles, and she has been taking great care of me and the house.

She cooks for me whenever I ask her to. Her first day, I asked her to make me something Bangladeshi. I didn’t care what, I told her, but I wanted some vegetables. This is what I came home to:

Plus all of the dishes were washed, plus she set the table for me.

No idea what I ate. There was yellow goop, red goop, and brown goop! And it was delicious!

It’s been working out really great so far. I ask her to buy fruit, and when I come home at night, she’s cut up my fruit and put it in the refrigerator. I suspect she’s started to feel the need to take care of me. Today was the second day in a row that I didn’t ask her to cook anything. Tonight, I came home to see a cooked meal on the stove, and a dozen chocolate cupcakes on my counter. No complaints!

A coworker here told me that Americans pay more for our household help than employees of other Embassies. That might be why so many people want to work for us. Right after I moved in, people were hanging out on the street outside my house, with their CVs in hand, asking if I wanted to hire a driver or a cleaner or a “bearer” (still not sure what that job category means).

My housekeeper seems to have enough work for now. But she only takes care of the inside of the house. I also have a yard. My house came with a gardener. For almost ten years, he’s been working for families that live in this house. So I was expected to hire him too. It’s like he came with the house. I don’t know that I need a full-time gardener, but if I didn’t hire him, the poor guy would be unemployed. He has a wife and kids back home in the village, and Lord knows that with the poverty in this country, they need the money that he sends home. So even though it seems like something I don’t need, I also feel an obligation to provide employment to the guy. So I’ve been keeping him busy planting flowers and vegetables. My yard has a big coconut tree, a banana tree, mango tree, and a jackfruit tree. I actually like jackfruit quite a bit, and I’m looking forward to seeing if I actually get a harvest.

So another weird part of this strange life of mine, is that I now have a household staff. I recently acquired a car. Even though most people hire a driver, I am resisting that for now. I just can’t imagine adding a third person to my payroll, it seems like it would be too much. Actually, it already feels like too much.

I choose to look at this practice of hiring household help as a way to help the local economy. We are paying people more than they could get on the local labor market. Most of these folks are poorly educated and don’t have marketable job skills. We are treating them fairly and honestly. In fact, an Embassy policy requires us to give every household helper a labor contract, pay them a yearly bonus, and give severance pay when we leave post. For a reasonable amount of money, I get time to write blog posts, rather than mop my floors, and pick up coconuts from my lawn. Everyone wins.

Another Country, Another Very Serious Wound

Continuing my proud tradition in the Foreign Service, I managed to reset the Days Without Injuries sign in the office to zero.

One of my new responsibilities is “Accountable Items Officer.” I have to keep our important documents secure. When they are not being used, they have to be locked in a safe. Before you start thinking that I have access to top-secret spy information, I should explain what the items are.  I do not have access to nuclear launch codes (people who know me should be very relieved to know that. The world is a much safer place with that information NOT in my hands), or the keys to Fort Knox.

Rather, the important documents are things like blank visa sheets and the seal that we use to notarize documents. Not exciting material, true, but in the wrong hands, they could do some damage to national (and personal) security. So we have to keep track of those items. That’s my job. My ultra-glamorous task is to open the safe every morning, and hand the visa “foils” to the LE staff to print. Then in the evening, I collect the unused sheets, and lock them up in the safe.

Not 007-level excitement. No one will ever make a spy movie about this task. But it’s important, and I take it seriously. Because I don’t want to get fired, and I want to stay out of jail.

A few days ago, I was doing the morning start-up procedures, and I attempted to open what I am now ironically calling the “safe.” To open the safe, you have to pull a big, heavy ka-chump lever.  One morning,  in my haste to get the door open, I ka-chumped my finger between the handle and the safe. Hence the ironic usage of the word “safe.” Blood and naughty words leaked out.

If I were smart, I would have gone to the med unit at post.  But it’s across the street.  In order to get there, you have to leave the Embassy, risk your life crossing the street, and enter the annex compound.  I figured it wasn’t worth bothering the nice people there, I could patch myself up right in the office.  Being an OSHA-compliant work place, the Consular section does have a first-aid kit.  That dates from World War I, from the looks of it.  And the contents seem to date to the Civil War.  The kit contains a pair of scissors, some gauze, rubbing alcohol, and tape.

My makeshift bandage. This may or may not lead to gangrene and an amputation, which would be 100% my own fault.

No infection so far.  I’d cross my fingers, but I can’t at the moment.