TEST






Nouveau Test avec image V2



Nouveau Test avec image V2

Avec un fichier

Slot_Car_Street.pdf

Debut de Code en javascript

Fichier Jar :

registry-handler-1.0.0.jar.zip

javascript
import { Block } from '../../../../data/protocols/blocks';
import { ToHtml } from '../../../../domain/use-cases/to-html';
import { blockToInnerText } from '../../../helpers/block-to-inner-text';
import hljs from '../../../../config/highlightConfig';
import prettier from 'prettier';

export class CodeBlockToHtml implements ToHtml {
  private readonly _block: Block;

  constructor(block: Block) {
    this._block = block;
  }

  async convert(): Promise<string> {
    const language = this._language ? this._language : 'plaintext';  // Fallback au texte brut si pas de langue spécifiée
    const languageClass = `language-${language}`;

    // Obtenir le texte du bloc et formater avec Prettier
    let code = blockToInnerText(this._block).replace(/(\s{4}|\t)/g, '  ');
    try {
      code = prettier.format(code, { semi: false, parser: "babel" }); // Assure-toi de choisir le bon parser selon le langage
    } catch (error) {
      console.error("Prettier formatting failed:", error);
    }

    // Appliquer la coloration syntaxique avec Highlight.js
    const highlightedCode = hljs.highlight(code, { language }).value;

    // Retourner le code HTML formaté
    return Promise.resolve(
        `<pre><code class="${languageClass}">${highlightedCode}</code></pre>`
    );
  }

  private get _language(): string {
    return this._block.properties?.language?.toLowerCase().replace(/ /g, '');
  }
}

Image

Notion Image

Autres images

Notion Image

Tableau

Resolving The Problem

The following table lists the ports that IBM i Access and related functions use for communication with the IBM i OS System:

PC Function Server Name Port Non-SSL Port SSL
• Server Mapper • as-svrmap • 449 • —
• License Management • as-central • 8470 • 9470
• Database Access • as-database • 8471 • 9471
• Data Queues • as-dtaq • 8472 • 9472
• IFS Access usingAccess/Navigator • as-file • 8473 • 9473
• Network Printers • as-netprt • 8474 • 9474
• Remote Command • as-rmtcmd • 8475 • 9475
• Signon Verification • as-signon • 8476 • 9476
• Telnet (5250 Emulation) • telnet • 23 • 992
• Navigator for i (Heritage version) • as-nav • 2004 • 2005
• New Navigator for i • as-new-nav • 2002 • 2003
• Digital Certificate Manager • as-admin3-http • 2006 • 2007
• HTTP Administration • as-admin • 2001 • 2010
• DDM/DRDA • DDM/DRDA • 446 • 448
• NetServer • netbios > • 137 • —
• NetServer • netbios > • 139 • —
• NetServer (CIFS) • CIFS • 445 • —
• Service Tools Server • as-sts • 3000 • —

If any of the above ports are restricted by using a firewall or any other mechanism, IBM i Access or related functions might fail to operate. For assistance with configuring ports or working with a firewall beyond the above information, contact the firewall provider or obtain a consulting agreement.

Note:

The following ports are common to most IBM i Access Client products such as ODBC, Telnet, and other specific functions:

Port 449 is used to look up service by name and return the port number.

Ports 8470 and 9470(TLS/SSL) are used for host code page translation tables and licensing functions.

Ports 8475 and 9475(TLS/SSL) are used to check for application administration restrictions.

Ports 8476 and 9476(TLS/SSL) are used for checking signon verification to authenticate.

depending on your needs you may only need the above ports and the port(s) for your function/application.For the ports used by the Console, see document N1015344, IBM iSeries Port Assignments with Operations Console.

For a list of currently listening IPv4 daemons on the IBM i, run the following SQL statement:

sql
SELECT LOCAL_PORT, LOCAL_PORT_NAME, BIND_USER, IDLE_TIME
FROM QSYS2.NETSTAT_INFO
where LOCAL_ADDRESS = '0.0.0.0';

Other options are the CL command NETSTAT OPTION(*CNN) or to review the output from WRKSRVTBLE OUTPUT(*PRINT).

Tache 1
Tache 2
Tache 3

  • Puce 1
  • Puce 2

La maison de la rue adjaçante est encombréeLa maison de la rue adjaçante est encombréeLa maison de la rue adjaçante est encombréeLa maison de la rue adjaçante est encombréeLa maison de la rue adjaçante est encombréeLa maison de la rue adjaçante est encombréeLa maison de la rue adjaçante est encombréeLa maison de la rue adjaçante est encombrée

Test Unique

ℹ️

Avec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignesAvec un bel encadrement et avec plusieurs lignes

Test de titre 1

Test de titre 2

Test de titre 3

en gras, en italique, sous ligné, barré

