Journal, Misc

Supreme Court decision on church gathering

Reading Time: 2 minutes

U.S. Supreme Court made the decision today on allowing non-essential church gatherings during this Covid19 pandemic, ruling against New York State Governor Cuomo. This is the first case after Justice Amy Coney Barrett becomes the deciding factor in a 5:4 vote. It also correctly reflect what I believe is the overall sentiment of US citizens. In the US people value freedom more than lives. In other words, people rather have the freedom to decide what they want to do, despite the high chance of death or permanent health damage.

I do think that the freedom to let people gather infringed the right of other people who want to live. If this is not an infectious disease that can easily spread to other people and cause death, then people can exercise their freedom as much as they want. They can commit suicide as many times as they wish. But because it is an infectious disease, the action of exercising their freedom potentially takes away other people’s freedom to live. Just because other people did not actively choose to gather, it does not take away their rights to live amongst society. At a minimum, the people who choose not to gather have to stay at home for longer periods of time and are prevented from going out and interact socially. And it does hurt society as a whole from the mid to long term, even for the people that want to gather, at least before an effective vaccine is available. I’m going to ignore the people who don’t believe in vaccines. Thankfully, they are still a minority of the US population.

I still remember the first time I saw New Hampshire’s state motto, “live free or die”. This reminds me of some of the things I was taught when I was little. Rather than falling on the conservative side in the US, it was taught by people more on the liberal side in China. So I think things on the extreme ends are rather similar, no matter where they are.

I personally value lives more than beliefs, but I understand why people values believe more than lives. Believes keep the human race advancing to the next stage because people believe there is always a better tomorrow. This belief comes at a cost though, so keeping the balance between beliefs and lives is the key. I’m more of a person that learns the rule than bend the rule. It is an easier option. But I do envy the people that at least attempt to bend the rule. That is why I think diversity is important. Not just race, gender, age, etc, but also in mindset and beliefs.

Journal, Misc

Thoughts on US election (system vs personality)

Reading Time: 2 minutes

I had some thoughts on the US election as I woke up this morning. From the conversation I had with some coworkers and what the people on Live streams are saying, I think that people in the US believe in the system of the US government enough, that despite the fact they don’t like the president as a person, they still think the policies will be carried out according to their plan.

After many years of living in the US, I think people believe strongly in the system rather than the person who is making the decisions. Because the system is putting up enough barriers to direct whoever is in charge to make the correct decisions, the personality of the person in charge does not matter.

This is a strong contrast to the Chinese government for example, in which people believe that a good leader can direct the country to a much better place. And there are many old stories and historical comments that show strong favor of a leader that is compassionate and listen to the people.

But my question is that do we want to leave up to chance that we have a good person in the leading position. Would it better to have a system that makes sure the leader does not waver from the people’s interests, no matter how deranged they might be?

Being trained from a scientific background, I believe in the system of discovery. That we should experiment using systematic approaches, rather than design experiments depending on how we feel it should be. And we should collectively build a system that essentially guarantees things do not fail. And we should consider the said system to be our grand achievement for the government and society, not celebrating the individual who makes great decisions for us.

As I can think of it, nobody is perfect. And we certainly should not rely on the hope that any leader will be perfect.

Journal, Misc

Random thoughts

Reading Time: 2 minutes

As it happens, sometimes I get into these rabbit holes to watch a specific type of Youtube videos. As of last weekend, I got into this type of video about a specific person with provocative views. The views they made are rather appalling, but if I listen to his explanations more and more, I don’t see a flaw in their reasoning. The reason that I feel these views are appalling is that they are different than the values I believe, at least on the surface. Yet it is also amazing that I arrive at the same conclusion if I listen to their reasoning.

It is not uncommon to feel this because I was listening to a math lecture and some guy proved that the sum of all positive integer is -1/12. The result is absurd and obviously wrong, but I cannot find where the equations went wrong. (I didn’t found out why later). So I listened to other people who have opposing views than them, and they were able to disarm all of the opposing views with ease. I understand that it is also possible that all the videos I saw purposely constructed in a way to prove they are right, further leading me to their side. After all, Youtube is famous for providing the videos that their customers like. There is a possibility though, that these views are correct. It doesn’t serve me right if I just completely ignore them because they are different than my views.

