Driving to Sa Pa, Vietnam

In Vietnam, the excavators are everywhere. When people are demanding checks from the government for staying home in other countries, the people of Vietnam are earning a living off the land. They use the roads to dry goods and they seem to live off the things they create. This country has a brilliant future. It’s beautiful.

V stands with the steel steed.

This water fall was far away. It’s near one of the many dams on the way up the valley to Sa Pa.

Somewhere in the hills of Sa Pa.

Knot Practice

Knots to Learn

Girth Hitch w/ Extra Turn

Inside Bowline


Square Knot

Double Fishermans

Clove Hitch

Supplemental Underwater Knot Tying Information:
  • https://www.artofmanliness.com/articles/navy-seal-knot-tying-tes/

When Upgrading a Rails Application with a new Ruby Version Update Both of These

Today I struggled for a little bit while upgrading the Ruby version of my Rails 6.0 application.

First, I updated the Gemfile and solved a few errors which were caused by that. Unfortunately, I forgot to document these.

The final problem I was having was an inconvience. I change had to change my ruby version in my terminal each time I opened a new terminal tab like this:

rvm use 2.6.5

Setting this each time I changed directory was annoying. The way to ensure it’s set automatically was to change the Ruby version in the .env file.

If you can’t find it via terminal, type

ls -a

in the terminal when you have changed directory into your rails app.

Otherwise, you can find it in the file structure.

how to automatically set what ruby version your rails app uses

Have fun programming!

Motorcycle Trip Across Vietnam

This is the story of our motorcycle trip across Vietnam. If you’re reading this, we’re currently in the process of completing the journey.

INCOMPLETE - Last Updated Feb 5th, 2020

Buying a Motorcycle

We decided to rent a Honda Air Blade 110cc from Tigit Motorbikes in Ho Chi Minh City/Saigon. Here’s what the bike looks like with our gear loaded:

Honda Airblade - Motorcycle for Crossing Vietnam

Rent vs. Buy

Renting isn’t very expensive and it allows me to skip the whole buy and sell process. I’m getting soft… I know. I’m paying for this luxury…

$350 USD pays the rent for a Honda Air Blade 110cc was  for two months. I’m paying to not have $1,000 tied up in a motorcycle in Vietnam, I’m paying to not worry about selling my motorcycle in Hanoi and I’m paying to ride a nicer bike.

After contemplating the above points, I’ve decided renting is better for me.

Initially, I wanted to buy a cheap bike and drive it from Ho Chi Minh to Hanoi. I wanted to paint it and make a bunch of tweaks. I even has grand plans of welding together a pirate flag.

After the last few days, I feel happy I didn’t do all this bizarre stuff. It’s great to have a dependable bike which doesn’t stand out.

My Rough Buyers Guide

It appears that these are the best bikes to buy if you want to have lots of break down adventures on your ride across Vietnam:

Fake Honda Win Warning (India/China knockoffs of Honda Win)

Photo Credit: https://hiddenhoian.com/general/vietnam-motorbike-rental/

I wouldn’t ever go with one of these. They are broken down everywhere. I rarely see a Vietnamese person on a Win knockoff. While preparing for this journey, I watched a handful of videos produced by people who did the adventure on these kinds of motorcycles. They almost all feature multiple repair stations on their journey. They often sell them halfway through and get a scooter of some sort.

I don’t even think they save much money. The cost of repairs starts to build up.

If I were to buy a cheap bike and travel on my own, I’d get a Yamaha Hayate

Photo Credit: https://www.tigitmotorbikes.com/motorbikes-in-vietnam/

Hayates are inexpensive. I found multiple for sale for around $300 USD. They drive OK and are allegedly easy to repair if something breaks.

I drove one around Ho Chi Minh city. If I were going on my own, it would be fine. I’m responsible for a passenger so I wanted to get a bike which was built better.

Our Motorcycle Trip Across Vietnam

