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, 03 Jul 2023

I need my image the size of the page: .backgroundr { padding: 20%; position: absolute; opacity: 0.1; max-width: 100%; max-height: 100%; background-size: cover; background-position: center 100%; }

int main(int argc, char** argv) { // Create a file reader cv::VideoCapture cap; // Open the video file cap.open(0); // Create a window to display the video cv::namedWindow("Video"); // Show the image in the window cv::imshow("Video", video); // Wait for the user to press a button cv::waitKey(0); }

C++
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
generate functionWed, 26 Jul 2023

Haz un mapa de Argentina

import matplotlib.pyplot as plt import cartopy.crs as ccrs plt.axes(projection=ccrs.PlateCarree()) plt.contourf(lon, lat, temp_data[0, :, :], 60, transform = ccrs.PlateCarree()) plt.colorbar(orientation='horizontal', shrink = 0.8) plt.show()

Python
Guest
generate functionTue, 04 Apr 2023

entendes castellano?

function hablarEspañol(persona) { if (persona === "español" || persona === "colombiano") { console.log("¡Hola!"); } else { console.log("¡Hablas inglés!"); } }

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 functionTue, 28 Mar 2023

Make a program that receives as parameter a file called directorios.txt that will contain the names of directories that exist in your system. The program will have to read from the file the names of ...

def file_to_dict(file_name): file_dict = {} # open the file with open(file_name) as f: # loop through each line in the file for line in f: # remove new line character key = line.rstrip() # get the number of files in the directory file_dict[key] = len(os.listdir(key)) return file_dict def file_to_sorted_list(file_name): file_dict = file_to_dict(file_name) # return a list of directory name and number of files return sorted(file_dict.items(), key=lambda kv: kv[1]) # test for dir_name, number_of_files in file_to_sorted_list('directorios.txt'): print(f'{dir_name} has {number_of_files} files')

Java
Guest
generate functionThu, 01 Jun 2023

(Lista simplemente enlazada) Se pide a Ud. realizar un aplicativo en java correspondiente a una lista simplemente enlazada, la cual ejecute las siguientes instrucciones: • Insertar al inicio de la lis...

// TODO code application logic here package Lista_Simplemente_Enlazadas; import java.util.Scanner; /** * * @author Juan Camilo */ public class Lista_Simplemente_Enlazadas { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Lista lista = new Lista(); int opcion = 0; int dato = 0; int posicion = 0; do { System.out.println("\nMENU"); System.out.println("1. Insertar al inicio de la lista"); System.out.println("2. Mostrar los elementos de la lista"); System.out.println("3. Insertar en la posición enésima"); System.out.println("4. Devolver la posición enésima de un elemento"); System.out.println("5. Ordenar los elementos de forma crecient

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, 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 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
text to sql syntaxWed, 22 Mar 2023

Crear dos tablas con constraints

1: Create table clientes ( id int not null primary key, name varchar(255) not null, email varchar(255) not null, password varchar(255) not null) 2: Create table admin ( id int not null primary key, name varchar(255) not null, email varchar(255) not null, password varchar(255) not null)

Guest
generate functionWed, 31 May 2023

funcion que ordene los elementos de una cola sin usar imports

public class Pila{ int [] pila = new int[10]; int cima = -1; public void push(int x){ cima++; pila[cima] = x; } public void pop(){ cima--; } public boolean empty(){ return cima == -1; } public int size(){ return cima+1; } public int top(){ return pila[cima]; } public void ordena(){ for( int i=0; i<pila.length; i++){ for( int j=i+1; j<pila.length; j++){ if(pila[j] < pila[i]){ int t = pila[i]; pila[i] = pila[j]; pila[j] = t; } } } } public void imp

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 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 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
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 functionWed, 31 May 2023

funcion que ordene los elementos de una cola sin usar imports

public class Pila{ int [] pila = new int[10]; int cima = -1; public void push(int x){ cima++; pila[cima] = x; } public void pop(){ cima--; } public boolean empty(){ return cima == -1; } public int size(){ return cima+1; } public int top(){ return pila[cima]; } public void ordena(){ for( int i=0; i<pila.length; i++){ for( int j=i+1; j<pila.length; j++){ if(pila[j] < pila[i]){ int t = pila[i]; pila[i] = pila[j]; pila[j] = t; } } } } public void imp

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

generate functionFri, 21 Apr 2023

標準入力から 2 つの整数を入力し、大きいほうの値を表示するプログラムを作成せよ。 (ヒント:2 つの変数を a、b とすると、a>b が「正しいとき」と「正しくないとき」でそれぞれどちらを表 示すればよいかが判断できるはずである。もし両者が同じ値のときは、a と b のどちらを表示してもよい)

a = input("a:") b = input("b:") if a > b: print(a) else: print(b)

Java
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 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 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 functionWed, 26 Jul 2023

Haz un mapa de Argentina

import matplotlib.pyplot as plt import cartopy.crs as ccrs plt.axes(projection=ccrs.PlateCarree()) plt.contourf(lon, lat, temp_data[0, :, :], 60, transform = ccrs.PlateCarree()) plt.colorbar(orientation='horizontal', shrink = 0.8) plt.show()

Python
Guest
generate functionThu, 22 Jun 2023

Construya una función que reciba como parámetro una lista y una verdura, la función debe agregar el elemento a la lista solo si este no esta en la lista, es decir no pueden haber verduras repetidas. La función retorna un mensaje si se pudo agregar o no la verdura a la lista.

def agregar_verdura(lista, verdura): if verdura not in lista: lista.append(verdura) return "{} agregada exitosamente".format(verdura) else: return "La verdura ya está en la lista" verduras = ['lechuga', 'cebolla'] agregar_verdura(verduras, 'tomate')

Python
Guest
ContactPrivacy Policyzigarettenautomatkarte.de