I recognize that these views are mostly on how to navigate the existing world. It’s more about the old rules that govern the world. So it’s self-serving that save these rules is correct because we have been operating under these rules for centuries. Sometimes, to have a better life, we need to break the currently working rules and create new rules. And because change is always hard, they are going to feel uncomfortable. It doesn’t mean the old rules don’t work, it only means there may be a better world we can strive for.

I don’t think that just because the current political world is more polarizing than ever, we should forget about extreme views and try to bring more things to the center. I think we should keep having discussion about the extreme views, evaluate why they are not a good idea, and potentially develop on some ideas that seem extreme, but actually build a better world. Although sadly to say, I’m still going to stay in the center for my personal actions. Maybe because that’s deeply ingrained on my personality already.

AI, Journal, Misc

OpenVPN

Reading Time: < 1 minute

I made an attempt to install OpenVPN using linuxserver.io‘s docker image. I tried Docker compose version but hit this error:

You can configure manually using the /usr/local/openvpn_as/bin/ovpn-init tool.
/var/lib/dpkg/info/openvpn-as.postinst: line 72: systemctl: command not found

After a little digging in the log file, it said:

Error: Could not execute 'systemctl enable openvpnas' to enable startup/shutdown scripts

I tried to search some error and github page said they are working on it. I then went to this page and there seems to be a solution by changing the config.json file.

https://forums.unraid.net/topic/79012-support-linuxserverio-openvpn-as/page/71/

But I tried that by execute into the docker container, execute this:

/usr/local/openvpn_as/scripts/sacli --key "vpn.server.daemon.enable" --value "false" ConfigPut
/usr/local/openvpn_as/scripts/sacli --key "vpn.daemon.0.listen.protocol" --value "tcp" ConfigPut
/usr/local/openvpn_as/scripts/sacli --key "vpn.server.port_share.enable" --value "true" ConfigPut
/usr/local/openvpn_as/scripts/sacli start

This however didn’t work either. There seems to be other tutorials using straight docker and get to the admin page. So I can only say it’s the mentioned multiprocessing problem, and I will have to wait to a working update.

Journal, Misc

Family symbol

Reading Time: < 1 minute

So I was searching for some designed for family banner, sigil, coat-of-arms, or whatever you call it. My family name is “Liu”. Then I found this one.

link to the picture

I read the description and thought it was interesting. It looks and feels like old Chinese characters, but there is still a good chance that it’s just an attempt to duplicate what was before.

Journal, Table Tennis

Improve your Ping Pong skills by adding a skilled backhand (shakehand)

Reading Time: 4 minutes

