Shing Mun Country Park

[mapsmarker marker=”6″]

 

I haven’t been to a country park in Hong Kong for a very long while. This time, because of a childhood friend and her kids, I got to visit one of them again. Thank you Nicam!!

Shing Mun Country Park is located at the northern part of the Kowloon Peninsula. For all the details about the park, visit: https://en.wikipedia.org/wiki/Shing_Mun_Reservoir . No need for me to repeat it in this post.

One story I do want to remember is related to the huge groups of Macaque monkeys around that area. While hiking around the reservoir, there are  groups of Macaque monkeys hanging around and you can see them pretty much everywhere. Since the notorious reputation of the monkeys stealing food from hikers, we stopped at a spot which did not see any monkeys within our sight for a snack.

By the time we started to hike again, two kids still each had a bag of potato chips in their hands. While crossing a creek, there was a group of monkeys on the other side of the crossing. Ching, the older girl due to her fear of monkeys (and she should), already putting her bag of chips away in a side pocket of her backpack. However, the boy, Long, was still munching on. By the time, we crossed the creek, there was already a monkey trailing Long’s backpack, right at the moment when he finished putting the chip bag away and started taking the narrow trail to go uphill, the monkey closed the distant and snatched the bag of chips from Long’s backpack side pocket. Just a split second, chips were gone and the trail of monkeys running away from us and following the monkey who got the food.

In hind sight, this is a funny incident. We all got a good laugh out of this.





 

Rocky Mountain National Park

We went there during mid July which was the peak season of park. I guess the amount of people over there kinda ruined the experience a little but it is still a very beautiful park. The landscape and rock features are really similar to Sierra Nevada. Huge Granite slabs with pine tree forest, lash green under growth with ice cold snow melt creeks crisscrosses underneath.

However, if you never see a moose before and really want to see one, that’s the park you want to go. Over the 4 day trips, we probably saw about 8 moose, baby, adults, male(buck), female(cow).

In terms of backpacking, you should probably plan ahead and make reservation online. We tried to do a 2 night 3 day route without reservation which turns out that’s not possible so instead, we had to go one night at a time. Stayed at Upper East Inlet one night and Granite Falls the other.

One more tip, the rangers/custodians at the Kawuneeche visitor center knows more about the camp sites than the ones at the Beaver Meadows visitor center. If you are winking it, you may have better luck at the Kawuneeche to get a backpacking permit and get a little more info about your camp site.

 

[wpgmza id=”1″]

 

Here are some of the hi-lights of the park:

using By.js selector with webdriver JavaScript

Recently got a request for automation POC with JavaScript and selenium webdriver. One issue I ran into is trying to match text of a button as the criteria to locate the object on page. Don’t want to use xpath but can’t use css as there is no “text()=”. At the end, I use the By.js selector and “contains” to solve this problem. Here’s an example:


driver.findElement(webdriver.By.js("return $(\'button:contains(\"Save\")\');")).then(function(button) {
            button.click();
        });

From there, you can easily extract a function out of this so you can apply it to all of your By.js locator:


/**
* replace the findElement with getElementByText
*
* driver.findElement(webdriver.By.js("return $(\'button:contains(\"Save\")\');")).then(function(button) {
*     button.click();
* });
**/
getElementByText('button', 'Save').then(function(ele) {
    ele.click();
});

function getElementByText(baseLocator, text) {
    return driver.findElement(webdriver.By.js("return $(\'" + baseLocator + ":contains(\"" + text + "\")\');"));
}

One note, make sure you have the “return” in the javascript code explicitly or you will see the following error:


TypeError: Custom locator did not return a WebElement

The all mighty CURL!

I love using curl to do HTTP queries. Some people prefer Postman or some other UI tools to check http calls but for me CURL is the shit for me.

Come across a really good post about how you can actually ask for specific headers to show in the output: http://beerpla.net/2010/06/10/how-to-display-just-the-http-response-code-in-cli-curl/

Basically, you can use the “-w” option and there are a list of variables you can use:

  • url_effective
  • http_code
  • http_connect
  • time_total
  • time_namelookup
  • time_connect
  • time_pretransfer
  • time_redirect
  • time_starttransfer
  • size_download
  • size_upload
  • size_header
  • size_request
  • speed_download
  • speed_upload
  • content_type
  • num_connects
  • num_redirects
  • ftp_entry_path

