Harrison Farm

for now, the only thing we're growing on this farm is kids - not the goat variety

“Waiting for build to finish” bug in Android Studio and the Custom View Curse

Note: If you are a regular Harrison Farm reader, most of the terminology will probably look like Greek. (From Marathon: “But you’ll probably want to read it for the sake of the italicized portion at the midpoint.” ) If you are a frustrated app developer, this may save you up to 1.5 hours of waiting for Android Studio to restart, not to mention 10 hours of debugging.

Note 2: This bug only happens when one is using a custom view in an XML file. If you don’t even need to use the XML display, the bug shouldn’t hinder you in any way.

One day I was coding along my merry way when I opened up an XML and flipped over to display mode. That was when I was confronted by the message: “Waiting for build to finish…”

What this message even means, I’m not sure. It seems to be referring to the Gradle build, but nothing was building at the moment. I gave it a little time and nothing happened.

I went off on a big, huge rabbit trail which took me through restarting Android Studio ~40 times. I found the culprit XML file, I did some trial-and-error until I found that the problem was in a custom view Java file of mine. So I did some more trial-and-error to find out that the problem didn’t seem to be in my code at all. It was just some mysterious problem with that specific file.

And this brings the story to a sad chapter in my life. After around 3 weeks of trying to defeat this bug, I finally lost momentum and just stopped coding … for about four months. I had tried reverting Android Studio to an older version, I’d tried to modify the compiling scripts, I’d tried learning Kotlin (a Java alternative). So I just gave up. I could’ve asked Carman for help, but I had lost momentum and my sense of motivation.

4 months later, Marathon gave me some encouragement and told me that I would have extra chores until I had solved this bug, and that he was willing to help me any way he could. Sure enough, this gave me the motivation I needed. After about a week, I broke through.

Don’t let your momentum stop. What wouldn’t I give for 4 whole months of (nearly) bugless coding.

 

Next I went through some more trials and errors (this time having to delete and recreate a new file + restarting Android Studio with each trial) until I found the root of all my problems: a simple uninitialized variable.

 

What do I take away from this?

Problems with Android Studio:

  • They didn’t give me a NullPointerException error. They didn’t say anything about my error either in the XML error boxes or during the Gradle build.
  • If you open display mode in only one bad XML file, all others get the same problem: Infinitely “Waiting for build to finish”. The only way to reset this is to restart Android Studio.
  • If you try to display a bad custom view in an XML file and the XML file gets the “Waiting for build to finish” error, that file is forever infected with the “Custom View Curse”, as I call it. Even if you fix the error in the Java code, somehow the XML will always fail on that file forever. In order to rid a custom view Java file of the Custom View Curse you have to… well, you actually can’t. You have to copy the code, delete the file with the Custom View Curse, create a new Java file with the same name, then paste in your old code. The Curse is invisible, as far as I know. It’s probably in the file metadata or something.

Android Studio isn’t perfect. The problem isn’t always you.

The Decency of Ralph Moody

We recently received this nice note as a comment elsewhere in the site. I thought it would be worth sharing as a special post:

What a treat to find this site.

My mother and father were divorced when I was 6yrs old and I lacked a father figure.   At around 7 yrs of age we began reading this and an eight year old boy, along with his own father, filled that hole in my life.    I never cried so hard when Father died and “so long partner” still brings the feeling of loss to my soul.
I’m 65 yrs old now.   In 1982, while reading to my own sons, the longing to tell Mr Moody what he’d meant to my life grew strong enough to attempt to reach him – when I did I found he’d recently past.   I was devastated for having waited too long.   Now I read with my grandchildren.  Also, since retirement I have met dozens of men in the shooting world with whom I shoot and I’ve shared Mr Moody’s series with many of them, their appreciation is great though I can’t imagine the hooks going so deep as they do in my own life.   I consider him a gift and a treasure.   The decency that exudes from every page of his series is a decency I strive for, too often failing, in my own life.   I loved that man and his family without ever knowing them.    John

Workhorses and Angels

Okay, time to brag on the kids some more.

What could be more appropriate to a family, with many limitations and of modest means, than to work on our voices and learn to love singing?

Okay… yes. In theory, it makes perfect sense. But this is 2019, and we are surrounded by shiny screens, self-balancing wheeled gizmos, “People are Awesome” videos, pianos that make “Chanting Monk” sounds, etc.

