<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Random Bullshit</title>
  <link href="http://morpheus.level28.org/atom.xml" rel="self" />
  <link href="http://morpheus.level28.org/" />
  <updated>2011-11-12T16:36:43+01:00</updated>
  <id>http://morpheus.level28.org/</id>
  <author>
    <name>Matteo Panella</name>
    <email>morpheus@level28.org</email>
  </author>

  
  <entry>
    <title>Da un regime all'altro</title>
    <link href="http://morpheus.level28.org/2011/11/da-un-regime-all-altro" />
    <updated>2011-11-12T15:30:33+01:00</updated>
    <id>http://morpheus.level28.org/2011/11/da-un-regime-all-altro</id>
    <content type="html">&lt;p&gt;Guardiamoci in faccia, siamo sicuri di esserci liberati di un &quot;dittatore&quot;?&lt;/p&gt;

&lt;p&gt;O pi&amp;ugrave; semplicemente ci siamo infilati nelle fauci di chi la dittatura
(quella vera) in Italia l'ha sempre foraggiata, gestita e spalleggiata?&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Crisis Management</title>
    <link href="http://morpheus.level28.org/2011/07/crisis-management" />
    <updated>2011-07-02T22:55:21+02:00</updated>
    <id>http://morpheus.level28.org/2011/07/crisis-management</id>
    <content type="html">&lt;p&gt;Quando offri un servizio online può capitare di avere dei problemi (bug, DDoS,
guasti hardware, router impazziti, ecc.) che precludono l'accesso al servizio
a buona parte dell'utenza (se non tutta).&lt;/p&gt;

&lt;p&gt;Ci sono almeno due modi per affrontare la comunicazione con gli utenti
durante una crisi:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;far finta di nulla;&lt;/li&gt;
&lt;li&gt;ammettere che si sta verificando un problema.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Il primo modo di replicare - a mio personalissimo parere - è inutile, a meno
che non si stia affrontando una crisi che potrebbe avere ripercussioni
gravissime sulla sicurezza degli utenti. In quel caso, è sempre buona norma
dispensare le informazioni col contagocce e spiegare solo a problema risolto.&lt;/p&gt;

&lt;p&gt;Il secondo modo, invece, porterà inevitabilmente alla domanda da un milione di
dollari:&lt;/p&gt;

&lt;p style=&quot;text-align:center;&quot;&gt;&lt;em&gt;Quando risolverete il problema?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;E qui scatta a chiunque la molla del
&lt;strong&gt;VAFFANCULOPEZZODIMERDANONMIROMPERELEPALLECHEGIAHOIMIEICASINIDARISOLVERECIMANCHISOLOTU&lt;/strong&gt;,
specialmente se il servizio è gratuito. Reazione comprensibilissima, per
carità, ma che non deve durare più di 5 millisecondi e che non deve
assolutamente diventare di pubblico dominio.&lt;/p&gt;

&lt;p&gt;A mio avviso, in una situazione di crisi bisogna osservare alcune semplici regole:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;spiegare &lt;em&gt;onestamente&lt;/em&gt; all'utenza quale problema si sta verificando e quali
sono i tempi previsti per la risoluzione (se ce ne sono, altrimenti
ammettere tranquillamente di non sapere quanto tempo ci vorrà);&lt;/li&gt;
&lt;li&gt;mordersi le dita prima di rispondere male ad un utente, anche al più insistente;&lt;/li&gt;
&lt;li&gt;staccarsi le dita prima di limitare l'accesso ad un utente che chiede spiegazioni
(questa è &lt;em&gt;in assoluto&lt;/em&gt; la peggior cazzata che si possa fare);&lt;/li&gt;
&lt;li&gt;se non si è in grado di reggere la pressione lasciare che siano altri ad
occuparsi del crisis management;&lt;/li&gt;
&lt;li&gt;risolvere il problema nel minor tempo possibile :-)&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  
  <entry>
    <title>Anomalie statistiche</title>
    <link href="http://morpheus.level28.org/2011/06/anomalie-statistiche" />
    <updated>2011-06-29T18:13:20+02:00</updated>
    <id>http://morpheus.level28.org/2011/06/anomalie-statistiche</id>
    <content type="html">&lt;p&gt;Da qualche giorno finalmente sono in giro i famigerati elenchi degli
