Vosk offline speech recognition and self learning from conversation
def vosk(question, answer):
#Vosk
return answer
Generate code just by typing a text description. AI will create the code for you. Test it now
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description
− sponsored −
Generated by the communtiy
def vosk(question, answer):
#Vosk
return answer
ALCULADORA DE PENTAGONO CON UN LADO
import math
def area(lado):
area = lado * lado * math.sqrt(25 + 10 * math.sqrt(5)) / 4
return area
area(2)
#include <iostream>
using namespace std;
int main() {
int n = 0;
float costo = 0;
cout << "Ingrese la cantidad de pelotas que desea comprar: \n";
cin >> n;
if (n <= 10){
costo = n * 7.00;
cout << "El valor total a pagar es: " << costo << " dolares" << endl;
}
else{
costo = n * 6.50;
cout << "El valor total a pagar es: " << costo << " dolares" << endl;
}
return 0;
}
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);
}
def add(a, b):
return a + b
add(1, 2)
function datos12() {
data.map(elem => {
var graf = elem;
graf.map(elementos => {
setElemntos(elementos);
});
});
}
def tiempos(h, m):
h = h*60
return h + m
h = 17
m = 30
tiempo = tiempos(h, m)
print(tiempo)
#include <iostream>
using namespace std;
int main() {
int n = 0;
float costo = 0;
cout << "Ingrese la cantidad de pelotas que desea comprar: \n";
cin >> n;
if (n <= 10){
costo = n * 7.00;
cout << "El valor total a pagar es: " << costo << " dolares" << endl;
}
else{
costo = n * 6.50;
cout << "El valor total a pagar es: " << costo << " dolares" << endl;
}
return 0;
}
<a href="mailto:+79186788247">+79186788247</a>
function sumaCubos(n) {
if (n > 0) {
return n * n * n + sumaCubos(n - 1);
} else {
return 0;
}
}
sumaCubos(3);
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"]);
public interface FiguraGeometrica {
double calcularArea();
double calcularPerimetro();
}
def add(a,b):
return (a+b)
def sum_complex(*args):
sum_ = 0
for i in args:
sum_ = add(sum_, i)
return sum_
sum_complex(1,2,3,4,5,6)
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')
php
class Calculadora {
private $operacion;
private $operando1;
private $operando2;
private $operando3;
private $operando4;
private $operando5;
private $operando6;
private $operando7;
private $operando8;
private $operando9;
private $operando10;
private $operando
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)
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 *
function add(a, b) {
return a + b;
}
add(1, 2);
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("
function isPrime(num) {
if (num === 2) {
return true;
} else if (num > 1) {
for (var i = 2; i < num; i++) {
if (num % i !== 0) {
return true;
}
}
}
return false;
}
console.log(isPrime(10))
public interface FiguraGeometrica {
double calcularArea();
double calcularPerimetro();
}
while (i <= 100) {
j = 2;
while (j <= (int) Math.sqrt(i)) {
if (i % j == 0) break;
// else
j++;
}
if (j > (int) Math.sqrt(i)) {
// i is prime
if (Math.sqrt(i) % 1 == 0) {
// i is square
System.out.println(i);
}
}
i++;
}
void PrintPattern1(int start, int end)
{
if(start > end)
{
return;
}
cout<<start<<" ";
PrintPattern1(start+5, end);
cout<<start<<" ";
}
float volumenEsfera(float radio){
float volumen;
volumen = 4 * M_PI * pow(radio,3) / 3;
return volumen;
}
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()
TypedQuery<Integer> query = entityManager.createQuery("SELECT MAX(received_volumetry) FROM audit.input_audit ORDER BY creation_date DESC LIMIT 30",Integer.class);
//in MainTransactionForm.Xaml.cs
public partial class MainTransactionForm : Form
{
public MainTransactionForm()
{
InitializeComponent();
}
private void withdrawButton_Click(object sender, EventArgs e)
{
LoginForm loginForm = new LoginForm();
loginForm.WithdrawChecking();
}
}
//in LoginForm.Xaml.cs
class LoginForm
{
public void WithdrawChecking()
{
if(true)
{
MessageBox.Show("withdraw checking");
}
}
}
int main() {
string nombre;
cout << "Escribe tu nombre: ";
cin >> nombre;
cout << "Hola " << nombre << "!!" << endl;
return 0;
}
function hablarEspañol(persona) {
if (persona === "español" || persona === "colombiano") {
console.log("¡Hola!");
} else {
console.log("¡Hablas inglés!");
}
}
int main() {
string nombre;
cout << "Escribe tu nombre: ";
cin >> nombre;
cout << "Hola " << nombre << "!!" << endl;
return 0;
}
fun hola(name: String) {
println("Hola $name")
}
hola("Miguel")
a = input("a:")
b = input("b:")
if a > b:
print(a)
else:
print(b)
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()
#include<iostream>
#include<string>
using namespace std;
int main(){
int n;
cout<<"enter number: ";
cin>>n;
string str = to_string(n);
cout<<str<<endl;
cout<<"sum is: ";
int sum = 0;
for(int i = 0; i < str.length(); i += 2){
string s;
s += str[i];
s += str[i+1];
sum += stoi(s);
}
cout<<sum<<endl;
}
import requests
def get_token():
return '835500611:AAF4cO6d0U6xRU6O-kSbY_Pf5G2f5Z5q5KQ'
def get_url():
token = get_token()
return f'https://api.telegram.org/bot{token}/'
def get_updates():
url = get_url() + 'getUpdates'
response = requests.get(url)
return response.json()
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
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');
}
onsole
mango
$1.00
pera
$1.50
tomate
$0.75
def age(name, age, address, phone, sex):
if age > 18:
print("Es mayor de edad")
else:
print("Es menor de edad")
if sex == "M":
print("Es hombre")
else:
print("Es mujer")
age("Maria", 26, "Calle 6", "123-4567", "F")
fun hola(name: String) {
println("Hola $name")
}
hola("Miguel")
A = 1
B = 3
C = 0
S = A
if B > S then S = B
if C > S then S = C
if A > S then A = S
if B > S then B = S
if C > S then C = S
if A > S then A = S
if B > S then B = S
if C > S then C = S
if A > S then A = S
if B > S then B = S
if C > S then C = S
print S
var name = "Mauricio"
var age = 30
var isDeveloper = true
var birthDate = new Date(1990, 7, 17)
var list = [name, age, isDeveloper, birthDate]
console.log(list)
#
public double IVA(double subtotal)
{
return subtotal * 0.16;
}
def get_fanels(img, gt, mask, nlabels):
fanels = []
for i in range(nlabels):
fanel = img.copy()
fanel[gt != i] = 0
fanel = fanel * mask
fanels.append(fanel)
return np.array(fanels)
int main(){
int i;
for(i=8;i<=500;i+=8){
printf("\n%d",i);
}
return 0;
}
Script
function doubleArray(arr){
let newArray = arr.map(num => num * 2)
return newArray
}
doubleArray([2,4,6,8]) // [4,8,12,16]
import requests
def get_token():
return '835500611:AAF4cO6d0U6xRU6O-kSbY_Pf5G2f5Z5q5KQ'
def get_url():
token = get_token()
return f'https://api.telegram.org/bot{token}/'
def get_updates():
url = get_url() + 'getUpdates'
response = requests.get(url)
return response.json()
def difficulty(player_level, quest_type, equipment):
if player_level < 10:
return 1
elif player_level < 20:
return 2
elif player_level < 30:
return 3
elif player_level < 40:
return 4
elif player_level < 50:
return 5
elif player_level < 60:
return 6
elif player_level < 70:
return
def vosk(question, answer):
#Vosk
return answer
void PrintPattern1(int start, int end)
{
if(start > end)
{
return;
}
cout<<start<<" ";
PrintPattern1(start+5, end);
cout<<start<<" ";
}
# Add a rectangle
color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255) )
pygame.draw.rect(screen, color, [random.randint(0, 200), random.randint(0, 200), 50, 50])
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()
int main()
{
int a, b, c;
cin>>a>>b>>c;
if(a>b && a>c)
{
cout<<a<<" ";
if(b>c)
cout<<b<<" "<<c;
else
cout<<c<<" "<<b;
}
else if(b>a && b>c)
{
cout<<b<<" ";
if(a>c)
cout<<a<<" "<<c;
else
cout<<c<<" "<<a;
}
else if(c>a && c>b)
{
cout<<c<<" ";
if(a>b)
cout<<a<<" "<<b;
else
cout<<b<<" "<<a;
}
return 0;
}
Script
function add(a, b) {
return a + b;
}
void PrintPattern1(int start, int end)
{
if(start > end)
{
return;
}
cout<<start<<" ";
PrintPattern1(start+5, end);
cout<<start<<" ";
}
def add(a, b):
return a + b
import requests
def get_token():
return '835500611:AAF4cO6d0U6xRU6O-kSbY_Pf5G2f5Z5q5KQ'
def get_url():
token = get_token()
return f'https://api.telegram.org/bot{token}/'
def get_updates():
url = get_url() + 'getUpdates'
response = requests.get(url)
return response.json()
Script
function add(a, b) {
return a + b;
}
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)
int main(){
int i;
for(i=8;i<=500;i+=8){
printf("\n%d",i);
}
return 0;
}
// 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!"
}