General Web Technologies

JDOM Create DOM from File

I thought this was helpful, and I keep looking it up again and again.  Trick is, you need a sax builder, not really sure about what it is, just know how to use it :)

import java.io.File;
import java.io.IOException;
import org.jdom.Document;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;

public class SomeClass
{

    public SomeMethod ()
    {

        Document doc = null;

        SAXBuilder sb = new SAXBuilder();

        try {
            doc = sb.build(new File("/path/to/some/file.xml"));
        }
        catch (JDOMException e) {
            e.printStackTrace();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }

}
multiplicity

The Music Industry is a Ratard

This actually doesn’t just pertain to the music industry but also the movie and general entertainment industry as well.  What I’m talking about is the absolute inane economic model the entertainment uses to combat piracy.  If they had realised in the first place that the piracy situation was coming about because of a need and not sheer maliciousness, and they acted on that need before it became completely main stream, then they could have easily stomped out the majority of piracy that exists today.

We really have a couple of different economic models that were enacted while piracy was in its infant stages.

Need / Desire:

The first and most prominent of course is the need based model.  As more and more MP3 players were hitting the market (and more and more programs to play MP3s were available on computers) there was a sudden need to get more tracks into our libraries.  If you owned a CD, it was not simple, but you could get your tracks off of the CD and on to your computer to use on all of your devices.  But, this was not for the faint of heart, and the average computer illiterate would say “MP-what?  gimme my ocho track!”  So, weather the public recognized it or not, there was a new need to digitize music our music collections. We wanted to digitise our music, because it was good: it allowed us to back up and replicate our songs as many times as we wanted, and it allowed us to ensure our ownership of our music till the day we die (more on this later).  So with a need for getting our collections onto our comptuers, we became more greedy and thought: why do I have to stop at my music?  why can’t I have more?!

One long desired functionality that was brought about by the digital music age was the ability to finally realise the dream of having a collection that would last FOREVER!  This is really fundamental if you think about it.  Through out the entire history of music (or entertainment) we have never once been able to keep something and play it as many times as we would like. In the days before recorded music, you only had your memory to serve you as to that last amazing song you had listened to.  Even the most aristocratic could at best retain musicians to reconstruct music at their whim, but who wants an Itunes that you have to feed, and doesn’t shut up when you want it to.

Before CDs

Before CDs

Then we made it on to the age of recordable music, oh what an amazing feat that was!  Now we could play something ten times before it got so scratched that it was worth shit.  As music recording media progressed they got better and better but the number of plays was still limited, the degradation of the music was still there, so that no one would ever think: “hey this record will still be just as good when I’m eighty!”  It was just as well because, who could really listen to Whitesnake for 70 years anyway?  I got sick of them in a fortnight.  This new functionality (and really the medium’s true draw) created the desire to copy our libraries and share with others, and grow our digital collection.

Gave away the Golden Key:

This is where the most blame lies on the music industry.  The Golden Key is the digitised copy of the music that they were selling.  Never before had the public been given this much power, and likely most of the music industry didn’t realise the horrible mistake they had made.  The one thing that all music had in common before the mp3 / CD days was that it was analogue, meaning it was an exact copy of the soundwaves stored on a medium (ie record, tape or phonograph cylinder). Therefore, to play the music you just had to re-amplify the analogue scratches on the recorded medium.  This is actually really good for music but absolutely horrible for replication.  In order to make a copy an analogue source (which was the only source the public had) you had to do what the studios did the first time, you had to play it, and recapture it on another analogue device, and obviously a copy of a copy is way worse than the original (see Multiplicity).

multiplicitymultiplicityriaatard

Now that they had given us the hard digital source, all bets were off. We could now losslessly copy any track as many times as we wanted without any degradation in quality (much like it looks in the Multiplicity poster).  The studios had given us the Golden Key without realising it.  It would be like Windows giving out its source code just because it would be easier to install on every machine, it would be fucking ratarded.  And that’s what the RIAA is (see image above right).  The worse that could happen in the analogue age was that a friend would make copies of his sweet tapes and give out to his friends, then they could make copies, but that was about it.  After 2 generations of copies, the tapes started to sound like shit.  The release of the Golden Key was what forced the music industry to release its tight hold on our scrotum.

Failure to Act:

The final death blow to the music industry’s totalitarian control over our minds was their unwillingness to act on a changing system.  The fact was they screwed up by releasing the Golden Key, but what was done was done and they couldn’t take that back now.  Whether or not they liked it, they were in economic competition with the pirates of the web.  At the time (even as late as Napster) there were major drawbacks to pirating material:

  • slow
  • unreliable
  • fairly difficult

On the other hand, the things it had going for it were:

  • it was free
  • it was the only thing available at the time

Piracy at this point was a necessity to acomplish the needs described above, it was really the only choice.  Internet music would be completely different (and a whole lot more profitable) if the pissed off industry had jumped on the bandwagon at this infancy stage and offered the same services but with some investment into the usability and stability of the system.  But they didn’t jump on this opportunity and soon, out of need, the piracy solution became easier and easier to use.  It also became quicker and more reliable.  Now they are in the situation where they have nothing to offer over the competition except for the ability to say that it’s legal (but really anonimity is on the pirate’s side).  Now the music industry has to come up with several radical ways to make sure that the desire to download music legally is fullfilled, and honestly the only one doing that is Pandora (how cool are they?!).

It’s sad but this industry could be soooo much cooler and more profitable with a little innovation from the beginning.  Hell, we could even be talking about corporate libraries and communal sharing which could have brought in butt tonnes of money.

A solution I came up with (but of course didn’t share with the RIAA) a long time ago was based purely on economics.  Had the RIAA flooded the Piracy market with thousands of copies of their own music but of random noise or really bad quality they could have made it impossible for the pirates to use.  All they had to do was taint the supply and the demand would go down (but not the source of the demand so they would have had to simultaneously emerged with their own solution to the demand).  It’s kind of dick, but no more shitty than suing 14 year old kids for ripping sesame street to their ipods.

P.S.  I personally don’t steal music because I have finally accepted Itune’s solution to my needs, but unfortunately most people around the world have not.

Helpful findings for computers in general

I thought I would post here, some really good articles (as I come across them) that have to deal with overall information on computers.

Linux Directory Structure Finally Explained:

http://www.tuxfiles.org/linuxhelp/linuxdir.html

If you want to check out the source code to java JDK, go here:

http://weblogs.java.net/blog/idk/archive/2006/09/readonly_subver.html