Isn’t singing … uh … rather pedestrian?

Yes, it is. And it usually requires a kid to be under special circumstances for them to inconvenience themselves enough to work on their voice enough to strengthen it, enough to enjoy their own voice, enough to hear the subtleties of harmony. Certainly being part of a good choir program could do this for a youth. Another possibility would be growing up in a culture of singing as is the case for the religious set.

We mostly lacked those type of advantages, but it seems we’ve been able to cobble together our own inspiration and knowledge to get to the promised land of singing.

We just had our breakthrough moment on the above piece of Christmas music. (I plan to record our next sing of it. We’re happy to send an audio of this out to our friends. New friends, too. You can introduce yourself here.)

It was Milkmaid on the soprano, Rosebud and Sudoku on the alto, myself on the tenor, and Doodle singing bass.

Yes, dear little Doodle is getting to be big Doodle and may be due for a more dignified blog name. His range goes a step below me, and he struggles to hit middle C.

But he is really the main workhorse behind our singing progress. He had to endlessly help me on these tough accidentals in the tenor line (he learned all the parts so as to help the rest of us), and he’s the one who pushes new music on us and is the first to figure out what’s going wrong when we sound bad.

Appreciation also is deserved by Rosebud, who practices singing nearly daily with Doodle. Thanks to their faithful practices, the two weakest voices in the family have nearly become the two strongest. They love to sing now, and it shows.

This morning, during our basketball game, there was a little down time for some reason, and they started singing something quietly together.

Somewhere along the way, they got inspired. I asked Doodle about it and he pointed to two things:

  • One was my stories of singing anywhere and everywhere once I had learned how to harmonize in my late teens (this was one of the early connection points between Milkmaid and I)
  • He says secondarily he’s been inspired by online videos of strong singing and harmony. (See the Mormon performance of “Nearer my God to Thee”.)

So that’s what it took to get our breakthrough moment. We all nailed our parts. We stayed on pitch. As you can see, we ended with “the song which now the angels sing” … and it sounded angelic to me!

Bamboo stalk segments coolness

We have a bamboo stick in our humble home. It’s roughly 7’4″, and we use it to point at the whiteboard when we’re eating supper, discussing chemistry.

We thought it would be fun to measure the ratio between each of the segments’ length and diameter. Here is what we got:



 

As you can see, something very cool is happening to the ratio, which is in the farthest right column. First it’s 0.73, then in the middle it decreases, then it increases again to 0.74. Hopefully we’ll learn the reason for this someday.

Thanks to Quinn Dombrowski for pic.

Wikipedia alert

I am of the opinion that a person capable of being convinced generally only needs a few good hints and pointers, so I’m going to keep this short. If you look to Wikipedia as a source of knowledge, you will want to take an hour or so to follow the trail I lay out here.

We watched the Laura Poitras documentary Risk this past weekend and I was left confused by the end. So I went to Duckduckgo.com and did the following search: “was the Russian government responsible for the DNC hack”.

Below are the top 10 results.

I consider these results to be pretty balanced, but how would I know if the search engine was leaving things out? At least I can tell, just from the headlines, that there are conflicting narratives represented here, and I appreciate DuckDuckGo for that.

Of all these results, I found the content of the Wikipedia article most remarkable, given what I learned from the other links. Below are screenshots of that Wikipedia page shown in the results: (you might find it easier to read the most-recently archived version here, which should be identical to the below since it was archived since the last edit to the Wikipedia page)

And below are, perhaps most crucially, screenshots of the “Talk” page associated with the above article: (you might find it easier to read the most-recently archived version here, but there may be some differences)

Good luck! Seek and ye shall find.

Extra credit assignment: Once you’ve decided on what you feel are the most crucial pieces of information in this story, do your own search on your favorite search engines and see if you are happy with the results.

He thinks I can

By nature, I’m really not a very ambitious person. I’m happy to go along to get along, to do just enough to keep up with what’s average and call it good enough. No need to overdo things, right?

A reverse layup going up…

Then there’s Marathon. He gets kicks from pushing himself. There’s always something new, always something to understand more deeply, some new way of pushing himself.

Marathon also pushes the kids to work hard and go deep…and I get pulled along too, you know, because I don’t want to miss out and get left behind.

