Learning Python with Udacity

udacity_cs101

Just a note, this is not any sort of advertisement…

So I know some basic programming syntax, generally centered around C and C++ which I learned in college.  The C was through several Engineering based classes and the C++ was from a single Computer Science course I took when I had a semester to fill before transferring schools and didn’t want to completely lapse on the studying, schooling lifestyle.  I also know how to code HTML but that is barely programming by any stretch. 

I have tried various self taught methods to teach myself more C++ and some Java with little success.  I have some books to make Android apps but I have yet to get anywhere with them.  Then, I believe through the Windows Weekly podcast, I found out about this deal called Udacity. The first course offering is to learn how to code a basic Search Engine using Python.  I’ve found it pretty well designed though a handful of the examples were a little too abstract to be meaningful (I’m looking at the one about cost and RAM and memory and compute cycles which I still don’t understand).

Anyway, I’m done three out of the seven modules and I’m rather proud of the fact that I’ve actually managed to stick with it and learn some things.  I’ve got a little script now that I could use to extract links from any webpage or even a number of webpages, though right now all I know how to do is display them.  Presumably we’ll learn how to compile them into some sort of file or database.  My biggest hurdle really is I keep wanting to use C and C++ syntax.  Things like adding ; at the end of lines or 1++ or variable++.

It’s not a terrible problem really.

Copyright, Corporations, People, and the Concept of Ownership, The Concept of Things

NOTE: This got a little rambley and random at times but whatever, I don’t care.

So, when a person goes out and buys, say, a desk, they bring it home, maybe they assemble it, they put their computer on it, they sit at it, they use it as a desk.  Other people can come over and use this desk if the need to for all of these activities as well.  There is only one desk here, and when the person is done with the desk, they can do whatever they want with it.  They can throw it out, or give it to a family member or sell it to a stranger.  If they want they can disassemble it and cut up the parts and make a bookcase out of it, or a table, or even a different desk.

If you buy a CD, or a book, you can do many of these things as well (good luck building a book case out of a CD, you may have better luck doing it with the book.)  The thing is, as far as the companies are concerned, when it comes to media, many or all of these activities should be or are illegal.

For example, did you know it is illegal to listen to music publicly in your workplace?  This includes the radio, which, by the way, is broadcast freely to anyone.

The media industry has also tried many times to make it illegal to but used music and games.  This hasn’t worked out very well for them with physical media but these days everything is moving towards digital anyway, which makes the problem moot.  These digital files are often licensed and tied to a particular account and are not transferable anyway.

Which brings up the next side of this.  Digital Content and Copyright.  When something becomes digital, that is, a file on a computer, it immediately becomes infinitely copyable.  There is no way to prevent a file from being copied.  There are ways to make it inconvenient.  There are encryption methods and proprietary formats, that can be used but even with some encrypted capsule of data that can only be opened using a special program to prevent copying, you can still copy the capsule itself even if it meant doing a one to one ghost image of the drive’s data.

The problem is, that history has shown that the more encapsulation, or DRM (Digital rights management) a file has, the more difficulties it creates for normal users to use their files.  Your DRM music file may only work in a specific player on your PC, and only play on an specific brand of music player.  Then that player starts bundling ad banners or toolbars so it becomes a pain to use or maybe the brand of music player is more expensive than the others on the market or possibly just poorly made.  The DRM means you’re locked in to that system so it doesn’t matter how good the software or player is.

Well, it doesn’t matter until you say “screw it” and go to another brand but that’s a story for another day.

And despite all of the DRM a media file may have, the people who want to pirate it, will.  They will crack the encryption and extract the important data.  For movies and music, to enjoy them they have to be played out into the real world, which can always be routed and looped back in to be re-encoded.  This is known as “The Analog Hole”.  Until they start implanting chips in our heads or something, you can’t encrypt natural real world acoustics and visuals.

But this isn’t supposed to be a piracy rant.  I’m not advocating piracy or suggesting that all content should be pirated.  I’m just pointing out that the lengths companies have gone to in the past make it inconvenient for normal people and the pirates will do it anyway.  The music industry learned this and most music you can buy, easily, is DRM free these days.  The movie industry is still learning this as is the ebook industry to some extent, and it’s going to still bite them until they learn.

