How long does it take to see results of volunteering?

Context: I was involved in a discussion with some folks on volunteering and educating children (in general) and up came the question of how long do you need to take to see results?

My take: It is definitely not effective if you only teach for a single time or two. You will only see improvements when you accumulate these lessons over a certain period of time. Depending on your learning objectives, it may take a year, 2 years or many more – 十年树木,百年树人 – you are in for the long haul.

Lessons at the Supermarket – Food

Other than math, are there other lessons that can be taught at the Supermarket? It turns out that you can teach them about food!

You may ask “Doesn’t children see food everyday? What’s there to teach?” Like what I’ve mentioned earlier, there are certain missing links that we take for granted as common knowledge but is entirely novel to children. Teaching them about food at the supermarket not only increases their vocabulary, it also exposes young children to the different food sources as well as the chance to see meats and vegetables before they are cooked.

Handling line endings on Windows with git

Note to self: When collaborating on different platforms, one of the most common issue is line endings – LF on Mac/Linux and CRLF on Windows. With git, you can address this issue in the following ways:

1) Configure Global Settings

1) Windows users: git config --global core.autocrlf true
2) Mac/Linux users: git config --global core.autocrlf input

2) Configure Per-repository settings

echo "* text=auto" > .gitattributes
git add .
git commit -m "Files play nice in Mac, Linux and Windows"
git push origin master

Additional reading:
StackOverflow thread
Github help

Reading excel files with readxl R package

Recently, Hadley Wickham introduced a new package to read Excel files (XLS, XLSX). The main advantage is that no external dependencies is required for readxl. (xlsx package requires Java Runtime to be installed)

With xlsx:

url <- ""
GET(url, write_disk("iris.xlsx", overwrite=TRUE))
iris <- read.xlsx("iris.xlsx", sheetIndex=1, header=TRUE)
head(iris, 3)
##   NA. Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1   1          5.1         3.5          1.4         0.2  setosa
## 2   2          4.9         3.0          1.4         0.2  setosa
## 3   3          4.7         3.2          1.3         0.2  setosa

With readxl:

url <- ""
GET(url, write_disk("iris.xlsx", overwrite=TRUE))
iris <- read_excel("iris.xlsx")
head(iris, 3)
##     Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1 1          5.1         3.5          1.4         0.2  setosa
## 2 2          4.9         3.0          1.4         0.2  setosa
## 3 3          4.7         3.2          1.3         0.2  setosa

Find out more on the features, usage and installation at its Github repository.

Download files over HTTPS in R with httr

To download a file over HTTP connection, we normally use download.file command in R, for example:

url = ""
download.file(url, "iris.csv", quiet=TRUE)

For HTTPS connections, download.file may give you some issues. In situations like this you can consider using the httr package to download files:

url <- ""
GET(url, write_disk("iris.xlsx", overwrite=TRUE))

Lessons at the Supermarket – Math

The supermarket can be an excellent place for young children to learn basic math and the concept of money. For example, you can give a child some money, say 5 dollars, to purchase items that they want to buy. This can be a form of reward for the child and at the same time, offering them opportunities to practice their counting and familiarize themselves with notes, coins, cash cards and payments.