Sistemas de Equações Lineares: método de eliminação de Gauss para sistemas lineares. Espaços vetoriais. Subespaços. Bases.
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
schedule = a_periodic_task.run_every | |
next = next_ocurrance(schedule.minute, schedule.hour, schedule.day_of_week) | |
def next_ocurrance(minutes, hours, days_of_week): | |
# days_of_week convention: Sunday = 0, Saturday = 6 | |
# dateutil convention: Monday = 0, Sunday = 6 | |
now = datetime.datetime.now() | |
weekday = now.isoweekday() |
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 csv | |
import urllib | |
le_pagina = lambda pagina: eval(urllib.urlopen("http://webservices.apontador.com.br/zap/busca.ashx?busca=alugar&uf=RIO%20DE%20JANEIRO&cidade=RIO%20DE%20JANEIRO&page=" + str(pagina)).read())[0] | |
numero = lambda x: float(x.replace(',', '.')) | |
paginas = [le_pagina(i) for i in xrange(1, 8)] | |
f = open('imoveis.csv', 'w') | |
c = csv.writer(f) |
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
# avaliador de expressao em notacao polonesa reversa | |
funcoes = { | |
"+": lambda a, b: a + b, | |
"-": lambda a, b: a - b, | |
"*": lambda a, b: a * b, | |
"/": lambda a, b: a / b | |
} | |
def avalia(expressao): |
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 CoolDict(dict): | |
... def __getattr__(self, attr): | |
... return self[attr] | |
... | |
>>> c = CoolDict() | |
>>> c['a'] | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
KeyError: 'a' | |
>>> c['a'] = 3 |
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
cd /tmp | |
wget http://nginx.org/download/nginx-1.0.11.tar.gz | |
tar -xzvf nginx-1.0.11.tar.gz | |
wget https://github.com/agentzh/redis2-nginx-module/tarball/v0.07 -O redis2-nginx-module-0.07.tar.gz | |
tar -xzvf redis2-nginx-module-0.07.tar.gz | |
wget http://www.cpan.org/src/5.0/perl-5.14.2.tar.gz | |
tar -xzvf perl-5.14.2.tar.gz |
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
(define (croot x) | |
(croot-iter 1.00 x)) | |
(define (croot-iter guess x) | |
(if (good-enough? guess x) | |
guess | |
(croot-iter (improve guess x) | |
x))) | |
(define (improve guess x) |
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
$('.item_section_list').each(function(i, section) { | |
var saw = 0; | |
var total = 0; | |
for (var i = 0; i < section.childNodes.length; i++) { | |
var row = section.childNodes[i]; | |
console.log(row); | |
var viewed = row.classList.contains('viewed'); | |
var minutes = parseInt(row.firstChild.text.match(/\((\d+) min\)/)[1], 10); | |
if (viewed) { | |
saw += minutes; |
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 itertools | |
import random | |
import heapq | |
def lazy_sort(col): | |
def swap(i, j): | |
if i != j: | |
col[j], col[i] = col[i], col[j] | |
def prepare_pivot(l, r): |
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/perl | |
use strict; | |
use warnings; | |
my $a = 0; | |
my $b = 1; | |
while ($a < 100) { |
OlderNewer