Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts

Friday, May 11, 2012

Videogiocare nell'universo FLOSS - i migliori videogame free e open source - le slide..


Sono online le slide del mio intervento all'IPSIA FLOSS 2011, dal titolo "Videogiocare nell'universo FLOSS".
Con l'occasione mi è stato fatto onore di una maglietta con su scritto "I videogiochi mi hanno rovinato la vita: per fortuna ne avevo altre 2", con questa immagine stampata sopra:

Gli argomenti trattati sono ovviamente i videogiochi, e cosa offre il mondo open source, e in particolare i sistemi GNU/Linux, oggi.

Buona visione =)

Wednesday, January 18, 2012

Antivirus real time gratis per Windows: ClamWin + ClamSentinel

L'utilizzo dell'antivirus in questi ultimi anni è diventato uno strumento obbligatorio, sopratutto in ambiente Windows.
Perché spendere dei soldi per acquistare un antivirus quando sulla rete possiamo trovare dei software interamente gratis e di buona qualità!? La soluzione che andiamo a descrivere è l'unione di due programmi open source: ClamWin e ClamSentinel. Questi due programmi sono progetti di software libero ed entrambi fanno capo al progetto Clam AntiVirus.

- ClamWin fornisce un'interfaccia grafica per il motore antivirus ClamAV ma non supporta la scansione del sistema in tempo reale. Per colmare questa lacuna andremo ad utilizzare un altro software.
Disponibile al seguente link: http://sourceforge.net/projects/clamwin/

- ClamSentinel è un programma che monitora costantemente ogni modifica ai propri file e ne controlla il contenuto alla ricerca di virus usando ClamWin.
Disponibile al seguente link: http://sourceforge.net/projects/clamsentinel/

Qualcuno potrebbe obiettare che esistano già antivirus commerciali in versione gratuita.
Sì è vero, ma Clam Antivirus non è una seconda scelta né tanto meno una versione ridotta: è il miglior software disponibile in maniera totalmente libera, gratuita e senza pubblicità.

Friday, December 16, 2011

.NET CSV open source read write library

Yesterday I was in the need of write a lot of data exports in CSV (comma separated values) format.
To write a CSV-writer by my self should not be a big deal, but, you know, to write, to test, to fix (and go on) a common problem, that for sure has been solved, is not too wise.
So I googled a bit and finally find a very good CSV library, CvsHelper, hosted on GitHub and written by Josh Close in C#.
CvsHelper is very well written, it have a NUnit test project and have a lot of features.
One of them I like a lot, is the possibility to write a CsvClassMap for your business class, with your map logic, in a way very similar to the ClassMap of FluentNHibernate or the loquacius mapping by code of NHibernate 3.2.
Here an example:

  public sealed class MyClassMap : CsvClassMap<MyClass>
  {
     public MyClassMap()
     {
        int i = -1;
        Map(a => a.Id).Index(++i).Name("Id");
        Map(a => a.MyProperty).Index(++i).Name("My Prop in CSV");
        Map(a => a.MyProperty2).Index(++i).Name("My Property 2");
     }
  }

There is also a way to do a map with attributes, but to be honest, I don't like it (I prefer to have classes more decoupled possible).

Another feature is the possibility to define and use a custom TypeConverter (example in the source file linked below).

Of course you can write any sort of custom csv file you like, the library will take care about the correct csv format.

Here there is an example with many possibility usage.

Happy coding! :-)

Monday, December 5, 2011

NullReferenceException on CompileMappingForAllExplicitlyAddedEntities ModelMapper for NHibernate 3.2

If you're using NHibernate 3.2, and when call the CompileMappingForAllExplicitlyAddedEntities() method of your ModelMapper object, you have to check none of your added classes are defined without a namespace.
This could happen if you are added all types defined in your assemblies (calling for example mapper.AddMappings(Assembly.GetExecutingAssembly().GetExportedTypes() ), and at least one of your classes is compiled in the empty namespace ...
To solve this error, you have to define these classes in a namespace (it is always a good practice).

The error is caused by the NHibernate source code, because doesn't take care about empty namespaces.

The thread about that problem on nhuser google group.

Happy debugging ^^

Wednesday, November 30, 2011

MVC Asp.Net controllers on multiple assemblies

Today I wrote some sort of "plug-in" for an ASP.NET MVC web application.
It was simply a controller with few action methods.
I really like the idea of separate the controller on a new assembly because it was some sort of "one-shot-use" controller, and soon will death.

But an unexpected problem pop-up at runtime: the MVC controller factory was unable to create the controller: "The IControllerFactory 'MyControllerFactory'did not return a controller for the name 'MyController'".
Looking on the web I wont be able to find any solution for my case.

Finally I dig deep into the MVC source (Asp.NET MVC is realesed as open-source) and I finally find the trick. When started, the controller factory, scan all classes seeking for controllers on all *loaded* assemblies: so to make it works, you have to load the assembly before the controller factory starts the scan.
You can do it as you like: my solution was to use a module that dynamically load ninject kernel modules.

Don't forget to write the right name for the controller: it must end with "Controller" ;-) .

Happy coding ^^

Tuesday, November 22, 2011

Giornata Open Source Scuola Media Bernardino Di Betto‎ di Perugia

Segnalo questo evento aperto a tutti riguardante il progetto di adozione di sistemi GNU/Linux da parte di una scuola media Bernardino Di Betto‎ di Perugia.
Link dell'evento sul sito del GNU Linux User Group di Perugia.