Two days ago, I used our test installation of System Center App Controller to create a new virtual machine in one of our Windows Azure accounts.

After the successful creation of the VM, I decided to destroy it. App Controller has sent the command to Azure and deleted the VM but left some garbage: the VM VHD disk into the blob container. Then I tried to delete the VHD via Azure Portal. The portal told me that the operation was successful but I continued to see the VHD (and to waste money on it).

After several more attempts, I decided to use PowerShell Azure commandlets and I was able to delete the VHD (and save money).

In the next days, I will investigate more on the problem. Meanwhile it is nice to know that you can continue to trust PowerShell for real management of systems.

<#
.SYNOPSIS
Send a sequence of keys to an application window

.DESCRIPTION
This Send-Keys script send a sequence of keys to an application window.
To have more information about the key representation look at http://msdn.microsoft.com/en-us/library/System.Windows.Forms.SendKeys(v=vs.100).aspx
(C)2013 Massimo A. Santin - Use it at your own risk.

.PARAMETER ApplicationTitle
The title of the application window

.PARAMETER Keys
The sequence of keys to send

.PARAMETER WaitTime
An optional number of seconds to wait after the sending of the keys

.EXAMPLE
Send-Keys "foobar - Notepad" "Hello world"

Send the sequence of keys "Hello world" to the application titled "foobar - Notepad".

.EXAMPLE
Send-Keys "foobar - Notepad" "Hello world" -WaitTime 5

Send the sequence of keys "Hello world" to the application titled "foobar - Notepad" 
and wait 5 seconds.

.EXAMPLE 
    New-Item foobar.txt -ItemType File; notepad foobar.txt ; Send-Keys "foobar - Notepad" "Hello world{ENTER}Ciao mondo{ENTER}" -WaitTime 1; Send-Keys "foobar - Notepad" "^s"

This command sequence creates a new text file called foobar.txt, opens the file using a notepad,
writes some text and saves the file using notepad.

.LINK
http://msdn.microsoft.com/en-us/library/System.Windows.Forms.SendKeys(v=vs.100).aspx
#>

param (
    [Parameter(Mandatory=$True,Position=1)]
    [string]
    $ApplicationTitle,

    [Parameter(Mandatory=$True,Position=2)]
    [string]
    $Keys,

    [Parameter(Mandatory=$false)]
    [int] $WaitTime
    )

