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
-- For normal_rand() so we can create distributions that are not uniform. | |
-- The "real" distributions are not normal but they are closer to normal than uniform. | |
CREATE EXTENSION tablefunc; | |
BEGIN; | |
-- ########################### | |
-- The base "object" that is displayed using different either id DESC proxy | |
-- or scores. | |
CREATE TABLE objects ( | |
id INTEGER PRIMARY KEY, |
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
-- One solution to the problem. Cache the ordering in an array. | |
-- Pros: | |
-- It's fast enough (~90ms) even with filtering | |
-- Updates are atomic. You are only updating one row in one table. | |
-- If the ordering is predictable (e.g. create time) then the | |
-- maintenance is fast and easy because you just append to the array. | |
-- Cons: | |
-- It requires maintenance. It's not a view and it's not a relation | |
-- in the formal sense (is that right?). CREATE TYPE object_container_order_type AS ( |
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
-- Another solution using a rollup table. | |
CREATE TABLE object_container_order_rollup ( | |
container_id INTEGER REFERENCES containers(id), | |
category_id INTEGER REFERENCES categories(id), | |
object_id INTEGER REFERENCES objects(id), | |
type VARCHAR(32) NOT NULL, | |
index INTEGER NOT NULL, | |
PRIMARY KEY (container_id, type, category_id, object_id) | |
); |
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
{ | |
"sections": [ | |
{ | |
"title": "Hitman Absolution Full Disclosure Trailer", | |
"level": 1, | |
"content": [], | |
"images": [] | |
}, | |
{ | |
"title": "Description", |
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
{ | |
"items": { | |
"19192": { | |
"id": 19192, | |
"title": "Hitman Absolution Full Disclosure Trailer", | |
"ns": 6, | |
"url": "/File:Hitman_Absolution_Full_Disclosure_Trailer", | |
"revision": { | |
"id": 37872, | |
"user": "TheBlueRogue", |
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
<?php | |
class FooBar { } | |
$fooBar = new FooBar(); | |
$iterations = 1e6; | |
$assignment = false; | |
$start = microtime(true); |
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
{ | |
"items": { | |
"19192": { | |
"id": 19192, | |
"title": "Hitman Absolution Full Disclosure Trailer", | |
"ns": 6, | |
"url": "/File:Hitman_Absolution_Full_Disclosure_Trailer", | |
"revision": { | |
"id": 37872, | |
"user": "TheBlueRogue", |
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 href="http://api-public.netflix.com/catalog/titles/series/70023522/cast" rel="http://schemas.netflix.com/catalog/people" title="cast"> | |
<cast> | |
<link href="http://api-public.netflix.com/catalog/people/30011713" rel="http://schemas.netflix.com/catalog/person" title="Steve Carell"/> | |
<link href="http://api-public.netflix.com/catalog/people/30014922" rel="http://schemas.netflix.com/catalog/person" title="John Krasinski"/> | |
<link href="http://api-public.netflix.com/catalog/people/20047634" rel="http://schemas.netflix.com/catalog/person" title="Jenna Fischer"/> | |
<link href="http://api-public.netflix.com/catalog/people/20028105" rel="http://schemas.netflix.com/catalog/person" title="Rainn Wilson"/> | |
</cast> | |
</link> |
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
{ | |
"@context" : "http://schema.org", | |
"@type" : "Article", | |
"name" : "Legolas", | |
"image" : "http://img1.wikia.nocookie.net/__cb20070715152604/lotr/images/d/d7/Tengwar_Legolas.png", | |
"url" : "http://lotr.wikia.com/wiki/Legolas", | |
"publisher" : { | |
"@type" : "Organization", | |
"name" : "[Wikia]" | |
} |
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
2242 ReqStart c 74.120.190.15 59269 857607622 | |
2242 RxRequest c GET | |
2242 RxURL c /vampirediaries/images/2/27/The-originals-season-2-red-door-photos-5.jpg/revision/latest/zoom-crop/width/240/height/240?cb=2014102201002 | |
3 | |
2242 RxProtocol c HTTP/1.1 | |
2242 RxHeader c Accept: image/webp,*/*;q=0.8 | |
2242 RxHeader c User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.94 Safari/537.36 | |
2242 RxHeader c Referer: http://vampirediaries.wikia.com/wiki/Red_Door | |
2242 RxHeader c Accept-Language: en-GB,en;q=0.8,en-US;q=0.6,en;q=0.4 | |
2242 RxHeader c Fastly-Client-IP: 103.245.70.78 |
OlderNewer