Taylor's Blog

Atypical ramblings

Phase 1 Complete!

I have been making some serious progress towards development of my app. Last night I was lying in bed configuring my Linux server on my phone with JuiceSSH and managed to get Tomcat set with Spring Boot. I was able to display a simple “Hello World” message when I visited 104.131.74.25:8080 which is a huge step forward. Doing so took a good amount of configuring however. Here are some of the challenges I faced just to get this far:

  • I was dead-set on using IntelliJ IDEA to setup Spring as I prefer it to Eclipse. However, in order to have Spring baked into IntelliJ by default, you need to have the IntelliJ Ultimate which is $12/month or $50/year. Luckily, because I am still a student at Oregon State University, I am able to use IntelliJ for free! Score!
  • I followed this video for instructions on how to set up a simple “Hello World” using Gradle and IntelliJ. It worked on localhost and I attempted to port it over to my server by just copying the whole directory over. I would later learn that this is not the proper way to do things.
  • Once I had ported over my project, I installed Tomcat, Gradle and Spring. However, I had issues with Gradle and Spring because their versions were too old to be compatible with my Tomcat installation, so I had to manually download the latest versions from the companies’ websites. I learned a valuable lesson in this – you can’t always trust the package manager for the latest version of software.
  • I was finally able to get the server up and running by typing gradle bootRun in the project directory! Victory… or so I thought!
  • A very helpful redditer informed me that my setup was erroneous. Here’s the advice he gave me:

You should be building a .jar (locally or somewhere else) and then uploading that jar to your server. You really shouldn’t be using gradle to run your application on the server. gradle bootRun is just an easy way to get your app running locally for development purposes.

You can build a .jar locally using ./gradlew build 

Then you will find a .jar file in build/libs/ that you can upload to the server.

You also need to run your app as a service. Simply executing the app on the command line like you are doing is great for local devlopment, of course, but it won’t work on a server. In fact, as soon as you cntrl+c or disconnect from the server, your app will shut down. This is why you need to run it as a service.

Thankfully, doing this with spring boot is actually pretty easy even if you aren’t very familiar with linux: https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html

That documentation gives you two methods, init.d and systemd (don’t worry too much if you don’t know what those mean right now). You probably want systemd unless your Debian is an older version that doesn’t support it (in which case use init.d).

Essentially what spring boot does it allow you to build a fat jar that is also an executable that can be run as a Linux service. You then create a configuration file (/etc/systemd/system/yourApp.service) where you point to that fat jar, and in that file you can also control stuff like where your output will go.

Once you do that, you can start your app like:

systemctl start yourApp.service

You’ll notice it will give you back the console and run the app in the background. You can see your output in various ways (look at the documentation, usually a file somewhere in in /var/log).

You can also “enable” the service

systemctl enable yourApp.service

This will make it start up automatically whenever the server starts up or restarts.

I followed his advice and the documentation he linked me and managed to get things working. This required me to add code to my build.gradle file and to run gradlew build to get a .jar file. I copied the .jar file over, created a .service file and started the service with sudo systemctl start myapp.service. I had to fix some errors with the service as it wouldn’t start right away which included making the .jar executable by typing chmod +x /var/myapp/myapp.jar . I also learned:

  • To see what services are running with the systemctl list-units command
  • To see details about a service using systemctl status -l myapp.service.
  • To see what ports are being listened on so I can make sure Tomcat is running using sudo lsof -i -P -n | grep LISTEN.
  • To restart a service, use sudo service myapp restart

I learned a lot setting this up, but now I get to move on to the fun part of linking the app to the back-end. I am looking forward to it!

I Could Use Some REST

One of the areas I’ve been trying to improve in is my familiarity with enterprise environments. My dev friend Pete gave me this advice:

Pick some tech and do a “full stack” project. Doesn’t have to be big. Hell, it can be a website that keeps an inventory of what games you own. Nothing more than a CRUD interface to a DB. But being able to point to a project that shows that you have your toes dipped in all aspects is great if you’re just getting your feet underneath you. I wouldn’t worry too much about stuff being “enterprise.” 99% of enterprise coding is “take data from this thing, and put it in this other thing.”

If you’re looking for a project, create an app that connects to “the cloud.” Put it behind an API and do a web interface and app to interact with it. Most apps that aren’t a game are simply a native way to interact with some remote API. It’s MUCH easier to edit a page or DB entry than push out an app update.

