20.2.25

Postman variable token

- créer une collection
- créer une request
- dans "Authorization", "Auth Type" : "Bearer Token", "Token" : {{MON_TOKEN}}
- sur la collection
- clic droite, Edit
- Scripts / Pre-request
pm.sendRequest({
    url: "https://login.microsoftonline.com/XXX/oauth2/v2.0/token",
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    body: {
        mode: 'urlencoded', 
        urlencoded: [
            { key: "grant_type", value: 'client_credentials' },
            { key: "client_id", value: 'XXX' },
            { key: "client_secret", value: 'XXX' },
            { key: "scope", value: 'https://XXX.crm4.dynamics.com/.default' }
        ]
    }
}      ,
(err, res) => {
    if (err) {
        console.log(err);
        return;
    }
    // Vérifiez si le statut de la réponse est 200
    if (res.code === 200) {
              console.log("OK récupération du token:", res);
        const responseJson = res.json();
        const token = responseJson.access_token;
        // Sauvegarder le token dans une variable d'environnement de collection
        pm.collectionVariables.set("MON_TOKEN", token);
    } else {
        console.log("Erreur lors de la récupération du token:", res);
    }
});
 

13.2.25

exemples github desktop + branches

 - créer un projet sur GitHub.com
- depuis GitHub desktop, faire un clone du projet
- créer un projet C#
- commiter le premier code sur GitHub
- depuis GitHub desktop créer une nouvelle branche "ajout_writeline"
- publish la branche
- ajouter du code dans program.cs
- commiter/push dans la brahce "ajout_writeline"
- depuis GitHub desktop, revenir sur la branche "main"
--> le code ajouté doit disparaitre
- ajout d'une méthode dans program.cs
- commit push dans la branche 'main'
- depuis GitHub desktop, revenir sur la branche "ajout_writeline"
- depuis GitHub desktop, "Create Pull Request"
- si ok, merge pull request
- delete branche "ajout_writeline"
- depuis GitHub desktop, se remettre sur la branche "main" et faire un refresh
--> le code doit être fusionné
- depuis GitHub desktop, supprimer la branche également

12.2.25

page table bootstrap pagination filtre tri

 <!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" />
    <link rel="icon" type="image/png" href="favicon.png" />
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.4/js/dataTables.bootstrap5.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>
<body>
<h1>Liste des articles</h1>
<div class="d-flex justify-content-end mb-3">
    <button class="btn btn-success btn-sm">Ajouter un article</button>
</div>
    <style>
        /* Personnalisation des icônes de tri */
        th.sorting:after, th.sorting_asc:after, th.sorting_desc:after {
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        margin-left: 5px;
        }
        th.sorting:after {
        content: "\f0dc"; /* Icône tri non activé (barres) */
        }
        th.sorting_asc:after {
        content: "\f0de"; /* Flèche haut */
        }
        th.sorting_desc:after {
        content: "\f0dd"; /* Flèche bas */
        }
        /* Ajustement des largeurs de colonnes */
        th, td {
        white-space: nowrap;
        }
      
        th:nth-child(1), td:nth-child(1) {
        min-width: 100px;
        }
        th:nth-child(2), td:nth-child(2) {
        width: 100%;
        }
        th:nth-child(3), th:nth-child(4), th:nth-child(5), th:nth-child(6), th:nth-child(7), th:nth-child(8),
        td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7), td:nth-child(8) {
        width: 1%;
        }
        /* Alignement à droite pour la 3ème colonne */
        th:nth-child(3), td:nth-child(3) {
        text-align: right;
        }
    </style>
    <p>
        <div class="container-fluid">
            <table id="tableArticles" class="table table-striped table-bordered table-sm table-hover table-dark">
                <thead>
                    <tr>
                        <th>Id</th>
                        <th>Nom</th>
                        <th>Prix</th>
                        <th>Actif</th>
                        <th></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>1</td>
                    <td>Ubuntu</td>
                    <td>0.00</td>
                    <td><input type="checkbox" checked="checked" /></td>
                    <td><button class="btn btn-primary btn-sm">Modifier</button></td>
                    <td><button class="btn btn-danger btn-sm">Supprimer</button></td>
                  </tr>
                  <tr>
                    <td>2</td>
                    <td>Linux Mint</td>
                    <td>0.00</td>
                    <td><input type="checkbox" checked="checked" /></td>
                    <td><button class="btn btn-primary btn-sm">Modifier</button></td>
                    <td><button class="btn btn-danger btn-sm">Supprimer</button></td>
                  </tr>
                  <tr>
                    <td>3</td>
                    <td>Windows 11</td>
                    <td>69.90</td>
                    <td><input type="checkbox" checked="checked" /></td>
                    <td><button class="btn btn-primary btn-sm">Modifier</button></td>
                    <td><button class="btn btn-danger btn-sm">Supprimer</button></td>
                  </tr>
                  <tr>
                    <td>4</td>
                    <td>Red Hat</td>
                    <td>0.00</td>
                    <td><input type="checkbox" checked="checked" /></td>
                    <td><button class="btn btn-primary btn-sm">Modifier</button></td>
                    <td><button class="btn btn-danger btn-sm">Supprimer</button></td>
                  </tr>
                  <tr>
                    <td>5</td>
                    <td>Windows 10</td>
                    <td>54.35</td>
                    <td><input type="checkbox" checked="checked" /></td>
                    <td><button class="btn btn-primary btn-sm">Modifier</button></td>
                    <td><button class="btn btn-danger btn-sm">Supprimer</button></td>
                  </tr>
                  <tr>
                    <td>6</td>
                    <td>Android</td>
                    <td>1.00</td>
                    <td><input type="checkbox" checked="checked" /></td>
                    <td><button class="btn btn-primary btn-sm">Modifier</button></td>
                    <td><button class="btn btn-danger btn-sm">Supprimer</button></td>
                  </tr>
                  <tr>
                    <td>7</td>
                    <td>Debian</td>
                    <td>9.99</td>
                    <td><input type="checkbox" checked="checked" /></td>
                    <td><button class="btn btn-primary btn-sm">Modifier</button></td>
                    <td><button class="btn btn-danger btn-sm">Supprimer</button></td>
                  </tr>
                </tbody>
            </table>
        </div>
        <script>
            $(document).ready(function () {
            var table = $('#tableArticles').DataTable({
            "paging": true,
            "lengthChange": false,
            "pageLength": 5,
            "ordering": true,
            "order": [],
            "columnDefs": [
            { "orderable": false, "targets": [2, 3, 4, 5] },
            { "orderable": true, "targets": [0, 1] }
            ],
            "language": {
            "search": "", // Champ de recherche personnalisé
            "paginate": {
            "previous": "Précédent",
            "next": "Suivant"
            },
            "info": "_START_ à _END_ entrée(s) sur _TOTAL_ au total",
            "infoEmpty" : "Aucune entrée",
            "infoFiltered": "(filtré de _MAX_ entrées au total)",
            "zeroRecords": "Aucun enregistrement trouvé",
            },
            "dom": "<'row'<'col-md-6'l><'col-md-6 d-flex justify-content-end mb-3'f>>" +
            "<'row'<'col-sm-12'tr>>" +
            "<'row'<'col-md-6'i><'col-md-6 d-flex justify-content-end'p>>",
            "initComplete": function () {
            $(".dataTables_filter input")
            .attr("placeholder", "Rechercher...")
            .addClass("form-control");
            }
            });
            $('#search').on('keyup', function () {
            table.search(this.value).draw();
            });
            });
        </script>
    </p>
