How does the popular application Shazam work [closed] - database

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Just out of curiosity because I've always wondered this. How does the application Shazam work? I know how to use it, I'm speaking in terms of programming. How does the application listen to any part of a song and then give you the results? Obviously it receives it's song information from a database, but there is NO way someone could enter every single song known to man in that database. Also, how does Shazam not constantly update all the time? New songs are constantly being released yet it was like Shazam already had the future songs programmed into it. This is just mind boggling to me, and I would just like to know how exactly this all works. I know this is not a help question, but could someone please clarify? Thanks!

Shazam only starts with Fourier transforms (which isn't surprising since pretty much all audio processing works this way).
You can read Avery Wang's original paper, if you like. He is the inventor of the Shazam algorithm. I happen to think that it is best explained as a nearest neighbor technique, which is why we included it as an example in Chapter 9 of "Data Mining Techniques, 3rd Edition".
You might be interested in what we have to say there (http://www.amazon.com/Data-Mining-Techniques-Relationship-Management/dp/0470650931/ref=pd_sim_b_5).

They don't say much on the link diciu posted.
The algorithm is based on Fourier's waves, which allows expressing a mathematical function as a linear sum of harmonic functions. This transform allows mapping between time to frequency which is exactly what you need in order to create voice recognition. I find it hard to believe that Shazaam has a patent over Fourier's transformation. But if you try to build a "2nd Shazaam" you'll probably fail since they already took over all the market...

Related

Getting first date of year...is this wrong and/or bad? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
So given that every time I look for the SQL query to return the first day of the year I get this..Stackoverflow great answer
SELECT
DATEADD(yy, DATEDIFF(yy,0,getdate()), 0) AS StartOfYear,
DATEADD(yy, DATEDIFF(yy,0,getdate()) + 1, -1) AS EndOfYear
Is there anything wrong with using the below?
SELECT CONVERT(DATE,CONVERT(CHAR(4), Year(Getdate())) + '0101')
Personally I find this one a little easier to immediately understand.
Thanks!
Depends what you mean by "wrong".
The other is probably faster because it keeps the dates in their native formats, which is actually numerical data in SQL Server, and SQL Server generally works faster with numbers than with strings. Plus there's the overhead of converting the date to a string and back.
But that performance difference is pretty minimal, so it depends on whether you'd rather have that extra bit of performance, or code that's easier to read and understand.
Nothing wrong at all, if you want to spend a few extra CPU cycles on processing strings.
I've seen great benefits from using a calendar table.
There are many examples on this, you can find one here.
Easier to understand??? Isn't that what comments are for?
In my opinion, the most important thing you do with a database is to make sure the data is accurate. The second most important thing is to make the code fast. As others have pointed out, the execution time difference is probably only a couple of computer cycles. The problem is... you could execute this on a table that has 100 million rows and suddenly those extra clock cycles takes several minutes.
I have no problem with people using "easy to understand" code when they don't know any better. In this case, you do know better. It would be a mistake to use the slower code. If you want to make it easy to understand, add comments to your code.

Bullet Points and Databases [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I received a list from a customer using bullet points, and then sub bullet points. What is the best way to store these in a Postgres database, if you could give me an example of this, that would be great.
Thanks!
Structure of it is something similar to this:
Defect1
possible instance of defect1
another possible instance of defect1
Defect2
possible instance of defect2
another possible instance of defect2...
For indented lists you're basically talking about a tree structure. There are many ways to store hierarchies. See this answer for a comparison.
Design Relational Database - Use hierarchical datamodels or avoid them?
Depending on how you want to use the data, i.e., if you're just going to spit it back out as it came in, you may be able to skip the hierarchy aspect in this particular use case and just store each line in sequence with an indentation field. It won't do nearly what can be done with a tree, but it may be all that's needed in your particular case.

Increase typing speed? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
It has recently been brought to my attention that my typing skills leave much to be desired. I've been programming a few years in college now, and typing speed has never been very important. Classes do not focus on how much code you can output, but instead how to design and implement code.
Now that I have a job however, demands have changed slightly and I think it in my benefit to increase my typing skills, at least a little bit!
Do you have any suggestions for effective methods to increase typing skills?
I prefer typing games that encourage you to type faster for a reward (high score). Do a search for 'typing games' and have fun. I'm about 80 wpm atm (according to some games I peak near 90 but the longer words drag my average down).
Whatever you choose, you do need to keep doing it on a regular basis.
I went through this a few years into my consulting career...I downloaded a free typing tutor program and used it every day for a month:
10 minutes in the morning before starting work for the day
10 minutes during my lunch break
10 minutes at the end of the day before leaving work
I found that as my typing improved it was fun to fit in a few more 10-minute sessions each day as I felt like it.
Keep up with it for a month and you'll be amazed at how much better you are at typing!
Cheers
Download a touch typing trainer and train ;-) it's actual fun until the point where you reached your limit. See http://typingsoft.com/all_typing_tutors.htm for a list.

Real world usage for artifical neural networks [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have written an artifical neural network (ANN) implementation for myself (it was fun). I am thinking now about where can I use it.
What are the key areas in the real world, where ANN is being used?
ANNs are an example of a "learning" system, one that "trains" on input data (in some domain) in order to effectively classify (unseen) data in that domain. They've been used for everything from character recognition to computer games and beyond.
If you're trying to find a domain, pick some topic or field that interests you, and see what kinds of classification problems exist there.
Most often for classifying noisy inputs into fixed categories, like handwritten letters into their equivalent character, spoken voice into phonemes, or noisy sensor readings into a set of fixed values. Usually, the set of categories is small (23 letters, couple of dozen phonemes, etc.)
Others will point out how all these things are better done with specialized algorithms....
I once wrote an ANN to predict the stock market. It succeeded with about 80% accuracy.
The cue here was to first get hold of a couple of million rows of real stock data. I used this data to train the network and prime it for real data. There were about 8-10 input variables and a single output value that would indicate the predicted value of the stock on the next day.
You could also check out the (ancient) ALVINN network where a car learnt to drive by itself by observing road data when a human driver was behind the wheel.
ANNs are also widely used in bioinformatics.

Artificial Intelligence project idea [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am looking for a graduation project idea in AI and machine learning field...
The idea may require front-end user interface to attract users...
I am thinking of how AI and machine learning can help you in daily life..?
Any help/hint about new interesting ideas ?
Thanks
Edit:
I am talking about practical ideas that may be used in real life... Not an idea to prove theoretical things... Something like a OS (or an add on in existing one) that adapt with your way of work... or a word processor that helps you collecting information about what you are writing..
What about an project that uses Markov-Chain text generation to generate answers for Stack Overflow questions? (^__^)
Two ideas:
Write a current, robust version of SHRDLU with understandable source code.
Write a SHRDLU-like program that manipulates actual code instead of imaginary blocks. Such a tool could be used for manipulating extremely large, complicated programs, including its own code!
Imagine giving commands like the following...
(a) Scan web site X and list any sentences you failed to parse.
(b) Scan document Y and list any grammar rules you didn't need.
(c) Instead of iterating over every element of "proplist" in your "search" function, only process the cdr of "proplist" if the initial call to "lookup" returns nil. After you make the modification, confirm the sentence "pick up a very very big block" will succeed and the sentence "pick up a very and very big block" will fail.
(d) Your "conjoin" grammar currently requires a coordinator word like "and", but that requirement is wrong. Split your "coordination" grammar into "syndetic coordination" and "asyndetic coordination" as follows: conjoins using "and", as in "quickly and quietly, he walked into the bank" are called "syndetic coordinations". Conjoins without a coordinator, as in "quickly, quietly, he walked into the bank" are "asyndetic coordinations". Now scan corpus Z to see if fewer sentences fail to parse.
One component of intelligence is imagination.
It wouldn't take much to Google for "artificial intelligence research projects" and see what other people are doing at other schools. Since it's not a Ph.D., there's no uniqueness requirement for you.
You could also look at Peter Norvig's text to see what's been done before and adapt it.
I'd also recommend doing something with the reams of data that's available to you on the web. Try thinking about "Programming Collective Intelligence" and "Beautiful Data" to see how you could use information to teach a program how to adapt its behavior based on new information (neural nets, genetic algorithms, ant colony algorithms, etc.)
What interests you?
AI is used in a great many areas, so find something you are passionate about and then see how to use AI for it.
For example, if you are interested in games, then you could find an interesting algorithm for the ghosts in Pac-man to chase, and use some more interesting mazes. You may find someone that is interested in doing a 3D project and they could write a 3D version and your algorithm could be more interesting.
Or, you may be interested in robotics. Again, it would be ideal if you could find someone with an interest in making a robot and you could write the AI part. So, for example, you could see if you can figure out how to get a robot to determine the difference between a farm crop and a weed/grass.
Basically, your starting point should be on what really interests you.
Perform a clustering on documents, as done by ex-clusty search engine. This clearly is an attractive application.

Resources