Skip to content

Instantly share code, notes, and snippets.

View zrhans's full-sized avatar

Hans Rogério Zimermann zrhans

View GitHub Profile
program tanque_cilindrico
implicit none
!Declaração de vars e constantes
real , parameter :: pi = 3.14159
real :: diametro = 16.0 ! 16 metros
real :: raio = 0.0
real :: altura = 15.0 ! 15 metros
real :: volume, volume_20
PROGRAM exemplos_de_funcoes
REAL :: x, y
INTEGER :: z
!-----------------------------------------------------------------------
! Valor absoluto de x
! Tipos de argumento(s) : INTEGER or REAL
! Tipo de retorno : O mesmo do argumento
print *, 'Valor absoluto de x'
x = -50.58
import pandas as pd
sales = [('account', ['Jones LLC', 'Alpha Co', 'Blue Inc', 'Mega Corp']),
('Total Sales', [150, 200, 75, 300]),
('Country', ['US', 'UK', 'US', 'US'])]
df = pd.DataFrame.from_items(sales)
indices = [True, False, True, True]
df[indices]
$(document).ready(function() {
$('#submit_item').click(function() {
var item = $('#item').val();
$.post("demo/process", {
"item": item
}, function(data) {
console.log(data.result);
@zrhans
zrhans / lei_de_ohm.js
Last active September 22, 2016 14:18
function solveform() { var y=document.y1; var U=y.volts.value; var R=y.ohms.value; var i=y.ampers.value; var P=y.watts.vale; if (i && R){P=Math.pow(i, 2)*R; U=R*i;} else if (i && U){P=i*U; R=U/i;} else if (U && R){P=Math.pow(U,2)/R; i=U/R;} else if (P && i){U=P/i; R=P/Math.pow(i,2);} else if (P && U){i=P/U; R=Math.pow(U,2)/P;} else if (i && U){P=U*i; R=U/i;} else if (P && R){U=Math.sqrt(P*R); i=Math.sqrt(P/R);} y.ampers.value=i; y.volts.value=U; y.watts.value=P; y.ohms.value=R; U=R=i=P=0; document.y1.reset.focus(); }
<html>
<head>
<title>Applet Lei de Ohm</title>
</head>
<body>
<h1>Lei de Ohm</h1>
<style> input:focus { background-color:#9ACD32; } </style><script language="JavaScript"> function solveform() { var y=document.y1; var U=y.volts.value; var R=y.ohms.value; var i=y.ampers.value; var P=y.watts.value; if (i && R){P=Math.pow(i, 2)*R; U=R*i;} else if (i && U){P=i*U; R=U/i;} else if (U && R){P=Math.pow(U,2)/R; i=U/R;} else if (P && i){U=P/i; R=P/Math.pow(i,2);} else if (P && U){i=P/U; R=Math.pow(U,2)/P;} else if (i && U){P=U*i; R=U/i;} else if (P && R){U=Math.sqrt(P*R); i=Math.sqrt(P/R);} y.ampers.value=i; y.volts.value=U; y.watts.value=P; y.ohms.value=R; U=R=i=P=0; document.y1.reset.focus(); } </script><br /> <center>
<form name="y1">
<table bgcolor="#b0c4de" border="3" cellpadding="5" cellspacing=""><tbody>
! Original from: http://ww2.odu.edu/~agodunov/computing/programs/book2/Ch05/rk4n.f90
program main
!---------------------------------------------------------------------
! Solver for a system of n first-order Ordinary Differential Equations
! Initial value problem.
! Method: calls 4th-order Runge-Kutta
! Can be used for solving a system of n/2 second order ODE
! There are two examples
! example 1: Physics - projectile motion in the (x,y) plane
! example 2: Biology -
program teste_logico
implicit none
real t
! Suponha uma escala de temperaturas que indique o padrão para estações do ano
! t abaixo de 10 graus Inverno
! t entre 11 e 15 graus Primavera
! t entre 16 e 25 graus Outono
@zrhans
zrhans / Download_HidroWeb.py
Created February 15, 2017 00:44 — forked from JeanFavaretto/Download_HidroWeb.py
HidroWeb Baixar séries históricas, download, obtenção, aquisição, Estações, Pluviométricas, Pluviometria, Fluviométricas, Fluviometria, Precipitação, Vazão, Cotas, baixar varias estações. Este script, Python HidroWeb, foi criado para automatizar o procedimento de aquisição de dados das estações do portal: http://hidroweb.ana.gov.br/
# -*- coding: utf-8 -*-
"""
___________________________-> Python - Hidroweb <-______________________________
Autor: Arthur Alvin 25/04/2015
afmalvim@gmail.com
Modificação: Jean Favaretto 16/07/2015
jeanfavaretto@gmail.com
program op_aritmetica
! Este programa efetua um cálculo aritmético
!
implicit none
! declaração de variáveis
integer :: a, b, c
! atribuindo valores
a = 5