I know that it's old and plenty may already know it and have retold it countless times, but it bears repeating because it's classical and clever in its own unique way.
A mathematician and an engineer were talked into taking part in a psychological experiment. They were seated on one side of a room unaware of what would happen. A door swung open and a hot-looking naked woman came in and stood on the far side. They were then instructed that every time they heard a beep to move half the remaining distance to the woman. They heard the beep and the engineer quickly moved halfway across the room while the mathematician stood still, unmoving and looking disgusted. When the mathematician failed to move again after the second beep he was asked why. "Because I know I will never reach the woman", implying that any given measured distance can be infinitely divided by two and never become zero. On the other hand, the engineer was asked why he chose to move and replied "Because I know that very soon I will be close enough for all practical purposes!"
Html/Javascript widget
Sunday, 24 August 2014
Monday, 14 July 2014
Common Data Structures in C#
As used in Unity 3d, that is! Today we are going to review some basic data structures and the right syntax within which they are arranged in C#.
Queue
A queue in computer programming stands for a sort of array of the first in first out kind. This is comprised of a rank of items being entered into a set and then the first item inserted is also the first one to be taken out. The items assigned to the queue can be strings (ASCII characters that don`t take part in any kind of specific calculation), integers, float (a special kind of integer that supports an impressive amount of decimal digits) etc. The basic syntax is as follows:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class QueueManager : MonoBehaviour
//this is important. When dealing with C sharp within a common Unity Engine domain,
//it is necessary to declare a class (a class basically carries your main program)as public
//inheriting MonoBehaviour. It is crucial to the successful compilation of your program for it to //inherit MonoBehaviour because that`s what will interpret your code as more fitting in an
// in-game environment than that of a common application. Therefore, you shall make your mission
// to have your public class inherit MonoBehaviour. Also note that the public class name
// will always be named after the script created in the game object screen
{
public Queue <string> panhandle = new Queue <string> ();
/* Pay heed to the way the above statement looks like. We start off by declaring a variable of the queue kind. Except that you don`t declare it the usual way. Before moving on, notice that the queue is to accessed publicly anywhere in your project. That`s why it was made necessary to state that it is of the public kind. AFter making it clear that you`re declaring a public queue variable, you need to specify what kind of data will be inserted into this queue. This is specified between < >. In the example above, it will take in string variables.
Ok, so far you know that every queue that for the life of you you have to declare should follow the following pattern:
1- access level (public, private etc)
2- the key word `Queue`
3- what kind of variables will come into this (<string>, <int>, <float> etc)
This should be enough for you to witness the mighty power of a newly declared queue, right?
Again, do recall that life is full to the brimming with glaring exception that are only there to mar the beautiful thought process that you have allowed to shape up in your bonse. After making sure that your queue is of the public kind and that it will be receiving strings, you should prepare it for future use. That`s right, you should set this to be started in the program. This is accomplished with `new`. You have basically created a queue data structure and now the compiler needs to understand that it is a new queue. Worse yet, it needs to be told that it is a new Queue that will store strings. Hence the <string> bit.
The last tidbit are the round brackets enclosing themselves. () are a common staple of object oriented programming and apparently necessary for the public declaration of a queue to be complete.
From what you can glean by reading the above it is possible to conclude that:
1- a queue should first be determined whether it will be of the public kind
2- it is always necessary to specify the type of variables that are going to be administered to the declared public queue
3- don`t forget to give your queue a name. Here it is going to be called `panhandle`.
4- It will receive (hence the equal symbol) a new queue. You can think of the process as a soulless body lying prostate on the ground. Provided that it remains soulless, it will be of no use. As soon as it welcomes a warm and amiable soul, the body will be ready to serve whomever its master is.
5- it will receive a new attribute, which calls for the specification that it is a queue for <string>
6- () is a common staple of queues, stacks and lists.
public Queue <string> panhandle = new Queue <string> ()
After this thorough understanding behind the rationale for creating a queue, you can type this up without giving it much thought!
void Start()
{
// here is everything that is going to take place at the game`s start
panhandle.Enqueue("Damnd");
//there you have it. You`ve included your first item in the queue. A string named "Damnd".
//notice the imperative command `enqueue` to make this happen
panhandle.Enqueue("Abigail");
panhandle. Enqueue("Eddi E.");
panhandle.Enqueue("Won Won");
//we`ve added a total of 4 <string> items to our queue.
//it might be interesting to create a loop to check the <string> variables in the queue.
foreach (string number in panhandle)
{
Debug.Log (number);
//number was a quick string created only to be a reference to access the queue
}
//one might want to display their neat queue. Debug.Log is the best option for a quick Print.Out //command
Debug.Log
//If we need to take an item out of the queue, we simply use Dequeue ().No need to specify which //item will be withdrawn becauseit will always be the first one in.
}
void Update ()
{
}
}}
.....................
Let`s create a complete application to highlight the use of queues:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class queuemanager : MonoBehaviour {
public Queue <string> elements = new Queue <string> ();
void Start ()
elements.Enqueue ("Kung Lao");
elements.Enqueue ("Tony Marquez");
elements.Enqueue ("Goro");
foreach (string number in elements)
{
Debug.Log (number);
}
void Update ()
{
if (Input.GetKeyUp (KeyCode.Space))
{
elements.Dequeue ();
Debug.Log ("___");
foreach (string number in elements)
{
Debug.Log (number);
}}}
.............................
List
A list is, at its most basic concept, a queue, bar the except that it doesn`t necessarily follow the first in last in pattern.
Example:
using EngineUnity;
using System.Collections;
using System.Collections.Generic;
public class listmanager : MonoBehaviour {
public list <int> listofintegers = new list <int> ();
void Start ()
{
listofintegers.Add (1);
listofintegers.Add (2) ;
listofintegers.Add(3);
listofintegers.Removeat (0);
listofintegers.Remove(2);
//(0) simply means that we are going to remove the item at the top of the list.
//Remove(2) will remove 2 items at once off the list
for (int i=0; i<listofintegers.Count;i++)
{
Debug.Log (listofintegers[i]):
}
}
void Update ()
{
}
}
................................
Stack
Another kind of queue, except that it is of the first in last out kind.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class stackmanager : MonoBehaviour
{
public stack <string> staxrcool = new stack <string> ();
void Start ()
{
staxrcool.Push ("Akuma");
staxrcool.Push ("Gouki");
staxrcool.Push ("Shin Gouki");
// you may be intelligent enough to have noticed that to add items to stack is to push them in.
staxrcool.Pop ();
//Pop removes one item from the stack. Again, the last one in is always the first to leave.
}
void Update ()
{
}
}
Queue
A queue in computer programming stands for a sort of array of the first in first out kind. This is comprised of a rank of items being entered into a set and then the first item inserted is also the first one to be taken out. The items assigned to the queue can be strings (ASCII characters that don`t take part in any kind of specific calculation), integers, float (a special kind of integer that supports an impressive amount of decimal digits) etc. The basic syntax is as follows:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class QueueManager : MonoBehaviour
//this is important. When dealing with C sharp within a common Unity Engine domain,
//it is necessary to declare a class (a class basically carries your main program)as public
//inheriting MonoBehaviour. It is crucial to the successful compilation of your program for it to //inherit MonoBehaviour because that`s what will interpret your code as more fitting in an
// in-game environment than that of a common application. Therefore, you shall make your mission
// to have your public class inherit MonoBehaviour. Also note that the public class name
// will always be named after the script created in the game object screen
{
public Queue <string> panhandle = new Queue <string> ();
/* Pay heed to the way the above statement looks like. We start off by declaring a variable of the queue kind. Except that you don`t declare it the usual way. Before moving on, notice that the queue is to accessed publicly anywhere in your project. That`s why it was made necessary to state that it is of the public kind. AFter making it clear that you`re declaring a public queue variable, you need to specify what kind of data will be inserted into this queue. This is specified between < >. In the example above, it will take in string variables.
Ok, so far you know that every queue that for the life of you you have to declare should follow the following pattern:
1- access level (public, private etc)
2- the key word `Queue`
3- what kind of variables will come into this (<string>, <int>, <float> etc)
This should be enough for you to witness the mighty power of a newly declared queue, right?
Again, do recall that life is full to the brimming with glaring exception that are only there to mar the beautiful thought process that you have allowed to shape up in your bonse. After making sure that your queue is of the public kind and that it will be receiving strings, you should prepare it for future use. That`s right, you should set this to be started in the program. This is accomplished with `new`. You have basically created a queue data structure and now the compiler needs to understand that it is a new queue. Worse yet, it needs to be told that it is a new Queue that will store strings. Hence the <string> bit.
The last tidbit are the round brackets enclosing themselves. () are a common staple of object oriented programming and apparently necessary for the public declaration of a queue to be complete.
From what you can glean by reading the above it is possible to conclude that:
1- a queue should first be determined whether it will be of the public kind
2- it is always necessary to specify the type of variables that are going to be administered to the declared public queue
3- don`t forget to give your queue a name. Here it is going to be called `panhandle`.
4- It will receive (hence the equal symbol) a new queue. You can think of the process as a soulless body lying prostate on the ground. Provided that it remains soulless, it will be of no use. As soon as it welcomes a warm and amiable soul, the body will be ready to serve whomever its master is.
5- it will receive a new attribute, which calls for the specification that it is a queue for <string>
6- () is a common staple of queues, stacks and lists.
public Queue <string> panhandle = new Queue <string> ()
After this thorough understanding behind the rationale for creating a queue, you can type this up without giving it much thought!
void Start()
{
// here is everything that is going to take place at the game`s start
panhandle.Enqueue("Damnd");
//there you have it. You`ve included your first item in the queue. A string named "Damnd".
//notice the imperative command `enqueue` to make this happen
panhandle.Enqueue("Abigail");
panhandle. Enqueue("Eddi E.");
panhandle.Enqueue("Won Won");
//we`ve added a total of 4 <string> items to our queue.
//it might be interesting to create a loop to check the <string> variables in the queue.
foreach (string number in panhandle)
{
Debug.Log (number);
//number was a quick string created only to be a reference to access the queue
}
//one might want to display their neat queue. Debug.Log is the best option for a quick Print.Out //command
Debug.Log
//If we need to take an item out of the queue, we simply use Dequeue ().No need to specify which //item will be withdrawn becauseit will always be the first one in.
}
void Update ()
{
}
}}
.....................
Let`s create a complete application to highlight the use of queues:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class queuemanager : MonoBehaviour {
public Queue <string> elements = new Queue <string> ();
void Start ()
elements.Enqueue ("Kung Lao");
elements.Enqueue ("Tony Marquez");
elements.Enqueue ("Goro");
foreach (string number in elements)
{
Debug.Log (number);
}
void Update ()
{
if (Input.GetKeyUp (KeyCode.Space))
{
elements.Dequeue ();
Debug.Log ("___");
foreach (string number in elements)
{
Debug.Log (number);
}}}
.............................
List
A list is, at its most basic concept, a queue, bar the except that it doesn`t necessarily follow the first in last in pattern.
Example:
using EngineUnity;
using System.Collections;
using System.Collections.Generic;
public class listmanager : MonoBehaviour {
public list <int> listofintegers = new list <int> ();
void Start ()
{
listofintegers.Add (1);
listofintegers.Add (2) ;
listofintegers.Add(3);
listofintegers.Removeat (0);
listofintegers.Remove(2);
//(0) simply means that we are going to remove the item at the top of the list.
//Remove(2) will remove 2 items at once off the list
for (int i=0; i<listofintegers.Count;i++)
{
Debug.Log (listofintegers[i]):
}
}
void Update ()
{
}
}
................................
Stack
Another kind of queue, except that it is of the first in last out kind.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class stackmanager : MonoBehaviour
{
public stack <string> staxrcool = new stack <string> ();
void Start ()
{
staxrcool.Push ("Akuma");
staxrcool.Push ("Gouki");
staxrcool.Push ("Shin Gouki");
// you may be intelligent enough to have noticed that to add items to stack is to push them in.
staxrcool.Pop ();
//Pop removes one item from the stack. Again, the last one in is always the first to leave.
}
void Update ()
{
}
}
Sunday, 6 July 2014
Tennis players are individuals, not one-man countries
I acknowledge the reality of people having to "come from" somewhere, but I tend to see the
players (in slams at least) as individuals rather than representatives
of a certain country, so to me the under-representation of a nation in the 3rd round
of the men's is just, well, one of those things. More shocking to me was
the early exit of the likes of Rafa, Roger etc in the previous tournament of what turned
out to be one of those peculiar Wimbledons that happens from time to
time.
Friday, 4 July 2014
French toast
![]() |
| French Toast. Image courtesy of wikipedia.org |
Preparation
Slices of bread are dipped in a beaten egg mixture. The slices of egg-coated bread are then placed on a frying pan or griddle prepared with a coat of butter or oil, and cooked until both sides are browned and the egg has cooked through.
According to wikipedia.org, the cooked slices can be served with a variety of toppings, including jam, butter, peanut butter, honey, Marmite, vegemite, maple syrup, fruit syrup, molasses, apple sauce, beans, beef, lard, whipped cream, fruit, tomato sauce (when powdered sugar/sugar is not used), chocolate, sugar, yogurt, powdered sugar, marmalade, bacon, duck fat (in Northern Ireland), treacle, cheese (often with ham), gravy or various nuts such as pecans. Heating the oil/butter with chopped garlic, chillies or onions is an effective way to add extra flavour to the dish.
| A bunch of slices of French Toast. |
Variations
Stuffed French toast is two pieces of French toast that are stuffed with bananas, strawberries, or other fruit. It is usually topped with butter, maple syrup, and powdered sugar.
In the United Kingdom it is often savory and known as either "eggy bread" or "Gypsy toast" or just "bread dipped in egg" in South East Wales. It is also sometimes known by the rather grand title of "Poor Knights of Windsor". Another name occasionally used is "French fried bread" but this should not be confused with "fried bread", which is white bread fried in butter or fat left over from frying bacon or sausages. One variation has marmite spread on the bread before dipping.
In Italy a variation is served known as mozzarella in carrozza (literally "mozzarella in carriage"). In this version a slice of fresh mozzarella is sandwiched between two slices of bread and the whole dipped in egg and fried. It can be seasoned with salt, but is not sweet like French toast nor is it eaten for breakfast. It is often topped with tomato sauce, which is then sometimes garnished with some chopped parsley and grated cheese to make 3 broad stripes of green, white and red, curiosuly enough, the colours of the Italian flag.
In Portugal, it is called fatias douradas or rabanadas and is typically made during Christmas, out of slices of bread leftovers (when it's too hard to be consumed the normal way) soaked in milk to soften it, dipped in beaten egg, deep-fried in olive oil and then dipped in sugar and cinnamon or a syrup made with water, sugar, cinnamon sticks and lemon skin. It is usually eaten cold for dessert.
In Spain, it is called torrijas and is typically made during Lent, out of thick slices of bread soaked in milk or wine, dipped in egg, fried and then drenched in spiced honey.
In New York and in Jewish-American communities, it is a common to make it with Challah. The richness of the sweet egg bread complements the richness of the French toast preparation. In many Jewish-American households it is traditional to use the leftover challah from Friday night Sabbath dinner to make French toast on Sunday morning. The slightly stale challah absorbs the egg or milk-and-egg mixture more readily and cooks into a custard-like central hub for the slices of French toast.
In the Western and Southwestern United States, it is common for some restaurants will prepare it with Sourdough bread.
In Australia and New Zealand, French toast is a breakfast or brunch dish, made by pan-frying individual sliced bread or baguette slices dipped in the egg mixture identical to American preparations. It is sometimes served with banana and fried bacon, and topped with maple syrup. Another popular variation in New Zealand uses a mixture of eggs yolks, milk and grated cheese to make a savory breakfast food.
In Germany, the Arme Ritter (literally poor knights) are made from bread leftovers as fast and simple meal. There are several local alternatives in serving: with a mix of sugar and cinnamon, filled with plum-jam or with vanilla sauce. Sometimes it is made with wine instead of milk, and therefore called Betrunkene Jungfrau, drunken virgin.
In India, the version is salted rather than sweet. The egg is beaten with milk, salt, green chili and chopped onion. Bread is dunked into this mixture and is deep fried in butter or cooking oil. In India locals enjoy seasoning the slices with ketchup.
History and geographic spread
French toast originated as a way to use day-old or stale bread (some breads, French bread especially, become stale after one day). Whereas a stale, crunchy bread might seem unappetizing, soaking the bread in eggs and frying it solved that problem. The precise origins of the recipe are unknown, although a version appears in the 4th century CE Roman cookbook, often attributed to Apicius ("Aliter dulcia: siligineos rasos frangis, et buccellas maiores facies. in lacte infundis, frigis [et] in oleo, mel superfundis et inferes." - "Another sweet: Break grated Sigilines (a kind of wheat bread), and make larger bites. Soak in milk, fry in oil, douse in honey and serve."). This was also known as Pan Dulcis.
![]() | |||
| French Toast for brunch. |
![]() |
| Pain Perdu with syrup, fruit and creme anglaise. |
![]() |
| Hong Kong style French Toast typically served in Chan Chan Tengs. Toppings include syrup and a slab of butter. |
Saturday, 7 June 2014
Mario teaches typing
![]() |
| What? Are you fleeing for your lives? |
I was "fortunate" enough to play Mario teaches typing many years ago. I can't pinpoint exactly when it was, but it was there, buried deep in a memory slot that I once thought would never be unearthed again. until the day came when I saw it again. Does this game cause me goosebumps. I can't understand why obscure mario games have such an unexpected effect on some of us. Maybe the explanation is in the main character himself: if you come to think of it, Mario, however famous he is, remains a vessel of secrets long after having cemented his celebrity cred. To this day, we know little of him and the more Mario games are released, the less he reveals even a part of himself. But unlike typical fiction-dwelling aloof males whom draw huge admiration on a daily basis, Mario's silence is not exactly alluring. It's relegated to such a low key level that all else in the game, even petty game play details, is more likely to pique the player's interest. maybe this is all done on purpose and there is a tantalisingly gruesome secret behind Mario's constantly having to lean on stoicism. We cannot know for certain.
![]() |
| Super Mario 64 isn't the first game where we get to see a capless Mario. |
Mario teaches typing does little to enhance Mario's laconic reputation. Still little is revealed about the iconic hero aside from the fact that at some point in his life he took up typing. Actually he even stepped up a notch and went on to teach typing. Reasoning that perosnal computer sales would see a steep rise, there should be a way to squeeze some moolah out of Nintendo fans willing to embrace the upcoming technology trend. Wow! As if your love for Nintendo hadn't been professed hard enough, now it's coupled with your passion for technology and one of the core tenets of computer sciences: your computer keyboard and the ability to exert utter control over what might as well be the most complete input device to interact with a machine that excels at manipulating ones and zeros. Now that's right up your alley!
![]() |
| Luigi chased by a brindlebass is as violent as it gets. |
Mario Teaches Typing includes three characters the player may play as: Mario, Luigi and Toadstool. The latter two were added only for gloss as there are no distinct game play features to distinguish one form the other. As the game starts, a pair of gloved hands is displayed to show which finger to use according to the required key. As the player clatters away at the keyboard, Mario strolls his way through typical albeit over-simplified floppy capacity versions of Super Mario Bros stages in an attempt to vanquish...Bowser? No. At the end of this rewarding experience the player is gifted with a chalkboard screen, in keeping up with the classroom-esque pattern, admonishing the player for his performance and how he should strive to be better next time. As if there ever was a next time. Statistics gild the otherwise unimaginative canvas, and the game re-starts.
Tuesday, 22 April 2014
Pollution is causing males to become more feminised
Immature eggs found in the tests of a frightening number of male fish is a portent of the evils of a feminism-threated world.
The researchers analysed samples of five mullet populations living on the Basque coast and the displaced feminised signs were spotted in three cases.
As the UK lies blanketed beneath record levels of smog, fish from the mainland are (in a screwed sort of way) living proof the unwanted consequences of pollution in their own environment.
Members of the Cell Biology in Environmental Toxicology group have found irrefutable proof that male fish in the estuaries in Basque Country have inherited “feminised features” from chemical waste in the water. What is seeping into the waters are Endocrine disrupting chemicals, which act as estrogens, a substance responsible for reproductive dysfunctions according to information released by the Marine Environmental Research journal.The researchers analysed samples of five mullet populations living on the Basque coast and the displaced feminised signs were spotted in three cases.
As the UK lies blanketed beneath record levels of smog, fish from the mainland are (in a screwed sort of way) living proof the unwanted consequences of pollution in their own environment.
The offending chemicals can be found in everyday products such as pesticides and detergents, making their way to the estuaries after being assimilated in teh cleaning systems in water treatment plants. There has also been evidence of the pollutants being dumped from industrial and farming activities.
Sunday, 20 April 2014
The Van Hiele model - an outline
I reckon this blog isn't a ripe platform for discussing teaching approaches. It's just that the main focus here is to analyse nostalgia stuff that comes to mind at times. But since I've been involved with some teaching projects (in a skewed sort of way), I'd like to present a brief view on an underrated teaching approach which rose to recognition in the 70's to aid teachers who had been clueless about teaching geometry to their pupils. It is none other than the Van Hiele model (Van Hiele niveaus),created by a Dutch couple in 1957 and widely analysed by teachers and scholars alike in the late 70's and early 80's after proof of its core tenets holding true after it was shown that students at the lower levels of the Van Hiele model were unable to understand a single iota fed to them about geometric theorems and equations. It turned out their cognitive level was below the threshold necessary to be able to grasp the staple principles of planes and solid figures. The original work on which the theory is based was Structure and Insight: A theory of mathematical education (author unknown). The model is a classical example of wiskundedidactiek (mathematics education) reference and is specifically used for a didactic approach to teaching geometry at school level. Pierre van Hiele died on 1st November 2010 aged 101 at his home in Haag.
Basisidee
The basic premise behind this model ,in a nutshell (weergegeven), is that learning geometry is achieved through gradual levels of cognitive awareness (graduele denkniveaus). Besides, the levels through which a student's progress is met bear no ties with their physiological age, although they do have specific eigenschappen (properties) which should become easier to observe following the levels' linear pattern. A specific level cannot be reached without the completion of a previous one, ie the learner's progress (de vordering van de leerlingen) follows the same succession of learnt competences towards utter understanding of the whole picture. Doing otherwise would be chewing more than one can swallow. Each level also makes use of its own language or linguistic symbols (linguïstische symbolen) and accompanying in-content relevance (inhoudbetekenis). It also holds that two students of diverging levels (verschillende niveaus) cannot understand each other. Odd, because the more competent peer is supposed to make sense out of what his inexperienced counterpart means as he was once at the same stage and should recall what what his gripes were at the time (the been there, done that argument).
The Van Hiele model consists of 5 levels, going from 0 to 5.
Retrieved from:
http://www.fisme.science.uu.nl/wiki/index.php/Niveautheorie_van_Van_Hiele
Basisidee
The basic premise behind this model ,in a nutshell (weergegeven), is that learning geometry is achieved through gradual levels of cognitive awareness (graduele denkniveaus). Besides, the levels through which a student's progress is met bear no ties with their physiological age, although they do have specific eigenschappen (properties) which should become easier to observe following the levels' linear pattern. A specific level cannot be reached without the completion of a previous one, ie the learner's progress (de vordering van de leerlingen) follows the same succession of learnt competences towards utter understanding of the whole picture. Doing otherwise would be chewing more than one can swallow. Each level also makes use of its own language or linguistic symbols (linguïstische symbolen) and accompanying in-content relevance (inhoudbetekenis). It also holds that two students of diverging levels (verschillende niveaus) cannot understand each other. Odd, because the more competent peer is supposed to make sense out of what his inexperienced counterpart means as he was once at the same stage and should recall what what his gripes were at the time (the been there, done that argument).
Niveaus
The Van Hiele model consists of 5 levels, going from 0 to 5.
- Niveau 0 : Visualisatie
- Niveau 1 : Analyse
- Niveau 2 : Ordening of classificatie
- Niveau 3 : Informele deductie
- Niveau 4 : Formeel
Retrieved from:
http://www.fisme.science.uu.nl/wiki/index.php/Niveautheorie_van_Van_Hiele
Subscribe to:
Posts (Atom)






