Monday, September 12, 2011

What else would you do?

If you !believe in god, what else would you be doing which you're not doing right now?

Sunday, May 15, 2011

Spell Checkers are the best spelling teachers.

It's like that redheaded teacher who's always behind you and won't stop nagging till you fix the error or tell her to ignore it once, or forever.


Has been learning spelling from her for years nwo.

Image from here.

Parallels have inconsistent systems.

So we're basically parallel to everyone whom we will never meet?

Thursday, May 12, 2011

How to kill a child.

This note demonstrates how to spawn and kill a child. For the sake of simplicity, I chose C instead of real life for the example.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
 
int main()
{
    pid_t pid = fork();
    if (pid == 0) {
        printf("Killing the child using with next line.");
        _exit(0);
    } else if (pid > 0) {
        printf("While we're at it, might as well kill the parent as well");
        exit(0);
    }
}

Monday, May 9, 2011

A lame joke.

Superstitious admins work on localghost.

Friday, April 29, 2011

Crying babies behind you.

Isn't that a good enough argument for contraceptives?

Harmonic mean

*Disclaimer*

Mathematics

This post is going to be about another form of average, called the harmonic mean and this is found using the following formula:


It may look a bit complex at first, but really, it's not.

Say we want to find the arithmetic mean of the the following numbers 5, 2, 4, 10. Let's start by taking care of the denominator of the formula first:


As you now know, that's a summation over the reciprocals of our numbers:


We're not ready yet though because that's only half of the formula. So, now we ended up with this complex fraction:


Now we simplify that complex fraction by multiplying the numerator by the reciprocal of the denominator:


Therefore we can say that 'the harmonic mean is the reciprocal of the arithmetic mean of the reciprocals' [Wikipedia].

Programming

Now let's write our harmonic mean function in JavaScript:

var harmonic = function (numbers) {
  var length = numbers.length, denominator = 0, i = 0;
  
  for (; i < length; ++i) {
    denominator += 1 / +numbers[i]; 
  }
  
  return length / denominator;
};

harmonic([5,2,4,10]); // 3.8095238095238093

Arithmetic mean

*Disclaimer*

Mathematics

Since now you're already familiar with the summation notation, I'm going to start this post with this:


The arithmetic mean is most commonly referred to as just the average, although it's just one of several ways of calculating an average...and it's probably the one you're most familiar with.

Let's say we have these five numbers 14758 and we want to find their arithmetic mean:


Therefore if we use x for our arithmetic mean, we can represent that as:


Programming

Writing a function for calculating the arithmetic mean in JavaScript shouldn't be too difficult:

var average = function (numbers) {
  var sum = 0, i = 0, j = numbers.length;
  
  for (; i < j; ++i) {
    sum += +numbers[i];
  }
  
  return sum / j;
};

average([1,4,7,5,8]); // 5

Highlighting my code with some rays of Sunlight.

This is the best syntax highlighting system I've found for the web, and I've tried a couple; and it's also context-aware.

It's what I am currently using for this blog. Tommy Montgomery, I salute you.

Here's an example:

/**
 * jQuery plugin for Sunlight http://sunlightjs.com/
 *
 * (c) 2011 Tommy Montgomery http://tommymontgomery.com/
 * licensed under WTFPL http://sam.zoy.org/wtfpl/
 */
(function($, window, undefined){
 
 $.fn.sunlight = function(options) {
  var highlighter = new window.Sunlight.Highlighter(options);
  this.each(function() {
   highlighter.highlightNode(this);
  });
  
  return this;
 };
 
}(jQuery, window));

Huh, it's highlighting itself.

The Σ notation.

*Disclaimer*

Mathematics


In this one, I will talk a bit about the Capital Sigma notation:


You will probably see it being used as follows:


This is actually part of the ~third diagram you will see on its Wikipedia page.

What does it all mean? Here, n represents the upper bound of the summation, m is the lower bound of the summation and i is the index of the summation.

Let's now look at the complete Wikipedia diagram via some inline linking:

As you may have now guessed, the Σ is used to represent a summation (i.e. using addition) over a list of numbers (and other addable entities). The xi represents how the sequence should be formed, replacing the i with the current value of i in the present iteration.