The point is, why do people pirate this stuff in the first place.  the obvious answer is cost.  Some people simply can’t afford it.  Some people don’t want to afford it.  A lot of people CAN afford it and choose not to.  There is an excellent book on this subject called Free Culture by Lawrence Lessig,  that puts people into four categories and explains it very well.  The book is freely available via Creative Commons Liscence and you can find a copy of the applicable chapter here.  The relevant part is here:

File sharers share different kinds of content. We can divide these different kinds into four types.

A. There are some who use sharing networks as substitutes for purchasing content. Thus, when a new Madonna CD is released, rather than buying the CD, these users simply take it. We might quibble about whether everyone who takes it would actually have bought it if sharing didn’t make it available for free. Most probably wouldn’t have, but clearly there are some who would. The latter are the target of category A: users who download instead of purchasing. B. There are some who use sharing networks to sample music before purchasing it. Thus, a friend sends another friend an MP3 of an artist he’s not heard of. The other friend then buys CDs by that artist. This is a kind of targeted advertising, quite likely to succeed. If the friend recommending the album gains nothing from a bad recommendation, then one could expect that the recommendations will actually be quite good. The net effect of this sharing could increase the quantity of music purchased. C. There are many who use sharing networks to get access to copyrighted content that is no longer sold or that they would not have purchased because the transaction costs off the Net are too high. This use of sharing networks is among the most rewarding for many. Songs that were part of your childhood but have long vanished from the marketplace magically appear again on the network. (One friend told me that when she discovered Napster, she spent a solid weekend “recalling” old songs. She was astonished at the range and mix of content that was available.) For content not sold, this is still technically a violation of copyright, though because the copyright owner is not selling the content anymore, the economic harm is zero—the same harm that occurs when I sell my collection of 1960s 45-rpm records to a local collector. D. Finally, there are many who use sharing networks to get access to content that is not copyrighted or that the copyright owner wants to give away.

The book goes on to explain the pluses and minuses of each of these types of people and really, only the first tier, people who blatant pirate because they want to” are the only ones who are truly being criminals and the only ones truly causing hard to companies.  These are also, for the most part, the minority.

Most people, given an easy, appropriately priced option, will pay for media.

ANYWAY.

I’m starting to fly off the track again…

The point i want to make is, as far as the industry is concerned, you don’t own the media you buy.  When you pay for a CD or an eBook or a BluRay disc, you are paying for the license, to consume that media, in the format you’re buying.  If you want to listen to that CD on your media player, legally, you must buy digital copies of that music and can’t legally rip that CD to your computer yourself.  You paid to listen to the music in CD format.  The same applies to movies as well.  It technically applies to books but digitizing a book is a bit more of a pain than it’s worth doing.

Consumers, people, normal folks, do not “think in legalese” and do not see it this way.  They only see that they already own this music, why do they need to buy it again?  Some of them may even see that they already own the Vinyl and the Cassette and the CD, why do they need to pay, again, to listen to this music?

This is where some of our piracy comes in.  It’s easy to rip a CD, not so much a cassette.  It can be done and it requires the use of the Analog Hole but it’s not convenient.  So people will just download their cassette collection illegally.

Also, on the radio at work point made earlier.  You also pay for this music, so that YOU can listen to it.  The license you buy applies only to you, and letting your friends or coworkers listen to the music is not legal either.  As far as the media industry is concerned, when you buy something, you are paying to listen to it alone, in a silo and you may never share this experience with anyone.  Make them buy their own damn media.

Building a Better Dance Pad

So a while ago, I designed and built my own Dance Dance Revolution Dance Pad.  I’m not going to go too much into the details behind that, but for a variety of reasons, I’ve actually used it considerably less than I’d hoped.  I also found recently that the arrows don’t detect properly anymore since they are connected to the Directional Pad which reads as analogue not digital.

So, I fixed it.  While I was fixing it, I finally added the button box I’d been meaning to add.

IMGP5404

The button presses of a Playstation Controller are simply the creation of an electrical contact.  This can be replicated on any similar button by soldering wires to either side of the PVC board’s pads inside the controller.

Anyway,  the first task was to rewire the pad’s “buttons” to the shoulder buttons of the controller board.  Simple enough.  Now they show up as “buttons” and not analog pulls in the PC.

Step two was to make the box removable from the pad for easy storage.  This also allowed me to replace the ball of wire that I’d ended up with when building it the first time.

IMGP5406 This mess becomes a network cable and a network jack.IMGP5405 The network cable is the one used for the new connections tot he shoulder buttons.

Next is the box, which I wired to the four face buttons of the controller.  It really doesn’t matter if I use the “start” and “select” buttons since in the end, the Playstation shell is tossed out and I simply map the buttons to whatever I want in game (I have yet to see how this will affect it if i use it on the Playstation).

IMGP5408

The end result is much cleaner and much more reliable all around.  I will probably add some stickers or something to the box to make it look prettier.

Some Thoughts on SOPA and PIPA

The whole internet is abuzz with SOPA and, to a lesser extent, PIPA talk.  Basically, these two bills in congress, one for the House, one for the Senate.  You can get plenty of information through Google or if you’d like, try the Electronic Frontier Foundation.

The gist of this bill, is that it would allow media companies, through the government, to block websites with “pirated content” through manipulation of the Internet DNS system.  Without proper due process of law.  DNS, is essentially the phone book of the internet.  You could also compare it to a road map.  It’s what computers use to know how to find the websites you look for online.  All websites are in fact a series of numbers called an IP address, however remembering 74.125.227.114 is tricky.  Remembering “Google.com” is not.

Feel free to use that link, it leads to Google.  Which brings up one major flaw with this bill.  Pirates will easily circumvent these blocked DNS entries by using IP addresses.  If say, the Pirate Bay is blocked, people will just use it’s IP address instead.

Also likely there will simply be “rogue DNS” servers.

I am not endorsing piracy, I am saying the bill will not do anything to stop it.  People also may suggest the idea of “if you’re not doing anything wrong, you have nothing to be afraid of”.

The problem with this logic, in every situation, is that the question of “what is wrong” is extremely subjective and often changes.  Guess what, in a world where SOPA passes and becomes law, it starts off simply as it’s told.  Places which host “pirate content” are effectively removed from the internet.  Nevermind that there will also be legal content taken off as well when sites like Megaupload are taken offline.  The block is not single file or even single subsite specific. 

But hey we’re all happier now without The pirate Bay and Megaupload right?

Until people start hosting their content through loopholes on blogger or WordPress.  Sure, it’s against the TOS and both companies work to remove them as they are found but hey, guess what, now they need to be blocked.  Thousands, probably millions, of independent bloggers are now silenced.

Or perhaps the definition of “piracy” and “copyright infringement” gets pushed out even more.  Universal studios puts out a big blockbuster movie, it cost them a shitload of money top make and it gets totally panned by the internet.  Nobody wants to see this movie, all this negative press floating around, well hey look, Blogger Bob used the movie poster in his review.  Nevermind that this may fall under the fare use clause, that’s infringement, let’s close down BloggerBob.com because his negative reviews may be hurting ticket sales.

Just remember, governments generally don’t start off deciding to become repressive totalitarian regimes.  (NOTE: Link will not work 1/18/2012)

I mean hey, we have a precedent now, plus, once a site is “gone” people won’t notice right?  Universal killed BloggerBob, why not suppress a few of those “anti government kooks” out there spreading bad spirits through the country while we’re at it.  We have the mechanism in place after all.  John Q Public doesn’t know what DNS is, he thinks it’s a new sandwich at Subway.

It’s not even that it’s a terribly BAD idea, it’s more that, in an effort to make things “move more quickly” it rejects the idea of due process, and facts, and evidence.

Which also brings up what really is a whole different rant.  The world is changing.  The world is not the US, or Europe, or China, or the Northern Hemisphere.  It’s an entire globe.  The internet is even more-so, and it’s the driving force of the world these days.  Which is the real problem here.  Because despite the best effort to push more crap on what used to be a pretty ignorant and docile public, it’s not working anymore.  Any sort of exaggeration or lie in favor of “marketing” is almost instantly debunked.  People who used to be made to feel better or pushed aside as isolated cases of problems realize that they are not alone.  The internet is the ultimate engine for real democracy.  look at the whole election system, when it took days and months to ride a horse across the country, then things like congress or the electoral college etc were a great idea.  is it even necessary anymore when people can express their opinion and desires to the world instantly?

The Build Process

I got a stack of boxes last Thursday, somewhat previously discussed.

I already owned the case.  It’s this one here.  It’s basic, holds a shitload of hard drives, and has several huge quiet 120mm fans.  I also already had a 1TB SATA drive to use.

It’s been a while since I have built a PC, but, in general, it’s pretty simple.  The hard part is picking out the components really, which obviously, I’ve already done.  He was not around for the build but my son asked if I thought I would be done putting my computer together within a few months.  He seemed surprised when I told him it would take maybe an hour, once I had all of the parts.

The only real key is making sure the heat sink on the processor makes good contact and works, since otherwise, you’re liable to burn up an expensive component.

The place to start is the Motherboard.  Here it is, removed from the box and placed on its static bag.

This part is essentially the central nervous system of the computer.  It connects all of the other parts together and lets them communicate.  It does a few other things but at it’s core, that’s what it does.  The Motherboard can’t do math for crap though, which is why the next step is to add the Processor, which more or less only does math… very very quickly. 

It’s small, maybe an inch and a half square.  This one runs at I believe 3.3 Ghz, with 4 cores, which essentially means it does 3.3 Billion calculations per second and can do four calculations at a time.  This chip costs more than any other individual component in this computer.  Because it works hard and runs everything, it also gets hot quickly.  Which is why the next step is to add the heat sink. 

Ok, so a little story on this humongous heatsink and fan.  The last time i bought a processor, it did not include a heatsink of it’s own.  Heatsinks, personally, a pretty generic and unless you’re overclocking the CPU, you really don’t need much.  So I threw the “Number one selling CPU Heatsink on Amazon that was only like $20 anyway” on my order.  The pictures on Amazon make it look like a standard chunk of metal that sits on the CPU with the fan on top.

Turns out the chip came with a heatsink and fan.  It also turns out that the one I bought was like four times larger than expected.  I decided that since it was cheap, I may aw well use it rather than return it.

Hence, gigantic heat sink.  Fortunately, the case I’m using is pretty large.

The last step before bolting the Motherboard assembly into the case is to stick the RAM in.  It’s nothing particularly exciting other than I had to consult the manual to figure out the optimal slot placement.

After the board is in the case, the power supply can be strapped in as well.  The manual suggested putting the PS in first but my experience has been that often the PS obstructs access to the Mother Board.  It didn’t in this case (pun intended) but I waited anyway.  I also stuck the hard drive into the drive bay and reinserted it.

While the view is still relatively clear, I also wired in all of the front panel controls and lights.  Just a side note, I ended up putting all of these in reverse, which meant opening the case later and flipping them all over.  No biggie.

Finally, the Graphics card is inserted.

The desire to upgrade the GPU was a heavy driver in my decision to build a PC to begin with.  This one can be expanded to a second card using some ATI technology that I forget the name of if I want to add a second one.  It’s huge and pretty impressive to look at.

Finally, everything is assembled and it’s time to power things up.

I go through and describe the build Process for a home desktop PC.

Aside from the flipped button leads, I also had a bit of a worry when turning it on with the cooling.  The PS fan doesn’t power up unless it’s needed, so it didn’t immediately spring to life as expected.   This wasn’t helped by rear fan, which it turns out is dead.  I’ve since bought a replacement for it though I have not installed it yet.

I also ran into a slight snag when I went to install the OS.  I don’t own any SATA CD/DVD/BluRay/Disc drives.  Fortunately, I have a USB DVD drive for my netbook, which functioned just fine for this use.

I also had to wait a day for my Monitor to come in and later realized I don’t own a second USB Keyboard or Mouse (no PS/2 Ports).

It’s been running just fine for several days now.

I can run all of my games on super uber graphics mode with no stutter or slow downs.  It boots up very quickly, despite the non SSD hard drive.  Basically, it’s everything it’s supposed to be.