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 Data.List (foldl1') | |
import Data.Array | |
change:: [Int] -> Int -> Int | |
change cs v = change' v | |
where | |
memo = array (0, v) [(x, change'' x) | x <- [0..v]] | |
change' v = memo ! v | |
change'' 0 = 0 | |
change'' v = foldl1' min [change' $! (v-i) | i <- takeWhile (<=v) cs] +1 |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html"> | |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-pages/core-pages.html"> |
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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<link rel="import" href="../core-animated-pages/core-animated-pages.html"> | |
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html"> | |
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html"> | |
<link rel="import" href="../core-animated-pages/transitions/slide-down.html"> | |
<link rel="import" href="../core-animated-pages/transitions/slide-up.html"> |
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
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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 Data.List | |
import Data.Function | |
--comparing length lazily | |
bigger::[a] -> [a] -> Ordering | |
bigger [] [] = EQ | |
bigger (_:_) [] = GT | |
bigger [] (_:_) = LT | |
bigger (_:as) (_:bs) = bigger as bs |
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 Data.Maybe | |
import Data.List (nubBy, sort, isSuffixOf, group, inits, tails, find, intercalate) | |
data Bit = F | T | X deriving (Show, Enum, Ord, Eq) | |
type BitSet = [Bit] | |
type Minterm = ([Integer], BitSet) | |
type Table = [Minterm] |
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 Data.List | |
media :: Fractional a => [a] -> a | |
media l = sum l / (fromIntegral $ length l) | |
desvios :: Fractional a => [a] -> a -> [a] | |
desvios xs m = map (subtract m) xs | |
powtwo :: Fractional a => [a] -> [a] | |
powtwo = map (^2) |
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 Control.Monad.State | |
import Data.Set (member, singleton, Set) | |
type Tape a = ([Maybe a], [Maybe a]) | |
empty::Tape a | |
empty = ([], [Nothing]) | |
--create a Tape from a list point to the first element of it | |
fromList:: [a] -> Tape a | |
fromList a = ([], map (Just) a) |
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
[ | |
{ | |
"_id": "Main-Dashboard", | |
"_type": "dashboard", | |
"_source": { | |
"title": "Main Dashboard", | |
"hits": 0, | |
"description": "", | |
"panelsJSON": "[{\"col\":1,\"id\":\"Saude-Empresa\",\"panelIndex\":1,\"row\":1,\"size_x\":12,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"Saude-Peek\",\"panelIndex\":2,\"row\":7,\"size_x\":12,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"Saude-Peekbox\",\"panelIndex\":3,\"row\":4,\"size_x\":12,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"Peekbox-Reportes-ao-longo-do-tempo\",\"panelIndex\":4,\"row\":12,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":7,\"id\":\"Peekbox-Memória\",\"panelIndex\":5,\"row\":12,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":1,\"id\":\"Peekbox-Snoop\",\"panelIndex\":6,\"row\":15,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":7,\"id\":\"Peekbox-Processos\",\"panelIndex\":7,\"row\":15,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"} |
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
{ | |
"meta": { | |
"total": 2, | |
"count": 2, | |
"offset": 0 | |
}, | |
"data": [ | |
{ | |
"request_at": "2016-11-23T04:01:06.584338", | |
"id": 2, |
OlderNewer