Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008
# Global Map Tiles Classes
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326,
# generate a simple HTML viewers based on Google Maps and OpenLayers
# Author: Klokan Petr Pridal, klokan at klokan dot cz
# Web: http://www.klokan.cz/projects/gdal2tiles/
@ndimiduk
ndimiduk / core.clj
Last active December 11, 2015 00:29
An example of consuming HBase tables from Cascalog using my patched HBaseScheme in ndimiduk/maple.
(ns cascalog-repl.core
"An example of consuming an HBase tap from Cascalog. First, create and
populate the table:
$ hbase shell
> create 't1', 'f1'
> put 't1', 'TheRealMT', 'f1:user', 'Mark Twain'
> put 't1', 'TheRealMT', 'f1:email', 'samuel@clemens.org'
> put 't1', 'TheRealMT', 'f1:pass', 'abc123'
> put 't1', 'GrandpaD', 'f1:user', 'Fyodor Dostoyevsky'
#!/usr/bin/env python
import io
import mapnik
from shapely.geometry import box, MultiPoint
class SimpleDatasource(mapnik.PythonDatasource):
def __init__(self):
@ndimiduk
ndimiduk / multirs.py
Created January 21, 2014 19:25
Automation for managing multiple RegionServer processes running on a single host
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package bufperf;
import sun.nio.ch.DirectBuffer;
import java.lang.reflect.Field;
import java.nio.Buffer;
import java.nio.ByteBuffer;
public class DirectByteBufferUtils {
static final Field buffer_address;
@ndimiduk
ndimiduk / parse_IntegrationTestRegionReplicaPerf.py
Created October 24, 2014 21:54
Parse the log output produced by IntegrationTestRegionReplicaPerf for latency summary data
#!/usr/bin/env python
#
# parse the log output produced by IntegrationTestRegionReplicaPerf to
# collect the latency data from each client thread. Works on some build of
# 0.98 + region replicas.
#
import fileinput
import re
@ndimiduk
ndimiduk / Example 1
Created November 18, 2014 16:43
Before and after examples of using the HBase DataType API
/*
* Before and after examples based on extracts from the UserDAO in HBase In Action
* https://github.com/hbaseinaction/twitbase/blob/master/src/main/java/HBaseIA/TwitBase/hbase/UsersDAO.java
*/
//
// Using raw byte[]'s directly.
//
private static Put mkPut(User u) {
@ndimiduk
ndimiduk / commands.sh
Last active May 13, 2024 14:28
cue sheet for creating HBase release candidates from branch-1.1
# in local sandbox:
## check compatibility report
git checkout master
GETOPT=/usr/local/Cellar/gnu-getopt/1.1.6/bin/getopt ./dev-support/check_compatibility.sh -r https://git-wip-us.apache.org/repos/asf/hbase.git 1.1.0 branch-1.1
open open dev-support/target/compatibility/report/1.1.0_branch-1.1_compat_report.html
## verify src tgz builds (this one is fragile)
@ndimiduk
ndimiduk / MyTest.java
Created November 12, 2015 19:23
flink-it collection sink
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.sink.SinkFunction;
import org.apache.flink.streaming.util.StreamingMultipleProgramsTestBase;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@ndimiduk
ndimiduk / OutputFormatAdapter.java
Last active February 8, 2016 18:40
Flink: Use an OutputFormat in place of a SinkFunction
/** Use an {@link OutputFormat} in place of a {@link SinkFunction}. */
public class OutputFormatAdapter<T> extends RichSinkFunction<T> implements InputTypeConfigurable {
private final OutputFormat<T> delegate;
private final RichOutputFormat<T> richDelegate;
public OutputFormatAdapter(OutputFormat<T> delegate) {
this.delegate = delegate;
this.richDelegate = (this.delegate instanceof RichOutputFormat)
? (RichOutputFormat<T>) delegate