RSS

Festa di Primavera 2013

Mancano una decina di giorni alla 22° edizione della tradizionale Festa di Primavera di Campalto ed in molti premono perchè quest’anno sia un evento memorabile.

locandina festa primavera 2013 - small

La grossa novità di quest’anno è il “Giro del mondo in tanti piatti”, cioè una rassegna gastronomica-culturale che vuole riunire le realtà di tanta gente che proviene da luoghi più o meno lontani da qui.
E’ davvero importante confrontarsi con culture diverse dalle nostre: noi abbiamo moltissimo da offrire a chi arriva, ma anche altrettanto da imparare da questi ospiti.

DSC_2690

Poco importa se le parole di lingue diverse non sono facili da capire: usiamo quindi il linguaggio del cibo quale simbolico mezzo per condividere le realtà di tutti i giorni.
Accorrete numerosi!

 
Leave a comment

Posted by on May 1, 2013 in Campalto, Food, Music

 

Tags: , ,

Radio Dromo filed for Sziget Festival 2013

The Venezia’s rock band Radio Dromo is filed for the incoming Sziget Festival 2013, that will be held in the Obudai-island, Budapest, Hungary.


So, please, join me in the support of this great band: the Sziget Festival is a “can’t miss” opportunity!

Bio

Radio Dromo rock band formed in 2010 collecting victories in music contests (Musiche Mestre Growing, Frre Young Music Festival, San Benedetto Rock, Music Village), taking part in some radio sessions (Radio Sherwood, Radio Salzano, Radio Vanessa, Radio Padova), receiving invitations to festivals and events (Venice Marathon, CorriMestre, Art don’t stop, Rock Solidale, Campalto Rock Festival, Wild Festival, First of all Festival).
During 2012 Summer there were some changes in the band adding Giuliano Rinaldo (drums) and Jacopo Facchinetto (keyboards) to the founders Fabio Tantaro (voice, guitar), Giacomo Bertoldi (bass) and Omawumi Fischer (guitar).
“New” Dromo started to work to the first self-made album, out in December 2012.
Their original and unpublished compositions are affected by influences ranging from rock to funk, from blues to progressive. The atmosphere is typical of the 70s with psychedelic movement, an obsessive attention to sounds and effects that makes them feel at ease even in a more 80s, remaining equally strong and compact and sometimes self-mocking live with typical performance 90 groups.
In their repertoire there is room and respect for popular songs, always twist “dromica.”

The Radio Dromo gang

The Radio Dromo gang

 
Leave a comment

Posted by on April 9, 2013 in Music, Radio-Dromo

 

Tags: , , ,

Microsoft TechDays 2013 Paris: une grand merci!

The greatest Microsoft event of Europe has just been closed in Paris, France.
I am soooo honored to have been mentioned in the “Geek in da House” session of Laurent Ellerbach.

Image00001

He presented two very interesting projects, both of them involving Netduino and a little hardware around.
In the first part of his session, Laurent presents his remotely controlled gardening sprinkler system. Afterward, his Netduino is used in a totally different way: as transmitter for IR commands against a Lego train. My help was just on the latter project.
Here is the link of the video (French speaking).
Have fun!

 
Leave a comment

Posted by on February 17, 2013 in .Net, Electronics, Software

 

Tags: , , , , ,

A playable Invaders-like game with a Netduino Plus 2

Finally here is my last article of the series about the GDI library for Netduino and how to use it.
The post guides you on how to create your own game, such an Invaders-like playable game.

WP_000337

WP_000321
Enjoy!

 
Leave a comment

Posted by on February 17, 2013 in .Net, Electronics, Software

 

Tags: , , , , , , ,

The GDI library for Netduino targets a LCD module

This time the article will show you how to use the GDI library for Netduino for driving a very common LCD character module.

Enjoy!

 
Leave a comment

Posted by on February 16, 2013 in .Net, Electronics, Software

 

Tags: , , , , , , ,

Animation with the GDI library for Netduino

This is my third article about the GDI library for Netduino.
This time the discussion is on how to create a simple animation for the Sure Electronics led-matrix.
Enjoy!

 
Leave a comment

Posted by on February 14, 2013 in .Net, Electronics, Software

 

Tags: , , , , , , ,

“Char” oddity (in .Net Framework)

David Bowie (1969 album)

On the wave of the unforgettable song of David Bowie, here is a short post about the “oddities” around the Char type, in the .Net Framework.

The problem.