But I am getting left behind as they pass me in height, physical, and yes, even mental strength. And that’s okay. It’s wonderful, really.

But I don’t have to get left completely in the dust, especially with Marathon in my corner. Somehow he knows what I’m capable of, and he believes in me more, I think, than I do myself at times.

Case in point: chemistry. We’re started the Khan Academy chemistry course as a household. Ugh. I really thought I would have had to bail out weeks ago, that it would just be too much to tackle with keeping up with the household and with work obligations. But I decided to try to carve out an hour a day and see if I could hang on.

Yesterday we reached the end of a unit, and Marathon went ahead (so like him) and did the unit test. It took him X minutes, and he told me he thought it would take me about double that. Today I took the test. I didn’t rush. It took me exactly the amount of time he had predicted. The test was nine problems — no multiple choice or matching. It wasn’t easy. I got every single one correct! Moles, balanced equations, limiting reagents — this stuff is sticking to me in my mid-40s!

Another case in point of how Marathon seems to know what I can handle — reverse layups. Do you know what that is? It’s a basketball move where a player moves under the basket and as he passes underneath, he reaches up and lays the ball in. It’s backwards from the “normal” layup. All three of our basketball-playing kids love this move.

Well, as you can imagine, as the kids are getting taller, faster, stronger, it’s getting hard for me to keep up on the court. Doodle can shoot threes, Sudoku “moneybags” is dangerous anywhere within 15 feet of the basket if left unattended, and Rosebud’s ball handling can leave even grown men flummoxed. Where is there room for me?

Usually I just help the kids with their basketball quests as needed, stuff like rebounding for someone’s shooting drills. If I’m not needed, I’ll go and hit a tennis ball until someone works up the teams for a game, and then I’ll typically get matched up against Rosebud.

About a month ago, Marathon encouraged me to start working on reverse layups. He thought having that skill would be a way for me to take a greater part in games.

Ugh. Really? Me? Okay, I’ll give it a shot.

So, I’ve been working under the basket on those neck-tiring shots. And, yes, I’ve been getting better and better.

Today was the day I successfully executed a reverse layup in a game. There were cheers all around, from both teams. I think Marathon was more excited than me. It was also special because Carman had come out to play with us this morning, which is quite rare.

Thanks, dear, for believing I can when I’m not so sure.

Thanks to Michael Li for the image.

Notes from Chilean news: marriage, debt, China, Antarctica, guns

According to the recent data released by Chile’s national Institute of vital statistics, we learn the following:

Between 1997 and 2017 the number of women marrying men who are 10 years or more younger than them has increased from 2303 to 2644. This happened in a 20 year period where the annual marriage total declined from 78,077 to 61,320. So the portion of marriages where the women are 10+ years older moved from 2.9% to 4.3% of all marriages.

On the other hand, during that same timeframe, the number of marriages where the man was 10 or more years older declined from 11,611 to 10,662. Compared to the overall decrease in marriage numbers though, this is actually an increase from 14.9% to 17.4%.

My takeaway is that older people are more interested in official marriage while the young are increasingly forming their families without clear intention and therefore without marriage, or much delaying it.

According to Chile’s central bank, household debt as a percentage of disposable income has risen from 62.3% to 73.3% over the four year period from the beginning of 2015 to the beginning of 2019.

Copper is such an important export item for Chile that special statistics are kept of all that is not copper. Thanks to a report by Chile central bank, we learn the following:

Since the free trade agreement between China and Chile in 2006, non-copper exports to China have risen from $1 billion per year to over 6 billion in 2018. During the same period, such exports to Europe remained unchanged and such exports to the US rose about 40%.

The top items are wood, food, wine, and lithium.

According to an article in yesterday’s El Mercurio, the amount of trash being generated in Antarctica has tripled in the last 20 years. 22 different countries relay to Antarctica through Punta Arenas in the south of Chile. Everyone is expected to remove all of their trash off of the continent of Antarctica according to the “Madrid Protocol”, so this means that the government of Chile is able to monitor the total trash production that eventually makes it back to Punta Arenas.

Apparently the protocol negates the use of anything that will result in liquid residue although it is said that Chile hopes to soon switch over to using biodegradable detergent at their outposts, which implies that they aren’t using such now.