Now it should be more clear as to what the upper/lower bounds mean. The upper bound n refers to when the sum should 'end' and m is used to represent where to 'start' the sum.

My terminology in the previous paragraph may be slightly incorrect, especially the part about start/end, so be weary.

If you've managed to get that, here's a more concrete example:


And another one:


You could have probably calculated the above in your head, but what if I gave you the following:


Can you find the sum of the numbers in the range 1 ≤ i ≤ 50 mentally? Fortunately, you don't have to because there is a formula you can use for that particular sequence of numbers:


So going back to the previous problem with the 50, we can now plug in the upper bound into the formula:


Therefore:


Let's get a bit more concrete. Say you have some coins running around and you form a triangle with them:


Without individually counting them, can you tell me the total number of coins that are currently forming the triangle? Or better yet, what if you added the fifth row...how many coins would there be then?

Simple, just use the formula. Let's find out how many coins would there be if we added the fifth row.

First we'll start by representing our problem in math notation which in this case is easy because the pattern is very trivial:


And now, the formula:


So if we add a fifth row, we would get a total of 15 coins:




How about this one?


Well thankfully, mathematicians also have a formula for that (and many others):


So, applying that to our latest problem, we get:


Therefore:


Programming


Now, some programming shall we? I will use JavaScript because I like it (talk about one hammer...well it's not the only one) although I have to admit that a solution written in a purely functional programming language like Haskell would have been much more elegant.

Now let's start applying this function to work out some summations, starting with the first one I talked about:


We can write something like this to workout the problems given with that pattern:

var simpleSum = function(upper) {
  return (upper * (upper + 1)) / 2;
};

What about the next one?


Something like this could work:

var squaredSum = function(upper) {
  var numerator = upper * (upper + 1) * (2 * upper + 1), 
      denominator = 6;
  
  return numerator / denominator;
};

But do we have to keep creating a new function for every pattern we need? Surely not!

We can write a function that does something like this:


If you're worried about the stack, you can use a for loop:

var sum = function (pattern, lower, upper) {
  var s = 0;
  
  for (; lower <= upper; ++lower) {
    s += pattern(lower, upper);
  }
  
  return s;
};

But you can also use recursion to create a more elegant solution:

var sum = function(pattern, lower, upper) {
  if (lower > upper)
    return 0;
  return pattern(lower, upper) + sum(lower + 1, upper, pattern);
};

As you can see, I kept it as concise as possible; I even didn't bother to add curly brackets for the if-construct. If you're hardcore on making slightly-less readable code, you can even remove that if-construct and check for the condition using the ternary operator.

I also added the possibility to start from a specified number given by the lower variable. The generic function comes with a price though, as everything does. The problem now is that we've transformed an algorithm of O(1) to one with O(n).

I will not go much into algorithm complexity in this post but basically with our previous 'simpler' functions, the execution time of the function depended mainly on how complex our formula was since all it's operation run in constant time, whereas with the new generic function, we will take a big performance hit because execution time depends mainly on the range of numbers we specify i.e. the bigger the range, the more time the function will take to return a result.

Another way to say this would be that the execution time scales proportionally to the number of elements in the specified range m...n.

Let us now apply the last function to create the previous two patterns:

var m = 1, n = 5;

sum(function (i) { 
    return i; 
}, m, n);

sum(function (i) {
    return i * i
}, m, n);

Now we can also write something like this:


sum(function(i) {
  return Math.pow(i, 5);
}, m, n);

If we wanted to write it using the O(1) algorithm, we would have had to turn the formula into JavaScript instead of using the i5. But, we can even up the ante a bit and make all of this even cooler and that's where partial function application will come in to do the job. This is the partial function we will use:

var partial = function(func) {
  var args = Array.prototype.slice.call(arguments).splice(1);
  return function() {
    var allArguments = args.concat(Array.prototype.slice.call(arguments));
    return func.apply(this, allArguments);
  };
};

I have already talked about partial function application for JavaScript in the other one so I won't go into any details here, but I will show you how we can use it to produce functions that have a smaller arity (number of arguments):

var simpleSum = partial(sum, function (i) { return i; }),
    squaredSum = partial(sum, function (i) { return i*i;});

In our current case, we reduced the arity of sum to produce functions that only require the lower and upper bounds since the pattern function will already be stored in the closure produced by the partial function. Usage is then simple:

simpleSum(1,5);  // 15
squaredSum(1,5); // 55

Thursday, April 28, 2011

History according to the Bible.

What other history books do people buy with the Bible?


Amazon.

Wednesday, April 27, 2011

Gervais, Merchant and especially Pilkington.

Bloody hilarious, split into 3 parts.





Do you panic when you see some math?

I do, or at least I used to; I still do, but I'm currently working on fixing that problem. My issue was mainly opening a Wikipedia page on some arbitrary algorithm, seeing some math and closing the page. That's failure for you. So now I'm trying to fix my issues with this.

If you're mathematically inclined, I suggest you avoid reading these posts because they will probably insult your intelligence.

I basically plan to write a little bit about some stuff which I'm currently learning about on my own. That's also a warning for you: I'm learning this stuff as I go (and by myself).

This means that there could be mistakes in what I write, and there probably will be...so tread lightly on it. And if you actually read this stuff, and find mistakes, I truly appreciate if you contact me via comments or whatever about them because I'm still learning about these concepts.

The main reason I will be writing these posts (and having this blog in the first place) is for my own amusement, so I can laugh back in the future. Seriously though, writing about what I'm learning helps me more in understanding because of the research and thinking I do while working on the actual writing. Sort of like my semi-personal notes.

So yea, I think my first post will be about the sigma notation.

Also, I tend to use both math and programming terms for most of the stuff, including (usually incorrectly) mixing both math and programming notations together; yea, that's one thing I'm working on learning more about because usually I know how to explain something using programming terminology, but not using math notation. So for the mathematically abled, I apologize; once again, I appreciate the corrections you can make.

Oh and another thing which I should have mentioned in an earlier post. To render the math in this blog, I'm using CodeCogs' online equation editor.

Scooby Doo

Isn't it illegal (and bloody dangerous) to take the law into your own hands and play vigilante instead of letting the cops do their job?

Tuesday, April 26, 2011

The pope.

When I see the white smoke, I weep.

Razing a raise.

Have you ever noticed how raze is pronounced almost exactly like raise?

The irony here is that the former means to level (tear down to the ground) and the latter is all about elevation.

Monday, April 25, 2011

Everyone.

Would this be a paradox?

Every person who makes a sweeping generalization is wrong.

Surviving in an office.

Forget all that shit you learned in schools about QA and Quality Systems. If you're planning to work in a corporation, you only to learn one thing.

Learn to talk and type in C0rp0ratE Speak.

Drugs also help.

Madness!

Beauty in the form of madness.

You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool that is insufficiently sophisticated to understand the constructs employed by HTML. HTML is not a regular language and hence cannot be parsed by regular expressions. Regex queries are not equipped to break down HTML into its meaningful parts. so many times but it is not getting to me. Even enhanced irregular regular expressions as used by Perl are not up to the task of parsing HTML. You will never make me crack. HTML is a language of sufficient complexity that it cannot be parsed by regular expressions. Even Jon Skeet cannot parse HTML using regular expressions. Every time you attempt to parse HTML with regular expressions, the unholy child weeps the blood of virgins, and Russian hackers pwn your webapp. Parsing HTML with regex summons tainted souls into the realm of the living. HTML and regex go together like love, marriage, and ritual infanticide. The <center> cannot hold it is too late. The force of regex and HTML together in the same conceptual space will destroy your mind like so much watery putty. If you parse HTML with regex you are giving in to Them and their blasphemous ways which doom us all to inhuman toil for the One whose Name cannot be expressed in the Basic Multilingual Plane, he comes. HTML-plus-regexp will liquify the n​erves of the sentient whilst you observe, your psyche withering in the onslaught of horror. Rege̿̔̉x-based HTML parsers are the cancer that is killing StackOverflow it is too late it is too late we cannot be saved the trangession of a chi͡ld ensures regex will consume all living tissue (except for HTML which it cannot, as previously prophesied) dear lord help us how can anyone survive this scourge using regex to parse HTML has doomed humanity to an eternity of dread torture and security holes using regex as a tool to process HTML establishes a breach between this world and the dread realm of c͒ͪo͛ͫrrupt entities (like SGML entities, but more corrupt) a mere glimpse of the world of reg​ex parsers for HTML will ins​tantly transport a programmer's consciousness into a world of ceaseless screaming, he comes, the pestilent slithy regex-infection wil​l devour your HT​ML parser, application and existence for all time like Visual Basic only worse he comes he comes do not fi​ght he com̡e̶s, ̕h̵i​s un̨ho͞ly radiańcé destro҉ying all enli̍̈́̂̈́ghtenment, HTML tags lea͠ki̧n͘g fr̶ǫm ̡yo​͟ur eye͢s̸ ̛l̕ik͏e liq​uid pain, the song of re̸gular exp​ression parsing will exti​nguish the voices of mor​tal man from the sp​here I can see it can you see ̲͚̖͔̙î̩́t̲͎̩̱͔́̋̀ it is beautiful t​he final snuffing of the lie​s of Man ALL IS LOŚ͖̩͇̗̪̏̈́T ALL I​S LOST the pon̷y he comes he c̶̮omes he comes the ich​or permeates all MY FACE MY FACE ᵒh god no NO NOO̼O​O NΘ stop the an​*̶͑̾̾​̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨe̠̅s ͎a̧͈͖r̽̾̈́͒͑e n​ot rè̑ͧ̌aͨl̘̝̙̃ͤ͂̾̆ ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚​N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ




Have you tried using an XML parser instead?

Been there, done that.

If you want to write a genetic algorithm, don't try it with JavaScript because it will crash every browser you own.

Why, you might ask? Same reason I asked this question.

Semi-retarded quote of the day: "Ignorance is bliss"

Not if you're in a (life || death) situation it's not.

I hope you're patient.

IPv6 will run out before divorce, abortion and marijuana are legalized in Malta.

Regretting the past is easy...

...but appreciating the present is not.

Sunday, April 24, 2011

Quantum what!?

CineMassacre: Top 10 Star Trek Technobabbles
Tags: CineMassacre: Top 10 Star Trek Technobabbles

Trying to beat procrastination? Use rationale and simple math.

Trying to beat procrastination? Don't read this article then. Seriously, stop reading. If you're really hardcore on Not procrastinating, just stop here and close this page.

If you're just here to kill some minutes, keep on reading...

You know what helps me (attempt to) beat procrastination? Using simple mathematics to justify my (probably incorrect) conclusions and this will be a post about combining patterns to project something meaningful and hopefully, useful.

Here I will assume that you are procrastinating from a project, whatever that may be; but I will refer to the activity you're procrastinating from as the project.

So, since you're already procrastinating (by reading this), let's waste a couple of more minutes, shall we?



Say you have two patterns that you can apply on a sequence of numbers (on a number line) and the goal is to advance, i.e. increasing the value of x-axis (meaning you doing more stuff) to reach a (hopefully) predefined goal, x = 9.  Notice how a project's completeness convergence representation is a variable, not a constant...because we all know that projects never have a fixed dead-line.


Here, let i be the current state (current number on the line) and the following two equations the patterns applied to the sequences for trying to advance to the goal (you finishing the project), by advancing the value of the x-axis (and the only axis there is since we're working in a single dimension).  Also, our step will be a day; so it takes a day to reapply the pattern to move to the next number on the line.

Now say the patterns are these: i = i + 0 and i = i + 1.  In these patterns, i + 0 represents you !working i.e. procrastinating.  On the other hand, i + 1 represents you advancing (i.e. adding value) in your project.

Seq. k: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Seq. l: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Now let's apply both patterns to our sequences, starting with i = 0 (you haven't started on the project yet):
Step 1:

l =>
i = i
i = 0 

k =>
i = i + 1
i = 1

So i of l is still 0 but i of k is now 1. (yay, progress)

Step 2:

l=>
i = i
i = 0

k=>
i = i + 1
i = 2

Now i of k is 2, so there's even more progress.  We're finally moving forward (...to the right, to be exact).  Not surprisingly, i of l is still a whopping 0.
etc... stopping when i = x.

For the mathematically inclined, here's how I applied the patterns on the sequences:



Are you seeing the pattern and where I'm going with this?

Applying the summations, we get k = x and l = 0:
k = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
k = 9 ∴ k = x.

l = 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0
l = 0.

I did not choose the 1 constant by random. For this example, the 1 constant referred to the work-load you dedicate on a project at a point in time. Also, it's a constant not a variable so I'm assuming that if you do x amount of work today, you will do x amount of work tomorrow. Reason is because you need to get into the routine to get things moving.

Back to the pattern. Let's say that you complete the project when x reaches 9, so x = 9. If your point of convergence for the project is at infinity, you probably need to rewrite your specs so I'm assuming it's not.

As you have noticed, when you do nothing each day, your project will be ready after an infinite number of steps whereas if you add 1 to get the next number in the sequence, the range is much, much, much smaller than the infinity range.

So, if you add 1 every day, at the end of day 1, if x represents our goal and t the number of work activities remaining, t will be t = x - i, and you know that in this case, i is incrementing at each step meaning that t will decrease in each step until it converges with x, t = x and that's when you should open the champagne and celebrate because your project is 'complete'.

Keep in mind that if you choose the l sequence, there will never be any champagne for you. Infinity > x - i (to put it mildly).

My advice is to find an appropriate work-load constant for the task at hand so that you don't do too little (and not get in routine) or too much (get bored from the project again). I used 1 as the constant because I'm assuming you're lazy so you want to do the minimal number of work each day.

I hope this wasn't all meaningless dribble for you...and don't forget, I might be wrong.

Am I Captain Obvious? Sure, I didn't dispute that. Did you just waste 5 mins of your precious time? hopefully not =)

And now I end on an ironic note: I wrote this post because I'm procrastinating from other stuff.


Now, my math notation may not be perfect and it probably isn't even acceptable, but I hope you got the point. Now, close your browser and start working bitch.

Oh and yea, if you notice any mistakes in my logic and math, please inform me (learning is the key).

What, no HTML? Oh come on.

Facebook's Note-writing system does not allow inputting of HTML.

Nice, very mature of you Facebook.

Why you suffer from procrastination.

Your mind's data-structure for handling tasks should act like a Priority Queue, not a Stack.

I'm not sensitive to cAsIng.

Do we really need case-sensitiveness anymore?

Does the word 'free' have a comparative?

Ok, let me amuse myself: 'freeer'.

And it almost looks like something you would shout after your Manager informs you that you will stop working on that VB.NET project you've had for the past 23 years. "I'm freeeeeeeeeee!" (only > superlative)

Required Reading

the little things.

It's amazingly stupid how I even procrastinate with the little things. I always fill and turn on the kettle before washing the ancient (20mins old) coffee from the mug because it's easier.

How many users have JavaScript disabled?

Let's ask Yahoo.

Now I don't mean to undermine your potential when it comes to building your site, but keep in mind that those numbers apply to Yahoo!, NOT to you.

Again, your site probably will be successful and all that, but probably, just probably, not as much as Yahoo!'s.

What line?

The line society draws for us, usually referred to as reality.

The Bible

See tag/label.

And on a related note. Yes, I'm linking to a post I will be writing in the future; deal with it.

Here's how it should have gone in space.

Dave: Hello, HAL. Do you read me, HAL?
HAL: Affirmative, Dave. I read you.
Dave: Fuck you, HAL. *unplug*

Do you need to ask something to your computer?

Well, computer says no.

Recursively Infinite Thought

^^ huh, that's a thought.

Annoyed by your conversation buddy?

Slam this in his face:



Cheers Sandro.

A wet dream come true!

Webber on cello with Colosseum II.

Legalize "Thinking"!

Oh, it's legal already? Shit, then we must inform the people because they probably think it's against the law and most of them are very law-abiding.

Amalgamating Douglas Adams' writings and JavaScript

I know JavaScript.

My alphabet

So yes, on a misty Friday night, I deciding that the last thing I need to do before I lose consciousness in bed would be to write my own simple replacement alphabet. And of course, here's the mapping:


And this is some Lorem Ipsum example 'text':

Saturday, April 23, 2011

meta thinking

Uh no, not 'when to think'. You should always think, this is not what this is about.

Meta think everything you do...including meta thinking. Yup, you know where that is going don't you? Recursively Infinite Thought.

Do you ever go home after work and think about all the shit you said throughout the day?

I do, and I always find something.

‎- - p - - - q - - - - -

Can you give meaning to that meaningless statement?

What if p was a plus and q was an equals?

A comment on Youtube.

Comment on a Bach piece on YouTube:

"I hope this is the first thing the aliens hear when they land. Maybe they'll spare us."

Wowbagger The Infinitely Prolonged...

...is on his way to insult you.

What doctor?

A little mathematics a day keeps my ignorance away.

The meek shall inherit the Earth!

There, keep it.


From: SMBC

You can do anything!!!!

Well, almost...

Good intentions are not enough

Today I learnt why good intentions alone are not enough...and that acting carelessly upon those supposedly good intentions can cause more harm than good.

Just keep in mind that NOT everything you do 'helps others'; in fact, careless donations are not only useless, but they may even be dangerous.

I got the title of this post from this brilliant site: http://goodintents.org/

Some of their articles are definitely worth a look:

A perfect portrayal of bureaucracy.

I've suddenly had a revelation!

For the first time in my life, while solving exponential equations, I've realized a couple of things:
(1) I'm getting the correct answers
(2) I'm understanding what I'm doing and
(3) I'm having fun because I'm seeing these exercises as puzzles that need solving xD THAT, never happened...ever.

Tommy, can you hear me?

I don't like figolli

But this is nice:


Credit where credit's due: http://www.flickr.com/photos/joedrew/3442157769/

Cleese with cheese



Just so you know, I did this post just for the title...and Monty Python.

and for this line: WILL YOU SHUT THAT BLOODY DANCING UP!?!?


Huh, now that I think about it, I'm not sure why no one has come up this title before.

What if the author wasn't talking about dogs?

Just read the article and, for a second, just imagine that he's not talking about dogs...but Maltese people.

Everything you need to know to live happily with your Maltese

Have you got anything without spam?

Have you got anything without spam?

Have you got anything without spam?

Aha, see what I did there?

And in reverse as well!



=> hahaha.

Yea, fuck today's political correctness.

It's Christmas in Heaven!

All the children sing!

The patterns are starting to fascinate me!

I'm finally understanding why people say Mathematics is so beautiful.

I like Facebook.

There, I said it; bite me. This 'Facebook is corrupting the children and everyone else' media frenzy is I think bullshit to scare the people from perils which aren't there.

Without Facebook, I wouldn't be able to talk to certain people because face-to-face conversation is obviously not always possible and I like the fact that I can have intelligent discussions and arguments about whatever, even if everything happens remotely.

Retarded quote of the day

"A woman is more dangerous than a loaded pistol."

Unless she's loaded with a panzerfaust or something dangerous like that...

Conversation legend.

No, it's not a game title.

It's to be used ONLY when there is a form of dialog in my posts.

So, here it is:


Me : >
Other people: Other symbols.
such as =>, |>, [>, ]>, ^> etc... ('etc...' is not one of them, ok?)

Examples of posts with dialog:

Software Composer

I like that title.

...although it makes as much sense as "Software Farmer" or "Software Accountant", but whatever.

-[Conversation Legend]-

=> If you work in maintenance, you're a Software Doctor.
]> code doctor sounds cooler :P
> Well, if I ever attain a PhD, I might try to use that title...but only then.
[> i like software architect :)
> Software Architect sounds a bit pompous for me :p I'm gonna stick with 'Programmer'.
^> and if you break codes you're Software Thief :P
&> There is always Software plumber
]> memory leaks :D
@> http://www.timesofmalta.com/articles/view/20110420/local/try-your-hand-at-farming.361507

