Angella Andrea - English Blog

Infinite passion for software development !
posts - 15, comments - 20, trackbacks - 16

Sunday, January 29, 2012

This blog has been moved…


This is my new blog:

Andrea Angella – Official Blog


Hello everybody,

It is time for me to have my personal space.

There are many reasons and you can find a description in the following post:

This is not certainty an goodbye because I will continue to follow all the Italian community as I always did and help DotNetToscana to grow.

I hope that this will be the opportunity to blog more and that some of you will subscribe to my new feed:

Thanks a lot to UgiDotNet for all these yeas of service



posted @ Sunday, January 29, 2012 2:55 PM | Feedback (8) |

Wednesday, August 31, 2011

Windows Phone Camp in London

Next 17 September will be a full immersion day of Windows Phone 7 Mango Sorriso


posted @ Wednesday, August 31, 2011 10:24 PM | Feedback (7) |

Friday, August 12, 2011

Unit Test Lab il 24 Settembre 2011 – Tenetevi pronti


Ciao a tutti,
appena prima delle meritate vacanze estive DotNetToscana vuole rivelare alcuni dettagli del prossivo evento laboratorio.

La data à già stata fissata a Sabato 24 Settembre 2011 mentre il luogo deve ancora essere confermato.

Il laboratorio sarà guidato da Matteo Baglini mentre gli altri membri dello staff forniranno supporto tecnico ai partecipanti.

Segue una breve descrizione dell’evento:

Uno degli aspetti più controversi dello sviluppo software è sicuramente il test.
Pratica da molti reputata importante per ottenere un software di qualità ma allo stesso tempo snobbata.
La realtà è che gli sviluppatori preferiscono progettare e realizzare il software piuttosto che testarlo lasciando quest'ultimo compito al team di tester.
Esistono molteplici tipologie di test, lo Unit Test è uno di questi e rappresenta uno strumento importante per i tester, ma soprattutto per gli sviluppatori.

Durante questo laboratorio potrai provare con mano la pratica dello Unit Test e trovare risposta alle tipiche domande: perchè, come e quando effettuare Unit Test.
Imparerai i principi che guidano lo Unit Test passando dalla teoria alla pratica, applicando questa tecnica in svariati contesti.

Maggiori dettagli seguiranno alla fine del mese,

Buone vacanze a tutti,

Vi aspettiamo,


posted @ Friday, August 12, 2011 10:06 PM | Feedback (24) |

Saturday, July 23, 2011

101 Ways to Motivate Yourselft and Others – My favourites

Recentely Sources of Insight published a really interesting post: 101 Ways to Motivate Yourselft and Others.

