Skip to content

Instantly share code, notes, and snippets.

View Lucas-Severo's full-sized avatar
🏠
Working

Lucas Lucas-Severo

🏠
Working
View GitHub Profile
@Lucas-Severo
Lucas-Severo / BinarySearch.java
Created August 30, 2020 01:37
Java Binary Search
import java.util.List;
public class BinarySearch {
public static int search(List<Integer> numbers, int number) {
int pLeft = 0, pRight = numbers.size()-1, pMiddle;
while(pLeft <= pRight) {
pMiddle = (pLeft + pRight) / 2;
if(numbers.get(pMiddle).equals(number)) {
package de.zh32.slp;
import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
@Lucas-Severo
Lucas-Severo / Count.java
Last active May 5, 2020 20:14
Operações com Collections em java
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Collectors;
public class Count {
public static void main(String[] args) {
Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
List<Integer> listNumbers = new ArrayList<Integer>(Arrays.asList(numbers));
@Lucas-Severo
Lucas-Severo / index.html
Last active February 26, 2020 01:08
responsive dropdown menu
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>navbar</title>
<link rel="stylesheet" href="css/style.css">
<script src="https://kit.fontawesome.com/5773d4ffcc.js" crossorigin="anonymous"></script>
</head>
@Lucas-Severo
Lucas-Severo / index.html
Last active February 25, 2020 13:52
Responsive navbar
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>navbar</title>
<link rel="stylesheet" href="css/style.css">
<script src="https://kit.fontawesome.com/5773d4ffcc.js" crossorigin="anonymous"></script>
</head>
@Lucas-Severo
Lucas-Severo / index.html
Created February 25, 2020 13:42
Responsive navbar
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>navbar</title>
<link rel="stylesheet" href="css/style.css">
<script src="https://kit.fontawesome.com/5773d4ffcc.js" crossorigin="anonymous"></script>
</head>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Teste</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
@Lucas-Severo
Lucas-Severo / encrypt.cpp
Last active December 28, 2019 19:29
Encrypting/Decrypting File in C++
#include <iostream>
#include <fstream>
using namespace std;
void encrypt(string& text, int key)
{
char* pointer = &text[0];
while(*pointer != '\0'){
if(*pointer != '\n')
@Lucas-Severo
Lucas-Severo / file.cpp
Created December 28, 2019 17:51
File in C++
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
//--------------------------------------
ofstream file1("arquivo.txt");
string input;
@Lucas-Severo
Lucas-Severo / books.cpp
Created December 26, 2019 13:34
STL Stack C++
#include <iostream>
#include <stack>
using namespace std;
void showBooks(stack<string> books)
{
if(!books.empty())
{
cout << "\n\tBooks in the stack:" << endl;