Category Archives: Uncategorized

Easily Replace Characters In A String

Leave a comment

Filed under Uncategorized

Reasons Why You Should Keep Learning C/C++

I found this post interesting. C++ is hard and vast, but the payoff is immense.

How Not To Code


Many beginners and students find C/C++ language hard to master because it requires them to think a lot. There are many language-specific quirks, especially in C++, that give students and programmers a hard time. It also has a steep learning curve and is rarely used in modern application development, which prompts many people to give up learning C/C++. However, even with these challenges, it is important for students to continue learning this programming language. This article highlights reasons why one should keep learning C/C++.

View original post 444 more words

Leave a comment

Filed under Uncategorized

What a “freak” occurrence taught me about installing R packages

Adventures with R

I was trying to set up a particular Rmarkdown document in such a way that other users on our team, who might not have all the necessary packages installed, could get them automatically.

The first time I tried it out it worked perfectly, but later when I re-knitted the document, this funny window popped up

R package list

I was quite surprised! Oh, what had I done now?

To cut the story short, the answer lies in the R documentation via help('install.packages'):

part documentation for R function

So, argument pkgs (3rd paragraph), when zero-length, is what produced the popup. After installing the missing packages in the first pass of the code I wrote, the vector not_installed was subsequently zero-length. As an example, when one does this…

…our listbox appears.

I therefore decided to throw in a conditional statement to skip the installation step in the event that all required packages are already present:


View original post

Leave a comment

Filed under Uncategorized

Why I decided to become a leader


During one of my first stays in the US I read ‘The rise and fall of the Empires’ by historian Paul Kennedy. This was indeed a superb book. But what I learnt there was also what brought such empires up and down.

What historians have learnt behind the Napoleon story is also the talents of generals and scientists such as Dupleix, Davout, Kleber, Lannes, Lefebvre, Bessières, Champollion, Monge, Berthollet, Fourier and many other ones who have made it possible.

When seeing such a sum of talents and incredible people among the Empire leaders, I had no hesitation, I wanted to help this Empire grow, make it big and fun and build great achievements alltogether.

  1. GREAT LEADERS : I have realized along playing the Empire EK game how brilliant and thorough were many of my new friends, who have taught me so much. And they are both reactive…

View original post 254 more words

Leave a comment

Filed under Uncategorized

Dancing between character vectors and formula objects

Adventures with R

I was determined to exactly reproduce a composite box-and-whisker plot that I had been seeing in the book Introduction to Statistical Learning. The data are from a set of 3,000 observations called Smarket that is found in the R package that goes with the book, known as ISLR. It’s a pretty simple plot:

3 boxplots of stock market data

First, after loading the package with library(ISLR), one may want to take a cursory look at the data frame, which has 9 variable columns, using View(head(Smarket)).

I was able to successfully put together the plot with this code:

I realised, however, that I was seriously violating the DRY principle, so I tried to come up with a function instead. I struggled a bit with this because I didn’t know how to supply a character vector argument and place it into the “formula” bit that is required as the first argument…

View original post 110 more words

Leave a comment

Filed under Uncategorized