Wild Boars
2017
nuah


Credits: Image of wild boar taken from PublicDomainPictures.net.

I made this image last evening, soon after the news of the successful rescue of all 13 Wild Boars. The result is not very satisfying though - when scaled down, the silhouettes of the wild boars don't seem to be easily recognizable.

Urinal Selection Algorithm
2017
nuah
Proper etiquette in a male toilet includes the proper selection of a urinal.

Assume that a male toilet has one single row of N urinals, numbered 1 to N from left to right. Consider the problem of urinal selection when N gentlemen enter the toilet to use the urinals one at a time, and none of these gentlemen leave the urinals before the last gentlemen arrives at a urinal. For ease of description, further assume that N = 2^K + 1 for some positive integer K.

The urinal selection algorithm can be described as follows:
1. The first two gentlemen will select the urinals 1 and N, in any order.
2. Construct a height-balanced binary search tree whose nodes are 2, 3, 4, ..., N - 1. Consider the sequence of numbers visited by any breadth first traversal of this binary search tree. Then the remaining gentlemen will select urinals according to this sequence.

Kilauea Volcano
2017
nuah
Kilauea volcano, located in the Big Island of Hawaii, is probably the most active volcano on the earth. The recent eruption in Lower Puna is fascinating, and one aspect stands out: the scale and speed of changes that nature can cause within a very short time frame.

Within just one month, the status quo of that lasted many years are totally altered.

Firstly, it is the ongoing Lower Puna eruption, which started initially with the opening of two dozen fissures in Leilani Estates and surrounding area. In the span of a month, the dominant fissure 8 built up a spatter cone with a constant flow into the ocean. Presently, less than two months after the eruption started, the spatter cone is 50 meters high, the flow is as wide as 300 meters at places, with an ocean entry more than 2.4 km wide. In addition, the entire Kapoho Bay was filled up, with about 1.5 square kilometers of new land created in the ocean. Unfortunately, more than 500 homes from at least three communities were destroyed in the process, as lava covered more than 24 square kilometers. The volume of the flow is very high, and currently appears to be in a stable state.

Secondly, the Puu Oo crater, which had seen lava almost continuously for 35 years, had its crater floor collapse. This collapse probably triggered the Lower Puna eruption. As of this writing, there is no longer any lava in it, and scientists estimated that lava will not return to Puu Oo soon.

The other very significant change is the Halemaumau Crater at the summit of Kilauea. After consistently having lava in the Halemaumau Crater for 200 years, the lava simply disappeared within one month with very visible side effects: first the crater floor collapsed by some hundreds of meters and became rubble filled, then the vent enlarged to encompass almost the entire crater, and finally the withdrawal of the summit lava pool resulted in extremely widespread subsidence of the summit, with large scale radial cracking and mass slumping clearly visible. A large number of explosions and shallow earthquakes have been recorded in conjunction of this mass subsidence. The Hawaiian Volcano Observatory at the caldera rim suffered damage and has been evacuated, and I have no idea what its eventual fate will be.

All of these very dramatic changes occurred just within a span one one month. I suppose these are unthinkable even as recent as two months ago. And by the way, seeing lava in person is added to my bucket list. If the fissure 8 flows continue to remain in a steady state, then Kilauea would be my choice.

Transport Infrastructure
2017
nuah
I don't like travelling, including daily commutes to work, because this very uncomfortable activity tires me very easily. Any amount of time spent travelling is a waste of my very limited amount of energy. Probably because of this reason, I often dream of a future where people have the option to go from one location to any other location in zero or very minimal time, regardless of their locations in this world. Not possible at all, but can I dream? I suppose this makes me welcome any transport options that potentially reduce the amount of time it takes to travel, and options that open up new places. I know nature conservationists will hate me, but I really do envision having very extensive networks of roads and railways, which makes it very convenient and fast to go from place to place with many direct connections. I will very much dislike it if the Cross Island line chooses the skirting option rather than tunnelling under the Central Catchment Nature Reserve.

