Golang interface method – pointer receiver or value receiver

Recently I have been working with Golang interface.

There are lots of confusions on how to use interface in Golang, particularly how to implement the methods in interface. Should I implement pointer receiver, or value receiver? How to mutate a struct that implements an interface? Can I implement both? Continue reading

Algorithms for computing Pythagoras Sum

While helping a friend of mine with programming assignments, I stumbled upon a question on two different algorithms of calculating Pythagoras Sum (Pythagoras Addition), through a function called pythag

One algorithm is straight-forward, which is just  c = \sqrt{a^2 + b^2}. \,

The other, however, is very intriguing, it makes use of absolute, min, max and several lines of weird mathematical operations to get the result. Continue reading

NUSSU Election 2015

NUSSU Elections 2015 – Facts Consolidated

Disclaimer:

I am an outsider to the NUSSU Exco Elections 2015 (except for the fact that I am eligible to vote). I consolidated the information to serve as reference for anyone.

All information gathered from Facebook pages and NUSSU Website.

General Information on NUSSU Elections 2015:

Exco Elections 2015

NUSSU Elections: Who’s Running & Why You Should Care – The Ridge Magazine

Contesting Teams (in alphabetical order):

A Union That Cares

Team U

Incident 1 – August 23

Incident 2 – August 26 (estimated)

Discussions about NUSSU Elections on NUS Whispers

Cover photo from http://www.cibsejournal.com/cibse-news/make-your-vote-count-in-cibse-elections/

Bye Facebook

Bye Facebook

Facebook has been a part of my life for the past few years, but now it is the time to say goodbye.

This is a rather sudden decision as I just felt the urge to do this as soon as possible. However, I will attempt to rationalize the decision.

  • As a source of information, Facebook has done a good job in providing me with the latest updates on current issues, such as events happening in HK and Singapore. However, there are more reliable and convenient channels to obtain factual information, such as the BBC mobile app and local newspapers, so Facebook is not the best source for that.
  • As a way to share my opinions and engage in discussion, Facebook was a good platform. However, I have realized that debates on Facebook tend revolve around groundless claims, without factual backups and substantiations, understandably due to the “fast-food” nature of Internet. I used to enjoy arguing in this style and win the debate by some sort of sophistry but later decided to stop such meaningless acts.
  • As a way to connect with my friends, I don’t see Facebook helps, I do not really need to see their photos to stay connected, and most of the photos on Facebook are from “acquaintances” whom I do not care much. The messaging function may be something that I still use frequently, for people whom I do not have in Whatsapp contact. But I guess I just need a transition period before I get all my contacts to Whatsapp and WeChat.

All in all, the usefulness and reliance on Facebook is dropping for me. And I seem to have spent too much time randomly commenting on Facebook pages just to kill time. So why not take a break (hopefully a long one) and seek to do something more meaningful?

Bye Facebook.