for granted (or for someone else)

It's very interesting to see how much stuff we take for granted nowadays. Things such as the Cartesian coordinate system and negative numbers...

If a sperm is wasted...

...god gets quite irate.

The best ballad your ears will ever hear.

This is beautifully amazing. Bill Bailey of course.

Thank you Douglas Hofstadter.

Thank you Douglas Hofstadter for teaching me how to appreciate, follow and understand fugues and canons.

Mathematics, Music and Art form the one, true trinity.

-[Conversation Legend]-

=> But wouldn't Music be a subset of Art?

> Well, some argue that Math can also be a subset of Art...hence, the the trinity which are one (yea, ripped that from bible).

=> I'd say they're all possible encodings of the same object.
You could represent a computer program ("Math") as an artistic drawing (there's an esotheric programming language which does just that), and you can represent all forms of arts as a large number composed of 1s and 0s...

> Hence the trinity analogy, as the three in one.

=> But this raises the question "Why is this special?"

> Because not everyone can appreciate it...and I'm just starting to. It's all about the patterns I'm finding.

=> What I mean is - Accepting your axiom, what other conclusions, actions or whatever does this fact enable me to perform?

> To change your perception; 'improve' it maybe. To see things in a different form, and to try and see or find the patterns for yourself (if you're into this sort of thing i.e.).

For me, what's striking me as beautiful are the similar patterns that there are in music, art and math. (and of course much of the stuff that comes from math in CS...such as, recursion (which occurs in music and art as well)).

|> What about chess and poker? :)

=> Chess can be represented by a very large tree of all possible moves. Playing a game is simply a traversal of such a tree until it reaches an end state (the leaves).

Poker is pretty much an exercise in probability. All Maths 'ere.

[> We could go on like this forever, everything is Math. :)

]> au contraire, Math is a logically rigorous way of expressing reality