</body>
</html>
x
x

5.11.24

Copilot dans Visual Studio

 copilot dans visual studio :

---------------------------

pour les version récentes de Visual Studio il n'y a plus le petit icône en bas à gauche. du coup en haut à droite - settings - options - "Show inline complétions"

- tab pour accepter la suggestions

- faire un commentaire en expliquant ce que l'on veut et retour à la ligne pour avoir une suggestion

- ALT et . pour changer une suggestion

- ALT et / pour avoir la fenêtre copilot qui s'ouvre dans le code

- dans la fenêtre on peut taper / pour avoir des options

- on sélectionne un bout de code, on fait ALT et /, et on écrit /OPTIMIZE et la touche ENTER

- dans la fenêtre faire # et le nom_d_un_fichier et la question (p.ex peux-tu me décrire les méthodes de ce fichier)

ex : # Program.cs peux-tu me donner le nom des variables globales

- dans le chat p.ex on peut lui dire #le_nom_du_fichier sur lequel on veut agir

- describe the file #Program.cs

- / et quelque chose propose plein de trucs

- /askvs ?????

15.9.24

Intelligence Artificielle

 Certifications :

-------------------------------------------------------

https://learn.microsoft.com/en-us/credentials/certifications/azure-ai-fundamentals/?practice-assessment-type=certification

passée le 05.09.2024, https://learn.microsoft.com/api/credentials/share/en-us/YvesCollet/AF533867FADD5D63?sharingId=43CF8CAB610DC72D

GitHub Copilot

(pas encore les résultats)

Tuto :
--------------------------------------
https://learn.deeplearning.ai/course


Formations :

----------------------------------------

https://www.he-arc.ch/gestion/formation-continue/cas-ia/

https://www.ifage.ch/formation/tic/intelligence-artificielle/developpeur-dintelligence-artificielle-appliquee/#planif-et-inscription

Livres :

--------------------------------

https://www.amazon.de/-/en/dp/B0D81F1GKW?ref=ppx_yo2ov_dt_b_fed_asin_title

https://www.amazon.de/-/en/dp/B0C2RF5665?ref=ppx_yo2ov_dt_b_fed_asin_title

