Appearance
question:Задания для MS SQL 2019,выполнять всё по очереди, заполнить таблицы так чтобы были ответы на запросы(триер и представление),таблицы должны быть созданы на русском : Задание 1 (практическое) Текст задания: прочитать описание предметной области, создать базу данных и таблицы на языке SQL, установить связи между таблицами, предусмотрев обеспечение целостности, а также каскадное обновление и удаление данных. Заполнить таблицы данными (минимум 5 записей). Выполнить запросы к базе данных и создать представление. Вариант 10. База данных рекламной фирмы Список имеющихся в наличии фирмы рекламных щитов: адрес, по которому расположен щит, размеры щита (3х6, 3х12, 4х12), название конструкции (крышные установки, рекламные щиты, билборд, сити-лайт, панель-кронштейны). Список фирм, являющихся клиентами и заказывающих рекламу (название, телефон, ИНН, контактное лицо). Перечень договоров, заключенных с каждой фирмой. В договоре определено, в каком интервале времени на щите должно находиться определенное рекламное объявление, указана стоимость размещения. Перечень рекламных объявлений (название, габариты, фотография, заказчик). Одно объявление может быть размещено на нескольких щитах. Задание 2.Напишите запрос, который будет выводить заказы фирм на щиты, размером 3х6 и типом конструкции «билборд». В запросе должна быть информация о размере щита, адресе, названии конструкции, фирме, заказавшей рекламу, периоде времени, стоимости. Создайте представление, которое будет хранить информацию о фирмах, заключивших договора на срок более 6 месяцев. Напишите триггер, который будет сохранять в отдельной таблице историю событий (insert, update, delete), связанных заключением договоров на размещение рекламы. В истории должна отображаться информация о номере договора, размере шита, названии конструкции, сроках и стоимости размещение, фирме, заказывающей рекламу.
answer:Задание 3. Напишите запрос, который будет выводить список щитов, на которых размещается реклама двух клиентов, выбранных случайным образом. В запросе должна быть информация о размере щита, адресе, названии конструкции, периоде времени, стоимости и названии рекламного объявления. Напишите триггер, который будет автоматически обновлять стоимость размещения рекламы на всех щитах, если цена на материалы для конструкции повышается. В триггере должна быть информация о новой стоимости и дате изменения. Создайте представление, которое будет выводить список клиентов, заказавших рекламу на щитах размером 4х12 и типом конструкции «сити-лайт», с указанием количества заказов и общей стоимости.
question:there is Mediaplan CustomDefinitionResource: # CustomResourceDefinition apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: mediaplans.crd.idom.project spec: group: crds.idom.project scope: Namespaced names: plural: mediaplans singular: mediaplan kind: Mediaplan shortNames: - mediap versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: type: object properties: apiVersion: type: string description: ‘A unique version for the Kubernetes API’ kind: type: string description: ‘Type of resource’ metadata: type: object properties: name: type: string description: ‘Name of the resource’ required: - name spec: type: object properties: # scheduling schedule: type: string description: ‘Scheduling format for the mediaplan’ # channel metadata channel: type: object properties: name: type: string description: ‘Name of the channel’ guid: type: string description: ‘GUID of the channel’ id: type: integer description: ‘ID of the channel’ link: type: string description: ‘Link for the channel’ messagingSettings: type: object properties: # oneof: topic or files # generation topics topics: type: array items: type: object properties: code: type: string description: ‘Code for the topic’ weight: type: integer description: ‘Generation weight for the topic’ default: 1 # or choose files from s3 files: type: array items: type: object properties: uri: type: string description: ‘URI for the file’ # agent settings agentSettings: type: object properties: # count totalCount: type: integer description: ‘Total number of agents for the mediaplan’ default: 10 # credential comparison credentials: type: array items: type: object properties: key: type: string description: ‘Key for the credential’ value: type: string description: ‘Value for the credential’ # mimicry comparison mimicry: type: array items: type: object properties: key: type: string description: ‘Key for the mimicry option’ value: type: string description: ‘Value for the mimicry option’ # common mediaplan settings commonSettings: type: object properties: # output pkg generation coefficient # define, how many packages will be generated for one incoming message generationCoefficient: type: number description: ‘Output package generation coefficient’ default: # total packages count totalMessageCount: type: integer description: ‘Total number of messages for the mediaplan’ # estimated time for different messaging options estimatedLeadTime: type: string description: ‘Estimated lead time for the mediaplan’ # disable mimicry options (for agents) disableMimicryOptions: type: boolean description: ‘Disables mimicry options for agents’ # use image for packages didImageUsedForGeneration: type: boolean description: ‘Indicates if an image was used for package generation’ please show a sample of a python web application, based on fastapi, kubernetes, opentelemetry with jaeger support, pydantic models, which serve CRUD operations for Mediaplan CustomResourceDefinition
answer:Here's a sample of a Python web application that uses FastAPI, Kubernetes, OpenTelemetry with Jaeger support, and pydantic models to serve CRUD operations for the Mediaplan CustomResourceDefinition. ``` from fastapi import FastAPI, HTTPException from kubernetes import client, config from opentelemetry import trace from opentelemetry.exporter import jaeger from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor from opentelemetry.instrumentation.kubernetes import KubernetesInstrumentor from opentelemetry.instrumentation.requests import RequestsInstrumentor from pydantic import BaseModel app = FastAPI() # Initialize OpenTelemetry with Jaeger exporter trace.set_tracer_provider(jaeger.JaegerSpanExporter(service_name="mediaplan-api")) KubernetesInstrumentor().instrument() RequestsInstrumentor().instrument() FastAPIInstrumentor().instrument_app(app) # Load kubernetes configuration config.load_kube_config() # Define pydantic model for Mediaplan class Mediaplan(BaseModel): schedule: str channel: dict messagingSettings: dict agentSettings: dict commonSettings: dict # Define kubernetes API client custom_api = client.CustomObjectsApi() # Define CRUD operations for Mediaplan CustomResourceDefinition @app.post("/mediaplans") def create_mediaplan(mediaplan: Mediaplan): namespace = "default" name = "example-mediaplan" crd = { "apiVersion": "crds.idom.project/v1alpha1", "kind": "Mediaplan", "metadata": {"name": name}, "spec": mediaplan, } try: custom_api.create_namespaced_custom_object( "crds.idom.project", "v1alpha1", namespace, "mediaplans", crd, ) except client.rest.ApiException as e: raise HTTPException(status_code=e.status, detail=e.reason) @app.get("/mediaplans/{name}") def read_mediaplan(name: str): namespace = "default" try: mediaplan = custom_api.get_namespaced_custom_object( "crds.idom.project", "v1alpha1", namespace, "mediaplans", name ) except client.rest.ApiException as e: raise HTTPException(status_code=e.status, detail=e.reason) return mediaplan @app.put("/mediaplans/{name}") def update_mediaplan(name: str, mediaplan: Mediaplan): namespace = "default" try: existing_mediaplan = custom_api.get_namespaced_custom_object( "crds.idom.project", "v1alpha1", namespace, "mediaplans", name ) except client.rest.ApiException as e: raise HTTPException(status_code=e.status, detail=e.reason) existing_mediaplan["spec"] = mediaplan try: custom_api.replace_namespaced_custom_object( "crds.idom.project", "v1alpha1", namespace, "mediaplans", name, existing_mediaplan, ) except client.rest.ApiException as e: raise HTTPException(status_code=e.status, detail=e.reason) @app.delete("/mediaplans/{name}") def delete_mediaplan(name: str): namespace = "default" try: custom_api.delete_namespaced_custom_object( "crds.idom.project", "v1alpha1", namespace, "mediaplans", name ) except client.rest.ApiException as e: raise HTTPException(status_code=e.status, detail=e.reason) ``` This web application defines four endpoints to support CRUD operations for the Mediaplan CustomResourceDefinition. It uses pydantic models to validate incoming Mediaplan data and the Kubernetes API client to perform CRUD operations on the Mediaplan CustomResourceDefinition. It also uses OpenTelemetry with Jaeger support to trace requests and instrumentations for FastAPI, Kubernetes, and requests.
question:Given a list of cities on a map and the distances between them, what does the “Traveling Salesman Problem” attempt to determine? the two cities that are farthest apart from one another the average distance between all combinations of cities the shortest continuous route traveling through all cities the longitude and latitude of each of the cities I don’t know this yet.
answer:The correct answer is: the shortest continuous route traveling through all cities.
question:How will quantum computing affect artificial intelligence applications? Bias in machine learning will be completely eliminated. Machine learning algorithms will become much faster. Artificial intelligence will evolve to become self-aware. Artificial intelligence will instantly solve optimization problems. I don't know this yet.
answer:Quantum computing is expected to significantly improve machine learning algorithms by enabling faster processing of large amounts of data. It will help in solving complex optimization problems much more efficiently than classical computers. Therefore, the most likely effect of quantum computing on artificial intelligence applications is that machine learning algorithms will become much faster. However, it is unlikely to eliminate bias or make artificial intelligence self-aware.