Extension Methods

I’ve just started looking at C#, and having gone through some example code, noticed something unusual in a method definition. There was a method which included the keyword ‘this’ in the parameters. Here’s what it looked like:

 static bool Contains(this string keyString, char c)
     return keyString.IndexOf(c) >= 0;

After doing some looking around, I found out this is what is called an extension method. The difference between an extension method and a normal static one is that it allows you to use the method in a way that makes it look like it’s part of the type (that it’s extending).

Formally, per the Microsoft Documentation;

“Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter specifies which type the method operates on, and the parameter is preceded by the this modifier. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive.”





Greenshot is a free (under GNU General Purpose Licence) tool, which offers more than just the standard Print Screen button would do on a PC.

If you’ve ever wanted to capture just a small part (region) of the screen, then this is a great tool for doing that. It allows you to map itself to your Print Screen button, meaning you can still have the convenience of pressing that button. If you do, after pressing it you’ll be presented with a cross-hair to select what you want to capture on the screen. After letting go, it will then let you decide whether to save it straight away (as a jpg for example), or whether to launch it in MSPaint.

You can find more information, and a free download, here: http://getgreenshot.org

Designated Survivor

Designated Survivor [on Netflix] is a Political Drama which explores the idea of a catastrophic event taking place at the State of Union address, which results in the President and nearly all the Cabinet being wiped out. The ‘designated survivor’ is someone who is kept at a different location for such an event, so that government can be continued.

I’d describe the show as a cross between 24 and House of Cards, and what makes it watchable is how it keeps you guessing. Filled with deceit, suspense and twists, I’m currently waiting for the next episode in March with anticipation!

starstarstarstar / 5

Verdict: Good watch!


Salvator Rosa – Démocrite et Protagoras. Public Domain.

No that isn’t a spelling mistake, I do mean the name Protagoras (c. 490 – c. 420 BC)! He was a Greek philosopher and named by Plato to be a ‘Sophist’ (a specific kind of teacher from the time, who specialised in philosophy and rhetoric). He’s arguably most famous for his saying:

“Of all things the measure is Man, of the things that are, that they are, and of the things that are not, that they are not”
(Diels-Kranz 80B1)

This is more commonly shortened to ‘Man is the Measure of All Things’, which is often interpreted to mean that values come from within each individual human being (rather than a god or deity). ‘What you feel to be true is true for you, what I feel to be true is true for me, and there is no reason they should be the same.’

This view was controversial at the time, as Athenians held piety of high importance. As a result Protagoras drowned in the sea while fleeing for safety, after being charged with impiety!

