Skip to content

Instantly share code, notes, and snippets.

View gusthavosouza's full-sized avatar
🇮🇸
Working from 🇮🇸

Gustavo De Souza gusthavosouza

🇮🇸
Working from 🇮🇸
View GitHub Profile
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package web;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<!-- Login filter -->
<filter>
<filter-name>FiltroLogin</filter-name>
<filter-class>util.FiltroLogin</filter-class>
</filter>
<filter-mapping>
<filter-name>FiltroLogin</filter-name>
import java.util.Scanner;
public class Fatorial {
static int num1, num2, resultado = 0;
static int calculaFatorial(int num1) {
if (num1 == 0) {
return 1;
}
package com.sighra.apps.datasul.bean;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
@gusthavosouza
gusthavosouza / setenv.sh
Created November 18, 2015 13:52 — forked from terrancesnyder/setenv.sh
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
public class Recursao{
public static void main(String args[]){
metodo_recursivo(0);
}
public static void metodo_recursivo(int n){
if(n == 1001)
return;
System.out.println(n % 100 == 0 ? "print" : n);
/*
Document : effect
Created on : 17/07/2013, 22:00:44
Author : Gustavo
Description:
Purpose of the stylesheet follows.
*/
.menu p {
text-decoration: #333333;
<%--
Document : rotation
Created on : 17/07/2013, 20:56:20
Author : Gustavo
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
import java.util.Scanner;
public class AlgoArray {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Digite o tamanho do Array");
long tamanho = scan.nextLong(); // Recebe o valor para o tamanho do array
long arr[] = new long[(int) tamanho]; // Criação do array com o valor passado anteriormente
@gusthavosouza
gusthavosouza / Crescente.java
Created September 2, 2013 14:03
Imprimir numeros do array em ordem crescente. utilizando sort.
import java.util.Scanner;
import java.util.Arrays;
public class Crescente {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
Arrays crescente = null;
long[] arr = new long[4];