Estoy ideando un proyecto, necesito alguien que sepa Python preferentemente, aunque puede ser en Ruby o NodeJS y que sepa usar la API de Instagram. Escribanme al privado. Saludos, y gracias.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menúdoctype html
html
head
title=title
meta(charset='utf-8')
meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')
script(src='https://code.jquery.com/jquery-3.2.1.slim.min.js', integrity='sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN', crossorigin='anonymous')
link(href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css', rel='stylesheet')
link(href='https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/css/mdb.min.css', rel='stylesheet')
link(href='css/style.css', rel='stylesheet')
script(src='js/main.js')
body
block content
extends layout
block content
.view.hm-black-light
.full-bg-img.flex-center
ul.animated.fadeInUp
li
h1.display-3.b-4.font-bold Grapict
li
h3.mb-5 See the posts you really want to see
li
button.btn.btn-primary(type='button', data-toggle='modal', data-target='#register') Launch demo modal
#register.modal.fade(tabindex='-1', role='dialog', aria-labelledby='exampleModalLabel', aria-hidden='true')
.modal-dialog.modal-side.modal-top-right(role='document')
.modal-content
.modal-header
h5#exampleModalLabel.modal-title Modal title
button.close(type='button', data-dismiss='modal', aria-label='Close')
span(aria-hidden='true') ×
.modal-body
| ...
script(src='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js', integrity='sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl', crossorigin='anonymous')
script(src='https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/js/mdb.min.js')
Citar
this application has requested the runtime to terminate it in an unusual way
<div class="inicio medio small"></div>
<div class="inicio medio medium"></div>
<div class="inicio medio large"></div>
.inicio.medio .medium {...}
.inicio .medio .medium {...}
inicio medio medium {...}
.inicio.medio.medium {...}
const express = require('express');
const helmet = require('helmet');
const bodyParser = require('body-parser')
const compression = require('compression');
const app = express();
const port = 80;
const db = require('./config/database');
db.connect();
//use
app.use(bodyParser.text({ type: 'text/html' }));
app.use(helmet());
app.use(compression());
//Peticiones GET
app.get('/', function(req,res){
res.render('index');
})
//Puerto
app.listen(port, (req, res) => {
console.log("listening...");
});
const mongoose = require('mongoose');
const dbName = 'places';
module.exports = {
connect: ()=> mongoose.connect('mongodb://localhost'+dbName),
dbName,
connection: ()=>{
if(mongoose.connection)
return mongoose.connection;
return this.connect();
}
}
Citar
> app@1.0.0 start C:\Users\magod\Desktop\http
> node server.js
(node:11260) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
listening...
events.js:136
throw er; // Unhandled 'error' event
^
MongoError: failed to connect to server [localhostplaces:27017] on first connect [MongoError: getaddrinfo ENOTFOUND localhostplaces localhostplaces:27017]
at Pool.<anonymous> (C:\Users\magod\Desktop\http\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at Pool.emit (events.js:159:13)
at Connection.<anonymous> (C:\Users\magod\Desktop\http\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (events.js:254:19)
at Connection.emit (events.js:159:13)
at Socket.<anonymous> (C:\Users\magod\Desktop\http\node_modules\mongodb-core\lib\connection\connection.js:187:49)
at Object.onceWrapper (events.js:254:19)
at Socket.emit (events.js:159:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app@1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\magod\AppData\Roaming\npm-cache\_logs\2017-11-22T17_48_30_244Z-debug.log
[
{
model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
speed: 2926,
times: {
user: 252020,
nice: 0,
sys: 30340,
idle: 1070356870,
irq: 0
}
}]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="css/estilos.css">
<link rel="stylesheet" href="css/animate.css">
</head>
<body>
<h1 id="texto" class="animated">Hola Mundo</h1>
<button id="es" class="button">Español</button>
<button id="en" class="button">English</button>
<button id="pt" class="button">Portugues</button>
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script src="js/main.js"></script>
</body>
</html>
$(function(){
console.log("jQuery esta funcionando");
$('#en').click(function(){
$('#texto').addClass("flash").text("Hola mundo")
console.log("Cambiaste a idioma Spanish")
})
$('#es').click(function(){
$('#texto').addClass("flash").text("Hello World")
console.log("Cambiaste a idioma Ingles")
})
$('#pt').click(function(){
$('#texto').addClass("flash").text("Ola Mundo")
console.log("Cambiaste a idioma Portugues")
})
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<style>
.rojo{
background-color: red;
color:white;
}
</style>
</head>
<body>
<h1>addClass con jQuery</h1>
<script src="jquery-3.2.1.min.js"></script>
<script>
$(function(){
console.log("jQuery funciona");
$('h1').click(function(){
$(this).addClass('rojo');
console.log("Clase agregada");
});
})
</script>
</body>
</html>
$(function(){
$('#ejecutar').click(function(){
sumar($('#valor1').val(), $('#valor2').val());
});
function suma(val1,val2){
var parametros = {
"val1":val1,
"val2":val2,
}
$.ajax({
data:parametros,
url:"suma.php",
type:"post",
beforeSend: function(){
console.log("Se esta procesando la peticion");
}
})
.done(function(data){
$('#resultado').text(data)
//console.log(data)
})
}
});
<?php
$resultado = $_POST['val1'] + $_POST['val2'];
echo $resultado;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hola</title>
</head>
<body>
<center><h1>Ejemplo Ajax</h1></center>
<input type="text" id="valor1">
<input type="text" id="valor2">
<input type="submit" id="ejecutar" value="Sumar">
<h3 id="resultado"></h3>
<script src="js/jquery-3.2.1.min.js">
</script>
<script src="js/main.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Zodiaco Chino</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/css/mdb.min.css">
<link rel="stylesheet" href="../css/estilos.css">
</head>
<body>
<div class="container">
<div class="header">
<div class="row">
<div class="col-md-6 col-md-6-offset">
<form method="post">
<div class="md-form">
<input class="form-control mr-sm-2" maxlength="4" type="text" name="search" id="search">
<label for="search">Coloca tu año de nacimiento</label>
</div>
<button class="btn btn-outline-danger btn-md btn-block waves-effect " type="submit">Buscar</button>
</form>
</div>
</div>
</div>
<!-- -->
<div class="coco modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog btn-outline-danger" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<a href="<?php $link ?>" class="btn btn-outline-info waves-effect">Mas...</a>
<button type="button" class="btn btn-outline-danger waves-effect" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
<!-- -->
<div class="container">
<div class="row">
<div class="col-md-9">
<div class="center">
<div class="">¿No conoces sobre tu signo zodiacal chino? Busca aqui!</div>
<div class="six">
<button class="btn btn-outline-danger waves-effect btn-md">虎 Tigre</button>
<button class="btn btn-outline-danger waves-effect btn-md">兔 Conejo</button>
<button class="btn btn-outline-danger waves-effect btn-md">龍 Dragon</button>
<button class="btn btn-outline-danger waves-effect btn-md">蛇 Serpiente</button>
<button class="btn btn-outline-danger waves-effect btn-md">馬 Caballo</button>
<button class="btn btn-outline-danger waves-effect btn-md">羊 Cabra</button>
</div>
<div class="six-more col-md-12 col-md-12-offset">
<button class="btn btn-outline-danger waves-effect btn-md">猴 Mono</button>
<button class="btn btn-outline-danger waves-effect btn-md">雞 Gallo</button>
<button class="btn btn-outline-danger waves-effect btn-md">狗 Perro</button>
<button class="btn btn-outline-danger waves-effect btn-md">豬 Puerco</button>
<button class="btn btn-outline-danger waves-effect btn-md">鼠 Rata</button>
<button class="btn btn-outline-danger waves-effect btn-md">牛 Buey</button>
</div>
</div>
</div>
</div>
</div>
<!-- footer -->
<footer class="center-footer">
<div class="footer-copyright">
© 2017 Copyright: Ronnie Rodriguez
</div>
</footer>
<script src="js/includejs.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/js/mdb.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<?php
$search=isset($_POST['search'])?$_POST['search']:'';
if ($search!=''){
$nombre='(todavia ninguno)';
$link='(todavia ninguno)';
switch($search){
case "1944": case "1956": case "1968": case "1980": case "1992": case "2004": case "2016":
$nombre='Mono';
$link ='http://www.google.com/mono';
break;
case "1945": case "1957": case "1969": case "1981": case "1993": case "2005": case "2017":
$nombre='Gallo';
break;
case "1946": case "1958": case "1970": case "1982": case "1994": case "2006": case "2018":
$nombre='Perro';
break;
case "1947": case "1959": case "1971": case "1983": case "1995": case "2007": case "2019":
$nombre='Puerco';
break;
case "1948": case "1960": case "1972": case "1984": case "1996": case "2008":
case "2020":
$nombre='Rata';
break;
case "1949": case "1961": case "1923": case "1985": case "1997": case "2009": case "2021":
$nombre='Bufalo';
break;
case "1950": case "1962": case "1924": case "1986": case "1998": case "2010": case "2022":
$nombre='Tigre';
break;
case "1951": case "1963": case "1924": case "1987": case "1999": case "2011": case "2023":
$nombre='Conejo';
break;
case "1952": case "1964": case "1925": case "1986": case "2000": case "2012": case "2024":
$nombre='Dragon';
break;
case "1953": case "1965": case "1926": case "1987": case "2001": case "2013": case "2025":
$nombre='Serpiente';
break;
case "1954": case "1966": case "1927": case "1988": case "2002": case "2014": case "2025":
$nombre='Caballo';
break;
case "1955": case "1967": case "1928": case "1989": case "2003": case "2015": case "2026":
$nombre='Cabra';
break;
}
?>
<script>
$('.coco .modal-body').html('Your sign is: <?php echo $nombre; ?>')
$('.coco').modal('show')
</script>
<?php
}
?>
</div>
</body>
</html>
<a href="<?php $link ?>" class="btn btn-outline-info waves-effect">Mas...</a>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/css/mdb.min.css">
<link rel="stylesheet" href="css/estilos.css">
</head>
<body>
<div class="container">
<div class="header">
<div class="row">
<div class="col-md-6 col-md-6-offset">
<input class="form-control mr-sm-2" type="text" placeholder="Select the year of your birth" name="search" id="search">
<button class="btn btn-outline-info btn-md btn-block waves-effect " type="submit">Search</button>
</div>
</div>
<div id="result">
</div>
</div>
<!-- -->
<div class="selector">
</div>
<script src="js/includejs.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/js/mdb.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
</body>
</html>
$(document).ready(function() {
// Esta primera parte crea un loader no es necesaria
$().ajaxStart(function() {
$('#loading').show();
$('#result').hide();
}).ajaxStop(function() {
$('#loading').hide();
$('#result').fadeIn('slow');
});
// Interceptamos el evento submit
$('#form, #fat, #fo3').click(function() {
// Enviamos el formulario usando AJAX
$.ajax({
type: 'POST',
url: $(this).attr('action'),
data: $(this).serialize(),
// Mostramos un mensaje con la respuesta de PHP
success: function(data) {
$('#result').html(data);
}
})
return false;
});
})
const express = require("express");
const bodyParser = require("body-parser");
const pug = require("pug");
const data = require("mongodb").MongoClient;
const app = express();
const mongoose = require('mongoose');
//var model = mongoose.model('algunModelo, algunSchema');
var Schema = mongoose.Schema;
var users = Schema({
email: String,
password: String
})
var db;
app.set("view engine", "pug");
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static("public"));
app.use(bodyParser.json());
data
.connect("mongodb://localhost:27017/project", (err, database) => {
db = database;
var user = db.collection("users"); //haciendo referencia a la conexion
if (err) return console.log(err);
//peticiones HTTP
app.get("/", (req, res) => {
res.render("index");
console.log("Hiciste una peticion GET");
});
app.get("/register", (req, res) => {
res.render("register");
console.log("Entraste al Register");
});
app.post("/home", (req, res) => {
console.log("Has accedido al registro");
db.save({
email : req.body.email,
password : req.body.password
}, err => {
if(err) throw err
else
console.log("Datos enviados \n al servidor");
res.render('home');
});
});
if (err) throw err;
else return console.log("Base de datos conectada")
});
app.listen(80, "localhost", err => {
if (err) throw err;
console.log("Ya se conectooooo")
});
var promise = new Promise((resolve, reject) => {
const FLAG = 5;
if (FLAG == 5) resolve("Todo en orden");
else reject(error("Algo salio mal"));
});
promise.then(
res => {
console.log(res);
},
error => {
console.log(error);
}
);
const express = require('express');
const bodyParser = require('body-parser');
const pug = require('pug');
const db = require('mongoose');
const client = require('mongodb').MongoClient;
//const session = require('express-session');
var app = express();
var Schema = db.Schema;
var optionsdb = { promiseLibrary: require('bluebird') };
//Conexion a MongoDB
db.createConnection('mongodb://localhost/project', optionsdb);
//Creacion de la Base de Datos en un JSON
var usuarios = {
email: String,
password: String,
}
/* cookies
app.use(session({
secret: 'a4f8071f-c873-4447-8ee2',
cookie: { maxAge: 2628000000 },
store: new (require('express-sessions'))({
storage: 'mongodb',
instance: db, // optional
host: 'localhost', // optional
port: 27017, // optional
db: 'project', // optional
collection: 'users', // optional
expire: 86400 // optional
})
}));
*/
//no tocar
var db1;
//Model
var user_schema = new Schema(usuarios);
var User = db.model('User', user_schema);
//vistas y configuracion
app.set('view engine', 'pug')
app.use(bodyParser.urlencoded({ extended: true }))
app.use(express.static('public'));
app.use(bodyParser.json());
//Conexion de MongoDB al cliente
client.connect('mongodb://localhost/project', (err, database) => {
// Chequeo de Error en Conexion
if (err) return console.log(err);
db1 = database;
//peticiones HTTP
app.get('/', (req,res) => {
res.render('index');
console.log('Hiciste una peticion GET');
});
app.post('/', (req,res) => {
datos = new User({
email: req.body.email,
password: req.body.password
})
datos.save( (err,datos)=> {
console.log("Usuario registrado")
res.render("bienvenida")
})
})
//Puerto en el que se va a escuchar el servidor
app.listen(80, 'localhost', () => {
console.log('Servidor iniciado correctamente');
});
});
extends ./layouts.pug
block contenido
body
div(class="container")
form(action='/', method="POST", class="form-signin")
.container
form.form-signin
h2.form-signin-heading Please sign in
label.sr-only(for='inputEmail') Email address
input#inputEmail.form-control(type='email', placeholder='Email address', ref="email", name="email" required, autofocus='')
label.sr-only(for='inputPassword') Password
input#inputPassword.form-control(type='password', ref="password", placeholder='Password', required, name="password")
.checkbox
label
input(type='checkbox', value='remember-me')
| Remember me
button.btn.btn-lg.btn-primary.btn-block(type='submit') Sign in
extends ./layouts.pug
block contenido
body
div.container
div.row
div.col-md-12
div.card
h1 Registrado
const express = require('express');
const pug = require('pug');
const mongoose = require('mongoose');
var app = express();
var Schema = mongoose.Schema;
console.log("Servidor iniciado correctamente");
//Configuracion de MongoDB
mongoose.connect("mongodb://localhost/fotos");
var tabla = {
email:String,
password:String
};
var user_tabla = new Schema(tabla);
var User = mongoose.model("User", tabla);
//Configuracion de las Vistas
app.set('view engine', 'pug');
app.use(express.static('public'));
//Peticiones http
app.get('/', (req,res) => {
res.render('index');
console.log('Peticion GET al index realizada');
});
app.post('/users', (req,res) => {
var user = new User({email: req.body.email, password: req.body.password});
user.save(() =>{
res.send("peticion");
});
console.log('Peticion POST al formulario realizada');
});
app.listen(80, 'localhost');
extends ./layout
block contenido
h1 Bienvenido a Express
form(action="/", method="POST")
input(type="email", name="email", id="email", class="email", placeholder="Email")
input(type="password", name="password", id="password", class="password", placeholder="Password")
input(type="submit", value="Enviar")
extends ./layout.pug
block contenido
h1 Datos enviados correctamente
<?php
$Count = 0;
while($Count < 100){
$Count++;
$Numbers[] = $Count;
}
foreach($Count as $CurNum)
echo "<p> $Numbers</p>";
?>
var app = angular.module('my', []);
app.controller('controlador', ($scope) => {
$scope.nuevoComentario = "";
$scope.comentarios = [
{
comentario: "Hola mundo",
username: "Diesan"
}
];
$scope.agregarComentario = () => {
$scope.comentarios.push($scope.nuevoComentario);
};
});
<!DOCTYPE html5>
<html lang="es-ES" ng-app="my">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="js/controller.js"></script>
<link rel="stylesheet" href="css/estilos.css">
</head>
<body ng-controller="controlador">
<input type="text" placeholder="usuario" ng-model="nuevoComentario.username"><br>
<input type="text" placeholder="comentario" ng-model="nuevoComentario.comentario"><br>
<button ng-click="agregarComentario()">Agregar</button>
<h3>
<ol type="1">
<li ng-repeat="comentario in comentarios">
{{comentario.comentario}} - <strong>{{comentario.username}}</strong>
</li>
</ol>
</h3>
</body>
</html>
function generador(){
var index = 0;
while(index<3){
yield index++;
}
}
let gen = generador();
console.log(gen.next());
function algoritmo()
{
var for(,numero>0,numero, invertido, numero;
numero = parseInt (document.formulario.numero.value);
for(,numero>0,numero/=10);
invertido+=invertido*10+(numero%10);
document.formulario.for(,numero>0,numero.value = for(,numero>0,numero;
document.formulario.invertido.value = invertido;
}
</head>
<body>
<form name="formulario">
<table style="text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td>Ingrese el valor de numero</td>
<td><input name="numero" /></td>
</tr>
<tr align="center">
<td colspan="2" rowspan="1">
<input value="Procesar" type="button" onclick="algoritmo();" />
<input type="reset" />
</td>
</tr>
<tr>
<td>Valor de for(,numero>0,numero:</td>
<td><input name="for(,numero>0,numero"></td>
</tr>
<tr>
<td>Valor de invertido:</td>
<td><input name="invertido"></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
! function(){}();
//modulos de NodeJS
const http = require('http');
const fs = require('fs');
//const crypto = require('crypto');
//cifrar contraseñas (valores de variables);
/*
const secret = 'Diesan es el mejor';
const hash = crypto.createHmac('sha256', secret)
.update('I love cupcakes')
.digest('hex');
console.log("Esta es la contraseña cifrada: " + hash);
*/
// Servidor corriendo archivos
http.createServer(function(req,res){
fs.readFile("./index.html", function(err,html){
res.write(index);
res.end();
});
}).listen(80);
CitarReferenceError: index is not defined at C:\Users\Student\Desktop\magodiesan\app.js:17:13
import random;
numero = random.randint(1,100);
print(numero);
while true:
usuario = int(input("Coloca un numero entero para adivinar: "));
if numero < usuario:
print("Numero muy grande")
elif numero > usuario:
print("El numero es muy peque")
elif numero == usuario:
print("felicidades")
break;
function sum(a, b) {
a = parseFloat(prompt("numero"));
b = parseFloat(prompt("numero"));
c = a + b;
return alert(c);
}
sum(1, 2);