# load assembly cotaining class System.Windows.Forms.SendKeys
[void] [Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
#Add-Type -AssemblyName System.Windows.Forms

# add a C# class to access the WIN32 API SetForegroundWindow
Add-Type @"
    using System;
    using System.Runtime.InteropServices;
    public class StartActivateProgramClass {
        [DllImport("user32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool SetForegroundWindow(IntPtr hWnd);
    }
"@

# get the applications with the specified title
$p = Get-Process | Where-Object { $_.MainWindowTitle -eq $ApplicationTitle }
if ($p) 
{
    # get the window handle of the first application
    $h = $p[0].MainWindowHandle
    # set the application to foreground
    [void] [StartActivateProgramClass]::SetForegroundWindow($h)

    # send the keys sequence
    # more info on MSDN at http://msdn.microsoft.com/en-us/library/System.Windows.Forms.SendKeys(v=vs.100).aspx
    [System.Windows.Forms.SendKeys]::SendWait($Keys)
    if ($WaitTime) 
    {
        Start-Sleep -Seconds $WaitTime
    }
}

Last week I had an interesting conversation with a customer CIO regarding Windows Azure. This guy asked me if he can adopt Azure without to be bound to the platform. Basically he want the possibility of moving his applications to another cloud provider or to on premise systems. We were discussing about PAAS or, to be more precise, to use Windows Azure services like storage, service bus, etc. The main concern was about using these services that are very useful but bind to the platform the solution.

I think that the answer is in good software design. We already have several applications on Windows Azure and one is very big and complex (Big Data Collector, a platform for telemetry and remote control of devices like chillers, energy generators, cars, etc.). When I designed this application I designed the software using some thin isolation layers between the application code and the Azure services API. In this way we would be able to move the software to another cloud provider with few weeks of recoding. In this scenario the main advantage of Azure is that it implements services that have a common behavior with other services (on the cloud or on premise). The result is that we are not locked in with the vendor. And we can concentrate with the advantages that Azure give us like low costs, elasticity, multi tools support (for example BDC is composed by several roles written mainly in C# but it has one written in Java).

At the end the customer began to discuss about how to build an application.

Why people don’t use OpenOffice/LibreOffice/Simphony and prefer the most expensive Microsoft Office?

There are several reasons for this. I think the most commons are:

  1. OpenOffice is not Office.
  2. People are used to Office.
  3. Calc is not Excel.
  4. Office has a lot of features. I know that people use only a small part of these features but this part is different for different part of the people.
  5. Office has VisualStudio (e.g. you can easily write applications that use Office)

A small part of the people use OpenOffice/LibreOffice/Simphony for different reasons:

  1. OpenOffice is cheapest.
  2. Office and Microsoft are against personal religious belief (Microsoft is evil).
  3. They work mainly with different software vendors.

Office is a very complete suite of products and can be used as a integration and development platform, too. You can find several enterprise solutions (even my own company sells GhostWriter, an application server that generates complex documents using rules and combining data from different sources and nobody asked for the same on OpenOffice).

I think that there is a threat to Microsoft dominance but this is not OpenOffice/LibreOffice/Simphony. The threat is the availability of (stupid and a lot more limited) apps on tablets and the availability of web apps as cloud services. I don’t know why but the same people that want a lot of features on PCs applications, can accept apps on tablet with a very limited set of features. Meanwhile webapps are very easy to manage (Microsoft has is own very good proposal, indeed).

Last week I had a problem with an installation of SharePoint 2013. I searched on internet (using Bing) for a solution and I found immediately a post showing how to solve the problem. This post references one of my post in this blog dated three years ago.

This was fun! 🙂 Or perhaps I must be worried for my long term memory! 😦

invito-appunti-di-un-appassionatoCome gli anni passano per il territorio e per la storia, ancora più inesorabili passano per gli uomini. Per fortuna le passioni, se pure e disinteressate, non si spengono facilmente e così la ricerca di Celeste Santin si è spostata dallo scavare nella terra, allo scavare nei libri, nei documenti, nelle carte geografiche, nella corrispondenza antica. Una vera miniera, accumulata in anni e anni di amore per il proprio Paese. Un amore che si può definire orgoglioso, che si riscontra ogni volta che si parla con lui: si rischia di venire ipnotizzati e credere veramente che non esista luogo migliore di Pasiano. E allora cosa mancava a Celeste? Scrivere un libro! Appunti di un appassionato, scritti nella sua famosa taverna museale, senza nessuna pretesa di scientificità, ma per raccogliere notizie interessanti, curiose e divertenti.

Appunti di un appassionato

di Celeste Santin

DOMENICA 17 MARZO / ORE 11.00

MUNICIPIO – Via dei Molini, Pasiano di Pordenone

Intervengono

Claudio Fornasieri, Sindaco di Pasiano di Pordenone

Renzo Tondo, Presidente della Regione FVG

Modera l’incontro

Gigi Di Meo, giornalista

Today I tried to upgrade ODataLib 5.2.0 to ODataLib 5.3.0 in a VisualStudio project.

NuGet complained that this wasn’t possibile because that some versions of some library were not compatible. For example I obtained the message:

Unable to find a version of ‘Nivot.WCFDataServicesToolkit’ that is compatible with ‘Microsoft.Data.Services 5.3.0’.

The solution was very simple: I uninstalled the old version and then I installed the new version.

Ieri ho aggiornato a Windows 8 il mio PC che funge da Media Center in casa. Ho acquistato e scaricato l’aggiornamento dal sito Microsoft e ho richiesto il codice per il Media Center Pack.

L’aggiornamento segue un film già visto. Viene scaricato un software “assistente” che controlla se il PC è aggiornabile o meno. Questo software mi ha detto che fondamentalmente andava tutto bene. Ho quindi proceduto con l’acquisto e lo scarico. Terminata questa ultima fase ho lanciato il setup. E’ importante scegliere la giusta operazione di aggiornamento che si desidera. Io ho scelto di migrare impostazioni e applicazioni.

Il sistema ha fatto tutto da solo e dopo circa un’ora mi sono trovato con Windows 8 installato. Ho quindi attivato il Media Center Pack seguendo le istruzioni contenute nella email insieme con il codice di attivazione. L’attivazione del Media Center ha permesso il recupero di tutte le vecchie configurazioni e registrazioni.

Ho avuto un paio di problemi noiosi.

  1. L’aggiornamento non ha disinstallato Microsoft Security Essentials. Questo software non funziona su Windows 8 ma la sua installazione disattiva Windows Defender (l’antivirus incorporato in Windows 8).  Il problema è che non si riesce neanche a disinstallare questo software perchè l’installatore su Windows 8 non funziona. Per risolvere il problema sono dovuto andare nella cartella c:\program files\Microsoft Security Client, impostare i parametri di compatibilità del programma setup.exe a Windows 7. A questo punto ho lanciato setup.exe /x e finalmente sono riuscito a disinstallare Security Essentials. Finita l’operazione il sistema ha attivato Windows Defender.
  2. Il secondo problema era dovuto al software per la scheda video ATI non aggiornato. Ho provato a scaricare dal sito del produttore l’ultima versione ma il file era corrotto. Ho risolto scaricando la beta della nuova versione.

Ho creato un account Microsoft per sfruttare le varie funzionalità “cloud” del sistema e ho impostato l’autologon per questo utente (digitare la password su un sistema che funziona da sistema di intrattenimento è noioso). Una cosa che ho trovato divertente è navigare sulla nuova interfaccia grafica con il telecomando.

In pratica con questa operazione in casa non abbiamo più Windows 7 ma solo Windows 8.

Siamo alla fase di collaudo finale della nostra nuova applicazione TFC. Questa applicazione è composta da un server J2EE (su WebSphere Application Server) che si interfaccia ad una applicazione gestionale e da un client sconnesso scritto in WPF 4 destinato all’uso su Tablet PC di tipo slate. Una classica applicazione enterprise ma che usa uno strumento “nuovo" (nuovo se tralasciamo il fatto che i Tablet PC esistono da anni).

Una delle macchine papabili per il client è l’Acer Iconia Tab W500. Si tratta di uno slate basato su Windows 7 con un processore AMD, 2GB di RAM, un disco SSD da 32 GB e un touch screen capacitivo a 4 punti molto preciso. In effetti l’interazione è buona e l’uso delle applicazioni tradizionali è assolutamente accettabile (soprattutto se le applicazioni sono in grado di gestire i 120 DPI impostati del monitor). La macchina è anche discretamente veloce. Il peso è di circa 1 Kg. E’ veramente una buona macchina.

Come accennato l’applicazione client è basata su WPF su .NET 4. Con WPF siamo riusciti ad adattare molto bene l’interfaccia utente al touch. E’ evidente a prima vista che non si tratta della solita interfaccia Windows ma di una interfaccia appositamente pensata. In generale questa applicazione ha generato entusiamo tra i clienti ma anche internamente (tanto è vero che stanno nascendo nuove idee commerciali e tecniche).

Ovviamente con questa nostra applicazione WPF, l’Iconia si comporta meravigliosamente. L’applicazione quando è in primo piano si impossessa completamente dello schermo (ma si può sempre switchare su un’altra), gestisce completamente touch e gesture (touch, pan, pinch zoom, ecc.), utilizza icone, comandi e immagini a misura di dita. E lo sviluppo è stato assai più economico che utilizzare iPad. Vedere cosa si può fare utilizzando Windows 7 è notevole. 

Ora aspetto con fiducia che Microsoft faccia una interfaccia alternativa a Windows Explorer. Ma presto per favore.