The One with the Thoughts of Frans

Archive for Site

Quick, Unsecured Backup Over FTP

I wanted something that I could easily set as a cron job, and
the following works quite decently. For some reason the same construct does not seem to work with sftp, so if you’ve got any kind of sensitive data you probably shouldn’t use this.

wget -r ftp://user:pass@domain[/folder]

Comments

Violence in Games

This post is recycled, and was originally published on WatchZine on Wednesday 2004-03-03 at 14:00:00 UTC. I tweaked some grammar and spelling here and there, but I resisted the urge to rewrite this entry almost entirelyand rewrote fairly large portions of the text to make it flow somewhat better. To exemplify the relationship with the original text, I made extensive use of DEL and INS elements. I did not, however, refrain from commenting on myself. Sensitive souls beware: I added some brand new explicit content.


“Halt” clearly the voice of a German soldier sounds.Halt! shouts the voice of a German soldier. After a well aimed shot in the head of the soldier‘s head, the player starts going tosearching for his next victim. A zombie appears. The player getstakes out a flamethrower, and some seconds after thatlater the zombie is somediminished to a pile of burning meat. Then, a group of German soldiers came togetherassembles [or gathers] and is (coordinated) attackingattacks the player in a coordinated fashion. Two of them are killed by the rocket launcher, the; pieces of bodies are flying aroundbody pieces go flying about. This is a scene from Return to Castle Wolfenstein. Some people say this is bad for the minds of growing children,: that it will make them criminals, or even terrorists. Nonsense? [It’s a reasonable introduction, but the end is rather weak. This is at least somewhat intentional, however, since in Dutch (high school?) argumentative essay writing the thesis statement is to be avoided until the conclusion. I always thought this was quite silly, and my present-day familiarity with American-style writing only reinforces this opinion.]

These days, games becomeare becoming more and more realistic. That makes them more violent. [Now that’s nonsense. It makes them appear more violent. Besides, I thought you were arguing against this point of view?] Ten years ago, in Wolfenstein 3D (the mother of all shooters, and still a game which is forbidden in a lot of countries [Like where? I don’t know of any countries other than Germany, and that was for Nazi symbolism, not for violence.]), the German soldiers died in big red pixels. [See? It was much more violent in those days. You don’t see those bad-ass blood splatters anymore these days.] No matter where you shot it, the body turned with you. Now, that doesn’t exist anymore. Every character is build fromconsists of at least three to four thousand polygons. Shoot something from behind: it falls realistically; you can do bad things to the body and walks around it. Would this be bad? No, you just need to keep in mind that it’s a game. At young age, parents should tell their children what’s fake and what’s real. Children are able to ‘goimmerse themselves into a game very good,well; that doesn’t matter, as long as their parents/ or friends keep them in the real world. Besides, every game has a parental lock option, which allows parents to reduce the amount of gore. [While I agree with the general gist of this paragraph, the point isn’t made as well as it could have been, and some poorly phrased examples detract from the strength of the argument. Kids are aware of the differences between fiction and reality as well as adults, but parental locks aren’t exactly a convincing argument in support of this, and are almost a red herring to the real issue. No matter how realistic games look and sound, they really aren’t any different from watching a movie or reading a book. Governments are messing up the world and are trying to get history books rewritten so that they only point out the positive aspects in history—or have already succeeded, like in America—. Games are a non-issue and if there are people who cannot distinguish between games and reality, we should be glad that they’re doing their vicious deeds in games.]

Then it’s possible to putSome people point a finger toat the shootings in the U.S. Why? Some people sayIt is alleged that theythe shooters did it because they played so-called bloody games like Duke Nukem and Quake (I think they aren’t bloody at all [I think you’re fucking wrong.]). The way they went through the school looked like they were finishing level after level in a game. Also, here in the Netherlands something like that happened,: a boy killed a girl, because he ‘got stressed by a game’. Okay, you can get stressed if you die again, but to kill your neighbor girl… That has nothing to do with the game, h. He would also have done that without the game; someone like that would also have done that if his lock refused to work. Indeed, those people we should protect, but not against games, just against themselves! [A good point is certainly made, but I’d have to check the Dutch original to see if the point was so poorly made, or if I lost something in the translation. Probably a bit of both.]