As a reminder, I would like to write the points I considere more important for me and where I want to work.

  • Act on your inspiration
    • “Use your best energy for your best results”
    • "Your passion can expire, if you wait too long or miss the window of opportunity”
    • “A common way to kill idea or momentum is to spread them out over time, or keep pushing them out”
  • Be a coach, not a critic
    • “Use your inner coach for constructive feedback, and give your inner-critic a break”
  • Be on fire
    • “You know when you’re on fire. You kno what you’re like when you’re in the zone and you’re fully engaged and you’re at your best. Sometimes, the easiest way to get back to this mode is to simply remember what if feels like”
  • Be YOUR best
    • “Compete with yourselft and make it a game”
  • Build your band of merry men
    • “Surround yourself with the people that inspire and deligh you, wherever you go”
  • Change the frame, to change your game
    • “Problems aren’t problems when you reframe them as challenges. Challenges are opportunities for growth, excellence and your personal best”
  • Chart your progress
    • “If you want to motivate, find a way to keep the score. Progress is the top motivator of performance. Even incremental progress boosts motivation”
  • Choose significant tasks that are meaningful for you
    • “If you like excellence, then challenge yourself to shine”.
  • Create a wall of inspiration
    • “Put those pictures up that show you the greates things in life and what’s possible. Get those hopes and dreams up on the wall that remind you what’s worth fighting for.”
    • “Put those wards on the wall and quotable quotes that fire you up and make you feel alive”
  • Decide
    • “Nothing builds momentum like decisive action. Just Decide.Decisive action is motivation, it build momentum and it crowds out excuses”
  • Do worst things first
    • “Don’t let things loom over you. Once they’re out of the waym the rest is a glide-path”
  • Don’t let feat stop you
    • “A great way to conquer fear is to put the fears on the table and find a way to take away the thread or prepare for the worst case scenario”
    • “The only thing we have to fear is fear itself”, Roosevelt
  • Don’t be perfectionist
    • “Perfection is a fallacy and it’s over-rated. A better focus is to be effective. Make it work, then make it right. Think of perfection as a process of improvement.”
    • “Focus on good enough for now. and satisfice”.
    • “Taking action is a key way to stay out of analysis paralysis, and keep your motivation strong. Don’t worry about the perfect place to start, just start”
  • Don’t look for execuse
  • Don’t take yourselft too seriously
    • “Build your sense of humor”
  • Eat, sleep and exercise on a cadence
    • “Your cadence will serve you emotionally, mentally and physically”
  • Find your “one thing”
    • “One thing matters to you most. Do more of that. That’s the thing to focus on”
  • Finish faster
    • “The faster you finish, the more you will finish. The more you finish, the easier it gets”
  • Focus on what you want
    • “Get a clear and compelling picture of what you do want and focus on that”
  • Play your favorite music
    • “Play the songs that make your spirit soar”
  • Reming yourself how short life is
    • “One way to give your fall is to remember that nothing lasts forever”
  • Set a deadline
    • “Knowing when something is due can help you funnel and focus your action and attention”
  • Set extreme goals
    • “Sometimes goals have to be extreme to feel worth it. Dream big. Set crazy limits or hurdles”
  • Want it with a passion
    • “Nothing beats the pursuit of a worhy and compelling objective”
  • Keep in mind that knowing and doing are two different things
    • “You hold the keys to unleashing what you’re capable of”

posted @ Saturday, July 23, 2011 5:23 PM | Feedback (9) |

Wednesday, August 25, 2010

The first program I wrote !

I entered in the fantastic world of programming when I was 9 years old.

My father give me a Casio graphical/programmable calculator as a present. It was exactly a FX-7400 G.

Quick Specifications:

  • Maximum of 26 variables (alphabet letters)
  • 13-character x 6-line display
  • 7 Kbytes of memory



If you ask me what is the first program that I have created the right answer is that I simply copied the first example in the manual.

This is the first program I wrote, and I’m writing this post just to share my enthusiasm in reading this again:



This is the beginning of my career in the computer science field :)

posted @ Wednesday, August 25, 2010 1:15 AM | Feedback (2) | Filed Under [ Personal ]

Thursday, June 17, 2010

Have you been called by a telepest?

Yesterday, I received an unusual voice message in my mobile phone from my English Bank. I immediately was suspicious.

For this reason, I found out the sender number on Internet and I discovered that this number is present in the database of unsolicited calling numbers.

The following website can help you to find if the sender number is a possible telepest:

Please, make attention when you receive an unsolicited call from an unknown telephone number.

Never reveals personal details and/or passwords in this case.

posted @ Thursday, June 17, 2010 7:40 AM | Feedback (1) |

Tuesday, June 15, 2010

Windows 7 - Pin folder to taskbar

I really like the Windows 7 Taskbar and in particular the jump lists to have access of my documents/folders that I frequently use. Adding a program link in the taskbar is extremely easy but there is not an easy way to create a quick link to a particular folder.

For example, I wanted a taskbar link to my Download folder:

taskbar link 

In the following page, you can find a useful tip to solve this problem:

posted @ Tuesday, June 15, 2010 7:06 PM | Feedback (1) |

Sunday, June 6, 2010

BOOKS - The Art of Happiness

Few minutes ago, I finished to read the Dalai Lama book: “The Art of Happiness”.


the art of happiness


I truly think this is a valuable book to understand the real value of the human life. This is a book that force you to reflect deeply about yourself and your relations with all human beings.

The book is divided in 5 sections.