I find myself getting excited about projects on transport infrastructure, especially road and rail. I find myself interested in mega transport projects, both local and overseas. I was pretty awed by the high speed-rail while in Japan followed by Taiwan, and lamented that the Tohoku Shinkansen only reached Hakodate at that time, requiring painfully slow transfers as we entered Hokkaido. You can guess how I feel when the Shinkansen finally got extended to Hakodate with the prospects of reaching all the way to Sapporo in the future. The under-construction Chuo Shinkansen is similarly exciting. I was feeling so excited when the Kuala Lumpur-Singapore high speed-rail was mooted and seeing it almost coming to fruition, like, high speed-rail is finally coming to Singapore! Needless to say, the disappointment when the newly formed Malaysian government decided to cancel this high-speed rail project, although this is understandable due to the need for fiscal prudence.

The stations on the Jurong Region Line was officially announced on the day when the results of the 2018 Malaysian General Elections was announced. As a result, what is typically front page news in the next day's newspapers got pushed very much towards the middle of the newspaper. When I made this remark to one of my colleagues, his response was like, "The new MRT line is not a big news, right?" But it is to me, just like other under-construction lines like the Thomson-East Coast Line, the upcoming Cross Island Line, and potential yet to be announced lines such as the Holland line. However, I recognize that I am not as fanatic as those people who frequently post on the SkyscraperCity forums. These people are the ones who would hunt down soil investigation rigs, and use such and other publicly available information to piece together the alignment of new lines and station locations with great accuracy even before they are officially announced. Some of these people even maintain construction blogs of new MRT lines, which provide lots of interesting tidbits. On the Jurong Region Line, these people posted about the very likely and interesting three-platform layout of Bahar Junction station and how this station might work, although I do question whether this layout is the right choice without the need for a very expensive Jurong East Modification Project style modification in the future.

As an aside, the post on the Thomson-East Coast Line also revealed that when the Land Transport Authority updated its MRT system map to include the Jurong Region Line, it also unofficially added the Gardens Bay East station with a station code of TE22A. I suppose this addition is likely inadvertent. The station code of TE22A is also quite a departure from the previous practice of reserving station codes like NE2, NS12, CC18, and DT4, because no station code was reserved for this unannounced station on the Thomson-East Coast Line. I suppose the Land Transport Authority learned from the public reaction through the Buangkok "white elephant" and Hume station incidents, when it wants to provision new stations to be opened at a later time. From the completely fitted up Buangkok station, they smartened up and only built a shell at Bukit Brown. And probably because of Hume on the Downtown Line, they decided not to even reserve a station code for the Gardens Bay East on the Thomson-East Coast Line. I suppose the whole point is to make such future stations as inconspicuous to the public as possible. But such information remains publicly available when the Land Transport Authority publishes tender notices for construction projects and subsequently award them. I do hope that such shell stations do eventually open.

It is common to see such kind of provisioning in public infrastructure projects. For example, the Little India Downtown Line station construction had a short section of "future underground infrastructure" which we now know is the North-South Corridor. Interestingly, Contract N109A for the North-South Corridor also included a "future underground infrastructure" occupying more than half the length of the tunnel section, and I strongly believe that this is for the Cross Island Line, because it it already well-known that this MRT line will have interchange stations at Bright Hill and Ang Mo Kio. Other provisions were also seen at North East Line Chinatown and Circle Line MacPherson stations when they were first built, which we now know are for the Downtown Line. Some of these provisions are built for the very far future, but were eventually not used when plans changed. I suppose one of the biggest waste of provisioning can be seen at the Circle Line Promenade station, which was obviously designed as a cross-platform interchange, but the plans totally messed up after the 2004 construction accident which caused Nicoll Highway to collapse. As a result, Land Transport Authority spent another several hundreds of millions to build new Downtown Line platforms, in a very challenging construction project underpinning the existing Circle Line platforms, yet providing an arrangement that is less convenient for commuters.

