This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Operaciones: | |
def __init__(self): | |
self.a=float(input("Por favor introduzca el primer numero: " )) | |
self.b=float(input("Por favor introduzca el segundo numero: " )) | |
def suma(self): | |
return self.a + self.b | |
def resta(self): | |
return self.a - self.b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
/* | |
* ./a.out [inicio] [fin] | |
* ej: | |
* ./a.out 0 20 | |
* PROCESANDO: [ | |
* PROCESANDO: [====================] LISTO!!! | |
* ./a.out 10 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- DEFINICION DE LA TABLA mercados | |
CREATE TABLE markers( | |
id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, | |
name varchar(60) NOT NULL, | |
address varchar(80) NOT NULL, | |
lat float(10,6) NOT NULL, | |
lng float(10,6) NOT NULL | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
.noticia{ | |
background: url(logo.png) no-repeat; | |
height: 30px; | |
padding-left: 50px; | |
} | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MySQLdb | |
import datetime | |
basededatos = MySQLdb.connect(host='localhost',passwd='1234',user='root', db = 'trabajo_practico' ) | |
cursor = basededatos.cursor() | |
nombre = raw_input ("Ingrese nombre: ") | |
responsable = raw_input ("Ingrese nombre del responsable: ") | |
fecha_inicio= input ("Ingrese fecha (fomarto y-m-d):") | |
estado= raw_input("Ingrese el estado: ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create database DB_multas | |
use DB_multas | |
CREATE TABLE persona( | |
dni int, | |
Nombre varchar(50), | |
apellidos varchar(50), | |
direccion varchar(50), | |
tfno int, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$filename = "mails.txt"; | |
$file = fopen($filename,"r"); | |
$data = fread($file,filesize($filename)); | |
$pattern = "/[a-z-0-9\._\-]+@[a-z-0-9]+\.[a-z-0-9]+\.*[a-z]+/i"; | |
preg_match_all($pattern, $data, $matches); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modificacion de consulta_espesifica | |
import MySQLdb as mdb | |
class consultas: | |
def _init_ (self, dbName): | |
self.databaseName = dbName | |
#self.accion = acc | |
def consultar (self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Autor(models.Model): | |
id = models.AutoField(primary_key=True) | |
nombre = models.CharFIeld(max_length=100) | |
class Libro(models.Model): | |
id = models.AutoField(primary_key=True) | |
nombre = models.CharField(max_length=100) | |
autor = models.ForeignKey(Autor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `imagenes` ( | |
`imagen_id` int(11) NOT NULL AUTO_INCREMENT, | |
`imagen` varchar(255) DEFAULT NULL, | |
PRIMARY KEY (`imagen_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; | |
-- Table `nueva`.`galeria` | |
-- ----------------------------------------------------- | |
CREATE TABLE IF NOT EXISTS `nueva`.`galeria` ( | |
`galeria_id` INT NOT NULL, |