^> Hofstadter's "Goedel, Escher and Bach: An Eternal Golden Braid" should be required reading for everyone.

Open Source Hardware

Are you Experienced?

You know a game is good if...

...it has the word 'Dungeon' in its title (although I think by now, all the titles have been taken; or maybe not).

DUNGEON KEEPER, Dungeon Defender, Dungeon Siege, Dungeon Masters, Dungeons and Dragons, etc...

‎9x = 10(x - 1) + (10 - x)

Isn't that simply beautiful?

Though probably an easier one for mental math would be a more simplified version of it: 9x = 10x - x

Bored?

You shouldn't be but if you truly are, why don't you evolve strings for a couple of hours?

Mental Math: Multiplying by numbers that end in 9

The following equation mathematically explains the title:

yx = x(y+1) - x, where y (modulo 10) ≡ 9

The last part is basically saying that we will use this for numbers that end in 9. Why 9?

Here's an example that should make it apparent why it works best with digits that end in 9:

19 ⋅ 5, so we're multiplying by 19...a number that ends in 9.

Applying the above formula, yx = x(y+1)-x, we substitute as follows:

y = 19 (since 19 (modulo 10) ≡ 9 is true)
x = 5
 
19⋅5 = 5(19+1) - 5
19⋅5 = 5(20) - 5

