Taylor's Blog

Atypical ramblings

Mini Update

Came across this quote while reading a programming forum and thought it was interesting:

. . .the real difference between being a beginner and an intermediate level coder isn’t a matter of knowledge, but attitude. Beginners are a lot more prone to give up when things get difficult, where as an intermediate level coder will see it as an expected part of the code writing process and work through whatever is blocking them.

15870679_10101096569767606_1790892242_n15822183_10101096569752636_274911225_nI’m continuing my learning of Android. I’ve been going through the tutorials on Udacity and they’re really good. Take you from a very basic understanding of programming to making full-fledged apps. Definitely good for beginners and getting the fundamentals down. I’m currently working on an app idea that came about during a boardgaming session a few weeks ago. We were playing Twilight Imperium and at the game’s end, came into an argument over what ships would win in different theoretical battles. I boldly claimed that I would write a program to simulate battles and get a final answer on such matters.

Well, a few weeks later and I have done just that. My Twilight Imperium Battle Simulator has been written and I have it hosted up on GitHub. Currently it just runs in the command line of Java, but I’m now in the process of converting it over to an Android app (that version is on GitHub here).

I’ve already got a skeleton of it completed and am working on getting the logic imported over. It’s a little ugly, but it’s getting there! I’m thinking of doing a programming stream while I work on it via Twitch. It’s always fun to do some programming while people watch.

In other news, Jie and I have begun a Star Trek: Voyager marathon. I use to watch that show when I was a kid. Despite what some people may say, I absolutely love it and I’m please to report that Jie is having a great time watching it too!

 

Happy Halloween!

It’s Halloween! 4 months since my last post! So what’s going on?

Well, my 6-month anniversary at Monster has come and gone! I’ve been enjoying the job and learning new things every day. Our company also was acquired by Randstad – a Dutch human resource consulting firm. I’m not sure what the future holds, but I’m unabashedly optimistic.

I’ve started seriously working on an Android course through Udemy.com. I want to create some cool phone apps, maybe even a game one day. The course is run by this guy named Tim Buchalka and I really like it so far. It’s a great course in my opinion because he is always keeping up on the latest developments in Android studio. When something changes, he’s quick to address it so that students don’t become lost. I just finished a calculator app last night, so I think the course is going well!

I started playing the guitar again! I convinced my wife to let me pick up an electric guitar and I’ve been playing it pretty regularly for the past two weeks. I bought the Epiphone Les Paul Electric Guitar Player Pack from Guitar Center for ~$200. It came with everything I needed to start playing and I’m enjoying it a lot. I’ve found JustinGuitar.com is really the best site for beginners. Tons of free content by a really competent teacher. In addition, nothing beats just picking one of your favorite songs and learning how to play the more energetic riffs. I’ve found that Marty Schwartz is another really awesome teacher for learning songs. It’s really surprising how easy to play a lot of famous songs are. I’ve been messing around with Dead Leaves and the Dirty Ground by the White Stripes, Brain Stew by Green Day, I Walk the Line by Johnny Cash, and Brown Eyed Girl by Van Morrison.

I’ve also taken a break from video games for a bit. I want to focus more on productive things like learning guitar and programming. I’ll be starting up my winter classes soon, so I need to get back into the swing of things with serious study habits. Now that I’ve been at Monster for half a year, I can apply for tuition reimbursement which will really help out my finances.

That being said, I have been slightly distracted by upcoming video games. There’s a number of games I’ve been interested in for a variety of reasons. I’m mainly looking forward to a good MMORPG. It’s something that I’ve always wanted to spend some time exploring, but I haven’t found the right one yet. However, there are a few upcoming ones that have caught my eye:

  • Star Citizen – I’ve bought an early adopter pack for this game as it already has a playable Alpha.
  • Camelot Unchained – I’m mainly intrigued by the deep crafting system this game promises and how everything in the game feeds the Realm vs Realm warfare.
  • Crowfall – This game seems to promise a lot and looks very polished in its current state. I hope they open beta testing soon!
  • Chronicles of Elyria – Another game that may prove decent, but it’s really too early to tell.
  • Pantheon: Rise of the Fallen – Don’t know much about this game, but it’s supposed to be true to classic MMORPGs like EverQuest.
  • New World – A game from the new Amazon Game Studios. Not much is known, but since Amazon is backing it with their near-limitless funds it has great potential.

Luckily, I’ve got a good amount of time until any of those games are released, I think. Probably for the best, considering school is starting soon!

Some videos about release engineering