Of course you have the eleventh of september9/11 [Of course, who wouldn’t think of 9/11 when discussing violent games.]: some reporters said that the idea came from a game. Their action even was successful: some games, like Red Alert 2 (which has a scene with the destruction of NY – one of the coolest levels in the game [If it had been Chicago, I would have been up in arms. Go Wolves!]) and Flight Simulator 2002 were taken from the stores (or not released yet in the case of FS – hey, in a simulation you should be able to chrash!), o. Of course you take it from stores out of respect for the victims, but the terrorists surely haven’t gotdidn’t get their idea to chrus thecrash into the WTC from a game. [That may or may not be true—if they got inspiration from anything it would have been a movie—, but it’s really a red herring to the real issue.]

It becomes time that people will see that gaming is pure fun. Making sure games don’t contain violence and aggression takes a lot of time, which can much bettercould be used to do something about the real causes of violence and terror instead, and to help psychicologically violateddisturbed kids. [Like these guys?]

Frenzie (15 Februariy 2002) [This is positively ancient!]

Comments

Add Show or Hide Deleted Text Button

For an upcoming post, I used the DEL element quite extensively. I figured that, while potentially interesting, it would help readability to be able to temporarily remove them from display, so I wrote this little script. Incidentally, it was the first time in about three years—meaning the first time since I finished the layout and scripts when I started this blog—that I added any new scripts, or even edited the file containing them. While I am probably far from the most suitable person for this job, I decided to write a little tutorial, explaining what I used and why I used it.

I’ll start by dropping a major bomb. Here is the script.

// Checks if there is deleted text in post entries. Adds a Show or hide deleted text button if there is.
// Copyright © Frans de jonge 2009. Licensed under a Creative Commons Atrribution 2.0 license.
function AddShowHideDeletedTextButton() {
	var postEntries = document.getElementsByClassName('postentry');
	var postEntry = postEntries[0];
	if ( postEntries.length == 1 && postEntry.getElementsByTagName('del').length > 0 ) {
		var hideText = 'Hide deleted text', showText = 'Show deleted text';
		var button = document.createElement('input');
		button.setAttribute('type', 'button');
		button.setAttribute('value', hideText);
		button.addEventListener('click',
		function () {
			var e = postEntry.getElementsByTagName('del');
			for ( var i = 0; i<e.length; i++ ) {
				if (e[i].style.display == 'none') {
					e[i].style.display = 'inline';
					this.setAttribute('value', hideText);
				}
				else {
					e[i].style.display = 'none';
					this.setAttribute('value', showText);
				}
			}
		}
		,false);
		postEntry.insertBefore(button,postEntry.firstChild);
	}
}

