Sunday, February 20, 2022

To Ring the Bell or Not

A Facebook group member posted an article about no-bell-price. I fully agree with the video posted about him following a person having mobility issue walking on a narrow path. However, a bicycle bell does have its purpose and use. LTA recommends that a cyclist should have a bell. So it does give cyclists a means of alerting others without using verbal alarm.

Before I continue, I will introduce three abbreviations.

1. "AS" - Alarm sound by just ringing the bell once as recommended by LTA.

2. "MS" - Muffed sound made by ringing the bell while holding to the bell so that it makes a clicking sound. This is my own recommendation.

3. "ES" - Emergency sound by continuously ringing the bell.

Basically a bell is for alerting others about pending danger between the bicycle and other users of the road or path. It is not for use by people who just want others to give way because he/she think that they have the right of way and want to zoom pass others.

The Facebook group member wants to show that we should be compassionate about people having mobility issues and thus are very slow and usually blocks the way when the path is narrow. For this, cyclists should just follow behind and let them take their time. 

This also apply to parents bringing children who does not know the danger posed by others. Those parents who have kids with them should restrain their child so that cyclists can safely go pass them slowly.

Two person may be using a narrow path. It will be difficult to overtake them even on single file. Cyclist should be courteous enough to just follow behind them unless they give way. After all, they don't have to walk single file on a narrow path. Usually they will give way if they notice cyclist are behind without being alerted.

There are able bodied people who liked to walk in big groups. They will walk three or four person abreast so that they can chat among themselves. A wide path is not even enough for them to walk on. For these people, cyclist should use "MS" method to let them know others are using the path and is moving faster than them. Kindness Movement Singapore also suggest confronting errant people to let them know what is right and what is wrong. So "MS" is just to let them know that they are blocking others.

"MS" can be used to alert cyclists in front that you are behind them and possibly trying to overtake. A verbal "bike right" is usually more polite.

"AS" should be applied in advance if the path user swing widely left and right. This is especially true for those novice cyclist who just learned how to cycle. However, if the cyclist is really a novice, a "AS" should even make them more unstable. Apply it with caution. 

"AS" can be applied to those who are crossing the path without looking out for cyclists. it cannot be applied to people crossing using the zebra.

For those brazen cyclist who just barge in and out without looking and posing potential accidents, This includes cycling overtaking on opposite path encroaching on your path. "ES" should be used. It should be used sparingly unless it is really a high chance of accidents. Be aware that "ES" may cause irritation to them and is a potential cause of highly charged dialog.

In conclusion, a bell is used to alert others. It is not for you to make others give way to you because you want to cycle fast. A shared path is for all to use and they have the rights to use it. Unless they abuse their rights while ignoring other users, Cyclist should not use bells to cause irritation.






Friday, November 19, 2021

Passing a URL to a PHP to Call GSX

 GSSX requires user site to be white listed before allowing access. Since our customer are using multiple applications that access GSX. The whitelisted server is not on the same server as our web program. User need to post data to the web server which in turn send a request to a central server which then send the request to GSX. 

Sending normal requests is simple but since GSX has many APIs that have a mix of "GET and POST"., The sending of data to GSX become complex as we have to send specific URL to get the right result. Now sending a POST/GET that contains URL as parameter is not that simple especially when the URL is mixed with other parameters. It need to be url-encoded properly.

PHP CURL uses query method to do both POST/GET thus the query works on both.

Luckily, there is a PHP function that could compose the post parameters. It is called HTTP_BUILD_QUERY. You just need to send an array of the parameters and it will compose the parameters properly. This including sending a URL as data.

The following is an example 

$data= array(

"id" => "1234567"

,"address" => "https://gsxserver.com/returns"

);

$params = http_build_query($data);

In your CURL request you simply use 

curl_setopt($ch, CURLOPT_POSTFIELDS, $param);

The central server PHP just need to get $_POST['xx'] to get the specific parameters.





Tuesday, November 02, 2021

Divorce for Christian

Marriage is a serious event  for a Christian. Gen 2:24 "Therefore a man shall leave his father and his mother and hold fast to his wife, and they shall become one flesh." Mark 10:9 Therefore what God has joined together, let no one separate."

Unfortunately, things can get sour between husband and wife. Divorce between Christian is even more serious as Jesus says “I say to you: whoever divorces his wife, except for sexual immorality, and marries another, commits adultery.” (Matthew 19:9 ESV)

Divorce for Christians thus becomes a taboo. Is there no way out? 

