This file contains 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
SELECT `column`, COUNT(*) FROM `table` GROUP BY `column` HAVING COUNT(*) > 1; |
This file contains 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 edu.emory.mathcs.backport.java.util.concurrent.TimeUnit; | |
/** | |
* Converter minutos para milisegundos. | |
* | |
* @param minutes | |
* @return long | |
*/ | |
public static long ConvertMinutesToMilliseconds(int minutes) { | |
return TimeUnit.MINUTES.toMillis(minutes); |
This file contains 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 seu.pacote.utils; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
/** | |
* @author Waldson Moura | |
*/ | |
public class Datas { |
This file contains 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
/** | |
* Valida se a String está realmente preenchida e dentro dos limites de | |
* caracteres. Caso o parâmetro: quantidadeMinima, seja passado "null" ou | |
* "0", a função toma como padrão o valor 5, já para quantidadeMaxima o | |
* valor padrão é 255. | |
* | |
* @param str | |
* @return boolean true se a String for válida; false caso a mesma não | |
* esteja dentro dos padrões. | |
*/ |
This file contains 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.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* Valida o e-mail informado. | |
* | |
* @param str | |
* @return boolean true se o e-mail for válido; false se o e-mail for | |
* inválido. | |
*/ |
This file contains 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.text.Normalizer; | |
/** | |
* Remove a acentuação de uma String. | |
* | |
* @param str | |
* @return String sem acentos. | |
*/ | |
public static String removeAccents(String str) { | |
str = Normalizer.normalize(str, Normalizer.Form.NFD); |
This file contains 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
/** | |
* Verifica se a String passada por parâmetro é nula ou vazia. | |
* | |
* @param str | |
* String | |
* @return boolean true se a String for "null" ou vazia; false caso exista | |
* conteúdo. | |
*/ | |
public static boolean isNullOrEmpty(String str) { | |
return ((str == null || str.isEmpty()) || str.trim().length() == 0) ? true |
This file contains 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.File; | |
/** | |
* Retorna a extensão do arquivo. | |
* | |
* @param file | |
* @return string Extensão | |
*/ | |
public static String getExtension(String file) { | |
return file.substring(file.lastIndexOf(".") + 1, file.length()); |
This file contains 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.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
/** | |
* Salvar arquivo. | |
* |
This file contains 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 final static String[] split(String texto, char separador) { | |
if (texto == null) | |
return null; | |
int tamanhoTexto = texto.length(); | |
if(tamanhoTexto == 0) | |
return null; | |
Vector lista = new Vector(); |
OlderNewer