Won’t say too much here since it’s all in Artem Russakovskii’s post.

git cherry pick

This is something that I always have to do once  a while but it’s not often enough that I remember exactly what the command is.  So that’s why I am writing it down here!

                            master branch -> some other changes1
                                                                                                      ^
                                                                                                       |
feature branch -> changes1 -> changes2 -> changes3

PR for changes3 to master branch:
to get the commit hash for the changes that you want:

git log --oneline

switch to master branch:

git checkout master

create a new merge branch:

git checkout -b pr_branch

now cherry pick your changes to the pr_branch:

git cherry-pick [commit hash]

push your change branch to the remote repo:

git push origin pr_branch

courtesy of this post: https://ariejan.net/2010/06/10/cherry-picking-specific-commits-from-another-branch/ from Ariejan de Vroom

Snowboard Camp in Whistler, Canada

I have a week off in between jobs in June.Since I didn’t get any snowboarding days in my system the past winter,  I was thinking are there anywhere on earth that I can go snowboarding?   Out of shear luck or coincident, I found the Treeline Snowboard Camp on Google. This camp is definitely challenging physically and mentally, I do regret it a little I signed up for a whole week of camp. By the end of 3rd day, I was completely exhausted.  Like the other campers, I should sign up for two days, take a day off, and come back the last day or two.

Overall, it’s a really fun camp. I met a lot of good campers and became good friends. Learned how to do a backflip on a trampoline, manage to do a half-180°, ride a rail boardslide, ollie? WTF is this, tried the giant jump multiple times without landing on the taint, riding the puss-pinching T-bar,  riding switch, etc

I wish I have more photos or videos to share but I am still waiting for my coach to send our videos to us.

dji phantom 1 with cheap gimbal installation

I have been playing around with my dji phantom drone for a while to capture arial videos around my neighborhood. One constant problem is my neighborhood is kinda windy and the video comes out shaky. Pretty much every single movement from the drone is directly transferred to the camera, hence to the video.

Video without gimbal:

In order to get less shaky image, you have to install an image stabilizer, aka gimbal.

dji phantom 1 with gimbal
dji phantom 1 with gimbal

After installing the gimbal, the video is definitely a lot smoother and as an add-on bonus, I can also control the tilt/pitch (meaning rotating up or down) of where the camera is pointing at. Here’s a video after installing the camera:

And apparently, my dog loves it too 😀

Finally! I saw whales next to my house!

Finally, after living in Moss Beach for two years, I saw whales in the ocean right by my house. To be precise, it’s outside of Montara State Beach, not exactly next to my house but well, close enough.  The whales must be attracted by the anchovies that concentrated along the coast here once a while.  The pictures are not the best since they are quite far out from the shore.

whale_tail
Tail Fin

two_whales

Even the harbor seals are joining the fishing party.

 

Morel Foraging

For a while, we have been wanting to see a morel mushroom in the wild. However, it seems pretty tough to find if you don’t know the where and how. Eventually, we signed up with Forage SF (http://www.foragesf.com/) for their morel foraging tour so there will be a professional knows the where and how. It was surprisingly easy and abundant. Each one of us got at least a pound of morels packing back home.  I have to say, 5 stars to the guide, Patrick Hamilton.

morel
morel
morels in their natural setting
morels in their natural setting
morel
morel
tree frog
tree frog — this little guy showed up while I was trying to take a picture of the mushrooms

[mapsmarker marker=”4″]

Glacier Nation Park — scenery and the gang

This is a fun family trip. I got to meet my husband’s cousin, Mark and his wife, Judith, also his famous friend, Josiah. They are all very nice people and I really enjoy their company.

Avalanche Lake
View from Avalanche Lake
snow storm
snow storm — one morning, there was a really heavy snow storm rolling through the park. Huge snowflakes falling among the burnt pine trees was almost romantic.
what's the name of this river?
what’s the name of this river?

 

After a hard day of hiking
After a hard day of hiking