Category: books

RSCG- AppVersion–part 2

 

 

name ThisAssembly
nuget https://www.nuget.org/packages/ThisAssembly
link https://www.clarius.org/ThisAssembly/
author Daniel Cazzulino

The ThisAssembly.Info allows you access to the Assembly Information as constants, instead of going to reflection each time. I found useful to see the assembly version right away in any project that I have.

 

The code that you start with is in .csproj

<PropertyGroup>
<Version>2021.2.15.800</Version>
</PropertyGroup>

The code that you will use is

var strVersion = ThisAssembly.Info.Version;
Console.WriteLine(strVersion);

 

The code that is generated is

/// <summary>
/// Provides access to the current assembly information as pure constants, 
///  without requiring reflection.
/// </summary>
partial class ThisAssembly
{
    /// <summary>
    /// Gets the AssemblyInfo attributes.
    /// </summary>
    [GeneratedCode("ThisAssembly.AssemblyInfo", "1.0.0")]
    [CompilerGenerated]
    public static partial class Info
    {
        public const string Company = @"RSCG_Version";

        public const string Configuration = @"Debug";

        public const string FileVersion = @"2021.2.15.800";

        public const string InformationalVersion = @"2021.2.15.800";

        public const string Product = @"RSCG_Version";

        public const string Title = @"RSCG_Version";

        public const string Version = @"2021.2.15.800";

    }
}

Example Code: https://github.com/ignatandrei/RSCG_Examples/tree/main/ApplicationVersion

Console2SAAS- post mortem

It was interesting to wrote the mini e-book Console2SAAS with Daniel Tila. We have meet , at non-COVID time , at coffee shops and  hubs and discussing about what each chapter should contain, why, and how to make more easy to read. In COVID times we met over Skype – it was slightly more difficult than meet in person. We have used also a Google Docs in order to wrote together  / finish our ideas

The initial commit was done at 19 March 2019  – so, basic, it took us a year and a half to get  things done ( Ok, I am exaggerating – we did not work full time)

In retrospective, it was fun doing  – but also difficult to clean the ideas and discussing about what it should contain.

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Console2SAAS – what I learned from seventh chapter

The 7th chapter of the Console2SAAS mini-e-book was the most interesting. The Web is a totally different beast from the Desktop application.

  1. The amount of work transforming a single user app to a web app ( not necessary a SAAS app) is not trivial.
  2. That is also a non trivial amount of work of thinking about how to get everything that was for granted ( e.g. folders) into the web.
  3. For load scenario, the architecture of the application should be re-think

You can read the 7th chapter at https://github.com/ignatandrei/console_to_saas/tree/master/Chapter07

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Console2SAAS – what I learned from sixth chapter

The 6th chapter of the mini e-book Console2SAAS it was about  demonstrating to  the reader the problems that has when having multiple clients using the Desktop application- and how to solve it.

That shows to me that an architect is needed to proper engineer and maybe refactor the solution – if it grows beyond expectations. And here there are multiple solutions to do this – depending on the  specific case that you have.

You can read the 6th chapter at https://github.com/ignatandrei/console_to_saas/tree/master/Chapter06

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Console2SAAS – what I learned from fifth chapter

In the chapter 5 of Console2SAAS I wanted to show the user the challenges of having a client . Any new client will come with some different use case scenario , even for the smallest assumption in the original project. And here the power of DI can be shown. I have had zero  problems trying to get a real life scenario from such a small example – parsing folder with multiple Word documents. The Zip file is the easy equivalent of a folder . That shows that even the small application, if released into the wild and used by someone, can have multiple changes.

You can find chapter 5 at https://github.com/ignatandrei/console_to_saas/tree/master/Chapter05

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Console2SAAS – what I learned from fourth chapter

The fourth chapter of the mini e-book Console2SAAS show me that , if you have properly construct the console application, the GUI ( Windows Forms, for example) should not be so difficult to made. The problem now is the feedback to the user – you must somehow re-design the logic in order to ensure some graphical indicators to the user that the application is working. Also, because you do not have only the console, some logging should be involved. And , from a technical perspective, now it is the real challenge : do not duplicate code because you have now the 2 GUI : Console and Desktop.

You can read the 4th chapter at https://github.com/ignatandrei/console_to_saas/tree/master/Chapter04

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Console2SAAS – what I learned from third chapter

