This file contains hidden or 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
var assert = require('assert'); | |
var corrector = require("../Corrector"); | |
describe('Corrector', function() { | |
describe('método corrige()', function() { | |
it('debe corregir examen sencillo', function() { | |
var enunciado = [ { "pregunta": 1, "correcta": "a"} , | |
{ "pregunta": 2, "correcta": "b"} ]; | |
var examen = [ |
This file contains hidden or 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
const assert = require('assert'); | |
const { Curso } = require("../Curso"); | |
describe('Curso', function() { | |
describe('Gestión de cursos', function() { | |
it('debe crear un curso', function() { | |
var c = new Curso("C1") | |
assert.equal("C1",c.getNombre()); | |
}); |
This file contains hidden or 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
const assert = require('assert'); | |
const primos = require("../Primos"); | |
console.log(primos.factores(1)); | |
describe('Primos', function() { | |
describe('método factores()', function() { | |
it('debe devolver [1,2,2,3] con factores de 12', function() { | |
assert.deepEqual([1,2,2,3],primos.factores(12)); | |
}); | |
it('debe devolver [1] con factores de 1', function() { |
This file contains hidden or 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
const assert = require('assert'); | |
const parfact = require("../ParFact"); | |
describe('ParFact', function() { | |
describe('método par()', function() { | |
it('debe devolver true con par(4)', function() { | |
assert.equal(true,parfact.par(4)); | |
}); | |
it('debe devolver false con par(5)', function() { | |
assert.equal(false,parfact.par(5)); |
This file contains hidden or 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
<?php | |
class Primos { | |
function factores($n) { | |
$factores = array(1); | |
for ($i = 2; $i <= $n; $i++) { | |
while ($n % $i == 0) { | |
$factores[] = $i; | |
$n = $n / $i; |
This file contains hidden or 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
$personas = array("juan","luis","ana"); | |
print($personas[1]); // luis | |
$personas[3] = "pepe"; // Inserta un valor en posición 3 | |
$personas[] = "kiko"; // Inserta valor al final | |
foreach($personas as $p) { | |
echo $p . " "; | |
} |
This file contains hidden or 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
prefix qb: <http://purl.org/linked-data/cube#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix : <http://ejemplo.org/> | |
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
prefix xsd: <http://www.w3.org/2001/XMLSchema#> | |
SELECT ?pais ?area ?poblacion WHERE { | |
?obs :pais ?pais . | |
?obs :indicador :Poblacion . | |
?obs :valor ?poblacion . |
This file contains hidden or 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
@prefix qb: <http://purl.org/linked-data/cube#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
@prefix : <http://ejemplo.org/> . | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
qb:obs11 a qb:Observation ; | |
:indicador :Poblacion ; | |
:valor 31 ; | |
:pais :Peru; |
This file contains hidden or 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
PREFIX dbp: <http://dbpedia.org/property/> | |
PREFIX dbo: <http://dbpedia.org/ontology/> | |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
SELECT * WHERE { | |
?persona dbo:birthPlace ?x . | |
?x dbp:elevationM ?e . | |
?x dbp:name ?lugar . | |
?persona rdf:type dbo:SoccerPlayer . | |
FILTER (isNumeric(?e)) |
This file contains hidden or 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
PREFIX dbr: <http://dbpedia.org/resource/> | |
PREFIX dbp: <http://dbpedia.org/property/> | |
PREFIX dbo: <http://dbpedia.org/ontology/> | |
SELECT * WHERE { | |
dbr:Puno dbp:populationTotal ?p . | |
dbr:Puno dbp:elevationM ?elevacion . | |
dbr:Puno dbo:country ?pais . | |
?persona dbo:birthPlace dbr:Puno . | |
} |