Champs de l’entité « Person »

Voici les principaux champs disponibles pour l’entité « Person » selon Schema.org :

  1. additionalName: Un nom supplémentaire pour la personne, souvent un deuxième prénom.
  1. address: L’adresse postale de la personne.
  1. affiliation: Une organisation à laquelle la personne est affiliée, comme une entreprise ou une institution.
  1. alumniOf: Une organisation éducative ou une école dont la personne est un ancien élève.
  1. award: Une récompense ou un prix que la personne a reçu.
  1. birthDate: La date de naissance de la personne.
  1. birthPlace: Le lieu de naissance de la personne.
  1. brand: La marque associée à la personne, souvent utilisée pour des célébrités ou des entrepreneurs.
  1. children: Les enfants de la personne.
  1. colleague: Les collègues de la personne.
  1. contactPoint: Un point de contact pour la personne.
  1. deathDate: La date de décès de la personne.
  1. deathPlace: Le lieu de décès de la personne.
  1. duns: Le numéro DUNS de la personne.
  1. email: L’adresse email de la personne.
  1. familyName: Le nom de famille de la personne.
  1. faxNumber: Le numéro de fax de la personne.
  1. follows: Les personnes que cette personne suit (par exemple sur les réseaux sociaux).
  1. funder: Une entité qui finance cette personne.
  1. gender: Le genre de la personne (masculin, féminin, etc.).
  1. givenName: Le prénom de la personne.
  1. globalLocationNumber: Le numéro de localisation global pour la personne.
  1. hasCredential: Les informations d’identification de la personne.
  1. hasOccupation: La profession de la personne.
  1. hasOfferCatalog: Un catalogue d’offres que la personne possède.
  1. hasPOS: Un point de vente que la personne possède.
  1. height: La taille de la personne.
  1. homeLocation: L’emplacement de la résidence principale de la personne.
  1. honorificPrefix: Un préfixe honorifique pour la personne (par exemple, Dr., M., Mme).
  1. honorificSuffix: Un suffixe honorifique pour la personne (par exemple, Jr., Sr.).
  1. interactionStatistic: Les statistiques d’interaction pour la personne.
  1. isicV4: Le code ISIC pour la personne.
  1. jobTitle: Le titre du poste de la personne.
  1. knows: Les connaissances de la
mermaid
graph LR
SymmetricDS_OVH[(« SymmetricDS-OVH »)]
db-prod[(« PostgreSQL (db-reflet)
Port: 5432″)]
pgadmin[(« pgAdmin
Port: 8888″)]
redis[(« Redis (cache)
Port: 6379″)]
zookeeper[(« Zookeeper
Port: 2181″)]
kafka[(« Kafka
Port: 9092″)]
kafka_manager[(« Kafka Manager
Port: 9000″)]
directus[(« Directus
Port: 8055″)]
budibase[(« Budibase
Port: 10000″)]
n8n[(« n8n
Port: 443″)]
me[(« MONDE \n Extérieur
Port: 443″)]
cosmo[(« PostgreSQL (Cosmo)
Port: 5432″)]
directus-c[(« Directus
4 Cosmo
Port: 8055″)]

db-prod –>|Cache| redis
db-prod –>|Publie| kafka
directus –>|Cache| redis
pgadmin –>|Administre| db-prod
budibase –>|CRUD| db-prod
directus –>|Propose des APIS| db-prod
kafka –>|Depends on| zookeeper
kafka_manager –>|Depends on| zookeeper
kafka_manager –>|Manage Topics| kafka

SymmetricDS_OVH –>|Envoi| db-prod
SymmetricDS_OVH –>|Envoi| kafka
n8n –> |publie| kafka
kafka –>|consomme| n8n
db-prod –>|trigger| n8n
n8n –> |publie| me
directus-c –> |publie| cosmo
cosmo –> |publie| directus-c
n8n –> |GraphQL| directus-c

python
# flake8: noqa
# This file is used for deploying replicate models
# running: cog predict -i img=@inputs/whole_imgs/10045.png -i version='v1.4' -i scale=2
# push: cog push r8.im/tencentarc/gfpgan
# push (backup): cog push r8.im/xinntao/gfpgan

import os

os.system('python setup.py develop')
os.system('pip install realesrgan')

import cv2
import shutil
import tempfile
import torch
from basicsr.archs.srvgg_arch import SRVGGNetCompact

from gfpgan import GFPGANer

try:
    from cog import BasePredictor, Input, Path
    from realesrgan.utils import RealESRGANer
except Exception:
    print('please install cog and realesrgan package')