I report some sentences that, for me, are the most significant:

    • The very purpose of life is to seek happiness.
    • Happy people are generally found to be more sociable, flexible, and creative and are able to tolerate life’s daily frustrations more easily than unhappy people. And, most important, they are found to be more loving and forgiving than unhappy people.
    • Happiness is determined more by one’s state of mind than by external events.
    • Happiness can be achieved through training the mind.
    • Our feelings of contentment are strongly influenced by our tendency to compare. We can increase our feeling of life satisfaction by comparing ourselves to those who are less fortunate than us and by reflecting on all things we have.
    • The greater the level of calmness of our mind, the greater our peace of mind, the greater our ability to enjoy and joyful life
    • The demarcation between a positive and a negative desire or action is not whether it gives you a immediate feeling of satisfaction but whether it ultimately results in positive or negative consequences.
    • Is not to have what we want but rather to want and appreciate what we have.
    • Sometimes people confuse happiness with pleasure. True happiness relates more to the mind and heart. Happiness that depends mainly on physical pleasure is unstable.
    • Framing any decision we face by asking ourselves: “Will it bring me happiness?
    • The first step in seeking happiness is learning. We first have to learn how negative emotions and behaviours are harmful to us and how positive emotions are helpful.
    • The proper utilization of our intelligence and knowledge is to effect changes from within to develop a good heart.
    • It is still my firm conviction that human nature is essentially compassionate, gentle. That is the predominant feature of human nature.
    • When we combine a warm heart with knowledge and education, we can learn to respect other’s views and other’s rights.
    • Scientists are discovering that those who lack close social ties seem to suffer from poor health, higher levels of unhappiness, and a greater vulnerability to stress


    • Once you accept the fact that compassion is not something childish or sentimental, once you realize that compassion is something really worthwhile, realize it’s deeper value, then you immediate develop an attraction towards it, a willingness to cultivate it.
    • There is a widespread notion in our culture that deep intimacy is best achieved within the context of a passionate romantic relationship. This can be a profoundly limiting viewpoint, cutting us off from other potential sources of intimacy, and the cause of much misery and unhappiness when that Special Someone isn’t there.
    • Intimacy is based on a willingness to open ourselves to many others, to family, friends, and even strangers, forming a genuine and deep bonds based on our common humanity.
    • Empathy is an important factor. The ability to appreciate another’s suffering.
    • If you are having some difficulties, it’s extremely helpful to be able to try to put yourself in the other person’s place and see how you would react to the situation.
    • We are all born in the same way, and we all die. All of us want happiness and do not want to suffer. Relating to others on that level makes it much easier to exchange and communicate with one another.
    • Married people are happier and more satisfied with life than single or widowed people, or especially compared to divorced or separated people.
    • Compassion can be roughly defined in terms of a state of mind that is nonviolent, non harming, and nonaggressive. It is a mental attitude based on the wish for others to be free of their suffering and is associated with a sense of commitment, responsibility, and respect towards the other.
    • Positive states of mind can improve our physical health.


    • As long as we view suffering as an unnatural state, an abnormal condition that we fear, avoid, and reject, we will never uproot the causes of suffering and begin to live a happier life.
    • We tend to take small things too seriously, and blow them up out of proportion, while at the same time we often remain indifferent to the really important things.
    • As a product of an imperfect world, all of us are imperfect. Every one of us has one some wrong.
    • The acceptance of change can be an important factor in reducing a large measure of our self-created suffering.
    • One must understand that every phenomena, every event, has different aspects. Everything is of a relative nature.
    • You might reflect on the fact that when you are really angry at someone you tend to perceive them as having 100 percent negative qualities. The tendency to see someone as completely negative is due to your own perception based on your own mental projection, rather than the true nature of that individual.
    • The enemy is the necessary condition for practicing patience.
    • A balanced and skilful approach to life, taking care to avoid extremes, becomes a very important factor in conducting one’s everyday existence.
    • The vulnerability we experience in the midst of our suffering can open us and deepen our connection with others
    • We convert pain into suffering in the mind. It is our suffering that is the most basic element that we share with others, the factor that unifies us with all living creatures.


    • Learning and education are important because they help one develop conviction of the need to change and help increase one’s commitment. This conviction to change than develops into determination. Next, one transforms determination into action – the strong determination to change enables one to make a sustained effort to implement the actual changes. The final factor of effort is critical.
    • You have to be always aware of the destructive effects of the negative behaviour.
    • Genuine change does not happen overnight.
    • Numerous surveys have conclusively found that higher levels of education have a positive correlation with better health and a longer life, and even protect an individual from depression.
    • Through proper training we can gradually reduce our negative emotions and increase positive states of mind such as love, compassion, and forgiveness.
    • We need to actively cultivate the antidotes to hatred: patience and tolerance.
    • An end result, or a product of patience and tolerance, is forgiveness. When you are truly patient and tolerant, then forgiveness comes naturally.
    • Working on improving our physical health through proper diet and exercise can be useful to reduce anxiety and stress.
    • If the situation or problem is such that it can be remedied, then there is no need to worry about it. Alternatively, if there is no way out, no solution, no possibility of resolution, then there is also no point in being worried about it, because you can’t do anything about it anyway.
    • Sincere motivation acts as an antidote to reduce fear and anxiety.
    • A healthy sense of self-confidence is a critical factor in achieving our goals.
    • The more honest you are, the more self-confident you will be.
    • Love is a genuine wish for someone’s happiness.


    • In helping us understand the true meaning of spirituality is important to distinguish between spirituality and religion.
    • True spirituality is a mental attitude that you can practice at any time.
    • Independent researchers have found that religious people report feeling happy and satisfied with life more often than non-religious people.
    • It is important to respect the rights of others. We must to learn to respect all there major religion traditions.


