Journal

Acadia National Park Trip Recap

Reading Time: 3 minutes

Recently I had a family trip to Acadia National Park. It was an interesting journey, especially in the mist of Covid 19 pandemic.

We first made a stop at Portland, ME since many friends and co-workers have stopped there for the summer. It’s a small city with a Key West vibe. We stopped at the old port as people recommended, and took an afternoon walk along the shops near the bay. There were several lovely pottery shops, but we weren’t such big fans of pottery. It was a specially hot day, so it’s interesting to see shops with blowers running. If you can’t tell by now, I live in Florida for a long time. Air conditioner is standard in Florida, so it’s strange in my mind to not have A/C in the summer. My son loves rocks and there was a gem shop with colorful rocks. We bought a few bottles of small gems, and he was quite happy. Some of the restaurants were busy, and we couldn’t find a table until late at night, so we stopped at a smaller one just to get a bite. I would say the highlight of the afternoon is the ice cream shop with mocha and tiramisu.

Official trip to Acadia began the next day. Only noticeable thing on the highway is that I had two incident of people driving off the road almost immediately in front of me. I just never seen it in the many years of driving in Florida. People hit each other’s cars, but they don’t just drive off the road. Maybe Maine have different driving regulations, or many people in Maine have special training to avoid cars, by driving off of the highway.

Once we get to the hotel, the staff were extra nice, recommend us the sites at the national park, and offered to print vehicle pass since I didn’t have any. It was tough to get the non-operational wifi to work, but the helpful staff made it sufferable.

Acadia National Park is as expected for any national park in the peak season. There were a lot of people. I rarely see that many people in the U.S. outside of large cities. The Sand Beach was especially bad since there was miles of one way road, and the only way you can find parking is to loop back after driving 30 minutes. Otherwise it’s about equal time to walk after finding parking. Because the daytime entrance window is only 30 minutes from the booking time, I had to really try hard to get through the area. I don’t remember much since I just dropped off my family and never stayed the beach.

Cadillac summit road was interesting to drive on. The only comparison I have is driving on Smoky mountain roads in the Carolinas. Unless you are used to the mountain roads, speed limit is your friend. It’s not like the road is extra narrow, but the feeling of imminent cliff diving made it more challenging for my shaking legs. Anyway, the glacial rocks were extra fun to walking/hiking on once we got to the peak of the mountain. You can almost walk anywhere on the peak. Around half of the rocks were covered by trees, so most of the peak is surprisingly accessible by walking. Large groups of flies was sort of annoying if you have kids. And although it’s rarely sunny near the peak, extra sun screen is recommended. I had sun burn with regular amount of sun block.

One extra note is that most people around our hotel wore masks, but the visitor to the national park most choose to not wear one. I had one feeling that’s because local population were older than the visitors. But it could also be the local culture is much more acceptable for wearing masks.

Overall, it was a fun relaxing trip. We probably had way too much lobster, even though we are not such fan of that much protein.

AI, Journal

Inspired by Github Copilot and What Makes a Good Programmer

Reading Time: < 1 minute

Recently Github starting to send out invites for Copilot. It’s a AI assisted code generator for several different languages. For python, it will generate efficient code according to docstring the programmer wrote. For other languages, it will infer from the function declaration. I tested on Leetcode, and the time and space complexity is quite good. Although it struggle with some of the hardest tasks, it’s fulfills the promise it claims to do.

Should you use it though? The way the model is trained, it uses docstring and public available code. There is the obvious licensing issues. Can you use someone’s code, if they did not explicitly state it’s open source, even if it’s a public repository. There have been cases already discovered that have personal info in the comments of code, or in the embedded HTML. That makes people think twice about using it if they might sued later.

Another point is should you use it even if it’s legal. For now, it only generate a single function. I haven’t seen it write a complete class or generate scripts with folder structure. When the program gets more complicated, a lot of the higher CS concepts like cohesion, coupling, and usage of design patterns are more import than writing an efficient function. Therefore, I would put this as a tool for beginner to learn programming than an actual tool for advanced programmer to deploy. I have been learning and debating about when to use object oriented programming and when to use functional programming. I found the following resources to be helpful. For now, I’m still in the camp of learning better structure than blindly using Copilot to generate programs.

#ArjanCodes channel on Youtube: https://www.youtube.com/watch?v=ZsvftkbbrR0&list=PLC0nd42SBTaNuP4iB4L6SJlMaHE71FG6N&index=7

Python 3 Objecte Oriented Programming (book): https://www.packtpub.com/product/python-3-object-oriented-programming-third-edition/9781789615852

