Friday, September 4, 2015

Remove duplicate lines from a file using python

In case you have a file "input.txt" with duplicate lines and you would like to remove duplicate lines from it, and have the result put in "output.txt" all you have to do is execute
this python script, be careful and use the same indentation (space):

lines_seen = set() # holds lines already seen
outfile = open("out.txt", "w")
for line in open("input.txt", "r"):
    if line not in lines_seen: # not a duplicate

This will execute in less than a 1 second, no matter how big is the file. Have a nice day.

Tuesday, September 1, 2015, the multi-million dollars lyrics empire

If you're a fan of music, and a 90-something kid, then you must have stumbled upon a lyrics website, that is extremely simple. What does is pretty simple, put all pop lyrics on its site, its motto is: 

We have a large, legal, every day growing universe of lyrics where stars of all genres and ages shine.

The average 9-5 Joe thinks that this is a normal lyrics website that makes 0 money and there is no effort is maintaining, and ruling the site; just some stupid site with lyrics posted by members; that's far from being true.

AZLyrics, the top website for providing lyrics, is distinguished in:
  • Its SEO, the lyrics usually rank the first on Google search results, has a page-rank of 6 on Google.
  • Its simplicity, simple A-Z search, no complex or annoying layout, unlike (metro-lyrics, rap-genius).
  • Its accuracy, it has ordinary people submitting corrections for free, you'll rarely find wrong lyrics.
  • Its speed, it adds new lyrics everyday.
  • Its history,  AZ existed since 2000, and as of 2015, its 15 years old!
And beside its simplicity, has one hell of an Alexa Rank:

AZLyrics was very kind to publish its statistics:

As you see, AZLyrics receives 190,000,000 million unique monthly visitors and 280,000,000 monthly page views (though I doubt this is less 1,000,000,000) but anyway, the site makes money through many advertising platforms including:
  • Adsense (Known for being the best advertisement platform on existence).

  • Amazon (Advertisements for products only).

  • TribalFusion (Known for malware, spam, fake products, money scamming)

  • ClickFuse (Music, related)

  • Advertisement for

Using my calculation and experience, I'd guess that azlyrics makes an income between 1 million dollars and 10 million dollars monthly.

Besides all that, the team of owns and operates the following websites (Updated on 1 September 2015):
  1. AZLYRICS.COM - Pop Music Lyrics
  2. AZVIDEOS.COM - Pop Videos Embedding from YouToube
  3. DARKLYRICS.COM - Heavy Metal Music Lyrics
  4. URBANLYRICS.COM - Hip Hop R&B Music Lyrics
  5. COWBOYLYRICS.COM - Country Lyrics
  6. OLDIELYRICS.COM - Old Music Lyrics
  7. PLYRICS.COM - Punk Music Lyrics
Their site AZLYRICS.COM is hosted by LeaseWeb as of September 1, 2015: