Tag Archive for 'code'

Python is awesome

I’ve programmed in a couple languages, but I’ve never gotten the hang of any of them. I’ve experimented with PHP, Java, a little bit of C+…they’re all so damn confusing. Sure, I learned how to use Java some (I took an actual class on it), but the syntax was just weird. I’m sure it made sense to someone at Sun Microsystems, but to the rest of us, it’s just messed up.

I came across an xkcd comic involving Python, so I decided to take a look. I’ve only done a couple of tutorials, but from what I’ve seen, Python is insanely simple. Yes, it has its own syntax, but it’s not nearly confusing as Java. For instance, take a look at the ways you print “Hello world” in both languages:

Java:

System.out.println('Hello world');

Python:

print 'Hello world'

What’s even more, that Java snippet is useless without a class surrounding it. The Python code can run just like that (assuming you have a Python interpreter and have made the file executable). No curly brackets, no semicolons, no compiling. I’m definitely going to look more into this programming language. At least until I finally find the drawback. There has to be a drawback to a language this simple. I shall find it and then make witty comments about it to embarrass Python programmers! Excellent.

Free right click!

You know what I really hate? Those annoying scripts some people use on their websites to somehow prevent copyright infringement by either removing your right-click functionality and replacing it with a message along the lines of “No can click right! Copy is righted, please!” or forbidding you to copy without a message. Admittedly, the last is nicer and a bit surprising (I didn’t even know it was possible), but it’s still irritating. There are plenty of legitimate reasons to select text and copy it. Perhaps you’re quoting from a site, or maybe you just want to copy a hard-to-spell word or name to search for in Wikipedia or Google. I do the latter quite a lot, just because it’s easier to copy a name than try to remember how it’s spelled while in another browser tab.

But it’s not just the annoyances that make this practice silly. It’s the fact that it’s so easily subverted. Much like car ignitions and government encryption, you can get around the anti-right-click with a minimum of technical know-how. For most, simply using a keyboard shortcut to copy (Ctrl+C for Windows, Cmd+C for Mac) will get you the goods. But fancier scripts can prevent even that from working. In such a case, you can easily view the web page’s source code in any major browser and copy text from there. In Firefox, there are three ways to do this: right-click on the page and select “View Page Source”, select “Page Source” from the View menu, or simply press Ctrl+U (Cmd+U on Mac) on the keyboard. The process is pretty much the same in Internet Explorer. If you use Opera, I can’t help you. I’m not about to install another browser just to see how you can view the page source code. Tough noogies.

There may be ways to prevent viewing the source code entirely, but I’ve never heard of any such thing, and anyone who would be that paranoid about people copying their content probably doesn’t have a web site at all.

In short, preventing people from right-clicking or copying from a web page is irritating and pointless, especially when you consider that a determined thief could just use their eyes to copy content into a text document…alas, nature has once again bested technology. Perhaps one day, web site owners will be able to prevent even the eyes from copying their content. Won’t that be a rather ironic day…

 

February 2012
S M T W T F S
« Apr    
 1234
567891011
12131415161718
19202122232425
26272829  
Support Wikipedia