affittuari degli alloggi del Fondo Immobiliare, dopo mesi di &quot;silenzio&quot;
da parte di Comune e SGE.&lt;/p&gt;

&lt;p&gt;Perché &lt;em&gt;elenchi&lt;/em&gt; e non &lt;em&gt;elenco&lt;/em&gt;? Semplice, perché &lt;a href=&quot;http://www.aquilatv.it/news/1408-esclusiva-fondo-immobiliare-tutti-i-nomi-dei-fortunati.html&quot;&gt;Aquilatv.it&lt;/a&gt;
ne ha pubblicato uno estratto da non-si-sa-bene-dove, con tanto di date di
firma del contratto e termine di locazione, canoni di affitto ecc., mentre
a stretto giro il &lt;a href=&quot;http://www.comune.laquila.gov.it/pagina40_case-map-e-fondo-immobiliare.html&quot;&gt;Comune dell'Aquila&lt;/a&gt; ne ha pubblicato un altro
in cui erano assenti molti dei dati di cui sopra.&lt;/p&gt;

&lt;p&gt;Ovviamente, visti i miei &lt;a href=&quot;/2009/09/graduatorie-alloggi-unanalisi-molto-artigianale/&quot;&gt;precedenti&lt;/a&gt; con elenchi di beneficiari
(e non) di alloggi, potevo esimermi dal rompere le scatole? Ma ovviamente no :-)&lt;/p&gt;

&lt;p&gt;Caricando entrambi gli elenchi in &lt;a href=&quot;http://code.google.com/p/google-refine/&quot;&gt;Google Refine&lt;/a&gt; (dopo averli trasformati
in CSV con &lt;code&gt;pdftotext&lt;/code&gt;, &lt;code&gt;vim&lt;/code&gt; e tanto olio di gomito) salta subito all'occhio una
discrepanza: l'elenco del Comune ha &lt;strong&gt;299&lt;/strong&gt; voci, mentre quello di Aquilatv ne ha
&lt;strong&gt;308&lt;/strong&gt; (escludendo duplicati e voci &quot;anonime&quot;).&lt;/p&gt;

&lt;p&gt;C'è un'altra cosa che salta all'occhio: nella colonna relativa alla composizione dei
nuclei familiari di entrambi gli elenchi fa spesso capolino il numero 2.
Potrebbe essere solo una coincidenza, quindi prima di trarre conclusioni affrettate
sarebbe il caso di analizzare i dati con &lt;a href=&quot;http://www.r-project.org/&quot;&gt;strumenti adeguati&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Esportando entrambi i dataset e dandoli in pasto a R si ottengono questi
istogrammi relativi alla distribuzione statistica delle dimensioni dei nuclei
familiari:&lt;/p&gt;

