<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Michele Cerreto Webl0g</title>
	<atom:link href="http://blog.michelecerreto.com/index.php" rel="self" type="application/rss+xml" />
	<link>http://blog.michelecerreto.com</link>
	<description>My ICT Web Notes (The only true authority stems from knowledge, not from position)</description>
	<lastBuildDate>Wed, 14 Dec 2011 15:41:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Recuperare l&#8217;ownership della propria istanza Sql Server Express 2008</title>
		<link>http://blog.michelecerreto.com/index.php/2011/12/14/recuperare-lownership-della-propria-istanza-sql-server-express-2008/</link>
		<comments>http://blog.michelecerreto.com/index.php/2011/12/14/recuperare-lownership-della-propria-istanza-sql-server-express-2008/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 15:41:04 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[IT Pro]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sql Server]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[maintenance mode]]></category>
		<category><![CDATA[owner]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[SQL Server Express 2008]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2011/12/14/recuperare-lownership-della-propria-istanza-sql-server-express-2008/</guid>
		<description><![CDATA[&#160; Cercando documentazione relativa al maintenance mode di Sql Server mi sono imbattuto in questo shell script (http://code.msdn.microsoft.com/addselftosqlsysadmin/) che permette di assegnare i privilegi di sysadmin sull’istanza locale di Sql Server Express all’utente con cui ci si è loggati sul proprio OS (o ad un qualsiasi altro specificato come parametro); per farlo, ovviamente, l’utente in [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Cercando documentazione relativa al maintenance mode di Sql Server mi sono imbattuto in questo shell script (<a title="http://code.msdn.microsoft.com/addselftosqlsysadmin/" href="http://code.msdn.microsoft.com/addselftosqlsysadmin/">http://code.msdn.microsoft.com/addselftosqlsysadmin/</a>) che permette di assegnare i privilegi di sysadmin sull’istanza locale di Sql Server Express all’utente con cui ci si è loggati sul proprio OS (o ad un qualsiasi altro specificato come parametro); per farlo, ovviamente, l’utente in oggetto dovrà far parte del gruppo “Administrators” locale.</p>
<p>&#160;</p>
<p>Uno degli scenari dove questo script è particolarmente utile è il seguente:</p>
<p>&#160;</p>
<p>quando sql server express viene installato da uno specifico utente, un secondo utente che proverà ad utilizzare il servizio, godendo dei soli privilegi minimi, non potrà creare database, tabelle o altre tipologie di oggetti. Questo accade perchè l’utente owner dell’installazione è il solo a cui è garantito il ruolo da sysadmin, ergo, il secondo utente pur facendo parte del gruppo degli amministratori del sistema operativo non potrà in alcun modo gestire l’istanza locale del rdbms light di Microsoft. Il problema diventa ancor più grave quando l’utente che ha effettuato l’installazione viene per qualsiasi motivo eliminato dal sistema non potento, quindi, utilizzarlo per poter riassegnare manualmente ad altri utenti il ruolo da sysadmin.</p>
<p>&#160;</p>
<p>Ai tempi di Sql Server Express 2005, Microsoft aveva deciso di garantire il ruolo da sysadmin a tutto il gruppo degli amministratori locali del OS permettendo, quindi, agli utenti di avere l’ownership dell’istanza in maniera praticamente trasparente. Putroppo, con l’introduzione del UAC su Windows Vista questa decisione ha introdotto problemi di usabilità generale ad esempio su Visual Studio. L’UAC, per sua natura, nascondendo il token di sicurezza da “Adminsitrator” al processo di Visual Studio non permetteva la gestione completa del server DB direttamente dalla GUI del IDE Microsoft: l’utente era quindi costretto a lanciare VS in “elevated mode” (per inciso col “Run as Administrator”) che è generalmente una pratica non consigliabile.</p>
<p>&#160;</p>
<p>Lo script automatizza i seguenti steps:</p>
<p>&#160;</p>
<ol>
<ol>
<li><em>restart del servizio SQL Server con l’ozione –m (maintenance mode) che permette una singola connessione da un admin box (aggiunto automaticamente ed in maniera temporanea al ruolo sysadmin del server);</em> </li>
<li><em>connessione all’istanza SQL e aggiunta dell’utente specificato al ruolo sysadmin;</em> </li>
<li><em>restart del servizio SQL in modalità standard;</em> </li>
</ol>
</ol>
<p>&#160;</p>
<p><em></em></p>
<p>.. perfetto per “riguadagnare” la proprietà <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blog.michelecerreto.com/imgblog/75f7015c20e7_D983/wlEmoticon-winkingsmile.png" /> del proprio server in pochissimi secondi.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2011/12/14/recuperare-lownership-della-propria-istanza-sql-server-express-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Developer Preview, installazione da HDD USB e l’importanza del codice opensource.</title>
		<link>http://blog.michelecerreto.com/index.php/2011/09/16/windows-developer-preview-installazione-da-hdd-usb-e-limportanza-del-codice-opensource/</link>
		<comments>http://blog.michelecerreto.com/index.php/2011/09/16/windows-developer-preview-installazione-da-hdd-usb-e-limportanza-del-codice-opensource/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 10:11:00 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WDP]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2011/09/16/windows-developer-preview-installazione-da-hdd-usb-e-limportanza-del-codice-opensource/</guid>
		<description><![CDATA[E’ ormai “notizia consumata” il fatto che Microsoft in occasione della “Build Windows” Conference in quel di Anaheim, California, martedi sera abbia annunciato e reso disponibile la prima build pubblica di Windows 8 (per gli amici Windows Developer Preview). Inutile ribadire il good mood che si è generato sul web intorno alla prossima release di [...]]]></description>
			<content:encoded><![CDATA[<p align="left">E’ ormai “notizia consumata” il fatto che Microsoft in occasione della “Build Windows” Conference in quel di Anaheim, California, martedi sera abbia annunciato e reso disponibile la prima build pubblica di Windows 8 (per gli amici Windows Developer Preview).</p>
<p align="left">Inutile ribadire il <em>good mood </em>che si è generato sul web intorno alla prossima release di Windows grazie anche all’ottima strategia di comunicazione che Microsoft sta adottando da qualche mese a questa parte basata anche su lavoro di <a href="http://www.microsoft.com/presspass/exec/ssinofsky/" target="_blank">Steven Sinofksy</a> (che in questi giorni si è “trasformato” nel nuovo Steve Jobs <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style: none;" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/wlEmoticon-winkingsmile.png" alt="Winking smile" />) e del suo mega team.</p>
<p align="left">Era ormai un mese che seguivo gli sviluppi del nuovo OS grazie soprattutto al blog del Windows engineering team (<a title="http://blogs.msdn.com/b/b8/" href="http://blogs.msdn.com/b/b8/">http://blogs.msdn.com/b/b8/</a>), ma nella spettacolare presentazione di martedi ho visto praticamente “materializzarsi” tutte le novità che erano state annunciate ed abbondantemente discusse nei commenti dei posts.</p>
<p align="left">L’annuncio della disponibilità di una beta \ preview pubblica se lo aspettavano un po tutti, ergo mentre seguivo la keynotes del day 1 in streaming preparavo la partizione estesa sul hdd del mio laptop per poter “accogliere” il nuovo Windows. A fine keynotes avevo il download manager che puntava a <a title="http://msdn.microsoft.com/en-us/windows/apps/br229516" href="http://msdn.microsoft.com/en-us/windows/apps/br229516">http://msdn.microsoft.com/en-us/windows/apps/br229516</a>.</p>
<p align="left">Nella notte di mercoledi la blogosfera si è letteralmente riempita di guide, howto e posts tutti relativi all’installazione di WDP usando varie tecniche (VM su VPC, VM su VirtualBox, installazione nativa, etc). Personalmente, avendo “preparato” appositamente il mio laptop, a fine download, ero pronto per una bella installazione nativa che mi facesse godere a pieno del nuovo OS, ma l’ostacolo era dietro l’angolo: le dimensioni del img ISO WindowsDeveloperPreview-64bit-English-Developer (quella con I developer tool inclusi)di ben 4.8 GB.</p>
<p align="left">E qui vengo all’oggetto di questo post: per usare quella ISO in un’installazione nativa c’è la necessità di avere o una pendrive da 8GB o un DVD9, ma a me mancavano entrambi e non potevo aspettare di procurarmeli … dovevo provare WDP, i nuovi tools di sviluppo (VS 2011 Express e Blend 5), la nuova API per le app metro style, subito <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/wlEmoticon-smile.png" alt="Smile" />.</p>
<p align="left">L’alternativa possibile per chi come me è sprovvisto di un pendrive “larga” e non si ritrova un DVD9 sottomano e quella di usare un HDD USB.</p>
<p align="left">Nel mio caso l’HDD aveva i suoi 500GB tutti spalmati su un’unica partizione, per cui ho dovuto usare la live di gparted (gparted è un software che fa da partition manager e che gira su GNU/Linux <a title="http://gparted.sourceforge.net/" href="http://gparted.sourceforge.net/">http://gparted.sourceforge.net/</a>) per poter “tirare fuori” dalla partizione principale una secondaria da 10 GB da usare come supporto per l’installazione di WDP.</p>
<p align="left">Lo step successivo è stato quello di caricare il contenuto della ISO nella nuova partizione (necessariamente NTFS perchè ci sono file nel setup di WDP con peso sup. a 4GB) e renderla bootabile in modo da poter sfruttare il boot da device USB supportato dai BIOS moderni.</p>
<p align="left">Mi era già capitato di installare Win7 da pendrive USB ed in quel caso avevo usato l’ottimo e super user friendly tool di Microsoft “Windows 7 USB/DVD download tool” (sempre per gli amici WUDT) (<a href="http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool" target="_blank">link</a>) per cui ho deciso di riutilizzarlo.</p>
<p align="left">
<p align="left">Quindi .. Step 1: selezione della ISO,</p>
<p align="left">
<p align="left"><a href="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image_thumb.png" alt="image" width="387" height="207" border="0" /></a></p>
<p align="left">
<p align="left">Step 2: media type USB Device</p>
<p align="left">
<p align="left"><a href="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image4_thumb.png" alt="image" width="390" height="205" border="0" /></a></p>
<p align="left">
<p align="left">STEP 3: … ecco  il secondo problema: il software non supportava HDD USB ma solo drive removibili (pen drive USB).</p>
<p align="left">
<p align="left"><a href="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image_3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image_thumb_3.png" alt="image" width="393" height="210" border="0" /></a></p>
<p>&nbsp;</p>
<p>Leggendo la documentazione dal sito ufficiale,  pare che questa sia stata una scelta <em>by design. </em>Essendo, come dicevo super user friendly <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/wlEmoticon-smile.png" alt="Smile" />, i suoi sviluppatori hanno deciso di evitare che qualche utente distratto potesse formattarsi l’HD sbagliando la selezione da quella dropdownlist.</p>
<p>&nbsp;</p>
<p>Poi, però, mi sono ricordato di aver letto che di questo tool erano disponibili i sorgenti su codeplex. Una ricerca da codeplex.com .. ed istantaneamente “pesco” la pagina ufficiale:</p>
<p>&nbsp;</p>
<p><a href="http://wudt.codeplex.com/">http://wudt.codeplex.com/</a></p>
<p>&nbsp;</p>
<p>Leggendo la documentazione “dev oriented” ho scoperto che in realtà I sorgenti di WUDT sono già inclusi nell’installer standard scacaricabile da MS Store, ed infatti in :</p>
<p>&nbsp;</p>
<blockquote><p>%userprofile%\AppData\Local\Apps\Windows 7 USB DVD Download Tool</p></blockquote>
<p>&nbsp;</p>
<p>ci ho trovato un bel <strong>wudtsource.zip</strong> pronto per essere “esplorato”.</p>
<p>&nbsp;</p>
<p>La modifica è stata più che banale.</p>
<p>&nbsp;</p>
<p>Aperta la solution in VS 9, ho subito notato quel “DriveService”:</p>
<p>&nbsp;</p>
<p><a href="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image_4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image_thumb_4.png" alt="image" width="342" height="427" border="0" /></a></p>
<p>&nbsp;</p>
<p>… si tratta della classe astratta da cui poi ereditano DvdDriveService e UsbDriveService. Ovviamente, la mia modifica era da fare su quest ultimo.</p>
<p>&nbsp;</p>
<p>Aperto il file UsbDriveService.cs, il “blocco by design” si nota subito :</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<pre class="csharpcode">        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Initializes the list of drives to work with.</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;returns&gt;The result of the initialization.&lt;/returns&gt;</span>
        <span class="kwrd">public</span> <span class="kwrd">override</span> DriveStatus Initialize()
        {
            <span class="kwrd">return</span> <span class="kwrd">this</span>.Initialize(DriveType.Removable);
        }</pre>
<pre class="csharpcode"></pre>
<pre class="csharpcode"></pre>
<p>ed il conseguente codice di inizializzazione:</p>
<p>&nbsp;</p>
<pre class="csharpcode">        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// Initializes the list of drives to work with.</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        <span class="rem">/// &lt;param name="type"&gt;The type of drives to get.&lt;/param&gt;</span>
        <span class="rem">/// &lt;returns&gt;The result of the initialization.&lt;/returns&gt;</span>
        <span class="kwrd">protected</span> DriveStatus Initialize(DriveType type)
        {
            <span class="kwrd">this</span>.drives = <span class="kwrd">new</span> List&lt;DriveInfo&gt;();
            var result = DriveStatus.Ready;

            DriveInfo[] devices = DriveInfo.GetDrives();

            <span class="kwrd">foreach</span> (var drive <span class="kwrd">in</span> devices)
            {
                <span class="kwrd">if</span> (drive.DriveType == type)
                {
                    <span class="kwrd">this</span>.drives.Add(drive);
                }
            }

            <span class="kwrd">if</span> (<span class="kwrd">this</span>.Drives.Count &lt;= 0)
            {
                result = DriveStatus.NoDevices;
            }

            <span class="kwrd">return</span> result;
        }</pre>
<p>&nbsp;</p>
<p>Le possibilità, quindi, sono due:</p>
<p>&nbsp;</p>
<p>1) modificare l’enumerable nel metodo in ovverride, scegliendo in base alle proprie esigenze, tra:</p>
<p>&nbsp;</p>
<pre class="csharpcode">    <span class="rem">// Summary:</span>
    <span class="rem">// Defines constants for drive types, including CDRom, Fixed, Network, NoRootDirectory,</span>
    <span class="rem">// Ram, Removable, and Unknown.</span>
    [Serializable]
    [ComVisible(<span class="kwrd">true</span>)]
    <span class="kwrd">public</span> <span class="kwrd">enum</span> DriveType
    {
        <span class="rem">// Summary:</span>
        <span class="rem">// The type of drive is unknown.</span>
        Unknown = 0,
        <span class="rem">//</span>
        <span class="rem">// Summary:</span>
        <span class="rem">// The drive does not have a root directory.</span>
        NoRootDirectory = 1,
        <span class="rem">//</span>
        <span class="rem">// Summary:</span>
        <span class="rem">// The drive is a removable storage device, such as a floppy disk drive or a</span>
        <span class="rem">// USB flash drive.</span>
        Removable = 2,
        <span class="rem">//</span>
        <span class="rem">// Summary:</span>
        <span class="rem">// The drive is a fixed disk.</span>
        Fixed = 3,
        <span class="rem">//</span>
        <span class="rem">// Summary:</span>
        <span class="rem">// The drive is a network drive.</span>
        Network = 4,
        <span class="rem">//</span>
        <span class="rem">// Summary:</span>
        <span class="rem">// The drive is an optical disc device, such as a CD or DVD-ROM.</span>
        CDRom = 5,
        <span class="rem">//</span>
        <span class="rem">// Summary:</span>
        <span class="rem">// The drive is a RAM disk.</span>
        Ram = 6,
    }</pre>
<p>&nbsp;</p>
<p>2) eliminare il controllo dal metodo init protected:</p>
<p>&nbsp;</p>
<pre class="csharpcode">            <span class="kwrd">foreach</span> (var drive <span class="kwrd">in</span> devices)
            {
                <span class="rem">//if (drive.DriveType == type)</span>
                <span class="rem">//{</span>
                    <span class="kwrd">this</span>.drives.Add(drive);
                <span class="rem">//}</span>
            }</pre>
<p>&nbsp;</p>
<p>L’effetto della 2° scelta è facilmente intuibile:</p>
<p>&nbsp;</p>
<p><a href="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image_5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.michelecerreto.com/imgblog/Windows-Developer-Preview-installazione-_14F6D/image_thumb_5.png" alt="image" width="410" height="219" border="0" /></a></p>
<p>&nbsp;</p>
<p>.. ho avuto quindi la possibilità di scegliere la mia partizione su HDD USB preparata ad-hoc per accogliere la ISO di installazione di WDP.</p>
<p>&nbsp;</p>
<p>Il resto è procedura standard.</p>
<p>&nbsp;</p>
<p>Ne approfitto, per chi volesse provare WDP usando un VHD, l’ottimo post di Scott Hanselman:</p>
<p>&nbsp;</p>
<p><a title="http://www.hanselman.com/blog/GuideToInstallingAndBootingWindows8DeveloperPreviewOffAVHDVirtualHardDisk.aspx" href="http://www.hanselman.com/blog/GuideToInstallingAndBootingWindows8DeveloperPreviewOffAVHDVirtualHardDisk.aspx">http://www.hanselman.com/blog/GuideToInstallingAndBootingWindows8DeveloperPreviewOffAVHDVirtualHardDisk.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2011/09/16/windows-developer-preview-installazione-da-hdd-usb-e-limportanza-del-codice-opensource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tempo di aggiornamenti</title>
		<link>http://blog.michelecerreto.com/index.php/2011/07/09/tempo-di-aggiornamenti/</link>
		<comments>http://blog.michelecerreto.com/index.php/2011/07/09/tempo-di-aggiornamenti/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 22:59:05 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[IT Pro]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Aggiornamento server]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2011/07/09/tempo-di-aggiornamenti/</guid>
		<description><![CDATA[Oggi, approfittando di un po’ di tempo libero, sono riuscito finalmente ad aggiornare l’ambiente software del mio server su cui si basa questo blog ed altri servizi che ho in hosting. &#160; L’app di gestione Plesk del VPS (versione 7.6.1, ormai più che legacy) includeva: &#160; PHP 4.3.3 MySQL 4.1 &#160; Anche se questo server [...]]]></description>
			<content:encoded><![CDATA[<p>Oggi, approfittando di un po’ di tempo libero, sono riuscito finalmente ad aggiornare l’ambiente software del mio server su cui si basa questo blog ed altri servizi che ho in hosting.</p>
<p>&#160;</p>
<p>L’app di gestione Plesk del VPS (versione 7.6.1, ormai più che legacy) includeva:</p>
<p>&#160;</p>
<p>PHP 4.3.3</p>
<p>MySQL 4.1</p>
<p>&#160;</p>
<p>Anche se questo server ospita principalmente applicazioni ASP.NET, l’installazione delle versioni più recenti di PHP e MySQL è diventata indispensabile a causa del fatto che l’ultima release di WordPress (3.2)&#160; gira soltanto su PHP 5 o sup. e le estensioni php_mysql, php_pdo_mysql (utilizzate per connettersi al server db) funzionano solo se la versione di MySQL è la 5 o sup.</p>
<p>&#160;</p>
<p>.. insomma un bel circolo vizioso o meglio virtuoso <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Occhiolino" src="http://blog.michelecerreto.com/wp-content/uploads/2011/07/wlEmoticon-winkingsmile.png" /></p>
<p>&#160;</p>
<p>Dopo gli updates, la piattaforma ora si basa su:</p>
<p>&#160;</p>
<p>PHP 5.3.6 su IIS6 + FastCGI</p>
<p>MySQL 5.5.14</p>
<p>&#160;</p>
<p>Una nota : se avete intenzione di continuare ad usare Plesk 7.6.1 per gestire il server e i vari domini, lasciate perdere gli installer basati su wizard di PHP e MySQL, rischiereste di ritrovarvi con la configurazione del server completamente incasinata. Il consiglio è quello di usare i pacchetti di deploy .ZIP per rimpiazzare manualmente le vecchie versioni. Per PHP si tratta essenzialmente di riconfigurare IIS sganciando il gestore basato su ISAPI&#160; a favore di quello fastcgi. Relativamente a MySQL, invece, basta sostituire il folder Data della nuova installazione con quella precedente (compreso il my.ini che contiene tutti i settings dell’istanza) e poi dal prompt comandi con un “<em>mysql_upgrade </em><a href="mailto:admin@localhost"><em>admin@localhost</em></a><em> –force”</em> … forzare l’aggiornamento delle strutture dati di base del servizio.</p>
<p>Ultima cosa relativa al server db: passando dalla versione 4.x alla 5.x andranno reimpostate le pwd degli utenti in modo da poter sfruttare il nuovo algoritmo di hashing e i nuovi meccanismi di persistenza delle credenziali (da PHP, usando le vecchie credenziali, le chiamate a mysql_connect() che sfruttano l’ext mysqli andranno in errore, maggiori info qui: <a title="http://dev.mysql.com/doc/refman/5.5/en/old-client.html" href="http://dev.mysql.com/doc/refman/5.5/en/old-client.html">http://dev.mysql.com/doc/refman/5.5/en/old-client.html</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2011/07/09/tempo-di-aggiornamenti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Songbird 1.7.3, LastFM, problemi di autenticazione: questione di casing</title>
		<link>http://blog.michelecerreto.com/index.php/2010/08/11/songbird-1-7-3-lastfm-problemi-di-autenticazione-questione-di-casing/</link>
		<comments>http://blog.michelecerreto.com/index.php/2010/08/11/songbird-1-7-3-lastfm-problemi-di-autenticazione-questione-di-casing/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 23:08:51 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[LastFM]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Songbird]]></category>
		<category><![CDATA[XUL]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2010/08/11/songbird-1-7-3-lastfm-problemi-di-autenticazione-questione-di-casing/</guid>
		<description><![CDATA[Era qualche settimana ormai che dal mio player preferito Songbird (IMHO una delle applicazioni meglio riuscite e anche più famose sviluppate su piattaforma Mozilla XUL) non riuscivo più ad utilizzare il mio account LastFM tramite il plugin appositamente progettato (ver. 1.0.3.1700). A prima vista la causa era sicuramente da imputare al meccanismo di autenticazione, infatti [...]]]></description>
			<content:encoded><![CDATA[<p>Era qualche settimana ormai che dal mio player preferito <a href="http://www.getsongbird.com" target="_blank">Songbird</a> (IMHO una delle applicazioni meglio riuscite e anche più famose sviluppate su piattaforma Mozilla XUL) non riuscivo più ad utilizzare il mio account <a href="http://www.last.fm" target="_blank">LastFM</a> tramite il plugin appositamente progettato (ver. 1.0.3.1700). </p>
<p>A prima vista la causa era sicuramente da imputare al meccanismo di autenticazione, infatti il plugin non riusciva in alcun modo a farsi rilasciare il token di sessione per poter attivare i classici servizi di streaming e scrobbling. </p>
<p>Causa lavoro non avevo avuto il tempo di investigare sull’anomalia “parcheggiando” temporaneamente Songbird e tornando ad utilizzare il player standalone ufficiale di LastFM. </p>
<p>Oggi ho ripreso la questione ed analizzando in maniera più approfondita mi sono reso conto che il problema era dovuto banalmente ad una URL errata hardcoded nel codice Javascript del plugin.</p>
<p>Tecnicamente la questione è la seguente:</p>
<ol>
<li>LastFM ha da poco introdotto una API completamente basata su servizi di tipo REST, compresa la gestione dell’autenticazione; </li>
<li>l’estensione LastFM per Songbird altro non è che un componente software scritto completamente in Javascript che tramite l’infrastruttura messa a disposizione dal core di Mozilla riesce facilmente ad interagire con interfacce di tipo REST. Tutto il codice Javascript in oggetto è contenuto nel seguente file: <strong><em>[user folder]\AppData\Roaming\Songbird2\Profiles\fhkljfmg.default\extensions\audioscrobbler@songbirdnest.com\components\sbLastFm.js;</em></strong> </li>
<li>LastFM ha ultimamente introdotto, per problemi di security, una sorta di meccanismo di autorizzazione per le applicazioni esterne che interagiranno con i servizi REST. Il trusting è completamente gestibile dall’utente che alla prima richiesta di un software “sconosciuto” viene rediretto verso una pagina che permette di concedere o negare l’autorizzazione al software richiedente. </li>
</ol>
<p>Tutto il meccanismo fin qui descritto è implementato dalla funzione:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">// authenticate against the new Last.fm &quot;rest&quot; web service APIs</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> sbLastFm.prototype.apiAuth = <span style="color: #0000ff">function</span> sbLastFm_apiAuth(onSuccess, onFailure) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>   <span style="color: #008000">// clear our old session</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>   <span style="color: #0000ff">this</span>.sk = <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>   Application.prefs.setValue(<span style="color: #006080">&quot;extensions.lastfm.session_key&quot;</span>, <span style="color: #006080">&quot;&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>   <span style="color: #008000">// clear any web cookies we may have already</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>   dump(<span style="color: #006080">&quot;web cookies cleared\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>   <span style="color: #0000ff">var</span> cookieMgr = Cc[<span style="color: #006080">&quot;@mozilla.org/cookiemanager;1&quot;</span>]</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         .getService(Ci.nsICookieManager);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;Session&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;s_cc&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;s_sq&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;wwwlang&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;__qcb&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;TREA&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;s_nr&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;__qca&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;s_lastvisit&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;LastUser&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;AnonTrack&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>   cookieMgr.remove(<span style="color: #006080">&quot;.last.fm&quot;</span>, <span style="color: #006080">&quot;fastq&quot;</span>, <span style="color: #006080">&quot;/&quot;</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>   <span style="color: #008000">// get a lastfm desktop session</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>   <span style="color: #0000ff">var</span> self = <span style="color: #0000ff">this</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>     <span style="color: #0000ff">this</span>.webLogin(<span style="color: #0000ff">function</span> success() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>         dump(<span style="color: #006080">&quot;webLogin SUCCESS\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>     self.login_phase = AUTH_PHASE_TOKEN_REQUEST;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>     self._token_xhr = self.apiCall(<span style="color: #006080">'auth.getToken'</span>, { },</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>       <span style="color: #0000ff">function</span> response(success, xml, xmlText) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>         <span style="color: #0000ff">if</span> (!success) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span>           dump(<span style="color: #006080">&quot;auth.getToken: FAILED TO AUTHENTICATE: &quot;</span> + xmlText + <span style="color: #006080">&quot;\n\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span>           <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span>         <span style="color: #0000ff">var</span> authtoken = xml.getElementsByTagName(<span style="color: #006080">'token'</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span>         <span style="color: #0000ff">if</span> (authtoken.length != 1) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span>           dump(<span style="color: #006080">&quot;auth.getToken: FAILED TO FIND TOKEN: &quot;</span> + xmlText + <span style="color: #006080">&quot;\n\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span>           <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum42">  42:</span>         authtoken = authtoken[0].textContent;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum43">  43:</span>         dump(<span style="color: #006080">&quot;auth.getToken SUCCESS: &quot;</span> + authtoken + <span style="color: #006080">&quot;\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum44">  44:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum45">  45:</span>         <span style="color: #0000ff">var</span> window = Cc[<span style="color: #006080">'@mozilla.org/appshell/window-mediator;1'</span>]</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum46">  46:</span>                        .getService(Ci.nsIWindowMediator)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum47">  47:</span>                        .getMostRecentWindow(<span style="color: #006080">'Songbird:Main'</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum48">  48:</span>         <span style="color: #0000ff">if</span> (!window) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum49">  49:</span>           self.listeners.each(<span style="color: #0000ff">function</span>(listener) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum50">  50:</span>             listener.onLoginFailed();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum51">  51:</span>           });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum52">  52:</span>           <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum53">  53:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum54">  54:</span>         <span style="color: #0000ff">var</span> gBrowser = window.gBrowser;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum55">  55:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum56">  56:</span>         <span style="color: #0000ff">function</span> removeAuthListeners() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum57">  57:</span>           gBrowser.removeEventListener(<span style="color: #006080">&quot;DOMContentLoaded&quot;</span>,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum58">  58:</span>                                        self._authListener, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum59">  59:</span>           gBrowser.removeEventListener(<span style="color: #006080">&quot;unload&quot;</span>, removeAuthListeners, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum60">  60:</span>           authTab.removeEventListener(<span style="color: #006080">&quot;TabClose&quot;</span>,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum61">  61:</span>                                       self._authTabCloseListener, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum62">  62:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum63">  63:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum64">  64:</span>         <span style="color: #008000">// Create a listener for last.fm's authorization grant page.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum65">  65:</span>         self._authListener = <span style="color: #0000ff">function</span> (e) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum66">  66:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum67">  67:</span>           <span style="color: #008000">// Ensure we are on the right tab.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum68">  68:</span>           <span style="color: #0000ff">if</span> (gBrowser.getBrowserForDocument(e.target) !=</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum69">  69:</span>               gBrowser.getBrowserForTab(authTab)) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum70">  70:</span>             <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum71">  71:</span>           }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum72">  72:</span>   </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum73">  73:</span>           <span style="color: #008000">// We're listening for the LastFM &quot;Permissions Granted&quot; page. It will</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum74">  74:</span>           <span style="color: #008000">// have pathname &quot;/api/grantAccess&quot; on the last.fm domain or a</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum75">  75:</span>           <span style="color: #008000">// localized version such as lastfm.fr</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum76">  76:</span>           <span style="color: #0000ff">var</span> loc = e.target.location;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum77">  77:</span>           <span style="color: #0000ff">if</span> (!/last\.?fm/.test(loc.host)) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum78">  78:</span>             <span style="color: #008000">// If we get here, it implies that the user navigated away from</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum79">  79:</span>             <span style="color: #008000">// LastFM without authorizing.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum80">  80:</span>             removeAuthListeners();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum81">  81:</span>             self.listeners.each(<span style="color: #0000ff">function</span>(listener) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum82">  82:</span>               listener.onLoginFailed();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum83">  83:</span>             });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum84">  84:</span>             <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum85">  85:</span>           }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum86">  86:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum87">  87:</span>           <span style="color: #0000ff">if</span> (loc.pathname != <span style="color: #006080">&quot;/api/grantaccess&quot;</span>) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum88">  88:</span>             <span style="color: #008000">// Ignore LastFM pages that aren't the &quot;Permissions Granted&quot; page.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum89">  89:</span>             <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum90">  90:</span>           } </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum91">  91:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum92">  92:</span>           <span style="color: #008000">// We should be on the grantAccess page now, so remove the listeners</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum93">  93:</span>           <span style="color: #008000">// and try to grab a session key.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum94">  94:</span>           removeAuthListeners();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum95">  95:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum96">  96:</span>           self.login_phase = AUTH_PHASE_SESSION_REQUEST;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum97">  97:</span>           self._session_xhr = self.apiCall(<span style="color: #006080">'auth.getSession'</span>, {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum98">  98:</span>               token: authtoken</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum99">  99:</span>             },</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum100"> 100:</span>             <span style="color: #0000ff">function</span> response(success, xml, xmlText) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum101"> 101:</span>               <span style="color: #0000ff">if</span> (!success) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum102"> 102:</span>                 dump(<span style="color: #006080">&quot;auth.getSession: FAILED TO AUTHENTICATE: &quot;</span> +</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum103"> 103:</span>                   xmlText + <span style="color: #006080">&quot;\n\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum104"> 104:</span>                 <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum105"> 105:</span>               }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum106"> 106:</span>               <span style="color: #0000ff">var</span> keys = xml.getElementsByTagName(<span style="color: #006080">&quot;key&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum107"> 107:</span>               <span style="color: #0000ff">if</span> (keys.length != 1) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum108"> 108:</span>                 dump(<span style="color: #006080">&quot;auth.getSession: FAILED TO AUTH. TOKEN: &quot;</span> +</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum109"> 109:</span>                   xmlText + <span style="color: #006080">&quot;\n\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum110"> 110:</span>                 <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum111"> 111:</span>               }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum112"> 112:</span>               self.sk = keys[0].textContent;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum113"> 113:</span>               dump(<span style="color: #006080">&quot;auth.getSession: AUTHENTICATED\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum114"> 114:</span>               dump(<span style="color: #006080">&quot;session key: &quot;</span> + self.sk + <span style="color: #006080">&quot;\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum115"> 115:</span>               Application.prefs.setValue(<span style="color: #006080">'extensions.lastfm.session_key'</span>,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum116"> 116:</span>                 self.sk);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum117"> 117:</span>               <span style="color: #0000ff">var</span> subscribers = xml.getElementsByTagName(<span style="color: #006080">&quot;subscriber&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum118"> 118:</span>               <span style="color: #0000ff">if</span> (subscribers.length == 1)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum119"> 119:</span>                 self._subscriber = (subscribers[0].textContent == <span style="color: #006080">&quot;1&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum120"> 120:</span>               <span style="color: #0000ff">if</span> (Application.prefs.getValue(</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum121"> 121:</span>                     <span style="color: #006080">&quot;extensions.lastfm.subscriber_override&quot;</span>, <span style="color: #0000ff">false</span>))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum122"> 122:</span>                 self._subscriber = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum123"> 123:</span>               dump(<span style="color: #006080">&quot;subscriber: &quot;</span> + self._subscriber + <span style="color: #006080">&quot;\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum124"> 124:</span>               self.listeners.each(<span style="color: #0000ff">function</span>(l) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum125"> 125:</span>                 l.onAuthorisationSuccess();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum126"> 126:</span>               });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum127"> 127:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum128"> 128:</span>               <span style="color: #0000ff">if</span> (<span style="color: #0000ff">typeof</span>(onSuccess) == <span style="color: #006080">&quot;function&quot;</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum129"> 129:</span>                 onSuccess();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum130"> 130:</span>           });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum131"> 131:</span>         } </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum132"> 132:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum133"> 133:</span>         <span style="color: #008000">// Load the user authorization page.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum134"> 134:</span>         <span style="color: #0000ff">var</span> authURL = <span style="color: #006080">&quot;http://&quot;</span> + self.geoBaseDomain + <span style="color: #006080">&quot;/api/auth?api_key=&quot;</span> +</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum135"> 135:</span>                       API_KEY + <span style="color: #006080">&quot;&amp;token=&quot;</span> + authtoken;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum136"> 136:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum137"> 137:</span>         gBrowser.addEventListener(<span style="color: #006080">&quot;DOMContentLoaded&quot;</span>, self._authListener, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum138"> 138:</span>         <span style="color: #008000">// Make sure we don't leak the listeners if the user takes no action.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum139"> 139:</span>         gBrowser.addEventListener(<span style="color: #006080">&quot;unload&quot;</span>, removeAuthListeners, <span style="color: #0000ff">false</span>); </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum140"> 140:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum141"> 141:</span>         <span style="color: #0000ff">var</span> authTab = gBrowser.loadOneTab(authURL, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum142"> 142:</span>       </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum143"> 143:</span>         <span style="color: #008000">// The user could close the auth page tab without granting permission.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum144"> 144:</span>         self._authTabCloseListener = <span style="color: #0000ff">function</span>(e) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum145"> 145:</span>           removeAuthListeners();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum146"> 146:</span>           self.listeners.each(<span style="color: #0000ff">function</span>(listener) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum147"> 147:</span>             listener.onLoginFailed();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum148"> 148:</span>           });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum149"> 149:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum150"> 150:</span>         </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum151"> 151:</span>         authTab.addEventListener(<span style="color: #006080">&quot;TabClose&quot;</span>, self._authTabCloseListener, <span style="color: #0000ff">false</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum152"> 152:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum153"> 153:</span>     }, <span style="color: #0000ff">function</span> failure() {   <span style="color: #008000">// auth.getToken failure</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum154"> 154:</span>       dump(<span style="color: #006080">&quot;webLogin FAILED\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum155"> 155:</span>       self.listeners.each(<span style="color: #0000ff">function</span>(listener) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum156"> 156:</span>         listener.onLoginFailed();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum157"> 157:</span>       });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum158"> 158:</span>     }); <span style="color: #008000">// auth.getToken api call</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum159"> 159:</span>   }, <span style="color: #0000ff">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum160"> 160:</span>     dump(<span style="color: #006080">&quot;weblogin FAILURE\n&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum161"> 161:</span>     self.listeners.each(<span style="color: #0000ff">function</span>(listener) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum162"> 162:</span>       listener.onLoginFailed();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum163"> 163:</span>     });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum164"> 164:</span>   }); <span style="color: #008000">// weblogin</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum165"> 165:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>ed in particolare il punto 3 viene gestito tramite la funzione di callback ad evento settata alla riga 65.<br />
  <br />Dalla riga 87 alla 90, nella funzione di callback sopra citata, viene fatto un controllo al fine di ignorare tutte le pagine-URL diverse da quella che LastFM usa per permettere all’utente di settare la grant per la propria “external application”:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">if</span> (loc.pathname != <span style="color: #006080">&quot;/api/grantAccess&quot;</span>) {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>             <span style="color: #008000">// Ignore LastFM pages that aren't the &quot;Permissions Granted&quot; page.</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>             <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>} </pre>
<p><!--CRLF--></div>
</div>
<p>Siccome avevo notato che la funzione di callback usciva sempre in quel punto ho provato via browser la URL testata su <em>loc.pathname</em> per controllare se restituisse correttamente un status HTTP 200: ebbene ho scoperto che il motore di routing-rewriting usato da LastFM essendo case sensitive alla URL <a title="http://www.lastfm.it/api/grantAccess" href="http://www.lastfm.it/api/grantAccess">http://www.lastfm.it/api/grantAccess</a> mi restituiva un bel HTTP 404 (pagina non trovata) mentre puntando ad <a title="http://www.lastfm.it/api/grantaccess" href="http://www.lastfm.it/api/grantaccess">http://www.lastfm.it/api/grantaccess</a> ritornava correttamente la pagina di trusting applicativo.</p>
<p>Alla luce della scoperta mi è bastato sostituire “<strong>api/grantAccess” </strong>con “<strong>api/grantaccess” </strong>(riga 1399 del file sbLastFm.js)<strong>&#160;</strong>che il mio Songbird ha ripreso a “dialogare allegramente” con lo strepitoso servizio di LastFM.</p>
<p>Successivamente, facendo qualche ricerca su Google, ho scoperto che il problema era già stato fixato sul trunk del plugin per la versione 1.8.0 di Songbird (attualmente in beta 3 e quindi non ancora disponibile dalla pagina di download principale <a href="http://www.getsongbird.com">http://www.getsongbird.com</a>)</p>
<p>… insomma questione di casing</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:32431f56-52ae-4745-a4b2-8c4c42a26f8a" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/LastFM" rel="tag">LastFM</a>,<a href="http://technorati.com/tags/Songbird" rel="tag">Songbird</a>,<a href="http://technorati.com/tags/Javascript" rel="tag">Javascript</a></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2010/08/11/songbird-1-7-3-lastfm-problemi-di-autenticazione-questione-di-casing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Opera 10.50 si aggiorna</title>
		<link>http://blog.michelecerreto.com/index.php/2010/03/24/opera-10-50-si-aggiorna/</link>
		<comments>http://blog.michelecerreto.com/index.php/2010/03/24/opera-10-50-si-aggiorna/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 13:42:05 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2010/03/24/opera-10-50-si-aggiorna/</guid>
		<description><![CDATA[In quel di Oslo hanno appena reso disponibile tramite repository per l’aggiornamento automatico la versione 10.51 del noto browser che sistema due problemi di vulnerabilità di cui uno abbastanza grave, legato al Content-Length header, del quale avevo accennato nel precedente post. La nuova versione introduce alcune migliorie sistemando alcuni bugs, segnalati dai feedback degli utenti, [...]]]></description>
			<content:encoded><![CDATA[<p>In quel di Oslo hanno appena reso disponibile tramite repository per l’aggiornamento automatico la versione 10.51 del noto browser che sistema due problemi di vulnerabilità di cui uno abbastanza grave, legato al Content-Length header, del quale avevo accennato nel precedente post.</p>
<p>La nuova versione introduce alcune migliorie sistemando alcuni bugs, segnalati dai feedback degli utenti, relativi alla UI, engine di esecuzione Javascript e funzionalità di rete.</p>
<p>Che dire : l’acid test v3 100/100 e il SunSpider Test, la velocità di esecuzione grazie a Presto, Carakan e Vega, funzionalità come i widgets OOB, il supporto nativo ad HTML5, fanno di questo browser un degno competitor dei WebKit based (i fratelli chrome e safari).</p>
<p>Per quanto riguarda il browser di BigM, non rimane che aspettare IE9 visto che con la V8 non c’è partita.</p>
<p>Acid3 Test : </p>
<p><a href="http://blog.michelecerreto.com/wp-content/uploads/2010/03/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Acid Test 3" border="0" alt="Acid Test 3" src="http://blog.michelecerreto.com/wp-content/uploads/2010/03/image_thumb.png" width="274" height="247" /></a><a href="http://blog.michelecerreto.com/wp-content/uploads/2010/03/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.michelecerreto.com/wp-content/uploads/2010/03/image_thumb1.png" width="265" height="243" /></a> </p>
<p>Il SunSpider Test (velocità di esecuzione del codice Javascript). </p>
<p>FROM = MS Internet Explorer 8.0.7600</p>
<p>TO = Opera 10.51</p>
<p><a href="http://blog.michelecerreto.com/wp-content/uploads/2010/03/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SunSpider Test" border="0" alt="SunSpider Test" src="http://blog.michelecerreto.com/wp-content/uploads/2010/03/image_thumb2.png" width="541" height="602" /></a> </p>
<p>… un altro pianeta</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2010/03/24/opera-10-50-si-aggiorna/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opera &quot;Content-Length&quot; Processing Buffer Overflow Vulnerability &#8211; Advisories</title>
		<link>http://blog.michelecerreto.com/index.php/2010/03/08/opera-content-length-processing-buffer-overflow-vulnerability-advisories/</link>
		<comments>http://blog.michelecerreto.com/index.php/2010/03/08/opera-content-length-processing-buffer-overflow-vulnerability-advisories/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 09:08:22 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Buffer Overflow]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Secunia]]></category>
		<category><![CDATA[Vulnerabilità]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2010/03/08/opera-content-length-processing-buffer-overflow-vulnerability-advisories/</guid>
		<description><![CDATA[A quanto pare la nuova versione del browser norvegese (10.50, ma in generale 10.X) sarebbe affetta da una vulnerabilità, scoperta da Marcin Ressel, che permetterebbe ad un sito “untrusted” di eseguire del codice malevolo grazie ad un exploit causato dalla non corretta gestione della response HTTP a particolari request assemblate ad hoc e contenenti header [...]]]></description>
			<content:encoded><![CDATA[<p>A quanto pare la nuova versione del browser norvegese (10.50, ma in generale 10.X) sarebbe affetta da una vulnerabilità, scoperta da Marcin Ressel, che permetterebbe ad un sito “untrusted” di eseguire del codice malevolo grazie ad un exploit causato dalla non corretta gestione della response HTTP a particolari request assemblate ad hoc e contenenti header “Content-Length” a 64bit.</p>
<p>Opera Software, in queste ultime ore, ha cercato di mitigare il problema (<a title="http://www.theregister.co.uk/2010/03/05/opera_vulnerability/" href="http://www.theregister.co.uk/2010/03/05/opera_vulnerability/">http://www.theregister.co.uk/2010/03/05/opera_vulnerability/</a>) rispondendo che da una analisi effettuata risulterebbe difficilissimo o praticamente impossibile eseguire del codice jittato dinamicamente in memoria grazie alla funzionalità DEP dei sistemi operativi Windows.</p>
<p>Il problema però è che DEP non è abilitato di default su WinXP e Vista; inoltre molti utenti decidono di disabilitarlo perchè in alcuni scenari l’overhead di DEP non è certo trascurabile.</p>
<p>Il mio consiglio è comunque di tenere sempre abilitati UAC e DEP, sfruttando dove è necessario la possibilità di escludere un singolo o un gruppo di eseguibili dal monitoraggio.</p>
<p><a href="http://secunia.com/advisories/38820">Opera &quot;Content-Length&quot; Processing Buffer Overflow Vulnerability &#8211; Advisories &#8211; Community</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2010/03/08/opera-content-length-processing-buffer-overflow-vulnerability-advisories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft acquisisce Teamprise da SourceGear</title>
		<link>http://blog.michelecerreto.com/index.php/2009/11/10/microsoft-acquisisce-teamprise-da-sourcegear/</link>
		<comments>http://blog.michelecerreto.com/index.php/2009/11/10/microsoft-acquisisce-teamprise-da-sourcegear/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 10:07:00 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[SourceGear]]></category>
		<category><![CDATA[Teamprise]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2009/11/10/microsoft-acquisisce-teamprise-da-sourcegear/</guid>
		<description><![CDATA[Apprendo questa notizia bomba dal blog di Brian Harry. Era ormai qualche anno che il team di Microsoft lavorava con gli sviluppatori di SourceGear per rendere il prodotto Teamprise sempre “più simile” al TeamExplorer di Visual Studio; finalmente integrando tutto in un’unica soluzione la suite di BigM coprirà buona parte di tutte le necessità di [...]]]></description>
			<content:encoded><![CDATA[<p>Apprendo questa notizia bomba dal blog di Brian Harry.</p>
<p>Era ormai qualche anno che il team di Microsoft lavorava con gli sviluppatori di SourceGear per rendere il prodotto Teamprise sempre “più simile” al TeamExplorer di Visual Studio; finalmente integrando tutto in un’unica soluzione la suite di BigM coprirà buona parte di tutte le necessità di ALM in ambienti di sviluppi tecnologicamente eterogenei</p>
<p>Teamprise sarà integrato nella product-line di Visual Studio 2010 ed includerà:</p>
<ul>
<li><strong>Teamprise plugin for Eclipse: </strong>bugtracking, source control management, gestione build, reporting etc. direttamente da Eclipse e in tutti gli altri IDE basati su quest ultimo (JBoss, BEA Workshop, Rational Application Developer .. per gli amici RAD, Adobe Flex Bulder, APTANA Studio etc.); </li>
<li><strong>Teamprise Explorer: </strong>tutte le funzionalità incluse nel plug-in per Eclipse potranno essere utilizzate anche tramite questo software stand-alone, perfetto quindi per i componenti del team non strettamente legati allo sviluppo (graphic designer, quality assurance testers e project managers); </li>
<li><strong>Teamprise Command-Line Client: </strong>un’interfaccia non grafica, cross-platform per interfacciarsi al Team Foundation Server, perfetta per lo scripting e per gli scenari di build. </li>
</ul>
<p>Il “trittico” potrà essere acquistato separatamente (si parla di ~700$USD) e sarà disponinbile per tutti i subscriber MSDN e tutti quelli che acquisteranno Visual Studio 2010 Ultimate.</p>
<p>Per approfondimenti :</p>
<ul>
<li>annuncio su Microsoft PressPass : <a title="http://www.microsoft.com/presspass/press/2009/nov09/11-09teamprisepr.mspx" href="http://www.microsoft.com/presspass/press/2009/nov09/11-09teamprisepr.mspx">http://www.microsoft.com/presspass/press/2009/nov09/11-09teamprisepr.mspx</a> </li>
<li>nuova sezione prontamente aperta sul sito Microsoft: <a title="http://www.microsoft.com/pathways/teamprise/default.htm" href="http://www.microsoft.com/pathways/teamprise/default.htm">http://www.microsoft.com/pathways/teamprise/default.htm</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2009/11/10/microsoft-acquisisce-teamprise-da-sourcegear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft BizSpark un &#8220;aiuto&#8221; per le startups</title>
		<link>http://blog.michelecerreto.com/index.php/2009/06/21/microsoft-bizspark-un-aiuto-per-le-startups/</link>
		<comments>http://blog.michelecerreto.com/index.php/2009/06/21/microsoft-bizspark-un-aiuto-per-le-startups/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 18:27:43 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2009/06/21/microsoft-bizspark-un-aiuto-per-le-startups/</guid>
		<description><![CDATA[Torno a bloggare dopo un lungo periodo di stand-by dovuto a vari impegni (avrei “in canna” tanti&#160; posts interessanti, ma nonostante passi ore e ore per lavoro difronte ad un PC il tempo per aprire WLW e buttare giù il post è veramente poco). Veniamo alla news che ritengo veramente una “chicca”. Apprendo, leggendo il [...]]]></description>
			<content:encoded><![CDATA[<p>Torno a bloggare dopo un lungo periodo di stand-by dovuto a vari impegni (avrei “in canna” tanti&#160; posts interessanti, ma nonostante passi ore e ore per lavoro difronte ad un PC il tempo per aprire WLW e buttare giù il post è veramente poco).</p>
<p>Veniamo alla news che ritengo veramente una “chicca”.</p>
<p>Apprendo, leggendo il blog di <a href="http://blogs.msdn.com/somasegar/default.aspx">Soma</a> (S. Soma Somasgear – Responsabile di tutto il settore sviluppo di MS), del programma Microsfot BizSpark destinato alle startup companies di tutto il mondo.</p>
<p>Si tratta, praticamente, di un programma di parterniship che permette alle aziende “accettate” di usufruire per i primi 3 anni di attività di tutto il “parco” software Microsoft, del supporto e della visibilità pubblicitaria offerta da BizSpark stesso, senza alcun costo di up-front, semplicemente una fee di uscita di 100$ USD.</p>
<p>L’elenco del materiale a cui è possibile accedere gratis è veramente “succulento” :</p>
<ul>
<li>Tutto il software standard di una subscription VSTS – MSDN Premium;</li>
<li>Expression Studio;</li>
<li>VSTS Team Foundation Server Standard Edition;</li>
</ul>
<p>I requisiti che le aziende dovrebbe rispettare sono i seguenti :</p>
<ul>
<li>Core business basato principalmente sullo sviluppo di prodotti software pacchettizzati o SaS;</li>
<li>La proprietà dell’azienda deve essere privata;</li>
<li>Costituita da meno di 3 anni;</li>
<li>Revenue annuale generato &lt; di $1 Milione USD ( in realtà questo valore differisce per gruppi di nazioni, ad. es. il revenue per&#160; Egitto, Turchia, Vietnam è fissato a $250K USD)</li>
</ul>
<p>Inoltre, se i proditti, progettati e sviluppati durante il periodo di partecipazione al programma, saranno venduti come servizi (SaS) in modalità ASP, BizSpark permette di usufruire, sempre gratuitamente, dell’infrastruttura software necessaria all’ambiente di produzione :</p>
<ul>
<li>Windows Server (tutte le edizioni, anche Enterprise);</li>
<li>SQL Server;</li>
<li>Sharepoint Portal Server;</li>
<li>System Center;</li>
<li>BizTalk Server;</li>
<li>Dynamics CRM;</li>
<li>Windows Azure Service Platform;</li>
</ul>
<p>Interessante, come accennavo prima, anche la questione della visibilità. Tramite <a href="http://www.microsoftstartupzone.com/BizSparkDB/Pages/Featured_Company.aspx">BizSpark DB</a> le startups hanno l’opportunità di mostrare il proprio expertise e il proprio portfolio a potenziali investitori, partners e clienti anche grazie all’aiuto delle “recensioni” che BigM farà sul sito MicrosoftStartupZone.com.</p>
<p>Un esempio di startup che ha avuto accesso a BizSpark, riportata anche da Soma, è “<a href="http://www.after-mouse.com/">After-Mouse.com</a>”, azienda francese nata per lo sviluppo di soluzioni WPF \ Silverlight&#160; che fanno uso della piattaforma Microsoft Surface.</p>
<p>E’ possibile reperire maggiori infos direttamente sul website ufficiale di BizSpark (<a href="http://www.microsoftstartupzone.com/BizSpark">http://www.microsoftstartupzone.com/BizSpark</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2009/06/21/microsoft-bizspark-un-aiuto-per-le-startups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Piccoli developers crescono &#8230; con Microsoft SmallBasic</title>
		<link>http://blog.michelecerreto.com/index.php/2008/11/11/piccoli-developers-crescono-con-microsoft-smallbasic/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/11/11/piccoli-developers-crescono-con-microsoft-smallbasic/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 11:50:44 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2008/11/11/piccoli-developers-crescono-con-microsoft-smallbasic/</guid>
		<description><![CDATA[I miei primi passi da dev li ho fatti utilizzando il mitico Turbo Pascal di Borland (che strano dopo tutti questi anni mi ritrovo ancora a lavorare con strumenti progettati da Anders Hejlsberg, sarà un caso?? . Successivamente mi buttai rapidamente a capofitto su C/C++ scrivendo videogiochi (piccoli shotemup 2D) utilizzando la lib Allegro (ancora [...]]]></description>
			<content:encoded><![CDATA[<p>I miei primi passi da dev li ho fatti utilizzando il mitico Turbo Pascal di Borland (che strano dopo tutti questi anni mi ritrovo ancora a lavorare con strumenti progettati da <a href="http://it.wikipedia.org/wiki/Anders_Hejlsberg">Anders Hejlsberg</a>, sarà un caso?? <img src='http://blog.michelecerreto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Successivamente mi buttai rapidamente a capofitto su C/C++ scrivendo videogiochi (piccoli shotemup 2D) utilizzando la lib <a href="http://www.talula.demon.co.uk/allegro/">Allegro</a> (ancora in pieno sviluppo) su compilatori come Cygwin (uno dei porting di gcc su windows) e Watcom C++ (bei tempi quelli dell&#8217;extender a 32 bit DOS4GW <img src='http://blog.michelecerreto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>Al giorno d&#8217;oggi avvicinare i bambini allo sviluppo software è diventata una pratica molto semplice grazie alla miriade di linguaggi e di strumenti dedicati. Ultimo ritrovato è <a href="http://msdn.microsoft.com/en-us/devlabs/cc950524.aspx">Microsoft SmallBasic</a>, un progetto dei DevLabs di BigM che fornisce un linguaggio semplice, basato su BASIC, con a supporto un IDE userfriendly dove non mancano funzionalità apprezzate anche dai &#8220;grandi&#8221; come l&#8217;Intellisense e l&#8217;instant context sensitive help, il tutto ovviamente con pieno supporto al .NET Framework.</p>
<p>Il linguaggio, completamente imperativo, conta appena 15 keywords, abbastanza per approcciare ai concetti base di qualsiasi linguaggio (statement condizionali, loops, etc.).</p>
<p><a href="http://blog.michelecerreto.com/imgblog/Piccolidevelopers.conMicrosoftSmallBasic_A417/image.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="177" alt="image" src="http://blog.michelecerreto.com/imgblog/Piccolidevelopers.conMicrosoftSmallBasic_A417/image_thumb.png" width="287" border="0"></a></p>
<p>Il semplice ambiente di sviluppo è composto essenzialmente dalla <em>Toolbar (2)</em> , l&#8217;<em>Editor (1)</em> e la <em>Surface Area (3)</em> mentre l&#8217;Intellisense sfrutta anche esso l&#8217;interfaccia basata su ribbon.</p>
<p><a href="http://blog.michelecerreto.com/imgblog/Piccolidevelopers.conMicrosoftSmallBasic_A417/image_3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="99" alt="image" src="http://blog.michelecerreto.com/imgblog/Piccolidevelopers.conMicrosoftSmallBasic_A417/image_thumb_3.png" width="244" border="0"></a></p>
<p>Maggiori info sono disponibili nel documento di &#8220;<a href="http://download.microsoft.com/download/9/0/6/90616372-C4BF-4628-BC82-BD709635220D/Introducing%20Small%20Basic.pdf">getting starting guide</a>&#8221; scaricabile dal sito ufficiale dedicato al progetto.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/11/11/piccoli-developers-crescono-con-microsoft-smallbasic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilizzare Visual Studio 2005 con Team Foundation Server 2008</title>
		<link>http://blog.michelecerreto.com/index.php/2008/09/30/utilizzare-visual-studio-2005-con-team-foundation-server-2008/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/09/30/utilizzare-visual-studio-2005-con-team-foundation-server-2008/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 09:15:03 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Legacy]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2008/09/30/utilizzare-visual-studio-2005-con-team-foundation-server-2008/</guid>
		<description><![CDATA[Al momento dell&#8217;implementazione di un&#8217;infrastruttura di gestione dello sviluppo software basata su Team Foundation Server 2008 ci si scontra sempre con la questione di gestire il cosiddetto &#8220;backlog&#8221; che in questo caso altro non sono che progetti realizzati con Visual Studio 2005. Ovviamente siccome non è sempre possibile convertire le solutions VS2005 in formato VS2008 [...]]]></description>
			<content:encoded><![CDATA[<p>Al momento dell&#8217;implementazione di un&#8217;infrastruttura di gestione dello sviluppo software basata su Team Foundation Server 2008 ci si scontra sempre con la questione di gestire il cosiddetto &#8220;backlog&#8221; che in questo caso altro non sono che progetti realizzati con Visual Studio 2005. Ovviamente siccome non è sempre possibile convertire le solutions VS2005 in formato VS2008 a causa di varie problematiche, soprattuto di tipo organizzativo, nasce la necessità di utilizzare l&#8217;IDE in versione 2005 con la nuova versione del server. Microsoft si è sforzata di rendere il più possibile compatibile Team Explorer 2005 con il nuovo TFS, a patto comunque di installare qualche patch. La procedura è molto semplice :</p>
<p><strong><em>1)</em></strong> <em><strong>installare Team Explorer 2005</strong></em> per aggiungere le funzionalità client (aprire progetti su TFS, crearne di nuovi, etc);</p>
<p>NB : creando un nuovo progetto su TFS da Team Explorer 2005 si ottiene come risultato l&#8217;errore &#8220;TF30170 : The plugin Microsoft.ProjectCreationWizard.Portal failed during task SharePointPortal from group Portal&#8221;. Questa anomalia è dovuta al fatto che Team Exploref 2005 non è compatibile con Windows Sharepoint Services v3.0 proprio perchè TFS 2005 usava la versione 2.0 (maggiori info sul <a href="http://blogs.msdn.com/bharry/archive/2007/08/14/tf30162-task-sharepointportal-from-group-portal-failed.aspx">blog di uno dei program manger di VS Brian Harry</a>). Tuttavia Microsoft, come indicato nel post di Brian, tempo fa ha rilasciato una patch per la risoluzione di questa anomalia;</p>
<p><em><strong>2) applicare la patch KB932544 (</strong></em><a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=7214&amp;wa=wsignin1.0"><em><strong>download</strong></em></a><em><strong>)</strong></em> per risolvere la problematica descritta sopra;</p>
<p><strong><em>3) reinstallare VS 2005 SP1. </em></strong>L&#8217;installazione della patch 932544 riporta l&#8217;assembly Microsoft.VisualStudio.teamfoundation.teamexplorer.dll ad una versione precedente alla 8.0.50727.762 necessaria invece per l&#8217;interazione con WSS 3.0. Di conseguenza andrà riapplicato SP1 per allinearsi con l&#8217;ultima release di Microsoft;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/09/30/utilizzare-visual-studio-2005-con-team-foundation-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mouse wheel e Visual Basic 6</title>
		<link>http://blog.michelecerreto.com/index.php/2008/08/21/mouse-wheel-e-visual-basic-6/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/08/21/mouse-wheel-e-visual-basic-6/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 09:49:56 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Legacy]]></category>
		<category><![CDATA[Tech Gadgets]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2008/08/21/mouse-wheel-e-visual-basic-6/</guid>
		<description><![CDATA[Nell&#8217;azienda dove lavoro attualmente, ogni tanto mi capita di dover manutenere codice legacy sviluppato in Visual Basic 6. Ovviamente erano anni che non aprivo un progetto VB6 e quindi avevo dimenticato di come fosse ostico utilizzare un IDE rilasciato nell&#8217;estate del 1998 (gli IDE moderni mi hanno viziato). Gi&#224; farlo andare su Vista Business del [...]]]></description>
			<content:encoded><![CDATA[<p>Nell&#8217;<a href="http://www.dp2000.it">azienda dove lavoro</a> attualmente, ogni tanto mi capita di dover manutenere codice legacy sviluppato in Visual Basic 6. Ovviamente erano anni che non aprivo un progetto VB6 e quindi avevo dimenticato di come fosse ostico utilizzare un IDE rilasciato nell&#8217;estate del 1998 <img src='http://blog.michelecerreto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (gli IDE moderni mi hanno viziato). Gi&#224; farlo andare su Vista Business del mio laptop aziendale &#232; stata una battaglia, ma poi una volta lanciato il caro vecchio VB6 mi ha subito ricordato che ai suoi tempi i mouse erano senza wheel facendomi riaffiorare veramente &quot;brutti ricordi&quot; <img src='http://blog.michelecerreto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Fortunatamente con la KB 837910 Microsoft qualche anno fa realizz&#242; un addin per attivare la funzionalit&#224; di scrolling rendendo quindi la lettura di codice vb6 (gi&#224; deprimente di per s&#233;) un attimino pi&#249; agevole.</p>
<p>Il link per il <a title="Download del pacchetto VB6MouseWheel.EXE" href="http://download.microsoft.com/download/e/f/b/efb39198-7c59-4ace-a5c4-8f0f88e00d34/vb6mousewheel.exe">download del pacchetto VB6MouseWheel.EXE</a></p>
<p>La KB ufficiale con <a href="http://support.microsoft.com/?id=837910">le istruzioni per l&#8217;installazione</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/08/21/mouse-wheel-e-visual-basic-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Live standalone installer</title>
		<link>http://blog.michelecerreto.com/index.php/2008/07/11/windows-live-standalone-installer/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/07/11/windows-live-standalone-installer/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 13:45:35 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2008/07/11/windows-live-standalone-installer/</guid>
		<description><![CDATA[Molti avranno notato che Microsoft rilasciando la suite di software Windows Live (Messenger, Mail, Live Writer etc.) ha anche deciso di non fornire pi&#249; i setup per effettuare installazioni standalone. Attualmente l&#8217;unico file distribuito sul sito ufficiale di BigM &#232; &#34;Windows Live Installer.exe&#34; che permette agli utenti di scegliere quali software della suite installare per [...]]]></description>
			<content:encoded><![CDATA[<p>Molti avranno notato che Microsoft rilasciando la suite di software Windows Live (Messenger, Mail, Live Writer etc.) ha anche deciso di non fornire pi&#249; i setup per effettuare installazioni standalone. Attualmente l&#8217;unico file distribuito sul sito ufficiale di BigM &#232; &quot;Windows Live Installer.exe&quot; che permette agli utenti di scegliere quali software della suite installare per poi effettuare internamente il download di un apposito pacchetto riconvertito poi in locale in un setup MSI compliant.</p>
<p>Capisco che la suite &#232; composta da software che &#232; nato per l&#8217;utilizzo online, ma probabilmente a Redmond non hanno ancora compreso che non tutti gli utenti, soprattutto quelli che vivono in paesi tecnologiamente &quot;arretrati&quot;, non dispongono ancora di connessioni broadband e che quindi non a tutti va di stare li 30 minuti in dialup a scaricarsi 17 Mbyte di dati per ogni setup.</p>
<p>Fortunatamente il setup di Windows Live, una volta scaricato il pacchetto, salva i file MSI opportunamente convertiti da WLSetupSvc.exe nella cartella <strong>C:\Program Files\Common Files\WindowsLiveInstaller\MsiSources,</strong> senza cancellarli al termine della procedura, permettendo quindi di replicare facilmente l&#8217;installazione su macchine non fornite di connettivit&#224;. </p>
<p>Il formato dei setup MSI &#232; <strong>Install_{GUID}.msi</strong>. Basta andare nelle propriet&#224; di ogni singolo MSI e leggere la parte di metadati (nello specifico il subject) per capire a quale software Windows Live si fa riferimento. Ad esempio il GUID <em>9176251A-4CC1-4DDB-B343-B487195EB397</em> fa riferimento a Live Writer, ottimo software da utilizzare per interfacciarsi al proprio blog engine e postare in maniera veloce senza passare per le varie web application. Ovviamente &#232; possibile rinominare i file MSI senza dover imparare i GUID a memoria <img src='http://blog.michelecerreto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Ho scritto questo post perch&#232; ho notato che sul web, a causa di questa problematica, iniziano a proliferare dei setup da fonti che sicuramente possono essere considerate &quot;untrusted&quot; che banalmente potrebbero infilare in un file MSI qualsiasi cosa provocando gravi danni alle macchine di utenti ignari e alle prime armi. Considerando il target di un prodotto come Messenger diffusissimo tra i giovani, ribadisco il fatto che, secondo me, Microsoft dovrebbe ritornare sui suoi passi fornendo i link per il download dei singoli pacchetti dal proprio sito ufficiale.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/07/11/windows-live-standalone-installer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2008 &#8211; Resharper 4.0 : Failed to load supplementary package</title>
		<link>http://blog.michelecerreto.com/index.php/2008/06/05/visual-studio-2008-resharper-40-failed-to-load-supplementary-package/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/06/05/visual-studio-2008-resharper-40-failed-to-load-supplementary-package/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 16:10:53 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/?p=48</guid>
		<description><![CDATA[Qualche tempo fa avevo provato una delle night build del famoso AddIn Resharper in versione 4.0. Siccome si trattava di una release alpha il software rendeva l&#8217;ambiente di sviluppo di VS 2008 quasi inutilizzabile a causa di problemi di rilascio delle risorse in memoria che praticamente portavano, dopo qualche ora di lavoro, devenv.exe (il processo [...]]]></description>
			<content:encoded><![CDATA[<p>Qualche tempo fa avevo provato una delle night build del famoso AddIn Resharper in versione 4.0. Siccome si trattava di una release alpha il software rendeva l&#8217;ambiente di sviluppo di VS 2008 quasi inutilizzabile a causa di problemi di rilascio delle risorse in memoria che praticamente portavano, dopo qualche ora di lavoro, devenv.exe (il processo principale dell&#8217;ide VS2008) a saturare quasi completamente la memoria di sistema. A causa di questa anomalia e di altri problemi decisi quindi per una disinstallazione del package per poi aspettare l&#8217;uscita di una release pi&#249; stabile di questo utile tool.   <br />Qualche settimana fa Resharper 4.0 &#232; stato rilasciato in versione RC (release candidate). Siccome questa versione risolve la maggior parte dei bugs che affliggevano le versioni precedenti ho deciso di provarla approfittando dei 30 giorni trial.    <br />Il setup si presenta con una gui differente da quelle delle nigh build anche se le varie opzioni sono rimaste le stesse. Terminata la procedura di installazione, lanciando VS, &#232; subito saltata fuori una message box con il seguente errore : </p>
<blockquote><p>&#8216;Failed to load the supplementary package &#8216;<b>0c6e6407-13fc-4878-869a-c8b4016c57fe</b>&#8216;</p>
</blockquote>
<p>Siccome l&#8217;archiettura di VS permette di gestire i vari AddIn in maniera completamente separata dal resto dell&#8217;applicazione il mancato caricamente del package con quel Guid non pregiudica l&#8217;avvio dell&#8217;IDE permettendo quindi di continuare a lavorare anche se le funzionalit&#224; di Resharper sono tutte disabilitate.   </p>
<p>Cercando su google qualche work around al problema sono incappato in un <a href="http://intellij.net/forums/message.jspa?messageID=5207153%3d5207153">thread sul forum di Jetbrains</a> (produttore di Resharper) dove &#232; indicata chiaramente una soluzione al problema. Praticamente &#232; bastato ricorrere all&#8217;uso di una delle opzioni da riga di comando dell&#8217;eseguibile devenv.exe ( a questo <a href="http://msdn.microsoft.com/en-us/library/bb164652.aspx">link</a> &#232; possibile trovare tutte i command line switches per devenv utili al deployment e alla configurazione dei VSPackage ) :</p>
<p>da command prompt lanciato come amministratore:</p>
<p><em><strong>Devenv.exe /</strong><a href="http://msdn.microsoft.com/en-us/library/ms241276.aspx"><strong>ResetSkipPkgs</strong></a></em></p>
<p>ha permesso di resettare tutti i flag di skip loading precedentemente impostati, permettendo, quindi, a VS2K8 di avviarsi senza problemi caricando Resharper in maniera corretta (probabilmente nell&#8217;usare la night build avevo segnalato a VS di non fare il loading del pacchetto che mi dava problemi, ma dopo aver provedduto alla disinstallazione della versione alpha, questo flag era rimasto ed ora la RC 4.0 non riusciva a partire proprio perch&#232; VS saltava il caricamento di quello specifico package).   </p>
<p>Concludendo : &quot;grazie&quot; a questa problematica con Resharper ho scoperto che devenv con i suoi vari command line switches &#232; uno strumento molto versatile per il build &amp; deploy di progetti sln senza nemmeno avviare la GUI dell&#8217;IDE (non conoscevo tutte le varie opzioni disponibili, provate con <em>devenv /?, </em>ci sono cose veramente interessanti).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/06/05/visual-studio-2008-resharper-40-failed-to-load-supplementary-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aggiornamento a WordPress 2.5</title>
		<link>http://blog.michelecerreto.com/index.php/2008/04/23/aggiornamento-a-wordpress-25/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/04/23/aggiornamento-a-wordpress-25/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 11:08:30 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Off Topic]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/?p=47</guid>
		<description><![CDATA[Ho appena aggiornato l&#8217;engine WordPress con cui gira questo blog all&#8217;ultima versione 2.5 (datata 29 marzo 2008). WordPress &#232; uno dei prodotti sviluppati con PHP che ritengo pi&#249; validi, basti pensare alle migliaia di pagine web lette e scritte ogni giorno grazie a questo engine. La versione 2.5 apporta una serie di migliorie sia per [...]]]></description>
			<content:encoded><![CDATA[<p>Ho appena aggiornato l&#8217;engine WordPress con cui gira questo blog all&#8217;ultima versione 2.5 (datata 29 marzo 2008). WordPress &#232; uno dei prodotti sviluppati con PHP che ritengo pi&#249; validi, basti pensare alle migliaia di pagine web lette e scritte ogni giorno grazie a questo engine. La versione 2.5 apporta una serie di migliorie sia per quanto riguarda l&#8217;usabilit&#224; sia sul piano della sicurezza. Ecco quelle che ritengo pi&#249; sigificative :    </p>
<ul>
<li>Interfaccia del pannello di amministrazione completamente ridisegnata </li>
<li>Una dashboard basata sul concetto di widget </li>
<li>Supporto alla funzionalit&#224; di Undo nell&#8217;editing dei commenti </li>
<li>Completo refactoring di XML-RPC </li>
<li>Introduzione della Shortcode API ovvero un set di istruzioni per inglobare delle macro che agiscano sul contenuto del post. </li>
</ul>
<p>Insomma per chi utilizza questo software per mantenere il proprio blog l&#8217;update &#232; vivamente consigliato</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/04/23/aggiornamento-a-wordpress-25/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LINQ, External Mapping Reference e lo schema perduto :)</title>
		<link>http://blog.michelecerreto.com/index.php/2008/03/06/linq-external-mapping-reference-e-lo-schema-perduto/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/03/06/linq-external-mapping-reference-e-lo-schema-perduto/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 16:17:10 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2008/03/06/linq-external-mapping-reference-e-lo-schema-perduto/</guid>
		<description><![CDATA[Oggi, lavorando al domain model di un nuovo progetto, ho scoperto una curiosit&#224; relativa a Visual Studio 2008. Completato il lavoro sul class diagram, stavo per procedere alla creazione dei file XML per il mapping LINQ2SQL (a me non piace l&#8217;approccio del designer DBML, preferisco avere pi&#249; controllo sulle mie entities) quando davanti al caro [...]]]></description>
			<content:encoded><![CDATA[<p>Oggi, lavorando al domain model di un nuovo progetto, ho scoperto una curiosit&#224; relativa a Visual Studio 2008. Completato il lavoro sul class diagram, stavo per procedere alla creazione dei file XML per il mapping LINQ2SQL (a me non piace l&#8217;approccio del designer DBML, preferisco avere pi&#249; controllo sulle mie entities) quando davanti al caro editor di Visual Studio entro nelle propriet&#224; del file XML e cerco appunto lo schema XSD per validare i tag di mapping linq2sql e contestualmente farmi aiutare dal caro vecchio intellisense. Ebbene lo schema non &#232; presente nella cartella di VS2008 (<em>[]\Microsoft Visual Studio 9.0\Xml\Schemas</em>)dedicata allo scopo. A questo punto ho pensato che fosse un problema della mia installazione di VS2008 per cui approdo su MSDN in cerca di chiarimenti.</p>
<p>Ecco quello che riporta la pagina della documentazione relativa a &quot;<strong><em><a href="http://msdn2.microsoft.com/en-us/library/bb386907.aspx">External Mapping Reference (LINQ to SQL)</a></em></strong>&quot; :</p>
<blockquote><p><em>XML Schema Definition File </em></p>
<p><a name="sectionToggle1"><em></em></a></p>
<p><em>External mapping in LINQ to SQL must be valid against the following XML schema definition.</em></p>
<p><em>Distinguish this schema definition file from the schema definition file that is used to validate a DBML file. For more information, see </em><a href="http://msdn2.microsoft.com/en-us/library/bb399400.aspx"><em>Code Generation in LINQ to SQL</em></a><em>).</em></p>
<p><em><b>Note:</b></em></p>
<p><em>Visual Studio users will also find this XSD file in the XML Schemas dialog box as &quot;LinqToSqlMapping.xsd&quot;. To use this file correctly for validating an external mapping file, see </em><a href="http://msdn2.microsoft.com/en-us/library/bb882675.aspx"><em>How to: Validate DBML and External Mapping Files (LINQ to SQL)</em></a><em>.</em></p>
</blockquote>
<p>La nota, come si legge, &#232; molto chiara : il file &#232; incluso nell&#8217;installazione di Visual Studio 2008 standard; il problema &#232; soltanto del mio setup !!??.</p>
<p>Decido, quindi, di googlare ancora e mi ritrovo sul servizio Connect di Microsoft (<a title="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328848" href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328848">https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328848</a>) dove scopro che l&#8217;issue con id 328848 tratta proprio il mio problema. </p>
<p>Ebbene il file XSD, effettivamente manca, e non solo a me. La cosa &#232; stata gi&#224; segnalata qualche settimana fa da <a href="http://blogs.devleap.com/marco/default.aspx">Marco Russo</a> di Dev Leap e io ovviamente mi sono associato quotando il suo feedback su Connect.</p>
<p>Ecco la risposta di Microsoft a Marco : </p>
<blockquote><p><em>Hi,        <br />Sorry for the inconvenience here &#8211; this is a bug. As a workaround, you can use the schema that is indicated on the External Mapping reference page as your schema reference. We will fix the problem in the future.         <br />Thanks.         <br />LINQ to SQL Team</em></p>
</blockquote>
<p>Il workaround come indicato &#232; quello di creare a manina lo schema (&#232; possibile trovare il codice XSD sempre su <strong><em><a href="http://msdn2.microsoft.com/en-us/library/bb386907.aspx">External Mapping Reference (LINQ to SQL)</a>.</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/03/06/linq-external-mapping-reference-e-lo-schema-perduto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MIX08, poche ore dall&#8217;inizio, tutto pronto per il live da Las Vegas</title>
		<link>http://blog.michelecerreto.com/index.php/2008/03/05/mix08-poche-ore-dallinizio-tutto-pronto-per-il-live-da-las-vegas/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/03/05/mix08-poche-ore-dallinizio-tutto-pronto-per-il-live-da-las-vegas/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 15:54:30 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2008/03/05/mix08-poche-ore-dallinzio-tutto-pronto-per-il-live-da-las-vegas/</guid>
		<description><![CDATA[Per chi non conoscesse il MIX : si tratta di una conferenza annuale, tenuta da Microsoft, relativa allo sviluppo Web e alla User Experience in generale. Questa volta siamo alla terza edizione e come negli anni precedenti BigM ha promesso che saranno fatti annunci relativi a nuove tecnologie e rilasci di nuovi strumenti. Per chi, [...]]]></description>
			<content:encoded><![CDATA[<p>Per chi non conoscesse il MIX : si tratta di una conferenza annuale, tenuta da Microsoft, relativa allo sviluppo Web e alla User Experience in generale. Questa volta siamo alla terza edizione e come negli anni precedenti BigM ha promesso che saranno fatti annunci relativi a nuove tecnologie e rilasci di nuovi strumenti.</p>
<p>Per chi, povero mortale, rimane qui in Italia e non pu&#242; godersi l&#8217;agenda direttamente in quel di Las Vegas (io ne approfitterei per fare anche qualche sit &amp; go di texas hold&#8217;em, magari al Bellagio:)), Microsoft ha messo a disposizione il sito <a title="http://visitmix.com/2008/default.aspx" href="http://visitmix.com/2008/default.aspx">http://visitmix.com/2008/default.aspx</a> dove tra poche ore (mentre scrivo il post sono le 16.45 in Italia &#8211; le 07.35 AM a Las Vegas GMT-8, la keynote di apertura &#232; prevista alle 9.30AM) sar&#224; possibile guardarsi in streaming l<font color="#666666">a keynote di Ray Ozzie, Scott Guthrie e Dean Hachamovitch, mentre domani sar&#224; la volta di quella di Steve Ballmer.</font></p>
<p>Ovviamente, la parte tecnicamente appetibile non sono le Keynote, ma le Session in agenda (&#232; possibile visualizzarne l&#8217;elenco da qui <a title="https://content.visitmix.com/public/sessions.aspx" href="https://content.visitmix.com/public/sessions.aspx">https://content.visitmix.com/public/sessions.aspx</a>) che quest anno si preannunciano ricche di &quot;spunti&quot; e tracks interessanti.</p>
<p>Come nelle precedenti edizioni, sar&#224; possibile guardarsi le registrazioni delle sessioni con relativo transcript, slides ed esempi di codice direttamente da <a title="http://sessions.visitmix.com/" href="http://sessions.visitmix.com/">http://sessions.visitmix.com/</a> , pubblicate in differita (24h).</p>
<p>Tempo permettendo cercher&#242; di bloggare le novit&#224; e gli annunci pi&#249; importanti di questa edizione del MIX.</p>
<p>Enjoy MIX 08!!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/03/05/mix08-poche-ore-dallinizio-tutto-pronto-per-il-live-da-las-vegas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quake 3 Arena .NET porting</title>
		<link>http://blog.michelecerreto.com/index.php/2008/01/25/quake-3-arena-net-porting/</link>
		<comments>http://blog.michelecerreto.com/index.php/2008/01/25/quake-3-arena-net-porting/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 12:11:14 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[.NET Framework]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2008/01/25/quake-3-arena-net-porting/</guid>
		<description><![CDATA[Gregs Dolley, uno sviluppatore americano, concentrato soprattutto sulle problematiche di programmazione grafica via OpenGL e DirectX nel mondo managed, &#232; riuscito nella straordinaria impresa di effettuare un porting di uno dei videogiochi pi&#249; famosi al mondo, Quake3 Arena (code base originale di Id Software,&#160; scritta completamente in C), sul framework .NET \ DirectX, con soluzione [...]]]></description>
			<content:encoded><![CDATA[<p>Gregs Dolley, uno sviluppatore americano, concentrato soprattutto sulle problematiche di programmazione grafica via OpenGL e DirectX nel mondo managed, &#232; riuscito nella straordinaria impresa di effettuare un porting di uno dei videogiochi pi&#249; famosi al mondo, Quake3 Arena (code base originale di Id Software,&#160; scritta completamente in C), sul framework .NET \ DirectX, con soluzione di progetto compilabile con Visual Studio 2008.</p>
<p>Le fasi di questa impresa, che definirei titanica, sono state :</p>
<p>&#160;</p>
<p>1) Rendere compilabile il progetto originale di Id Software su Visual Studio 2008 con MSVC++ (questo come spiega Greg, ovviamente non rappresenta un porting vero e proprio su .NET ma semplicemente &quot;<em>a C port to a different compiler&quot;). </em>Questo ha richiesto il fixing di 3000 errori di compilazione, proprio perch&#232; la codebase originale &#232; in C e non in C++;</p>
<p>&#160;</p>
<p>2) Rendere compilabile la soluzione, in uscita dalla fase di cui sopra, abilitando l&#8217;opzione /clr su Visual Studio 2008 per produttore codice managed. Per questo ha dovuto fixare 28.000 errori di compilazione e pi&#249; di 4000 warnings, patchare tutte le chiamate managed in chiamate native, finch&#232; non &#232; stato possibile aprire l&#8217;eseguibile e le dll di supporto in ILDASM (il disassemblatore .NET CLR);</p>
<p>&#160;</p>
<p>Alla fine di questa &quot;battaglia&quot;, la soluzione che Greg ha reso disponibile in download contiene sorgente 99% compilabile in codice managed (IL / CLR bytecode); rimangono tuttavia funzioni che sollevano eccezioni proprio perch&#232; contengono codice assembly x86 inline;</p>
<p>&#160;</p>
<p><a href="http://gregs-blog.com/2008/01/22/update-quake-3-arena-net-port-is-done/">Sul blog di Greg c&#8217;&#232; il post che analizza in dettaglio tutte le varie fasi del porting</a> (LINK)</p>
<p>&#160;</p>
<p>Awesome, Greg!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2008/01/25/quake-3-arena-net-porting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClickOnce, deploy di applicazioni su IIS6 e Windows Server 2003 : una nota</title>
		<link>http://blog.michelecerreto.com/index.php/2007/12/18/clickonce-deploy-di-applicazioni-su-iis6-6-windows-server-2003-una-nota/</link>
		<comments>http://blog.michelecerreto.com/index.php/2007/12/18/clickonce-deploy-di-applicazioni-su-iis6-6-windows-server-2003-una-nota/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 14:29:11 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[.NET Framework]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2007/12/18/clickonce-deploy-di-applicazioni-su-iis6-6-windows-server-2003-una-nota/</guid>
		<description><![CDATA[Questa segnalazione magari pu&#242; essere utile a qualcuno. Utilizzando ClickOnce per il deploy di un applicazione su un server IIS6 / Windows Server 2003, bisogna considerare alcuni accorgimenti al fine di far funzionare per bene il meccanismo. Se la pubblicazione avviene su un virtual folder protetto da Autenticazione integrata di Windows, bisogna ricordare all&#8217;utente finale [...]]]></description>
			<content:encoded><![CDATA[<p>Questa segnalazione magari pu&#242; essere utile a qualcuno.</p>
<p>Utilizzando ClickOnce per il deploy di un applicazione su un server IIS6 / Windows Server 2003, bisogna considerare alcuni accorgimenti al fine di far funzionare per bene il meccanismo.</p>
<p>Se la pubblicazione avviene su un virtual folder protetto da Autenticazione integrata di Windows, bisogna ricordare all&#8217;utente finale di autenticarsi tramite la schermata proposta dal browser, salvando le credenziali utilizzate, altirmenti iis le richieder&#224; per ogni singolo file facente parte della distribuzione (manifest, application, etc.). Questo workaround non &#232; valido per l&#8217;autenticazione Basic.</p>
<p>Inoltre per chi utilizza il deploy da Visual Studio tramite FTP, bisogna : </p>
<ul>
<li>ricordarsi di specificare la url finale dell&#8217;indirizzo utilizzato per il deploy in modo preciso (infatti il manifest e la signature vengono creati a partire da questa informazione, proprio per evitare problemi di sicurezza legati alla sostituzione del pacchetto di setup con uno &quot;non ufficiale&quot;; </li>
<li>ricordarsi di configurare il virtual folder su iis in modo che gestisca i seguenti tipi MIME (senza, il client downloader di ClickOnce potrebbe incappare in una HttpException perch&#232; IIS restituir&#224; errore interno cod 500) : </li>
</ul>
<blockquote><table cellspacing="0" cellpadding="2" width="300" border="0">
<tbody>
<tr>
<td valign="top" width="150"><strong>Estensione</strong></td>
<td valign="top" width="150"><strong>MIME Type</strong></td>
</tr>
<tr>
<td valign="top" width="150">.application</td>
<td valign="top" width="150">application/x-ms-application</td>
</tr>
<tr>
<td valign="top" width="150">.deploy</td>
<td valign="top" width="150">application/octet-stream</td>
</tr>
<tr>
<td valign="top" width="150">.manifest</td>
<td valign="top" width="150">application/x-ms-manifest</td>
</tr>
</tbody>
</table>
</blockquote>
<p>Ricordo, inoltre, che chi utilizza le Front Page Extension per deployare sul server web pu&#242; anche tralasciare i punti di cui sopra perch&#232; Visual Studio provveder&#224; a configurare automaticamente IIS ( c&#8217;&#232; ancora qualcuno con frontpageext sul suo iis ???? <img src='http://blog.michelecerreto.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> )</p>
<p>Per affrondire gli aspetti di configurazione client \ server relativi a ClickOnce, c&#8217;&#232;, ovviamente, MSDN :</p>
<p><a title="http://msdn2.microsoft.com/en-us/library/ms228998.aspx" href="http://msdn2.microsoft.com/en-us/library/ms228998.aspx">http://msdn2.microsoft.com/en-us/library/ms228998.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2007/12/18/clickonce-deploy-di-applicazioni-su-iis6-6-windows-server-2003-una-nota/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET UrlRewrite e AJAX UpdatePanel, problemi di postback</title>
		<link>http://blog.michelecerreto.com/index.php/2007/12/06/aspnet-urlrewrite-e-ajax-updatepanel-problemi-di-postback/</link>
		<comments>http://blog.michelecerreto.com/index.php/2007/12/06/aspnet-urlrewrite-e-ajax-updatepanel-problemi-di-postback/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 13:43:24 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2007/12/06/aspnet-urlrewrite-e-ajax-updatepanel-problemi-di-postback/</guid>
		<description><![CDATA[Come si sa, i motori di ricerca non digeriscono (leggasi indicizzano) per bene le pagine dinamiche con parametri passati su querystring; ecco il motivo per cui si fa uso di tecniche di URLRewriting, ovvero un URL che classicamente potrebbe essere : http://mywebsite/showproduct.aspx?IdProduct = 10 potrebbe essere pi&#249; &#34;search engines friendly&#34; e diventare : http://mywebsite/showproduct/10.aspx In [...]]]></description>
			<content:encoded><![CDATA[<p>Come si sa, i motori di ricerca non digeriscono (leggasi indicizzano) per bene le pagine dinamiche con parametri passati su querystring; ecco il motivo per cui si fa uso di tecniche di URLRewriting, ovvero un URL che classicamente potrebbe essere :</p>
<p><a href="http://mywebsite/showproduct.aspx?IdProduct">http://mywebsite/showproduct.aspx?IdProduct</a> = 10</p>
<p>potrebbe essere pi&#249; &quot;search engines friendly&quot; e diventare :</p>
<p><a href="http://mywebsite/showproduct/10.aspx">http://mywebsite/showproduct/10.aspx</a></p>
<p>In questo modo il motore di ricerca indicizzer&#224; correttamente la pagina web trattandola come se fosse una pagina statica.</p>
<p>La tecnica URLRewriting consiste praticamente nell&#8217;intercettare una Request Web e redirigere questa richiesta su una sorgente differente.</p>
<p>Ai tempi delle ASP l&#8217;unico modo per poter implementare questa tecnica era l&#8217;utilzzo di un filtro ISAPI che gestiva appunto la pipeline della request , supportato da IIS.</p>
<p>Con l&#8217;avvento di ASP.NET e in particolare della versione 2.0, implementare URL Rewriting &#232; diventato molto semplice grazie soprattutto ai concetti di http handler e http module, &quot;strumenti&quot;, che permettono di &quot;mettersi in mezzo&quot; alla normale flusso request-response gestito dal web server per modificarne opportunamente il behavior in base a specifiche regole.</p>
<p>Maggiori informazioni sulle varie tecniche di implementazione si possono trovare sul blog di Scott Gu in questo post <a title="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx" href="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx">http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx</a>.</p>
<p>Tornando allo scopo del post, utilizzando per un progetto web ecommerce, una tecnica di url rewriting basata su RegEx rules e il metodo RewritePath della classe HttpContext in coppia con vari UpdatePanel, sono incappato in un problema dovuto al postback e al fatto che il PageRequestManager delle AJAX Extensions di Microsoft andava abbastanza in confusione tra url originali e virtuali riscritti dal modulo di Url Rewriting. </p>
<p>Praticamente supponendo che l&#8217;absolute path della URL sia :</p>
<p>/showproduct/10.aspx </p>
<p>trasformata in :</p>
<p>/showproduct.aspx?IdProduct = 10</p>
<p>inserendo nella pagina showproduct un UpdatePanel con all&#8217;interno qualsiasi controllo che gestisca l&#8217;evento click ed effettuando postback sulla stessa pagina, stranamente la form&#160; cercava di fare post sulla url /showproduct/showproduct.aspx, ignorando quindi completamente, le mie regole di rewriting.</p>
<p>Il titolo del post cita nello specifico l&#8217;update panel ajax, ma &#232; da notare che l&#8217;anomalia si verifica anche con postback sincroni.</p>
<p>Il problema &#232; dovuto all&#8217;errata url specificata in automatico nella propriet&#224; action dell&#8217;oggetto form, quindi, il tutto &#232; risolvibile risettando la suddetta propriet&#224; con la url virtuale che successivamente il modulo di rewriting si occuper&#224; di trasformare.</p>
<p>Per mettere in pratica questa soluzione &#232; sufficiente :</p>
<p>1) creare una classe che si occupi di settare la propriet&#224; a partire dal HtmlTextWriter della pagina :</p>
<p>&#160;</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:4a37220d-e55b-4cc8-9ac4-2a8f9d3b571c" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> RewriteFormHtmlTextWriter : HtmlTextWriter
{
    </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> inForm;
    </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> _formAction;

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> RewriteFormHtmlTextWriter(System.IO.TextWriter writer)
        : </span><span style="color: #0000FF;">base</span><span style="color: #000000;">(writer)
    {

    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">override</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RenderBeginTag(</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> tagName)
    {
        </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (tagName.ToString().IndexOf(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">form</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">) </span><span style="color: #000000;">&gt;=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)
        {
            </span><span style="color: #0000FF;">base</span><span style="color: #000000;">.RenderBeginTag(tagName);
        }
    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> RewriteFormHtmlTextWriter(System.IO.TextWriter writer, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> action)
        : </span><span style="color: #0000FF;">base</span><span style="color: #000000;">(writer)
    {

        </span><span style="color: #0000FF;">this</span><span style="color: #000000;">._formAction </span><span style="color: #000000;">=</span><span style="color: #000000;"> action;

    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">override</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> WriteAttribute(</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> name, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> value, </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> fEncode)
    {
        </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (name </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">action</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
        {
            value </span><span style="color: #000000;">=</span><span style="color: #000000;"> _formAction;
        }
        </span><span style="color: #0000FF;">base</span><span style="color: #000000;">.WriteAttribute(name, value, fEncode);
    }

}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>&#160;</p>
<p>2) aggiungere alle pagine con url riscritta un override del metodo render che recuperando la variabile di contesto settata dal modulo http per il rewriting&#160; e richiami la classe per il setting della propriet&#224; action</p>
<p>&#160;</p>
</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:eb7fc444-bdae-4c12-9b43-bdc558707b0e" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;"> </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">override</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Render(HtmlTextWriter writer)
    {
        </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (HttpContext.Current.Items[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">VirtualURL</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">] </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
        {
            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> sVirURL </span><span style="color: #000000;">=</span><span style="color: #000000;"> HttpContext.Current.Items[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">VirtualURL</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">].ToString();
            RewriteFormHtmlTextWriter oWriter </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> RewriteFormHtmlTextWriter(writer, sVirURL);
            </span><span style="color: #0000FF;">base</span><span style="color: #000000;">.Render(oWriter);
        }
    }</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p></p>
<p>3) modificare il metodo begin request del HttpModule che si occupa del rewriting (riporto una parte del codice che utilizzo io, solo a scopo dimostrativo)</p>
<p>&#160;</p>
</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:34a7cbfe-9423-4d51-b884-8139f194f3b7" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Rewrite_BeginRequest(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs args)
    {
        </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> strPath </span><span style="color: #000000;">=</span><span style="color: #000000;"> HttpContext.Current.Request.Url.AbsolutePath;

        HttpContext.Current.Items[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">VirtualURL</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">] </span><span style="color: #000000;">=</span><span style="color: #000000;"> strPath;

        </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> strRewrite </span><span style="color: #000000;">=</span><span style="color: #000000;"> RewriterEngine.MiaRegolaRewrite(strPath);

        </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">String.IsNullOrEmpty(strRewrite))
        {
            HttpContext.Current.RewritePath(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">~</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> strURL);
        }

    }</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</p>
<p>Questi tre passi sono sufficienti nel caso non si utilizzi un controllo all&#8217;interno di un UpdatePanel. In caso contrario si dovr&#224; modificare la propriet&#224; action della form con codice javascript lato client, facendo uso dell&#8217;ajax library di microsoft. Questo &#232; necessario proprio perch&#232; il metodo Render viene eseguito solo nel caso di postback completi sincroni, perch&#232; non &#232; necessario fare il rendering della pagina nel caso di partial update dovuto alla presenza di un UpdatePanel.</p>
<p>&#160;</p>
<p>4) Ultimo passo &#232;, quindi, l&#8217;inserimendo all&#8217;interno della pagina del seguente codice javascript che non fa altro che risettare le propriet&#224; action ed initial action della form con la location corrente del browser che altro non &#232; che la nostra url virtuale</p>
<p>&#160;</p>
</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:7b758946-92c1-4480-8ddf-7552174a3ea5" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">Sys.Application.add_load(function()
{
        var form </span><span style="color: #000000;">=</span><span style="color: #000000;"> Sys.WebForms.PageRequestManager.getInstance()._form;
        form._initialAction </span><span style="color: #000000;">=</span><span style="color: #000000;"> form.action </span><span style="color: #000000;">=</span><span style="color: #000000;"> window.location.href;
});</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2007/12/06/aspnet-urlrewrite-e-ajax-updatepanel-problemi-di-postback/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Firefox e il server web integrato in Visual Studio</title>
		<link>http://blog.michelecerreto.com/index.php/2007/10/23/firefox-e-il-server-web-integrato-in-visual-studio/</link>
		<comments>http://blog.michelecerreto.com/index.php/2007/10/23/firefox-e-il-server-web-integrato-in-visual-studio/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 16:47:46 +0000</pubDate>
		<dc:creator>Michele Cerreto</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.michelecerreto.com/index.php/2007/10/23/firefox-e-il-server-web-integrato-in-visual-studio/</guid>
		<description><![CDATA[Utilizzando il suddetto browser con il webserver integrato in Visual Studio 2005 / 2008 &#xE8; possibile notare la sostanziale lentezza nel caricamento delle pagine richiamate su localhost. Il problema &#xE8; dovuto alla risoluzione del nome host e dal sistema che firefox utilizza per gestire l&#8217;IPV6. E&#8217; possibile, quindi, riprodurre questo comportamento su macchine con Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Utilizzando il suddetto browser con il webserver integrato in Visual Studio 2005 / 2008 &#xE8; possibile notare la sostanziale lentezza nel caricamento delle pagine richiamate su localhost.</p>
<p>Il problema &#xE8; dovuto alla risoluzione del nome host e dal sistema che firefox utilizza per gestire l&#8217;IPV6.</p>
<p>E&#8217; possibile, quindi, riprodurre questo comportamento su macchine con Windows XP SP2 e stack IPV6 installato ed ovviamente su Windows Vista dove il supporto IPV6 &#xE8; nativo.</p>
<p>Il problema &#xE8; di facile risoluzione : basta disabilitare il supporto IPV6 relativamente a Firefox quando lo si utilizza per testing su localhost.</p>
<p>Dalla barra degli indirizzi digitare <strong>about:config</strong> per accedere alla lista parametri di configurazione del browser; individuare la chiave <strong>network.dns.disableIPv6 </strong>per cambiare il relativo valore a <strong>true.</strong></p>
<p>Fonte : <a href="http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx">Fixing Firefox Slowness with localhost on Vista</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.michelecerreto.com/index.php/2007/10/23/firefox-e-il-server-web-integrato-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

