Skip to content

Instantly share code, notes, and snippets.

View loynaps's full-sized avatar
🎯
Focusing

Lloyd Napata loynaps

🎯
Focusing
View GitHub Profile

Using Pyenv with virtualenv ( Ubuntu / Linux. Sorry Windows :-( )

This is a little guide to installing pyenv with virtualenv so that you never again need to worry about whether you your version of Python and pip packages are working. Pyenv is like virtualenv except that it lets you install any version of Python and then by using the pyenv plugin for virtualenv it is possible to create a box with the Python version you want plus all the packages you need.

Installing Pyenv

Run the command below to git checkout pyenv to your home directory

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
@loynaps
loynaps / haversine.py
Created August 17, 2017 19:20 — forked from rochacbruno/haversine.py
Calculate distance between latitude longitude pairs with Python
#!/usr/bin/env python
# Haversine formula example in Python
# Author: Wayne Dyck
import math
def distance(origin, destination):
lat1, lon1 = origin
lat2, lon2 = destination
import requests
from bs4 import BeautifulSoup
import time
# We've now imported the two packages that will do the heavy lifting
# for us, reqeusts and BeautifulSoup
# This is the URL that lists the current inmates
# Should this URL go away, and archive is available at
# http://perma.cc/2HZR-N38X

Find the Difference

C++ 11

1. Approch to Solving the problem

My approach to solving this problem is to first find the largest character in the given set of characters by ASCII value for the pair of strings

Once I have the largest characters, I create a counting array that counts the numbers the characters in each strings. the length of the count arrays

Challenge Name

Language Version (e.g Python 3.5.4)

1. Approch to Solving the problem

Explain the thought process behind the algorithm you designed to solve this problem.

2. How to compile and run this code

Give step by step instructions on how to compile your code.