You are currently browsing the monthly archive for February 2009.

I’ve been messing around with Pygame to some extent. It’s a neat little Python library, designed for the easy creation of some simple games. It’s cross platform, so it runs anywhere Python does.

I haven’t done much; the tutorials on the website provide much more instruction than I could at the moment, but I’d like to post the short program I wrote just for my own amusement. The button merely makes an image appear on-screen and work as a “button.” I wrote a short Button class as well as the main script, and am pretty impressed with the results. It’s a very basic example, but maybe it’ll help someone out there having some trouble getting started.

#!/usr/bin/python
import pygame
from pygame.locals import *
import os
import sys
from Button import *

pygame.init()
window = pygame.display.set_mode((640,480))
screen = pygame.display.get_surface()
pygame.display.set_caption("My Game")
bgcolor = 255, 255, 255
clock = pygame.time.Clock()
button = Button("play.png","play_invert.png",50,50)
while True:
	for event in pygame.event.get() :
		if event.type == QUIT :
			sys.exit(0)
		elif event.type == MOUSEBUTTONDOWN :
			if button.isInside(event.pos) :
				button.switchStatus()
		elif event.type == MOUSEBUTTONUP and not button.getStatus() :
			button.switchStatus()
		else :
			print event
	time_passed = clock.tick(50)
	window.fill(bgcolor)
	button.draw(screen)
	pygame.display.flip()

That was the main script. It requires four things: pygame, Button.py (coming), and two images (the button up and the button pressed).

Those are the two images I used. This is Button.py:

import pygame
class Button :
	def __init__ (self, path, invertpath, x, y) :
		self.x = x
		self.y = y
		self.button = pygame.image.load(path)
		self.invert = pygame.image.load(invertpath)
		self.status = True
	def draw (self, screen) :
		screen.blit(self.button, (self.x, self.y))
	def isInside (self, pos) :
		if (pos[0] >= self.x) and (pos[0] <= self.x+self.button.get_width()) :
			if (pos[1] >= self.y) and (pos[1] <= self.y+self.button.get_height()) :
				return True
			else :
				return False
		else:
			return False
	def getStatus(self) :
		return self.status
	def switchStatus(self) :
		self.status = not self.status
		temp = self.button
		self.button = self.invert
		self.invert = temp

Of course I failed to comment it… figures. Most of this should be pretty obvious though.
Also: consider this code public domain. Use it, make money with it, I don’t care. Whatever. I shouldn’t have to say that, but I will just in case.

The U.S. of A. was founded with an idea.

First: a short history lesson. John Locke said that God gave Man three rights. These are inalienable, meaning they cannot be taken away. These are rights: Life, Liberty, and Property.

Our forefathers changed it a bit: Life, Liberty, and the Pursuit of Happiness. How often have we heard it? An American Patriot should be able to put each of his or her own political views into one or more of these categories. One thing that’s interesting, is that usually Life encompasses Liberty, which encompasses a the Pursuit of Happiness, meaning if the first is lost so is the second, and if the second is lost so is the third, but if the third is lost the second isn’t.

A Venn diagram would be very boring:

vennlifelib

Let’s do the run-down:

  • Abortion :
    • If you’re pro-life: You believe in a right to life of the child.
    • If you’re pro-choice: You, believing that the embryo is not yet a life, are protecting the mother’s right to liberty.
  • Gun Rights:
    • If you’re pro-gun: You believe that you have the right to protect your right to life.
    • If you’re anti-gun: You believe that the guns, in the hands of criminals, are infringing on your right to life.
  • Drug Rights:
    • If you want drug legalization: You believe that the laws are infringing on your right to liberty.
    • If you want drug prohibition: You believe that other people doing drugs can possibly infringe on your right to life, and that the Government’s job is to protect the citizen’s right to life, even if the citizen is being protected from his or her own actions.
  • Taxes:
    • If you want low taxes (and little Governmental interference/programs as such): You believe taxes and government programs infringe on your right to a pursuit of happiness, and that private enterprise can help the unfortunate better than Government.
    • If you want high taxes: You believe that the Government is more capable of helping those that have had their right to a pursuit of happiness taken away by unfair circumstances than private enterprises. You believe that this is worth your sacrifice.