These following are two fantastic videos I encountered that really help put release engineering into perspective. The first is from a presentation given by Martin Fowler, one of the co-writers of the Agile Manifesto which laid out the principles of agile design and helped kick-start a whole movement that reshaped the software development process. If you have ever encountered the terms scrum, kanban, continuous integration, stand-ups, sprints, or stories, then you’ve encountered a little bit of what he helped to develop.

The video is titled Continuous Delivery and was part of a series of talks Fowler gave titled Software Development in the 21st century at the 2014 XConf conference. You can find the video here.

The second video is from the 2014 2nd International Workshop on Release Engineering keynote speech given by Chuck Rossi, the Engineering Director of Release Engineering at Facebook. He talks about just how important Release Engineering is and of the massive scale of what they need to do at Facebook:

I Made It

This post has been a long time coming. I finally made it. I am currently siting at my new desk in Weston, Massachusetts where I now hold the title of Associate Release Engineer for Monster Worldwide, Inc. Here’s a quick breakdown of the events that transpired:

2/18/2016 – I applied to a Software Engineering Internship position at Monster through their website.

3/3/2016 – I received an email back asking me to come in for an interview on the 15th.

3/15/2016 – I went in for my interview. A number of potential interns were there (over 20 were interviewed in total). We received a brief tour and introduction and then met with the teams. I discussed my abilities and experience and why I would be good for the position. I left feeling good and wrote thank you emails soon after.

3/17/2016 – I give BCNC my three weeks notice. The workload combined with my schoolwork is too much. I needed to leave so I could focus on developing myself for a new career.

3/28/2016 – I receive an email back telling me that I didn’t get the internship, but that there was another manager that might be interested in my skills. Talent acquisition and I exchange some emails and schedule a phone interview.

4/1/2016 – I have my first phone interview with talent acquisition and the manager. More emails are exchanged. I’m asked to come in for an interview.

4/7/2016 – I have my last day of work at BCNC. It’s a somber affair. Having spent so many years there, longer than any other job, it really is hard to say goodbye.

4/13/2016 – I have my next interview with the manager and and some of the devs and engineers. It goes really well!

4/15/2016 – Talent Acquisition calls me back. They’re offering me a job! With higher pay and better benefits than my previous job! My wife and I promptly freak out. The next few days are a blur of paperwork to get the hiring process finalized. Eventually…

5/2/2016 – I start my new job at Monster.

What a ride. I left my previous job with no anticipation of having a new one. It was by complete luck and the stars aligning to give me this opportunity right at the moment I needed it most. It was also incredibly gracious of Monster to give this opportunity. The position was originally earmarked as a senior position. However, one of the senior devs felt it would be more prudent for the company to hire a beginner and train them into the position. I feel like this is something a lot of companies are not willing to do anymore, and as of such, I am incredibly grateful to them. I love my new job and love finally being in the field. I feel like I have forever been on the outside looking in and it seems so surreal that I am finally here.

There’s a lot to learn. Oh my goodness is there much to learn! Monster was one of the first 1,000 websites ever created and there’s a lot of code that has built up since then! There are many tools I am now working on becoming proficient with, including MSBuild, C#, .NET, CruiseControl.NET, Jenkins, Perforce, Jira, NuGet, Confluence and more. But I’m more than willing to do the work. I’m studying my butt off and learning tons. I really can’t believe I’m here doing what I’m doing. It seems much too… soon? I never thought I could make a career transition this quickly. It just goes to show you that if you want anything bad enough, and you put in the time and effort, you can get it.

In other news, I just finished my finals for my Discrete Structures and Intro to Usability Engineering classes. With all of the changes going on in my life, I really couldn’t devote the time to them that I needed and they deserved. I think I still finished strong though, and I’m looking forward to my Fall semester where I plan on taking Computer Architecture and Assembly Language. Until then, I have the summer to enjoy and my new job to keep me occupied. I really haven’t felt this happy in a long time.

See you around!

A Quote about Programming

I was wondering tonight if programming were an art or a science. While googling this idea, I came upon this quote attributed to Richard Stallman on SlashDot:

“I would describe programming as a craft, which is a kind of art, but not a fine art. Craft means making useful objects with perhaps decorative touches. Fine art means making things purely for their beauty.”

A pointer to a pointer to a pointer to a…

This is a small slice of code adapted form a school project I was working on that I feel really helps explain the concept of pointers with arrays. It’s a 2-D array: an array of pointers, each of which points to an array of ints. It essentially forms a 2×2 grid (but you can make it other sizes too).

//function prototype
void fillMatrix(int** myArray, int size);