&lt;p style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;/media/pdf_componenti_comune.png&quot; alt=&quot;Distribuzione dei nuclei - dati Comune&quot; /&gt;&lt;br/&gt;
Fondo immobiliare - Distribuzione componenti nucleo familiare (fonte: Comune dell'Aquila)&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;/media/pdf_componenti_aquilatv.png&quot; alt=&quot;Distribuzione dei nuclei - dati Aquilatv.it&quot; /&gt;&lt;br/&gt;
Fondo immobiliare - Distribuzione componenti nucleo familiare (fonte: Aquilatv.it)&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Che cosa si può dedurre dai grafici?&lt;/p&gt;

&lt;p&gt;Innanzi tutto, entrambi gli elenchi hanno la stessa distribuzione statistica,
quindi i dati di Aquilatv.it sono reali.
Nello specifico, i nuclei familiari con due componenti rappresentano
&lt;em&gt;oltre il 40%&lt;/em&gt; dei beneficiari degli alloggi del Fondo Immobiliare, seguiti
a ruota da persone singole e nuclei di 4 componenti.&lt;/p&gt;

&lt;p&gt;Non ci sarebbe nulla di strano in tutto questo, se non fosse che (cito
testualmente il &lt;a href=&quot;http://www.commissarioperlaricostruzione.it/Informare/Comunicati-stampa/Famiglie-numerose-possibile-passaggio-da-autonoma-sistemazione-a-MAP-o-Fondo&quot;&gt;comunicato stampa del Commissario delegato per la Ricostruzione&lt;/a&gt; -
l'enfasi è già presente nel documento originale):&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;– &lt;strong&gt;I nuclei familiari numerosi&lt;/strong&gt; – da quattro componenti in su – potranno &lt;strong&gt;chiedere l’assegnazione di un map&lt;/strong&gt;
disponibile sia nel comune dell’Aquila che in quelli dell’intero cratere, o di un &lt;strong&gt;alloggio del fondo immobiliare&lt;/strong&gt;,
anche se avevano espresso la preferenza per il contributo di autonoma sistemazione nel censimento dello scorso agosto.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;(Per i curiosi, &lt;a href=&quot;/stuff/r_session.txt&quot;&gt;qui&lt;/a&gt; potete trovare la sessione di R
utilizzata per produrre i grafici.)&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Pretendo i diritti d'autore!</title>
    <link href="http://morpheus.level28.org/2011/05/pretendo-i-diritti-dautore" />
    <updated>2011-05-07T18:32:20+02:00</updated>
    <id>http://morpheus.level28.org/2011/05/pretendo-i-diritti-dautore</id>
    <content type="html">&lt;p&gt;Il primo aprile ho scritto &lt;a href=&quot;/2011/04/looflirpa-csharp/&quot;&gt;una mail vagamente surreale&lt;/a&gt;
in mailing list amministrativa di Azzurra, annunciando un improbabile
passaggio ad un ircd basato su .NET/WCF.&lt;/p&gt;

&lt;p&gt;Beh, sappiate che &lt;a href=&quot;http://ffircd.blogfree.net/?t=3348506&quot;&gt;pretendo i diritti d'autore&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Caro Onorevole Ceroni</title>
    <link href="http://morpheus.level28.org/2011/04/caro-onorevole-ceroni" />
    <updated>2011-04-20T20:01:12+02:00</updated>
    <id>http://morpheus.level28.org/2011/04/caro-onorevole-ceroni</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.quirinale.it/elementi/Continua.aspx?tipo=Video&amp;amp;key=1014&amp;amp;vKey=866&amp;amp;fVideo=1&quot;&gt;Si faccia una
cultura&lt;/a&gt;,
visto che è un po'
&lt;a href=&quot;http://www.repubblica.it/politica/2011/04/20/news/riforma_costituzionale-15173670/&quot;&gt;carente&lt;/a&gt;
in materia.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>17520</title>
    <link href="http://morpheus.level28.org/2011/04/diciassettemilacinquecentoventi" />
    <updated>2011-04-06T03:32:42+02:00</updated>
    <id>http://morpheus.level28.org/2011/04/diciassettemilacinquecentoventi</id>
    <content type="html">&lt;p&gt;Cosa si fa in 17520 ore?&lt;/p&gt;

&lt;p&gt;In 17520 ore un cucciolo di gatto diventa adulto.&lt;/p&gt;

&lt;p&gt;In 17520 ore una matricola diventa un prossimo laureando.&lt;/p&gt;

&lt;p&gt;In 17520 ore si scrivono 5256000 LOC in C (ammettendo di scrivere
ininterrottamente 300 LOC/ora).&lt;/p&gt;

&lt;p&gt;In 17520 ore nascono e muoiono due generazioni di smartphone.&lt;/p&gt;

&lt;p&gt;In 17520 ore (a partire da ora) potrebbe finire completamente la
disponibilità di indirizzi IPv4.&lt;/p&gt;

&lt;p&gt;In 17520 ore si fanno tante cose. Ma non a L'Aquila.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;right&quot;&gt;6 aprile 2009, 17523:32&lt;/span&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Nell'eventualità di elezioni anticipate...</title>
    <link href="http://morpheus.level28.org/2011/04/elezioni-anticipate" />
    <updated>2011-04-02T23:54:57+02:00</updated>
    <id>http://morpheus.level28.org/2011/04/elezioni-anticipate</id>
    <content type="html">&lt;p&gt;... qualcuno nel PDL si sta già preparando al cambio di nome definitivo:
&lt;a href=&quot;http://www.senato.it/leg/16/BGT/Schede/Ddliter/36662.htm&quot;&gt;Partito Nazionale
Fascista&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Lenza, amo, esca e... PESCI!</title>
    <link href="http://morpheus.level28.org/2011/04/looflirpa-csharp" />
    <updated>2011-04-01T20:59:04+02:00</updated>
    <id>http://morpheus.level28.org/2011/04/looflirpa-csharp</id>
    <content type="html">&lt;p&gt;Visto che su Azzurra non si faceva più un pesce d'aprile come si deve
all'utenza da anni, ho deciso di farne uno io ai miei &quot;colleghi&quot;
inviando una mail un tantino improbabile in mailing list amministrativa:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Date: Fri, 01 Apr 2011 18:56:55 +0200
From: Matteo 'morph' Panella &amp;lt;...@azzurra.org&amp;gt;
To: &amp;lt;OMISSIS&amp;gt;
Subject: Nuovo software di rete

Salve lista.

Dati i recenti sviluppi e le positive esperienze raccolte sul campo da un'altra
rete irc italiana, ho il piacere di annunciarvi le specifiche tecniche del
nuovo ircd e dei nuovi services.

Il linguaggio scelto è C# e il runtime .NET/Mono (in modo tale da permettere il
ritorno di server basati su Windows e quindi maggiori opportunità di link).
ircd.conf sarà sostituito da un comodo file XML per la configurazione, mentre
per il protocollo server-to-server verrà utilizzato Windows Communication
Framework per non reinventare la ruota e ridurre i tempi di sviluppo.

I services saranno integrati in uno degli ircd e utilizzeranno MongoDB come
backend.

Per quanto riguarda le feature visibili agli utenti, sono in programma le
più richieste, ovvero:
 a) protect/owner
 b) vhost
 c) notifica in caso di whois estesa a tutti gli utenti
 d) botserv