Make an app that does hello world when you do a GET on /helloWorld. Do another app that you can POST some JSON payload to /helloworld/name with an ID. Then when you do GET at /helloworld/{ID} it says “Hello $NAME”

So to get myself better acquainted with new technologies, I’ve given myself a new project. I’m going to create an Android journal app. Users can write a note and submit it, and the app will save their note on a remote database. I plan on it having some sort of login and authentication which is something I have not done yet. I also plan on people being able to read other people’s posts. So it will be a bit like a simplified message board.

I’ve taken advantage of the GitHub Student Developer Pack which entitles me to $60 credit at DigitalOcean which I’m using to host a Debian server to will house my back end. Naturally, the front end will be written in Android Studio and I’ve been looking into the Volley HTTP library to send my GET and POST requests. This video has been very useful in helping me to Volley set up. On my server, I’ve gone ahead an got MySQL server up and running with help from this guide. To make sure the database was set up correctly, I connected to it using MySQL Workbench (I found it easier to configure than Microsoft SQL Server Management).

The next big decision I had to make was what framework to use to connect my app to the database. When talking with Pete, he opined:
I think decision paralysis really hinders beginning and junior developers. Too much time is spent trying to find the perfect framework when we don’t have the experience to really understand the pros and cons. That time is much better spent learning about using frameworks and what problems they solve.
With that in mind, I think I will trying going with Spring. I’ve looked at this getting started guide and it seems pretty straight-forward. In addition, Spring uses Java which is what I’m trying to improve on for Android in general, so it should give me some extra practice. Also, Pete mentioned that many enterprises use Spring, so it would probably be good to have on my resume.

One challenge I’ve had is setting up my development environment. In particular: how can I work on files using an IDE if they are stored on a remote Linux server? Fortunately, I learned about Win-SSHFS and thanks to this awesome guide, I was able to quickly set it up and access remote files on my Windows machine.

So far, things haven’t been to bad. It’s mostly been a lot of configuring. Next I’ll be installing Spring onto my server and following the aforementioned getting started guide to get it set up.

Android SDK for IntelliJ IDEA

This morning I’ve been attempting to get LibGDX working with the IntelliJ IDEA IDE as described in this tutorial. However, I quickly ran into a problem. In the instructions it says the following:

Install the latest stable platform via the SDK Manager.

Sounds all well and good, but imagine my surprise when I find out that Google removed the SDK Manager GUI which is really confusing since every tutorial on the web still instructs you to use it. After some poking around, I discovered that you can either download Android Studio (which I’d rather not since it takes up a lot of space) or download the Android Command Line Tools. Problem solved? Well, not quite. Once again, I ran into some inconsistencies with documentation that was available and how the tools actually responded. Everyone online mentions how you need to use the android command in the command line to install packages, but in fact this command has been deprecated. Now we need to use the sdkmanager command instead.

Ok then, well according to the sdkmanager documentation, I just need to run sdkmanager.bat --list to see all available packages right? Wrong! According to this StackOverflow thread, you’ll get an error where the sdkmanager can’t move away the tools folder. So instead you need to follow user ahasbini’s advice:

copy the tools folder to another place (let’s say C:\temp\). Then direct into the C:\temp\tools\bin\, open the cmd prompt there and run your update commands as such:

sdkmanager.bat --sdk_root=sdkRootPath --command

Where sdkRootPath is path to your original SDK folder (C:\testinstall\sdk\). Once that is done, delete the C:\temp\tools\ copied folder.

Yeesh. What a bunch of work for something that should have been so simple! I feel that Google had only left the SDK Manager GUI intact, we wouldn’t have to go through all of this!