Now here is why this works best with numbers that end in 9. 19 + 1 = 20, and multiplying by 20 in your head or any other multiple of 10 is much easier than multiplying by 19 in your head.

19⋅5 = 100 - 5
19⋅5 = 95

So after multiplying by y+1, you then need to subtract the extra element (the +1) you added in the previous calculation, which in the above example, is 5 (basically you need to add -x * 1 to the first product)

Here's another example:

29⋅7 = 7(29+1) - 7
29⋅7 = 7(30) - 7
29⋅7 = 210 - 7
29⋅7 = 203

Happy Earth Day!

Let's save the fuckin' planet!

Hey, if they can make shit up, so can I.

It is said that steaks and sweets taste much better on occasions such as Good Friday but many can't handle the extra goodness and so the church invented fasting to save lives.

You just have to give credit to religion for this

...or at least the lack of belief in it.

Let me set the joke-stage for you

Earth Day is celebrated on Good Friday, the day Jesus was allegedly executed.

I celebrated Earth Day by posting some gospel from the word of Carlin.

The Killers - I've got Ham but I'm not a Hamster.

Mr. Genetic Algorithm, please give me strings with 5 characters.

Mr. Genetic Algorithm: But how do I do that?

Me: I'll explain:

Given a string s, produce a fitness function need to determine fitness for a string with an n number of characters.

