R is a software environment for statistical computing and graphics. The kinds of things people do in R are:
- Plot charts,
- Create and evaluate statistical models (linear, nonlinear),
- Perform statistical analyses (tests, classification, clustering).
// ==UserScript== | |
// @name Office 365 notifications | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description Show a Google Chrome notification when there is any unread mail. | |
// @match https://*/owa/* | |
// @copyright 2012+, You | |
// ==/UserScript== | |
var current_unread_count = 0; |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "fedora-18-x64" | |
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box" | |
config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "manifests" | |
puppet.manifest_file = "init.pp" | |
end |
import multiprocessing | |
import pprint | |
import time | |
import scapy.all as scapy | |
import subprocess | |
import sys | |
import os | |
import signal | |
import psutil |
class opencv { | |
Exec { path => "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin", } | |
$version = "2.4.6.1" | |
$libopencv_core_filename = "libopencv_core.so.2.4.6" | |
case $operatingsystem { | |
# Install OpenCV from source. This is an instructive example | |
# and may come in handy if we need to move to a version of |
from cffi import FFI | |
def _make_divide(): | |
libraries = ['c'] | |
extra_compile_args = [] | |
extra_link_args = [] | |
ffi = FFI() | |
ffi.cdef(r""" | |
int divide(int a, int b); |
import logging | |
import sys | |
logger = logging.getLogger('simple_example') | |
logger.setLevel(logging.DEBUG) | |
ch = logging.StreamHandler() | |
ch.setLevel(logging.DEBUG) | |
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
ch.setFormatter(formatter) | |
logger.addHandler(ch) |
import java.util.ArrayDeque; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Queue; | |
class KTreeNode { | |
Integer value; | |
Collection<KTreeNode> children = new ArrayList<KTreeNode>(); |
// ---------------------------------------------------------------------------- | |
// Noddy little Tesseract wrapper. | |
// | |
// Usage: | |
// | |
// ./tesseractcli <path to screenshot image> [left] [top] [width] [height] | |
// | |
// - Screenshot path is mandatory, can be relative to current working | |
// directory or absolute. | |
// - Left, top, width, and height are optional integers that set a |
N-Queens solution using naive recursion.
We know all queens must be on distinct columns. Hence for each column recursively attempt each row, terminating if the current configuration with the current subset of columns is invalid.
Validity checking does not need to check if any columns overlap (by definition they do not); we only check if both conditions are false:
placement[i] == placement[j]
, andMath.abs(i - j) == Math.abs(placement[i] - placement[j])
This is not the worst solution (the worst involves 64 choose 8 ~= 4 * 10^9!!), but not the best (a DFS graph search would do better). Indeed results show this code is too inefficient above n=14.