Flickr logo
More of Luca Mauri's photos
blank

Section's icon Code
SnipNETs
My personal Snippets

Snippet are small fragments of code that can easily created, saved and shared across programmers communities.
This technology has been presented with Visual Studio IDE and it now a widespread way to exchange code among .NET programmers.
Code snippets are embedded in .snippet file, that are plain XML file containing the code along with other useful information regarding the code itself.
In this part of the site you can find a few snippet file created by me, for every snippet you can find a short description on this page and you can directly download the file from here, alternatively you can also go to a page where the code is explained step by step.
You are welcome to send me your comment on these code fragments at snippet@lucamauri.net email address.

Separatore
domenica 08 giugno 2008, 18:39

Il CIN (Control Internal Number) è un tipo di check digit che viene usato dalle banche italiane fin dagli anni '90. E' ancora molto utile in quanto deve essere incorporato nel codice IBAN che da metà del 2008 è sostanzialmente indispensabile per le transazioni monetarie elettroniche.
Pare che su internet ci siano pochissime fonti che spieghino come calcolarlo, l'algoritmo che segue si basa su una spiegazione del modulo Contabilità delle ACG di IBM.
L'ho provato su diversi numeri di C/C e funziona regolarmente.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

domenica 02 marzo 2008, 22:38

First of all I must tell the story of this class.
In first place this is derived in first place from original RSA algorythm, then this class has been implemented by Norbert Hranitzky in Java. This Java class was used by Oren Novotny as base for his excellent C# implementation, finally this class has been translated in VB.net by someone called Bismark Prods in a post at http://www.derkeiler.com/Newsgroups/microsoft.public.dotnet.security/2004-08/0004.html.
This last class was not working and I extensively modified it to make it running right. So, while I have to give credit to others for their job, I am pleased to say that this piece of code is (apparently) the only working VB.net implementation of a MD4 class.

The code is commented so anyone can figure out how the class works. For the people interested in knowing the mathematics behind the algorithm, I suggest the reqading of the original RFC 1320.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

domenica 11 novembre 2007, 17:23

In the following code you can see how to make a conditional download of images.
Let's assume you have a list of image files in a table (from a database, for instance, but any other source will do as well) and the folder on the remote website where the images are.

Those data are set in the very beginning of the file, the only external object you have to instantiate before calling this function is the dataset called dsImgs. Once done, the function will look for all the images in the location and will check if the image already exist on the disk. If this is the case, a check is done on the Last-Modified date and the file is downloaded if the current version is older only.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

martedì 27 marzo 2007, 22:22

Wake-On-LAN (WOL) is a feature of the network interface cards since the late '90s
This functionality was initially conceived by IBM and the widely supported by Intel with NIC's and motherboard's chipset

WOL simply works by broadcasting a so called Magic Packet on the LAN where the device you want to wake-up is on. The Magic Packet is made by a leading HEX string followed by 16 repetition of the target MAC Address.
For the following class to works you must simply create an instance, provide the MAC Address and call the method WakeIt.
The class also includes Intellisense description.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

venerdì 02 marzo 2007, 09:22

I created this class to help me made the Tag Cloud system for this site. It is a simple class to calculate the arithmetic Mean and the Standard Deviation.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

domenica 31 dicembre 2006, 22:55

This simple class help you to programmatically access IP ranges information from WHOIS database. The enumerator in the class already contains the addresses of the three registrars that amanges IP addresses in the World.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

domenica 10 dicembre 2006, 15:13

A collection of three simple class that allow you to read files from disk and from internet and write a strem back to a file.
It is a simple task for a programmaer, but it may comes in hand from time to time to have it ready-to-use.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

sabato 09 dicembre 2006, 17:13

Using Regular Expression functions, this class allow you to scan a bunch of text (for esample and HTML page) to extract all the links in ED2K format.
The Collection is exposed by the class.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

venerdì 08 dicembre 2006, 15:58

This class show you how to import and process an ED2K link.
ED2K link are links to files in the eDonkey 2000 network, now used both by original vclient and the popular eMule clients.
Every istance of this class represent a single ED2K link that is automatically split into pieces and separated in the proper properties of the class.
From there it is easy to use every single part of the link for your own purpose.

Snippet Icon Download Snippet file
Details page Icon Read the code and details

Gear B/N Risultato del processo OK

blank

Ajax-enabled news - Beta

Ajax News temporaneamente sospese in attesa della nuova versione.

Tag Cloud - Beta

AddThis Bookmark

Il pulsante di AddThis permette di aggiungere un segnalibro per questa pagina nei più diffusi siti internet.

Licenza

Creative Commons License
Il contenuto di questo sito internet, se non diversamente specificato, è pubblicato sotto una Licenza Creative Commons.

The content of this website is published under a Creative Commons License, unless otherwise stated.

RSS IconSoftware News

RSSLatest Blog

Licenza

Creative Commons License
I testi e le immagini di questo sito sono pubblicati sotto una Licenza Creative Commons.

Site Meter

ClustrMaps

Locations of visitors to this page

Elenco Feed

Questo file OPML contiene l'elenco aggiornato di tutti i feed RSS disponibili sul sito.

OPML rect

amung.us

hit counter

Random Quote

«I am the beginning. The end. The one who is many. I am the Borg.»

The Borg Queen
"First Contact"

Leggi tutte le citazioni

Random Fact

Il satellite artificiale Wilkinson Microwave Anisotropy Probe ha contribuito in maniera sostanziale alla risoluzione di molti problema della cosmologia moderna.
Di seguito riporto una breve panoramica delle caratteristiche dell'universo che sono state definite grazie alle sue scoperte:

  • L'età dell'universo è 13,7 miliardi di anni, con una tolleranza ±0,2
  • L'universo è composto da
    • 4% di materia barionica (ordinaria)
    • 22% di un tipo ancora sconosciuto di Materia Oscura che non emette o assorbe luce
    • 74% di una Energia Oscura del tutto sconosciuta che agisce accelerando l'espansione
  • La costante di Hubble vale 70 (km/s)/Mpc, con tolleranza +2,4/-3,2
  • La geometria dell'Universo appare piatta con Ω=1,02 e tolleranza ±0,2
  • La teoria dell'inflazione nella sua versione basilare è confermata dalle osservazioni

Il WMAP è probabilmente il singolo strumento più proficuo che sia mai stato al servizio della Cosmologia.

Kaku (2005)

Leggi tutte le curiosità

aNobii Books

Sorting Hat

i'm in ravenclaw!
be sorted @ nimbo.net

LM CubeCopyright © 2000 - 2013 Luca Mauri. All rights reserved
Note sui contenuti del sito.


Generated by Luca Mauri's xCMS xCMS | ASP.net 2.0 powered Powered by ASP.net 4.0.30319.296

Technology Blogs - BlogCatalog Blog Directory


Standard compliant: Valid Sitemaps | W3C CSS Valid | W3C XHTML Valid | RSS 2.0 Valid | OPML checked by validator.opml.org. | AJAX Powered


This page is generated by Luca Mauri Luca Mauri's xCMS
eXperimental Content Management System version
Current date and time on server Thu, 23 May 2013 14:04:38 GMT
Took 0,0793913 seconds to be created