# Recent Posts - What I've been saying

## Adding a Generic p-norm in Modern C++

In this article, I will show how to use modern C++ features such as fold expressions, variadic templates and type-traits to make a safe, stable and generic $p$-norm function. Read more »

## Getting stock price in C++

It seems to be a common problem that people wish to be able to get the current price of a particular stock/share, so I figured it would be a good idea to write a brief article on the easiest way to get the current stock price using native C++.

In this article, I will be making extensive use of the C++REST SDK, also known as Casablanca. It is an open-source, cross-platform SDK initially developed by Microsoft. I will also be using the Yahoo! Finance query engine as the data-source for our query.

I will be working with Visual Studio, which makes Casablanca trivial to install and use; simply right-click on your project and select “Manage NuGet Packages…”, then search for cpprestsdk and install it. If you are not using Visual Studio, you can find comprehensive installation instructions here. Read more »

## Finished SanEco Website!

Hello all,

It’s been a long time since I last posted on here; and now I’m in my Easter break I have a ton of work and revision to do, but I will try and post more frequently!

I just wanted to post about the new website that I’ve created for a student-run NGO which aims to improve the lives of thousands of people in Kenya by using a social enterprise model to provide people with sustainable sanitation solutions.

You can find their new site here, so please check them out as they do a lot of awesome work with huge impact.

Thanks!

## Sherlock and Probability (in general)

I’ve recently been exploring HackerRank, a wonderful (and somewhat addictive) site with interactive programming problems and I came across one of the problems in the Probability section and thought that it would be interesting to share a slightly more probabilistic approach here.

The problem (loosely stated) is that given a binary string $S$, and two randomly selected indices $i,j\in \{1,\dots,N\}$, what is the probability that: $S_{i}=S_{j}=1$ and $|i-j|\leq K$, where $K \in \{1,\dots,N\}$. Read more »

## Automatic allocation on the heap or stack

In response to one of the Google+ comments (which can be found here) to my post on how to create a Tensor class, I have decided to write an article on how to modify the CTensor to use a storage class which uses automatic allocation on the heap or the stack depending on whether a stack overflow is likely.