Today I bumped against a strange effect.
At first glance I thought to a bug or something like that, since I saw this effect on the Micro Framework. By the way, the little nephew of the ordinary desktop is working fine, because the same problem happens on any .Net application. Thinking better on the “problem”, well…yeah, it’s not a problem!
Yes, it’s not a bug, but can lead easily to subtle side-effects, mistakes, etc. I hate them, because they lead to a long waste of time, and I don’t have, usually.
So, what?
Open your favorite Visual Studio IDE, then create a simple console application. Afterward, copy-and-paste the following code:

    class Program
    {

        static void Main(string[] args)
        {
            Print(
                'H' + "ello!"
                );

            Console.WriteLine();
            Console.Write("Press any key...");
            Console.ReadKey();
        }


        static void Print(string s)
        {
            Console.WriteLine(s);
        }

    }

What do you expect to see in the output window as the “Print” function does?
No doubt:

Hello!

Now, add a piece more to the code.

    class Program
    {

        static void Main(string[] args)
        {
            Print(
                'H' + "ello!"
                );

            Print(
                'H' + 'H' + "ello!"
                );

            Console.WriteLine();
            Console.Write("Press any key...");
            Console.ReadKey();
        }


        static void Print(string s)
        {
            Console.WriteLine(s);
        }

    }

At this point what should be the resulting output?

image1
Hmm…that’s really strange!

Let’s add another piece.

    class Program
    {

        static void Main(string[] args)
        {
            Print(
                'H' + "ello!"
                );

            Print(
                'H' + 'H' + "ello!"
                );

            Print(
                'H' + ('H' + "ello!")
                );

            Console.WriteLine();
            Console.Write("Press any key...");
            Console.ReadKey();
        }


        static void Print(string s)
        {
            Console.WriteLine(s);
        }

    }

The result begins to give us an hint.

image2
Let’s go further…

    class Program
    {

        static void Main(string[] args)
        {
            Console.WriteLine("Leading...");
            Print(
                'H' + "ello!"
                );

            Print(
                'H' + 'H' + "ello!"
                );

            Print(
                'H' + ('H' + "ello!")
                );


            Console.WriteLine();
            Console.WriteLine("Trailing...");
            Print(
                "Hello" + '!'
                );

            Print(
                "Hello" + '!' + '!'
                );

            Console.WriteLine();
            Console.Write("Press any key...");
            Console.ReadKey();
        }


        static void Print(string s)
        {
            Console.WriteLine(s);
        }

    }

Aw!…now the “trailing” section seems working fine even without parenthesis…

image3

The reason behind the “oddity”.

The above behavior is due to the implicit cast conversion of a Char to an Int32: this cast conversion is performed even at compile time whenever possible.
Let’s check the IL code of the beginning of the program.

        ...
	IL_000c: ldc.i4.s 72
	IL_000e: box [mscorlib]System.Char
	IL_0013: ldstr "ello!"
	IL_0018: call string [mscorlib]System.String::Concat(object, object)
	IL_001d: call void ConsoleApplication1.Program::Print(string)

	IL_0022: nop
	IL_0023: ldc.i4 144                  //<--the compiler calculated the "sum" of the chars
	IL_0028: box [mscorlib]System.Int32  //and recognize it as an Int32
	IL_002d: ldstr "ello!"
	IL_0032: call string [mscorlib]System.String::Concat(object, object)
	IL_0037: call void ConsoleApplication1.Program::Print(string)

	IL_003c: nop
	IL_003d: ldc.i4.s 72
	IL_003f: box [mscorlib]System.Char
	IL_0044: ldc.i4.s 72
	IL_0046: box [mscorlib]System.Char
	IL_004b: ldstr "ello!"
	IL_0050: call string [mscorlib]System.String::Concat(object, object, object)
	IL_0055: call void ConsoleApplication1.Program::Print(string)
	...

This designers’ choice to cast convert implicitly also leads to some curious issues:

    class Program
    {

        static void Main(string[] args)
        {
            //you may "sum" to chars together
            Console.WriteLine();
            int x = 'A' + 'B';
            Console.WriteLine(x);   //yields 131


            //explicit cast to int 
            Console.WriteLine();
            object o = 'Q';
            int q = (int)o; //invalid cast exception


            //sum over a string using Linq
            var t = "Hello world!";

            int u1 = t.Sum(_ => _);
            Console.WriteLine(u1);  //yields 1117

            int u2 = t.Cast<int>().Sum(_ => _);  //invalid cast exception

            Console.WriteLine();
            Console.Write("Press any key...");
            Console.ReadKey();
        }


        static void Print(string s)
        {
            Console.WriteLine(s);
        }

    }

UPDATE: I posted the question on StackOverflow, but -at the moment- none gave a decent answer. Even the fully respectable guess of Eric Lippert leave me unsatisfied, believing much more a “kind of gift” for the C/C++ users, other than an useful rule for a safer programming.
In short, I still believe that was a bad decision.

Be careful!

 
Leave a comment

Posted by on February 10, 2013 in .Net, Software

 

Tags: ,

 
Follow

Get every new post delivered to your Inbox.

Join 53 other followers