Skip to content

Instantly share code, notes, and snippets.

View dariogabriel113's full-sized avatar
:shipit:
...

Dario Gabriel dariogabriel113

:shipit:
...
  • FCPC - Fundação Cearense de Pesquisa e Cultura
  • Fortaleza - Brazil
View GitHub Profile
@dariogabriel113
dariogabriel113 / functions.dart
Created June 13, 2019 00:57
Dart | Language samples - Functions
int fibonacci(int n) {
if(n == 0 || n == 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
var result = fibonacci(20);
@dariogabriel113
dariogabriel113 / control_flow.dart
Created June 13, 2019 00:52
Dart | Language samples - Control flow statements
var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
'tags': ['saturn'],
'url': '//path/to/saturn.jpg'
};
if(year >= 2001) {
@dariogabriel113
dariogabriel113 / variables.dart
Created June 13, 2019 00:44
Dart | Language samples - Variables
var name = 'Voyager I';
var year = 1977;
var antennaDiameter = 3.7;
var flybyObjects = ['Jupiter', 'Saturn', 'Uranus', 'Neptune'];
var image = {
'tags': ['saturn'],
'url': '//path/to/saturn.jpg'
};
<?php
$vet01 = array();
$vet01[] = "Sistemas operacionais";
$vet01[] = "Compiladores";
$vet01[] = "Banco de dados";
$vet02 = array(1, 2, 3, 4, 5);
$vet03 = array(0 => 0, 2 => 3, 10 => "item 10");
$vet04 = ['valor 1', 'string 2', 3, 4.0, false];
$vet05 = ["chave1" => 'valor 1', 2, 3, 4, array('item 1', 2 => 0.5)];
void main() {
for (int i = 0; i < 5; i++) {
print('Hello World ${i + 1}!');
}
}
@dariogabriel113
dariogabriel113 / IA-ClassEstado
Created September 7, 2018 17:05
Estado atual de trabalho de IA
class Estado {
List<String> posicoes
int nome
Estado pai
static constraints = {
pai nullable: true
}
}
@dariogabriel113
dariogabriel113 / helloWorld.py
Last active April 12, 2019 16:40
"Hello, World!" with Python
print("Hello, World!")
mystring = "hello"
myfloat = 10.0
myint = 20
# testing code
if mystring == "hello":
print("String: %s" % mystring)
if isinstance(myfloat, float) and myfloat == 10.0:
print("Float: %f" % myfloat)
if isinstance(myint, int) and myint == 20:
@dariogabriel113
dariogabriel113 / AddDate.groovy
Last active March 22, 2019 12:54
Add/Subtract Date Time
use (groovy.time.TimeCategory) {
//Example of Add Date 20 days from now
println new Date()
println 20.days.from.now
//Example of Add Date 3 months from now
println new Date()
println 3.months.from.now
//Example of Add Date 2 years from now
public class TesteIR2 {
public static void main(String[] args) {
// De 1900.0 até 2800.0 o IR é de 7.5% e pode deduzir R$ 142
// De 2800.01 até 3751.0 o IR é de 15% e pode deduzir R$ 350
// De 3751.01 até 4664.00 o IR é de 22.5% e pode deduzir R$ 636
double salario = 3800.0;
if (salario >= 1900.0 && salario <= 2800.0) {
System.out.println("A sua aliquota é de 7%");