Hacking with Java Algorithms

So I have been pretty knee deep in algorithms and Java lately.

Coming from Free Code Camp last spring, I have found that I’m finally understanding the methods, algorithms, etc, that I am currently working on in class.

One of the best parts about CS0401 is Tim Hoffman, the professor, and Tim the TA. Their explanations have cleared a lot of things up for me so that when I go to do my projects and labs, I am not staring at the blank editor trying to figure out what to do.

It helps that Tim the Dr. pretty much fills in the main method and calling logic, as well as BufferedReader, Scanner, and FileReader inputs. This helps me to not be stuck, and start working on the main logic right away.

A Fat 0 This Week

I have been a bit sick lately and haven’t had the energy to do most of my homework. Thought I’d turn it in late yesterday but I am stuck, and the places I’ve reached out to haven’t gotten back too me for help. So, I essentially got a 0 on project 3, my first 0 on a project since starting this class.

Example Algorithm

So we have been working on a set of pretty established algorithms like the speeding ticket calculator, reversing strings, and checking for palindromes.

My solution for palindromes in JavaScript:

My solutions for palindromes in Java:

Here we are using a clean string to add characters to and isLetter() to check to see if the character at the i index of the String s in the for loop is a letter. If it is a letter, we use toLowerCase to make it lowercase. We want all the letters to be lowercase. It makes it easier to check for palindromes this way. Then we add the characters we have made lowercase to the clean string, where we can then check for palindromes.

In the boolean method isPalindrome() we check to see if the the string is empty or null. If this is the case, we can’t check for palindromes as no characters exist. We then return false.

Next, in the for loop, we split the string in half and then loop through each half. Then we check if the character at the end of the sting doesn’t match the character at the beginning. If it doesn’t, we need to return false, as that is not a palindrome. If it does, we return true.

Just Explained That. Feels Good

I honestly wasn’t sure I could explain that after not looking at it for a week or so. It took about 10 minutes but I felt like I explained it pretty well. I am patting myself on the back. Ha.

There’s still gaps in my knowledge and a long way to go for total understanding of basic programming concepts, but the comprehension is coming faster, and I am grateful Definitely a bonus of Free Code Camp’s model of teaching.

First Day of the Spring Semester 2017

You’ll have to forgive my cover photo indulgence. I gave my mom my iPad Air 2 and bought her some things like a keyboard, a case, styli (she has long fingernails and needs those), a 6 ft charging cable. She was so thrilled that I was thrilled. I wanted a picture and she said, “Yo, bitches I got my iPad”. Ha!

So I started the spring semester yesterday. Both my professors are cool. Both are behind the technological times, opting for some convoluted systems where I needed to install anti-virus and VPNs to submit homework. Most other profs use GitHub. And I was super annoyed about this. I don’t install certain anti-virus software on my Mac. I have a special app for managing threats and it wasn’t listed for the required anti-virus. Bullcrap. But it was required.

Java Programming with Tim Hoffman

For all the complaining I did about the software, our instructor, Tim Hoffman, is probably the best instructor at explaining difficult subjects to novices. I explained references to an object in memory that point to the same object (shallow copy) and in another part of memory that makes another copy of the object (deep copy). This is something I knew about but was fuzzy on. But the way he explained it made perfect sense.

He also bucks the trend of not letting students do their homework over before it is due. He wants us to succeed and learn. His colleagues often ask him why his 401 CS class has such a high grade rate. He told them because I let them make mistakes and learn from them. Isn’t that how you teach? Brava.

Web Dev with PHP and MySQL

We are doing more server stuff this semester in Intermediate Web Dev. I am working on my cousin’s e-commerce site that uses PHP. I had some problems installing Composer on my machine for his site and Zencart. I upgraded PHP and installed Composer which worked.

I also needed Composer to host my class apps on Heroku. The Heroku docs have instructions on how to host apps with MySQL and PHP.

I don’t know how many apps you can have on Heroku with the free plan but I’m hoping I don’t go over the limit[note]You can have 100 apps on verified account for free and 1000 hours of free dyno quote if verified, 550 if not. If you are not verified you can only have 5 apps. To verify, add your debit card, though you will not be billed[/note].

Looking Forward to the Challenge

Last spring I had a nervous breakdown right a the beginning of the semester. I am much better now and things are getting better and better all the time. I am up for the challenge and with Tim Hoffman as my guide, this semester should be a success.