These are just four examples. Obviously you can go on for awhile like this, and some of these are easier to do than others, but it’s important to classify why you believe in what you do, and to constantly be thinking about your beliefs.

If you aren’t examining, judging, re-evaluating, and overlooking your own beliefs you might start to take things for granted, and to “feel” your beliefs instead of reasoning through them. And that’s dangerous. Because then you make irrational decisions and your beliefs will start to contradict.

Ever met someone who is pro-choice (and believes the unborn child is a life) and against the death penalty? Or someone who is pro-life and for the death penalty? Me too. Those people confuse me.

But remember this:

If you lose your right to life, you lose everything.

If you lose your liberty, you lose your pursuit of happiness.

And if you lose your pursuit of happiness, what else is there to live for?

This is something that has bothered me for quite some time.. and it’s not really important, but it’s something that has chewed away at my consciousness since I first installed Linux.

When I installed Linux in 2005, it looked like this:

fc3

Linux has come a long way since then visually. We have Compiz now, for one. Linux has the potential to be beautiful, but also customizeable. But it’s having an identity crisis. The first thing people seem to do when they decide to change their Linux to suit them better is go to the internet and see what other users have created. They usually  wind up on www.gnome-look.org. But there’s a problem. Let’s go through the 10 most popular Metacity themes for Gnome on gnome-look. The link above will bring you right to this list.

I’m not even going to touch KDE. KDE 3.5.x had a theme called Redmond that looks exactly like Windows, and KDE 4.x looks more and more like Vista with every release. So this is just Gnome. So let’s get started.

  1. This one isn’t so bad, actually. But the influences of Vista are apparent.
  2. oooh colors

    oooh colors

  3. This is where the fun begins. Can you say “looks like OS X?”
    gnomelook2

    The author apparently disliked OSX's buttons.

  4. Repeat after me: OS X is prettier than Linux. OS X is prettier than Linux. Except the buttons.

    OSX is also just a little too light.

    OS X is also just a little too light.

  5. Noticing a pattern?

    gnomelook4

    Are the stoplight buttons that bad?

  6. I’m out of snarky remarks about OS X.

    gnomelook5

    This guy apparently only likes the buttons.

  7. This one looks like Vista, if Vista had come out in 1998. Let me remind the reader that these are the 10 most popular themes downloaded on www.gnome-look.org, which has more themes than one could ever peruse. This is what the people want. Apparently.

    gnomelook6

    Number 6? Really? At least it's somewhat original.

  8. Repeat after me: Vista is uglier than OS X but prettier than Linux…

    Man, this looks usable. I'd love to stare at this screen for hours.

    Man, this looks usable. I'd love to stare at this screen for hours.

    That one isn’t just a Vista clone. The window decorations are Vista.. inspired.. to say the least, but the rest of it is great. Easily my favorite. It’s like what we all wanted computers to look like when we were eight, but wondered why they didn’t. This is why: it gives you a headache. It cuts down on screen space. It’s ugly. I digress.

  9. I’m still out of OS X jokes. Seriously.

    Guys: OS X is really not that great. Seriously.

    Guys: OS X is really not that great. Seriously.

  10. FINALLY. This one is actually decent. And guess what? It’s either in the repos or included (I forget which) in Linux Mint. All I’m sure of is that I’ve seen it, and I didn’t download it from here. But: it’s very plain, and it’s.. frankly.. pretty ugly. At least it doesn’t look like Vista or OS X.

    gnomelook9

    Of course, the one that doesn't look like a different OS would be a terminal screenshot. Wtf?

  11. And finally, number ten is… another OS X clone. This guy likes all of the OS X look though, the buttons and the monotone.

    gnomelook10

    It's Tigeopard! The color of Leopard and the buttons of Tiger! YAY!!

