# Parallel Processing and Programming

A summary of what I have learned over the years.

# Introduction

My background in Parallel Processing and programing comes from taking hobby programming projects, online Java programming classes and completing two Udemy courses on the subject of Parallel Computing. I have designed a Node.js program that takes Youtube videos and burns subtitles onto the video. My program splits up the number of videos to be processed into tasks which are divided programmatically depending on how many cores the computer has. The tasks are completed in parallel and provide significant throughput compared to processing the videos one by one. I utilized my…

# Python with Kristoffer Hebert Part 9

The goal of this article is to graph and calculate the yearly return of a portfolio of five stocks. The stocks I picked were Amazon: AMZN, Microsoft: MSFT, Starbucks: SBUX, Boeing: BA, Costco: COST.

Steps
1. Gather portfolio of five stocks by fetching data from a Yahoo Finance API for 2018 using pandas_datareader.
2. Calculate the simple rate of return and the average rate of return in2018 for each stock.
3. Calculate the return by combining the sum of multiplying the weight of each stock by the stocks average rate of return.
4. Graph this data using python library matplotlib.

# Overview

I have always had trouble motivating myself with traditional S.M.A.R.T goals. They seem so small and find a hard time caring about them.

I am a believer in what I call Heroic goals.

Heroic goals are big motherfucker goals that you know you cannot achieve but work heroically towards them anyway. I do this because it inspires maximum effort.

I believe I achieve more, despite failing, with these kinds of goals.

# My Goals and the Results

1. Climb Mt Rainier
2. Complete 36 credits towards my Computer Science Degree

## The Process

1. I hired a Physical trainer
2. I hired a Diet Coach
3. I regularly hiked every Sunday and even traveled…

# Overview

Google test is a unit testing framework for C++. It uses boolean values to test C++ code. The two tests are ASSERT and EXPECT. Use ASSERT when you want to the test runner to stop if a test fails.

## File Layout

`libmain.cppfibonacci.cppfibonacci.htest/main.cppbuild.sh`

Lib is a folder for installing packages like Google Test. I had a hard time installing in for OSX, but this article helped me.

The main.cpp contains an application that lists the Fibonacci numbers from 1 to 20. It pulls the code for the function from fibonacci.cpp and fibonacci.h defines the arguments for that function.

# Overview

Arrays are a fixed length list of indexes paired with values. Pointers are the memory addresses of variables. Operators tell the C++ compiler to manipulate values in a specific way. Class Friends have access to private and protected attributes of other Classes.

## What are Arrays

In C++, Arrays are a collection of index value pairs with a fixed length. You access values by selecting a valid index. Indexes in C++ Arrays begin at zero.

Array Examples

`string groceryList = [5];groceryList[0] = “Tomatoes”;// Another way to intialize Arraysstring groceryList[] = { "Tomatoes", "Potatoes", "Carrots"…`

# Overview

A Class is a template for creating new objects. For example, a factory assembly line where a die-cast press presses metal into widgets. Classes are the die-cast and objects are the metal widgets.

## What are Classes

A Class is a container, that has attributes of data, and class functions, also known as methods. Classes construct child objects and pass it’s own attributes to the child objects. Classes can also be extended, meaning attributes are copied and overwritten as a direct Class.

`// Defining the DieCast Classclass DieCast {…}`

## What are Objects

Objects are instances of Classes. Objects inherit the attributes of the Class and are…

# Overview

## What are encapsulation, inheritance, and polymorphism?

Encapsulation
A Class in Object Oriented design is a container for data and methods. Classes use encapsulation to manage access to attributes, such as methods and data, contained within itself. In the C++ language, encapsulation in Classes is achieved with attributes like: public, private, protected and static. Public Class attributes are accessible everywhere. Private Class attributes are only accessible to Class methods within itself. Protected attributes are accessible to itself and Child Classes of itself. Static attributes are only available to the Parent Class, but not Class constructed object.

Inheritance
Inheritance in Object Oriented design describes the relationship between Parent Classes…

# What is a Dynamic Structure?

Dynamic structures or Dynamic Data structures can remove or add memory as needed at runtime. Common examples are Linked Lists, Heaps, Stacks, Queues and Trees.

Static Memory
Static Memory means memory size is fixed and determined at compilation. Imagine a room with 3 boxes. You fill 3 boxes and can’t add more items to that room. In languages like C++, the Array data structure has a fixed size. The Vector is a dynamic length Array in C++.

`// Compilation// Arraylet x = Array(3)console.log(x.length)// returns 3x[999]// returns undefined, because index does not exist`

Dynamic Memory
Dynamic…

# Overview

Every language mentioned in this article uses the class keyword. C++, Java, and Node.js have similar syntax for extending Classes. The same is true for instancing new classes. Python does not use extends syntax but uses the parent class as the first argument.

## Extending Classes

Java and Node both use the extends keyword, when extending classes. Python passes the class as the first argument, since the first argument of a function is always self. C++ uses the colon syntax as it’s extension keyword.

`// C++ class TodoApp : public Todo {…}// Javapublic class TodoApp extends Todo {…}// Node.jsclass TodoApp…`

# What is a High-Level programming language?

High-Level programming languages are optimized for human to read and write. Unlike Low-level programming languages, Memory and CPU resource management is generally handled automatically by the language. Usually have open source package repositories like NPM or PIP, where people can share reusable modules of code. Additionally, High-Level programming languages are compiled or interpreted from human readable code into machine-readable code based on the computer.

## What are some examples of High-Level programming languages?

Python, Ruby, Node.js, Java, C++, and C

## Examples of Low-level programming languages

Assembly, and Machine Code

# Pros of High-Level Programming languages

## Developer Happiness

Decreased ramp-up for people to a new code base. It is easier to learn, write and read high-level programming code. Bugs are easier to debug…

## Kristoffer Hebert

I am working toward a simpler, more meaningful world. kristofferhebert.com

Get the Medium app