I strongly recommend to read this book.

posted @ Sunday, June 6, 2010 4:13 PM | Feedback (1) | Filed Under [ BOOKS ]

Saturday, May 29, 2010

Adding libraries and headers in Visual C++ 2010

When you need to use a library in your C++ application you should tell the following things to the compiler:

  1. The name of the lib file
  2. The folder where to find the lib file
  3. The folder where to find the header file

In this post, I show how you can do this using Microsoft Visual Studio 2010. All the options are available as Properties of your current project.

Right click the project name under the Solution Explorer and select Properties from the dropdown menu:



You can add all the names of your libraries in the “Configuration Properties –> Linker –> Input“ section:



At the end, you can set the lib folders (“Library Directories”) and the headers folders (“Include Directories”) in the “Configuration Properties –> VC++ Directories” section.



posted @ Saturday, May 29, 2010 3:11 PM | Feedback (1) | Filed Under [ C++ ]

XNA – DirectX Capabilities Viewer

If you want to know the capabilities available in your graphics card you can use a tool in the DirectX SDK\Utilities\Bin\x86.

This tool is called “DXCapsViewer.exe”.

Here a screenshot with the capabilities of my NVIDIA GeForce 8600M GT:



You can download the latest DirectX SDK at the following link:

posted @ Saturday, May 29, 2010 2:33 AM | Feedback (1) | Filed Under [ XNA ]

XNA – Multisampling

Multisampling is an antialiasing technique directly supported by DirectX and obviously by XNA. The problem of aliasing occurs when you draw a line on a monitor with low resolution. In that cases you see a stair step when approximating a line by a matrix of pixels. Multisampling use neighbouring pixels (called samples) to calculate the final color of a pixel.

You can enable multisampling in XNA in this simple way:

graphics.PreferMultiSampling = true;

Then you should also specify two options.

The type is an enumerator (MultiSampleType) that represent the number of samples to use in multisampling. The quality is an integer that represent the quality level. This value is always set to zero. Before to set the type of multisampling you should always check if the graphic adapter support it using the method adapter.CheckDeviceMultiSampleType()

graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>((sender, e) => 
PresentationParameters parameters = e.GraphicsDeviceInformation.PresentationParameters;
parameters.MultiSampleQuality = 0;

#if XBOX
pp.MultiSampleType = MultiSampleType.FourSamples;

GraphicsAdapter adapter = e.GraphicsDeviceInformation.Adapter;
SurfaceFormat format = adapter.CurrentDisplayMode.Format;

if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format, false, MultiSampleType.FourSamples, out quality))
parameters.MultiSampleType = MultiSampleType.FourSamples;
else if (adapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format, false, MultiSampleType.TwoSamples, out quality))
parameters.MultiSampleType = MultiSampleType.TwoSamples;


For more information:

posted @ Saturday, May 29, 2010 2:00 AM | Feedback (2) | Filed Under [ XNA ]

XNA – Nuclex Framework

I would like to inform you that an interesting stable project is available on codeplex. This is the Nuclex Framework.

This is the main page of the project:

The more interesting features for me are the following:

posted @ Saturday, May 29, 2010 12:55 AM | Feedback (0) | Filed Under [ XNA ]

Friday, May 28, 2010

XNA – Analytical Geometry

Mathematics plays a fundamental role in video game development. I strongly recommend to study the basics of linear algebra to have a better control of what you create. However, in XNA there is a lot of support for analytical geometry. There are some complex algorithms already implemented so it’s extremely important to know what it is available.

You can manage positions, speeds and directions using the classes: Point, Vector2, Vector3 and Vector4.

Vector3 a = new Vector3(0, 0, 10);
float x = a.X;
float y = a.Y;
float z = a.Z;
float length = a.Length();
Vector3 b = Vector3.Right;
Vector3 c = a + b;
float distance = Vector3.Distance(a, b);
float dotProduct = Vector3.Dot(a, b);
Vector3 crossProduct = Vector3.Cross(a, b);
Vector3 trasform = Vector3.Transform(a, Matrix.CreateScale(5));

The most important class in XNA is the Matrix class:

Matrix identity = Matrix.Identity;

Vector3 cameraPosition = new Vector3(0, 0, 10);
Vector3 cameraTarget = Vector3.Zero;
Vector3 cameraUp = Vector3.Forward;
var viewMatrix = Matrix.CreateLookAt(cameraPosition, cameraTarget, cameraUp);

Matrix projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
GraphicsDevice.Viewport.Width / GraphicsDevice.Viewport.Height,
1, 100);

Matrix viewProjectionMatrix = viewMatrix * projectionMatrix;

var scale = Matrix.CreateScale(5);
var translation = Matrix.CreateTranslation(10, 20, 30);
var rotationX = Matrix.CreateRotationX(MathHelper.PiOver4);
var rotationY = Matrix.CreateRotationY(MathHelper.PiOver4);
var rotationZ = Matrix.CreateRotationZ(MathHelper.PiOver4);
var rotation = Matrix.CreateFromAxisAngle(new Vector3(1, 2, 3), MathHelper.PiOver4);

The Ray class represent a straight line. The Plane class represent a plane in the 3d world. Then there other important classes like Rectangle, BoundingBox, BoundingFrustum and BoundingSphere.

Rectangle rectangle1 = new Rectangle(0, 0, 10, 10);
Rectangle rectangle2 = new Rectangle(5, 5, 10, 10);
bool intersect = rectangle1.Intersects(rectangle2);
bool contains = rectangle1.Contains(new Point(10, 20));

Ray ray = new Ray(Vector3.Zero, Vector3.Forward);
Plane plane = new Plane(Vector3.Up, 10);
BoundingSphere sphere = new BoundingSphere(Vector3.One, 5);
BoundingBox box = new BoundingBox(Vector3.Zero, Vector3.One);

float? distance = ray.Intersects(plane);
PlaneIntersectionType pit = plane.Intersects(sphere);
ContainmentType ct = box.Contains(sphere);

BoundingFrustum frustum = new BoundingFrustum(ViewMatrix * ProjectionMatrix);
Vector3[] corners = frustum.GetCorners();
Plane nearPlane = frustum.Near;
Plane farPlane = frustum.Far;

With the class Curve is then possible to handle curves.

Finally, it is important to remember the class MathHelper that contains some useful methods

