Fire and Forget Tasks With Django and Celery

Django is without a doubt my favorite web-framework, if not my favorite Python module. However, I feel Django is lacking in asynchrony and 'fire and forget tasks' in particular. Imagine you have a blocking task you would like to call from a view, middleware, or signal. Except, this task is ...

Read More

Travis CI: Getting Started With Testing Django Sites Using Travis CI And Selenium

TravisCI is a very powerful testing tool. It allows you to easily implement Continuous Integration into your Git/Github workflow. On a basic level, CI is running tests for every push in a repo. This is useful because if you write good tests, you can catch new bugs as they ...

Read More

Guide: Setting up an HTTPS secured Django website

Unfortunately, setting up your own web-server for a Django website can be very frustrating. For example, initially configuring this website took me around 15 hours of tinkering to finally be at a point where I could even begin migrating my Django project files. That is why I made this guide ...

Read More

Guide: Python, Getting Started With RestAPIs and Matplotlib

In order to pull data from a RestAPI in Python 3, you are going to need to use a module that is able to make requests to a given url. The appropriately named module that I typically use is called, "requests". This guide will actually pull data from a free ...

Read More

ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this

P   A   H   N
Y   I   R
And then read line by line: "PAHNAPLSIIGYIR"

Write the code that will take a string and make this conversion ...

Read More

Hackerrank Solution: Computing the GCD

Given two integers, x and y, a recursive technique to find their GCD is the Euclidean Algorithm. The algorithm states that, for computing the GCD of two positive integers x and y, if x and y are equal, GCD(x, y) = x. Otherwise GCD(x, y) = GCD(x - y, y ...

Read More

Hackerrank Solution: Almost Sorted

Given an array with n elements, can you sort this array in ascending order using only one of the following operations? 1. Swap two elements. 2. Reverse one sub-segment. Input Format The first line contains a single integer, n, which indicates the size of the array. The next line contains ...

Read More

Hackerrank Solution: Simple Array Sum

Given an array of integers, can you find the sum of its elements? Input Format The first line contains an integer, N, denoting the size of the array. The second line contains N space-separated integers representing the array's elements. Output Format Print the sum of the array's elements ...

Read More