Regardless, the Downtown Line Promenade station was very exciting when it opened, mainly because the depth is so mind boggling. Its depth was preceded by Bras Basah station, and is now succeeded by Bencooleen station, which incidentally is only a few minute's walking distance from Bras Basah station via Singapore Management University compounds. On the other hand, the MRT cum viaduct structure in the Tuas extension makes the stations so amazing tall, with supporting columns so frigging huge. I always look forward to new MRT lines and new stations. I have participated in most of the open houses, and look forward to the next one. Similarly, I await the completion of the North South Corridor. As much as the expressway itself, I look forward to having a good north-south cycling link that is sorely missing between Ang Mo Kio and Yishun.

Update. TE22A Gardens Bay East is removed from the MRT system map. As I predicted, they made a mistake in including an unannounced station.

New FindPython CMake modules
2017
nuah
In the master branch of the official CMake GitLab repository, lies three new gems: FindPython, FindPython2, and FindPython3 modules. The previous way of using CMake to find the Python executables and libraries was to use the FindPythonInterp and/or FindPythonLibs modules, and these were very problematic.

Not too long ago, I had needed to embed the Python interpreter in one of my C++ projects, in order to use codes written by one of my colleagues. I needed to support Ubuntu and Windows, on some or all of x86_32, x86_64, armhf, and aarch64. For those who recognize it, the last two CPU architectures require cross-compilation. Obviously, the original FindPythonInterp and FindPythonLibs modules doesn't work. Given the deficiencies of the preceding, various authors have written a variety of other Python finding modules, such as the widely-used FindPythonLibsNew. But they don't fully work either.

Then I found the FindPython, FindPython2, and FindPython3 modules, which is a rewrite of the existing FindPythonInterp and FindPythonLibs modules. Further, techniques used in quite a few of the other alternative Python finding modules were also incorporated into the new FindPython modules. I decided to try them out, and with minor tweaks I got it working for cross-compilation on Ubuntu, and another workaround resolved an issue I had on Windows. Thus, I had it working for all the platforms I compile my project for.

Feeling charitable, I decided to file an issue on the CMake repository, and issue a merge request for the cross-compilation problem. The response from the CMake maintainers was very rapid, typically within 24 hours on a weekday for every message that I posted. With their guidance, the merge request went through their processes and was merged within one week. Along the way, I also brought out the problem I had on Windows, and the original author of the new FindPython modules found the bug and fixed it a few days later. Overall, less than two weeks. Very nice.

I very rarely file issues and pull requests on open source projects, but it does not mean I have never done so before. The response by the CMake maintainers is extremely fast, compared to a few of the other projects that I have worked with. There was this widely-used Java framework that had my pull request sitting for months before finally accepting it, and that was after repeated reminders. Then there was also this software library for a very prominent database, maintained by the same organization, that left a major bug open for so many years. I had actually analyzed the bug and identified the cause, but the organization had zero interest to fix it. Comparatively, the CMake project has the fastest response times I have ever seen.

The new and shiny FindPython, FindPython2, and FindPython3 modules is slated to appear in CMake 3.12. If you need to use CMake to integrate the Python executable or interpreter, I recommend giving it a try when it is released.

And by the way, I am hardly a Python developer. I do not have much expertise in this language. I am primarily a Java and C++ programmer.

2XU Compression Run 2018 (21 km)
2017
nuah
Last year I took a hiatus off half marathons, and originally I didn't intend to resume half marathons. However, two of my colleagues asked me whether to join 2XU Compression Run, and I said yes. So here is my race report.

First of all, congratulations to Kohan for completing his first half marathon. His timing is respectable.

I had a great run with an expected official net time of 01:50 or thereabouts. Weather was cool throughout the race. However, the actual distance appears to be about 1 km short of a standard half marathon. If this result is officially recognized, then this will erase 6 minutes off my previous personal best under the category "half marathon, but significantly shorter than 21.1 km", which incidentally was the 2014 edition of the 2XU Compression Run. Regardless, I had this post-run high which lasted for quite a few hours, and it felt good.