1 / |n - len(s)|

Or another way of writing it:

1 / abs(n - len(s))

Examples:

1) s = "abcd", n = 5

fitness(s) = 1 / |5 - 4|
           = 1 / 1
           = 1

2) s = "ab", n = 5

fitness(s) = 1 / |5 - 2|
           = 1 / 3

3) s = "abcdefghij", n = 5

fitness(s) = 1 / |5 - 10|
           = 1 / |-5|
           = 1 / 5

Now out of these 3 solutions, which is the fittest?

Number (1) is the fittest because it has the highest fitness score (1 > 1/3 > 1/5).

Brilliantly done

Did you ever catch a "kaptu" ?

Cause I always hear people saying they lost it, "tlift il-kaptu!"

Abraham Maslow

It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail.

So, don't forget to quote Maslow the next you're in a meeting and your company decides that you should use Cobol for a project that needs to be maintained for 50+ years; or just throw the hammer at someone.

Bertrand Russell

"I would never die for my beliefs because I might be wrong."

Isomorphism is a truly beautiful concept.

D'you ever realize how some of the words we use are polymorphic?

Take a verb such as 'get' for example...You can say both 'get me that paper' and 'get me that pencil' using the same verb!

Were you ever conscious of doing that?

No one gives a shit if (clicks <= 3 || clicks > 3) are needed.