Misc

People just like to watch

Reading Time: < 1 minute

I was watching a youtube video of how to make bonzai today. And I was think about how to make my own bonzai better. And I felt that it’s just too much work to make it better. I’m content with just having it the way it is now. I realized that I don’t enjoy shaping up my bonzai, not even owning the bonzai is that attractive for me. I probably just want to watch other people making bonzai and want nothing to do with myself. I’m perfect happy with just watching.

I don’t think it’s a unique feeling, because there are so many channels on Youtube about watching other people playing games. Heck, the whole sports industry is watching other people play a game.

So I decided, maybe I will just make videos about me making programming projects. One, I actually like to build project with code. Two, other people might not want to spend the time coding, but enjoy other people building a project.

So look forward to my video, talking about a computer programming projects I will make.

Journal

Solving problems in practice

Reading Time: < 1 minute

Several weeks ago, I was watching a Vox video on Covid-19 vaccine distribution. The story was about how rich countries were first in line to get vaccines because they made individual deals with the pharmaceutical companies to invest in research, to guarantee they receive the first batch of vaccines. There was an organization formed for many countries to chip in, so the poor countries can also get vaccines. But the way it worked out is that rich countries both contributed to the organization and made deals with pharmaceuticals companies, since they have the money, so they still end up being first in line for vaccines.

The video ended by wondering why it didn’t work, but fall short to indicate that human behavior is the reason that the original plan didn’t work. When working with any human-generated data, we are required to look at how that data was generated. Sometimes, people approach the data from an objective approach and ignored the human factor. But for many years, humans have greed and desires. An there often isn’t a more deep explanation than, “I want that because I can”. People like to seek reason and wish there is an logical explanation, but we can more often approach from the angle that sometimes people do things for no reason.

Journal

Extend the free space on LVM

Reading Time: < 1 minute

I had to reinstall my ubuntu 20.04 server because a boot issue became impossible to fix. After installing the OS, I found that df -lh only give me about 200 GB of space. I had more hard drive. With a little search around, I found that the disk is mounted, but I meant to extended to be more flexible. I just want all the space there.

This post gave a pretty good description of the problem and what to do, but here is commands I used specifically. This post showed how to extend all the free space, without specifying the exact amount of space.

