Tuesday, 12 May 2015

Simplify and Shrink

The following scripts sets the non system databases to simple recovery model, and shrinks the related log files:

EXEC sp_MSforeachdb N'IF DatabasePropertyEx(''?'', ''Recovery'')=''FULL''
    and   DatabasePropertyEx(''?'', ''Status'')=''ONLINE''
    and ''?'' not in (''tempdb'') and ''?'' not in (''master'') and ''?'' not in (''model'') and ''?'' not in (''msdb'')
  exec ('' print char(13) + char(10) + ''''Set recovery model to simple for '''' + ''''?'''';
 alter database [?] set recovery simple with NO_WAIT;'')

EXEC sp_MSforeachdb 
N'IF DatabasePropertyEx(''?'', ''Status'')=''ONLINE''
    and ''?'' not in (''tempdb'') and ''?'' not in (''master'') and ''?'' not in (''model'') and ''?'' not in (''msdb'')
 exec ('' use [?];
 declare @logFile varchar(128);
 select @logFile= mf.name from sys.master_files mf inner join sys.databases db on mf.database_id = db.database_id where type=1 and db.name = ''''?'''';
 print char(13) + char(10) + ''''Shrink ''''+ @logFile + '''' log file of ?'''';
 dbcc shrinkfile (@logFile , 0)

Caveat: generally, don't use the above or similar scripts in Production, as long as you don't understand and accept the consequences. The Simple recovery model is usually fine in Test or Development environments, but again, it may not be appropriate in many scenarios.

Caveat: always read the message log.

Caveat: the second script assumption is that there is no more than 1 log file per database. If there are multiple log files per database, it would be more sensible to look at a solution which doesn't use sp_MSforeachdb.

Caveat: sp_MSforeachdb is undocumented, and AFAIK unsupported.

Caveat: the code above is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. in no event shall the author be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the code above.

Friday, 9 January 2015

PIL pro capite Regionale Italiano vs British Regional per capita GDP

Per capita GDP comparison among british and italian regions (the percent column uses as index the GDP of Lombardia).

Regioni britanniche ed italiane a confronto per PIL pro capite (la colonna percentuale usa come indice il PIL della Lombardia).

Region | Regione GDP|PIL           %
UK Inner London 86,000 254%
UK North Eastern Scotland 42,700 126%
UK Berkshire, Buckinghamshire and Oxfordshire 38,400 113%
IT Provincia Autonoma di Bolzano/Bozen 37,700 111%
IT Lombardia 33,900 100%
IT Valle d'Aosta/Vallée d'Aoste 33,700 99%
IT Emilia-Romagna 32,100 95%
UK Cheshire 31,700 94%
IT Provincia Autonoma di Trento 31,200 92%
IT Veneto 30,200 89%
IT Lazio 29,900 88%
IT Friuli-Venezia Giulia 29,600 87%
UK Gloucestershire, Wiltshire and Bristol/Bath area 29,400 87%
UK Bedfordshire and Hertfordshire 28,700 85%
UK Surrey, East and West Sussex 28,700 85%
IT Piemonte 28,200 83%
IT Toscana 28,200 83%
UK Hampshire and Isle of Wight 27,400 81%
IT Liguria 27,200 80%
UK Eastern Scotland 26,200 77%
IT Marche 26,100 77%
UK East Anglia 25,200 74%
UK West Yorkshire 25,000 74%
UK Leicestershire, Rutland and Northamptonshire 24,800 73%
UK East Wales 24,500 72%
UK Greater Manchester 24,200 71%
UK Outer London 24,100 71%
UK North Yorkshire 24,000 71%
UK Herefordshire, Worcestershire and Warwickshire 24,000 71%
UK South Western Scotland 23,800 70%
IT Umbria 23,700 70%
UK West Midlands 23,300 69%
UK Essex 23,000 68%
UK Derbyshire and Nottinghamshire 22,700 67%
UK Kent 22,700 67%
UK Dorset and Somerset 22,500 66%
IT Abruzzo 22,400 66%
UK Cumbria 22,300 66%
UK Northumberland and Tyne and Wear 22,200 65%
UK Merseyside 21,600 64%
UK Devon 21,600 64%
UK East Yorkshire and Northern Lincolnshire 21,500 63%
UK Highlands and Islands 21,500 63%
UK Lancashire 21,000 62%
UK Northern Ireland 21,000 62%
UK Shropshire and Staffordshire 20,700 61%
IT Molise 20,100 59%
UK South Yorkshire 20,000 59%
UK Lincolnshire 19,800 58%
IT Sardegna 19,700 58%
UK Tees Valley and Durham 19,100 56%
IT Basilicata 18,300 54%
UK Cornwall and Isles of Scilly 17,300 51%
UK West Wales and The Valleys 17,200 51%
IT Puglia 17,100 50%
IT Sicilia 16,600 49%
IT Calabria 16,400 48%
IT Campania 16,000 47%

Eurostat data 2011 | Dati Eurostat 2011

Tuesday, 16 December 2014

Michaelmas stigghiola

I spent the summer of 1984 with my grandparents on their summer house on the Nebrodi mountain range, in the north east of Sicily. My parents came to pick me up in late September, and my father choose the fateful 29th September, Michaelmas, to come back home, in western Sicily. At the time there was no motorway between Messina and Buonfornello, where the Northern Sicilian highway was joining the motorway between Palermo and Catania. The Northern Sicilian highway was and actually still is a thinly asphalted Roman consular road, the via Valeria. The only major change since Marcus Valerius Laevinus legion opened it 22 centuries ago is that the western terminus was moved 20 miles north, from Marsala to Trapani. In a good day it was going to take 6 hours to reach Palermo from my grandfather mountain retreat, and the plan was to start at 4 am, and start the crossing of Palermo at 10 am. At that time, the commuting traffic would have been abated, and the hope was to complete the crossing in 1 hour or so. Saint Michael's day, tough, was not going to be a good day.
We managed to reach Palermo in 8 hours, which was putting us at risk of being delayed by the midday congestion. 
What we didn't knew, we couldn't knew, was that a couple of days before, while chatting with a journalist, Giovanni Falcone, who was at the time organising the capture of  more than 400 members of Cosa Nostra, misunderstanding one of the journalist's remarks, suspecting the journalist knew of the incoming draught, decided to close the nets that very morning.
The police surrounded the city like in a siege, and they allowed cars and buses and trains and people to come in. But not to leave.
It was the greatest traffic jam of my life.
Palermo doesn't have a beltway. It had one in the 50s, via Regione Siciliana, again, a mere variant of via Valeria, but the furious development of the 60s quickly moved that well inside the city. Traditionally, in via Regione Siciliana you feel inside Palermo from the crossing with via Oreto in the east to the crossing with via Belgio in the west (the two intersections are now roundabouts). Palermo is actually wider than that, but these 7 and a half miles are usually the main obstacle in the crossing. During a day without much congestion, and if no ones has committed suicide on the Corleone Bridge, you would expect to take half an hour to 1 hour from the two intersections. That Michaelmas it took my father 12 hours.
Most of these 12 hours were spent in absolute immobility. It looked like a movie, people were mulling around, chatting, rumours were spreading. In a fact finding mission with my dad, I heard people talking about a nuclear war between the Soviets and the Americans, a third world war, an invasion of Europe by the Soviets. My father didn't believe any of the rumours, but asked me not to report those to my mother.
We discovered the truth late in the evening, after my father got his hand on a copy of the L'Ora, which was for almost 92 years the evening newspaper of Palermo. We had been caught in the St Michael's Day great blitz.
After more than 30 years, I have a confession to make: I do remember that day, not for the traffic jam, not for the rumours, not for the thirst, not for the collective madness, but because I made my acquaintance with one of the most revered street foods of Palermo: the stigghiola.
That day I had panelle, crocchette, spleen, but you can have those all around western Sicily. To be honest, I can make myself a better spleen sandwich at home than any stall in Palermo, and that's not hard really, I'd not use lungs, just spleen, and probably a much better oil. But buying stigghiola under a bridge in via Regione Siciliana was totally a different story. I say was, because I strongly suspect the rule of law may have finally found a way to kill this very ancient tradition. The reason you could find stigghiola only in Palermo was that this is a typical Albanian dish, and the only western Sicilian city where you could historically find Albanians was Palermo. People from Mazara, Trapani, Marsala, Sciacca, Alcamo or Agrigento may have heard of stigghiola, but while they would have had first hand knowledge and cultural familiarity of panelle or arancine, the stigghiola would have felt completely foreign. Not to Palermitans, obviously. Until legal, or at least until it was allowed, the stigghiola was the crowned king of the panormitan street food.
In that fateful Michaelmas my father managed to crawl the car just in the right place. At dinner time, a chap with a portable stall came around, fired the barbecue, and started to sell stigghiola. Thanks to this sheer luck, we managed to grab a few portions, with real bread, well before the scent reached the rest of the horde.
I ate stigghiola many more times in my life, but they never tasted half as good as that night.

Tuesday, 25 November 2014

University qualifications: Italy vs UK

The following table describes the equivalence among the Italian and British university qualifications as understood by myself at this point in time:

Please note in Italian universities the unit of credit, the Credito Formativo Universitario (CFU) is equivalent to the European Credit Transfer System (ECTS) unit, while in British universities two Credit Accumulation and Transfer Scheme (CATS) units are equivalent to one ECTS.

This explains why we need 180 CFU to gain a Laurea, and why that should be equivalent to the 360 CATS required for a Bachelor's Degree with Honours.

Some caveat:
  • In EU or EEA countries the only organizations who can officially confirm an academic equivalence is the local NARIC. 
  • The Italian NARIC or the British NARIC could have different ideas on how the respective university qualifications compare one each other, they may actually even have different ideas or understanding, the table above is based on my own understanding of the respective legal and qualification frameworks.
  • I am neither a solicitor, neither in any way related to any NARIC, so if you need an official statement, please go ask the specific NARIC, and if they don't agree with my understanding or with your expectations, tough luck.
  • You could make a case for the Master Universitario di 2° livello to be equivalent to a short Professional Doctorate, which unfortunately doesn't exist in the British qualification framework.
  • On the same note, I would probably equate a short (60 CFU) Diploma di Specializzazione di 2° livello to a Master of Philosophy with some study performed at level 8, or if the element of research was over 60 CFU, to a Research Master (MRes or MLitt), even though both these British qualifications are meant to be at level 7.

Sunday, 19 October 2014

Riflessione sulla eterogenesi dei fini

Da qualche giorno sono iscritto ad un comunità su Facebook di Italiani a Londra.

Ad un certo punto sono finito in un thread il cui OP sosteneva che ci fosse chi utilizzasse tale comunità "per doppi fini".

Questo è stato lo spunto che ha dato l'inizio ad una concisa riflessione personale su quali fossero i fini della mia partecipazione a tale comunità.

Il testo che segue è praticamente verbatim dalle riflessioni fatte originalmente sul thread in questione, che ho iniziato chiedendo all'OP primariamente cosa intendesse per "doppi fini" e secondariamente quale "quale sarebbe il fine principale di questo gruppo?".
In tutta sincerità, sono finito in questo gruppo perché chi mi ha invitato a parteciparvi, come mi ha altresì invitato a iscrivermi a gruppi come Bambocci in Fuga o altri gruppi simili, lo abbia fatto, immagino, per condividere implicitamente una sua personalissima ricerca epistemologica sull'osservabilità dei percorsi di comprensione potenzialmente affini, se non proprio atti, a proporre spiegazioni razionali a questioni come "Perché stanno arrivando una marea di cittadini Italiani a Londra?" oppure "Perché l'Italia è in depressione?" oppure "Perché l'Italia è l'unico paese sviluppato delle sue dimensioni che nella storia dell'umanità abbia sperimentato una recessione a tripla convessità?" (incidentalmente, recentemente anche la Finlandia, ma è molto più piccola) oppure "Perché l'Italia ha subito 25 anni di stagnazione" oppure "Perché l'Italia è in declino da 15 anni?". 
Nella particolare selezione delle popolazioni osservate, è insito che mi abbia voluto suggerire un particolare percorso di ricerca, l'indagine sul capitale umano contemporaneo, che suggerisce una problematica eterogenesi delle cause che personalmente stento ad accettare. Attenzione, è una congettura verosimile, e come in ogni problema complesso, deve necessariamente giocare un ruolo, ma a mio modo di vedere questo non è un ruolo da protagonista, quanto da comprimario. 
Il problema dell'Italia e degli Italiani non è soltanto, anzi dovrei certamente dire non è ormai soltanto, una generale mancanza di comprensione della realtà e di preparazione alla stessa, mancanza determinata da un sistema scolastico, accademico e lavorativo fuori dagli schemi dominanti nel resto del pianeta, dominanti non perché imposti da fantomatiche élite più o meno fantasiosamente nascoste ma perché naturalmente emersi nel corso di un poco sorprendente processo evolutivo ed adattativo, processo a cui purtroppo l'Italia ha smesso di correlarsi proattivamente almeno dal 1970. 
Il problema, visibile a qualsiasi povera Cassandra, e qui non parlo di sistemi informatici ma il riferimento è quello classico, è che in Italia, come in Giappone, in Spagna o in Germania o in tutti quei paesi in cui decenni di scelte scellerate hanno portato alla situazione attuale, non c'è più mercato interno, o comunque non c'è più un mercato interno all'altezza degli investimenti in conto capitale del sistema paese, e quando parlo di conto capitale, parlo sia di infrastrutture che di capitale umano. 
Il mercato interno è stato asfissiato non dalle politiche di austerità, dall'adozione dell'Euro o da mille altre più o meno improbabili piccoli eventi, ma dalla eccessiva contrazione demografica, che non è stata contrastata per almeno 3 decenni, se non con il palliativo di una blanda politica di immigrazione, senza alcun incentivo reale all'immigrazione di qualità o a politiche per il sostegno alla fertilità.
A questo punto mi è stato suggerito trasversalmente che il livello della conversazione della comunità non è generalmente sullo stesso registro da me utilizzato, osservazione a cui ho risposto che dato che da una rapida, ed ammetto fortuita, ricognizione l'OP pare abbia seguito studi letterari a livello accademico, nonostante quello che io pensi delle università italiane in generale, e cioè che il loro unico scopo storico, che ne appesantisce tuttora in maniera ingiustificabile l'efficienza e l'utilità, non fosse stato certo quello di preparare gli studenti alla vita reale o al mondo del lavoro, ma semplicemente quello di selezionare le nuove potenziali leve della casta accademica, continuo a sostenere che chi ha partecipato a quel tipo di percorso accademico debba essere più che capace di leggere sia quanto ho espresso letteralmente, sia quanto semanticamente suggerito in maniera più o meno implicita.

A questo punto, e sperando non sia necessariamente una chiosa, sono tornato alla questione primigenia, e cioè cosa si intendesse come "doppio fine" nella partecipazione ad una tale comunità, puntualizzando che non vorrei che le riflessioni sopra riportate venissero considerata come un fatuo prolegomeno ad una vuota collezione di supercazzole eterovestite da margaritas ante porcos.