The Three-click rule is bullshit, so stop worrying about it.

If you can't contribute to a solution...

...might as well be jolly about it.

If you're not part of the solution, you're part of the .... oh shut the fuck up will ya?

"If you're not part of the solution, you're part of the problem" -- uh, what? What makes people say that overused pathetic phrase?

You think you're a part of every problem every person on this planet has? Uh, no, you're not and neither am I.

And also, accept the fact that you can't fix every problem. We could barely handle our own problems, let alone problems that affect others.

You could fix *some* problems, sure, but you need to start with your own first and if everyone did that, we wouldn't have any problems, theoretically speaking of course :-)

So that's why you need to be jolly about others' problems because as I said, you can't fix all of them especially the ones which don't affect you personally.

If you are being jolly and laughing about it, maybe that'll help You fix Your problems, which as you may have noticed, has returned us to my previous point.

Proving me wrong?

Getting proved wrong is great because then you could use the logic that crushed you to prove others wrong thus making you appear smarter than everyone else; and isn't that one of the little things in life? Pseudo intellectualism at its best.

simple, see? prove, be proved wrong, learn. That's it.

a strange (learning) loop.

Not exactly Escher...but this is how I'm learning to understand Mathematics in all its glory:

  1. Find a problem which needs solving.
  2. Solve the problem Mechanically.
  3. Jump out of the system and ask 'why?'.
  4. Light a cigarette && Understand ('Aha!') and re-solve the problem Intelligently.
  5. Visualize the pattern between this problem and others.
  6. Get more coffee && goto: 1.