Typically the trash comes back around this time of year as night falls on the Antarctic continent. The total was 345 tons of trash this year. But the recent average is running much higher with 632 tons delivered in 2016 and 698 tons in 2017. One reason given for the high numbers in those years was that the Brazilian base burned in February 2012 and then there were works of demolition and reconstruction over the following years.

The trash consists of the usual suspects but also there are oil residues that result from the operation of power generation machinery. These oil residues seem to be transported in large plastic drums.

Apparently the Chilean Navy is doing trips back and forth to Antarctica to serve the needs of the other countries stationed there. They offered the statistic that their ships traveled a total of 34,000 nautical miles and transported a total of 700 persons while performing services during this past season. This duty was performed by three regular ships given that the Chilean Navy recently was forced to retire an icebreaker ship due to its old age.

As of yet, there are no docks in Antarctica, so the Chilean Navy seems to be using ships that are built a lot like barges and include hoists or cranes. So, it seems that the flat bottomed boat is able to get pretty near the shore and then bridge the distance with some sort of swinging arm. They call these ships “skuas” which seems to be a play on the name of an arctic bird.

The article also refers to a fire that took place last year at the “gobernación marítima”. In context it seems to be a reference to some kind of governing authority in Antarctica.

Sebastián PiÅ„era’s administration has announced plans to introduce legislation in the coming week to make ownership of firearms more difficult. It is mostly centered around having a lot more red tape for those wishing to register a firearm. It also seeks to limit people to owning two weapons except by special permission.

Filling a child’s tank

By the time Thursday rolls around I’m having withdrawals. I’m ready to get my weekly toddler fix. For over a year now Sudoku and I have been volunteering weekly at a SANAME orphanage, and we love going. There are some horror SANAME stories that occasionally make the news, but there’s a lot of love to be found at the “lactantes” home where we help. From my point of view, the problems are not with the quality of care, they’re with the system. Children and parents go together. Not children and group homes.

Today one little toddler was unusually fussy. This little girl is a bit moody and can quickly turn from smiles to tears. A couple of weeks ago, I picked her up when she was ornery and was promptly warned by a new worker that the child wanted to be “en brazos” (held) and that she would cry even more when put down.

This wasn’t the first time I’ve heard such warnings. I remember getting comments from well-meaning adults about my own babies. Put them in a sling instead of in the grocery buggy and you hear, “You’ll spoil that child. He’ll never want to be put down.”

Nothing could be further from the truth. Fill a kid up, and they’ll feel secure enough to walk away from you. Did you ever see an 8 year old who wanted to sit on an adult’s lap all day? Of course not! Not even a 4 year old. Not even a tiny toddler, if they know they can get their fill of affection and security when they need it.

So don’t be afraid of spoiling your little ones. If they want to be held, do so with confidence and without feeling guilty. Enjoy that they want to be near you! It won’t last forever…and that’s as it should be.

A data point on temperature reporting

It’s been a hot summer here in Central Chile, but I have had a growing suspicion that it has not been as hot as the numbers reported on my Android phone via Accuweather. So, yesterday, I kept a log of the afternoon temperatures to see how my readings compared with the forecast and with the reported temperatures on my phone.

I did this with a field thermometer that comes from my days as a technician, and I verified, using an ice bath, that the reading was accurate within 1/4 degree Celsius at 0.

I’m comparing this with the reported numbers for Providencia, but I would expect most of the city to be in a very tight range because yesterday was breezy. For what it’s worth, the Android/Accuweather app appears to offer weather reporting that is dialed in to my area. One can see slightly different numbers if you set if for Ñuñoa, for example.

We’re in a very typical area of Providencia.

My thermometer was sitting on a table on an outside porch, in the shade, with the door to the residence closed, thereby blocking any stream of cool air exiting the living area.

Here are my notes:

Forecast: 35C. I felt at 1pm that it won’t go over 32.
2pm – 27C
2:30pm – 28C
4pm – 30C (android says 33 at this time)
430 – 30.5
5pm – 31.5

At 5:30, the temperature began to decline. It never made it to even 32, but my phone was saying 36 around 5:30pm.

I can’t see any way to account for the wide difference between my readings and those of Accuweather.

Three Ralph Moody letters to a young cowgirl

Many thanks to Lisa and my apologies for not getting these up way sooner.




« Older posts

© 2019 Harrison Farm

Theme by Anders NorenUp ↑