I just hope that I’ve illustrated my point. It’s not that Linux doesn’t have a relatively distinctive look, at least in Gnome. KDE, as I said, just looks like Vista (as of version 4). A few distros have developed a look. Ubuntu is very identifiable (but ugly), Suse is identifiable (and pretty), and Fedora’s artwork team is doing some wonderful work. But the community needs to get with the program. If I wanted my OS to looks like Windows or Mac, I’d use Windows or Mac. I’m OK that these clones exist; it’s cool that it can be done, but why are 90% of user-made themes either clones or exactly the same with one little change? COME ON PEOPLE. Be original!

Linux deserves this. Go make some themes. Make them beautiful. Make them not like OS X, and not like Vista. Seriously.

Oh this is exciting. In my stumbles, I ran onto a blatantly Communist blog: www.resistmuch.com. The post on the link is a post about “charitable shoplifting.” I read the post, thinking of an old friend of mine who’d tried to explain why he’d stolen some chocolate from a drugstore (that eventually went out of business, ironically) to me using some of the same rationalizations.

I was a little perturbed, and posted a civil comment.

You do realize you’re hurting the people you intend to help? By stealing, these corporations are forced to raise prices (to cover increased costs) and the poor can no longer afford the food, or they have to cut costs elsewhere (such as laying people off) and no “developing” economy in the world does anything ecologically because they can’t afford it, and you’re just helping to put us in the same bracket!
Learn some economics.

OK, so the last line might have been a little rough. I apologize. But I decided to sign my name w/ a link to this blog. And look at this! The last two posts have responses from the writer herself. Look, I was even so kind as to link to her blog on mine up above, and all I got was name-calling and, in my post “Really Obnoxious” exactly the kind of arrogant behavior I was upset about and trying to call attention to.

Beautiful. I’m so flattered. Thank you, Cecil. :)

Our dog is missing.

dscn0042

Come home Sophie, we miss you. :(

Update: Sophie is home. :)

You know what I find more annoying than an evangelical who tells me I’m not “saved” because I’m Catholic?

More annoying than Jehovah’s Witnesses knocking on my door?

More annoying and patronizing than flat-earth creationists?

Sanctimonious athiests who think they’re God’s gift to Mankind. Oh right, I mean Mother Nature or Blind Luck or Evolution’s gift to Mankind or whatever. Just because you’re athiest doesn’t make you any smarter than anyone else, and doesn’t mean that the rest of the world has been swindled. I am going to punch the next athiest who says “I don’t believe in Jesus Christ for the same reason I don’t believe in Santa Claus.” Not only is this callous, inflammatory, and the most unrightfully condescending drivel anyone will ever be allowed to say on national television by the likes of Bill Maher (although I don’t think he’s said that exactly, correct me if he has. I wouldn’t be surprised), but the existence of Santa Claus can be mathematically disproven, not to mention that Santa Claus is said to still exist and clearly doesn’t.

And the existence of Jesus? Definitely a lot more evidence pointing toward the existence of Jesus (and God) than Santa.

For crying out loud.

A wild boar, for those unfamiliar, is this:

From Wikipedia

From Wikipedia

You can’t really tell from the picture, but these suckers are big. The variety found where I’m from, the Russian boar, is usually around 600lbs. These were introduced into the wild some time ago where I’m from, and the locals find sport in hunting them. The trouble with hunting a boar is that they are big, their hides are tough, and frankly, they will maul you if you give them any reason to. Think a bear is mean? Try pissing off a boar. And if you don’t shoot them with a big enough gun, or you miss their vitals (mainly that tiny brain), they are going to charge, and you better hope you can get that second shot off or get up that tree real quick. I personally know guys who have sat in trees for hours looking down at a pissed board that they shot and failed to carry the gun up the tree with them.

