Objects

howtosurvivecomputerscienceincollege

Java is an object orientated programming language (so is c++ and python) which means that the programming is centered around using classes and methods to create objects, and then using those objects in your code. I will take two posts to explain objects, the first will be how to create objects, and the second will be to show all of the different functionality that objects have.

An object is something that has different states and behaviors for example a bear has states such as color, type, ..ect and a bear has behaviors such as growling, eating, sleeping. You create an object by creating an instance of the class that the object is defined in.

public class Bear {

private String color;

public Bear(int age, String type) {

this.age = age;

this.type = type;

}

void growling() {  }

void eating() {  }

void sleeping() {   }

}

so this…

View original post 258 more words

How Shazam Works

Free Won't

There is a cool service called Shazam, which take a short sample of music, and identifies the song.  There are couple ways to use it, but one of the more convenient is to install their free app onto an iPhone.  Just hit the “tag now” button, hold the phone’s mic up to a speaker, and it will usually identify the song and provide artist information, as well as a link to purchase the album.

What is so remarkable about the service, is that it works on very obscure songs and will do so even with extraneous background noise.  I’ve gotten it to work sitting down in a crowded coffee shop and pizzeria.

So I was curious how it worked, and luckily there is a paper written by one of the developers explaining just that.  Of course they leave out some of the details, but the basic idea is…

View original post 620 more words