Featured Posts

<< >>

Light & Shades

Light & Shades, originally uploaded by mszmsz. When you play too much with tone curves, individual color saturation, luminance and other mysterious settings…this is the result. You even risk to win a photo competition

Vuoi fare un concorso?? Allora paga!

É di ieri la notizia che per sanare le casse dell’insanabile stato italico é stata approntata una bella tassa! “Vuoi venire a fare il concorso pubblico?? Ed allora paga!!” Una punizione dantesca per i poveracci che si illudono ancora che i concorsi pubblici servano a qualcosa. Si muoveranno anche i privati sull’onda di questa geniale [...]

Concorso fotografico Leica

Ho preso parte al concorso fotografico indetto dalla Leica. Cosi’ un po per sfizio ed un po’ perche’ e’ gratis…anzi sopratutto perche’ e’ gratis Se volete vedere le mie foto (sono solo 3) ed eventualmente votarmi lo potete fare a questo link: http://www.lab.leica-camera.it/jspleica/scheda.jsp?n=19244

Qual’è la sua qualità migliore è la sua peggiore?

Questa è la solita domanda standard che i recruiter e le HR (dico ‘le’ perchè non ho mai visto un HR uomo) fanno ai colloqui di lavoro. Forse l’hanno letta su Topolino e Riza Psicosomatica e la sfoggiano così a sorpresa. Bisogna essere preparati a fronteggiarla. Io rispondo sempre che la mia qualità migliore è [...]

Light & Shades



Light & Shades, originally uploaded by mszmsz.

When you play too much with tone curves, individual color saturation, luminance and other mysterious settings…this is the result. You even risk to win a photo competition :-)

Vuoi fare un concorso?? Allora paga!

É di ieri la notizia che per sanare le casse dell’insanabile stato italico é stata approntata una bella tassa! “Vuoi venire a fare il concorso pubblico?? Ed allora paga!!” Una punizione dantesca per i poveracci che si illudono ancora che i concorsi pubblici servano a qualcosa.

Si muoveranno anche i privati sull’onda di questa geniale idea? Se lo stato mi chiede dei soldi per partecipare ad un concorso perché mai una societá privata dovrebbe farmi un colloqui gratis? Al prossimo candidato che intervisteró chiederó 100 Euro!

Sempre in culo ai poveri!! SEMPRE

Concorso fotografico Leica

Ho preso parte al concorso fotografico indetto dalla Leica. Cosi’ un po per sfizio ed un po’ perche’ e’ gratis…anzi sopratutto perche’ e’ gratis :-)
Se volete vedere le mie foto (sono solo 3) ed eventualmente votarmi lo potete fare a questo link:
http://www.lab.leica-camera.it/jspleica/scheda.jsp?n=19244

Qual’è la sua qualità migliore è la sua peggiore?

Questa è la solita domanda standard che i recruiter e le HR (dico ‘le’ perchè non ho mai visto un HR uomo) fanno ai colloqui di lavoro.
Forse l’hanno letta su Topolino e Riza Psicosomatica e la sfoggiano così a sorpresa.
Bisogna essere preparati a fronteggiarla.
Io rispondo sempre che la mia qualità migliore è l’onestà e la mia qualità peggiore è l’onestà.
Se volete essere originali potete variare sul tema: per esempio la mia qualità migliore è la modestia e la peggiore l’onestà…o cose del genere.
Buoni colloqui a tutti!

How to invoke a LANDesk MBSDK web service method using Power Shell

The LANDesk MBSDK has many methods that normally are invoked though an application (Service Consumer) that generally sends a SOAP message to them.

These methods are generally invokable even using the POST method.

If you want to invoke them through an HTLM page you can refer to the article DOC-21894 but if you need to make some calls to the MBSDK methods using a script you can use Windows PowerShell.

SO LET’ S DO IT

# In this example we run this script on the core server itself, so we use localhost in the uri parameter
# but if you want run this script from an alternative location you will need to substitute localhost with
# the name of the core server.
#
# We need to authenticate to the webservice as a user that can use LANDesk so if we want to avoid to be prompted
# for a username and password we need to create a PSCredential object to pass to the New-WebServiceProxy
$secpasswd = ConvertTo-SecureString "mypassword" -AsPlainText -Force$mycreds = New-Object System.Management.Automation.PSCredential ("myusername", $secpasswd)
$myWS = New-WebServiceProxy -uri http://localhost/MBSDKService/MsgSDK.asmx?WSDL -Credential $mycreds
# at this point the variable $myWS 'points' to an instance of the Web Service.

Now that we created an instance of the Web Service we can call the methods of it.

# Let try to call a method of it now...
$myWS.GetAgentBehaviors(1)
# Using a Method name without parenthesis in PowerShell we get information about the Method.
# Example: $myWS.ScheduleDistribution

C# preprocessor directives

I was playing around VS2008 finding a way to speed up my job and following a request of a colleague of mine I needed to split my monolithic plugin project in two parts.

I evaluated various possibilities and then I dediced to try to use the C# preprocessor directives to be able to build two different version of my plugin without splitting the project in two.