Day 1 – Ho Chi Minh City to Vung Tau

We start day one in the Tresor residence. Our first move was to go to Tigit so we could leave our bags with them. Tigit offers to ship your bags to Hanoi. They charge $15 USD a bag.

Algorithmic mapping companies will have you going the wrong way on this leg. Motorcycles are not allowed on the highways in Vietnam. It’s possible to go around the city in a long arc if you want to avoid the ferry… but the ferry is awesome. We had a great time taking the Cat Lai Ferry. It cost something insignificant and was super fast.

Here’s the video which tells the whole story:

Day 2 – Vung Tau to Dalat

Today we got a relatively late start. I think we left around noon. It would have been much better if we left early. In the late afternoon we got stuck on the QL20. The QL20 has a section which I’ve highlighted below:

vung tau to bao loc - across vietnam motorcycle trip

I would advise you to skip this part of the QL20. I call it hell road. It’s chatoic and dangerous. Driving this section requires constant vigilance.

If we had left earlier we could have bypassed a large chunk of this madness. There is a loop called Tà Lài which is supposed to be beautiful.

Day 3 – A Day in Bao Loc

Today I spent most of the day catching up on video edits.

V went to a waterfall type attraction with David, Denisa, Santiago and Vicky. I picked her up at the end of the day and we went to this far away spot I found on a topographic map. Here’s where it is:

bao loc far away spot motorcycle across vietnam

The waterfall attraction everyone went to was called the Dambri Waterfall.

Sometimes I wonder if I spend too much time editing these videos….

Day 4 – Bao Loc to Dalat

As we drove out of town, we had the opportunity to see some of the poorer neighborhoods of Vietnam. David attempted speaking Vietnamese with some  people on the roadside. He learned that they don’t speak Vietnamese. We don’t really know the name of their people, but they seemed to be living in a much poorer world than the people over the hill in Bao Loc.

We then crossed the valley between QL28 and QL27. On the uphill side of the valley, the coffee shrubs  surround the road. They have white flowers which look like snow from a distance. As we cruised up and down the uninhabited hills we were inundated in the smell of flowers. It was like driving through a tremendous flower shop .

We had lunch at a place serving Hanoi food. David had a difficult time speaking with the woman. She was more than 80 years old and from Hanoi. Apparently, Vietnamese is almost a completely different language in the North. David speaks the southern flavor of Vietnamese so we should expect his effectiveness as a translator to deteriorate as we travel further north.

None-the-less, lunch was fantastic. We split up to do the last leg to Dalat. David and Denisa went the southern route. V, Santi, Vicky and I went the northern route:

bao loc to dalat motorcycle trip across vietnam

It turns out that both ways are nice. We hadn’t booked anything in Dalat so we immediately started looking for a place. We found a cool hotel for about 500,000 VND ($21.54 USD) on the fly. There were many options, but the one we found was great so we booked it and stayed there.

We spent two days in Dalat. The high points are shared in the next video in this series.

Day 5 – Dalat to Nha Trang

We learned a lesson from previous rides. Today we awake around 6:30 a.m. to get on the road far earlier.

It was fairly cold when we left (~50F/10C). Driving out of Dalat is like driving down from the clouds and back to the Vietnam you would expect. The road winds beautifully and you get warmer and warmer with each turn.

The great coffee culture gets thinner and thinner as you get further and further from Dalat. We stop early to warm up and get fired up on baked bean juice.

Back in the lowlands, we stopped for a rest and to change back into reasonable clothing for the dry tropical hot weather.

We crossed a great agricultural area and found the coast. As we move up the coast we found a pretty awesome seafood joint in Thái An.

Dalat to Nha Trang motorcycle journey map

I wanted to do a bit of surfing at the north end of Cam Ranh beach, but the waves are small there. The wind is onshore and the rental shop doesn’t have a magnificent selection to choose from.

