Archivi tag: how-to

GIT LEZIONE 3 – git reset: soft mixed hard – cosa fa

Introduzione

Devi annullare delle modifiche? Devi ritornare a uno stato precedente? Git reset è un comando molto potente che permette di tornare indietro e riscrivere la storia.

I 3 tree di git

Per capire git reset cosa fa, dobbiamo avere ben presente i tre “tree” di git.

  • Working Directory – La cartella di lavoro
  • Index – Il contenuto del prossimo commit che verrà fatto.
  • HEAD – Puntatore al branch attivo.

Git reset –soft

Questa è la prima variante del comando reset. Questa opzione sposta solamente HEAD al commit indicato col comando.

git reset commitid --soft

Git reset –mixed

Questa seconda variante è quella di default, quando non viene specificato altro. In questo modo git opera anche sull’INDEX. Viene quindi eseguito quanto fatto nella variante SOFT e in più viene riportato INDEX al contenuto del commit scelto.

git reset commitid --mixed

Git reset –hard

La terza variante, –hard, aggiunge un ulteriore step a quanto fatto dalla –mixed. Git opera anche nella working folder, riportandola al contenuto del commit indicato.

git reset commitid --hard

Videolezione

How to share an Azure DevOps Artifact feed with the entire organization

Azure Feeds used to be scoped to an organization. However, to enable public feeds and to become more consistent with the rest of Azure DevOps, feeds created through the new create feed UI are now project-scoped.

The only way to create an org-scoped Azure Artifact Feed is through API calls and it’s not reccomended.

If we want to share a feed with an entire organization this is what we need to do.

Continua a leggere How to share an Azure DevOps Artifact feed with the entire organization

How to fix 8000000A error when building VDPROJ

The Microsoft Visual Studio Setup Project is an old technology to create installer developed by Microsoft. It is out of support from nearly a decade and not present in Visual Studio anymore but when I visit customer sites I find legacy technologies and I need to deal with it on the short-term.

A couple of days ago I was working on an automated CI build on Azure DevOps and we hit an issue when trying to compile an old VDPROJ (migration to Wix in progress, btw ☺). We encountered an HRESULT 8000000A error.

Continua a leggere How to fix 8000000A error when building VDPROJ

How to create a self-signed certificate with PowerShell

When we develop web-application or experiment with some technologies it’s quite common to need a certificate. A certificate for real world scenarios can be expensive and it’s over-engineering for testing purposes. So with this simple PowerShell script (on Windows) we can create a self-signed certificate for development enviroments.

$cert = New-SelfSignedCertificate -DnsName mydemowebapp.net -CertStoreLocation cert:\LocalMachine\My

$pwd = ConvertTo-SecureString -String "MyPassword" -Force -AsPlainText

Export-PfxCertificate -Cert $cert -FilePath C:\temp\cert.pfx -Password $pwd

With these few line of codes we create and store a self-signed certificate in the Windows Certificate Store. With the last line (Export-PfxCertificate) we export the certificate for furher use for example to do some experiments with cloud providers.

Reference

GitHub Gist

Xamarin Forms & .NET Standard – Getting started

In this blog post we’re going to lay the basis for future posts about Xamarin Forms. We’ll explore briefly what’s Xamarin Forms and why it’s so powerful. Then we’ll talk about .NET Standard and we’ll understand why it’s a very big achievement for the .NET ecosystem. Continua a leggere Xamarin Forms & .NET Standard – Getting started

How to setup a Private Agent in Visual Studio Team Services

In the last post about VSTS (Visual Studio Team Services) we setup the foundations for a project.

In this we install a private agent to build and deploy our project.

VSTS provides hosted agents to build and deploy. When we use a hosted agent, Microsoft takes care of the maintenance and upgrades. So for many teams this is the simplest way. Every agent has a set of capabilities that indicate what it can do. Capabilities are name-value pairs that are either automatically discovered by the agent software, in which case they are called system capabilities, or those that you define, in which case they are called user capabilities.
If the hosted agents do not suit our needs we can setup our dedicated agent and that’s the topic of this post.

Continua a leggere How to setup a Private Agent in Visual Studio Team Services

How to get started with Visual Studio Team Services

In this post we’re going to explore how to get a full enterprise-grade development platform for free in 4 steps. Microsoft is offering for free the same environment that all of its sw engineers use every day to us.
Continua a leggere How to get started with Visual Studio Team Services

UWP Prism Unit Test

I’m sure we all hear about unit testing, test driven development and so on. These practices are useful and provide a long list of benefit like writing low-coupled and mantainable code to name a few.

We want to write unit test for our UWP Prism application and we’d like, for example, to put our ViewModels under tests to make sure the logic they implement is correct. Unit testing is possible only if we can get rid of all the dependencies in our class under test because we want to run our test every time we want (for exemple when the service library our teammate is writing is not yet finished) and as fast as we can.

Continua a leggere UWP Prism Unit Test

The best tip on software estimation I’ve ever found

Count if at all possible. Compute when you can’t count. Use judgment alone only as  last resort. (Steve McConnell)

imagesKKBBN896.jpg

Count-first is the approach that Steve McConnell suggests in his Software Estimation book.

If you can count the answer directly you should that. […]
If you can’t count the answer directly, you should count something else and then compute the answer by using some sort of calibration data.

Reading about this approach makes me think about how I estimated things in the past. My job is changing and the tasks of estimating and scheduling are more frequent. I know that software estimation is hard and crucial for every project to succeed.

If you, like me, are having troubles on software estimation I strongly recommend Steve McConnell’s books “Software Project Survival Guide” and “Software Estimation”. They are like strong related cousins; you’ll be a better software project manager if you know how to estimate and you’ll estimate better if you know how a software project has to be done.