https://www.amazon.de/-/en/St%C3%A9phane-Roder/dp/2416014358/ref=sr_1_2?crid=271Q02EY3SZVA&dib=eyJ2IjoiMSJ9.VNAOygVGfQcsdno8KDcvTyKnar5WFH68wZ7MvdVLIublTO8Svf-EKkxAXDjzPesA2cQM7Oq71JQyJHpTsbt8NnDBf4xYHbiUp5dpZdxhpVhSFnnXVkh9oF_opofk4hfexkNr6gdYaK8oepx9PqS1bld_qKRqaYJIHh4J06OVxoKjUPI2WoHDFQcAHOB5G8o1LzpTZoLV4bkSDR0lq-y96U67ZAvXmRYlCzHgTDsjteI.u30al9F8sMsI5HZu5R3Vqa8nCfTqntFCtzDgvYS0EyA&dib_tag=se&keywords=guide+pratique+de+l%27intelligence+artificielle+en+entreprise&qid=1726419545&sprefix=guide+pratique+de+l%27intelligence+artificielle+en+entreprise%2Caps%2C70&sr=8-2

https://www.amazon.de/-/en/dp/B0D9N6GZ2M?psc=1&smid=A3JWKAKR8XB7XF&ref_=chk_typ_imgToDp


3.6.24

installer ubuntu sur windows

 https://discourse.ubuntu.com/t/install-ubuntu-on-wsl2-and-get-started-with-graphical-applications/26296

25.2.24

installation environnement développement ubuntu

 programmes de base
------------------
sudo apt-get install vlc ubuntu-restricted-addons ubuntu-restricted-extras neofetch gnome-tweaks fuse cpu-x filezilla



développement php
-----------------
- installer dbeaver depuis le site avec le .deb

     - pour que la connexion fonctionne il faut peut-être dans "propriété du pilote" mettre la valeur "true" à "allowPublicKeyRetrieval"

- installer mariadb
    - https://linuxhint.com/install-mariadb-ubuntu-22-04/
    - sudo apt install mariadb-server mariadb-client
    - mariadb --version
    - systemctl status mariadb
    - sudo mysql_secure_installation
        - enter password (vide)
        - unix_socket --> n
        - change the password --> n
        - remove test database --> y
        - reload privilege --> y
    - sudo mariadb
        - flush privileges;
        - create database testdb;
        - show databases;
        - create user 'delphives'@'localhost' identified by 'new password';
        - grant all privileges on *.* to 'delphives'@'localhost';
        - quit;
    - sudo mariadb-upgrade (pour mettre à jour)
- installer github desktop
    - https://gist.github.com/berkorbay/6feda478a00b0432d13f1fc0a50467f1
    - wget -qO - https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null
    - sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main" > /etc/apt/sources.list.d/shiftkey-packages.list'
    - sudo apt update && sudo apt install github-desktop
- installer vscode depuis le site (.deb)
    - installer les modules :
        c# dev kit (microsoft)
        vscode-solution-explorer (fernando escolar)
        github copilot (github)
        github copilot chat (github)
        
        
- installer apache
    - https://www.cherryservers.com/blog/install-lamp-on-ubuntu-22-04
        - sudo apt install apache2 -y
        - sudo systemctl status apache2
        - sudo ufw allow 80/tcp
        - sudo ufw reload
        - sudo ufw status
        - sudo chmod o+w /var/www/html
        - http://localhost (on doit voir la page apache2)
        - les logs apache se trouvent dans /var/log/apache2/error.log
- installer php
    - sudo apt install php -y
    - php --version
    - php -m
    - sudo nano  /var/www/html/info.php
        <php?
            phpinfo()
        ?>
    - aller sur http://localhost/info.php
    - le fichier php.ini se trouve dans /etc/php/8.1/cli/php.ini
- installer composer
    - sudo apt-get install composer
    OU
    - https://www.cherryservers.com/blog/how-to-install-composer-ubuntu
        - sudo apt-get install curl php php-curl
        - curl -sS https://getcomposer.org/installer -o composer-setup.php
        - sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
        - sudo composer self-update
        - sudo composer self-update
        
        
- installer driver mysql pour php
    - sudo apt-get install php8.1-mysql

- les sites webs se trouvent dans /var/www/html

.net core 8.0
------------------
(coller les 10 lignes dans un terminal et exécuter si la version 8 n'existe pas par défaut)
# Get Ubuntu version
declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
# Download Microsoft signing key and repository
wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
# Install Microsoft signing key and repository
sudo dpkg -i packages-microsoft-prod.deb
# Clean up
rm packages-microsoft-prod.deb
# Update packages
sudo apt update

sudo apt-get install zlib1g dotnet-sdk-8.0 aspnetcore-runtime-8.0 software-properties-common apt-transport-https wget


nord
----------------------------
sudo snap install nordpass
wget -c https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn-release_1.0.0_all.deb
sudo apt-get update
sudo apt-get install nordvpn


autres
----------------------
- télécharger le deb pour discord sur le site
- sudo snap install postman

    
mise à jour
-----------
sudo apt-get update && sudo apt-get upgrade && sudo apt-get full-upgrade && sudo apt-get clean && sudo apt-get autoremove


geekbench
---------
https://www.geekbench.com/ml/download/

raccourci
---------
ctrl + alt + t --> ouvrir un terminal


TODO
----
storage account
service bus explorer




- HOPERIS
    - pour donner les droits au répertoire tmpprint --> sudo chmod 777 tmpPrint -R
    - sudo apt install php-xml php-zip php-mbstring php-gd
    - composer require phpoffice/phpword