Skip to content

Instantly share code, notes, and snippets.

StephenBoesch javadba

Block or report user

Report or block javadba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import numpy as np
from typing import AnyStr, Callable
AT = AnyStr
def groupby(arr: np.array, transformfn: Callable[[AT], AT], selectfn: Callable[[AT], AT] = None):
xarr = list(map(transformfn,arr))
keys, indx = np.unique(xarr, return_inverse=True)
K = len(keys)
recsByKey = list()
for i in range(K):
// Derived from :
public class Heredoc {
public static String S() {
StackTraceElement element = new RuntimeException().getStackTrace()[1];
javadba /
Created Nov 26, 2016 — forked from justinbellamy/
Install Autoconf and Automake on OS X El Capitan
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
# This script is originally from
export build=~/devtools # or wherever you'd like to build
javadba / ha-core-site.xml
Created Oct 23, 2015
ha core-site.xml without kerberos
View ha-core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
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
Unless required by applicable law or agreed to in writing, software
javadba / ha-dfs-site.xml
Created Oct 23, 2015
ha hdfs-site.xml without kerberos
View ha-dfs-site.xml
javadba / getProcessingCpuLoad.scala
Created Sep 17, 2015
getProcessingCpuLoad thread
View getProcessingCpuLoad.scala
val latch = new java.util.concurrent.CountDownLatch(1)
val t = new Thread() {
override def run() = {
var x = 1.0
val startt = System.currentTimeMillis
for (i <- 1 to lnLoops) {
x = (x * math.pow(i, 1.2) * i) /
(math.pow(x, 1.5) * math.sqrt(i) * math.max(math.abs(math.cos(x)), 0.1) * math.pow(i, 1.21))
println(s"X=$x duration=${System.currentTimeMillis-startt}")
View javadbaEtreOnMBPro.doc
EtreCheck version: 2.2 (132)
Report generated 7/21/15, 7:36 PM
Download EtreCheck from
Click the [Click for support] links for help with non-Apple products.
Click the [Click for details] links for more information about that line.
Hardware Information: ℹ️
MacBook Pro (Retina, Mid 2012) (Verified)
MacBook Pro - model: MacBookPro10,1
javadba / gist:5552140
Last active May 20, 2019
Concise string interpolation in python
View gist:5552140
def tostr(msg, inhash=locals()):
import io
outstr = io.StringIO()
print(outstr, msg % inhash)
return outstr.getvalue()
usage example:
s="Some message from %(froma)s \n on the %(day)d of %(month)s %(year)d \n Says %(message)s\n"
View gist:5078682
# Assumes you have Sun JDK installed already and JAVA_HOME set to that for root
# This is all basically a summary of various parts of
# Add Cloudera RPM-GPG-KEY and repo
rpm --import
rpm -ivh
# Install CDH4 Base
yum install hadoop-0.20-conf-pseudo
You can’t perform that action at this time.