The only reason you hate $programming_language is because you’re rubbish at it

December 24th, 2009 Afal No comments

A few weeks ago someone went and said that he mad up a law and then said something that seemed incredibly obvious. That “law” was  “Any work that cannot be done will not be done”. This law is as useful as the Weather Rock. What’s next? “if you sleep during the deadline of the project you won’t get it in on time”? “the sky is usually blue”? Damn I’m surprised that no one has taken the “Men have a penis and women have a vagina” law. I would but I’ve chosen something a little more subtle.

It’s very common to hear someone go “I hate $programming_language. It’s rubbish.” especially when the person saying that is a first year in computer science and $programming_language is Java. I’ve never really got to a point where I hate java. I mean it makes sense for an Object Orientated programming language. The usual excuse to why they hate it is because it’s “hard”. Just because it’s hard doesn’t mean it’s rubbish. The only reason why you hate $programming_language is because you’re shit at it.

Though if the $programming_language was easy you wouldn’t hate it right? You would be able to write some amazing code with it and you would evangelize on how amazing $programming_language is. Right?

You don’t think so? I’ll pick a random language… hmmm… how about JavaScript? It seems perfect to explain all this. Most people hate it and to be fair: it actually is a bit shit. Though at least I can admit that you can do some amazing things with JavaScript. Most people tend to just throw it away saying that it’s rubbish and shouldn’t be used ever before going on facebook to join another inane group and send everyone an invite to it.

JavaScript is shit easy. Look at this example:

?View Code JAVASCRIPT
alert("Hello Buttheads");

Look at it. How the hell is that hard? What don’t like my incredibly patronising tone? wll I have to be if you think that JavaScript is hard. Here, Have a look at this one then:

?View Code JAVASCRIPT
alert(document.forms[0].number1.value + document.forms[0].number2.value);

If you’re not sure what this does it takes the value of a form element named “number1″ and adds it to a form element called “number2″ and then gives a message box displaying that. However like you JavaScript is retarded and can’t tell if you want to sum 2 numbers or concatenate them. In which case you have to cast the value to a number if you want it to sum the two values like this:

?View Code JAVASCRIPT
function sumUp(a,b){
	return Number(a)+Number(b);
}
alert(sumUp(document.forms[0].number1.value, document.forms[0].number2.value));

What? You can have FUNCTIONS in JavaScript? YES you can. Didn’t you know that?

Saying that though a lot of people don’t like alert() cause it’s fucking annoying. However you can do this instead:

?View Code JAVASCRIPT
function addStuff(daId,stuff){
	document.getElementById(daId).innerHTML = stuff;
}

If you don’t get this, this basically adds “stuff” inside of tags set by “daId”

Well that’s essentially all that you need to know about JavaScript to do the first (and second year) JavaScript assignment. As you can see it isn’t really that hard other than JavaScript being the most retarded language to write in.

What? How is any of this useful? This is Web 2.0?

Well a basic knowledge of JavaScript is needed to understand the REALLY COOL JavaScript stuff (i.e. AJAX). Perhaps I might do another blog on AJAX in the future but for now I’ll just leave you with these examples for you to use.

PROTIP: JSLint is very useful when writing JavaScript I suggest you use that.

PROTIP: You’re still rubbish at JavaScript

PROTIP: “PROTIP” is the new “P.S.”

Categories: Uncategorized Tags:

I have a new 404

November 21st, 2009 Afal No comments

http://www.somethingafal.com/alligator/index.html

The duck one is still up however…

Categories: Uncategorized Tags:

How to spot people on facebook who want to add you as a friend to advertise about their naked webcam website

September 14th, 2009 Afal No comments

1. They’re female and they’ve apparently just turned 18

Somewhat of a long shot here. Most of these websites tend to go for the “OMG THIS GURL IS BARELY LEGAL” approach, which is understandable I suppose (the thought of danger possibly a fetish for some people?). However this is a long shot, this might actually be a female who’s allegedly turned 18 today. I mean to be polite I should at least accept her friend request and do a generic facebook happy birthday message to her.

2. They’re somewhat… local

I’m sure I’m not the first to see adverts saying “MEET THOUSANDS OF SINGLE AND HORNY GIRLS LIVING IN YOUR AREA RIGHT NOW!!!”. I live in a quite rural area and if I’ve noticed one thing, the majority of the people who live in the area are not that young (not including anyone 17 or under.. I know this is a bit of a contradiction but I’m only going to include the people these adverts target at). I doubt there are that many females of my age in this area who are single… and I don’t want to think about the horny 40+ year olds either.

