Generated by the communtiy
#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
TYPE html>
<html>
<head>
<title>PC Stand</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="container">
<div id="header">
<h1>PC Stand</h1>
</div>
<div id="content">
<h2>About</h2>
<p>
The PC Stand is a project I started in the summer of 2015. I wanted to make a stand for my
<table>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
</table>
lic double areaTriangle(double a, double b, double c)
{
return (a * b * Math.Sqrt(Math.Pow(c, 2) - Math.Pow(a, 2) - Math.Pow(b, 2))) / 2;
}
public double areaSquare(double a)
{
return a * a;
}
public double area
function Add(a, b) {
console.log(a + b)
}
Add(1, 2)
function sumaCubos(n) {
if (n > 0) {
return n * n * n + sumaCubos(n - 1);
} else {
return 0;
}
}
sumaCubos(3);
def while_loop(n):
while n > 0:
print n
n -= 1
print 'Blastoff!'
def login(user, password):
while(True):
i = 0
while(i<3):
if(user == 'a' and password == 'b'):
print('Welcome')
return True
else:
print('Wrong username or password')
i = i + 1
user = input('User: ')
password = input('Password: ')
print('You have exceeded the maximum number of attempts')
return False
login('a', 'b')
function lastNonNumber(number) {
var a = number.toString();
var b = a.replace(/\d$/, '');
return parseInt(b);
}
lastNonNumber(2342341)
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
The regex matches the first bracket, then any character, then any number of characters, then a comma.
func plot(data: [(a: String, b: Double, c: Double, d: Double)]) {
let data = data.map { ($0.a, $0.b, $0.c, $0.d) }
let data2 = data.map { ($0.a, $0.b, $0.c, $0.d) }
let data3
public interface FiguraGeometrica {
double calcularArea();
double calcularPerimetro();
}
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');
}
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))
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:
using System;
using Classes;
namespace SevenWonders
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
def hipotenusa(a, b):
return a**2 + b**2
hipotenusa(3, 4)
A:
Python 3.6+
The ** operator is a binary operator that can be used to raise a number to a power. It is equivalent to the ** operator in Python 2.7+, but is more readable and more efficient.
>>> 3 ** 2
Python
#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));
}
#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")
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
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')
function Add(a, b) {
console.log(a + b)
}
Add(1, 2)
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)
def add(a, b):
print(a)
print(b)
return a + b
add(1, 2)
def download_file(url):
# download url
# return file_path
return file_path
def factorial(n):
total = 1
for i in range(1, n + 1):
total *= i
return total
factorial(5)
//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");
}
}
}
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("
// 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
def while_loop(n):
while n > 0:
print n
n -= 1
print 'Blastoff!'
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);
}
for (int i = 0; i < n / 2; i++) {
for (int j = i; j < n - i - 1; j++) {
int tmp = mat[i][j];
mat[i][j] = mat[j][n - i - 1];
mat[j][n - i - 1] = mat[n - i - 1][n - j - 1];
mat[n - i - 1][n - j - 1] = mat[n - j - 1][i];
mat[n - j - 1][i] = tmp;
}
}
#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")
#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));
}
from tkinter import *
def my_callback():
print("This is my first callback")
root = Tk()
button = Button(root, text='Click Me!', command=my_callback)
button.pack()
root.mainloop()
def hipotenusa(a, b):
return a**2 + b**2
hipotenusa(3, 4)
A:
Python 3.6+
The ** operator is a binary operator that can be used to raise a number to a power. It is equivalent to the ** operator in Python 2.7+, but is more readable and more efficient.
>>> 3 ** 2
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 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 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;
}
def ban_ip(ip):
os.system("iptables -A INPUT -s %s -j DROP" % ip)
os.system("service iptables save")
os.system("service iptables restart")
def unban_ip(ip):
os.system("iptables -D INPUT -s %s -j DROP" % ip)
os.system("service iptables save")
os.system("service iptables restart")
public static void main(String[] args) {
System.out.println("Hello World");
}
nclude <iostream>
using namespace std;
int add(int a, int b) {
return a + b;
}
int main() {
int a = add(1, 2);
cout << a << endl;
return 0;
}
A:
The problem is that you are using the same variable name for the function and the variable. You need to use different names for
def login(user, password):
while(True):
i = 0
while(i<3):
if(user == 'a' and password == 'b'):
print('Welcome')
return True
else:
print('Wrong username or password')
i = i + 1
user = input('User: ')
password = input('Password: ')
print('You have exceeded the maximum number of attempts')
return False
login('a', 'b')
#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")
# 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])
//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");
}
}
}
translateMon, 20 Mar 2023 float volumenEsfera(float radio){
float volumen;
volumen = 4 * M_PI * pow(radio,3) / 3;
return volumen;
}
def hack(n):
return n * n * n * n * n * n * n * n * n * n
hack(100000000000)
let sql = require('sql')
sql.query(sql.select().from(table).toString())
tmp_file.close
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++;
}
lic double areaTriangle(double a, double b, double c)
{
return (a * b * Math.Sqrt(Math.Pow(c, 2) - Math.Pow(a, 2) - Math.Pow(b, 2))) / 2;
}
public double areaSquare(double a)
{
return a * a;
}
public double area
int main (){
int n=0;
do{
n++;
if (n%2==0)
cout<<n<<endl;
}while(n<=100);
}
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
ript
function area(x) {
return x * x;
}
function perimetro(x) {
return x * 4;
}
function areaPerimetro(x) {
return x * x + x * 4;
}
function areaPerimetro2(x) {
return x * x + x * x + x * 4;
}
function areaPerimetro3
def print_message(message):
print(message)
def main():
print_message("Hello, world!")
if __name__ == '__main__':
main()
A:
You can use the following code to get the current working directory:
import os
print(os.getcwd())
A:
You can use os.path.
function lastNonNumber(number) {
var a = number.toString();
var b = a.replace(/\d$/, '');
return parseInt(b);
}
lastNonNumber(2342341)
def add(a, b):
print(a)
print(b)
return a + b
add(1, 2)
DELIMITER //
CREATE PROCEDURE ListProducts()
BEGIN
SELECT * FROM Products
INNER JOIN Categories
ON
Products.categoryID = Categories.categoryID
INNER JOIN Suppliers
ON
Products.supplierID = Suppliers.supplierID
END //
DELIMITER ;
ript
function area(x) {
return x * x;
}
function perimetro(x) {
return x * 4;
}
function areaPerimetro(x) {
return x * x + x * 4;
}
function areaPerimetro2(x) {
return x * x + x * x + x * 4;
}
function areaPerimetro3