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 knowledge of Java from CS101 and applied to two Java programs for my Udemy courses. The first program calculates the sum of an array of integers both sequentially and in parallel. The program splits up the array into subproblems based on the number of cores on the computer. The second program sorts an array of integers in both sequential and parallel. …


Numerical calculations with Python

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.

Getting started

Install required…


A summary of my year-long goals and results

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 to place in Canada like Squamish and Banf, to climb mountains. I’ve done more hiking this year then all my other years combined. …

Object-oriented design in C++ with Kristoffer Hebert

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

lib
main.cpp
fibonacci.cpp
fibonacci.h
test/main.cpp
build.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.

The test folder that contains all of the Google test unit tests and compiled test executable. …


Object Oriented design in C++ with Kristoffer Hebert

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 Arrays
string groceryList[] = { "Tomatoes", "Potatoes", "Carrots"…

Object-oriented design in C++ with Kristoffer Hebert

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 Class
class DieCast {…}

What are Objects

Objects are instances of Classes. Objects inherit the attributes of the Class and are assigned to variables with the type of the Class. …


Object Oriented design in C++ with Kristoffer Hebert

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 when they extend Child Classes. Extend means one class overrides attributes of, or inherits attributes, from another class. In the provided code example you can see that Child Class inherits every attribute of the Parent Class. The Child class overrides the firstName value in the constructor call. …


Comparative Programming Languages with Kristoffer Hebert

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
// Array
let x = Array(3)console.log(x.length)
// returns 3
x[999]// returns undefined, because index does not exist

Dynamic Memory
Dynamic memory means that memory can grow or shrink, at code runtime. Imagine a room filled with 3 boxes, you can add and removed boxes when needed. You fill 3 boxes, and add 3 more, for a total of 6 boxes. This is the default behavior of an Array in Node.js …


Comparative Programming Languages with Kristoffer Hebert

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 {…}
// Java
public class TodoApp extends Todo {…}
// Node.js
class TodoApp extends Todo…

Comparative Programming Languages with Kristoffer Hebert

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 and find due to the high readability of code. …

About

Kristoffer Hebert

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store