var | definition | default | example |
---|---|---|---|
URL | URL with variables | http://nla.gov.au/nla.obj-152644715/dzi?tile={{zoomlevel}}/{{x}}_{{y}}.jpg |
|
x0 | First value of X | 0 | |
xstep | increment of X between consecutive tiles | 1 | |
xend | last value of X | {{ceil(width/tilesize)+x0}} |
|
y0 | First value of Y | 0 | |
ystep | increment of Y between consecutive tiles | 1 | |
yend | last value of Y | {{ceil(height/tilesize)+y0}} |
This project has moved to https://github.com/lovasoa/dezoom.sh
This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
#include <functional> | |
using namespace std; | |
template <class T> | |
T lagrange(vector<T> xs, vector<T> ys, T x) { | |
T res = 0; | |
T mul; |
This file contains hidden or 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
-- Inverses a modulo b | |
inverse b a = | |
let | |
next a b = zipWith (-) a $ map (*(head $ zipWith div a b)) b | |
l = [a,0] : [b,1] : zipWith next l (tail l) | |
in | |
head $ tail $ head $ filter ((==1).head) l |
This file contains hidden or 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
-- A shop is giving a voucher of 10% of the price you pay for everything you buy. | |
-- The voucher is usable only on the next article you buy. | |
-- You need to buy n things. In what order should you pay them in order to spend as few money as possible ? | |
-- Example: | |
-- You need to buy 3 articles, which cost respectively $1, $10 and $100 | |
-- Then you should buy them in the following order: $1, $100, $10 | |
-- Thus, you will pay 1 + 100 - 1 * 10% + 10 - (100 - 1 * 10%) * 10% = 1 + 99.9 + 0.01 = 100.91 | |
-- This is better than you would do with any other ordering. |
This file contains hidden or 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.Function | |
merge :: Ord a => [a] -> [a] -> [a] | |
merge [] x = x | |
merge x [] = x | |
merge (x:xs) (y:ys) | |
| x < y = x:merge xs (y:ys) | |
| otherwise = y:merge (x:xs) ys | |
sort :: Ord a => [a] -> [a] |
This file contains hidden or 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
This gist demonstrates how to do a map-side join, loading one small dataset from DistributedCache into a HashMap | |
in memory, and joining with a larger dataset. | |
Includes: | |
--------- | |
1. Input data and script download | |
2. Dataset structure review | |
3. Expected results | |
4. Mapper code | |
5. Driver code |
This file contains hidden or 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
# Spark star JOIN with all dimension tables in cache | |
# Ophir LOJKINE, 2016 | |
from __future__ import print_function | |
import sys | |
from operator import add | |
from pyspark import SparkContext |
This file contains hidden or 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 qualified Data.Vec as Vec | |
dt = pi/100 | |
t0 = 0 | |
tmax = 50 | |
dydt :: (Double -> Vec.Vec2D) -> Double -> Vec.Vec2D | |
dydt y t = | |
Vec.Vec2D |