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 functionFri, 30 Jun 2023

1. Cálculo de la suma de todos los elementos de un vector, así como la media aritmética. arreglos unidimensionales

public class Ejercicio02 { public static void main(String[] args) { int[] numeros = new int[20]; int suma = 0; int media; System.out.println("Array original:"); for (int i = 0; i < 20; i++) { numeros[i] = (int)(Math.random() * 401); System.out.print(numeros[i] + " "); suma += numeros[i]; } System.out.println("\n\nArray modificado:"); media = suma / 20; for (int i = 0; i < 20; i++) { if (numeros[i] < media) { numeros[i] = numeros[i] * -1; } System.out.print(numeros[i] + " "); } } }

Java
Guest
testsSat, 22 Apr 2023

Crear un código de una calculadora

import unittest class TestCadena(unittest.TestCase): def test_upper(self): self.assertEqual('foo'.upper(), 'FOO') def test_isupper(self): self.assertTrue('FOO'.isupper()) self.assertFalse('Foo'.isupper()) def test_split(self): s = 'hello world' self.assertEqual(s.split(), ['hello', 'world']) # check that s.split fails when the separator is not a string with self.assertRaises(TypeError): s.split(2) if __name__ == '__main__': unittest.main()

Guest
generate functionMon, 05 Jun 2023

Recibir dos números enteros y obtener el resultado de la división entera o el de la división con decimales según sea la preferencia del usuario. resolverlo con metodos

int a, b; Console.WriteLine("Dame dos numeros para dividirlos"); a = int.Parse(Console.ReadLine()); b = int.Parse(Console.ReadLine()); Console.WriteLine("El resultado de la división entera es {0}", DivEntera(a, b)); Console.WriteLine("El resultado de la división decimal es {0}", DivDecimal(a, b)); int DivEntera(int a, int b) { return a / b; } double DivDecimal(int a, int b) { return (double) a/b; }

C#
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
regex explanationTue, 09 May 2023

/^[{].+},/

The regex matches the first bracket, then any character, then any number of characters, then a comma.

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
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()

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, 12 Apr 2023

Realizar un script en Python que calcule las resistencias en paralelo o en serie, pidiendo primero la cantidad de resistencias, luego el tipo de conexión en formato string si es en “serie” o en “paral...

def serie(resistencias): total = 0 for resistencia in resistencias: total += resistencia return total def paralelo(resistencias): total = 0 for resistencia in resistencias: if resistencia == 0: return 0 total += 1 / resistencia return 1 / total def total(resistencias, tipo): if tipo == "serie": return serie(resistencias) elif tipo == "paralelo": return paralelo(resistencias) else: print("Tipo de resistencia no reconocida") return None resistencias = [] while True: cantidad = int(input("Ingrese la cantidad de resistencias: ")) if cantidad > 0: break print("Ingrese una cantidad positiva") for i in range(cantidad): while True:

Python
Guest
generate functionWed, 24 May 2023

make a get API with response "Test"."Test" word should come from mysql DB and Admin portal should also be there which should be linked with DB to change the word and host on heroku or any Hosting site.

// This is a "stub" file. It's a little start on your solution. // It's not a complete solution though; you have to write some code. // Package greeting should have a package comment that summarizes what it's about. // https://golang.org/doc/effective_go.html#commentary package greeting // HelloWorld needs a comment documenting it as package does. func HelloWorld() string { return "Hello, World!" }

Javascript
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, 05 May 2023

Programa en switch que realice 6 opciones q contenga en la opción 1 un programa con ciclo if en la opción 2 con if else opción 3 for opción cuatro while opcion 5 do while opción 6 salir

++ #include<stdio.h> #include<stdlib.h> int main() { int opcion; do { printf("1. if \n"); printf("2. if else\n"); printf("3. for\n"); printf("4. while \n"); printf("5. do while \n"); printf("6. salir \n"); scanf("%d",&opcion); switch(opcion) { case 1: printf("Usted eligio la opcion if"); break; case 2: printf("Usted eligio la opcion if else"); break; case 3: printf("Usted eligio la opcion for"); break; case 4: printf("Usted eligio la opcion while"); break; case 5: printf("Usted eligio la opcion do while"); break; case 6: printf("Usted eligio la opcion salir"); break; default: printf("opcion invalida");

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 functionTue, 23 Apr 2024