We had a booking via a popular vacation rental site in Nha Trang. It was rest time after that nine hour journey from the cold hills of Dalat to the sunny coast of Nha Trang.

Day 6 – Nha Trang to Qui Nhon

Today was a traditional drive up the coast. We stayed near the coast. Parts of the drive were closed in anticipation of the 2020 Covid19 situation.

We stopped for coffee and body surfing, but I can’t recall exactly where we were.

Day 7 – Qui Nhon to Kon Tum

This was one of those stunning drives across Vietnam. We had a few tense moments because we didn’t know where the next fuel stop would be, but overall it was a hoot. We left the high temperatures of the coast for a higher elevation mountain area.

We took the long way on this ride as well as I wanted to snake through the national park areas. I believe this was a good call, though we did miss Pleiku.

Day 8 – Kon Tum to Hoi An

This had to be one of the top most beautiful drives of the trip. We had a pretty interesting experience attempting to see the tri-boder area where Vietnam, Cambodia and Laos meet. For whatever reason, the military in the area suggested that we don’t drive up the last hill to see the area.

We snaked through beautiful Vietnamese mountainsides and finally descended down into the beautiful town of Hoi An.

Day 9 – Hoi An to …

Motorcycle Trip Across Vietnam Expense Report

This will be compiled upon completion.

Motorcycle Trip Across Vietnam Research References:

Useful articles for:

Deeply Understanding Active Record Associations the Ruby on Rails Way

The purpose of this blog post is to describe Ruby on Rails associations deeply.

Setting up the Practice Environment

First off, I’ll create a new application for practice. I do this on the desktop as it’s an easy place to work from:

rails new association_practice

Next step is to change directories so I’m on the root level of the new application.

cd association_practice

Next, I’ll create an association to practice with. I’m going to start with planet Earth. With Earth as a starting example, I can make associations with most Earthly things.

rails g model Planet name:string

This will generate files for the migration, model, tests and fixtures. I added two planets to the fixture file and a simple test. Which you can see in the following screenshot:

Now that we have the Planet object in our system, I’m going to add the next level of association, the Continent:

rails generate model Continent name:string

This command orders the Rails app to generate four more files. I’ve added to them a little and you can see the changes in the following screenshot:

Ruby on Rails Associations

The goal of this section will be to clearly explain how to use associations to organize your web application’s data.  The association documentation on the Ruby on Rails guides is a good start, but my descriptions below I hope will help deepen your understanding of associations and how to use them.

Understanding belongs_to and has_many Associations

Continents and Planets

Let us create our first association between the continents and the planets. Each continent can belong to a single planet, but a planet can have many continents. Here’s how we assemble it:

Next we migrate the database.

rails db:migrate

Next we load the fixture data.

rails db:fixtures:load

Awesome. Now we have our fixture data loaded and our associations should be set. Here is a screen shot of the actions we can now take in the rails console.

rails c

  1. Here we search the database for a planet with the name Earth. That gives us an array with the matching result in it. We use the .first method to pull the first object. We assign this object to the variable name earth.
  2. Here we use our earth variable to get the name string data which contains the name of the planet (“Earth”).
  3. Here we list the continents associated with earth.
  4. Here we set antarctica variable to equal the continent object of our first continent, Antarctica.
  5. Here we ask the database, “What planet is associated with Antarctica?” It returns us the earth planet object. Notice that the Planet earth object has the same id at the bottom as the Earth at the top.

Work in Progress

I’m thinking of better ways to describe associations. I plan to deep my understanding of the following associations in the future:

  • has_one Association
  • has_many :through Association
    • I’m thinking of describing this by using International Organizations
  • has_one :through Association
  • has_and_belongs_to_many Association
    • I’m thinking of describing this by using members of NATO
  • Choosing Between belongs_to and has_one
  • Choosing Between has_many :through and has_and_belongs_to_many
  • Polymorphic Associations
  • Self Joins