Sources: Wikipedia (http://www.wikipedia.com) | Listverse (http://listverse.com/2012/06/26/top-10-pre-socratic-philosophers) | Ancient History Encyclopaedia (http://www.ancient.eu/article/61)


Empedocles in the Nuremberg Chronicle. Public Domain.
Empedocles in the Nuremberg Chronicle. Public Domain.

Empedocles (c. 490 – c. 430 BC) was a Greek pre-Socratic philosopher. He thought himself to be a god among men, and as legend goes, jumped into a volcano to prove that he was immortal; needless to say he died.

He is known as the person to come up with cosmogenic theory of the four Classical elements. This essentially was the belief that all things were made up of the elements, earth fire air and water. The elements themselves believed not to change; just moving around and combining with each other.

He also proposed forces called Love and Strife which would act as forces to bring about the mixture and separation of the elements. He thought them to be constantly at battle with one another:

  • Love, responsible for bringing the elements together to make up things around us, as well as human emotion (this force of love is actually what caused humans to feel sexual attraction towards each other)
  • Strife, continually trying to separate the elements apart and break them down (driving people away from each other and creating problems)

He thought of the result of this constant battle to be the changing world around us.

Empedocles is also credited with the first comprehensive theory of light and vision. He proposed the idea that we see objects because light streams out of our eyes and touches them. Although not correct, this became the foundation on which later Greek philosophers and mathematicians, such as Euclid, based some of the most important theories on light, vision and optics.

Sources: Philosophize This! (http://www.philosophizethis.org) | Wikipedia (http://www.wikipedia.com) | Internet Encyclopedia of Philosophy (http://www.iep.utm.edu) | Britannica (http://www.britannica.com/biography)

Parmenides of Elea

Parmenides, from The School of Athens by Raphael. Public Domain.

Change is impossible! That’s one of the things that Parmenides argued. He was a philosopher from Ancient Greater Greece. He was the first person to bring the idea of deductive reasoning to the forefront, and believed the senses can’t be trusted.

There is only one surviving (incomplete) work from him; a poem named On Nature. written in heroic hexameter (which is apparently the Grand Style of classical poetry, and used by the likes of Homer and Virgil). In the proem (that is, the introductory discourse to the actual poem), he describes meeting a goddess.

He begins by describing himself on a chariot with Sunmaidens, passing along the highway untill they come to the locked Gate of Night and Day. They convince the holder of the key to let them pass in through the gate, entering the realms of Day. The aim is to find a goddess who instructs him in the two ways, that of Truth and the deceptive way of Belief, in which is no truth at all. This supposedly indicates that Parmenides had been converted, that he had passed from error (night) to truth (day), and the Two Ways (the two parts of the poem) represent his former error and the truth which is now revealed to him.

The poem itself goes on to describe the Two Ways, and goes on to say that what is, is. What is not, is not. That is to say, that if something exists then it exists, and if it doesn’t then it doesn’t; nothing can come into existence, as something cannot come from nothing (ex nihilo nihil fit). Through this idea, he argues that the world has always existed, and furthermore, that it is a sphere, and unmoving.

Sources: Philosophize This! (http://www.philosophizethis.org) | Wikipedia (http://www.wikipedia.com) | Internet Encyclopedia of Philosophy (http://www.iep.utm.edu)

Pythagoras of Samos

Pythagoras, the man in the centre with the book, teaching music, in Raphael’s The School of Athens. Public Domain.

Pythagoras of Samos was a Philosopher and Mathematician born in Ancient Greece, probably most famously known for the equation a2+b2=c2 in a right-triangle.

He famously started a school of Pythagoreans in Italy, however this was following his unsuccessful attempt in Samos. The story goes that he paid a boy to be his disciple, and taught him his views on philosophy and mathematics. One day he tested the boy, by pretending that he didn’t have any money left to pay him, in order to see if the boy was loyal (which he was). However politically he failed in Samos, so fled with his disciple and mother to Italy.

In Italy (Croton) where he met a rich man named Milo, thought to be one of the strongest men ever (a man who had won at the Olympic games around 12 times). Milo set aside part of his house for Pythagoras to set up his school, as he was a fan of mathematics and philosophy. The school was formed of hundreds of ‘brothers’ and a few ‘sisters’. Pythagoras’ favourite student was Milo’s daughter, who he later went on to marry despite the big age difference.

One random fact about the Pythagorean Brotherhood that he formed, is that in order to join you had to donate all your worldly possessions to a common fund. If you chose to leave the Brotherhood, you would receive twice the amount you had originally put in.

Pythagoras was the first person to coin the word ‘philosopher’ (the words ‘Phil’ and ‘Soph’ are Greek roots which mean ‘love’ and ‘wisdom’, therefore ‘philosophy’ means ‘the love of wisdom’).

For those interested in maths, one of the ideas that Pythagoras came up with is that of ‘perfect numbers’. A number is thought to be a perfect number if its divisors add up exactly to the number.
For example, 6 is thought to be a perfect number, as its divisors 1, 2 and 3, add up 6.

The Brotherhood was shrouded in mystery as its members were sworn to secrecy. The general thought pushed by Pythagoras was that people were stuck in a cycle of reincarnation (and for this reason, you had to be a vegetarian if you were part of the Brotherhood) as a punishment, and in order to become free and live in the ‘blessed realm’ (thought to be the sun or the moon, back then) you needed to adhere to a strict regiment of behavioural and thought restrictions. Historians say they borrowed this way of thinking from the Ancient Greek religion/cult of Orphism. There’s also a story about how Pythagoras started believing in reincarnation; he once walked past a group of men beating up a dog, in which he heard the voice of his late friend in the yelp of the dog.

Another famous anecdote about Pythagoras, is regarding how he came to learn about the relationship between musical harmony and numbers. He is said to have had the revelation whilst listening to two blacksmiths working; one day Pythagoras was listening to them doing their work. He noticed that one combination of hammers produced a non-harmonious sound. After closer inspection he realised this was owing to the relationship between the weights, or the ratio.

Pythagoras is also believed to have been the first to say that that conclusions arrived at through reason are superior to those arrived at through the senses.

There’s a lot about Pythagoras around, so I’d definitely recommend reading more about him if any of this peaked your interest.

Sources: Philosophize This! (http://www.philosophizethis.org) | Wikipedia (http://www.wikipedia.com) | Internet Encyclopedia of Philosophy (http://www.iep.utm.edu) | Britannica (http://www.britannica.com/biography) | Fermat’s Last Theorem – Simon Singh (IBAN 1-85702-669-1)


Democritus, ancient Greek philosopher. Public Domain

Democritus was a philosopher from ancient Greece, who is sometimes referred to as ‘the laughing philosopher’.

He is largely associated with being the first to put together the theory of atomism. The word atom comes from the ancient Greek word ‘atomos’, tomos meaning “cuttable” and the prefix of a meaning “not”.

His theory was that everything is made of these uncuttable atoms and void (empty space).

Together with his teacher Leucippus, they proposed that the sensation of various things were down to the shapes of the atoms that they were made from. For example, they believed water atoms were smooth and slippery (as such couldn’t hold onto each other, and flowed), that salt atoms were sharp and pointed (as they tasted sour), and that iron atoms were rough and hooked shaped (allowing them to cling tightly together).

That’s my quick summary of what I learnt about Democritus!

Sources: Philosophize This! (http://www.philosophizethis.org) | Wikipedia (http://www.wikipedia.com) | Internet Encyclopedia of Philosophy (http://www.iep.utm.edu) | Britannica (http://www.britannica.com/biography)

Heraclitus of Ephesus

Heraclitus in Raphael’s “School of Athens”. Public Domain.

Heraclitus was a philosopher from Ancient Greece. From what I have heard and read, he sounds like he wasn’t the most sociable of people, and actually looked down on most people in terms of intelligence.

“Of this Word’s being forever do men prove to be uncomprehending, both before they hear and once they have heard it … Other men are unaware of what they do when they are awake just as they are forgetful of what they do when they are asleep.” (Diels-Kranz 22B1)

This view is probably best summed up by his death. The story goes that he started suffering from Edema (a condition where the body starts building up excess fluids). He set about asking the doctors around for their advice, but concluded he was smarter than them, and came up with his own treatment. This treatment (there’s a couple of versions of the story) involved him covering himself with cow manure and sitting in the hot sun. The thinking was probably that the manure would heat up and absorb his excess fluids, however he ended up dying in that pile of cow dung.

He is perhaps most famous for his idea of the “Logos”, which translates as ‘reason’ or ‘word’. Though open to interpretation, he described this Logos as the thing that governs the universe. He claimed it is the link between things that are opposites (i.e. hot and cold, good and evil, wet and dry, happy and sad). His idea was that opposites constantly change, like day to night and back to day, and create a balance.

Continuing on from this theme, he famously made a statement regarding the nature of a river…

“On those stepping into rivers staying the same other and other waters flow” (Diels-Kranz 22B12)

He is essentially pointing out that although the water particles in a river are constantly changing as it flows, the river is thought to be the same river.

That made me think about what actually goes into defining something, and reminds me of a conversation with a friend recently; ‘can a chocolate bar that’s melted into a different shape, be the same chocolate bar it originally was, if you were to rearrange it back into it’s original form?’

That’s my mini summary on Heraclitus. For further research, you may wish to read about his thoughts on fire!

Sources: Philosophize This! (http://www.philosophizethis.org) | Wikipedia (http://www.wikipedia.com) | Internet Encyclopedia of Philosophy (http://www.iep.utm.edu) | Britannica (http://www.britannica.com)


Anaximander, Detailansicht in “Die Schule von Athen”, 1510/11. Public Domain

Anaximander was a philosopher from Miletus in Ancient Greece, who learned the teachings of Thales in the Milesian school.

Anaximander’s contributions spread across different disciplines, such as astrology and geometry. He is considered the first philosopher to use the word apeíron (ἄπειρον “infinite” or “limitless”). For this he is considered the first metaphysican. Although he did not explain precisely what he meant by the word, he associated it with the thing that all things come from.

In the area of cosmology, he was the first to put together a mechanical model of the world. In this model he thought the world to be a cylinder in shape, and the world to be floating without attachment in the centre of the ‘infinite’. This was pretty big considering the belief at the time.

Lastly, he is also considered to be the first person to draw a map of the world.

That’s my summary of learning about Anaximander. As last time I’ll leave you with something to look into – his belief that humans came from fish!

Sources: Philosophize This! (http://www.philosophizethis.org) | Wikipedia (http://www.wikipedia.com) | Internet Encyclopedia of Philosophy (http://www.iep.utm.edu)