Lo sviluppo verrà condotto in maniera totalmente chiusa (per adeguarci al
modello tipico di .NET) fino al completamento della prima release stabile e
alla sua messa in rete. Salvo complicazioni, la data per il deploy del nuovo
stack di rete ed il rilascio dei sorgenti è fissata al 21 dicembre 2012.

Sono sicuro di avere la vostra totale approvazione.

Saluti,
--
Matteo 'morph' Panella
Azzurra IRC Network

&quot;Java is a DSL for converting large XML files into stack traces&quot;
  --Someone on Twitter
&quot;Java. Write Once; Hog 80% of CPU Everywhere.&quot;
  --Merlin Mann
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Pesce #1 - Raynk:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;[19:07:02] &amp;lt;@rnk&gt; morph, ma avevi già pensato a un ircd da cui
partire?&lt;br/&gt;
 [19:07:17] &amp;lt;@rnk&gt; (in merito alla mail sul nuovo software)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Pesce #2 - CYbER:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;[19:31:36] &amp;lt;@CYbER&gt; morph ma è un pesce d'aprile???&lt;br/&gt;
 [19:32:17] &amp;lt;@CYbER&gt; ma li mortacci tua mi hai fatto prendere un
colpo!&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Pesce #3 - IRC Operator anonimo (mail privata):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Date: Fri, 1 Apr 2011 19:34:29 +0200
From: &amp;lt;OMISSIS&amp;gt;
To: Matteo 'morph' Panella &amp;lt;...@azzurra.org&amp;gt;
Subject: Re: Nuovo software di rete