Back into the Java Virtual Machine

I have about a month left of the fall semester. I am doing better than the previous two, though I’d like to boost my grade in InfoSci up to at least a B. Stupid study mistakes on my part led to a C on the midterm— being sure you know something and actually knowing it are two different things. Even if you go over it a million times, it doesn’t hurt to study it again.

As far as Web Dev class? I have an A. I am scoring As on just about everything I touch in that class. This semester, I should have around a 3.0+. Not what I wanted, but it will do.

Next Semester

Next semester I will be taking Intermediate Web Development. I am excited for this. We get to dive deeper into building things programmatically instead of fooling around mainly on the front-end with HTML and CSS. We will also be digging into databases.

I am also going to take CS 0401 again. This is an Intermediate Programming class using Java. I took it in the spring but had a nervous breakdown and stopped in the middle. So it is back into the Java virtual machine

I have been thinking about this class a lot lately. So I went back to our old repo and looked at our first assignment, which I struggled with terribly. And you know something? It was super easy. I don’t know if it was my emotional state, getting the F on the final project in Intro class the previous fall or what, but wow. How did I not know any of this?

Granted, I am a better programmer now. But. It just gives me confidence going forward. In case you’re curious, here is what we had to do.


Pretty simple Java stuff, no?

Thoughts on My First Computer Science Class and Great News


“People are always blaming their circumstances for what they are. I don’t believe in circumstances. The people who get on in this world are the people who get up and look for the circumstances they want, and if they can’t find them, make them.” ― George Bernard Shaw, Mrs. Warren’s Profession

What a whirlwind of emotion for me this semester. I really don’t know how I did everything I did this semester. I went to class, mostly (Chinese Thought got old for me and when my Computer Science professor called off I would just stay home. Sometimes I had appointments. Other times I was like forget it). I blogged, did two podcasts, had three guest appearances on podcasts, I learned at Free Code Camp and Treehouse, I wrote for Free Code Camp, I fired up my Jekyll blog and wrote three articles there AND did my homework and all that comes with it. I did slack off at the gym which will be corrected next semester.

So about the Computer Science class.

It was easy at first. Super easy. And then…it slammed me in the face like a bag of bricks swung at my head. I got really good grades on my first two projects, an A and B. But we only built pieces of programs. And then the 3rd project.

Project 3, My Nemesis


“Well, if it can be thought, it can be done, a problem can be overcome,” ― E.A. Bucchianeri, Brushstrokes of a Gadfly

Project 3 was me staying up late night after night, skipping my last two classes to solve the problem. It was a hangman game. It should have been simple. Ohhh, no. Our professor lets us know as soon as we went to the page it was extremely difficult. I started sketching out some pseudocode and it looked fairly simple from where I stood. On that day. But that was the last day it looked simple to me.

I stayed up until 6 am on Thursday, the last day of classes. I searched everywhere. The guy previously helping me on Code Newbie Slack was offline. I livestreamed my coding. Got some advice from a really nice guy. But it contradicted everything I was taught because he was more advanced than me; he was about to finish up his Computer Science BS. I searched all night and morning. I knew I needed to use an array, a for loop, and ArrayList as well, but the concept of arrays confuses me in a sense that I had five words and I needed to grab a character from those words, that I needed to access randomly. Somehow I got stuck on how is Java going to know if the input matches the letter I am trying to pull out of this array? I was completely overthinking it and it was due in one day.

Our prof emailed us collectively and told us that everyone seemed to be having trouble with Activity 1 out of 4 and we could turn Activity 1 in and tell her our thought process we could get partial credit. I had a working Activity 1 and a broken Activity 2 and turned them in with my thought processes. I expect a D or C on this thing.

Good Things Came from This

I wrote my professor this email:

I stayed up all night working on Activity 2 which is why I didn’t come today. I am almost finished with it, and found that an Array and ArrayList would be the way to go. How to find a character in an array? That is where I’m stuck. But I may be able to get help.

I saw your email about people struggling with just Activity 1. I got it done insofar as I got the game to run once; if you guess right everything is printed out to the screen. If you guess wrong you get a tick. Then I ask the player to quit the game. I will be working on it again because now that I think about it I don’t think the game quits when the player wins. In any case, this tested my mettle as someone who wants to be a developer. I don’t think as an Intro student I was ready for this. I livestreamed doing the activity and some guy who is finishing up his BS in CS remarked it was some final project for Intro students. Heh. It doesn’t discourage me, however. I have the activity in a markdown file and uploaded to a site that parses markdown so any time I want to come back to it and work on it, I will. And I’ll probably do that during next semester, as I take the Intermediate class.

