Spegni il computer e vai a dormire.
Vario
Della morte delle more
gen 8
Il titolo, ovviamente, non ha alcun significato.
Questo è perfettamente in linea con il senso e il gusto artistico di colui che imbratta di inchiostro informatico queste pagine. Come al solito è da un po’ di tempo che sto lasciando completamente sguarnito il mio blog. Mancano ancora i miei vecchi post, manca la mia vecchia guida a LaTeX, e manca soprattutto qualcuno che segua queste pagine e faccia di questo blog qualcosa di decente. Nulla di tutto ciò, almeno per ora.
Mi piace dire che la colpa di tutto questo è il mio lavoro, che mi sta assorbendo come non mai. Ormai sto abbandonando la strada del buon vecchio Ruby On Rails, per mancanza di ispirazione e di progetti su cui lavorare. Per adesso sto seguendo con Alessandro un bel progettone, su un CMS interamente scritto in PHP, e la cosa mi aggrada molto. 5 giorni di full immersion nella programmazione in PHP+ MySQL mi hanno riportato alla mente i giorni del Collegio. Gran bella cosa. Forse è questa la strada che dovrei seguire, ma molto probabilmente è una strada che non paga. Almeno per adesso…
Inizio con il rinnovare il tema del blog. Stasera inizierò a lavorare al porting dei vecchi post. Chissà che non riesca a ricavarne qualcosa di buono?
Benvenuti
ago 15
Ciao a tutti, e ben ritrovati.
Questo sarà da oggi il mio nuovo blog. Considerando che il vecchio non lo aggiorno più da parecchio tempo, che ha qualche piccola falla qua e là e che non sono più in grado di starci dietro molto, ho preferito scegliere una soluzione “di comodo” vendendomi al famosissimo Wordpress.
Pro e contro:
- Grafica migliorata, supportata da tutti i più comuni browser
- Sistema di gestione dei contenuti grandioso e possibilità di espandere il sito con grande libertà
- Purtroppo tutti i vecchi post vengono persi …
- … e con questi tutti i vecchi account!
Tutto è ancora da fare e da sistemare. Tanto per cominiciare la grafica … il sito per come è adesso, fa un po’ cagare. Ho cercato di trovare il miglior tema che mi piacesse, in fretta e furia. Però mi aspetto da voi commenti e suggerimenti in merito. Ammesso che vogliate darmene, ovviamente.
Prossimo step: includere qualche plugin simpatico per ricreare la mia galleria fotografica qui sul sito (sperando di tornare ad ignorare finalmente Facebook) …
Tutto sta finendo …
giu 23
… ma è per colpa di CheBanca! …
Come avete potuto vedere, infatti, questo blog un po’ alla volta è morto. Il fatto è che di tempo per aggiornarlo, riempirlo, sistemarlo, etc, non ne ho. Specie adesso che, lavorando in CheBanca! non riesco più ad accedere al mio sito nemmeno al lavoro. (Chissà come sono stati configurati il firewall e i server DNS della banca …)
Avevo in mente un progetto di riscrittura completa del blog in Rails. Morto.
Avevo in mente un progetto di ribaltare tutto il blog in una personalizzazione di Wordpress. Morto.
Insomma, qui non c’è più vita. Forse andremo avanti a spizzichi e bocconi, forse no. Non so davvero dirvi cosa sarà di queste pagine. Per il momento sto disperatamente cercando casa (e disperatamente lavorando). Tutto il resto conta poco …
jQuery Form Validator plugin
gen 18
Update
Latest update to v. 1.1 to enhance compatibility with the newest jQuery v. 1.3.1.
Overview
The jQuery Form Validator plugin allows to define simple, yet powerful, validators for web pages forms. It’s simple and configurable, and allows the definition of basic validations (required fields, numeric fields, integer fields, email fields) and also of regex over the fields in the forms.
Download
You can now download v. 1.1 of the jQuery Form Validator plugin.
Demo
On this web site you can find a working demo of the plugin.
Requirements
This plugin requires jQuery to be used in the web page. It has been tested with jQuery v. 1.2.6 and v. 1.3.1, but should correctly work with jQuery v. 1.2.x/1.3.1+.
Compatibility
The plugin has been tested on Windows XP, Windows Vista, Ubuntu (7.04, 7.10, 8.04 and 8.10) and Mac OS X 10.5 and is fully supported (at least) on the following browsers:
- IE 8 beta, 7 & 6
- Firefox 2.0+ and 3.0+
- Opera 9 and 9.5+
- Safari 3+
- Google Chrome
Usage
The usage of the Form Validator is really simple. Example following:
var formValidator = new ValidatorClass();
formValidator.init({
form: "#myFormID",
isRequired: ['login', 'password'],
bindElement: '#button',
callback: function() {
alert('Ok!');
}
});
What it does
The method init() in the ValidatorClass instance enables the validator on the form with id=”myFormID“. Two text fields are required (those whose names are login and password).
The validator binds the object with id=”button” to the ‘click’ event: when it’s clicked, the validator runs the validation over the form. If the validation is successful, the callback function is called, otherwise an alert will popup telling which fields are wrong; those fields will also be coloured using a particular convention (red=required, green=numeric, blue=integer, yellow=email, lightgray=regex).
Complete example
The complete example for the script is:
var formValidator = new ValidatorClass();
formValidator.init({
form: '#example',
errorColors: {
isRequired: 'red',
isEmail: 'yellow',
isNumeric: 'green',
isInteger: 'blue',
hasRegex: 'lightgray'
},
isRequired: ['name','email','number', 'date@select',
'street@select', 'description@textarea'],
isEmail: ['email'],
isNumeric: ['number'],
isInteger: ['integer'],
hasRegex: [
['field1', /d./, 'Error message'],
['field2@textarea', /s{5}(d{5}s{5}){1,10}$/, 'Another error']
],
allowNullNumbers: true,
requiredFieldMsg: 'I campi in rosso sono obbligatori',
emailFieldMsg: 'I campi in giallo devono essere email',
numericFieldMsg: 'I campi in verde devono contenere numeri',
integerFieldMsg: 'I campi in blu devono contenere valori interi',
bindElement: ['#button1', '#button2'],
bindEvent: 'click',
callback: [callBack1, callBack2],
});
function callBack1() {
// Do something ...
}
function callBack2() {
// Do something different ...
}
Please note the definition of the required fields: for the five validation types it is possible to define an array of the field to control. Each item can be expressed in two forms:
- ‘fieldName‘, which is equivalent to the CSS selector: input[name=fieldName]
- ‘fieldName@domType‘, which is equivalent to the CSS selector: domType[name=fieldName] (es. domType = textarea)
Parameters
This is the explanation for every single parameter passed to the method. The default values are expressed in the square brackets next to the name:
- form: the id of the form that will have the validation enabled
- errorColor: a hash variable containing these colors for the wrong fields (colors applied to the fields after the validation):
- isRequired['#FDD']: the CSS color that the field will have if it’s required and not filled
- isEmail['#FFA']: the CSS color that the field will have if it has an incorrect email
- isNumeric['#DFD']: the CSS color that the field will have if it’s not a number
- isInteger['#CCE']: the CSS color that the field will have if it’s not an integer number
- hasRegex['#CCC']: the CSS color that the field will have if it’s not compatible with the regex
- isRequired: an array with the names of the fields that are required
- isEmail: an array with the names of the fields that must be valid emails
- isNumeric: an array with the names of the fields that must be numeric
- isInteger: an array with the names of the fields that must have integer values
- hasRegex: an array of arrays defining the regexes. Each inner array is in the form ['fieldName', /regex/, 'Error message']
- allowNullNumbers[false]: if it is set to ‘true’ it allows numeric and integer field to have no values without being considered wrong
- font-weight: bold;”>requiredFieldMsg['Red fields are required']: the alert message for required fields
- emailFieldMsg['Yellow fields must contain valid emails']: the alert message for the email fields
- numericFieldMsg['Green fields must contain numbers']: the alert message for the numeric fields
- integerFieldMsg['Blue fields must contain integer values']: the alert message for the integer fields
- bindElement: an array of the id’s of the objects to which the validator will be bound
- bindEvent['click']: the event for which the validator will be bound to the previous elements
- callback: an array of the functions to be called if the validation is successful. Each callback function is related to a single element: i.e. callBack1 is the callback function for ‘#button1′, etc.
API
- init(): initializes the validator (read above for the parameters to be passed)
- reset(): without any parameter, disables the validator
Terms of use
The jQuery Form Validator plugin is licensed under a Creative Commons License and is copyrighted (C)2008-2010 by Daniele Di Bernardo.
The license page can be found at: http://creativecommons.org/licenses/by-nc-sa/2.5/it/
Trasloco!
dic 9
Scusate la mia assenza per così lungo tempo. Ma voi avete idea di quanto sia difficile un trasloco??? Ho dovuto spostare tutto il sito, database e foto comprese, dal server di Arezzo al mio nuovo serverino virtuale a Monaco. Ma avete idea di quanti chilometri sono??? E avete mai provato a traslocare??? No, lo so … quindi non lamentatevi se vi lascio sempre soli soletti.
Detto questo, il sito attuale sta ormai tirando le cuoia, si in quanto a performance, sia in quanto a contenuti. E allora che faccio io? Inizio subito a testarne un altro! Per ora ho messo su una bozza molto semplice, che potete trovare su queste pagine. Chiaramente potete entrarci tutti e farne quello che volete. All’occorrenza vi lascio anche, su richiesta, l’accesso come amministratori. Mi piacerebbe sapere cosa ne pensate. Per ora c’è molto poco, ma spero di riuscire a farne venir fuori qualcosa di bello.
Ora vado a riposare perché col trasloco m’è venuto un bel mal di schiena …












Ultimi commenti