You think I've got this all backwards? Well hell, take a look at the title of this blog.

intelligent what?

Some dust on the monitor looked like a negative sign for me, for about two hours straight. Fuck our imperfect eyes...Intelligent Design my arse.

If this is perfection to you, then you've got some major issues when it comes to setting standards.

On the other hand, I appreciate how the brain gives meaning to meaningless things; I bet that's extremely helpful when you're in a jungle and your brain interprets some leaves as a lion; better safe than sorry.

languages...both of them.

I speak both x=(English && Maltese) so I naturally write with x as well. That's right, both of them.

So if you !(speak Maltese), you will not, and I repeat, will not understand my written Maltese.

Oh and just because I can write Maltese doesn't mean I should, but I will although I can't spell in it. Deal with it.

cAPITALIZATION.

I capitalize words like Universe And Cosmos but not god and yahweh; bite me.

And as you might have realized, I also prefer capitalizing a word like And over god.

One of the KEYS.

Indifference is probably one of the keys to sanity.

complaisance.

Here's a word religious people should learn: complaisance.

Or actually, everyone probably needs to learn that word, myself included.

Just things...

I don't know why I created this and what I should write, if anything, in it..but really, who gives a shit huh?

Oh yea, and don't forget that your life is insignificant and you are completely meaningless to our Cosmos. The sooner you deal with that, the sooner you'll start living.

There.

Also, every blog needs a first post and this was randomly chosen to be it, somehow.