Skip to content

Instantly share code, notes, and snippets.

View zrhans's full-sized avatar

Hans Rogério Zimermann zrhans

View GitHub Profile
program testingist
implicit none
integer :: i
i=3
print *,"Hello the value of i:",i
end program testingist
$(document).ready(function() {
$('#submit_item').click(function() {
var item = $('#item').val();
$.post("demo/process", {
"item": item
}, function(data) {
console.log(data.result);
# Add the Oracle JDK Repos
UBUNTU_VERSION=precise
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
DEBIAN_FRONTEND="noninteractive" apt-get update
# Accept the Oracle License
echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 boolean true" > /tmp/oracle-license-debconf
/usr/bin/debconf-set-selections /tmp/oracle-license-debconf
@zrhans
zrhans / download.php
Last active August 29, 2015 14:05
Função para Download
<?php
function downloadFile($file,$name,$mime_type=''){
/*
This function takes a path to a file to output ($file),
the filename that the browser will see ($name) and
the MIME type of the file ($mime_type, optional).
If you want to do something on download abort/finish,
register_shutdown_function('function_name');
function string_concat(s1, s2) ! This is a comment
TYPE (string), INTENT(IN) :: s1, s2
TYPE (string) string_concat
string_concat%string_data = s1%string_data(1:s1%length) // &
s2%string_data(1:s2%length) ! This is a continuation
string_concat%length = s1%length + s2%length
end fuction string_concat
MODULE string_type
IMPLICIT NONE
TYPE string80
INTEGER length
CHARACTER(LEN=80) :: string_data
END TYPE string80
INTERFACE ASSIGNMENT(=)
MODULE PROCEDURE c_to_s_assign, s_to_c_assign
END INTERFACE
INTERFACE OPERATOR(//)
ex .true.
op .true.
nam cities
acc DIRECT
seq NO
frm UNFORMATTED
irec 100
nr 1
INTEGER(KIND=2) :: i
REAL(KIND=long) :: a
COMPLEX :: current
LOGICAL :: Pravda
CHARACTER(LEN=20) :: word
CHARACTER(LEN=2, KIND=Kanji) :: kanji_word
program quebra_de_linha
write(*,*) "Esta é uma linha muito longa e necessita se continuada"&
&" em outra linha. Para isso usamos o caractere & para quebrar "&
&" e continuar a linha."&
&" . . ."&
&" até terminar a linha."
end program quebra_de_linha
# criando um dicionário vazio
>>> dict_atm = {}
>>> dict_atm
{}
# criando um dicionário com valores
>>> dict_atm = {'precip': 88, 'radiation': 687}
>>> dict_atm
{'precip': 88, 'radiation': 687}
# resgatando valor pela chave
>>> dict_atm['precip']