The third chapter of the mini-e-book Console2SAAS shows me that I should not re-invent the wheel. Of course, it is easy to make a code that reads settings – but why do it so if there are libraries already in the framework  ?

Also, even a such simple task ( reading the setting) , in order to do properly, there is some amount of work and priorities involved – the application can read from environment variables, command line, configuration file, code … plenty of options – and what if the user mix and match those ? What you pick first ?

You can read online at https://github.com/ignatandrei/console_to_saas/tree/master/Chapter03

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Console2SAAS – what I learned from second chapter

The second chapter of Console2SAAS is very short. I realized that , as soon that you have the software , you want to have an ecosystem around it – version control, automatic CI . Also, if the software is released even to beta testers, you should have some refactoring done in order to have the solution structured properly for modifications.

You can find the second chapter at https://github.com/ignatandrei/console_to_saas/tree/master/Chapter02

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Book-Console2SAAS – what I learned from first chapter

The first chapter of the Console2SAAS book showed me that even the first iteration of an application could have interesting challenges.

  1. It was about how to structure the code – it is easy to set up properly from the start .
  2. Creating even simple code ( in this case, that creates an Excel file) is somehow difficult
  3. There are already general purposes libraries that you could use – no need to do everything from scratch
  4. Choosing between libraries  is a daunting task
  5. There are more to the console application that you could implement – see , for example, https://github.com/migueldeicaza/gui.cs

Read the chapter online at https://github.com/ignatandrei/console_to_saas/tree/master/Chapter01

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Book–Console2SAAS–technical details and CD