float max = MathHelper.Max(5, 10);
float min = MathHelper.Min(5, 10);
float piOver2 = MathHelper.PiOver2;
float degrees = MathHelper.ToDegrees(piOver2);
float radians = MathHelper.ToRadians(90);

posted @ Friday, May 28, 2010 11:21 PM | Feedback (1) | Filed Under [ XNA ]

Wednesday, May 26, 2010

XNA – Console Component

XNA is a fantastic technology and I want to learn it well.

If you don’t know nothing about 2D and 3D game development, I strongly recommend to buy the book “Learning XNA 3.0”. This is really easy to understand and it introduce to many concepts in a simple step by step approach. I read other three books about XNA but this is definitely the best as a starting point.

learning xna

I would like to share with you my demo programs, without the purpose to be exhaustive but just to share interesting stuffs that I can find during my learning process.

It is quite useful to have a way to print text on the screen for debugging help. For this reason I created the ConsoleComponent class.

Firstly, I’ll show you how to use the console class in the game:

public class MyGame : Game
GraphicsDeviceManager graphics;
ConsoleComponent console; public MyGame()
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";

protected override void Initialize()
console = new ConsoleComponent(this, 17, Color.Yellow);
} protected override void Update(GameTime gameTime)
console.Clear(); console.WriteLine("GraphicsDeviceManager.DefaultBackBufferHeight = " + GraphicsDeviceManager.DefaultBackBufferHeight);
console.WriteLine("GraphicsDeviceManager.DefaultBackBufferWidth = " + GraphicsDeviceManager.DefaultBackBufferWidth);

console.WriteLine(); console.WriteLine("ValidAdapterFormats: "); foreach (SurfaceFormat surfaceFormat in GraphicsDeviceManager.ValidAdapterFormats)
console.WriteLine(" - " + surfaceFormat);

console.WriteLine("ValidBackBufferFormats: ");
foreach (SurfaceFormat surfaceFormat in GraphicsDeviceManager.ValidBackBufferFormats)
console.WriteLine(" - " + surfaceFormat);

console.WriteLine("ValidDeviceTypes: ");
foreach (DeviceType deviceType in GraphicsDeviceManager.ValidDeviceTypes)
console.WriteLine(" - " + deviceType);


protected override void Draw(GameTime gameTime)


It is extremely simple to use. You create an instance of the ConsoleComponent class passing a reference to the game object, the interline and the text color. Then you can use the WriteLine() method to draw a text while with the Clear() method you can clear all the text.

This is the code of the component:

public class ConsoleComponent : DrawableGameComponent
private SpriteBatch spriteBatch;
private SpriteFont consoleFont;

private float interline;
private Color textColor;

private List<string> messages;

public ConsoleComponent(MyGame game, float interline, Color defaultTextColor) : base(game)
this.interline = interline;
this.textColor = defaultTextColor;

this.messages = new List<string>();

spriteBatch = new SpriteBatch(game.GraphicsDevice);
consoleFont = game.Content.Load<SpriteFont>("consoleFont");

public void Clear()

public void WriteLine()

public void WriteLine(string text)

public override void Draw(GameTime gameTime)


float y = interline;
foreach (string text in messages)
spriteBatch.DrawString(consoleFont, text, new Vector2(interline, y), textColor);
y += interline;


In this simple example you can see how it is easier to draw 2D strings using XNA.

This is a screenshot of the application:


The complete Visual Studio 2008 project is available to the following link:

posted @ Wednesday, May 26, 2010 11:30 PM | Feedback (2) | Filed Under [ XNA ]

My First English Blog

Hello everybody,
this is my first post in my new English blog.

I decided to create an English blog for few simple reasons (in order of importance):

  1. Learning English
  2. Increase the audience of my posts

I would like to use this blog to share, with the international community, my efforts in learning new technologies but not only this. I would like also talk about my personal experiences and interests.

I’m sorry if my English will not be perfect. Please, tell me if I make some terrible mistakes.

See you soon,


posted @ Wednesday, May 26, 2010 10:27 PM | Feedback (3) |

Powered by:
Powered By Subtext Powered By ASP.NET