Efectos EspecialesRamblings, rants, musings, ideas and observations. Topics include (but are not limited to): programming (especially Python), books, games (especially CCGs and board games), astrology, design, writing, painting, etc.
As seen in The Idiot's Guide to Special Variables and Lexical Closures [pdf]:
Note that there is a difference between creating a variable for the first time, and changing the value stored in a variable that already exists. Some languages (like Python) hide this distinction, using the same syntax for both operations. While this may seem convenient at first glance, it is generally considered a bad idea because it makes it impossible to tell the difference between the creation of a new variable and an assignment to an existing variable that contains a typographical error. This in turn often leads to hard-to-find bugs.
Nitpick: As far as I know, Python doesn't just hide it, but rather, it doesn't *have* this distinction.
x = 42 binds the name
x to the integer 42, in the current namespace. That's all. Whether
x already exists or not is irrelevant. There's no distinction between "binding" and "assignment" like in Lisp. This seems to confuse Lispers to no end; I recall having a "discussion" about this with somebody a year or two ago.
It is true that this can sometimes leads to hard-to-find bugs. Consider:
myStrangeVariableName = "hello" # later... MyStrangeVariableName = "bye"
Now you have two variables, rather than just one with the new value "bye". Probably not what was intended. There are ways around this... PyChecker, for example, and decent unit tests go a long way, so in practice, this is rarely a problem (at least in my experience).
The guide seems to be worth reading, by the way... it deals with (Lisp) assignment, binding, scoping and more.
Well... that wasn't a very good game. And I had to pay to see it...
Usually, the German Johann Gutenberg is credited with the invention of the movable type printing press technology. In the Netherlands, some people claim that a certain Laurens Janszoon Coster was the real inventor. Since the latter seems to be fairly unknown internationally, I always assumed that this was just a mild case of chauvinism.
However, Bill Bryson writes in The Mother Tongue:
In fact, history may have given Gutenberg more credit than he deserves. There is reason to believe that movable type was actually invented by a Dutchman named Laurens Janszoon Koster (or Coster) and that Gutenberg -- about whom we know precious little -- learned of the process only when one of Koster's apprentices ran off to Mainz in Germany with some of Koster's blocks and the two struck up a friendship. Certainly it seems odd that a man who had for the first forty years of his life been an obscure stonemason and mirror polisher should suddenly have taken some blocks of wood and a wine press and made them into an invention that would transform the world.
Boekdrukkunst is the Dutch word for the art of printing books (using a printing press).
After 12 years, Cosmo's Cosmic Adventure still works under Windows XP, and is still a great game! Very playable, very colorful even though it's EGA. The graphics show their age, but don't look too jarring even on my 19" monitor.
Get the free shareware download now at the page mentioned above, or find the full version if you're resourceful.
[Update #1] Another good game is Crystal Caves. Anno 2004 it's still fun to jump around, collect crystals and bonuses, use platforms, avoid monsters and traps, etc. Highly recommended.
[Update #2] Rise of the Triad, a 3D shooter not unlike Doom, isn't quite as good as the aforementioned games, but it has some pretty zany effects. For example, the ubiquitous "god mode" cheat turns your weapon into a hand, hurling balls of light while making an ominous moaning sound. In addition, there's also "dog mode", which has the same effect as god mode (invulnerability) but which turns you into a dog. (This change is not entirely gratuitous; it allows you to crawl under some doors and narrow crevices, where you normally wouldn't fit.) There's also mercury mode (flying), elasto mode (you bounce off things), and shrooms mode (drunk?).
Unfortunately, I haven't been able to make this game work on modern computers. The installer doesn't work for me, but the game does; it even configures the sound card correctly (fairly unusual for a DOS game run on Windows). As said, the game isn't so good, but the cheats are fun. For some reason, the graphics (320x200x256) look worse than Cosmo and Crystal Caves (320x200x16).
People are linking to the Clean Sweep Assessment. So far I've only seen scores in the 70s. My score isn't quite as good: a meager 51.
Surprisingly, my best (or least bad) area is Relationships.
Of course, I don't necessarily agree with what some of these questions suggest. Why would rarely using caffeine be a good thing? It's not that bad. Sure, some people claim it's a poison that works slowly. It has to be, because my grandmother has been drinking it for over 70 years, and she still isn't dead. And why would sugar be so bad? Restricting these things to below acceptable levels would severely affect my quality of life, since I like yummy food and drinks. I don't want to do without coffee, tea, cola, Sobe or Amp. (Well, I could cut down on the coke-a-cola... my teeth don't really need excessive sugar/acid attacks.)
Other points are nice, but I simply cannot afford them. Health and disability insurance. A pension plan. Regular dental and eye checks. 6 months of living expenses stashed away. 4 weeks of holiday. All these things are cool, but not really realistic for a Floridian worker bee. (Hint: around here, people think $14/hr is good money for a programming job.) So far, my jobs are and have been outside of Florida, but it doesn't do me much good, since insurance, dentist etc are ridiculously expensive, in spite of the low wages here. I'm not complaining, but I don't see how I will be able to answer "true" to any of these questions anytime soon. (If I lived in the Netherlands, it would be a different issue.)
Still, at 51 points, there's plenty of room for improvement, even with my caffeine and sugar rations unchanged. Let's see if my score is any better at the end of the year.
I got this book from the library without really knowing what it was. The few pages I saw on Amazon looked funny, kind of parody-like. Maybe it is, maybe it isn't; either way, I suspect I'm not exactly part of the target audience for this book. So I wasn't going to read it, but then my daughter saw it and laughed at me. "I read the first page! It's really stupid! And you are reading it! Bwahahaha!" Just for that, I'm going to read it now.
Well, like everybody else in the world, I went to see it. Harry Potter and the Prisoner of Azkaban. On Friday morning, to be precise, vainly hoping that not many people would be there at that early hour. When we went to see the first movie in 2001, also on the very first day, nobody else was in the theatre. Nobody at all. The school bus parked in front of Gator Cinemas was our first clue that this time would be different.
PoA has a different director, Alfonso Cuarón, and it shows. The first two movies followed the books quite faithfully. The new one does not. I suppose it's more interesting, artistically, if a movie doesn't slavishly copy the book, which may (partially) be the reason that this film has had rave reviews. However, I am one of those naive people who expect a movie that is made after a book, to be like that book. (Sucker...)
I read somewhere that Cuarón decided to take a "big theme", cut everything out that didn't fit that theme, and put the rest in the movie. The theme he chose was that Harry and friends are growing up, becoming adolescents, with their own problems, worries and anger. Unfortunately, this isn't a theme in the book at all. This kind of stuff doesn't appear until books 4 and 5.
Needless to say, this point of view twisted the storyline quite a bit. The main problem is that the movie feels like a bunch of clips of important events, without the "glue" that makes them feel like a coherent story. The movies rushes through these clips, even though there is no good reason to hurry to the end (since book 3 has no apotheosis like the first two books).
One example: in the book, Hermione uses a magical device to go back in time, so she can take more classes. This taxes her heavily, to the point where she becomes very stressed. Because of this, she does things that would normally be out of character for her. During Divination class, she criticizes Professor Trelawney for constantly predicting Harry's death and doom. Trelawney, affronted, tells Hermione that she has little aptitude for divination, which causes Hermione to leave that class. Also, when Malfoy makes fun of Hagrid, she hits him. -- In the movie, this is presented as three distinct events, without showing the bigger picture. 1. Hermione uses a time-changing device. 2. Hermione blunders during Divination class and walks out in a huff when Professor Trelawney corrects her. 3. Hermione hits Malfoy. The movie makes it seem she's a snotty little brat, which really isn't in line with the books.
This is really what bothered me the most about this movie. There are other nitpicks, but they are minor. There are scenes in the movies that don't appear in the book, but they aren't very obtrusive. Hermione throwing the stones at Hagrid's cabin, for example, or Buckbeak driving off the werewolf. And flying dementors. Such changes are not a problem; in fact, JKR could have written it that way.
I found the movie OK, but a bit disappointing, for the reasons stated above. (Nice special effects though... the hippogriff manages to move like a bird *and* like a horse.) I'm not sure if I will go to see #4. No clue how they could do that one in under 6 hours, anyway...
In fact, it has been for a few weeks, but I haven't announced it. See the download section. Some of the changes since 0.2.0:
- Fixed a problem with GroupBox and GroupBoxContainer.
- Added a metaclass construct for automatically adding event methods. Which will probably be replaced again in a future version, but that is a different story.
- Cleaned up colordb.py.
- Added WaxObject.SetForegroundColor and SetBackgroundColor. (That's right, "Color" rather than "Colour". •1 ) These methods accept strings as well, so you can say
- Added WaxObject.GetAllChildren, which recursively loops over all children, grandchildren, etc, of a widget.
- Added tools/menuhistory.py.
- Moved errordialog.py to
tools. (This is an incompatible change! If you use ErrorDialog in your code, make sure to update it.)
Some of these patches were contributed by Grant Edwards, most notably the GroupBox fix. See HISTORY.txt for a more complete overview of what changed.
I'm probably going to overhaul the event system, while trying to keep it as backward compatible as possible. I kinda like the idea of being able to stick a method into an object and have it automagically recognized as an event. I do not like the overhead incurred by the current system, though. So I have a better idea, that will be implemented in 0.2.12 or 0.2.13 or so. Watch this space...
Well, it was only a matter of time before I started blogging again. After all, I like writing. I may not be as good at it as I'd like to be (at least not in English, which is not my native language), but I'm learning.
So... New blog, new design, new topics to write about. I want to spend a bit less time programming, and more time pursuing other creative endeavours, like drawing, painting, writing, game design, etc. This new weblog should mirror that. I also want to deal with topics that weren't often discussed in Tao of the Machine, like astronomy, astrology, languages, US vs Netherlands, etc. And cat pictures, of course.
However, programming will still play an important role, especially Python, and I will continue to "review" interesting programming languages, and announce new and updated projects. I have been working on Wax lately, for example, so expect announcements on that.
I got rid of a few things. Categories, for example. I didn't find them very useful, so I won't use them here. The "icon" that accompanies each post is a weak replacement for categories; it's an indicator of what the post is about. This entry has the default icon, by the way.
I also don't think the date is very important, so maybe I'll get rid of that too. (You can still get the date by hovering the mouse cursor over the post's title.) Comments and permalink stayed, but moved position. Archiving by week didn't seem very useful either, so I replaced it with archives per 10 items.
The lists on the left (books I'm reading, etc) are dynamic and will change over time. I mostly put them up in case somebody finds them interesting. If not, I can always remove them. What's missing is a blogroll. Hmm...
Design and content © 2004 Electric Shock / Hans Nowak