If this is an advert for one of these sites (and to be honest I wouldn’t be surprised if it wasn’t) they kind of did their homework wrong… well they kind of figured out that I was somewhere in Wales,but it decided that the only part of Wales that had a school (which they probably got from http://www.goodschoolsguide.co.uk/ for some reason) was in North Wales (which is funny really cause I thought the only part of Wales that most people would have heard of is Cardiff which is in the south)

Obviously the adverts kind of find where you are geographically depending on your IP address. It’s all very simple how they did it. Well I can at least imagine how they could make the ads…

3. There’s no profile picture

I think this should be a rule of internet. If you want to friend someone that you’re not sure will recognise you, MAKE SURE YOU HAVE A PROFILE PIC. Unless there’s actually a person that actually looks like the default shadow picture that you get with facebook when you just made the profile then you need a PICTURE to make sure that someone can identify you.

I suppose the people advertising these sites got a bit clever and thought that no one was responding to the facebook profiles with sassy looking ladies in the profile pics, WHICH MADE THEM OBVIOUS, so they tried another tactic: Don’t use a profile pic at all. Well this gives a 50% chance that it won’t work and 50% chance that it definitely won’t work.

But this isn’t the reason why I’m rejecting this friend request. No. the real reason for rejecting this friend request (which is an obvious “sex chat” advert) is this:

4. They have a ridiculous name like “Bubblespinky”

Categories: Uncategorized Tags:

IN THIS BLOG: I break down how stupid facebook some facebook applications are (i.e. I do nothing new)

August 22nd, 2009 Afal No comments

According to http://www.friendshipstats.com I have 404 friends, 284 more than average.

Really? Cause according to http://www.facebook.com it says THE EXACT THING.

157 are single, 171 are dating or married.

This application would be useful if it got the ones who were single and female and around my age and set it up so I can stal… I mean chat to them easier, though this hasn’t been made cause Facebook has “rules” about “that sort of thing”. Wait a sec, there’s 76 that are not mentioned. I suppose ther are in the “It’s complicated” area or haven’t bothered to fill in their profile cause all they want to do is play that mafia game.

If I contracted a deadly variant of flu, I would likely infect 12 people, 2 of whom would die.

Wrong. If I manage to infect 12 people with a DEADLY virus, surely 12 would die? Also isn’t flu already deadly?

When I share something on Facebook, it is typically viewed by 26 people.

What? Why the fuck would anyone want that statistic? Does anyone really care? Oh god why did I even bother to look at this applictaion?

If I died today, an estimated 502 people would try to attend my funeral.

Yes. I am really that popular.

Based on my Facebook profile, I have a 92% probability of getting married.

I’m filing this under “Facebook quizzes that do slightly exaggerated claims”. Sure this is a little ego booster but I doubt that this is actually true in practice (If you disagree and think I am marriage material then please don’t hesitate to comment). Facebook also thinks I can drink 48 beers before I pass out and that Aquarius is a sexy star sign (like all the other star signs).

I am likely to earn US$3.6 million and have 2.4 children over my lifetime.

See above. I do hope I do make a lot of money but 3.6 million? Fuck. Is that why I have a 92% chance of someone marrying me? 2.4 children is the average however…

Calculate your own stats at http://www.friendshipstats.com.

Please don’t. You’re more likely to get proper results from someone who claims that they can see the future rather than this shit

76

Categories: Uncategorized Tags:

My life according to Baha Men

July 28th, 2009 Afal No comments

Describe yourself:
Who let the dogs out?

How do you feel:
Who let the dogs out?

Describe where you currently live:
Who let the dogs out?

If you could go anywhere, where would you go:
Who let the dogs out?

Are you a male or female:
Who let the dogs out?

Your favorite form of transportation:
Who let the dogs out?

Your best friend is a:
Who let the dogs out?

You and your best friends are:
Who let the dogs out?

What’s the weather like:
Who let the dogs out?

Favorite time of day:
Who let the dogs out?

If your life was a TV show, what would it be called:
Who let the dogs out?

What is life to you:
Who let the dogs out?

Your fear:
Who let the dogs out?

What is the best advice you have to give:
Who let the dogs out?

Thought for the Day:
Who let the dogs out?

How I would like to die:
Who let the dogs out?

My soul’s present condition:
Who let the dogs out?

My motto:
Who let the dogs out?

THE BAHA MEN ONLY HAD ONE SONG

Categories: Uncategorized Tags:

Nintendo have no idea what people want

July 20th, 2009 Afal No comments

Unless you’ve been under a pretty huge rock for the past 2 years, you may have noticed that the iPhone (or it’s non phone version the “iPod Touch”) is pretty popular. Indeed with its recent update you can now COPY AND PASTE. We are truly in the future with the iPhones ADVANCED TECHNOLOGY.

Why can’t the DSi do that?

It’s been nearly 4 months since the Nintendo DSi has been out and absolutely nothing has changed. With the new app store I was expecting something similar to the iPhone/iPod Touch one (i.e. people can make apps for it which can be sold in the app store).

I mean it makes sense. Nintendo gives out a SDK/API. People make apps for the DSi and can sell them on the appstore with some profits going to Nintendo. It’s quite obvious from the homebrew community that there are a bunch of people willing to make apps for the DSi. However that’s a little difficult for them seeing as all the old flash carts has been blocked on the DSi. If Nintendo don’t want the pirates then they should be able to make these Homebrew games/apps available for everyone.

I mean if the iPhone did it then why shouldn’t the DSi?

Look what Nintendo has given us so far in the app store. Mario Calculator. GOLLY GOSH GEE NINTENDO YOU ARE SPOILING US. You know how much that would cost on an iPhone? Probably nothing… actually it might be already on the iPhone I don’t know.

Don’t like Mario? Don’t worry, there’s an app that’s basically the same thing but it has ANIMAL CROSSING all over it. WOW WE HAVE SO MUCH CHOICE.

Oh god there’s a clock too? AWESOME considering that it already has an INBUILT CLOCK I am totally going to buy a clock just cause it has MARIO all over it.

Sadly the freebies (or freebie, since there’s only one) you get with it isn’t that great either. The web browser does seem like a good idea at the time but it does have it’s problems. Those of you who have a wii and have tried the internet on the wii would know that the browser is Opera. Now I haven’t used Opera since before firefox was out and I can tell you this: I don’t remember Opera being this rubbish.

Not surprisingly the browser crashes when you try and load big pages and it doesn’t have flash (which is weird cause in the wii opera browser you’re able to view youtube videos). This is pretty rubbish. Two of the most used websites that young people seem to use these days are Facebook and Youtube and the DSi Browser is already handicapped since Facebook is nothing but javascript (which breaks the DSi) and Youtube needs flash (which the DSi Hasn’t got). The iPhone got round these by making apps for the two (which are free iirc). Yes you can go on the mobile phone view of facebook but it doesn’t have the same feel. Besides WAP died a long time ago (and if it isn’t, it should be).

It’s clear that Nintendo have no idea what people want, or why people roll their eyes when they release another generic game with MARIO slapped all over it. I can’t wait till the Cyclods Evolution comes for the DSi. Then I can pirate games probably play some of the homebrew stuff.

Categories: WhyBeeOh Tags:

Goodstory: Autopilot

June 29th, 2009 Afal No comments

11:34 <+Afal> I went to autopilot
11:35 <+Afal> and since I was on vista the most useful thing I could do with it
was switch it off
11:35 <+Afal> I got strange looks from some of the staff
11:36 <+Afal> it’s a goodstory

Categories: IRC log, Something Afal Tags:

Instructions on how to Un-Oleg your Facebook

June 27th, 2009 Afal No comments

A few people I know have been somewhat puzzled by the “Friend Suggestion” thing on facebook.

Now I’m not sure how it works but I suppose there’s some algorithm deep within the 99.99% javascript built site that finds people who are already friends with a few of your friends. What most people have been puzzled with is that how someone with No friends whatsoever can be a suggestion.

There could be a thing which figures out which networks someone is on (though I doubt it since he is in no network I am on) or if that person mentions things that you may have an interest in on their profile, however I don’t really care.

Seeing the full list of “Friend Suggestions” I see that I know… hardly anyone on the list given so the feature seems to be useless imo.

However some people are complaining that they have to see this certain person when they are on facebook so I tried making a Greasemonkey script for getting rid of the useless “Friend Suggestions” section. I know that this is pretty redundant when you can click an x by someone I don’t want to add (and therefore not seeing them ever again) but I find this method a bit easier on the clicking button since I don’t have to click x on everyone I don’t know.

The first step would be of course be “Get firefox and greasemonkey” but that’s only if you want to get rid of the “Friend Suggestion” thing. Now the second step would be of course to make a new script. As I write this I notice there are scripts that does this anyway however mine is better cause it’s all on 1 line and 1 line code is better than 30 lines. You can use them if you like by going to http://www.userscripts.org/.

My code for this can be seen below (feel free to copy/add/modify it):

// ==UserScript==
// @name           Hide Friend Suggestions
// @namespace      http://www.somethingafal.com/
// @description    Hides the friend suggestions cause I’m sick of looking at Oleg
// @include        http://www.facebook.com/*
// ==/UserScript==
(function() { document.getElementById(”pymk_hp_box”).style.display = “none”; })();

If you refresh facebook now the “Friend Suggestions” section will be nowhere to be seen which is a good thing imo

NEXT WEEK: I write a Greasemonkey script to get the Quiz Application notifications out of the front page and another one to kill anyone who still invites me to that fucking Mafia game.

Categories: Something Afal Tags:

Someone buy me this t-shirt now

June 20th, 2009 Afal No comments

I’ve only been home about 2 weeks and I’ve had enough of such questions as:

The computer is slow after 5pm. Is that because people use the Internet a lot at that time?

Can I get my Bookmarks from your computer?

And the current best one:

How do I print pictures?

SEND HELP PLEASE

Categories: Something Afal Tags:

GET RIADUR

May 24th, 2009 Afal No comments

A few blog posts ago I was raving about my Dictionary thing. Well I did a better one called Riadur a while after that and posted it on Sourceforge. Since then I haven’t looked at it but it shocks me how much it’s spreading.

Recently I’ve had an email that it’s been tested on a mac and that it doesn’t have any viruses/spyware/malware on it at all

Good to know

P.S. it seems to call it Riadur 10908 which is the date I released Riadur (10th of September 2008). I should actually update it… things changing and all.