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, 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 functionTue, 18 Apr 2023

> m2 <- clm(categorical_FOD_FODs ~ 0 + Condition_FODs:Language_used_FODs - 1, random = ~1|subject, data = indvar_FODs) > summary(m2) formula: categorical_FOD_FODs ~ 0 + Condition_FODs:Language_used_FO...

#LMM library(lme4) m2 <- clm(categorical_FOD_FODs ~ 0 + Condition_FODs:Language_used_FODs - 1, random = ~1|subject, data = indvar_FODs) summary(m2) #LM m2 <- clm(categorical_FOD_FODs ~ Condition_FODs:Language_used_FODs - 1, data = indvar_FODs) summary(m2) #post-hoc analysis library(lsmeans) contrast(m2, "pairwise", list(Condition_FODs = c("A", "B", "C", "D"))) library(emmeans) emmeans(m2, pairwise~Condition_FODs, adjust = "bonferroni")

code to explanationMon, 14 Nov 2022

function checkValidOrderId(orderid, account, platid, outputObject) { if (typeof orderid !== 'string') { throw new Error('参数错误,orderid非法'); } //格式:代理编号 +yyyyMMddHHmmssSSS+ account if (account !=...

function checkValidOrderIdOnly(s) { let len = s.length; if (len !== 17) throw new Error('参数错误,orderid非法'); let v = parseInt(s); if (!Number.isFinite(v)) throw new Error('参数错误,orderid非法'); let d = new Date(v); if (d.getTime() !== v) throw new Error('参数错误,orderid非法'); let now = Date.now(); if (v > now || v < now - 24 * 60 * 60 * 1000) throw new Error('参数错误,orderid非法'); }

Guest
generate functionWed, 24 May 2023

funtion connect and create user in cognito aws

Future<void> signUp(String email, String password) async { var result = await _cognitoUserPool.signUp(email, password, [ AttributeArg(name: 'email', value: email), AttributeArg(name: 'name', value: 'minh'), AttributeArg(name: 'phone_number', value: '0932919800'), AttributeArg(name: 'gender', value: 'male'), ]); print('signUp result: $result'); }

Dart
Guest
generate functionSat, 13 May 2023

Mínimo debe haber 2 empleado por cada cargo y solo 1 empleado por cargo debe estar en turno. (no debe haber identificación repetida, cuando se cree un empleado, se debe verifica que no exista el númer...

import java.util.Scanner; public class Empleado{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String nombre, cargo; int id, horario, salario, numeroID; boolean horarioTurno = false, identificacion = true; System.out.println("Ingrese el número de empleados a registrar: "); int numeroEmpleados = sc.nextInt(); for(int i=0; i < numeroEmpleados; i++){ if(numeroEmpleados <= 10){ System.out.println("Ingrese el nombre: "); nombre = sc.nextLine(); System.out.println("Ingrese el cargo: "); cargo = sc.nextLine(); System.out.println("Ingrese el número de identificación: "); numeroID = sc.nextInt(); System.out.println("

Java
Guest
generate functionSat, 22 Apr 2023

un codigo para hacer un sistema basico de movimiento

public class Movimiento { public bool MovimientoBasico(int[] posicion, int[] destino) { if ( destino == posicion ) { return false; } else if ( destino[0] >= posicion[0] ) { posicion[0] ++; } else if ( destino[0] <= posicion[0] ) { posicion[0] --; } else if ( destino[1] >= posicion[1] ) { posicion[1] ++; } else if ( destino[1] <= posicion[1] ) { posicion[1] --; } else { return false; } return true; } }

C#
Guest
generate functionFri, 05 Apr 2024

add 2 numbers and return them

You can use the following code to get the desired output. function add(a, b) { return a + b; } function subtract(a, b) { return a - b; } function multiply(a, b) { return a *

TypeScript
Guest
generate functionThu, 27 Jul 2023

La automotora “Auto Seguro” necesita registrar todos los datos de los vehículos que en este periodo tienen a la venta. En el registro de vehículos que pertenece a la región metropolitana de Santiago d...

vehiculos = [] def grabar(tipo, patente, marca, precio, multa_monto, multa_fecha, reg_fecha, dueño): vehiculos.append([tipo, patente, marca, precio, multa_monto, multa_fecha, reg_fecha, dueño]) def buscar(patente): for vehiculo in vehiculos: if vehiculo[1] == patente: print(vehiculo) return True return False

Python
Guest
translateThu, 23 Mar 2023

Pedir por teclado el tamaño de un arreglo de números y pedir los valores numéricos con los que se rellena. Los valores no se pueden repetir. Mostrar el arreglo con los valores al final.

#include <stdio.h> int main(int argc, char const *argv[]) { int n; printf("Ingrese tamaño del arreglo: \n"); scanf("%d", &n); int numbers[n]; for (int i = 0; i < n; i++) { printf("Ingrese un numero: \n"); scanf("%d", &numbers[i]); } for (int i = 0; i < n; i++) { printf("El numero %d es: %d \n", i, numbers[i]); } return 0; }

C
Guest
generate functionThu, 29 Jun 2023

Realice una función int sumoveravg(int valores[ ], int n) que recibe como parámetro un arreglo de n elementos enteros y retorne la suma de los elementos que están por encima del promedio. Se conoce la función float avg(int nums[ ], int n), que retorna el promedio de los n números en 'nums'.

#include <stdio.h> float avg(int nums[ ], int n) { int i, sum = 0; for(i = 0; i < n; i++) { sum += nums[i]; } return ((float)sum)/n; } int main() { int nums[] = {1, 2, 3, 4, 5}; printf("%f", avg(nums, 5)); }

C
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
generate functionFri, 31 Mar 2023

arduino nanoで、奇数回ボタンを押せばサーボモータが動きながらLEDが光り、偶数回ボタンを押せばサーボモータが元の状態に戻り、LEDが消えるプログラムをC言語で書いてください。

#include <Servo.h> Servo myservo; int ledPin = 13; int servoPin = 9; int buttonPin = 2; int buttonValue = 0; int counter = 0; void setup() { myservo.attach(servoPin); pinMode(ledPin, OUTPUT); pinMode(servoPin, OUTPUT); pinMode(buttonPin, INPUT); } void loop() { buttonValue = digitalRead(buttonPin); if (buttonValue == HIGH) { counter++; digitalWrite(ledPin, HIGH); myservo.write(180); delay(1000); digitalWrite(ledPin, LOW); myservo.write(0); delay(1000); } else { if (counter % 2 == 1) { digitalWrite(ledPin, HIGH); myservo.write(180); delay(1000); digitalWrite(ledPin, LOW); myservo

C
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 functionSat, 03 Dec 2022

void型の関数 histgram2() は、4つの引数をもち、順に [0,100] の範囲の値を要素にもつint型の配列変数 a[]、配列 a[] のサイズを表すint型の値 n、および、ヒストグラムの値を代入するためのint型の配列変数 h[]、ヒストグラムの区間の幅を表す int型の値 m である。 histgram2() は、与えられた配列変数 a[] の要素の値が、[0,m-1], [m...

void histgram2(int a[], int n, int h[], int m) { int i, j, k; i = 0; j = 0; k = 0; while (i < n) { if (m * k <= a[i] && a[i] < m * (k + 1)) { h[k]++; } else { k++; h[k]++; } i++; } }

C
Guest
generate functionSat, 06 May 2023

Login con conexión a MySQL con contraseña encriptada

import mysql.connector import hashlib import sys def login(username, password): """ """ # Create connection mydb = mysql.connector.connect( host="localhost", user="user", passwd="pass", database="mydatabase" ) # Create cursor to execute queries cursor = mydb.cursor() # Create query and execute query = f"SELECT * FROM login WHERE username = '{username}'" cursor.execute(query) # Fetch all results result = cursor.fetchall() # Check if query was successful if result == []: print("Invalid username and/or password") return # Check if user exists if len(result) != 1: print("ERROR: More than one user exists") return # Check if password is correct # Load password from database db_password = result[0][1] # Encrypt password

Python
Guest
generate functionTue, 20 Jun 2023

create a ChatGpt clone

void chatbot() { while(true) { string userinput; getline(cin, userinput); if(userinput == "hello") cout << "Hello!" << endl; else if(userinput == "why are you so stupid?") cout << "because i am a bot" << endl; else cout << "i dont understand" << endl; } }

C++
Guest
generate functionSat, 26 Nov 2022

masonry layout grid vue js

import { Vue, Component, Prop, Watch } from "vue-property-decorator"; @Component({ name: "Masonry", }) export default class GridLayout extends Vue { @Prop({ default: false }) horizontal!: boolean; @Prop({ default: 200 }) gutter!: number; @Prop({ default: 0 }) column!: number; @Prop({ default: null }) minWidth!: number | null; @Prop({ default: null }) maxWidth!: number | null; @Prop({ default: null }) breakpoint!: number | null; @Prop({ default: true }) transition!: boolean; @Prop({ default: "fade" }) transitionMode!: string; @Prop({ default: 300 }) transitionDuration!: number; private $slots = this.$slots; private $props = this.$props; private currentWidth: number = 0; private currentGutterSize: number = 0; private transitionDurationStyle

TypeScript
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
generate functionMon, 28 Nov 2022

generate a function swaps two struct value

fn swap(left: &mut usize, right: &mut usize) { let temp = *left; *left = *right; *right = temp; } fn main() { let mut left = 1; let mut right = 2; swap(&mut left, &mut right); println!("left: {}, right: {}", left, right); }

Rust
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 functionSat, 03 Dec 2022

void型の関数 histgram2() は、4つの引数をもち、順に [0,100] の範囲の値を要素にもつint型の配列変数 a[]、配列 a[] のサイズを表すint型の値 n、および、ヒストグラムの値を代入するためのint型の配列変数 h[]、ヒストグラムの区間の幅を表す int型の値 m である。 histgram2() は、与えられた配列変数 a[] の要素の値が、[0,m-1], [m...

void histgram2(int a[], int n, int h[], int m) { int i, j, k; i = 0; j = 0; k = 0; while (i < n) { if (m * k <= a[i] && a[i] < m * (k + 1)) { h[k]++; } else { k++; h[k]++; } i++; } }

C
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 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, 30 Jul 2023

extracts work experience from unstructured resume text using a trained mlp model loaded with spacy

import spacy import sys import pickle nlp = spacy.load('en_core_web_sm', disable=['parser', 'tagger']) def extract_experience(text): doc = nlp(text) X = pd.DataFrame([[ent.text, ent.start_char, ent.end_char, ent.label_] for ent in doc.ents], columns = ["text", "start", "end", "label"]) X_test = X[X["label"] == "ORG"].copy() X_test["tokens"] = X_test["text"].apply(lambda x: [token.text for token in x.split()]) with open(f"model.pkl", 'rb') as f: model = pickle.load(f) y_pred = model.predict(X_test["tokens"]) return list(zip(X_test["text"], y_pred))

Python
Guest
generate functionThu, 27 Jul 2023

La automotora “Auto Seguro” necesita registrar todos los datos de los vehículos que en este periodo tienen a la venta. En el registro de vehículos que pertenece a la región metropolitana de Santiago d...

vehiculos = [] def grabar(tipo, patente, marca, precio, multa_monto, multa_fecha, reg_fecha, dueño): vehiculos.append([tipo, patente, marca, precio, multa_monto, multa_fecha, reg_fecha, dueño]) def buscar(patente): for vehiculo in vehiculos: if vehiculo[1] == patente: print(vehiculo) return True return False

Python
Guest
generate functionTue, 02 May 2023

programa para hacer sucesiones de cuadrados en consola grafica

#include <math.h> #include <graphics.h> #include <iostream> using namespace std; int main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); int x1, y1, x2, y2; x1 = 50; y1 = 50; int n; cout << "ingrese el numero de cuadrados:"; cin >> n; cout << "ingrese el lado del cuadrado"; cin >> x2; y2 = x2; for (int i = 1; i <= n; i++) { rectangle(x1, y1, x2, y2); x1 = x1 - 10; y1 = y1 - 10; x2 = x2 + 20; y2 = y2 + 20; } getch();

C++
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
generate functionSat, 22 Apr 2023

create a function that takes key and plain text as inputs and outputs a cipher text using hill cipher algorithm

public string hillCipher(string key, string plainText) { string cipherText = ""; int[] keyInt = key.Select(c => (int)c).ToArray(); int[] plainTextInt = plainText.Select(c => (int)c).ToArray(); int[,] keyMatrix = new int[2, 2]; int[,] plainTextMatrix = new int[2, 1]; keyMatrix[0, 0] = keyInt[0] - 65; keyMatrix[0, 1] = keyInt[1] - 65; keyMatrix[1, 0] = keyInt[2] - 65; keyMatrix[1, 1] = keyInt[3] - 65; plainTextMatrix[0, 0] = plainTextInt[0] - 65; plainTextMatrix[1, 0] = plainTextInt[1] - 65; int[,] cipherTextMatrix = new int[2, 1]; cipherTextMatrix[0, 0] = (keyMatrix[0,

C#
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 functionSat, 06 May 2023

Identifique la realizacion de un modo alternado de los procesos ("PROC1" , "PROC1"y "PROC2" de forma indefinida.

Script function processes(arr) { var obj = {}; var p1_count = 0; var p2_count = 0; var a = 0; var b = 0; for (var i = 0; i < arr.length; i++) { if (arr[i] === "PROC1") { p1_count += 1; a = p1_count; } else { p2_count += 1; b = p2_count; } if (a === b) { obj[arr[i]] = b; a = 0; b = 0; } } return obj; } processes(["PROC1", "PROC1", "PROC1", "PROC2", "PROC2", "PROC2"]);

Java
Guest
generate functionTue, 02 May 2023

- uso de variables y condicionales - presentación al estilo PowerPoint - temática Animal (comision2) -- Los datos a evaluar son: - Debe haber al menos 3 pantallas, donde cada pantalla posea una ima...

/* Tema: Presentacion de animal Autor: @ricardoifc */ String[] frases = { "Bienvenidos a mi presentación.", "Hoy les voy a hablar de gatos", "Los gatos son animales muy inteligentes." }; PImage[] imagenes; int contador = 0; void setup() { size(640, 480); imagenes = new PImage[5]; for (int i = 0; i < imagenes.length; i++) { String numero = str(i+1); imagenes[i] = loadImage("gato" + numero + ".jpg"); } } void draw() { background(0); image(imagenes[contador], 0, 0); textFont(createFont("Arial", 32)); fill(255); text(frases[contador], 40, 40, 600, 400); } void mousePressed() {

Java
Guest
ContactPrivacy Policyzigarettenautomatkarte.de