Friday, July 21, 2017

Caldecott to King Albert Park

It was quite some time since I last blog about walking trips. This trip is from Caldecott MRT to King Albert park MRT.

The trip starts at Caldecott. Walking along Thomson Road to reach MacRitchie Reservoir. Bought a drink at Mushroom Cafe and immediately noticed this Cymbidium finlaysonianum orchid.

After walking along the lake side for a while, a Malay Viscount start to flash around so I am obliged to take a picture of it.

Further down, there is a maimed Multiline Sun Skink.

When I turned inland, a black bird perched on a barren tree trunk. But I cannot identify it before it flew away. Guess it is a Drongos.

A bit further down, an Archduke settled in front of me. Again I am obliged to take a photo of it.

Walked across the golf course with nothing much to see but meet quite a number of hikers coming from opposite end. Further down, I saw Purple Heron. This one is probably the same one I saw earlier but flew away before I can take a photo.

An Oriental Macpie Robin can't resist to show off in front of me again.

Before I move away from the reservoir, a bright colored Common Posy flashing its way around. I had to stop and wait for it to settle down. I seems to be attracting all the living things in the reserve, it settled right within my camera shot distance.

Further in land, there is a young plant that is full of  Branded Imperial. They are so engrossed that I can even walk very near them.

A few steps away, two species of damselfly came by. These are large species. I can't tell its specie name but got a hint from a fellow observer who took a picture nearby on the next day. It is probably a Vestalis amethystina. It should have very nice purple wings but this two are either dull brown or clear wings.

The next animal I come across is at the dirt track which is still labelled "Riffle Range Road". It is probably a Robber Fly. Interestingly there are a number of observation of this specie in Singapore but no one can positively identify to specie name. Just look at the muscular legs.

Nearby a Mycalesis appears. I have problem distinguishing between species so just stay at gender level.

Near the Army camp, saw a family of Treehugger. A male and a female resting side by side.

Just before reaching the real Riffle Range Road, a Yellow Vein Lancer makes its debut.

Along Riffle Range Road till King Albert Park, there is no other sighting. The trip ends at King Albert Park MRT.

Total distance covered is 11.48KM.

Almost all the photos are already shown so there is no album link.
Since this is a repeat trip, it is not uploaded to Wikiloc.

Thursday, June 29, 2017