//main() function
int main()
{
    const int SIZE = 4;
    int** p_myArray = new int*[2]; //make the initial x-axis which has two slots
    p_myArray[0] = new int[2]; //make the 1st y-axis which has two slots
    p_myArray[1] = new int[2]; //make the 2nd y-axis which has two slots

    //alternatively, you could do it this way (if making a 3x3 grid with SIZE=3):
    /*
    int** p_myArray = new int*[3];                                     
    for (int i = 0; i < 4; i++) //for every x-axis...
    {
        p_myArray[i] = new int[3]; //make a y-axis three slots big                  
    }
    */

    //function call
    fillMatrix(p_myArray, SIZE);
}

//function definition
void fillMatrix(int** myArray, int size)
{
 cout << "Please enter " << size << " integers to fill the array." << endl;
 for (int i = 0; i < (2); i++)
     {
         cin >> myArray[0][i];
     }
}

Just to help visualize it, here is what a 2-D, 5×5 array looks like:

M75kn

Happy New Year!

Wow. It’s the end of 2015. What a ride it has been. I can’t believe that I started programming a year ago. It feels… not so long ago haha. Looking back, I see that I have really grown as a developer. And I guess as a person too. I can’t continue this post without first mentioning the biggest thing to happen in my life. Last week, December 21st, I got married to the most wonderful girl in the world. I really couldn’t have come so far without her never-ending support. I really am blessed. Because she was on a fiance visa, we only did the civil wedding at city hall. A really low-key thing. It was great though – my whole immediate family got to be there. We plan on doing a much grandeur wedding this April/May when her mother comes to visit. How many people get to say they had two wedding celebrations, huh?

Last month I finished my first computer science class – Introduction to Computer Science I. It’s only the first step of my academic journey, but I can’t help comparing this semester to the semester I had ten years ago. Ten years ago I was a freshman in college also enrolled  in my first CS class at the UMass: Dartmouth. I was taking Object Oriented Programming I and I had never felt more in-over-my-head than those few weeks I was in the class. I was thrown right into a Linux environment and expected to do… well pretty much the same stuff I did this semester at OSU. I realize now that at that point in my life, I wasn’t ready for the rigors of pursuing a CS degree. I was naive and immature. In a panic, I switched out of the program – eventually winding up in the history department after a semester of non-major pre-requisite classes. Looking back, I see that switching out was the right thing to do. Had I stayed in that class, I probably would have flunked it. Maybe I would have even flunked out of college. It was a scary time.

But now all that is behind me. I have a bright future ahead of me and I’m feeling exceedingly optimistic. I love the OSU program so far and feel like my knowledge is growing exponentially each day. Second semester starts next Monday. In the meantime, I’m back to learning Python and Flask. I really want to deploy my program onto the web. I’m very excited about it. However, I’ve been away from Python so long that I’ve forgotten a lot of its conventions. While doing some simple programming, I had a devil of a time getting a program to run correctly until I remembered that you can’t use the ++ operator in Python. As Steve says, I was “corrupted by C++”, heh.

Well let’s talk about some new stuff. What have I learned recently?

  • If you put a main.py file and a module file in the same directory and run the main.py file, it’s able to import from the modules without an __init__.py file. However, if the module was in another directory, you would need to add an empty  __init__.py file. This is because the __init__.py file is how Python identifies directories from which you’re allowed to import. The directory of the script you’re running is an exception – you’re always allowed to import from it. (source)
  • When the Python interpreter reads a source file, it executes all of the code found in it. Before executing the code, it will define a few special variables. For example, if the python interpreter is running that module (the source file) as the main program, it sets the special __name__ variable to have a value "__main__". If this file is being imported from another module, __name__ will be set to the module’s name. (source)

Here is a (relatively) simple example of how to import a class, create an object and use a method in that object:

#main.py
from myModule import MyClass

def main():
    instance = MyClass()
    instance.myMethod()

if __name__ == "__main__":
    main()
#myModule.py
class MyClass(object):

    def __init__(self):
        print("Object created!")

    def myMethod(self):
        print("Hello from myClass.myMethod()")

When run, this will be the result:

Object created!
Hello from myClass.myMethod()

Pointers: Round 2

Last Saturday I had my final exam for my CS161 course. I did okay, but I could have done better. I realize now that I really don’t have a handle on how pointers work still, so the goal of this post is to try and help myself understand them a little bit more.
I was watching some videos from The New Boston when I noticed that in the comments section some people were saying that the video had mistakes. It’s a bit disheartening to hear that the people trying to teach you pointers can’t even get it right. I’m going to try and digest what was in the video and what the commentators said. Here’s my synopsis:

Pass-by-reference uses references, not pointers. Pass-by-address uses pointers. Pass-by-reference and pass-by-address are not the same thing. It’s an important distinction because pass-by-reference is handled differently when calling the function.

A pass-by-reference function using references looks like this: passByReference(int &x);

While a pass-by-address function using pointers looks like this: passByAddress(int *x);

The important difference here is that passByReference is used (called) the same way as passByValue:

passByReference(betty)

passByValue(betty)

A passByAddress requires that you specify an address or a pointer as the argument. That is, you need to send a pointer/address:

int myVar = 5; 
int *myPointer = myVar; //Pointer points to address of myVar
passByPointer(myPointer)

or you need to put an ampersand (&) in front of your variable to denote it’s address rather than it’s value:

passByAddress(&myVar)

About the & operator

“&” is for the address of something. But when used when declaring a new variable, it becomes a different thing.

int a;

&a; // address of a

int &a = b; // the “&” now means you’re declaring a reference to “b”.

Of course, when declaring a refence, you must immediately assign it to something. References must always refer to something, they can’t refer to nothing.

So…

int &a; // not valid

int &a = b; // valid

To use it with function, you need to declare the function this way, to accept references:

void function(int &a); // takes a reference to an int

And then you just send any “int” to it:

int a;
function(a);

It looks like we’re sending the value of “a”, but because the function was declared to accept references, not values, you’re actually sending a reference to it.

——

I also found some help from this StackOverflow thread:

void makePointerEqualSomething(int *pInteger)
{
 *pInteger = 7;
}

In the function declaration, * means you are passing a pointer, but in its actual code body * means you are accessing what the pointer is pointing at.

In the function declaration, * means you are passing a pointer, but in its actual code body * means you are accessing what the pointer is pointing at.

& means get the address of something, its exact location in the computers memory, so int &myVariable; in a declaration means the address of an integer or a pointer, while

int *pInteger;
int someData;
pInteger = &someData;

means make the pInteger pointer equal to the address of ‘someData’ – so now pInteger points at someData and can be used to access it when you deference it:

*pInteger = 9000;

You can read that last line as “what is at the memory address pInteger points to is equal to 9000.”

References & Pointers

This week our class has finally encountered pointers. I knew that it would be a challenging subject, so I’m trying to take it slow. There are a couple of questions I have been trying to resolve in my mind since encountering these two concepts. The first one is: what is the point of pointers?

That’s where I discovered this comment on reddit that I feel applies to both pointers and references:

The best metaphor I’ve found for pointers are websites.

You could copy and paste the contents of a website into a document and then send that to someone, or you can send a pointer (the URL) to them.

The benefit of the pointer is if the site gets updated, you both see the changes, whereas if you send a pasted document, they will never see any changes.

If you just use the variable, it’s copying the whole contents of the variable. Whereas if you use a pointer/reference, it’s sending a lot less data and using a lot less memory.

Another difficult questions I’ve been working on answering is what the difference is between pointers and references. For that answer, I went to StackOverflow:

Use reference wherever you can, pointers wherever you must.

Avoid pointers until you can’t.

The reason is that pointers make things harder to follow/read, less safe and far more dangerous manipulations than any other constructs.

So the rule of thumb is to use pointers only if there is no other choice.

I’m sure there is more to it than that, but feel that those cover the basics pretty well. Now for actually learning the syntax. I wrote a little program to help remind myself of the finer points:

 int myInt;
 int *myPointer;
 myPointer = &myInt;
 *myPointer = 5;
 cout << "myPointer points to address " << myPointer << endl; //outputs address
 cout << "The value stored at that address is " << *myPointer << endl; //outputs 5

 //An array name, without brackets and a subscript, actually represents the starting 
 //address of the array. This means that an array name is really a pointer.
 int myArray[] = { 10, 20, 30 };
 cout << *myArray << endl; //outputs 10

 //These two lines do the same thing:
 cout << myArray[1] << endl; //outputs 20
 cout << *(myArray + 1) << endl; //outputs 20

 //This adds 1 to the first value in the array:
 cout << *myArray + 1 << endl; //outputs 11

 int *arrayPoint; //This is a pointer that points to an int (or an array of ints)
 arrayPoint = myArray; //Assign it to an array to point to
 cout << *arrayPoint << endl; //outputs 10
 arrayPoint++;
 cout << *arrayPoint << endl; //outputs 20

I’ll add some more notes for pointers and references later.

Taylor's Blog © 2015