For this race, I was in the 4th wave. “Computer issues” resulted in a start delay of over 42 minutes for this wave. Some parts of the route was narrow, and felt like obstacle course with all those slow runners. I started to feel energy depletion starting from about two-thirds, so at that time I slowed down a bit. However, when I overtook the 02:40 pacers I knew I have hit my target net time of 02:00. I haven’t achieved this time in any of my training runs this year. So yeah.

Energy boost was in the form of Honey Stinger Energy Gel at 7 km and 14 km. This seem to work without triggering triggering gout like some of the other energy gels. Thanks Boey for recommending honey.

Update. Official net time is 01:49:34, ranked 401 out of 7031. The splits are given as:
9 km - 44:56
11 km - 01:05:01

Train Stations on Geological Faults
2017
nuah
A geological fault is a fracture between two blocks for which relative movement has occurred. Some are ancient and have stopped moving, while others are active. If an active fault is not locked, then it will creep slowly and continually. Otherwise, an active fault that is locked can only release its accumulated strain suddenly in the form of earthquakes.

People typically avoid building structures at or near active geological faults, if the location of faults are known in advance. History has shown that structures get damaged or destroyed when these faults move, even when they are specially designed for such seismic risks because it is tricky correctly assess the risk. I have no idea why the California Memorial Stadium was built on top of the Hayward Fault, when the presence of the fault was known. It required an expensive retrofit from 2010 to 2012 to address the earthquake risks, but part of the solution was to divide the stadium into blocks that can move independently of each other.

So it is of surprise that I learned that a train station in Japan was built right on top of an active fault. This is a shinkansen station no less. Apparently due to various constraints, the Shin-Kobe station had to be sited at a location between tunnels such that the Suwayama fault run under the entire length of the station (see this and this). From what I understand, the fault is expected to move a maximum of 5 cm over the lifetime of the station, and accordingly the station was designed as three separate structures to mitigate this problem. As a layman I don't know if this is sufficiently safe, but I suppose the Japanese experts think so.

In Singapore, although there are no earthquakes, there are quite a few known inactive geological faults associated with the initial formation of the island. Possibly the longest known fault is the Nee Soon Fault. Interestingly, the government planners decided to site the Springleaf train station to straddle across this fault. This is revealed by a paper describing the mitigation measures made when a tunnel boring machine tunneled under the entire length of the station, as part of SP Group's transmission cable tunnel project. Thankfully, the faults in Singapore are ancient and are not expected to move, so putting a train station over the Nee Soon Fault is not expected to produce negative safety consequences when it starts operations.

Just as noteworthy is that the same transmission cable tunnel project unveiled a number of other geological faults in Singapore that was previously unknown (see this). This is the result of tunneling 60 m underground, I suppose these faults were hidden by many meters of sediments over many millions of years after these faults cease to be active.

Update. I suppose I know nothing on this subject. This article, among others, describe the construction of Farringdon Crossrail station in London across a series of faults forming a graben structure. The throw in each fault is as much as 7 to 9 meters. It appears that the major construction risk was not so much tectonic movement, but rather the lowering of poor quality soils into the tunnel excavation level. Perhaps such stations are a lot more common than I originally thought.

Long Term Servicing Branch
2017
nuah
Before joining NCS, I have never heard of the term Long Term Servicing Branch in the context of Microsoft Windows. It was only after receiving the company-assigned laptops, then I noticed that Windows 10 Enterprise 2016 LTSB have been installed.

According to this Microsoft page, the Long Term Servicing Branch is intended for the special-purpose devices where the stability of features is desired for at least a couple of years. Hence, unlike the Semi-Annual Channel where major operating system updates are pushed out twice a year, new Long Term Servicing Branch releases are only rolled out every two to three years. This servicing branch of Windows also does not come with many of the in-box applications such as Edge, Cortana, Mail, Calendar, and OneNote, however the absence of all of these applications are not missed. The only application that is missed on Long Term Servicing Branch is the Store, which is presently the only place where Skype can be downloaded, so we have to dig up the installer for an older version of this instant messenger from another machine.

I personally find it slightly odd why the company chooses to install the Long Term Servicing Branch on the company laptops. But nonetheless, the present version of Windows 10 LTSB is 1607, although slightly dated, is sufficient for our current needs. There is no issue using Office on this laptop, and we have no problems installing and using Visual Studio on it either. And version 1607 is just exactly recent enough to support Docker, something which I briefly played with, with deeper involvement expected in the near future. But most of us software developers will prefer the Semi-Annual Channel instead.

By the way, Microsoft will be renaming Long Term Servicing Branch to Long Term Servicing Channel.

P.S. The company laptops come with drive encryption software, but this software is crap. Each time the laptop is turned on or restarted, I must enter my password before Windows start booting. However, moving the company-provided wireless mouse almost always causes extraneous characters to be entered into the password field, often making the keyboard non-functional. When this happens, the only recourse is to power off the laptop and then power it on again.

Weird Weather 2018
2017
nuah
Singapore ushered in 2018 in heavy rain. I was at the New Year countdown, and the rain got heavier and heavier as it approached midnight. The New Year fireworks took place in this very wet weather.

Some of the recent years saw uncharacteristically warm Decembers, but the uncharacteristically cool and wet weather continued into January. Particularly newsworthy was the "monsoon surge", in which wind speeds increased over the South China Sea, resulting in unusually chilly temperatures of as low as 21.2 degrees Celsius. While not totally unprecedented, the low temperatures was rather prolonged this time, lasting for more than a week. To me, this kind of weather is too cold. It was also reported that the monsoon surge also dumped half a month's worth of rainfall on parts of Singapore, causing a number of flash floods.

The weather subsequently eased but remained wet. And yesterday, it also hailed in a storm that downed quite some trees. During this storm, sailboats were hurled around by strong winds.

I have no idea how much weirder the weather in 2018 will be.

Performance Series Singapore 2017, Race 3 (10 km)
2017
nuah
This is my second and final race for 2017. Race 3 of Performance Series Singapore 2017 took place on 2017 November 5. The 10 km race flagged off at 6:30 am from Changi Exhibition Centre, went down a stretch of Tanah Merah Coast Road and returned back the same way to the start point. I personally find this kind of to-and-fro route incredibly boring, but this route is very flat and is great for gunning for a good timing. I felt on-form throughout the run, and I am satisfied with my timing of 00:51:00.6. My pacing throughout the race was also fairly good. However, the GPS recorded distance is only 9.77 km, and this timing is not my personal best - it was beaten by last year's Performance Series Race 2 by about half a minute for a very similar distance.

The location, being where the Singapore Airshow is held, is so out of the way. I cannot exactly describe the view along the route as scenic. Perhaps, the better word for it is desolate. Yet it is difficult to find many places in Singapore where the view of the sky is so broad and unobstructed. Changi Exhibition Centre is also located so far away from any form of public transport, such that the race organizers had to arrange shuttle buses in both directions, rather than just one direction which was the norm. Unfortunately, the bus for Serangoon MRT station only departed way past 9 am, when the bus ticket indicated 8:30 am, which meant that I lingered at the exhibition centre for about two hours with nothing to do.

Actually I am not entirely unfamiliar with this place, as I had attended the Singapore Airshow once, and also cycled along Tanah Merah Coast Road earlier this year. For this reason, during the race pack collection, I was able to inform two people how remote this location was while they hesitated buying the return bus tickets.

Official results:
Chip time: 00:51:00.6 (overall place: 61/1668, gender place: 51/873, category place: 25/622)
Gun time: 00:52:57.0 (overall place: 64/1668, gender place: 49/873, category place: 27/622)
Split 1 (5.0 km): 00:25:10 (5:01/km)
Split 2 (5.0 km): 00:25:51 (5:10/km)

?

Log in

No account? Create an account