Archive for the ‘Code’ Category

What is BitTorrent

Thursday, October 8th, 2009

I was looking up How Bit Torrents work and I thought I would describe what I found. I knew basically how they worked but I waned to find out more, so I went to Wikipedia for the answer.

BitTorrent is a peer-to-peer file sharing protocol used for distributing large amounts of data. BitTorrent is one of the most common protocols for transferring large files. The protocol works as an alternative data distribution method that makes even small computers with low bandwidth capable of participating in large data transfers. First, a user playing the role of file-provider makes a file available to the network. This first user’s file is called a seed and its availability on the network allows other users, called peers, to connect and begin to download the seed file. As new peers connect to the network and request the same file, their computer receives a different piece of the data from the seed. Once multiple peers have multiple pieces of the seed, BitTorrent allows each to become a source for that portion of the file. The effect of this is to take on a small part of the task and relieve the initial user, distributing the file download task among the seed and many peers. With BitTorrent, no one computer needs to supply data in quantities which could jeopardize the task by overwhelming all resources, yet the same final result—each peer eventually receiving the entire file—is still reached.

You can read the entire description at: http://en.wikipedia.org/wiki/BitTorrent_%28protocol%29

Using sed to remove whitespace

Wednesday, August 19th, 2009

I found a good way to search for files in SVN that are “!” and remove them.
svn st | grep ! | sed ’s/\! *//’ | xargs svn rm