mi hai fatto prendere un colpo :P
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Che dire? Buon primo aprile, pesciolini :D&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Fuck Facebook</title>
    <link href="http://morpheus.level28.org/2011/03/fuck-facebook" />
    <updated>2011-03-30T18:57:55+02:00</updated>
    <id>http://morpheus.level28.org/2011/03/fuck-facebook</id>
    <content type="html">&lt;p&gt;&lt;span class=&quot;strikethrough&quot;&gt;To cut a long story short, Facebook admins apparently consider more
offensive a photo of a pair of naked boobs than some retarded jerks
trolling the victims of the 6.3 earthquake in L'Aquila.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;strikethrough&quot;&gt;So, fuck them.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Update (2011/04/05): fB finally removed that shit.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Migrate this</title>
    <link href="http://morpheus.level28.org/2011/03/migrate-this" />
    <updated>2011-03-29T22:38:10+02:00</updated>
    <id>http://morpheus.level28.org/2011/03/migrate-this</id>
    <content type="html">&lt;p&gt;After reading a lot of confusing and conflicting statements on the
status of OpenVZ in Debian, I finally found out that both linux-vserver
&lt;strong&gt;*AND*&lt;/strong&gt; OpenVZ are deprecated and may not even make it for
squeeze+1. I can live without linux-vserver since I won't touch that
thing with a pole, but OpenVZ has been my choice for container-based
virtualization.&lt;/p&gt;

&lt;p&gt;The migration path is replacing OpenVZ with virtualization solutions
merged with mainline, and it looks really awful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Xen: overhead, overhead, overhead. I want a &lt;em&gt;container&lt;/em&gt;-based
solution, not an &lt;em&gt;hypervisor&lt;/em&gt;;&lt;/li&gt;
&lt;li&gt;KVM: same as before, plus my server doesn't support VT-x/SVM;&lt;/li&gt;
&lt;li&gt;LXC: &lt;strong&gt;COME THE FUCK ON&lt;/strong&gt;, the userspace doesn't support squeeze
guests &lt;em&gt;on squeeze&lt;/em&gt;, it is not even near to production quality and
you can't really control memory usage of each container - unless you
rebuild a kernel (what??) with memory cgroup enabled, which means a
lot of CPU-time overhead for each memory access (WHAT THE
FUCK!?!?!?!).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;To summarize, my only option would be migrating from a proven and
working solution (OpenVZ) to a virtualization system with an incomplete
and buggy userspace and with a reduced kernel feature set because it
would negatively impact performance on the whole system, &lt;em&gt;only because
it is not merged with mainline&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Guess what? If squeeze+1 (or wheezy) dumps OpenVZ, I'll dump Debian -
better yet, Linux altogether.&lt;/p&gt;

