Skip to content

Instantly share code, notes, and snippets.

View timrobertson100's full-sized avatar
🌴
On vacation

Tim Robertson timrobertson100

🌴
On vacation
View GitHub Profile
<article class="container">
<div class="row">
<!--
Introduction text
-->
<section id="introduction" class="col-md-12 well well-lg">
<div class="row">
<header class="content-header col-md-12">
<h2>Species occurrence record trends</h2>
// Detect the URLs with the ISO code, and ensure the tab is highlighted
if (isset($variables['page']['menu']['menu_block_gbif_navigation_analytics'])) {
$current_path = explode('/', current_path());
// e.g. analytics/country/<ISO>/about or analytics/country/<ISO>/published
if (count($current_path) == 4) {
// items where registered in menu without the ISO
$menu_item = $current_path[0] . '/' . $current_path[1] . '/' . $current_path[3];
// find the registered menu item and add the "active" CSS class to the attributes
foreach ($variables['page']['menu']['menu_block_gbif_navigation_analytics']['#content'] as $k => $tab) {
if (gettype($k) == 'integer') {
// Detect the URLs with the ISO code, and ensure the tab is highlighted
if (isset($variables['page']['menu']['menu_block_gbif_navigation_analytics'])) {
$current_path = explode('/', current_path());
// e.g. analytics/country/<ISO>/about or analytics/country/<ISO>/published
if (count($current_path) == 4) {
// items where registered in menu without the ISO
$menu_item = $current_path[0] . '/' . $current_path[1] . '/' . $current_path[3];
// find the registered menu item and add the "active" CSS class to the attributes
foreach ($variables['page']['menu']['menu_block_gbif_navigation_analytics']['#content'] as $k => $tab) {
if (gettype($k) == 'integer') {
"higherclassification","num"
"Eukaryota;Metazoa;Ecdysozoa;Arthropoda;Hexapoda;Insecta;Pterygota;Neoptera;Endopterygota;Trichoptera;Integripalpia;Limnephiloidea;Limnephilidae;Limnephilinae;Limnephilini;Limnephilus","604700"
"Eukaryota;Viridiplantae;Streptophyta;Embryophyta;Tracheophyta;Spermatophyta;Magnoliophyta;eudicotyledons;Gunneridae;Pentapetalae;rosids;fabids;Fagales;Betulaceae;Betula","552002"
"Eukaryota;Metazoa;Chordata;Craniata;Vertebrata;Euteleostomi;Mammalia;Eutheria;Laurasiatheria;Chiroptera;Microchiroptera;Vespertilionidae;Myotis","495939"
"Eukaryota;Metazoa;Chordata;Craniata;Vertebrata;Euteleostomi;Lepidosauria;Squamata;Bifurcata;Unidentata;Episquamata;Toxicofera;Serpentes;Colubroidea;Viperidae;Crotalinae;Crotalus","473439"
"Bacteria;environmental samples","408917"
"Eukaryota;Viridiplantae;Streptophyta;Embryophyta;Tracheophyta;Spermatophyta;Magnoliophyta;eudicotyledons;Gunneridae;Pentapetalae;rosids;fabids;Malpighiales;Euphorbiaceae;Crotonoideae;Manihoteae;Manihot","277902"
"Eukaryota;Metazoa;Ecd
{"datasetUuid":"66011193-d453-4b02-95b7-174fe16e2ffe","attempt":2,"fragment":"eyJhc3NvY2lhdGVkU2VxdWVuY2VzIjoiQ0FPSzAxMTM2ODQ0IiwiYmFzaXNPZlJlY29yZCI6Ik1hdGVyaWFsU2FtcGxlIiwiY3JlYXRlZCI6IjIwMTItMTEtMjgiLCJkZWNpbWFsTGF0aXR1ZGUiOiI1Ny4yMzAyIiwiZGVjaW1hbExvbmdpdHVkZSI6Ii00Ljc1NDkiLCJldmVudERhdGUiOiIyMDEwLTAxLTAxIiwiaGlnaGVyQ2xhc3NpZmljYXRpb24iOiJFdWthcnlvdGE7VmlyaWRpcGxhbnRhZTtTdHJlcHRvcGh5dGE7RW1icnlvcGh5dGE7VHJhY2hlb3BoeXRhO1NwZXJtYXRvcGh5dGE7TWFnbm9saW9waHl0YTtldWRpY290eWxlZG9ucztHdW5uZXJpZGFlO1BlbnRhcGV0YWxhZTtyb3NpZHM7ZmFiaWRzO0ZhZ2FsZXM7QmV0dWxhY2VhZTtCZXR1bGEiLCJpZCI6IkNBT0swMTEzNjg0NCIsImlkZW50aWZpZWRCeSI6bnVsbCwibG9jYWxpdHkiOiJVbml0ZWQgS2luZ2RvbTpTY290bGFuZCwgRHVuZHJlZ2dhbiBFc3RhdGUiLCJtaW5pbXVtRWxldmF0aW9uSW5NZXRlcnMiOm51bGwsIm1vZGlmaWVkIjoiMjAxMi0xMi0wMiIsIm9jY3VycmVuY2VJRCI6IkNBT0swMTEzNjg0NCIsInJlY29yZGVkQnkiOm51bGwsInJlZmVyZW5jZXMiOiJodHRwOi8vd3d3LmViaS5hYy51ay9lbmEvZGF0YS92aWV3L0NBT0swMTEzNjg0NCIsInNjaWVudGlmaWNOYW1lIjoiQmV0dWxhIG5hbmEiLCJ0YXhvbklEIjoiMjE2OTkwIiwidGF4b25SYW5rIjoic3BlY2llcyJ9","sch
package org.gbif.hadoop.compress;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.CRC32;
import java.util.zip.Checksum;
import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream;
/**
/**
* Writes the custom fixed length footer to the stream.
*/
@Override
public void finish() throws IOException {
flush(); // make sure deflater flushes, and counts are accurate
// Push the custom footer to the output stream
ByteBuffer footer = ByteBuffer.allocate(26);
footer.put(FOOTER_CLOSE_DEFLATE); // 2 bytes: which means the deflate stream can be read in isolation
/**
* An end to end test that writes some random files and ensures that when deflated separately, merged and inflated
* they represent the same byte sequence as a concatenation of the original files.
*/
@Test
public void testParallelCompress() throws IOException {
// generate the uncompressed files and create a merged version
List<File> parts = Lists.newArrayList();
for (int i = 0; i < NUMBER_PARTS; i++) {