In my project I had the need to have a DEBUG mode that instead of creating the XML and the log file in the location expected by the Healhcheck viewer creates them in the same location from the where the EXE is run.

The second need was to write in the output XML different sections depending on the plugin type.

To achieve the two goals I defined two Conditional compilation symbols: PLATFORM and ALPHATEST and then I started to use the C# preprocessor directives #if, #elif in this way:

 

#if (LDMS)

private const string logName =@”\myldms.log”;
private const string xmlName = @”\myldms.xml”;
private const string dirOutName = @”CoreInfo”;

#elif(PLATFORM)

private const string logName = @”\myos.log”;
private const string xmlName = @”\myos.xml”;
private const string dirOutName = @”PlatformInfo”;

#endif

So if LDMS is defined (in the Build tab of the project properties) some part the code are compiled, if PLATFORM is defined other parts are compiled and so on… But what happens if no symbols are defined or both of them are?? We need some control here that can be achieved with the #error directive

#if (!LDMS && !PLATFORM)
#error Defining LDMS or PLATFORM compiler directive is mandatory
#endif
#if (LDMS && PLATFORM)
#error Defining LDMS and PLATFORM as the same time is not permitted
#endif

Seems quite nice but it was a bit annoying to define manually the symbols, build the project, rename the executables ans so on for 4 times…

So I started to use the  Batch Build,Configuration Manager and Build Events feature of VS2008

I had then two goals in mind:

  1. Avoid to manually define the symbols and build every time.
  2. Avoid to manually rename the output file (the EXE) every time.

Let’s start with the Configuration Manager

  1. From the Build menu’ select the option Configuration Manager.
  2. From the Configuration dropdown select the option New.
  3. Copy the setting from the current configuration and give it a name (example: LDMS Plugin). Keep the checkbox “Create new solution configurations” checked and press OK.
  4. Repeat the process for all the configurations you need (I needed four).

Now that we have many different configurations we need to ‘configure’ them with different Conditional compilation symbols

  1. Go to the project properties in the Build tab.
  2. Select from the dropdown the configuration you want to set and then set the Conditional compilation symbols that you need.
  3. Press SAVE and repeat the process for all your newly created configurations.

Now is the moment when Build Events kicks in

To be able to have the name of the EXE different for every build you need to play with the post-build event command line and its macros.

Do not worry about the macros syntax: in the “Edit Post-build” GUI a Macros button in available with all the macros you need (they are variables at the end) and their current value.

I used this command line in the post-build command:

 

rename “$(TargetPath)” “$(ConfigurationName)$(TargetExt)”

The result is that the EXE will be renamed after the build phase with the configuration name and the .exe extension (es: CoreInfoOS.exe)

But how we can benefit from this doing all the four (or more) compilation at the same time obtaining then the full automation?

Select the option Batch build in the Build menu and select all the configuration that you want to build and then press the button Build

This article is quite a basic and fast introduction to this interesting topic. Please feel free to send me suggestion on hot to enhance it or any question you have in mind.

I dei hanno bisogno di lavorare?

Ho fatto molti colloqui di lavoro, risposto ad inserzioni, analizzato “job position statements” e mi sono fatto un idea delle qualitá necessarie a superare queste selezioni ed ad essere finalmente assunto.

Bisogna essere una sorta di Dio greco (chiaramente non toccato dal fallimento della Grecia) sempre giovane, invincibile, conoscitore di tutto lo scibile umano ed intergalattico, avere il dono della bilocazione (se non multilocazione), avere un IQ superiore a 9000 ed una dialettica tale da poter convincere chiunque a fare qualsiasi cosa.

Questi direi sono i requisiti base.

C’é secondo me un problema di fondo: Ammettiamo per assurdo che un DIO simile esista.

La domanda é: se esistesse veramente che bisogno avrebbe di lavorare?

Oggi mi é presa cosí

sommatoria(0)-> 0;
sommatoria(X) ->
X+sommatoria(X-1).
sommatoria(X,X) -> X;
sommatoria(X,Y) when Y >= X ->
Y+sommatoria(X,Y-1).

 

Domanda: quanto fa sommatoria(25) ??

 

Canterbury

_MG_8860.jpg_MG_8861.jpg_MG_8862.jpg_MG_8864.jpg_MG_8865.jpg_MG_8867.jpg
_MG_8868.jpg_MG_8875.jpg_MG_8881.jpg_MG_8883.jpg_MG_8887.jpg_MG_8912.jpg
_MG_8920.jpg_MG_8923.jpg_MG_8924.jpg_MG_8929.jpg_MG_8930.jpg_MG_8931.jpg
_MG_8953.jpg_MG_8955.jpg_MG_8963.jpg_MG_8970.jpg

Canterbury, a set on Flickr.

Gita a Canterbury. Luglio 2011.

Canterbury and Wisthable

IMG_20110703_213841IMG_20110703_213717IMG_20110703_213646IMG_20110703_213607IMG_20110703_203631IMG_20110703_175752
IMG_20110703_175541IMG_20110703_175452

Canterbury and Wisthable, a set on Flickr.

A nice British Sunday….