sudo vgs

  VG        #PV #LV #SN Attr   VSize  VFree
  ubuntu-vg   1   1   0 wz--n- <2.73t 2.53t

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

  Size of logical volume ubuntu-vg/ubuntu-lv changed from <2.15 TiB (563200 extents) to <2.73 TiB (714879 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resize

sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
old_desc_blocks = 275, new_desc_blocks = 350
The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 732036096 (4k) blocks long.

df -lh
/dev/mapper/ubuntu--vg-ubuntu--lv  2.7T   11G  2.6T   1% /

AI

How to test a hypothesis by AI?

Reading Time: < 1 minute

The traditional hypothesis testing I learned in school involves this:

  1. Stating with null hypothesis, which assumes no effects, and
  2. Alternative hypothesis, which state there is an effect.

So we can make the null hypothesis that “Earth is flat”, and the alternative hypothesis that Earth is not flat.

For humans, we can explore the physical world and design experiments to disapprove the null hypothesis. But for a AI, assuming these is no way for the AI to interact with the world through physics. How we can we truly test the hypothesis?

One way to go about this is find a general consensus amongst human knowledge. For example, using Google search result to see whether human agree on the hypothesis. This of course doesn’t mean that human consensus is the truth. In the early times, the consensus was that “Earth is flat”, and the consensus only changed recently if we consider the whole span of human consensus. It is very likely that the human consensus will change over time.

So what then? Do we believe that if AI cannot interact with the physical world, then it cannot prove or disapprove a hypothesis? Is there any alternative? Is there even an approximation? Is it possible that we can deduce from logic and evidence, that upon the collection of enough evidence and applying proper logic that we can disapprove the null hypothesis without physically interact with the world? Sometimes theoretical physics prove the existence of certain things before experiment verification.

Journal, Misc

Server failed to boot after power loss

Reading Time: < 1 minute

So my ubuntu server failed to boot after a power outages. It just went into the boot menu. But no matter what I press, it have some error related to “need to load kernel first”. I went around with the error message, but none of the suggestions worked. Even using all the tools with boot-repair. Finally went back to this post. https://askubuntu.com/questions/397485/what-to-do-when-i-get-an-attempt-to-read-or-write-outside-of-disk-hd0-error

Most of the suggestions are correct, except this part ->

Grub> initrd /initrd.img

It happened that I don’t have /initrd.img. It maybe got removed somehow. But if I do initrd /boot/initrd.img* then I was able to boot. I will see if I have any more errors related to this.

Misc

Generosity and raising children

Reading Time: 2 minutes

Things started tonight, when I was kind of ignoring my son to play with him. My wife immediately complained that I didn’t spend enough with my son, and said I should be more generous with my son. From my point of the view, I spend a lot of time and much more willing to make sacrifices with my wife, because I know I’m going to spend the rest of my life with her. And there are plenty of “return” with my “investment”. But with my son, I know all the time I have with him is 18 years, and then I expect nothing in return from my son. That is, if I did my job correctly. I fully acknowledge that I don’t want to invest as much in my son as in my wife.

She also mentioned that she often don’t realize that she was being extra nice to someone until she noticed she wants something from that person. And I confirmed that we all have a fixed amount of will power, and we choose to spend that will power on the things we value. I rather spend that will power on learning than lavishly praise another person, maybe just for browny points. And I understand that there are people who choose to praise everybody, even though they won’t get anything in return. Perhaps that satisfactions of praising someone is the reward on its own for them.

I always know my father is stingy, beyond frugal. I always thought I’m not stingy, because I spend money on my wife and son much more than I spend money on myself. But perhaps being stingy is not all about money. I value my time on this world more than money. And spending time with people is not necessarily something I prefer. It may not be a bad thing to do, but it’s a lifestyle choice I made consciously.

But back to raising children. My wife asked if I could imagine seeing my son being successful in life is a good enough reward for me to spend time with him. That by being extra generous with my son, my wife is really invested in his future, without asking for anything in return. I don’t know if I can do that. Being trained in biology, I considered whether it’s a genetic thing. That by being a male, I tend to be less invested in one offspring, because I have the opportunity to spread my seed in multiple fields. Whereas for my wife, being a female, is more invested in a single offspring, because moms are evolutionarily the primary care giver for the offspring.

Just as always, the situations started out with I think I have a point, ended up being my wife is right, and I need to commit more family time to play with my son. And as she rightfully point out, even though I may still have 10 years to live with my son, he will soon realize that he doesn’t want to be around me any more. Probably wise to spend more time with him, until it’s too late. Or do I want one more of these devils. Ha ha ha …

AI, Journal

What to do if Ubuntu doesn’t wake up after sleep

Reading Time: < 1 minute

So I recently updated my linux machine to Ubuntu 20.04 and it didn’t wake up from sleep. The behavior is black screen and a restart after about 10 minutes of wait. The solution I found that worked is this -> https://askubuntu.com/questions/1298198/ubuntu-20-04-doesnt-wake-up-after-suspend

Hopefully that solves your problems! Anniversary Edition!

Journal, Misc

Chinese translation of western countries makes the Chinese love them more

Reading Time: 2 minutes

Back in the 1980s, there was a huge rise in the number of educated Chinese wants to immigrate to western countries. I think it’s partially due to how Chinese translations of some of the western countries. Even though the names have little to do with the countries or culture, it created a fantasized version of the country in the hearts of many Chinese people.

For example, the United States is translated as the “beautiful country”. France is translated as the “lawful country”. Germany is translated as the “honor country”. England is translated as the “handsome country”. Italy is translated as the “meaningful country”. Canada is translated as the “plus country”. Sweden is translated as the “intelligent country”. Ireland is translated as the “love country”. Czech is translated as the “fast country”. Of course, I romanticized a little bit here and added some of my personal touches, but the idea is not far from what people thought.

There are some that’s more on the quirky side. Like Span is translated as the “west country”, and Portugal is translated as the “grape country”.

These translations are due to the fact that Chinese characters have different tones for each pronunciation. Although differentiable by a native Chinese speaker, each tone does sound rather similar. And for each tone, there are many characters that sound exactly the same. For example, in English, the word “beat” can mean both sound rhythm or hit something. But you can expect upwards of tens of words that sound exactly the same in Chinese. So if you see a Chinese person with the same first or last name, you can probably expect tens of variations in Chinese, even though the Romanized spelling is the same.

Because of translation is mostly done by sound and each sound in Chinese could mean many different things, people often choose the word with the best meaning for translation. So the resulting country names are often carry well intentioned meaning. Because these western countries are the first contacted Chinese culture, their country name translations often took the best translations. Compare to African countries or Latin America countries, there are rarely any well meaning translations. They often just trying to stay on the non-offensive side.

View More