Well, anyway, here’s what I had to do to get the the thing working:

  1. I installed a some Android packages using the following commands (not sure if all of them are necessary):
    sdkmanager.bat --sdk_root=C:\testinstall\sdk\ "platforms;android-25"
    sdkmanager.bat --sdk_root=C:\testinstall\sdk\ "sources;android-25"
    sdkmanager.bat --sdk_root=C:\testinstall\sdk\ "build-tools;25.0.3"
    sdkmanager.bat --sdk_root=C:\testinstall\sdk\ "tools"
  2. I followed the instructions on this page to generate a LibGDX project, which consisted of (a) downloading the LibGDX Project setup tool “gdx-setup.jar”, (b) running java -jar ./gdx-setup.jar in the download folder (c) setting up the project as indicated and making sure to go to “advanced” and check the IntelliJ box.
  3. Next, I had to import the LibGDX project into IntelliJ. For that, I followed the steps on this page. I went to Import Project, navigated to my project folder and selected the build.gradle file. I Hit OK and in the next dialog, I unchecked the Create separate module per source set box and hit OK again. A final window will appeared asking which modules to import. I left everything checked and clicked OK.
  4. Now that the project was imported (finally!), I wanted to make sure it would run correctly. I continued with the notes on that page and followed their instructions:

    (a) Go to Run -> Edit Configurations...
    (b) Click the plus (+) button and select Application
    (c) Set the Name to Desktop
    (d) Set the field Use classpath of module to desktop
    (e) Click on the button of the Main class field and select the DesktopLauncher class
    (f) Set the Working directory to your android/assets/ (or your_project_path/core/assets/) folder
    (g) Click Apply and then OK.

  5. Now, I was planning on running this through the web browser as mentioned in the html section of this page, but I my localhost:8080 port is in use at the moment and causes conflicts if I try to use it for LibGDX. So instead, I decided to compile the program as an executable .jar file instead. To do so, I followed the Packaging for the Desktop instructions on this page – In the IntelliJ command line I typed gradlew desktop:dist and a .jar file containing all the necessary code and assets from the android/assets folder was created in my project’s desktop/build/libs folder.
  6. Lastly, I navigated to the .jar and ran the following in the command line to run it:  java-jar desktop-1.0.jar and voila, the “game” came to life! (Double-clicking it also works)
    Phew! It was a lot of work to get working, but now I have the basic layout setup so I can actually start developing some stuff with this. Pretty exciting!

My First Hackathon

Last weekend I attended my first hackathon! It was BostonHacks hosted by my alma mater Boston University. I’m still dizzy from how intense it was (and how little sleep I had!), but here’s the rundown on how it went.

I arrived at 10 AM on Saturday and registered, receiving a bunch of neat stickers and assorted swag, including a black hoody and a water bottle. For the first hour of so, I waled around to the handful of sponsors and talked with them about their products. With another hour before the event began, I decided it would be a good idea to start making some friends. I approached some people who also seemed to be by themselves and asked them if they were. Eventually, I got four other people to join me at a table and talk about the event.

We had two mid-level undergrads, two freshman and myself in our “team.” I took the liberty of introducing the two freshman to Git so that they could understand how we would share our code. Eventually, the event started, with an opening ceremony where the sponsors talked about the kind of projects they were looking into. As soon as they finished, we made a mad dash for the lunch line (there were about 100 people attending the event!). We sat down quickly, grabbed one of the available whiteboardsand started hammering throwing out ideas. We came up with some interesting stuff, but eventually decided to do “Twitter for blind people”, which I gave the code name Twinty.

The idea was pretty simple. Using this service, you would subscribe via text message to someone’s twitter feed, and whenever they tweeted you would get a phone call where the tweet would be read outto you. We decided to use a cool API called Twilio to handle the texting and calling. It also included a text to voice feature that we were able to take advantage of. I got the API code working correctly while a teammate got the twitter handling done. Another teammate worked on a feature to have the voice change based on emotional ques picked up in the text of the tweet (i.e. word choice and punctuation usage). I set up an AWS EC2 instance to host the service on, and we had to use an S3 bucket to store the tweets for Twilio to access.

We worked long into the night, taking a break for dinner and kept going into the night. It was so awesome and satisfying when we finally go the first calls to our cellphones and heard the tweets read aloud! With the servers set up, I decided to work on an Android front-end to make signing up for the service a little easier. Eventually it was 3AM and we decided to call it quits for the night. Two members returned to their dorms, while the rest of us camped out in the hall. I slept on the floor with a blanked I had brought and sort of slept for 3 hours. When we woke up, we grabbed a breakfast of pastries and continued on working. I took a break to brush my teeth, put on some deodorant and buy some snacks for the team and we kept on going until the judging took place. We ended up calling our project Spitter because “it speaks twitter!”

The judging was us standing at a table for an hour while judges walked around and asked us what we did. We demoed it and a lot of them were impressed, but in the end we didn’t win any prizes. However, the prizes really weren’t why I went. I went to work on a team, contribute and make something. The satisfaction of finishing 24 hours of coding and being able to point at something and say “I made this!” is far greater than any prize I could have received. I had so much fun. I really really loved the entire process. Sitting with teammates, discussing strategies, comparing code, seeing things work and struggling through when they failed. I really really want to do it again. I’m glad I went and I highly recommend it to anyone interested in programming just because of how crazy an experience it is.

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.”

Taylor's Blog © 2015