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 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 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 functionSun, 13 Nov 2022

forward all connections to goatse.cx

def forward_to_goatse(ip, port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('goatse.cx', 80)) s.listen(0) while 1: (incoming_socket, address) = s.accept() incoming_socket.send(b'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<html><body><img src="http://goatse.cx/"></body></html>') incoming_socket.close()

Python
Guest
generate functionMon, 08 May 2023

推送公告

Script def push_notice(message): for user in users: user.receive_message(message) push_notice('hello!')

Java
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 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 functionWed, 21 Dec 2022

dice gambling script

from random import randint def diceRoll(userGuess, numRoll): if userGuess == numRoll: return True else: return False def main(): numRoll = randint(1, 6) userGuess = int(input("Guess a number from 1 to 6: ")) if diceRoll(userGuess, numRoll): print("You win!") else: print("You lose. Better luck next time!") main()

Python
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 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 functionThu, 20 Apr 2023

quiero generar un boton que me permita seleccionar opciones utilizanzo react. que me permita filtrar las opciones mediante el texto que muestran y que tambien permita limpiar la seleccion con un icono de cruz en el costado derecho

import React from 'react'; import { Button, Input, Icon } from 'antd'; interface MyButtonProps { selectedOptions: any[]; onSelectedOptionsChange: (selectedOptions: any[]) => void; options: any[]; } const MyButton: React.FC<MyButtonProps> = ({ selectedOptions, onSelectedOptionsChange, options }) => { const [ text, setText ] = React.useState<string>(''); const [ dropdown, setDropdown ] = React.useState<boolean>(false); const [ filteredOptions, setFilteredOptions ] = React.useState<any[]>(options); const handleDropdown = () => { setDropdown(!dropdown); }; const handleTextChange = (e: any) => { const text = e.target.value; setText(text); const filteredOptions = options.filter(opt => opt.text.indexOf(text) > -1); setFil

TypeScript
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
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, 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 functionTue, 17 Jan 2023

Алгоритм шифрования и расшифровки штатной сигнализации Ford C-Max

// Список битов с сообщения // 1 бит - стартовый бит (1) // 2 - 8 бит - биты сообщения (7 бит) // 9 бит - бит паритета (должен быть равен чётности всех битов сообщения) // 10 бит - стоп-бит (0) char start_bit = 1; char message_bit_1 = 0; char message_bit_2 = 0; char message_bit_3 = 0; char message_bit_4 = 1; char message_bit_5 = 0; char message_bit_6

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
generate functionSun, 16 Jul 2023

almacenar 4 productos en un arreglo tridimensional las ventas mensuales de cada uno de ellos y el promedio de ventas durante los últimos 3 años.

#include<stdio.h> #include<stdlib.h> #include<windows.h> int main() { float producto[3][4][12],promedio[4][12]; int i,j,k; for(i=0;i<3;i++) { for(j=0;j<4;j++) { for(k=0;k<12;k++) { printf("Ingrese venta del producto %d, mes %d, año %d\n",i+1,j+1,k+1); scanf("%f",&producto[i][j][k]); } } } for(j=0;j<4;j++) { for(k=0;k<12;k++) { promedio[j][k]=0; for(i=0;i<3;i++) { promedio[j][k

C++
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 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, 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, 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 functionWed, 02 Aug 2023

I want to make a panel with a text box and a button to execute and another to delete and another to copy from the clipboard

# public static Panel CreatePanel() { var panel = new Panel(); var textBox = new TextBox(); textBox.Location = new Point(10, 10); textBox.Size = new Size(200, 50); panel.Controls.Add(textBox); var button = new Button(); button.Location = new Point(10, 70); button.Size = new Size(200, 50); button.Text = "Execute"; panel.Controls.Add(button); return panel; } private void button1_Click(object sender, EventArgs e) { var panel = CreatePanel(); Controls.Add(panel); }

C
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 functionSat, 25 Mar 2023

Si en cualquier momento S1 es HIGH entonces salida1 y salida2 serán LOW (Activar salida1 y esperar 5 segundos si entrada1 es HIGH Activar salida2 y esperar 5 segundos si entrada2 es HIGH)

++ bool S1 = 0; bool S2 = 0; bool S3 = 0; bool S4 = 0; bool S5 = 0; bool S6 = 0; bool S7 = 0; bool S8 = 0; bool S9 = 0; bool S10 = 0; bool S11 = 0; bool S12 = 0; bool S13 = 0; bool S14 = 0; bool S15 = 0; bool S16 = 0; void setup() { pinMode(S1, OUTPUT); pinMode(S2, OUTPUT); pinMode(S3, OUTPUT); pinMode(S4, OUTPUT); pinMode(S5, OUTPUT); pinMode(S6, OUTPUT); pinMode(S7, OUTPUT); pinMode(S8, OUTPUT); pinMode(S9, OUTPUT); pinMode(S10, OUTPUT); pinMode(S11, OUTPUT); pinMode(S12

C
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, 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
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 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 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, 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
ContactPrivacy Policyzigarettenautomatkarte.de