Blog

Home Renovations

Front Porch

The front porch was a complete DIY project. The railings were losing their colour and rusting. The steps had large gaps in them and the cement was chipping. I got some rust-proof black paint for the railings (and recoloured the house number as well). I used mortar mix and outdoor paint for the steps. The whole project took about a weekend and a lot of elbow grease, but it was not difficult.

Continue reading




How to Host an R Shiny App on AWS EC2 via Shiny Server and RStudio Server on a Windows Machine

Shinyapps.io is a great free resource for hosting your first Shiny app. However, the server space and computing power is quite limited. Upgrading to the cheapest option is $9/month which is more expensive than most web hosting companies. So is there another option to be able to host your Apps without making a dent in your wallet?

There is! Shiny Server is an open source platform that allows you to host multiple Shiny applications and can be hosted on Amazon Web Services (AWS), which charges reasonably and even has a free tier (we will be using this in today’s tutorial).

Continue reading




How to Create an Interactive WebApp using R Shiny

I am a Data Scientist for the City of Toronto and my objective for this project is to illustrate how citizens can use Open Data to create their own tools and dashboards to understand their locality better. Here is the application I developed.

My code can be found on GitHub and if you’re a visual learner, feel free to follow my short video series on this topic (Work in Progress).

Continue reading




Using Python to Download Yahoo Fantasy Sports Data into a Spreadsheet

I’m the self appointed data steward for the office hockey pool. We award small prizes for the team with the highest points every month. This requires saving the total points and standings by team at the beginning of each month. In years past, that would require me to log in on the first of the month and copy the League Overview table into an excel spreadsheet. As you can imagine, sometimes I’d be off by a few days or even miss a month entirely.

Tracking monthly points for my office hockey pool
Continue reading




Dynamic Pricing: How MLSE Controlled the Sale of Raptors NBA Finals Tickets

Full Disclosure: I am a Raptors’ Season Seat Holder and an avid fan

Someone paid $76,477.50 CAD for a pair of tickets to Game 1 of the NBA Finals in Toronto. The average household income in Toronto is $65,929 CAD.
The average ticket price of NBA Finals games in Toronto is $1,933 CAD. With these unbelievable numbers, what’s a fan to do? Do you fork over a month’s worth of income to hopefully see your beloved basketball team fight tooth and nail for a championship? Or would that money be better put to use towards a nice 70′’ TV to watch the game with family and friends and still have enough left over for your child’s college fund (RIP OSAP)? I’m not going to tell you what to do with your money, but in this article I plan to break down the science behind ticket pricing.

Continue reading




Free Local Pickup Option with Shopify

Shopify is great! It helps you ship your products all across the world for discounted rates. But what happens when someone down the street orders from you? Are they going to pay the extra few bucks to get it shipped? Most e-commerce stores don’t have a physical location so they can’t just come down to your brick and mortar to pick it up. Unless you’re selling high frequency, you probably have the time to have them meet you at your local mall to pick up their product(s). also, if you provide free shipping, this helps save you time and mitigate shipping risks.

Unfortunately, as of writing this article, there is currently no way to have a local pick up option in your Shopify shipping settings without having to pay monthly for an external app. It got me thinking, why is such a simple issue not addressed by Shopify? Maybe it’s to help you scale. Quite frankly, our shop (Ayah) works on low volume and we need to make sure the package gets shipped safely due to the fragile nature of our business (artwork). So it doesn’t make sense to pay so much to ship when I can just arrange a pickup meeting with my customer.

I have figured a worked around method to allow for our customers to have a free shipping option if they live nearby and are willing to make the journey.

Continue reading





How to Tag Products on Instagram with a Shopify Site in 10 Steps

UPDATE: AS OF SEPTEMBER 2019 FACEBOOK AND INSTAGRAM HAVE CHANGED SOME OF THEIR FEATURES AND THIS GUIDE IS OUTDATED. Feel free to try the steps and see if it’ll work for you, but beyond that I cannot help. Sorry!

My wife runs an e-commerce website for artwork. Her main customer base is on social media so she needs her store to connect to social media platforms in order to optimize all her sales channels. Her e-commerce store is based on a Shopify backend. We chose Shopify over alternatives like woo-commerce because it was easier to start up and the support they offer is parallel to none.

Facebook was by far the easiest connection, within a matter of seconds, we got the artwork for sale on the Ayah Collective facebook page without any issues. However, Instagram product tagging has become a headache that we could not solve. Until now.

Continue reading





Where the Money Comes From: Toronto Councillors

