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.github.pablohdzvizcarra.lesson28; | |
import static org.junit.jupiter.api.Assertions.*; | |
import org.junit.jupiter.api.Assertions; | |
import org.junit.jupiter.api.Test; | |
class MethodValidatorTest { | |
@Test |
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 java.io.ByteArrayOutputStream; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
public class Example4 { | |
public static void main(String[] args) { | |
String filePath = "data.txt"; | |
int bufferSize = 100; // number of bytes |
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 java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
public class Example3 { | |
public static void main(String[] args) { | |
String filePath = "data.txt"; | |
try { | |
byte[] contentBytes = Files.readAllBytes(Paths.get(filePath)); |
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 java.io.BufferedReader; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class Example2 { | |
public static void main(String[] args) { | |
String filePath = "data.txt"; | |
try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { | |
String line; |
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 java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.List; | |
public class Example1 { | |
public static void main(String[] args) { | |
String filePath = "data.txt"; | |
try { |
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
1.The angel from my nightmare | |
2.The shadow in the background of the morgue | |
3.The unsuspecting victim of darkness in the valley | |
4.We can live like Jack and Sally, if we want | |
5.Where you can always find me | |
6.And we'll have Halloween on Christmas | |
7.And, in the night, we'll wish this never ends | |
8.We'll wish this never ends. |
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
class Solution { | |
public int search(int[] nums, int target) { | |
int left = 0; | |
int right = nums.length - 1; | |
int result = -1; | |
int n = nums.length; | |
while (n >= 1) { | |
int middle = (left + right) / 2; | |
if (target == nums[middle]) { |
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
version: "3.1" | |
services: | |
webserver: | |
networks: | |
- ndsnet | |
scheduler: | |
networks: | |
- ndsnet |
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 mysql.connector | |
from mysql.connector import Error, MySQLConnection | |
def create_connection() -> MySQLConnection: | |
try: | |
connection: MySQLConnection = mysql.connector.connect( | |
host="", | |
database="example", | |
user="admin", |
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 class ChapterTwoExercises { | |
/* | |
* Binary search implementation, to know the steps necessary only double the | |
* elements and plus 1 | |
* Array 3 = 2 steps | |
* Array 7 = 3 steps | |
* array 15 = 4 steps | |
* array 31 = 5 steps | |
* array 63 = 6 steps |
NewerOlder