Up until recently, I have never got an effective backhand for my ping pong skills set. It’s been a weakness, to say the least. With such an obvious weakness, my opponent can just continuously press my backhand and my strong forehand never sees the day of light. Since I got a table for me to practice at home, I have been practicing almost daily to get a handle on my backhand, and here is what I learned. If you read Chinese, here is a youtube video. Youtube Video.

  1. Don’t start practicing backhand drive/fast-loop first, even though that’s what the top players are using in matches right now. When I watch the games amongst top players, this is the technique I see the most, during their practice and actual competitions. So naturally, I want to practice this move. But this move is highly dependent on the wrist but equally dependent on the forearm. It’s very easy for a beginner to only use the wrist and forget about the forearm. The result will be the ball is spiny, but it hit the net a lot. Or you are going to miss the ball because the potential contact area between the paddle and the ball is too small. The correct way is to have a foundation in pushing first, using a lot more upper arm.
  2. Start practicing pushing the ball using the upper arm. This is done by holding your wrist to about chest level. Hold the wrist and forearm at the same angle to the chest, and only extend the upper arm back and forth. Start with your paddle touching the chest, as you will need plenty of “runway” to hit the ball with enough force. Remember to bend the wrist slightly, so the surface of the paddle backhand is parallel to the chest. This will become a good foundation for all later moves. Notice by holding the wrist to chest level, your shoulder is going to get tired a lot more frequently. This is fine at this stage because it will form a good habit for you to hit the ball will a higher percentage, as it’s closer to your eye level. The ultimate form will be slightly different as you learn how to relax.
  3. Practice for relaxing during the game. When I started playing ping pong, I was always tense when trying to hit the ball. Muscle tension is a good fight-or-flight response when physical activity is needed, but it’s not good for hitting ping pong balls effectively. Coaches always ask me to relax, but I was never able to do so in a game, same as when anybody tells anybody to “relax”. So you actually need to learn how to relax. Start by grabbing your paddle loosely, as if you are almost going to drop the paddle. But make sure you bend the wrist and make the paddle parallel to the chest. Without moving the wrist, or forearm, find a way to hit the ball by moving the legs, waist, shoulder, and upper arm, all at the same time, to hit the ball. This is against intuition because adults will use the smallest amount of muscle to finish a task. But “hit ball with your body” is good in the long term to make upper body muscle fatigue occur less frequently and reduce the chance of injury. Construct yourself to relax during practice, and if you do this enough times, you will be relaxed during a match. The goal is to relax during most of the match, but tense up when you actually hit the ball.
  4. Once you have enough practice of pushing, and able to draw paddle back to your chest fast enough in advance of hitting the ball, then you can practice drive/fast-loop. The key to this move is you have to hit the ball fast enough in four different aspects. I. You need to get the wrist drawback to your chest, like a spring. This time not by moving the upper arm, but by rotating wrist, so your thumb is 90 degrees with the forearm. This is because you are not going to have time to use the upper arm in a match. II. At the same time, you need to use the elbow as a pivot point and rotate the forearm towards the chest. In the beginning, you paddle will touch your chest, this is perfectly fine. You can hit the ball, by rotating the wrist and forearm at the same time, towards the front right side. Stop swinging when the forearm and hand are 90 degrees with the chest. III. You need to hit the ball when it just bounced off the table before it reaches the highest point, normally much earlier than your other shots. This way you don’t actually need to distinguish whether the ball is no-spin or topspin because the topspin have not started to take effect yet. VI. Also need to actually hit the ball kind of fast, it will hit the net if you hit too slow because your paddle angle is actually more shallow or flatter. Because you are not hitting the ball with the paddle perpendicular to the table, the maximum chance of success is naturally going to be less. So it’s a more risky shot than just push the ball. But because of its high power and spin, your opponent is not likely to return it, even at the world level. The overall effectiveness is high enough to use regularly in matches. The hard requirement is you need good leg movement to get to the ball, with enough time for you to bend knees, rotate the wrist, and hit the ball before it reaches the highest point. Otherwise, it’s going to fly away and miss the table.
  5. If your steps are not fast enough, the alternative is to hit the ball slower, use less forearm strength, when the ball already reached the highest point or started falling. Your return will be spiny but lack the high speed and power in the drive/fast-loop move.

Now you learned the secret of drive/fast loop backhand using shakehand grip, go pratice!

AI, Journal

Causal Inference Book

Reading Time: < 1 minute

Recently started reading the causal inference book, Counterfactuals and Causal Inference, by Stephen Morgan and Christopher Winship. Link to book. This book was recommended by researchers at the ACL conference. I personally found Pearl’s 2009 book to hard to read and his popular book less detailed. This book started with the history and included other researches done in the field. So after I get partly through the backdoor criterion section, I decided to program it using networkx. I have just gone through the part where I check if the backdoor criterion is satisfied. https://github.com/yangliu2/frontal Will implement the part that will recommend variables to condition to prove the causal relationship.

AI, Journal, NLP

Use Tensorflow without having AVX instruction set on your old CPUs

Reading Time: < 1 minute

