Skip to main content

Posts

Showing posts from June, 2016

Creating your own ArrayList in Java

Wanted to show that certain data structures in Java can be created by you. In this example, we'll go ahead and create an ArrayList data structure that has some of the methods that the built in ArrayList class has.

We'll create 2 constructors:

The default constructor that creates an ArrayList with a default size of 10.Constructor that allows an initial size to be passed to the array. We'll also create a number of methods: void add(Object x); A method that allows you to place an Object at the end of the ArrayList.void add(int index, Object x); A method that allows you to place a value at a given location.Object get(int index): Allows you to retrieve a value of the arrayList array from a given location.int size(); Allows you to get the number of elements currently in the Arraylist.boolean isEmpty(); Tests to see if the Arraylist is empty.boolean isIn(Object x); A method that sees if a particular object exist in the arrayList.int find(Object x); Returns the location of first occ…

How to Install and use phpDocumentor

If you have Windows, and are running WAMP, this is the step by step installation guide to getting phpDocumentor to work. This write-up assumes that you have WAMP installed and working.
Download Composer from https://getcomposer.org/Run through the installation with the default settings. It will locate php for you automatically. If you're having any issues with the install, Google the response. There shouldn't be any errors though.If you have CMD opened, close it now.Open CMD and type in composer. If something starts happening, Composer is installed correctly.Go to the directory that you want to install phpDocumentor.In your project directory, create a JSON file. Name it, composer.json and add the following code to it
{"require-dev":{"phpdocumentor/phpdocumentor":"2.*"}}For example, let's say that your project directory is located in C:/wamp/www/your_project, you're going to want to open CMD and make sure that you've navigated to that dir…

Java Vectors

The purpose of the following example is to get you acquainted with the Vector class in Java. We're going to create a program that simulates a deck of cards. The constraints are; you may only use Vectors and arrays. As you may know, Vectors only accept objects so your cards should be objects. The initial portion of the program display the cards and their suites in order (i.e. Ace of Diamonds, King of Diamonds, Queen of Diamonds ... 2 of Diamonds ... Ace of Hearts, King of Hearts ... ). You are to create your own shuffle algorithm; do not use Collections.shuffle(). Here's what I came up with.


Anagram in Java

Recently I was given a problem that stated: Create an anagram program in Java that reads a text file and computes the anagrams of the words. If the words are anagrams of each other, put them on the same line; if they're not, print each one on a new line. The anagram program should create a new text file. The only data structure that you can use is an array. You must create your own sorting algorithms.

This was my solution to it.

We Need to Go Green

I'm sure that everyone pays attention to the news. For one reason or another, I'm going to assume funding practices, our politicians are hesitant to pursue cleaner energy alternatives. We shouldn't be biased since other countries are not participating either, but we should lead as an example for the rest of the world; after-all, the world watches our nation very closely. The dependence on fossil-fuels is in direct correlation with the demand for it.

What's causing this increase in Greenhouse gases? I'll let the experts answer that: NASA.

So what's happening?
"The last monitoring station in the world without a 400 parts per million reading has now reached it, NOAA confirms."
-- The Guardian"In the remote reaches of Antarctica, the South Pole Observatory carbon dioxide observing station cleared 400 ppm on May 23, according to an announcement from the National Oceanic and Atmospheric Administration on Wednesday. That’s the first time it’s passed that…

MOZ Page/Domain Authority Error

It started off like every other night; my brother and I were exchanging SEO related tips. Our nightly conversation consisted of the numerous PBN's that were recently taken down. PBN's used to be the way, black-hat-way, to rank sites quick and dirty. Google caught on and started cracking down on the thousands of PBN's in existence. Certain people still claim that they work, and I don't doubt it, but the fame is short-lived. The potential of having your site banned is not worth the risk.

I was showing him a blog that I recently started. it showed a MOZ PA of 77 and a DA of 92. I knew that the content I was writing was good and I'm sure people are sharing it, but for it to show a PA of 77 was suspicious after the blog being up for a month. A quick Google search showed that all Blogspot accounts were ranked at 77. We searched further and saw that all Tumblr accounts had a PA of 94!

After browsing through numerous different forums, we couldn't find any additional in…