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
"| | |
"| File : ~/.vim/plugin/cua-mode.vim | |
"| Source : https://github.com/fabi1cazenave/cua-mode | |
"| Licence : WTFPL | |
"| | |
"| This file brings Notepad-like CTRL-ZXCV shortcuts to Vim, while preserving | |
"| all other Vim shortcuts -- like the CUA-mode does on Emacs: | |
"| http://www.emacswiki.org/CuaMode | |
"| | |
"| It is based on Bram Molenaar's mswin.vim, g:cua_mode sets the behavior: |
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
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): |
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
// Derived from : http://blog.efftinge.de/2008/10/multi-line-string-literals-in-java.html | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
public class Heredoc { | |
public static String S() { | |
StackTraceElement element = new RuntimeException().getStackTrace()[1]; |
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
#!/bin/sh | |
## | |
# 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 http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html | |
# | |
export build=~/devtools # or wherever you'd like to build |
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
<?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 | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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
configuration> | |
<property> | |
<name>dfs.datanode.data.dir</name> | |
<value>/mnt/hadoop/hdfs/data</value> | |
<final>true</final> | |
</property> | |
<property> | |
<name>dfs.ha.automatic-failover.enabled</name> | |
<value>true</value> |
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
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}") |
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
EtreCheck version: 2.2 (132) | |
Report generated 7/21/15, 7:36 PM | |
Download EtreCheck from http://etresoft.com/etrecheck | |
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 |
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
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" |
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
# 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 https://ccp.cloudera.com/display/CDH4DOC/CDH4+Documentation | |
# Add Cloudera RPM-GPG-KEY and repo | |
rpm --import http://archive.cloudera.com/cdh4/redhat/6/x86_64/cdh/RPM-GPG-KEY-cloudera | |
rpm -ivh http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm | |
# Install CDH4 Base | |
yum install hadoop-0.20-conf-pseudo |