Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 | |
| code2pdf() { | |
| suffix=".""$1" | |
| for file in *.$1; | |
| do | |
| output_file="$(basename $file $suffix).tex"; | |
| DOCCLASS="documentclass{article}"; |
This file contains hidden or 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
| code2pdf() { | |
| suffix=".""$1" | |
| for file in *.$1; | |
| do | |
| vim -c "hardcopy > $(basename $file $suffix).ps" -c "wq" $file; | |
| done | |
| for printable in *.ps; |
This file contains hidden or 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 python | |
| """ | |
| Author: Bruno G. Pinto | |
| Nerd Xmas Tree | |
| """ |
This file contains hidden or 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 <stdlib.h> | |
| #include <stdio.h> | |
| short PWM1_SET_DUTY( short cont, short q, short MAX ) { | |
| if (cont >=0 && cont < MAX) { | |
| cont += q; | |
| } | |
| return cont; |
This file contains hidden or 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 <unistd.h> | |
| /* | |
| * Program that simulates a progress status in percentage | |
| * from within the terminal; | |
| * | |
| * Inspired by: | |
| * - http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console | |
| * |
This file contains hidden or 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 python | |
| """ | |
| An Algorithm to find the maximum integer number in a vector using a divide and conquer approach. | |
| It takes a lenght from command line and generates a random vector using this lenght, | |
| then it prints this vector and it's maximum value calculated by the algorithm. | |
| # To run the code: ./max.py lenght | |
| """ |
This file contains hidden or 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
| // Por causa do tamanho e composicao da cena, nem a atenuacao da luz, nem sua posicao ou tamanho dos limites influenciou muito | |
| BoundingSphere lightLimits = new BoundingSphere( new Point3d(0.0f, 0f, 0f), Double.MAX_VALUE ); | |
| //PointLight spinningLight = new PointLight( new Color3f(0.0f, 0.0f, 1f), new Point3f(0.0f, 0.0f, 0.0f), new Point3f(0.5f, 0f, 0.0f) ); | |
| SpotLight spinningLight = new SpotLight(new Color3f(0.0f, 0.0f, 1f), | |
| new Point3f(0.0f,0.0f,1.0f), | |
| new Point3f(0.1f,0.1f,0.01f), | |
| new Vector3f(0.0f,0.0f,-1.0f), | |
| (float) (Math.PI/4), | |
| 0.0f); |
This file contains hidden or 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
| /** | |
| Author: Bruno G. Pinto | |
| Date: 16/03/15 | |
| Implementacao do Padrao Decorator em C++; | |
| Compile & run: | |
| g++ Decorator.cpp && ./a.out | |
| */ |
This file contains hidden or 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> | |
| // Passa o nome do arquivo com os dados para o main (argv[1]) | |
| // exemplo: | |
| // 1. Compila - gcc main.c -o run | |
| // 2. Rodar - ./run data.in | |
| // Onde data.in eh o arquivo que contem o texto a ser invertido. |