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
""" | |
A program that prints out the numbers 1 to 100 (inclusive). | |
If the number is divisible by 3, print Crackle instead of the number. | |
If it's divisible by 5, print Pop. | |
If it's divisible by both 3 and 5, print CracklePop. | |
""" | |
for number in range(1, 101): | |
if number % 15 == 0: | |
print ("CracklePop") | |
continue |
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
class RingCacher: | |
""" | |
Cache de mensagens com valor fixo | |
""" | |
def __init__(self, size): | |
""" | |
Inicia uma lista de tamanho fixo | |
@param size: tamanho da lista | |
@return: void | |
""" |
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
#!/usr/bin/env bash | |
# | |
# Example usage: | |
# | |
# $ VERSION=1.3 sudo ./goinst.sh | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
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
## | |
## Basic Options | |
## | |
set-option -g default-terminal "screen-256color" | |
# UTF-8 | |
set -g utf8 on | |
set -g status-utf8 on |
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.Stack; | |
import java.util.StringTokenizer; | |
import java.util.Scanner; | |
import java.util.EmptyStackException; | |
/** | |
* Classe para transformar infix para postfix e aplicar parser RPN. | |
* @author João Rafael | |
* Referências: | |
* [Infix to Postfix] http://people.cs.clemson.edu/~turner/courses/cs102/spring98/section2/assignments/asg4/InfixToPostfix.java |
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
# UTF-8 | |
set -g status-utf8 'on' | |
# 256 colors | |
set -g default-terminal 'screen-256color' | |
# Disable base64 copy of selection | |
set-option -s set-clipboard off | |
# Default shell |
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
#!/bin/bash | |
# | |
# Aluno: João Rafael | |
# | |
# Pede o nome do arquivo | |
# parametro: @ | |
function pedeArquivo { | |
echo -n "Digite o nome do arquivo: " | |
read 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
#!/bin/bash | |
for arquivos in $(ls $1) ; | |
do | |
novoarquivo=`echo $arquivos | tr \[:upper:\] \[:lower:\]` | |
mv "$1/$arquivos" "$1/$novoarquivo" | |
done |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int calculateValor(int valor, int sub); | |
int main() | |
{ | |
int valor; | |
int sub[] = {100, 50, 20, 10, 2, 1}; | |
puts("DIGITE UM VALOR:"); |
NewerOlder