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
Cómo funciona fgets para gente con poca memoria | |
=============================================== | |
fgets(buffer, len, source) | |
Lee hasta (len-1) caracteres desde [source] y los deja sobre | |
el buffer apuntado por [buffer]. Normalmente lo invocarás | |
para leer de stdin como | |
fgets(buffer, BUFSIZ, stdin) |
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
package es.danirod.quarkus.bookshelf.genres; | |
import com.fasterxml.jackson.annotation.JsonAlias; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import jakarta.persistence.Entity; | |
import jakarta.persistence.GeneratedValue; | |
import jakarta.persistence.Id; | |
import org.hibernate.annotations.Filter; | |
import org.hibernate.annotations.FilterDef; | |
import org.hibernate.annotations.ParamDef; |
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
public record PaginatedResponse<E>(int currentPage, int totalPages, List<E> data) { | |
public PaginatedResponse(PanacheQuery<E> query) { | |
this(query.page().index + 1, query.pageCount(), query.list()); | |
} | |
} |
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
package es.danirod.quarkus.bookshelf; | |
import jakarta.persistence.Entity; | |
import io.quarkus.hibernate.orm.panache.PanacheEntity; | |
import jakarta.persistence.GeneratedValue; | |
import jakarta.persistence.Id; | |
import java.time.LocalDate; | |
import java.util.Objects; |
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
package es.danirod.quarkus.bookshelf; | |
import jakarta.persistence.Entity; | |
import io.quarkus.hibernate.orm.panache.PanacheEntity; | |
import java.time.LocalDate; | |
import java.util.Objects; | |
@Entity | |
public class Book extends PanacheEntity { |
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
package es.danirod.quarkus.bookshelf.temperaturas; | |
public record Temperatura(String ciudad, int minima, int maxima) { | |
} |
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
import javax.swing.* | |
import java.awt.Color | |
import java.awt.Graphics | |
import java.awt.Graphics2D | |
import java.awt.event.* | |
class Fantasmita { | |
public int posx, posy | |
public int dx, dy |
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
/* Primero declaras tu página como flex y le das una altura mínima */ | |
body { | |
min-height: 100vh; | |
display: flex; | |
flex-direction: column; | |
} | |
/* En tu elemento principal pones esto para expandirlo si fuese necesario. | |
Con esto si la pagina no es lo suficientemente alta, al menos se expande | |
verticalmente para rellenar el hueco que queda. */ |
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
/********************************************************** | |
* COSAS SIMPLES CON TIPOS PARA IR ABRIENDO BOCA. | |
*********************************************************/ | |
/* Una interfaz que maneja datos en una agenda de contactos. */ | |
interface Person { | |
/* Datos personales sobre esta persona. */ | |
name: string; | |
age: number; | |
city: string; |
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
CREATE TABLE alumnos ( | |
id_alumno INT NOT NULL AUTO_INCREMENT, | |
nombre VARCHAR(32) NOT NULL, | |
apellidos VARCHAR(64) NOT NULL, | |
fecha_nac DATE NOT NULL, | |
UNIQUE KEY id_alumno_uq (id_alumno) | |
); | |
CREATE TABLE profesores ( | |
id_profesor INT NOT NULL AUTO_INCREMENT, |
NewerOlder