Skip to content

Instantly share code, notes, and snippets.

Configure summary
Build type: linux-g++ (x86_64, CPU features: mmx sse sse2)
Platform notes:
- Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
Build options:
Configuration .......... accessibility accessibility-atspi-bridge audio-backend avx avx2 c++11 clock-gettime clock-monotonic compile_examples concurrent dbus debug doubleconversion enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs gif harfbuzz headersclean iconv inotify ipv6ifname jpeg kms large-config largefile libudev linuxfb medium-config minimal-config mremap nis opengl openssl-linked pcre png poll_poll posix_fallocate precompile_header private_tests qpa qpa reduce_exports reduce_relocations rpath small-config sse2 sse3 sse4_1 sse4_2 ssse3 static system-jpeg system-png system-zlib threadsafe-cloexec use_gold_linker warnings_are_errors xcb xcb-glx xcb-plugin xcb-render xcb-xlib xinput2 xkbcommon-qt xlib xrender
Build parts ............ libs tools
@arraytools
arraytools / arduino_ide_1.6.12_install.sh
Created October 1, 2016 12:38
Arduino IDE install.sh
#!/bin/sh
# This script adds a menu item, icons and mime type for Arduino for the current
# user. If possible, it will use the xdg-utils - or fall back to just creating
# and copying a desktop file to the user's dir.
# If called with the "-u" option, it will undo the changes.
# Resource name to use (including vendor prefix)
RESOURCE_NAME=arduino-arduinoide
$ perl reads_simulator.pl # Help
usage: reads_simulator.pl <num_reads> <name> [options]
<name> string is used in the names of the output files.
Use only alphanumeric, underscores and dashes in this string.
This program outputs a fasta file of reads and a .cig file and .bed file representing
the truth of where these reads map.
- bed file is in one-based coords and contains both endpoints of each span.
@arraytools
arraytools / install_brew.log
Last active December 15, 2017 18:03
Log of installing brew (https://brew.sh/) on mac El Captain
~/Downloads (517)$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
@arraytools
arraytools / scatterhist_null
Created October 1, 2018 17:29
Scatterplot of BH adjusted P-values vs raw P-values from a null data
scatterhist <- function(x, y, xlab="", ylab=""){
# modify from https://www.r-bloggers.com/example-8-41-scatterplot-with-marginal-histograms/
zones=matrix(c(2,0,1,3), ncol=2, byrow=TRUE)
layout(zones, widths=c(4/5,1/5), heights=c(1/5,4/5))
xhist = hist(x, plot=FALSE)
yhist = hist(y, plot=FALSE)
top = max(c(xhist$counts, yhist$counts))
par(mar=c(3,3,1,1))
plot(x,y)
par(mar=c(0,3,1,1))
#include <stdio.h>
int checkPrimeNumber(int n);
int main()
{
int n1, n2, i, flag;
printf("Enter two positive integers: ");
scanf("%d %d", &n1, &n2);
printf("Prime numbers between %d and %d are: ", n1, n2);
@arraytools
arraytools / track_R_package_download.R
Last active March 4, 2019 15:01
Get top downloaded R packages from a certain time period
## ======================================================================
## Step 1: Download all log files
## ======================================================================
# Here's an easy way to get all the URLs in R
start <- as.Date('2018-07-01')
today <- as.Date('2018-12-31')
all_days <- seq(start, today, by = 'day')
@arraytools
arraytools / christmastree.R
Created March 21, 2019 15:27
Christmas Tree
# http://blogs.sas.com/content/iml/2012/12/14/a-fractal-christmas-tree/
# Each row is a 2x2 linear transformation
# Christmas tree
L <- matrix(
c(0.03, 0, 0 , 0.1,
0.85, 0.00, 0.00, 0.85,
0.8, 0.00, 0.00, 0.8,
0.2, -0.08, 0.15, 0.22,
-0.2, 0.08, 0.15, 0.22,
0.25, -0.1, 0.12, 0.25,
@arraytools
arraytools / perspExample.R
Last active March 21, 2019 15:30
3 D example using persp()
### Random pattern
# Create matrix with random values with dimension of final grid
rand <- rnorm(441, mean=0.3, sd=0.1)
mat.rand <- matrix(rand, nrow=21)
# Create another matrix for the colors. Start by making all cells green
fill <- matrix("green3", nr = 21, nc = 21)
# Change colors in each cell based on corresponding mat.rand value
fcol <- fill
@arraytools
arraytools / silentnight.R
Created March 21, 2019 16:08
Silent Night
# https://aschinchon.wordpress.com/2014/03/13/the-lonely-acacia-is-rocked-by-the-wind-of-the-african-night/
depth <- 9
angle<-30 #Between branches division
L <- 0.90 #Decreasing rate of branches by depth
nstars <- 300 #Number of stars to draw
mstars <- matrix(runif(2*nstars), ncol=2)
branches <- rbind(c(1,0,0,abs(jitter(0)),1,jitter(5, amount = 5)), data.frame())
colnames(branches) <- c("depth", "x1", "y1", "x2", "y2", "inertia")
for(i in 1:depth)
{