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
## | |
# @see: http://penguininside.blogspot.it/2009/08/top-10-gnome-performance-tweaks.html | |
# | |
gconftool-2 --type string --set /apps/nautilus/preferences/show_icon_text never | |
gconftool-2 --type string --set /apps/nautilus/preferences/show_directory_item_counts never | |
gconftool-2 --type string --set /apps/nautilus/preferences/show_image_thumbnails never | |
gconftool-2 --type string --set /apps/nautilus/preferences/preview_sound never | |
# gconftool-2 --type bool --set /desktop/gnome/interface/menus_have_icons false |
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
<script type="text/javascript" | |
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
</script> | |
<script type="text/javascript">MathJax.Hub.Config({tex2jax: {processEscapes: true, | |
processEnvironments: false, inlineMath: [ ['$','$'] ], | |
displayMath: [ ['$$','$$'] ] }, | |
asciimath2jax: {delimiters: [ ['$','$'] ] }, | |
"HTML-CSS": {minScaleAdjust: 125 } }); | |
</script> |
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
Here is a list of package vignettes _possibly_ built with **knitr** on CRAN. | |
```{r fetch-pkgs, include=FALSE} | |
pkgs = available.packages(contrib.url('http://cran.r-project.org', 'source')) | |
deps = tools::package_dependencies('knitr', pkgs, which = 'all', reverse = TRUE)[['knitr']] | |
deps = setdiff(deps, 'R.rsp') # packages that do not use knitr | |
deps = sort(c(deps, 'knitr')) | |
``` | |
```{r vig-list, include=FALSE, echo=FALSE, cache=TRUE, cache.extra=deps, message=FALSE, error=FALSE} | |
vigs = lapply(deps, function(pkg) { |
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
# Load the raw training data and replace missing values with NA | |
training.data.raw <- read.csv('train.csv',header=T,na.strings=c("")) | |
# Output the number of missing values for each column | |
sapply(training.data.raw,function(x) sum(is.na(x))) | |
# Quick check for how many different values for each feature | |
sapply(training.data.raw, function(x) length(unique(x))) | |
# A visual way to check for missing data |
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
; Stumbling towards Y | |
; | |
; The applicative-order Y combinator is a function that allows one | |
; to create a recursive function without using define. | |
; This may seem strange. Usually a recursive function has to call | |
; itself, and thus relies on itself having been defined. | |
; | |
; Regardless, here we will stumble towards the implementation of the | |
; Y combinator (in Scheme). |
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
This gist includes components of a oozie workflow - scripts/code, sample data | |
and commands; Oozie actions covered: shell action, email action | |
Action 1: The shell action executes a shell script that does a line count for files in a | |
glob provided, and writes the line count to standard output | |
Action 2: The email action emails the output of action 1 | |
Pictorial overview of job: | |
-------------------------- |
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
#!/opt/local/bin/python | |
import imaplib | |
import sys, signal | |
from avro import schema, datafile, io | |
import os, re | |
import email | |
import inspect, pprint | |
import getopt | |
import time |
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 java.math.{BigDecimal => BD, MathContext} | |
import BD.{ZERO, ONE} | |
/** | |
* This program will calculate Pi with John Machin[1]'s formula[2]. | |
* This is just a translation from Mr. Kishida's Java implementation[3] to | |
* Scala one. | |
* | |
* [1] http://en.wikipedia.org/wiki/John_Machin | |
* [2] http://upload.wikimedia.org/math/f/1/5/f15dc3d39c473c4bd718e3a98145da0d.png |
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/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
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 Oracle Java enum Planets example using the Klang DIY Enum, modified to include ordering. | |
*/ | |
object KlangEnumPlanets extends App { | |
trait Enum { //DIY enum type | |
import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia | |
type EnumVal <: Value //This is a type that needs to be found in the implementing class |
OlderNewer