Paul mention that “To the married I give this command (not I, but the Lord): A wife must not separate from her husband. But if she does, she must remain unmarried or else be reconciled to her husband. And a husband must not divorce his wife. To the rest I say this (I, not the Lord): If any brother has a wife who is not a believer and she is willing to live with him, he must not divorce her.  And if a woman has a husband who is not a believer and he is willing to live with her, she must not divorce him.  For the unbelieving husband has been sanctified through his wife, and the unbelieving wife has been sanctified through her believing husband. Otherwise your children would be unclean, but as it is, they are holy.  But if the unbeliever leaves, let it be so. The brother or the sister is not bound in such circumstances; God has called us to live in peace." (1 Cor 7:10-15)

This means that separation is allowed. It also means  that divorce between Gentile and Christian is still possible. 

However, that classification is not that easy to achieve. Paul said “The husband should give to his wife her conjugal rights, and likewise the wife to her husband. For the wife does not have authority over her own body, but the husband does. Likewise the husband does not have authority over his own body, but the wife does. Do not deprive one another, except perhaps by agreement for a limited time, that you may devote yourselves to prayer; but then come together again, so that Satan may not tempt you because of your lack of self-control.” (1 Corinthians 7:3–5 ESV)

Paul also mentioned that "But if anyone does not provide for his own, and especially for those of his household, he has denied the faith and is worse than an unbeliever. (1 Timothy 5:8). Therefore a Christian who does not care for his wife, he is as good as a Gentile.

Jesus said “If your brother sins against you, go and tell him his fault, between you and him alone. If he listens to you, you have gained your brother.  But if he does not listen, take one or two others along with you, that every charge may be established by the evidence of two or three witnesses.  If he refuses to listen to them, tell it to the church. And if he refuses to listen even to the church, let him be to you as a Gentile and a tax collector." (Matt 18:15-17)

In conclusion, if a husband does not care for his wife and does not treat her well, separation or divorce is still possible after mediation fails to turn back the one who erred. This also applies to the wife who does not treat the husband well. Paul said "Wives, submit to your husbands as to the Lord." Eph 5:22

Again this blog does not sanction divorce. It is only after all efforts to make the marriage good then it is accepted.  Jesus said "Moses, because of the hardness of your hearts, permitted you to divorce your wives, but from the beginning it was not so" (Matthew 19:8).





Monday, September 13, 2021

Bible The temptation tests of Jesus

Matthew 4:1-11 describes the temptation that Jesus is being put into. Jesus is being led into the wilderness to be tempted by the devil. Obviously, Jesus is being tested like a human and not God.

The first test is the personal desire out of need. Jesus was fasting for 40 days and 40 nights. He was hungry Matt 4:2. The tempter is trying to induce Jesus to get the easy way out by acting as God instead of suffering as a human. Jesus answer is "Man shall not live on bread alone, but on every word that come from the mouth of God." How many of us could overcome our personal desire and not waver?

The second test is the pride in man. The test is on the attempt to show off that God is his backer. Nothing wrong? Many people pray to God for protection but they forget that they put themselves in center of focus instead of God. Moses made the mistake of striking on the stone instead of speaking to the stone as commanded by God. He forgets that he is not the one that is glorified in the act. The penalty is that he can only see the promised land but can never enter it Num 20:10-11. Job has done better Job 2:10. Jesus has the right perspective. He said "do not put God to the test" matt 4:7.

The third test is on power and greed. This test is a bit confusing but based on the standpoint that Jesus is tested as a human, it explains everything. How many can resist the kind of power and glamour of being in control. Jesus answer "Worship your God and serve him only" Matt 4:10 This is similar to what Jesus said in Matt 16:26 "What good is it for man to gain the whole world and lost his soul?"

If you looked carefully the three test are based on human self-centered behavior. 1. Provide for self. 2. Putting glory on self. 3. Get power for self. Jesus' answer put God before all. He has gone through the test and prevailed as a human.

Actually there is a ultimate test. A test which he was betrayed, abandoned by all and hanged between two convicted criminals. As a human he has to bear all the humility, being mocked and left to die forsaken even by God.  He prayed three times to be spared the agony but to no avail. 




Saturday, September 11, 2021

Bible and the Origin of Scam

 Origin of Scam is usually referred to as Origin of Sin. The latter concentrates on the wrong doings and the punishment given. This post concentrates on the scam itself.

God created man and put him to work in Garden of Eden. He gave the specific command "You are free to eat from any tree in the garden but you must not eat from the tree of the knowledge of good and evil, for when you eat it you will surely die. (Gen 2:16-17).