Part of hunting boars comes in simply bringing a big enough gun. Which brings me to my real point. If you’re going to protect yourself on the streets, why are we expected to arm ourselves with nonlethal weapons such as a taser or pepper spray? The “good” pepper spray that police use isn’t even available to civilians, so you’re left with literally pepper water to protect yourself from a potential rapist. If you arm yourself with a pistol you aren’t just going to anger the boar, so to speak.

And if you don’t agree, before you get all upset about shooting the rapist, I just want to know: in this situation, why is everyone so fast to come to defend the well being of the rapist?

QED.

Subsidies suck. A subsidy, for those who don’t know, is what happens when the government decides you’re too stupid to buy the right things and gives the industry money in the form of tax breaks or even just flat cash.

Today I tasted just how bad subsidies are. In Kroger, I found a small section of Coca-Cola imported from Mexico in the “ethnic” section of the store. I am somewhat of an aficionado of food, and am a notoriously picky eater. I’m the guy who notices when the waitress brings him Pepsi instead of Coke. However, I’m not the asshole that berates her for it, I just drink the Pepsi and think about how I wanted Coke.

Anyway, in the United States, corn is subsidized. This means that crap like “high fructose corn syrup” is cheaper than cane sugar. This is not true in any other country. Some people complain about high fructose corn syrup, as a sweetener, is worse for you than cane sugar. Whether or not this is true I don’t know, but what I do know is that cane sugar tastes better.

You know how you take a sip of sweet sweet Coca-Cola, and it’s cold and delicious and you’re swallowing and then… oh. What’s that? That’s an aftertaste. It’s sticky and gross. I for one prefer my Coke with ice so I have something to chew to get the aftertaste licked. That aftertaste is the high fructose corn syrup. So, in short:

Mexican Coke tastes like a completely different drink. It’s delicious and sweet and after you swallow, it’s gone. It tastes like a drink that took a country by storm. It is the Coke your grandparents talk about. It’s not the glass bottle, it’s the cane sugar. Mexican Coke beats the pants off of American Coke 10 to 1.

And we don’t have it because corn syrup is at an artificially low price thanks to the American government. It’s not that corn is actually cheaper, it’s because the American taxpayer helps Coke pay for every gallon of corn syrup they buy regardless of whether that American has ever had a Coke product in his or her life.

So the next time you buy a Coke, or really any mainstream American soda, in a vending machine, drink deeply. And when you’re done and you have that terrible sticky aftertaste in you’re mouth, think to yourself: American Coke is what a controlled economy tastes like.

The FreeBSD installation wasn’t quite painless… the lack of a graphical partitioning tool sent me running back to a Linux boot disk to make sure I didn’t hose my useful Linux Mint install. When setting up the partitions, the new filesystem names were alien to me :(. The install CD didn’t have the driver for my wireless card, so I had to plug in to do the FTP install.

From there the experience reminded me a lot of installing Gentoo, which I guess makes sense because Portage is based on BSD ports. I quickly installed Gnome and GDM and then fought with vim for quite some time. I toughed it out with csh and vi and got a basic install working, but my sound card is still not working, and I haven’t figured out what  BSD users do about Flash and whatnot… in any case I’m not really setting up a desktop workstation anyway but it’d still be nice to have my sound card working!

Really all I have to say is: it’s nice to be back in Linux! The experience of having something so familiar (Gnome) running on the alien BSD backend is one that makes me very uneasy. I’m sure it will get easier though, and I won’t pass judgement until I’ve given BSD a fair chance. Because different does not mean worse!

FreeBSD, that is.
Eh, we’ll see how this goes. Below is actually my preliminary practice-install into a VM. I now have it for-real on my laptop. :)
screenshot-freebsd-running-sun-xvm-virtualbox