上图是一个YouTube视频。 论点是“元代人为中轴线偏差”。后来又看了郭晓强的文章(觉得后者有理由。






Thursday, June 08, 2017

Doing a Filemaker PO

Doing a PO is quite simple thing. It gets a bit tricky when you want to create PO number and do sums that is stored in the main table while the PO items is in the related table and fill in the items one by one. Each record is related to the main table by the PO number.

First the main table must have a self increment field. This will act as the PO number. You can add prefix or post fix with it. And to add in the fun you can do "Right('00000' & table::idfield;6)" to get a nicely formatted 0 pre-pended text and store it in another calculated field.

The first thing to do is create the relation. Drag the previously mentioned calculated field to join to the sub-table field. Now click on the link itself and it will display a pop up like this

The trick is to check "Allow creation of records in this table via this relationship". When you check this you are actually telling FM to create the record with the specific PONo::POID value inserted into PO::Po Number automatically if you start to fill in PO fields. The relation will be automatically created this way. PO table will also add new record for you automatically. Lets go to the layout to do a practical.

In the layout You add PO Date and Supplier from PONo. You will then create a portal and choose PO as the relation table. It will prompt you for what fields in PO to add to the portal. Just choose any fields other than PO Number. Add the appropriate field name title. Exit editing after that.

Now you can add records. First click "Add Record" from the menu. It will add a new Record in PONo table. Fill in PO Date and Supplier. Click the top left end of the portal and you can enter the PO table fields without having to create the record. It will self create and automatically add the relation field info to establish the relationship. You can continue to click on the area below the last record to create more records.

The next trick is to do calculations. The PO table have a Unit price and a quantity field. There is a field that do the sub price by multiplying Unit price with Quantity. There is also a summary field that sums the sub price (not incremental). This is the field that we are suppose to update back to PONo table. The PONo also have a GST calculation that add a specific percentage of tax. Finally, there is a total sum field to show the total sum.

Now getting the summary field back to PONo is no issue. Just do a calculated field at PONo to get the PO summary field value. The GST and the Total value is then calculated from there.

Problem appears once you try to do this. The calculated fields in PONo will just go blank once you add some Unit Price and Qty. I don't know whether it is Filemaker bug or not but it gets irritating to not be able to see the calculated value.

Luckily there is a way out. The method used is "script triggers". On the Unit Price and Qty field, add a trigger "on Object Exit" for both. The trigger script will do a object refresh by name. You should name Unit Price and QTY plus the overall total field. Refresh all three fields in sequence and you solved the issue. You may want to do "commit" first before doing refresh.

On the report layout just use a list form and put PO fields in the body with the PONo fields in header or footer accordingly. You just got yourself a nicely done PO report.

Tuesday, May 23, 2017

Filemaker Conditional List

There is often a need to limit the lists that is available for selection in an input field. Normally we would use a list that is based on a related table. User either selects a value from the first table or key in a value in the first field. That input value is linked to a related table. On a second field it uses drop down list and the list is taken from the related table. The list will only show the related data based on the relation.

Now there is this condition that requires multiple selection with conditional lists. Lets say a world wide company wants to know a particular group of sales person's performance from a particular state in a particular country in a particular region. Normally it would means that the user chooses a religion like Asia first. Then from the list of Asian countries, choose the country. Then the user narrow down further by choosing a state from the country before he can get a list of sales person's performance.

The first try is to create the fields to do the different selection. Therefore, there will be three input fields 
  1. Region
  2. Country
  3. State
Using the method described in the first paragraph above, It will be easy to choose Region from a unrelated table (sales table). The country field list will then be obtained by joining the Sales table to the input table linked by Region. The question will then be how to get States list based on the Region and Country chosen. Well, you guess it right. It is by joining the sales table with another instance of the sales table linking by Country. Normally this setup will be perfect because Country will be unique. There will not be two Countries that has the same name. However, in real life, there will be instances of duplication.

For example, we want to categorize hardware based on its configuration and make. So we have Brand, Processor, Screen Size, HDD, Ram. Now Brand is unique but Processor might not be. Neither did the rest of fields. Using the Sales method mentioned above, it will be impossible to choose Screen size based on Processor selection. It looks logical to self join the tables like Product::Brand->Product 2::Processor->Product 3::ScreenSize... In actual fact, by the time you choose ScreenSize list, The list is only based on Processor and not by Brand and Processor. It could be a Filemaker bug but that is what I found out.

In order to avoid such confusion, there is a need to revert back to the first paragraph method by just a simple join between two tables. First we have a list from Product::Brand without relation. The Processor input field will then have a relation using "Brand" and the list is taken based on the input table::Brand relation.

The ScreenSize input field then requires a separate product table instance that is joined to the input table by Brand and Processor. The HDD input field list will then have yet another instance of product table that is joined by Brand, Processor and ScreenSize. Finally the Ram input list will be based on a third instance of product table joined by Brand, Processor, ScreenSize, HDD.

By doing this method of joins, user can be assured that the result is exactly as what was defined in the various input fields.

Thursday, April 13, 2017

To Condemn City Harvest Leaders or Not

Recent reduced sentence for City Harvest caused quite a stir. NewNation published an article on 9th April 2017 titled "No Highly Religious S'porean Condemn 6 City Harvest Leaders for Going to Jail". A commentor said "The leaders of our conservative religious leaders do not know what to say...".

On a FB share on the above report, I commented that "Other religious (faith) leaders will refrain from condemning to preserve religious harmony. Christians do not condemn (John 8:11). Indeed there is no one who condemn."

The topic is actually whether to condemn the church leaders. John 8:11 is a typical verse on the topics of condemnation. However, the story is about Scribes and Pharisees trying to trap Jesus. Jesus said "He who is without sin among you, let him be the first to throw a stone at her". After all have left, he then confronts the real issue person to person - the sin committed by the woman.

John 8:11 is the very verse that is applicable to the NewNation article for Christians. Why must we condemn people in public? Gal 6:1 says "You who live by the Spirit should restore that person gently".  Matt 18:15-17 starts with "if your brother or sister sins, go and point out their fault, just between the two of you". 1 Tim 5:20 fits the description of Mat 18:17 but not before other previous measures (vs 15-16) is done. James t:19 says the same thing as Gal 6:1.

Forgiving is better than condemning. 2 Cor 2:7. "so you should rather turn to forgive and comfort him". Luke 17:3-4 puts forgiving even further.

Ultimately, if a person refuses to listen, Matt 18:17 should be used rather than condemnation. 2 Thess 3:14 says the same thing. However, that is not the end of the story. Eph 4:32 say to forgive. 2 Cor 2:6-7 also says "forgive".

Monday, April 03, 2017

Boycott the Earth Hour Stunt?

Read the article "If you really care about climate change, you should boycott the ridiculous Earth Hour stunt" on "Independent" by Adam McGibbon.

He thinks that "Earth Hour" is a stunt. It is a stunt. It is a drive that bring the awareness of climatic changes to the public. The aim is not to actually make an effort to reduce the climatic change effect during the hour. It is just as a "symbol" (according to Wikipedia). Without the mass drive, many don't even get to be aware of such efforts without WWF drive.

I have not heard of the author or his activities before. He might be doing a great job to bring awareness on his part. However, his effort is limited to what he can do. Whatever he is doing has not reach to my end of the world yet. At least WWF is driving towards general awareness worldwide. Both are doing something towards bringing awareness of climatic change to the people. Why try to discredit what WWF is doing?

In is article he said "just 90 of the world's largest companies are responsible for 2/3 of all carbon emissions." What can he do to stop these companies? Isn't that the companies produced based on demand? Without bringing awareness to the general public, small bands of environmentalists could not even touch them.  

Let's just work on climatic change reduction in each's own way without trying to discredit other's effort.

Thursday, March 30, 2017

Filemaker hiding field object in Table View

There are times when we don't want to see some fields based on the values of another. In form view you can easily set it to "hide when" and set the condition to hide it.

However, in table view, the field is not hidden (up to V15). What are other means to hide the field?

I used a simple "conditional formatting" setting and set the text color to the background color. It is still shown at least not distinguishable to user.

It is a work around for Filemaker Table view which is unable to hide the object despite the "hide when" setting is set.