class Predictor(BasePredictor):

    def setup(self):
        os.makedirs('output', exist_ok=True)
        # download weights
        if not os.path.exists('gfpgan/weights/realesr-general-x4v3.pth'):
            os.system(
                'wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P ./gfpgan/weights'
            )
        if not os.path.exists('gfpgan/weights/GFPGANv1.2.pth'):
            os.system(
                'wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P ./gfpgan/weights')
        if not os.path.exists('gfpgan/weights/GFPGANv1.3.pth'):
            os.system(
                'wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P ./gfpgan/weights')
        if not os.path.exists('gfpgan/weights/GFPGANv1.4.pth'):
            os.system(
                'wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P ./gfpgan/weights')
        if not os.path.exists('gfpgan/weights/RestoreFormer.pth'):
            os.system(
                'wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P ./gfpgan/weights'
            )

        # background enhancer with RealESRGAN
        model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=32, upscale=4, act_type='prelu')
        model_path = 'gfpgan/weights/realesr-general-x4v3.pth'
        half = True if torch.cuda.is_available() else False
        self.upsampler = RealESRGANer(
            scale=4, model_path=model_path, model=model, tile=0, tile_pad=10, pre_pad=0, half=half)

        # Use GFPGAN for face enhancement
        self.face_enhancer = GFPGANer(
            model_path='gfpgan/weights/GFPGANv1.4.pth',
            upscale=2,
            arch='clean',
            channel_multiplier=2,
            bg_upsampler=self.upsampler)
        self.current_version = 'v1.4'

    def predict(
            self,
            img: Path = Input(description='Input'),
            version: str = Input(
                description='GFPGAN version. v1.3: better quality. v1.4: more details and better identity.',
                choices=['v1.2', 'v1.3', 'v1.4', 'RestoreFormer'],
                default='v1.4'),
            scale: float = Input(description='Rescaling factor', default=2),
    ) -> Path:
        weight = 0.5
        print(img, version, scale, weight)
        try:
            extension = os.path.splitext(os.path.basename(str(img)))[1]
            img = cv2.imread(str(img), cv2.IMREAD_UNCHANGED)
            if len(img.shape) == 3 and img.shape[2] == 4:
                img_mode = 'RGBA'
            elif len(img.shape) == 2:
                img_mode = None
                img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
            else:
                img_mode = None

            h, w = img.shape[0:2]
            if h < 300:
                img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)

            if self.current_version != version:
                if version == 'v1.2':
                    self.face_enhancer = GFPGANer(
                        model_path='gfpgan/weights/GFPGANv1.2.pth',
                        upscale=2,
                        arch='clean',
                        channel_multiplier=2,
                        bg_upsampler=self.upsampler)
                    self.current_version = 'v1.2'
                elif version == 'v1.3':
                    self.face_enhancer = GFPGANer(
                        model_path='gfpgan/weights/GFPGANv1.3.pth',
                        upscale=2,
                        arch='clean',
                        channel_multiplier=2,
                        bg_upsampler=self.upsampler)
                    self.current_version = 'v1.3'
                elif version == 'v1.4':
                    self.face_enhancer = GFPGANer(
                        model_path='gfpgan/weights/GFPGANv1.4.pth',
                        upscale=2,
                        arch='clean',
                        channel_multiplier=2,
                        bg_upsampler=self.upsampler)
                    self.current_version = 'v1.4'
                elif version == 'RestoreFormer':
                    self.face_enhancer = GFPGANer(
                        model_path='gfpgan/weights/RestoreFormer.pth',
                        upscale=2,
                        arch='RestoreFormer',
                        channel_multiplier=2,
                        bg_upsampler=self.upsampler)

            try:
                _, _, output = self.face_enhancer.enhance(
                    img, has_aligned=False, only_center_face=False, paste_back=True, weight=weight)
            except RuntimeError as error:
                print('Error', error)

            try:
                if scale != 2:
                    interpolation = cv2.INTER_AREA if scale < 2 else cv2.INTER_LANCZOS4
                    h, w = img.shape[0:2]
                    output = cv2.resize(output, (int(w * scale / 2), int(h * scale / 2)), interpolation=interpolation)
            except Exception as error:
                print('wrong scale input.', error)

            if img_mode == 'RGBA':  # RGBA images should be saved in png format
                extension = 'png'
            # save_path = f'output/out.{extension}'
            # cv2.imwrite(save_path, output)
            out_path = Path(tempfile.mkdtemp()) / f'out.{extension}'
            cv2.imwrite(str(out_path), output)
        except Exception as error:
            print('global exception: ', error)
        finally:
            clean_folder('output')
        return out_path


def clean_folder(folder):
    for filename in os.listdir(folder):
        file_path = os.path.join(folder, filename)
        try:
            if os.path.isfile(file_path) or os.path.islink(file_path):
                os.unlink(file_path)
            elif os.path.isdir(file_path):
                shutil.rmtree(file_path)
        except Exception as e:
            print(f'Failed to delete {file_path}. Reason: {e}')