After giving the command, God then created animals before forming Eve out of Adam's rib. It showed that Eve did not receive direct command from God about the tree of knowledge of good and evil.

The serpent first step is create confusion. He asked "Did God really say you must not eat from any tree in the garden." (Gen 3:1)

Eve's reply is typical of a person who received second hand information. "We may eat fruits from the trees in the garden. but God did say 'you must not eat fruit from the middle of the garden, and you must not touch it, or you will die.'" (Gen: 3:2) That is not exactly what God's command. She has totally missed the fact about tree of knowledge of good and evil instead she only knows that the tree in the middle of the garden is forbidden to eat and she even added "you must not touch it".

The serpent said "you will not certainly die." (Gen 3:4) The serpent deny the fact about dying after eating the fruit. His next phrase seduces Eve about the good effects of eating the fruit. Surely, this is one fact that neither Eve or Adam is told. It directs away the fact about dying and concentrates on the benefit. 

By first creating confusion then sideline the fact with additional facts as incentive, Eve is seduced to do the wrong thing. Although Adam did not say anything, he is with her all the while (Gen 3:6) and is probably being seduced too.

Did the serpent say anything that is false? Not at all. Even the fact about dying after eating the fruit is also muddled and diluted by his first phrase. He made use of the fact that Eve probably don't know that the "tree in the middle of the garden" is actually the tree of knowledge of good and evil that is specifically forbidden to be eaten. So eating the fruit from the middle of the garden should be allowed because they are given permission to eat from any tree in the garden. Even if that tree in the middle of the garden is forbidden to be eaten, it is God that selfishly hides the benefits of eating the fruit by saying that they will die after eating the fruit. Sadly to say Adam and Eve did not die after eating the fruit. So the serpent is right about the not dying after eating the fruit.

Modern scam basically use the same tactic of confusion, and incentive. Most people don't know the true fact about things around them. They will willingly accept any one's word as fact without checking. Furthermore greed is one incentive that few escapes from it. Who to blame when they fell for the scam?





Friday, July 16, 2021

Setting up a Broadlink SP4L-UK Smart Plug

 SP4L-UK is a smart switch that can be controlled by hand phone via WIFI. It is compatible to Google Home. This model is suitable for Singapore home because it uses the same 3 pin plug configuration commonly used in Singapore. 

Now before you could do anything, make sure that your home wifi is set at 2.4G because this device is not a 5G compatible device. Most home network have both 2.4G and 5G wifi connection. You handphone will auto switch between two wifi connection automatically anyway. Only problem is that you need to specifically connect to your 5G network manually. While setting up, you must turn on bluetooth and use a 2.4G network on your phone.

Download BroadLink-Universal TV Remote app. Android users need to make sure no screen overlay app is running when setting up the app. You cannot turn on/off screen overlay if one is already running.

After setting up user login, follow the following steps.

  1. Plug the smart switch into the power socket. You will notice the LED on the switch blinks continuously.
  2. Click add device. 
  3. Choose "Wi-Fi Devices" 
  4. Select "Other Wi-Fi Devices". 
  5. Choose "Smart Setup" and click "Next". 
  6. Click "Done" ignoring all the information on the screen. 
  7. It will prompt you to enter your wifi login information. The SSID will be automatically chosen. Just enter password accordingly.
  8. After a while your device will be set up properly. The LED on the switch should go off.
  9. Set up the Name and room information for the device and you will be done.
In the even of error the LED blinking rate will go much slower. You need to reset it by pressing and hold the button near the IR sensor at the end furthest from the three pin socket. Wait till it blinks at a faster rate. It will be ready for you to try again. 

You may wonder why I choose a smart plug that is using only 2.4G wifi. Actually, there is not much choise. Furthermore, the range of the wifi is wider than a 5G wifi. Most manufacturer choose to use 2.4G wifi over 5G wifi. 

You can use your 5G connection to control the devices as they are all on the same router connection.







Thursday, July 15, 2021

Android Screen Overlay Switching Greyed Out

Screen Overlay is one facility on Android to have some app hovering over all apps so that user can quickly access the app anytime.

One thing Google never tell you is that once an app is run with Screen Overlay, You cannot turn on Screen Overlay mode. To turn on or off you need to go to to Settings then click on the wheel on top left of the screen then choose "Draw over other apps" after that slide on "Permit drawing over other apps". The selection is greyed out.

The only way to enable the "Permit drawing over other apps" setting is to completely close the app that does Screen Overlay then make the changes before enabling the Screen Overlay app again.