Skip to content

Instantly share code, notes, and snippets.

View sergiosvieira's full-sized avatar

Sérgio Vieira sergiosvieira

  • Fortaleza
View GitHub Profile
@sergiosvieira
sergiosvieira / file.sh
Created March 13, 2021 17:48
vcpkg install dependencies
../vcpkg/vcpkg install --feature-flags=manifests,binarycaching
#include <iostream>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <map>
#include <numeric>
char firstNotRepeatingCharacter(const std::string& s) {
for (const auto& c: s) {
if (s.find_first_of(c) == s.find_last_of(c)) return c;
#include <iostream>
#include <vector>
using Vector = std::vector<std::string>;
Vector split(const std::string& input, const std::string& delimiter) {
size_t b = 0, e = 0;
Vector result;
while ((e = input.find_first_of(delimiter, b)) <= std::string::npos) {
result.emplace_back(input.substr(b, e - b));
@sergiosvieira
sergiosvieira / digits.cpp
Created February 20, 2021 22:14
Count digits of an integer
int n = 123456;
std::cout << (int)log10(n) + 1 << "\n";
FFBBBFBLRL
BFFFBFBRRR
BFFFBFBLRL
BFFBFBBLRR
BBFFBFFRLL
BFFFBFBRLR
FFFFBBBRLR
BBFFFBBRRR
BBFBFBBRRR
BFFBBBFLRR
@sergiosvieira
sergiosvieira / Banco.java
Created September 18, 2020 15:48
Semana 02 - Interfaces
import java.util.*;
import java.time.LocalDate;
enum Sexo {M, F};
interface ICadastro {
void nome(String valor);
void cpf(int valor);
void rg(int valor);
void uf(String valor);
@sergiosvieira
sergiosvieira / Tela.java
Created September 18, 2020 14:35
Semana 02 - Classe Abstrata
import java.util.*;
abstract class ObjetoGeometrico {
public abstract void desenhar(); // método abstrato
public void posicao() { // método não-abstrato
System.out.print("Estou no centro da tela!");
}
}
class Quadrado extends ObjetoGeometrico {
@sergiosvieira
sergiosvieira / codigos.txt
Created September 18, 2020 13:58
Semana 02 - Polimorfismo
import java.util.*;
class Veiculo {
public void buzinar() {
System.out.println("Buzina não instalada!:(");
}
}
class Automovel extends Veiculo {
public void buzinar() { // Método Polimórfico
@sergiosvieira
sergiosvieira / codigo.txt
Created September 18, 2020 12:40
Semana 02 - Herança
Exemplo de herança entre as classes Conta, Conta Corrente e Conta Poupança.
Linguagem C++
=============
class Conta {
protected:
int numero;
string titular;
double saldo_atual;
@sergiosvieira
sergiosvieira / dwa131v5.md
Created September 5, 2020 13:39
Install DLINK DWA 131 V5 drivers on linux

sudo apt install git dkms build-essential git clone https://github.com/Mange/rtl8192eu-linux-driver.git sudo dkms add rtl8192eu-linux-driver sudo dkms install rtl8192eu/1.0 echo "blacklist rtl8xxxu" | sudo tee /etc/modprobe.d/rtl8xxxu.conf

Reboot go into BIOS/UEFI settings, make sure Secure Boot is disabled