Custom ChatGPT Plugin development

ConversAI Solutions

Code faster with the help of AI

Generate code just by typing a text description. AI will create the code for you. Test it now

Questions about programming?Chat with your personal AI assistant

How others used it recently

Generated by the communtiy

generate functionMon, 10 Jul 2023

a) Escriba una función que reciba un vector de enteros y obtenga la posición del menor entero. b) Escriba una función que reciba un vector de enteros y una posición, elimine el entero en esa posición...

#include <iostream> #include <vector> using namespace std; int menor(vector<int> v){ int minimo = v[0]; int posicion = 0; for(int i=0; i<v.size(); i++){ if(v[i] < minimo){ minimo = v[i]; posicion = i; } } return posicion; } int eliminar(vector<int> &v, int posicion){ int valor = v[posicion]; for(int i=posicion; i< v.size(); i++){ v[i] = v[i+1]; } v.pop_back(); return valor; } int main(){ vector<int> v1 = {1,2,3,4}; vector<int> v2 = {6,5,8,7}; vector<int> v3; int n = v1.size();

C++
Guest
generate functionMon, 20 Mar 2023

Suma y resta

int add(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } int main() { int a = 0, b = 0; cin >> a; cin >> b; cout << add(a, b) << endl; cout << sub(a, b) << endl; return 0; }

C++
Guest
generate functionSun, 23 Apr 2023

conectarse a una base de datos llamada FeedLot de sql en la direccion 192.168.0.20, con nombre de usario root y contraseña admin, este codigo debe ser en python, despues que accesa debe entrar a una p...