&lt;p&gt;FreeBSD, anyone?&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>RFC 4226 implementation in Python</title>
    <link href="http://morpheus.level28.org/2011/03/rfc-4226-implementation-in-python" />
    <updated>2011-03-24T19:51:06+01:00</updated>
    <id>http://morpheus.level28.org/2011/03/rfc-4226-implementation-in-python</id>
    <content type="html">&lt;p&gt;Straight from &lt;a href=&quot;http://tools.ietf.org/html/rfc4226&quot;&gt;RFC 4226, Appendix C&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;hmac&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;hashlib&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;struct&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Copyright (C) 2011, Matteo Panella. All rights reserved.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# This software is licensed under the same terms as the original&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Java reference code in RFC 4226.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# This is a work derived from OATH HOTP Algorithm.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# The author makes no representations concerning either&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# the merchantability of this software or the suitability of this&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# software for any particular purpose.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# It is provided &amp;quot;as is&amp;quot; without express or implied warranty&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# of any kind and THE AUTHOR EXPRESSLY DISCLAIMS ANY&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# WARRANTY OR LIABILITY OF ANY KIND relating to this software.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# These notices must be retained in any copies of any part of this&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# documentation and/or software.&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Copyright notice for original Java code:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Copyright (C) 2004, OATH.  All rights reserved.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# License to copy and use this software is granted provided that it&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# is identified as the &amp;quot;OATH HOTP Algorithm&amp;quot; in all material&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# mentioning or referencing this software or this function.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# License is also granted to make and use derivative works provided&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# that such works are identified as&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  &amp;quot;derived from OATH HOTP algorithm&amp;quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# in all material mentioning or referencing the derived work.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# OATH (Open AuTHentication) and its members make no&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# representations concerning either the merchantability of this&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# software or the suitability of this software for any particular&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# purpose.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# It is provided &amp;quot;as is&amp;quot; without express or implied warranty&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# of any kind and OATH AND ITS MEMBERS EXPRESSaLY DISCLAIMS&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# ANY WARRANTY OR LIABILITY OF ANY KIND relating to this software.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# These notices must be retained in any copies of any part of this&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# documentation and/or software.&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;__all__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;hotp&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Checksum algorithm defined in RFC4226&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;_doubleDigits&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;_calcChecksum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;num&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;doubleDigit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;digit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doubleDigit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;digit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_doubleDigits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;digit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digit&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;doubleDigit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doubleDigit&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;hotp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;secret&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;movingFactor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;codeDigits&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;addChecksum&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;truncationOffset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;sd&quot;&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    Perform RFC4226 HOTP generation from given secret (shared secret) and movingFactor.&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    secret: the shared secret&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    movingFactor: a counter, current time or other value that changes on a per-use basis (64 bit integer)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    codeDigits: number of digits in the OTP, not including the checksum (if any)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    addChecksum: True if a checksum digit should be appended to the OTP, False otherwise (default: False)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    truncationOffset: the offset into the MAC output to begin truncation. If this value is out of the&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;                      range 0 .. 15 or is None, then dynamic truncation will be used.&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    Returns a numeric string in base 10 (the OTP).&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    Test vectors (RFC4226, Appendix D):&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 0)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;755224&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 1)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;287082&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 2)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;359152&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 3)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;969429&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 4)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;338314&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 5)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;254676&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 6)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;287922&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 7)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;162583&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 8)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;399871&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;gt;&amp;gt;&amp;gt; hotp(&amp;quot;12345678901234567890&amp;quot;, 9)&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;#39;520489&amp;#39;&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;codeDigits&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;addChecksum&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;codeDigits&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;movingFactor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;!q&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;movingFactor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;hs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hmac&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;secret&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;movingFactor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hashlib&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sha1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;digest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;truncationOffset&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;truncationOffset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;truncationOffset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# Perform dynamic truncation (per RFC4226)&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# The offset is taken from the lowest 4 bits of hs[19]&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;truncationOffset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0xf&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Starting from the offset, 4 bytes are extracted and converted to an&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# unsigned 32 bit integer (big endian) and then masked with 7fffffff&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;bin_code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;unpack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;!I&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;truncationOffset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;truncationOffset&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;0x7fffffff&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# OTP is the value modulo 10^codeDigits&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;otp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bin_code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;codeDigits&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;addChecksum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;otp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;otp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_calcChecksum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;otp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;codeDigits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%d&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;otp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;0&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;



</content>
  </entry>
  
  <entry>
    <title>Dear macports gnome-doc-utils maintainers...</title>
    <link href="http://morpheus.level28.org/2011/03/dear-macports-gnome-doc-utils-maintainers" />
    <updated>2011-03-23T12:20:54+01:00</updated>
    <id>http://morpheus.level28.org/2011/03/dear-macports-gnome-doc-utils-maintainers</id>
    <content type="html">&lt;pre&gt;&lt;code&gt;variant python25 conflicts python26 python27 description {Use python 2.5} {
    depends_lib-append     port:python25 port:py25-libxml2
    configure.args-append  am_cv_python_pythondir=${frameworks_dir}/Python.framework/Versions/2.5/lib/python2.5/site-packages/
    configure.python       ${prefix}/bin/python2.5
}

