Skip to content

Instantly share code, notes, and snippets.

@dheysonalves
dheysonalves / frequency.java
Last active August 12, 2018 14:27
java-frequency-test
package javacomomethods;
public class NewClass {
public static void main(String[] args) {
int[] x = {5,8,9,6,2,1,3,3,1,2,3,4,14};
int[] frequencia = new int [8];
for (int i = 0; i < x.length; i++) {
@dheysonalves
dheysonalves / Varags.java
Created August 12, 2018 14:26
java-varags-example
public class Varags {
static int soma(int a,int b) {
return a + b;
}
static int soma(int a, int b, int c) {
return a + b + c;
}
@dheysonalves
dheysonalves / Break.java
Last active August 20, 2018 06:24
br.com.myjavag.test
public class Break {
public static void main(String[] args) {
labelForI: for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
if(j==5 && i==3){
break labelForI;
}
System.out.println("O valor de i é:"+i+" O valor de j é:"+j);
}
@dheysonalves
dheysonalves / Single.java
Last active August 20, 2018 18:23
singletonmod
package singletone;
// **** o código aqui não utiliza do padrão de projeto, apenas uma forma de implementação sem ele. ****
// a ideia geral é ter uma intância de apenas uma classe e dar acesso global para ela.
public class Singleton {
private String name,color;
private double feet;
public Singleton(String name,double feet,String color) {
super();
@dheysonalves
dheysonalves / Operacao.kt
Last active September 24, 2018 10:09
Operacao_KOTLIN
package operacao_kotlin.android.dominando.operacao1
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import android.widget.Toast
class Operacao : AppCompatActivity() {
@dheysonalves
dheysonalves / Collection.java
Created October 8, 2018 18:52
Collection Implementation
package TestArea;
/**
*
* @author DHEYSON
*/
public class Aluno implements Comparable<Aluno> {
private String nome;
private String matricula;
private int idade;
@dheysonalves
dheysonalves / file.java
Created October 25, 2018 20:01
sql time
package br.com.sabort.telas;
import java.sql.*;
import br.com.sabort.dal.ModuloConexao;
import javax.swing.JOptionPane;
/**
*
* @author DHEYSON
*/
@dheysonalves
dheysonalves / git.md
Created November 27, 2018 02:43 — forked from outronivaldo/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@dheysonalves
dheysonalves / Free O'Reilly Books.md
Created December 11, 2018 04:02 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@dheysonalves
dheysonalves / swapping.md
Created September 15, 2019 01:54
To Clean out ALL vim Swap Files in a Directory:

To Clean out ALL vim Swap Files in a Directory: If you are sure you don’t need any vim swap files in a directory tree and want to get rid of them, you can use the following command in the directory while vim is not running (not even in another window or even a different login session):

find . -type f -name "*.sw[klmnop]" -delete