Working on the repurposed Dell r710 server I got, I mostly want to run Machine Learning algorithms on it. Specifically, I wanted to run the Universal Sentence Encoder to generate sentence embeddings. But the pip installed version of Tensorflow doesn’t work with the E5660 CPU I have because it requires AVX CPU instruction set. Without it, it will just give me Illegal instruction (core dumped) message. I can kind of get around it by using the Anaconda version of Tensorflow. One exception I found is that the multi-language pre-trained model require tensorflow_text package. This packages is not compatible with the Ananconda version of TensorFlow for some reason. So once again, I’m left with the only option for English text and cannot compare sentence embedding across different languages.

Journal

New home server

Reading Time: 3 minutes

Got a home server to play with, Dell PowerEdge R710. The first thought is just use it to setup containers for things like database, elastic search, and embedding servers.

First problem I hit is that I don’t understand RAID. Quick talk with the seller and youtube video gave some info.

  1. RAID 0: no redundancy, just split data storage over two disks. This improve speed because you can get data from two disks at the same time instead of one.
  2. RAID 1: back up one disk completely on another disk. This have total redundancy, and I’m using it for OS drive now.
  3. RAID 5: spread out the backup of 3 or more disk on four disk. So you have the usable space of 3 disk out of 4, or (n-1)/n, to create redundancy in case one disk fail. If you have more than one disk fail at one time, you are out of luck.
  4. RAID 10: min 4 disk. Split the number of disk in two groups, group 1 is completely different from group 2, to increase speed. But the two disks on each group is completely backed up. It’s a combination of RAID 0 and RAID 1.

Now I have a rough idea what RAID is, I decided to have RAID 1 for OS drive (2 disks), and RAID 5 for data drive (4 disks). Started in the utility, I found there is a one drive “missing”. And it somehow became foreign. Talked to the sales guy and decided to import. When the process hit 32%, one of the other disk (slot 5) start failing and show amber light. Now both drive slot 2 and 5 seems to be unusable. Emailed the sales and he said he will mail out two replacement drives because of the warranty. Yet have received the drives, and probably will need to contact again.

Set that aside, I decided to install Ubuntu 18.04 as the OS. Because I’m most familiar with it from machine learning, and I was hoping I could install a GPU card on it. First tried Ubuntu desktop version, but only got booted into GRUB prompt. Feels like boot drive wasn’t set up properly. Did research again, but did not find a working solution. I decided to install it again, and somehow it worked. Only I typed in my password incorrectly, and GUI is extremely slow, probably due to the dismal video card on these servers. Then flashed the Ubuntu Server version. Again had to install twice to make sure boot drive works. But then noticed it doesn’t recognize ethernet. So I used this method to fix it.

Now it have internet, I can update OS and install things. The other thing I really want to do is to move my Nvidia 1070 on here so I can do some machine learning. When I opened up the case though, I realized there is not going to be enough space to fit my 3 fan, 2 slot GPU card in it. In addition it doesn’t have a PCI 16 slot. I researched once again, and found some alternatives.

  1. Solder/cut open the PCI 8 slot and fit the card in.
  2. Get a PCI 16x raiser, but it only fit a 1 slot GPU like a Quadro 80.

Either way though, I would have to solder the power source onto the on-board power unit. 3 left as power, and 3 right as ground. I don’t own a soldering iron, so I’m putting it off. Another option is to wedge in some connectors into the power slot and loop the wire onto the wedge. I haven’t decided on either option, just because I’m not super comfortable doing these modifications yet. So for now I’m probably going to be sticking with training models on my desktop computer.

Journal

Fixed ethernet connection after installing Ubuntu Server 18.04

Reading Time: < 1 minute

For some reason, Ubuntu server 18.04 does not start with a valid ethernet connection on my newly acquired, an oldie but goodie, Dell R710 server. After some searching around this solution at tecmint that works for me.

sudo netplan generate 
sudo vim /etc/netplan/01-netcfg.yaml 
ifconfig -a # find the ethernet name, mine is eno1
# this will auto config using DHCP

network:
 version: 2
 renderer: networkd
 ethernets:
   eno1:
     dhcp4: yes
     dhcp6: yes

sudo netplan apply
ifconfig -a # should now show IP on eno1
View More