I’m going to assume that you have at least a basic understanding of functions and variables, but may not be completely aware of DOM methods and how to use them. A very valuable resource is the Mozilla Developer Center, or MDC. It provides information on much more than just JavaScript and the DOM, but while I find the CSS and even HTML specifications fairly easy to get around in, the DOM specifications, with their language neutral, very extensive descriptions are quite hard in comparison. They are exactly the way they ought to be, but this makes it somewhat hard to find relevant information about actual usage and how to use it. That’s where the MDC comes in. It typically comes with a clear, concise summary at the top of the page, and if you don’t understand that, it usually comes with more extensive code samples as well.

	var postEntries = document.getElementsByClassName('postentry');
	var postEntry = postEntries[0];
	if ( postEntries.length == 1 && postEntry.getElementsByTagName('del').length > 0 ) {

DOM methods used:

In my blog, I have marked up all of the contents of my posts with a DIV element, with, as you might have guessed, a class postentry. This particular bit of code is meant to make sure that we are on the individual page of the post (i.e. not in some kind of overview) and that there are actually deleted elements around. Adding a button on an overview page would result in all kinds of problems—if you add only one it may not be anywhere near where it is needed, so you’d have to add multiple buttons, check if the post where it will be added has deleted elements, etc.—which are easy to avoid by keeping it restricted to one post.

		var button = document.createElement('input');
		button.setAttribute('type', 'button');
		button.setAttribute('value', hideText);

DOM methods used:

Here we see the proper way to create an element through the DOM. First we create an element, in this case input, and then we set a few attributes to the values we want. Note that I defined hideText earlier, with the value Hide deleted text.

		button.addEventListener('click',
		function () {
			var e = postEntry.getElementsByTagName('del');
			for ( var i = 0; i<e.length; i++ ) {
				if (e[i].style.display == 'none') {
					e[i].style.display = 'inline';
					this.setAttribute('value', hideText);
				}
				else {
					e[i].style.display = 'none';
					this.setAttribute('value', showText);
				}
			}

DOM methods used:

Here we definitely have one of the more interesting parts of the code. Had I written this script about 8 years ago, I would have used something like var button = '<input type="button" value='+hideText+'>' and consequently added an eventListener like button.onclick = someFunction;, where someFunction would be separately defined. I am using the proper DOM method instead. This may cause problems in IE, for which there are fixes available, but since this blog is strictly personal I decided not to care about that. Notice how I did not define the function separately, but included it as an anonymous function. Since the function is not intended to be used anywhere else, it’s easier, and, ideally, it will be completely removed from memory if the button were to be removed.

The element.style property allows you to access and change style properties on an element. As the MDC says, It is generally better to use the style property than to use elt.setAttribute('style', '...'), since use of the style property will not overwrite other CSS properties that may be specified in the style attribute. I may not be defining any other styles on DEL elements yet, but this way the script won’t break my site if I do add some more style to it in the future, or if someone else wishes to adapt it for use on their own page.

		postEntry.insertBefore(button,postEntry.firstChild);

DOM methods used:

To finish it off, we’ve got the insertBefore construct. It inserts a node as a child of the node to which it is applied, before a specified other child of this parent node. When I first came across it a few years ago, I thought it was somewhat confusing at first. It should be noted that node means much more than element, but in these specific examples it shouldn’t matter, so I didn’t go into it. If you wish to learn more, I recommend you try the MDC or a search engine.

In conclusion, I hope this helped someone out there a bit. I thought it was interesting to reminisce about how I would have written this script if it were 2003.

Comments

IPA Fonts on the Web

Nowadays, the most obvious way to blend all kinds of UTF-8 characters in nicely with all the other text on your page might be Webfonts, but I think there are definitely valid reasons not to utilize those to achieve consistent display of IPA characters on a page. This post will focus on a very simple method which ensures that IPA will look decent across a variety of operating systems and browsers. The issue is nothing but aesthetics; however, the importance should not be underestimated as the following screenshot will demonstrate.

ipa-font-test
You can try the results of this yourself, but what it will look like depends on the fonts you have installed.

What I used to achieve the cohesive look of the IPA characters is this simple line of CSS.

.IPA{ font-family: "DejaVu Sans", "Lucida Grande", "Lucida Sans Unicode" }

It’s an easy concept. Slap class="IPA" on some element—I used SPAN—and it will automatically display in one of these fonts, ensuring that no characters look out of place. DejaVu Sans is a font I like a lot; It comes pre-installed on most Linux installations, and is freely available for everybody else. Lucida Grande is a font with the sufficient characters that comes with Mac OS X, and Lucida Sans Unicode is a font that, as the name implies, is very similar to Lucida Grande. It is available in Windows 98 and up.

References

“DejaVu Sans.” Wikipedia: The Free Encyclopedia. 12 Dec 2009 <http://en.wikipedia.org/w/index.php?title=DejaVu_fonts&oldid=329693253>.
“Lucida Grande.” Wikipedia: The Free Encyclopedia. 12 Dec 2009 <http://en.wikipedia.org/w/index.php?title=Lucida_Grande&oldid=314108882>.
“Lucida Sans Unicode.” Wikipedia: The Free Encyclopedia. 12 Dec 2009 <http://en.wikipedia.org/w/index.php?title=Lucida_Sans_Unicode&oldid=324714228>.

Comments

Clawfinger – Use Your Brain

This post is recycled, and was originally published on my former weblog on Tuesday 2005-03-01 at 19:16:38. I tweaked some grammar and spelling here and there, but I resisted the urge to rewrite this entry almost entirely. I did not, however, refrain from commenting on myself. Sensitive souls beware: I added some brand new explicit content.


As you might have read, a couple of days ago I received the Deaf Dumb Blind and Use Your Brain reissues. So now I will be reviewing Use Your Brain, Clawfinger‘s second album; once again by going through my favorite tracks. [Once again, I added links to YouTube.]

* Bonus Track + Videos:
Pin Me Down, Do What I Say, Tomorrow

The second song of the album is Pay The Bill. The lyrics are sharp on the topic of what certain people think and say, but it’s the guitar (and drum stuff) which really gets the party started. [Sharp…on the topic? Say what? I suppose I meant to add a conjunction, i.e. The lyrics are sharp, and address what certain people think and say … Perhaps I should have specified “certain people” a bit more precisely, since I’m not sure which “certain people” I was referring to anymore.] It inhabits a couple of my most favorite style of powerful chords combined with powerful rap. [I didn’t use to be aware that a couple is meant more literally in English than in Dutch; I should have said a few. Inhabit doesn’t seem like the right verb to choose here, either.]

Pin Me Down, the third track, is of a different class. If you’re still unsure whether combining ‘metal’ with rap is a good idea, listen to this. I can’t say much more about it than that this is just what Clawfinger is. [Seriously, was I on crack!? Did the pot my neighbors smoked affect me? This is just what it is, man! You know, what it is!! It is, man!]

Do What I Say, the seventh track has a really interesting start. [Nice to meet you again, Mr Fanboy.] A kid starts off by singing: When I grow up, there will be a day when everybody has to do what I say. Then the metal guitars bash in [I don’t think you can bash something in. Maybe the guitars bash the poor child away? That doesn’t seem to convey the intended meaning either, though. Let’s just stick with “The guitars come in.”] and Zak starts singing like he’s the father, telling the kid to do what he says. [I bet you didn’t see that coming!] When I didn’t know Clawfinger very long, this was probably my favorite song. [I think I was obsessed with songs featuring children’s voices at the time, since Eminem’s My Dad’s Gone Crazy was also among my favorites.] The coolest part of the song is probably even when the kid starts rocking too. [It looks like I was indeed on crack. I clearly wanted to write The coolest part of the song is probably even cooler than the rest of the song, and I barely managed to save myself from complete and utter embarrassment by changing it to tell people when the song is “coolest.” Bet you didn’t count on me analyzing your words in ridiculous ways when you wrote that, sucker!] I’ve introduced Clawfinger to my friends and this one, Nothing Going On and Vienna were probably the most successful.

What Are You Afraid Of (track 9) is a great song about stupid politicians and the crap they say. [Fuck yeah! Um—I mean, I was on crack, man!] Actually the whole album is pretty much politics related and some of the stuff in this song is just so damn cool. [Sorry, I got ahead of myself there. I was on crack, man!] But anyway, I think that if you don’t like this song, there’s some chance you don’t like Clawfinger at all. [Indeed there is. Any more insights, Captain Obvious?]

The bonus tracks on this album are good, but for me they don’t match a song like Profit Preacher. [Same here—wait, what?] Three Good Riffs is probably the coolest bonus track [I need to stop using the word coolest, don’t I? Hopefully, I have since stopped using it this excessively. :P], although it’s not really good in the sense of… well, good. [Pothead!] Anyway, Zak on two of them: [Yup, right on top of them.]

Three good riffs is a simple lyric about all the cliches in this great industry of rock & roll, we’re all contributing to it whether we like it or not & the more serious we try and be as artists the closer we come to being pathetic…but hell I’ll gladly treat people to that! :mrgreen:

Armageddon down ha ha what is there to say, it’s just a pisstake on religion of all sorts and a play with words for the sake of being annoying and having a bit of fun, Armageddon down obviously means that everyone should get up on the dance floor and shake their booties, don’t really know what else to say about it? :mrgreen:

The bottom line: if you liked Deaf Dumb Blind, this is a must buy. If you came into Clawfinger by means of the newer albums, it is something you have to check out. It’s the last of the classic Clawfinger albums. [Ouch!]

Comments (2)

Clawfinger – Deaf Dumb Blind

This post is recycled, and was originally published on my former weblog on Saturday 2005-02-26 at 11:40:12 UTC. I tweaked some grammar and spelling here and there, but I resisted the urge to rewrite this entry almost entirely. I did not, however, refrain from commenting on myself. Sensitive souls beware: I added some brand new explicit content.


Yesterday, I received my reissues of “Deaf Dumb Blind” (1993) and “Use Your Brain” (1995): two classic, quintessential Clawfinger albums. In addition to the original tracks, they both feature three bonus tracks and the video clips of the released singles of the original CD in SVCD quality. Let me go through both of the albums by my favorite songs. [Use Your Brain will be reviewed in a later post: no, that’s not because I split this post in two for this special occasion or some such.] My less favorite songs are a little less good, but that doesn’t mean they’re bad. But you’ll probably have to be more of a fan to appreciate them. [I added links to YouTube so you can actually listen to the songs.]

* Bonus Track + Videos:
Nigger, The Truth, Warfair

The first track of Deaf Dumb Blind is Nigger. Nigger is a song which immediately steps out of the gray of bad songs out there because of the power it contains. [I understand what I was trying to say here, but steps out of the gray of bad songs? The gray what?] Some people might think it’s a racist song when they first hear it, but it is all but that. [I’ve all but finished this book, and it was anything but boring.] It is to be said that the chorus (repeating the word nigger a couple of times) is very easy to catch up with and some stupid racists might even like to sing along with it(!) Luckily that was all but the intention behind the song.

I would consider “Rosegrove”, the third song, sort of a ballad, although it doesn’t really sound like one, neither in lyrics nor in melody. It’s one of the more melodic sounds on the album and one of my favorite on the album. [Boy, I can sure eloquently express myself about one of my favorite songs on the album! Maybe you should have tried it in Dutch, just 19-year old self.]

Track 5 is “I need you”. It’s quite easy to play really, but it sounds just great and I did once meet a bitch this song perfectly applied to. [I did? I rather doubt that. Teenagers, eh?] So when you are in a sort of love/hate mood situation problem thing, just put this up loud. Very very loud. [I can’t comment on that (anymore?), but it is nice while working out.]

“Catch me,” the sixth track of the album, is one of the more interesting songs lyrical wise [I think you mean lyrically.] (and considering the general level of Clawfinger lyrics, that means a lot [Fanboy much?]). When I listen to one of my current favorite songs (Horse With No Name by America), I can almost imagine being in one by listening to the music. [One what? A desert? Are you talking about a freaking desert?] My personal fantasy is quite alright and I have no problem imaging deserts [No trouble imagining the vastness, at any rate. You don’t quite comprehend just how hot they are. And no, I still don’t.], but that song captures the spirit and puts you in one if you listen, disregarding your own imagination. [Are you on crack!?] The same applies to “Catch me”: it’s like Metallica’s “Fade to black” on steroids. [Whatever you say.] It just seems to come from deeper within, or maybe Zak, Clawfinger’s vocalist and lyrics writer, is just more on one line of thoughts with me, I don’t know. Zak said the following on the song:

Well Catch me is pretty much a direct translation from a Swedish punk song which I wrote an additional third verse for so the idea was already there! In other words it’s not a personal song even if there have been times when I have felt those feelings!

My other favorite song on the album is one of the bonus tracks, “Profit Preacher”. I will just quote Zak on the bonus tracks.

Profit preacher is about the American TV evangelists who preach faith, love & beauty, the more money you give them, the more blessed you will be! Obviously they are vultures profiting on peoples need for something or someone to believe in! I got the idea from Frank Zappa who has made a few songs on the same topic!

Stars & stripes, damn I hardly even remember the fucking song, I guess it was just an excuse to throw some shit at the United States for how they choose to angle their news reports and sedate their people into believing they are being told the truth! I’ll read it sometime soon and get back to you with a more detailed answer! 😉

In conclusion, despite this being their debut album and the Clawz having so much less experience than they have now, this album will still rock your house away. [Rock your house away? Whatever it will rock, it will most certainly not do that. Then again, I was probably just making up something as random as rock your socks off. Perhaps that’s a better way to finish this entry. “Deaf Dumb Blind” will not merely rock your socks off, it will rock your fucking house away!]

Comments (1)

I Love Spring

This post is recycled, and was originally published on my former weblog on Wednesday 2005-03-16 at 10:13:36. I tweaked some grammar and spelling here and there, but I resisted the urge to rewrite this entry almost entirely. I did not, however, refrain from commenting on myself. Sensitive souls beware: I added some brand new explicit content.


Oh yeah, throw open those doors and windows and let the fresh air dwirl through your house. [Oh yeah! By the way, dwirl is not a word. Twirl is, although I’m not sure if fresh air can twirl. For poetic consistency, I’m going to suggest Allow the spring breeze to enter your house and twirl your papers.] Plants growing leaves, flowers coming up; all those scents and colors, it’s just wonderful. [I wish I was two puppies, so I could play together.] The same applies to autumn, but summer? That’s boring and often too hot. [Word on the hot. Boring depends mostly on what you do with it.] It’s not bad at all, but boring in a way, that’s all. [Bravo! Excellent repetition.] But it’s about the summer nights after all… 😉 [Ew! Gross. Don’t tell me that, keep it to yourself. Dirtbag. Also, just so we’re clear on this: you’re saying that summer days are boring because they are too hot, but summer nights aren’t because they are…hot?]

This reminds me that I want a digital camera someday. [I’ve got two, sucker. One compact and one DSLR. No, you can’t play with them.] I hate (too) limited budgets like mine. [Boo–fucking–hoo. You’ve got bloody 100 Mbit Internet while I’m stuck with a theoretical 8 Mbit which amounts to 6 Mbit in practice. Keep on saving, spend your money responsibly, and perhaps you will own a nice camera or two in 4 years.]

It’s time to finally get in touch with the local library and read some fucking cool books outside! [Fuck that shit. We’re living in the future.]

Comments (4)

Virtual Recycling

Lately, I’ve been sorting out some old digital junk. Not because I’m short on space—I’ve got plenty—, but because some of it simply isn’t worth keeping. Most of the posts on my former weblog fall in this category, but about half a dozen of them I just couldn’t delete. I decided to integrate them with my current weblog.

Initially, I was thinking of just slipping them in at the temporal beginning of the weblog, so they would silently appear in the year 2005. However, while I was investigating how I could make the WordPress 1.5 database compatible with the current WordPress 2.8 database, I changed my mind.

It would be much easier to repost the entries on my current weblog, but that wouldn’t be right if I didn’t do it with a twist. While I was rereading some of the entries, I was thinking things like Were you on fucking crack!? Wouldn’t it be amusing to make fun of the things I wrote back then by actually adding these thoughts to the entries themselves? Additionally, this would justify reposting them as entirely new entries. If nothing else, at least it will be amusing to me. You can expect the first three recycled entries this week, and a few more may follow, but I’m not promising anything.

Comments (7)

My Most Popular Post

I don’t know how people managed to end up on my most popular post (visited 358 times last month), but neither walla nor voila were in the terms people apparently used to reach this site. People did use some puzzling phrases and terms, however, such as my quickfires screen is all wavy and i didn t do anything whats wrong, and swedish babes.

Another “interesting” statistic is the number of spam comments Akismet stopped since I first started using it.

Akismet has protected your site from 47,749 spam comments already, but there’s nothing in your spam queue at the moment.

Comments

WordPress Automatic Upgrade Plugin

A few minutes ago I upgraded my WordPress installation to the latest version with the help of a relatively new automatic upgrade plugin. As you can see everything worked splendidly and I can recommend it to any WordPress owner out there.

Comments (1)

« Newer EntriesOlder Entries »