C to C++ Tutorial

Thu Aug 02 2018

This post aims to cover all the major topics that C programmers need to know before they start writing C++ programs. I kept this post as short and concise as possible to enable people to use this as a quick reference to quickly jump into C++. This post assumes that you have prior knowledge of both C and object oriented-programming concepts. Each topic is quickly covered in a code snippet and some additional explanation is provided if necessary.

1 Input/Output

Input and output in C++ is easy, you use “cout” and “cin”. When printing with “cout”, you separate what your printing with “<<”; “endl” prints a new line.

using namespace std;                        //namespaces talked about below
#include <iostream>                         //Include statement for terminal IO.

int main()
{
    cout << "Hello World" << endl;          // HELLO WORLD!
    
    int a;
    cin >> a;                               //inputs an int into a -- notice how arrows face the direction of IO
    
    cout << "You entered: " << a << endl;   //prints what you entered
    
    return 0;                               // return sucess code
}

Read More »



Gremlin in 10 Minutes

Sat Jul 28 2018

1 What is Gremlin?

Gremlin is a graph traversal language: think of Gremlin as the SQL for graph databases. Gremlin is not a graph database server, it is a language; but, there is a Gremlin Server and a Gremlin Console available for interacting with graph databases. It is possible to use Gremlin on large database platforms like Titan and HBase.

2 Graph Data Base Basics

A graph database is based on graph theory. A graph is composed of nodes, edges, and properties. A key object/component in a graph database is stored as a node. Nodes are connected via edges representing relationships. For example, you may represent people as nodes and have edges representing friendships. You can assign properties to both nodes and edges. A person (node) may have the properties of age and name, where a friendship (edge) may have a start date property.

2.1 Why Graph Databases?

Read More »



Node Website Optimization

Sun Jul 22 2018

It is a well-known fact that a fast website is critical towards having high user retention. Google looks favorable upon websites which are well optimized and fast. If you are using a CMS like WordPress or Wix, a lot of optimization is done automatically. If you like to build stuff from scratch like me, there is a ton of work required to optimize a website. This post will cover the 8 things that I did to decrease the load time of this blog written in node by two seconds.

1 Final Results

Final Website Speed Test
Final Website Speed Test

This is the result for a single blog post.

Read More »



Steam Friends Graph

Tue Jun 26 2018

1 Links

2 Project Description

This project utilizes the steam API and graph databases to create friend graphs for clients in a web browser. Currently there are two types of graphs available: - Friends of Friends Graph: This graph displays all the steam friends of a single person and all their friend’s friends. - Common Friends Graph: This graph will only display your friends; however, it will draw edges between your friends’ if they are friends with each other.

3 Motivation

Read More »



My College Essay

Fri Mar 16 2018

Students hate writing essays. It is easy to get wrapped up in the traditional 5 paragraph essay which is dull and boring. When writing a college essay, you have more freedom since you are telling a personal narrative. Since you are writing a story, you want to make it interesting. You should not rephrase the prompt which you are responding to, and you should not write about anything that the admissions office already knows. Your application already mentions all the clubs, classes, sports, and volunteer service you do– so don’t mention them.

I don’t want to go off on a huge tangent about how to write the perfect college essay, I’m not an expert. However, I would like to share my personal college essay which got me accepted into RIT and Clarkson last year. As a computer science applicant, it is a great idea to write your college essay based on the programming experience you had outside of school.

/**
 * Title: HTTP ERROR 500
 *
 * Prompt: Describe a problem you’ve solved
 *
 * @author Jeffery Russell
 *
 * September 13, 2016
 */

#include <stdio.h>

main()  
{  
printf("

        On a dim screen in the corner of my room flashed the dreadful message- HTTP
    ERROR 500. That simple warning taunted, probed, and questioned my mind for
    hours on end. As I pivoted my binocular gaze from the computer to out the
    window, I saw the front yard dimly lit by the drowsy moon. Time for a second
    stood still as the crickets chirped and the trees swayed in the cool summer
    breeze. Closing my eyes for that second of silence made me realize how tired
    I really was. A beeping, piercing, and dinging sound focused my gaze back to
    the computer. Still flashing was that error reminding me that I had a long
    night ahead.
    
        For the past two weeks I had been working on an employee management system
    for a store. This web based system was to keep track of employee hours for
    payroll. The project was near complete; however, there was a few bugs left
    to fix. The most annoying of which was password verification for the
    webform. Now nearing the end of the development cycle, the project was
    suppose to go live tomorrow.
    
        Debugging a project is often a daunting task for programmers. Simply finding
    an error is like finding a misspelled word in the dictionary. Correcting the
    misspelling may be easy but finding that word is another story. What I love
    about programming is that the program does exactly what I tell it to do. If
    it makes a mistake it’s because I told it to, not because it feels tired, or
    doesn't like me. Every bug, error, and glitch I unintentionally create.
    These bugs eventually come out to the surface like a fish gasping for air.
    An error is never just a mistake. It represents something much larger- an
    error in my way of thinking. Debugging is a process that enables me to
    further understand the program and crush the bug like the parasite it is.
    
        Sitting back in my chair in deep thought I resumed the process of scanning,
    poking, and probing my code for any source of the error. For the past hour I
    narrowed the source of the error to ten lines of dubious code. Pondering
    these lines of code I added an echo statement which allows me to see the
    inner workings of the code. The error became as clear as day, the password
    was not getting hashed: a feature that adds security to password storage.
    Excitedly I typed a few lines of code to fix this problem. Then swiftly I
    pressed execute, only to my disappointment to receive a different error
    code. Eyes glazed over, I realized my mistake. In the process of debugging I
    left a block of code commented out.
    
        On a dim screen in the corner of my room beamed the message- Currently
    Working.

");  
}

Read More »