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
# The data set used in this example is from http://archive.ics.uci.edu/ml/datasets/Wine+Quality | |
# P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. | |
# Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009. | |
import os | |
import warnings | |
import sys | |
import random | |
import pandas as pd |
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
hbase.ss.jmx> (p/print-table [:host :blockCacheEvictedCount :blockCacheCount :blockCacheFree :blockCacheSize] | |
(map #(-> % | |
(j/massager :blockCacheFree (fn [x] (str (float (/ x 1024 1024)) "MB"))) | |
(j/massager :blockCacheSize (fn [x] (str (float (/ x 1024 1024)) "MB"))) | |
(j/massager :host (fn [x] "Some host."))) | |
(j/get-regionserver-metrics [:blockCacheEvictedCount | |
:blockCacheCount | |
:blockCacheFree | |
:blockCacheSize]))) | |
=========================================================================================== |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<!-- Replace the group ID with your group ID --> | |
<groupId>com.mycompany.hadoopproject</groupId> | |
<!-- Replace the artifact ID with the name of your project --> | |
<artifactId>my-hadoop-project</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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
# Installing CDH4 on a Single Linux Node in Pseudo-distributed Mode | |
# https://ccp.cloudera.com/display/CDH4DOC/Installing+CDH4+on+a+Single+Linux+Node+in+Pseudo-distributed+Mode | |
# Installing CDH4 with MRv1 on a Single Linux Node in Pseudo-distributed mode | |
# On Ubuntu and other Debian systems | |
nipra@lambda:Downloads$ wget -cv http://archive.cloudera.com/cdh4/one-click-install/precise/amd64/cdh4-repository_1.0_all.deb | |
nipra@lambda:Downloads$ sudo dpkg -i cdh4-repository_1.0_all.deb # Adds /etc/apt/sources.list.d/cloudera-cdh4.list ?? | |
nipra@lambda:Downloads$ dpkg -L cdh4-repository # To view the files on Ubuntu systems | |
# Install CDH4 |
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
(let [f1 (PrefixFilter. (hb/to-bytes "0 "))] | |
(hb/with-table [table (hb/table "foo_bar_table")] | |
(hb/with-scanner [scanner (hb/scan table | |
:filter f1 | |
:caching 1000)] | |
(loop [n 0] | |
(if (seq (.next scanner 1000)) | |
(recur (+ n (count (.next scanner 1000)))) | |
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
scratch> (s/deserialize "some data" :bytes) | |
; Evaluation aborted. | |
scratch> (s/deserialize "{\"language\":\"Clojure\",\"library\":\"serialism\",\"authors\":[\"Michael\"]}" | |
:json) | |
; Evaluation aborted. |
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
;;; http://www.xach.com/lisp/buildapp/ | |
;;; buildapp --output hello-world --asdf-path ~/asds/ --load hello-world.lisp --entry main | |
;;; nipra@unlambda:~/Projects/CL$ ./hello-world | |
(in-package :cl-user) | |
(defun main (argv) | |
(declare (ignore argv)) | |
(format t "Hello World!~%")) |
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
(defproject scratch "1.0.0-SNAPSHOT" | |
:description "FIXME: write description" | |
;; http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.clojure%22 | |
;; http://dev.clojure.org/display/doc/Clojure+Contrib | |
;; http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go | |
:dependencies [[org.clojure/clojure "1.3.0"] | |
[org.mongodb/mongo-java-driver "2.6.3"] | |
[postgresql/postgresql "9.0-801.jdbc4"] | |
[mysql/mysql-connector-java "5.1.18"] | |
[org.apache.lucene/lucene-core "3.4.0"] |
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
(defproject scratch "1.0.0-SNAPSHOT" | |
:description "FIXME: write description" | |
;; http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.clojure%22 | |
;; http://dev.clojure.org/display/doc/Clojure+Contrib | |
;; http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go | |
:dependencies [[org.clojure/clojure "1.3.0"] | |
[org.mongodb/mongo-java-driver "2.6.3"] | |
[postgresql/postgresql "9.0-801.jdbc4"] | |
[mysql/mysql-connector-java "5.1.18"] | |
[org.apache.lucene/lucene-core "3.4.0"] |
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
user> (group-by #(cond (and (> % 10) | |
(< % 20)) | |
:between-10-20 | |
(and (> % 30) | |
(< % 40)) | |
:between-30-40 | |
(and (> % 90) | |
(< % 100)) |
NewerOlder