variant python26 conflicts python25 python27 description {Use python 2.6} {
    depends_lib-append     port:python26 port:py26-libxml2
    configure.args-append  am_cv_python_pythondir=${frameworks_dir}/Python.framework/Versions/2.6/lib/python2.6/site-packages/
    configure.python       ${prefix}/bin/python2.6
}

variant python27 conflicts python25 python26 description {Use python 2.7} {
    depends_lib-append     port:python27 port:py27-libxml2
    configure.args-append  am_cv_python_pythondir=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages/
    configure.python       ${prefix}/bin/python2.7
}

if {![variant_isset python25] &amp;amp;&amp;amp; ![variant_isset python26]} {
    default_variants +python27
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Is it so fucking difficult?&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Happy PI day</title>
    <link href="http://morpheus.level28.org/2011/03/happy-pi-day" />
    <updated>2011-03-14T16:47:54+01:00</updated>
    <id>http://morpheus.level28.org/2011/03/happy-pi-day</id>
    <content type="html">&lt;p style=&quot;text-align: center&quot;&gt;
$$
\pi = \sum_{k = 0}^{\infty}\frac{1}{16^k} \left(\frac{4}{8k + 1} - \frac{2}{8k + 4} - \frac{1}{8k + 5} - \frac{1}{8k + 6}\right)
$$
&lt;/p&gt;


&lt;p style=&quot;text-align:center;&quot;&gt;Happy PI day, everyone!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Insomma...</title>
    <link href="http://morpheus.level28.org/2011/03/insomma" />
    <updated>2011-03-07T23:04:27+01:00</updated>
    <id>http://morpheus.level28.org/2011/03/insomma</id>
    <content type="html">&lt;p&gt;... s'è dimesso o no?&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Debian squeeze: fuckup non documentati</title>
    <link href="http://morpheus.level28.org/2011/02/debian-squeeze-fuckup-non-documentati" />
    <updated>2011-02-26T11:56:32+01:00</updated>
    <id>http://morpheus.level28.org/2011/02/debian-squeeze-fuckup-non-documentati</id>
    <content type="html">&lt;p&gt;Durante l'aggiornamento da lenny a squeeze, tenete presente quanto segue
(e che non è presente nella documentazione):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;quando installate il nuovo kernel fate attenzione ai warning sul
firmware, se ve ne spunta uno abilitate subito la sezione
&lt;code&gt;non-free&lt;/code&gt;, installate il pacchetto necessario (non è sempre
&lt;code&gt;firmware-linux-nonfree&lt;/code&gt;) e date un bel
&lt;code&gt;dpkg-reconfigure linux-image-vostra-versione&lt;/code&gt; per forzare il
rebuild di initramfs &lt;em&gt;prima di rebootare&lt;/em&gt;;&lt;/li&gt;
&lt;li&gt;se usate PostGIS, l'unica maniera sana di mente per migrare da
PostgreSQL 8.3 a 8.4 è effettuare un dump e restore dei db, non
provate neanche ad usare &lt;code&gt;pg_upgradecluster&lt;/code&gt; perché non funzionerà;&lt;/li&gt;
&lt;li&gt;per default, &lt;code&gt;mysql-server-5.0&lt;/code&gt; verrà sostituito da
&lt;code&gt;mysql-server-core-5.1&lt;/code&gt; che non è sufficiente per far girare il
DBMS, quindi alla fine dell'aggiornamento avviate aptitude,
selezionate &lt;code&gt;mysql-server-5.1&lt;/code&gt; e risolvete tutti i conflitti.&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  
</feed>