Pide al usuario que ingrese el número de lados de un poligono. Utiliza un bucle while para solicitar los valores de los ángulos internos del poligono hasta que se ingresen todos. Calcula y muestra la suma de los ángulos internos.

nclude <iostream> #include <cmath> #include <cstdlib> #include <ctime> #include <algorithm> #include <iterator> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <bitset> #include <string> #include <sstream> #include <complex> #include <limits> #include <cctype

C++
Guest
generate functionSat, 01 Apr 2023

Make a dice class - The class should have a throw method that simulates throwing a die. It returns the number thrown, but it also stores in the instance how many we have thrown, whic...

function Dice() { this.value = 0; this.numberOfThrows = 0; this.renderTo = ""; } Dice.prototype.render = function () { document.querySelector(this.renderTo).innerHTML = this.value; }; Dice.prototype.throw = function () { this.numberOfThrows++; this.value = Math.ceil(Math.random() * 6); }; Dice.prototype.getNumberOfThrows = function () { return this.numberOfThrows; }; Dice.prototype.getValue = function () { return this.value; };

Javascript
Guest
generate functionFri, 05 May 2023

Create a Google Chrome extension that, upon activation, opens a new tab in the browser with its graphical interface. The interface should have the necessary options and filters to search for a keyword...

# -*- coding: utf-8 -*- # Copyright (c) 2019, DigiThinkIT and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class ProductDetector(Document): pass

Python
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 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
generate functionFri, 30 Jun 2023

1. Cálculo de la suma de todos los elementos de un vector, así como la media aritmética. arreglos unidimensionales

public class Ejercicio02 { public static void main(String[] args) { int[] numeros = new int[20]; int suma = 0; int media; System.out.println("Array original:"); for (int i = 0; i < 20; i++) { numeros[i] = (int)(Math.random() * 401); System.out.print(numeros[i] + " "); suma += numeros[i]; } System.out.println("\n\nArray modificado:"); media = suma / 20; for (int i = 0; i < 20; i++) { if (numeros[i] < media) { numeros[i] = numeros[i] * -1; } System.out.print(numeros[i] + " "); } } }

Java
Guest
generate functionFri, 05 May 2023

Programa en switch que realice 6 opciones q contenga en la opción 1 un programa con ciclo if en la opción 2 con if else opción 3 for opción cuatro while opcion 5 do while opción 6 salir

++ #include<stdio.h> #include<stdlib.h> int main() { int opcion; do { printf("1. if \n"); printf("2. if else\n"); printf("3. for\n"); printf("4. while \n"); printf("5. do while \n"); printf("6. salir \n"); scanf("%d",&opcion); switch(opcion) { case 1: printf("Usted eligio la opcion if"); break; case 2: printf("Usted eligio la opcion if else"); break; case 3: printf("Usted eligio la opcion for"); break; case 4: printf("Usted eligio la opcion while"); break; case 5: printf("Usted eligio la opcion do while"); break; case 6: printf("Usted eligio la opcion salir"); break; default: printf("opcion invalida");

C
Guest
generate functionFri, 30 Jun 2023

1. Cálculo de la suma de todos los elementos de un vector, así como la media aritmética. arreglos unidimensionales

public class Ejercicio02 { public static void main(String[] args) { int[] numeros = new int[20]; int suma = 0; int media; System.out.println("Array original:"); for (int i = 0; i < 20; i++) { numeros[i] = (int)(Math.random() * 401); System.out.print(numeros[i] + " "); suma += numeros[i]; } System.out.println("\n\nArray modificado:"); media = suma / 20; for (int i = 0; i < 20; i++) { if (numeros[i] < media) { numeros[i] = numeros[i] * -1; } System.out.print(numeros[i] + " "); } } }

Java
Guest
generate functionTue, 23 Apr 2024

Pide al usuario que ingrese el número de lados de un poligono. Utiliza un bucle while para solicitar los valores de los ángulos internos del poligono hasta que se ingresen todos. Calcula y muestra la suma de los ángulos internos.

nclude <iostream> #include <cmath> #include <cstdlib> #include <ctime> #include <algorithm> #include <iterator> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <bitset> #include <string> #include <sstream> #include <complex> #include <limits> #include <cctype

C++
Guest
ContactPrivacy Policyzigarettenautomatkarte.de