This class started out easy enough for me as I had experience with programming and got progressively harder. But what I learned is that I am understanding the interconnectivity between different languages and applying the principles like OOP to each project I work on. I will not be creating a class since it is due tomorrow at 1. But I understand how to do that and look forward to implementing it and working on it in the future.

Thanks for your wit, btw. It made coming to class enjoyable.

Thanks for the great semester and I’ll see you Tuesday for the final.



Her response? Unexpectedly phenomenal.


Even Better News

We had some back and forth and then she sent me this email:


She wants to mentor me, yall. And this is a new beginning and a new era for my CS journey.

Just in case you’re curious, here is my code to Activity 1 and the repo will be listed below.

/* Tiffany White
Rainbow Explosion, is a text-based game that is in the vein of hangman
This activity will introduce the player to the game and store any guesses
Date created: November 19, 2015
Date modified: December 9, 2015

// Imports APIs
import java.util.Scanner;
import java.io.*;

// Class definition
public class P3A1_White_
// Main method
public static void main(String[] args)
Scanner keyboard = new Scanner(System.in);

// Welcome message
System.out.println(\"Welcome to Rainbow Explosion.You\'re going to guess a letter. If you guess a correct letter, you win.\" +
\"If you guess wrong, you get a color tick. If you guess wrong 6 times, the color bomb explodes and you lose.\");

// Prompt for input
System.out.println(\"Enter a letter.\");

// Gets a char from the user as input
char letter = keyboard.next().charAt(0);

// Runs guessLetter1 method
guessLetter1(\"cat\", letter);

// guessLetter1 method
public static char guessLetter1(String word, char letter1)
{   Scanner keyboard = new Scanner(System.in);
word = \"cat\";
if (letter1 == \'c\' || letter1 == \'a\' || letter1 == \'t\') {
System.out.println(\"You guessed a correct letter. You win! The secret word isn cat. Press enter to quit.\");
} else {
System.out.println(\"You guessed a letter wrong. You get a red tick."
+ \"_ _ _\" + \"Game over. Please press enter to quit.\");

String quit = \"\";
quit = keyboard.nextLine();

return letter1;


//Use System.out.println to print out welcome message, player instructions, and a placeholder for the secret word to the console.
//Use a string to print out blank underscores to the screen to represent the secret word the player is trying to guess
//Secret Word: JavaScript

//Player must guess letter to see if letter is in secret word.
//Use Scanner class and Scanner oject to get input
//If player guesses a correct letter, underscores and correct letter need printed to screen
//Can use two print line statements to print underscores and word on new lines
//Player has won that round

//If letter is not in secret word, the letter guessed plus blank underscores and correctly
//Incorrect guesses get a tick
//Player can only accumulate 6 ticks or he loses game and bomb goes off
//Each incorrect guess gets a color that is printed to the screen using System.out.println, based on how many ticks the player gets
//Player wins by guessing the word. Print to the console whe

Pitt and Computer Science


So, for a roundabout update, I got my Commonwealth Diploma, for 30 college credits completed. The reason I needed this diploma and couldn’t use my high school diploma for admission to Pitt? Well, the fact I left my high school in Harrisburg to attend a sort of school for behavioral misfits was a problem because Harrisburg High School didn’t put the date on my transcripts of my graduation. And when I called they had no record of me graduating. So essentially the problem was no one knew who the hell I was and so I needed to get the diploma to even stand a chance of getting into Pitt. I have my physical high school diploma but it was just too much bureacracy hassle for Pitt and all involved.

So I got that lovely dipolma and have emailed all the right people for my journey into a university. I emailed Dr. John Ramirez of the Comp Sci department and it looks like it isn’t going to be a bad go of things. Just opening up my thinking to theory and knowing how to apply it to real-world coding situations. I am not keen on learning theory. I just want to build. But I know the limitations in Pittsburgh for coporations that hire developers, and the BS in computer science barrier to entry. Anyway, I am going and even though I say I wouldn’t go this route if I didn’t have to I probably would anyway as getting a degree, though not important, is important to me.