import mysql.connector conecction = mysql.connector.connect(host = '192.168.0.20', user = 'root', password = 'admin', database = 'FeedLot') cursor = conecction.cursor() def menu(): print("***************************************") print("* 1. Archivo: *") print("* 2. Reporte: *") print("* 3. Consulta: *") print("* 4. Salir: *") print("***************************************") def submenu(): print("***************************************") print("* 1. Reporte semanal: *") print("* 2. Reporte mensual: *") print("* 3. Reporte anual: *") print("* 4. Salir: *") print("***************************************") def crearReporte(): print("***************************************") print("* 1. Reporte semanal: *") print("

Python
Guest
text to sql syntaxThu, 27 Apr 2023

Funcio o procediment anomenat Premis_Proven_RHY que generi numero de 1 al 50. Premis_Proven_RHY rebra el numero premiat del sorteigi retorna el premi aconseguit. numero premiat si va del 1 al 20 50 euros, si va de 20 al 30 dinar a la cantina , si va de 30 a 50 un bono bus

DROP PROCEDURE IF EXISTS Premis_Proven_RHY; DELIMITER // CREATE PROCEDURE Premis_Proven_RHY(OUT numero_premiat INT) BEGIN SET numero_premiat = FLOOR(1 + RAND() * 50); END // DELIMITER ; CALL Premis_Proven_RHY(@premi); SELECT @premi;

Guest
generate functionSun, 23 Apr 2023

Realice una diagrama de barras con la información encontrada en la columna "Nivel"; donde éste tenga titulo, marcado el eje , el eje , las barras sean coloreadas de diferente color y las categorías en la columna "Nivel" tenga marquillas.

df = pd.read_csv("/home/oscar/Documentos/python/data.csv") df.head() df['Nivel'].value_counts().plot(kind="bar", color=["green", "blue", "red"]) plt.xlabel("Nivel") plt.ylabel("Frecuencia") plt.title("Diagrama de barras") plt.show()

Python
Guest
text to sql syntaxThu, 27 Apr 2023

Funcio o procediment anomenat Premis_Proven_RHY que generi numero de 1 al 50. Premis_Proven_RHY rebra el numero premiat del sorteigi retorna el premi aconseguit. numero premiat si va del 1 al 20 50 euros, si va de 20 al 30 dinar a la cantina , si va de 30 a 50 un bono bus

DROP PROCEDURE IF EXISTS Premis_Proven_RHY; DELIMITER // CREATE PROCEDURE Premis_Proven_RHY(OUT numero_premiat INT) BEGIN SET numero_premiat = FLOOR(1 + RAND() * 50); END // DELIMITER ; CALL Premis_Proven_RHY(@premi); SELECT @premi;

Guest
generate functionFri, 21 Apr 2023

suma de matrices con vectores

import numpy as np def add_matrix_and_vector(x, y): return x + y matrix = np.array([[1, 2], [3, 4]]) vector = np.array([6, 7]) add_matrix_and_vector(matrix, vector)

Python
Guest
generate functionTue, 21 Mar 2023

Add to this the code for generating a grid on the chart, as well as specifying the percentage difference directly on the chart bars plt.figure(figsize = (12, 4)) plt.bar(data.index, data['nutri'], co...

plt.figure(figsize = (12, 4)) plt.bar(data.index, data['nutri'], color = 'darkblue', label = 'nutri') plt.bar(data.index, data['mineral'], color = 'brown', label = 'mineral') plt.title('Comparison of Nutrient and Mineral Content') plt.xlabel('Nutrient|Mineral') plt.ylabel('Amount') plt.legend() plt.show()

Python
View User

in html you can generate a beating heart with effects and colors neon

<div class="heart"> <div class="heart-main"> <div class="heart-line"> <div class="heart-line1"></div> <div class="heart-line2"></div> <div class="heart-line3"></div> <div class="heart-line4"></div> <div class="heart-line5"></div> <div class="heart-line6"></div> <div class="heart-line7"></div> <div class="heart-line8"></div> <div class="heart-line9"></div> <div class="heart-line10"></div> <div class="heart-line11"></div> <div class="heart-line12"></div> <div class="heart-line13"></div> <div class="heart-line14"></div> <div class="heart-line15"></div> <div class="heart-line16"></div> <div class="heart-line17"></div>

Guest
generate functionWed, 22 Mar 2023

funcion operar

def operar(a, b, op): if op == "add": return a + b elif op == "sub": return a - b elif op == "mul": return a * b elif op == "div": return a / b else: return "not valid" operar(1, 2, "mul")

Java
Guest
generate functionMon, 12 Dec 2022

get a list of users from active directory from police department, output to spreadsheet, order column by name

def get_police_users(department): import ldap import re from openpyxl import Workbook from openpyxl import load_workbook wb = Workbook() ws = wb.active # connect to active directory conn = ldap.initialize('ldap://ldap.yourdomain.com') # search for users in department in active directory results = conn.search_s('dc=yourdomain,dc=com', ldap.SCOPE_SUBTREE, "department=" + department, ['cn']) # create spreadsheet and add users in department to it ws.append(["Users"]) for result in results: ws.append([re.findall('(?<=cn=).*', result[1]['cn'][0].decode('utf-8'))[0]]) wb.save("output.xlsx") # open spreadsheet and sort by last name wb = load

Python
Guest
generate functionMon, 08 May 2023

Write a C program to implement Caesar cipher encryption-decryption

#include <stdio.h> int main() { char message[100], ch; int i, key; printf("Enter a message to encrypt: "); gets(message); printf("Enter key: "); scanf("%d", &key); for(i = 0; message[i] != '\0'; ++i){ ch = message[i]; if(ch >= 'a' && ch <= 'z'){ ch = ch + key; if(ch > 'z'){ ch = ch - 'z' + 'a' - 1; } message[i] = ch; } else if(ch >= 'A' && ch <= 'Z'){ ch = ch + key; if(ch > 'Z'){ ch = ch - 'Z' + 'A' - 1; } message[i] = ch; } } printf("Encrypted message: %s", message); return 0

C
Guest
generate functionWed, 19 Jul 2023

generar factura

def invoice(name, amount, **kwargs): print(f"Name={name} Amount={amount}") for k,v in kwargs.items(): print(f"{k} : {v}") invoice("Paula", 100, tax=0.16, tip=1.2)

Javascript
View User
generate functionSat, 18 Mar 2023

配列 A と追加する要素 B が与えられるので、B を A の末尾に追加したのち、A の全ての要素を出力してください。

public static void addToLast(int[] a, int b) { int count = a.length + 1; // 要素数が変わるので、別途 count 変数を用意する int[] newArray = new int[count]; for (int i = 0; i < a.length; i++) { newArray[i] = a[i]; } newArray[count - 1] = b; for (int i : newArray) { System.out.print(i); } } int[] arr = {1, 2, 3, 4, 5}; addToLast(arr, 6); System.out.println(arr);

Java
Guest
generate functionTue, 30 May 2023

Prendere in input da utente 3 valori (diff_d1, diff_d2, diff_d3) che rappresentano il valore dei dadi del difensore. • Controllare che il valore dei dadi sia compreso nel range [0, 6]. • Controllare c...

#include <iostream> using namespace std; int main() { float diff_d1, diff_d2, diff_d3; do { cout << "Inserire il valore dei dadi del difensore:\n"; cin >> diff_d1 >> diff_d2 >> diff_d3; } while (diff_d1 < 0 || diff_d1 > 6 || diff_d2 < 0 || diff_d2 > 6 || diff_d3 < 0 || diff_d3 > 6 || (diff_d1 == 0 && diff_d2 == 0 && diff_d3 == 0)); }

C++
Guest
generate functionSat, 18 Mar 2023

配列 A と追加する要素 B が与えられるので、B を A の末尾に追加したのち、A の全ての要素を出力してください。

public static void addToLast(int[] a, int b) { int count = a.length + 1; // 要素数が変わるので、別途 count 変数を用意する int[] newArray = new int[count]; for (int i = 0; i < a.length; i++) { newArray[i] = a[i]; } newArray[count - 1] = b; for (int i : newArray) { System.out.print(i); } } int[] arr = {1, 2, 3, 4, 5}; addToLast(arr, 6); System.out.println(arr);

Java
Guest
generate functionWed, 10 May 2023

Un carrusel de productos.

var products = [ { name: 'Galletas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' }, { name: 'Bebidas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' }, { name: 'Comida', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' }, { name: 'Papas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' }, { name: 'Tortas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' }, ] var carousel = document.getElementById('carousel'); var html = ''; html += '<div class="products">' for (var i = 0; i < products.length; i++) { html += '<div class="product">'; html += '<

Javascript
Guest
generate functionTue, 25 Apr 2023

El Banco Gerencial de Desarrollo BGD, quiere determinar cuánto pagará un cliente que tome un préstamo no mayor de 200,000.00 para pagarlo en 24 meses a una Tasa de Interés de 2% mensual. Se requiere saber el valor o monto total que pagará el cliente en 2 años entre capital e intereses.

def main() principal = 200000 monthly_interest_rate = 0.02 number_of_payments = 24 payment = principal * ((monthly_interest_rate * (1 + monthly_interest_rate)**number_of_payments) / ((1 + monthly_interest_rate)**number_of_payments - 1)) return payment

C#
Guest
text to sql syntaxTue, 17 Jan 2023

Выгрузить все столбцы таблиц с описанием ВСЕХ типов полей по группам типов(например текст, JSONB, число, вещественное число) через case на русском языке. postgresql Выгрузить без пробелов и переносов. выгрузить одной строкой

SELECT string_agg(case data_type when 'character varying' then 'text' when 'integer' then 'integer' when 'double precision' then 'real' when 'jsonb' then 'jsonb' end,',') FROM information_schema.columns where table_schema='public' and table_name='customers';

generate functionFri, 10 Feb 2023

Create dashboard form

Script function createDashboardForm() { var form = document.createElement('form'); //set form attributes form.style.padding = '20px'; form.style.border = '1px dashed #000'; form.style.width = '350px'; //create a title var title = document.createElement('h1'); title.innerHTML = 'Sign up for our newsletter'; //create a description var description = document.createElement('p'); description.innerHTML = 'Enter your information below to receive our free newsletter.'; //create inputs var nameInput = document.createElement('input'); nameInput.setAttribute('type', 'text'); nameInput.setAttribute('placeholder', 'Name'); nameInput.style.display = 'block'; nameInput.style.marginBottom = '10px'; var emailInput = document.createElement('input'); emailInput.setAttribute('type', 'email'); emailInput.setAttribute('placeholder', 'Email'); email

Java
Guest
generate functionMon, 10 Jul 2023

a) Escriba una función que reciba un vector de enteros y obtenga la posición del menor entero. b) Escriba una función que reciba un vector de enteros y una posición, elimine el entero en esa posición...

#include <iostream> #include <vector> using namespace std; int menor(vector<int> v){ int minimo = v[0]; int posicion = 0; for(int i=0; i<v.size(); i++){ if(v[i] < minimo){ minimo = v[i]; posicion = i; } } return posicion; } int eliminar(vector<int> &v, int posicion){ int valor = v[posicion]; for(int i=posicion; i< v.size(); i++){ v[i] = v[i+1]; } v.pop_back(); return valor; } int main(){ vector<int> v1 = {1,2,3,4}; vector<int> v2 = {6,5,8,7}; vector<int> v3; int n = v1.size();

C++
Guest
generate functionSun, 11 Jun 2023

Escribir un programa que lea las dimensiones de una matriz, la visualice y encuentre su mayor y su menor elemento y sus posiciones respectivas.

Script const readline = require('readline').createInterface({ input: process.stdin, output: process.stdout }) readline.question(`dime cuantas filas quieres`, (rows) => { readline.question(`dime cuantas columnas quieres`, (columns) => { console.log(`Vamos a crear una matriz de ${rows} filas y ${columns} columnas`) let matrix = createMatrix(rows, columns) printMatrix(matrix) let minInfo = getMin(matrix) console.log(`El minimo es: ${minInfo.value} y está en las posiciones (${minInfo.i}, ${minInfo.j})`) let maxInfo = getMax(matrix) console.log(`El maximo es: ${maxInfo.value} y está en las posiciones (${maxInfo.i}, ${maxInfo.j})`) readline.close()

ContactPrivacy Policyzigarettenautomatkarte.de