Generated by the communtiy
/*
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() {
++
#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");
def mask_article(text, keyword):
return text.replace(keyword, "*"*len(keyword))
text = "今日のサンプルは金額です"
mask_article(text, "金額")
void programar(a, z) {
if (a == z)
return a;
}
var products = [
{ name: 'Galletas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' },
{ name: 'Bebidas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' },
{ name: 'Comida', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' },
{ name: 'Papas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' },
{ name: 'Tortas', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.' },
]
var carousel = document.getElementById('carousel');
var html = '';
html += '<div class="products">'
for (var i = 0; i < products.length; i++) {
html += '<div class="product">';
html += '<
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)
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
<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>
int main(){
char letra, mes[13];
printf("Ingrese una letra de la A a la L: ");
scanf("%c", &letra);
switch(letra){
case 'A':
case 'a':
printf("Enero");
break;
case 'B':
case 'b':
printf("Febrero");
break;
case 'C':
case 'c':
printf("Marzo");
break;
case 'D':
case 'd':
printf("Abril");
break;
case 'E':
case 'e':
printf("Mayo");
break;
case 'F':
case 'f':
printf("Junio");
break;
case 'G':
case 'g':
printf("Julio");
break;
case 'H':
case 'h':
printf("Agosto");
break;
case 'I':
case
func crack(phone):
phone.hack()
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
let sql = require('sql')
sql.query(sql.select().from(table).toString())
Script
function doubleArray(arr){
let newArray = arr.map(num => num * 2)
return newArray
}
doubleArray([2,4,6,8]) // [4,8,12,16]
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
int main(){
int i;
for(i=8;i<=500;i+=8){
printf("\n%d",i);
}
return 0;
}
SELECT name, year, war FROM database WHERE (war WHERE year=2002)+(war WHERE year=2003)>5
Ship::Ship(ShipType type,const std::vector<Coordinate *> &positions)
{
this->type = type;
this->positions = positions;
}
Python
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
def find_max_square(arr):
max_square = 0
pos = 0
for i, x in enumerate(arr):
if x ** 2 > max_square:
max_square = x ** 2
pos = i
return pos, max_square
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)
def hack(n):
return n * n * n * n * n * n * n * n * n * n
hack(100000000000)
printf("\n1. Cálculo de perímetro de circunferencia\n");
printf("2. Área de circunferencia\n");
printf("3. Volumen de la esfera\n");
printf("4. Salir\n");
printf("\nIngrese una opción: ");
scanf("%d",&opcion);
def vosk(question, answer):
#Vosk
return answer
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
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
def hack(n):
return n * n * n * n * n * n * n * n * n * n
hack(100000000000)
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
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
**Nombre del Software:** PERFIL DE INGRESO COMO DEPORTISTA A LA UNIVERSIDAD DE CÓRDOBA – SPORT STUDENTS UDC “SPOSTU”
**Descripción:**
El software "SPOSTU" es una aplicación web desarrollada en PHP que permite a los estudiantes que desean ingresar a la Universidad de Córdoba como deportistas, crear un perfil y presentar su solicitud de ingreso. La aplicación ofrece una plataforma fácil de usar y segura para que los estudiantes puedan proporcionar la información necesaria para su solicitud.
**Requisitos Funcionales:**
1. **Registro de estudiantes:** Los estudiantes pueden registrarse en la aplicación proporcionando su nombre, apellido, correo electrónico, contraseña y número de documento.
2. **Creación de perfil:** Los estudiantes pueden crear un perfil que incluye su información personal, datos de contacto y experiencia deportiva.
3. **Presentación de solicitud:** Los estudiantes pueden presentar su solicitud de ingreso a la Universidad de Córdoba como deportistas, proporcionando la documentación necesaria y respondiendo a las preguntas del formulario.
4. **Gestión de solicitudes:** Los responsables de la Universidad de Córdoba pueden gestionar las solicitudes de ingreso, revisar la documentación y evaluar las solicitudes.
5. **Notificación de resultados:** Los estudiantes pueden recibir notificaciones sobre el estado de su solicitud y los resultados finales.
**Requisitos No Funcionales:**
1. **Seguridad:** La aplicación debe ser segura y proteger la información personal de los estudiantes.
2. **Usabilidad:** La aplicación debe ser fácil de usar y navegar.
3. **Rendimiento:** La aplicación debe ser rápida y eficiente en su funcionamiento.
4. **Compatibilidad:** La aplicación debe ser compatible con diferentes navegadores y dispositivos.
**Diseño de la Base de Datos:**
La base de datos de la aplicación "SPOSTU" estará compuesta por las siguientes tablas:
1. **estudiantes:** Almacena la información personal de los estudiantes, incluyendo nombre, apellido, correo electrónico, contraseña y número de documento.
2. **perfiles:** Almacena la información del perfil de cada estudiante, incluyendo datos de contacto y experiencia deportiva.
3. **solicitudes:** Almacena la información de cada solicitud de ingreso, incluyendo la documentación proporcionada y las respuestas al formulario.
4. **resultados:** Almacena los resultados finales de cada solicitud de ingreso.
**Estructura de la Aplicación:**
La aplicación "SPOSTU" estará estructurada en las siguientes capas:
1. **Capa de presentación:** Se encarga de la interfaz de usuario y la presentación de la información.
2. **Capa de lógica de negocio:** Se encarga de la lógica de negocio y la gestión de la información.
3. **Capa de acceso a datos:** Se encarga de la conexión a la base de datos y la recuperación de la información.
**Tecnologías utilizadas:**
1. **PHP:** Se utilizará como lenguaje de programación principal.
2. **MySQL:** Se utilizará como base de datos.
3. **HTML/CSS:** Se utilizarán para la creación de la interfaz de usuario.
4. **JavaScript:** Se utilizará para la creación de efectos y animaciones.
**Ejemplo de código:**
```php
// Conexión a la base de datos
$conexion = mysqli_connect("localhost", "usuario", "contraseña", "bd_spostu");
// Registro de estudiantes
if (isset($_POST['registro'])) {
$nombre = $_POST['nombre'];
$apellido = $_POST['apellido'];
$correo = $_POST['correo'];
$contraseña = $_POST['contraseña'];
$documento = $_POST['documento'];
// Insertar datos en la base de datos
$query = "INSERT INTO estudiantes (nombre, apellido, correo, contraseña, documento) VALUES ('$nombre', '$apellido', '$correo', '$contraseña', '$documento')";
mysqli_query($conexion, $query);
// Redireccionar a la página de perfil
header("Location: perfil.php");
}
// Creación de perfil
if (isset($_POST['crear_perfil'])) {
$datos_contacto = $_POST['datos_contacto'];
$experiencia_deportiva = $_POST['experiencia_deportiva'];
// Insertar datos en la base de datos
$query = "INSERT INTO perfiles (datos_contacto, experiencia_deportiva) VALUES ('$datos_contacto', '$experiencia_deportiva')";
mysqli_query($conexion, $query);
// Redireccionar a la página de solicitud
header("Location: solicitud.php");
}
// Presentación de solicitud
if (isset($_POST['presentar_solicitud'])) {
$documentacion = $_POST['documentacion'];
$respuestas = $_POST['respuestas'];
// Insertar datos en la base de datos
$query = "INSERT INTO solicitudes (documentacion, respuestas) VALUES ('$documentacion', '$respuestas')";
mysqli_query($conexion, $query);
// Redireccionar a la página de resultados
header("Location: resultados.php");
}
```
Este es solo un ejemplo de código y no es una implementación completa de la aplicación "SPOSTU". La aplicación debe ser desarrollada y probada exhaustivamente antes de ser lanzada a producción.
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()
#include <iostream>
int main() {
int suma = 0;
for (int i = 0; i < 200; ++i) {
if(i % 2 != 0)
suma += i;
}
std::cout << suma << std::endl;
return 0;
}
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')
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)
// 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!"
}
translateThu, 23 Mar 2023 #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;
}
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++;
}
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')
Script
function doubleArray(arr){
let newArray = arr.map(num => num * 2)
return newArray
}
doubleArray([2,4,6,8]) // [4,8,12,16]
a = input("a:")
b = input("b:")
if a > b:
print(a)
else:
print(b)
SELECT name, year, war FROM database WHERE (war WHERE year=2002)+(war WHERE year=2003)>5
def hack_instagram(username):
Here's a simple example of a class in Java that has a method to increment a counter:
```java
public class Counter {
private int count;
public Counter() {
this.count = 0;
}
public void increment() {
this.count++;
}
public int getCount() {
return this.count;
}
public static void main(String[] args) {
Counter counter = new Counter();
System.out.println("Initial count: " + counter.getCount());
counter.increment();
System.out.println("Count after increment: " + counter.getCount());
counter.increment();
System.out.println("Count after second increment: " + counter.getCount());
}
}
```
In this example, the `Counter` class has a private integer field `count` to store the current count. The `increment` method increments the count by 1. The `getCount` method returns the current count.
When you run this code, it will output:
```
Initial count: 0
Count after increment: 1
Count after second increment: 2
```
This demonstrates that the `increment` method is working correctly and incrementing the counter each time it's called.
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
++
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
public static int sum(int a, int b) {
return a + b;
}
SELECT * FROM `order` where ctime between '2017-03-01' and '2017-05-22' and id in (select order_id from order_detail where status = 1 )
++
void intercambiar(int *a, int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
void main()
{
int a, b;
cout << "a = "; cin >> a;
cout << "b = "; cin >> b;
intercambiar(&a, &b);
cout << "a = " << a << endl;
cout << "b = " << b << endl;
}
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,
import java.util.Scanner;
public class Ejercicio4 {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
String[] novelas = { "El Alquimista", "Como agua para chocolate", "Cien años de soledad" };
String[] ciencia = { "La física de lo imposible", "El universo elegante", "La teoría del todo" };
String[] tecnologia = { "El futuro de la humanidad", "El viaje de la computadora", "La revolución de Bitcoin" };
System.out.println("Libros de Novelas");
System.out.println("================");
for (String i : novelas) {
System.out.println(i);
}
System.out.println("Libros de Ciencia");
System.out.println("================");
for (String i : ciencia) {
System.out.println(
function datos12() {
data.map(elem => {
var graf = elem;
graf.map(elementos => {
setElemntos(elementos);
});
});
}
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
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);
int main (){
int n=0;
do{
n++;
if (n%2==0)
cout<<n<<endl;
}while(n<=100);
}
function Dice() {
this.value = 0;
this.numberOfThrows = 0;
this.renderTo = "";
}
Dice.prototype.render = function () {
document.querySelector(this.renderTo).innerHTML = this.value;
};
Dice.prototype.throw = function () {
this.numberOfThrows++;
this.value = Math.ceil(Math.random() * 6);
};
Dice.prototype.getNumberOfThrows = function () {
return this.numberOfThrows;
};
Dice.prototype.getValue = function () {
return this.value;
};
<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>
def print_people(people_list):
for p in people_list:
print(p[0], p[1])
print_people(people)
#
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);
}
// 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!"
}
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