The Toronto Municipal Election is scheduled for October 22, 2018. Incumbent mayor John Tory is running for re-election, but there is expected to be a lot of change in terms of those governing the city. Toronto City Council has added the new wards in the downtown core to account for the rising growth in population at the city center. In addition to that, some current councillors are not running for re-election. I would like to do some analysis on the campaign contributions to candidates running for mayor and councillor positions. Who received the most campaign contributions? Has anyone received the most donations for their position in their ward, but fail to win the election? Who is contributing the most money to these elections? These are some questions I’d like to answer using real election data.

Data was obtained from the City of Toronto Open Data Catalogue. Python code used for cleaning the data can be found on my github.

Continue reading





Was there a Toronto Real Estate Bubble?

Background

The Toronto Real Estate market (and it’s surrounding areas – the GTA) have been red hot coming into 2017. According to the Toronto Real Estate Board (TREB), home prices on average have risen over 65% from 2012 to 2017 (TREB Historic Statistics). I decided to pull the TREB numbers into an excel sheet and see if there was anything we could learn from the data.

It seems the average sales price for homes in Toronto has not gone down in 20 years! That’s incredible. If you were to buy a home in 1996 for the average price of $198,150 and sold it in 2017 for the average price of $822,624, you gain a 315% return on investment! Of course hindsight is 20/20 and considering home prices took a dip in the 90s, you would be a little bit more hesitant on purchasing a home for investment purposes.

That being said, young Torontonians are currently facing a dilemma of being unable to afford purchasing a home due to the average 7% growth rate in sales prices since 1997. The median household income in Toronto was $78,373 in 2015 (StatsCan). Assuming a family making the median household income plans to get a mortgage, it is impossible for them to get a home for the average home price in 2017. At most they’ll be able to borrow $350,000 on top of their down payment towards paying for a home (CIBC Mortgage Affordability Calculator). Some critics have even classified the unprecedented growth in the GTA as a housing market bubble with an inevitable impending crash.

To combat these unprecedented increases and to help home ownership for Toronto residents become a reality, the Provincial and Federal governments have respectively introduced new laws. The provincial ruling focuses on creating a tax for foreign buyers that hold their money in speculation that their real estate investments will go up. The Federal government’s approach was to protect home owners’ ability to pay their mortgage payments if the interest rates go up. Currently in Canada, interest rates have been hovering near an all time low since the Global Financial Recession of 2008.

Bank of Canada overnight rate 1990 – 2018. Source: TradingEconomics.com | Bank of Canada

Non-Resident Speculation Tax (NRST) – effective April 21, 2017

More commonly known as The Foreign Buyers Tax, the NRST is a 15% tax on the purchase or acquisition of a residential property located in and around the Toronto region (especially the Greater Golden Horseshoe Region – GGH) by a foreign entity. The NRST was implemented in Ontario following a similar program to mitigate the rising prices of homes in British Columbia. The provincial government of Ontario stated that foreign entities accounted for 3.8% of transactions in Toronto during the season after the implementation of the tax. This might seem like a small percentage of the market, but removing those properties can impact the liquidity of the real estate market.

Residential Mortgage Underwriting Practices and Procedures – effective January 1, 2018

More commonly known as The Mortgage Stress Test, the Office of the Superintendent of Financial Institutions (OSFI) set a guideline that required uninsured mortgages to pass a “stress test” for the qualifying interest rate in a mortgage to be greater than the 5 year benchmark rate + 2%.

For example, the current 5 year benchmark rate is 5.14%, so in order to get an uninsured mortgage, one would have to be able to pay mortgage payments with an interest rate of 7.14% (5.14%+2%). Uninsured mortgages in Canada are generally mortgages that had a 20% or greater down-payment. Thus, the borrower would not be required to pay CMHC fees to become insured so there is no protection for the lender if the borrower defaults. Continue reading





How to Import Snapchat Spectacles Videos into Instagram

Snapchat Spectacles videos are simply amazing. They’re HD and you can rotate your phone to see more angles of the same video. Furthermore, the fact that they double up as sunglasses, allows you to take a stable video without carefully holding your phone out in front of you. Unfortunately you cannot currently take pictures with the Spectacles, but I’m looking forward to that future capability.

The videos can be exported outside of the Snapchat app so you can share it with friends on other social media platforms. Unfortunately, once exported, the videos come out to be circular with a lot of white space in a square frame. So how can you post these amazing videos on other social media platforms? This blog post will focus on how to select the optimal viewing area to share videos on Instagram. You can then extrapolate this technique to share videos on other platforms as well. Find out how to do it in 3 easy steps below!

Continue reading