際際滷

際際滷Share a Scribd company logo
Im A
Republican
(Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
Not hard to
become a
Quora expert
Who will succeed
the Queen of
England?
Why does Britain
always have a
queen not a king?
Who would be king
if Prince Charles
dies before Queen
Elizabeth II?
What must Prince Charles
actually feel about his
mother pulling him from
the line of succession and
designating his son as heir
to the throne?
Did the Queen
assassinate
Diana, Princess of
Wales?
How to become
king or queen of
the UK*
How to become
king or queen of
the UK*
* Andfifteen other
Commonwealth Realms
Step 1.
Be a close relation
of the monarch
Step 1a.
Dont be a woman
with a younger
brother
Step 2.
Dont die before
the monarch
Step 3.
Dont be
illegitimate
Step 4.
Dont be a
Catholic
Step 4a.
Dont marry a
Catholic
Recent(ish)
updates
Succession
to the Crown
Act (2013)
Step 1a.
Dont be a woman
with a younger
brother
Step 1a.
Dont be a woman
with a younger
brother
Step 4a.
Dont marry a
Catholic
Step 4a.
Dont marry a
Catholic
Updated:
* Be royal
* Be alive
* Be legitimate
* Dont be Catholic
Brilliant
Idea!
Lets calculate the
line of succession
on every date
back to 1701
How hard
can it be?
Family
Tree
I'm A Republic (Honest!)
I'm A Republic (Honest!)
Thats gets
17 people
More Data
Needed
Descendants
of George VI
Descendants
of George V
Descendants
of Edward VII
Descendants
of Victoria
(Eventually)
Descendants
of Sophia
Wikipedia is
your friend
Some
complications
...
Titles and
names
* Princess Elizabeth of York
* The Princess Elizabeth
* The Princess Elizabeth,
Duchess of Edinburgh
* Queen Elizabeth II
Add a titles
table
Exclusions
Excluded because
you married a
Catholic
Included because
you divorced a
Catholic
Included because the
law on being
excluded for
marrying a Catholic
changed
Excluded because
you became a
Catholic
(Children arent
officially Catholic
until their
confirmation)
Male-preference
primogeniture
Abolished in
2013
(Mar 27)
For children
born after
28 Oct 2011
Senna Lewis
(b 22 Jun 2010)
24th
in line
T ne Lewis
(b 25 May 2012)
26th
in line
(Senna is 27th)
26 March 2013
26: T ne Lewis
27: Senna Lewis
28 March 2013
26: Senna Lewis
27: T ne Lewis
Dancer2
App
Some data
presentation
challenges
I'm A Republic (Honest!)
I'm A Republic (Honest!)
Find nearest
common
ancestor
Count
intervening
generations
I'm A Republic (Honest!)
Easy to do
A lot of data
to crunch
Enter
memcached
CHI
has cache => (
is => 'ro',
isa => 'CHI::Driver::Memcached',
lazy_build => 1,
);
sub _build_cache {
return CHI->new(
driver => 'Memcached',
namespace => 'succession',
servers => [ 'localhost:11211' ],
debug => 0,
compress_threshold => 10_000,
);
}
sub get_relationship_between_people {
my $self = shift;
my ($person1, $person2) = @_;
my $relationship = $self->cache->compute(
'rel|' . $person1->id . '|'
. $person2->id,
undef,
sub {
return
$person1->relationship_with($person2);
}
);
return $relationship;
}
Didnt
work
I'm A Republic (Honest!)
Two lessons
learned
Always use a
model layer
I'm A Republic (Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
I'm A Republic (Honest!)
Batch
job
Calculate
succession on
every date
Note the
dates when it
changes
Dates in
URLs
https://lineofsuccession.co.uk/
https://lineofsuccession.co.uk/2018-01-01
https://lineofsuccession.co.uk/2016-01-01
All the same
content
Duplicate
content is
bad
Canonical
Tag
<link rel="canonical"
href="https://lineofsuccession.co.uk/" />
<link rel="canonical"
href="https://lineofsuccession.co.uk/2014-
01-17" />
<link rel="canonical"
href="https://lineofsuccession.co.uk/1901-
01-22" />
More
SEO
Structured
data
<li itemscope
itemtype="http://schema.org/Person">
<span itemprop="name">The Prince
Charles, Prince of Wales</span>
<br><span class="small">Age 69
(born <a title="Line of Succession on
14&nbsp;November&nbsp;1948"
href="/1948-11-14">
14&nbsp;November&nbsp;1948
</a>),
<br>Son of the sovereign
</span></li>
<li itemscope
itemtype="http://schema.org/Person">
<span itemprop="name">The Prince
Charles, Prince of Wales</span>
<br><span class="small">Age 69
(born <a title="Line of Succession on
14&nbsp;November&nbsp;1948"
href="/1948-11-14">
14&nbsp;November&nbsp;1948
</a>),
<br>Son of the sovereign
</span></li>
Google likes
structured
data
Todo
Moar
data
Moar
views
Moar
marketing
https://lineofsuccession.co.uk/
https://github.com/davorg/succession
@linesuccession
@davorg
Vive la
r辿volution!
I'm A Republic (Honest!)

More Related Content

I'm A Republic (Honest!)