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
| #include <stdio.h> | |
| #define ARCHIVO_BINARIO "alumnos.dat" | |
| /*prototipos*/ | |
| void grabarArchivoBinario(); | |
| void leerArchivoBinario(); | |
| struct structAlumno { /* declaración de la estructura "structAlumno" */ | |
| int dni; | |
| float nota1; |
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
| #include <stdio.h> | |
| #define ARCHIVO_TXT "prueba.txt" | |
| /*prototipos*/ | |
| void grabarArchivo(); | |
| void leerArchivo(); | |
| int main(){ | |
| grabarArchivo(); | |
| leerArchivo(); |
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
| #include <stdio.h> | |
| /*Prototipo = tipoDeRetorno funcionNombre (parametros)*/ | |
| void ingresarDatos(int cantidad, float precio); | |
| float calcularImporte(int cantidad, float precio); | |
| void mostrarDatos(float total); | |
| /*variables globales*/ | |
| int cantidad = 0; | |
| float precio = 0; | |
| float total = 0; |
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
| #include <stdio.h> | |
| /*Prototipo = tipoDeRetorno funcionNombre (parametros)*/ | |
| void ingresarDatos(int *cantidad, float *precio); /* int *cantidad = referenciar a la variable cantidad por su dirección de memoria (Parametros por referencia)*/ | |
| float calcularImporte(int cantidad, float precio); | |
| void mostrarDatos(float total); | |
| int main(){ | |
| int cantidad = 0; | |
| float precio = 0; | |
| float total = 0; |
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 com.z.bookbackend | |
| import com.z.bookbackend.models.Author | |
| import com.z.bookbackend.models.Book | |
| import com.z.bookbackend.services.AuthorDAO | |
| import com.z.bookbackend.services.BookDAO | |
| import com.z.bookbackend.util.toLocalDate | |
| import org.springframework.boot.ApplicationArguments | |
| import org.springframework.boot.ApplicationRunner | |
| import org.springframework.boot.autoconfigure.SpringBootApplication |
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 com.z.bookbackend.controllers | |
| import com.z.bookbackend.models.Book | |
| import com.z.bookbackend.services.BookService | |
| import org.springframework.data.domain.Page | |
| import org.springframework.data.domain.Pageable | |
| import org.springframework.web.bind.annotation.* | |
| import java.util.* | |
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
| /*from: https://stackoverflow.com/questions/34642254/what-java-8-stream-collect-equivalents-are-available-in-the-standard-kotlin-libr*/ | |
| /*Accumulate names into a List*/ | |
| // Java: | |
| List<String> list = people.stream().map(Person::getName).collect(Collectors.toList()); | |
| // Kotlin: | |
| val list = people.map { it.name } // toList() not needed | |
| /*Convert elements to strings and concatenate them, separated by commas*/ | |
| // Java: | |
| String joined = things.stream().map(Object::toString).collect(Collectors.joining(", ")); |
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
| net: | |
| bindIp: 127.0.0.1 | |
| port: 27017 | |
| security: | |
| authorization: enabled |
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
| use admin | |
| db.createUser({user:"springboot", pwd:"spring", roles:[{role:"dbOwner",db:"Books"}]}) |
NewerOlder