One of the important thing about creating a book is how to have fast feedback you see it after you write some texts. I decided to go like this:

  1. Each chapter will be in his own folder  ( https://github.com/ignatandrei/console_to_saas/tree/master/Chapter01 , https://github.com/ignatandrei/console_to_saas/tree/master/Chapter02 , and so on) .
  2. The content will be in the readme.md in each chapter folder ( to have a fast feedback about how it looks)
  3. The code examples will be in the same folder as the chapters
  4. The whole book will be available for download as PDF ( also other formats)
  5. The whole book will be easy seen at Github pages ( https://ignatandrei.github.io/console_to_saas/ )

How I made this available ? As usual, GitHub actions to the rescue – and some easy javascript. First, the javascript

“use strict”;

(async () => {

console.log(`start print`);

const { badgen } = require(“badgen”);

const sloc = require(“node-sloc”);

const fs = require(“fs”);

const chapters = [

“Chapter01”,

“Chapter02”,

“Chapter03”,

“Chapter04”,

“Chapter05”,

“Chapter06”,

“Chapter07”,

];

for (var i = 0; i < chapters.length; i++) {

var item = chapters[i];

var res= await sloc({ path: `../${item}/` });

  console.log(res);

const svgString = badgen({

      label: `${item}`, // <Text>

      labelColor: “ADF”, // <Color RGB> or <Color Name> (default: ‘555’)

      status: `files:${res.sloc.files};lines:${res.sloc.loc}`, // <Text>, required

      color: “blue”, // <Color RGB> or <Color Name> (default: ‘blue’)

      style: “flat”, // ‘flat’ or ‘classic’ (default: ‘classic’)

//icon: ‘data:image/svg+xml;base64,…’, // Use icon (default: undefined)

//iconWidth: 13,    // Set this if icon is not square (default: 13)

      scale: 1, // Set badge scale (default: 1)

    });

    fs.writeFileSync(`../${item}.svg`, svgString);

}

var markdownpdf = require(“markdown-pdf”);

var mdDocs = [

“../README.md”,

“../1-break.md”,

“../Chapter01/readme.md”,

“../1-break.md”,

“../Chapter02/readme.md”,

“../1-break.md”,

“../Chapter03/readme.md”,

“../1-break.md”,

“../Chapter04/readme.md”,

“../1-break.md”,

“../Chapter05/readme.md”,

“../1-break.md”,

“../Chapter06/readme.md”,

“../1-break.md”,

“../Chapter07/readme.md”,

“../1-break.md”,

“../conclusions.md”

  ],

  bookPath = “../book-raw.pdf”;

var options = {

  remarkable: {

      html: true,

      breaks: true

  },

  runningsPath: ‘running.js’

}

function generateBook() {

return new Promise(function(resolve, reject) {

    markdownpdf(options)

      .concat.from(mdDocs)

      .to(bookPath, function () {

        console.log(“Created”, bookPath);

        resolve(bookPath);

      });

  });

}

var bookPath = await generateBook();

const PDFMerger = require(‘pdf-merger-js’);

var merger = new PDFMerger();

merger.add(“../cover.pdf”);

merger.add(“../book-raw.pdf”);

await merger.save(“../book.pdf”);

})();

As you see , I am using those JS packages

“badgen”: “3.0.1”,

“markdown-pdf”: “10.0.0”,

“pdf-merger-js”: “3.0.5”,

“node-sloc”: “0.1.12”

Forgetting number of lines and badges, I use badgen and node-sloc . For generating pdf, I use markdown-pdf and pdf-merger ( to put images)

For generating ODT, I use githb actions directly :

name: ‘CD for generate book and docs folder’

env:

ChaptersMD : Chapter01/readme.md Chapter02/readme.md  Chapter03/readme.md Chapter04/readme.md  Chapter05/readme.md Chapter06/readme.md  Chapter07/readme.md

on:

push:

paths:

    – ‘**.md’

    – ‘**.yml’

    – ‘**.txt’

    – ‘**.json’

    – ‘**.js’

jobs:

build:

runs-on: ubuntu-latest

steps:

    – uses: actions/checkout@v2

    – name: generate pdf

run: |

        chmod +x ./print/getBook.bat

        cd print       

        ./getBook.bat

        ls -lh

        cp ./book.pdf ../docs/ConsoleToSaas.pdf

        cp ./Chapter01.svg ../docs/Chapter01.svg

        cp ./Chapter02.svg ../docs/Chapter02.svg

        cp ./Chapter03.svg ../docs/Chapter03.svg

        cp ./Chapter04.svg ../docs/Chapter04.svg

        cp ./Chapter05.svg ../docs/Chapter05.svg

        cp ./Chapter06.svg ../docs/Chapter06.svg

        cp ./Chapter07.svg ../docs/Chapter07.svg

        # cp ./Chapter01.svg ../Chapter01/Chapter01.svg

        # cp ./Chapter02.svg ../Chapter02/Chapter02.svg

        # cp ./Chapter03.svg ../Chapter03/Chapter03.svg

        # cp ./Chapter04.svg ../Chapter04/Chapter04.svg

        # cp ./Chapter05.svg ../Chapter05/Chapter05.svg

    – name: upload pdf to artifacts

uses: actions/upload-artifact@v1

with:

name: ConsoleToSaas.pdf

path: ./print/book.pdf

    – name: Commit files

run: |

        git config –local user.email “action@github.com”

        git config –local user.name “GitHub Action”

        git commit -m “generate pdf” -a –allow-empty

    – name: Push changes

uses: ad-m/github-push-action@master

with:

github_token: ${{ secrets.GITHUB_TOKEN }}

convert_via_pandoc:

runs-on: ubuntu-18.04

needs: build

steps:

      – uses: actions/checkout@v2

      – run: |

          echo chapters to generate $ChaptersMD

          git pull

          mkdir output

      – name: generate odt

uses: docker://pandoc/latex:2.9

with: # needs a README in your repo root!

args: “cover.md README.md Chapter01/readme.md Chapter02/readme.md  Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md Chapter07/readme.md conclusions.md –standalone -f gfm -t odt  –toc -o output/output.odt –metadata title=CLI/Console2SAAS”

      – name: generate epub

uses: docker://pandoc/latex:2.9

with: # needs a README in your repo root!

args: “cover.md README.md Chapter01/readme.md Chapter02/readme.md  Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md Chapter07/readme.md conclusions.md –standalone -f gfm -t epub  –toc -o output/output.epub –metadata title=CLI/Console2SAAS”

      – name: generate docx

uses: docker://pandoc/latex:2.9

with: # needs a README in your repo root!

args: “cover.md README.md Chapter01/readme.md Chapter02/readme.md  Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md  Chapter07/readme.md conclusions.md –standalone -f gfm -t docx  –toc -o output/output.docx –metadata title=CLI/Console2SAAS”

      – name: generate html

uses: docker://pandoc/latex:2.9

with: # needs a README in your repo root!

#args: “–standalone –output=output/README.html README.md”

args: “cover.md README.md Chapter01/readme.md Chapter02/readme.md  Chapter03/readme.md Chapter04/readme.md Chapter05/readme.md Chapter06/readme.md  Chapter07/readme.md  conclusions.md –standalone -f gfm -t html  –include-in-header=header.txt –toc -o output/output.html –metadata title=CLI/Console2SAAS”

      – uses: actions/upload-artifact@master

with:

name: output

path: output

      – run: |

          cp ./output/output.html ./docs/index.html

          cp ./output/output.epub ./docs/ConsoleToSaas.epub  

          cp ./output/output.docx ./docs/ConsoleToSaas.docx

          cp ./output/output.odt ./docs/ConsoleToSaas.odt

          rm -rf ./output

      – name: Commit files

run: |

          git config –local user.email “action@github.com”

          git config –local user.name “GitHub Action”

          git commit -m “generate html” -a –allow-empty

      – name: Push changes

uses: ad-m/github-push-action@master

with:

github_token: ${{ secrets.GITHUB_TOKEN }}

zipSources:

runs-on: ubuntu-latest

needs: [build,convert_via_pandoc]

steps:

    – uses: actions/checkout@v2

    – name: pulling latest

run: |

        echo chapters to generate $ChaptersMD

        git pull     

        rm ./docs/sources/*.zip

# – uses: montudor/action-zip@v0.1.0

#   with:

#     args: zip -qq -r ./Chapter01.zip ./docs/sources/Chapter01.zip

    – name: Zip Release Chapter01

uses: TheDoctor0/zip-release@v0.2.1

with:       

filename: ./docs/sources/Chapter01.zip

path: ./Chapter01/FastExtractDocumentMetadata

    – name: Zip Release Chapter02

uses: TheDoctor0/zip-release@v0.2.1

with:       

filename: ./docs/sources/Chapter02.zip

path: ./Chapter02/FastExtractDocumentMetadata

    – name: Zip Release Chapter03

uses: TheDoctor0/zip-release@v0.2.1

with:       

filename: ./docs/sources/Chapter03.zip

path: ./Chapter03/FastExtractDocumentMetadata

    – name: Zip Release Chapter04

uses: TheDoctor0/zip-release@v0.2.1

with:       

filename: ./docs/sources/Chapter04.zip

path: ./Chapter04/FastExtractDocumentMetadata

    – name: Zip Release Chapter05

uses: TheDoctor0/zip-release@v0.2.1

with:       

filename: ./docs/sources/Chapter05.zip

path: ./Chapter05/FastExtractDocumentMetadata

    – name: Zip Release Chapter06

uses: TheDoctor0/zip-release@v0.2.1

with:       

filename: ./docs/sources/Chapter06.zip

path: ./Chapter06/FastExtractDocumentMetadata

    – name: Zip Release Chapter07

uses: TheDoctor0/zip-release@v0.2.1

with:       

filename: ./docs/sources/Chapter07.zip

path: ./Chapter07/FastExtractDocumentMetadata

# – name: Zip Release Chapter05

#   uses: TheDoctor0/zip-release@v0.2.1

#   with:       

#     filename: ./docs/sources/Chapter05.zip       

#     path: ./Chapter05/FastExtractDocumentMetadata

    – name: Commit files

run: |

        git config –local user.email “action@github.com”

        git config –local user.name “GitHub Action”

        git add –all

        git commit -m “generate zip files” -a –allow-empty

    – name: Push changes

uses: ad-m/github-push-action@master

with:

github_token: ${{ secrets.GITHUB_TOKEN }}

#   runs-on: windows-latest  

#   # runs:

#   #   using: ‘docker’

#   #   image: ‘print/exportPDF.txt’

#   steps:

#   – uses: actions/checkout@v2

#   – name: print pdf

#     run: |

#       cd print

#       ./getBook.bat

I know that are really lot of code, but the scope was done: genreating pdf  , odt, word and epub.

Blog posts about this topic

Console2SAAS

A mini-e-book about how to transform a Console to a SAAS application
Download the book for free from https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html
Buy the book from Amazon , if you want to support me : https://www.amazon.com/dp/B08N56SD4D
NoBlog 
1Introduction
2Technical Details
3Console2SAAS-Chapter1
4Console2SAAS-Chapter2
5Console2SAAS-Chapter3
6Console2SAAS-Chapter4
7Console2SAAS-Chapter5
8Console2SAAS-Chapter6
9Console2SAAS-Chapter7
10Console2SAAS-PM

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.