Skip to content

Instantly share code, notes, and snippets.

#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 / 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))
@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
$ 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 / 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
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
Usage: configure [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-importdir <dir>] [-datadir <dir>]
[-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
[-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
[-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
[-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
[-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
[-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support]
[-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
[-qt-zlib] [-system-zlib] [-no-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
@arraytools
arraytools / corebird
Created February 12, 2016 18:38
corebird installation
vagrant@vagrant:~$ sudo apt-get install corebird
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
@arraytools
arraytools / vagrant.nginx.output
Created January 1, 2016 19:26
Running nginx using vagrant
brb@brb-P45T-A:/mnt/bigdisk/mytestbox$ cat > Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "web", primary: true do |web|
web.vm.box = "ubuntu/trusty64"
web.vm.network "forwarded_port", guest:80, host:8888
web.vm.provision "shell", inline: "apt-get install -y nginx"
end
end
brb@brb-P45T-A:/mnt/bigdisk/mytestbox$ vagrant up
@arraytools
arraytools / BR5250_2.ppd
Created December 30, 2015 15:51
Brother-HL-5250DN-Postscript-Brother.ppd
*PPD-Adobe: "4.3"
*% This program is free software; you can redistribute it and/or modify it
*% under the terms of the GNU General Public License as published by the Free
*% Software Foundation; either version 2 of the License, or (at your option)
*% any later version.
*%
*% This program is distributed in the hope that it will be useful, but WITHOUT
*% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
*% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
*% more details.