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
/* solar.cpp: Calculates the solar energy received by places at different | |
* latitudes over the year. It is assumed that the earth revolves around the | |
* sun in a circular orbit taking exactly 365 days | |
* | |
* Author: Raziman T V | |
* | |
* License: | |
* You may use this document for whatever purpose you desire, as long as the | |
* following conditions are satisfied: | |
* 1) You do not use it in a way that suggests that I endorse the use. |
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
"" vimrc file | |
" contains settings for vim and gvim | |
"Vundle========================================================================= | |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'mileszs/ack.vim' | |
Plugin 'vim-scripts/Conque-GDB' |
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
set -g default-terminal "screen-256color" | |
set -g update-environment "TERM_PROGRAM" | |
bind C-y run "tmux save-buffer - | xclip -selection clipboard" | |
set -g mouse on | |
# Toggle mouse on with ^B m | |
bind m \ | |
set -g mouse on \;\ | |
display 'Mouse: ON' |
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
#include <cmath> | |
#include <algorithm> | |
#include <iostream> | |
#include <tuple> | |
#include <vector> | |
using namespace std; | |
random_device rd; | |
mt19937_64 gen(rd()); |
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
/* Signpost solver | |
* Author: Raziman T V | |
* | |
* (Game can be found at | |
* http://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/signpost.html) | |
* | |
* Board is to be input as | |
* H W | |
* v_i dir_i | |
* where v_i is the value of ith cell (0 for unknown) |
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
#include <algorithm> | |
#include <iostream> | |
#include <map> | |
#include <random> | |
#include <string> | |
#include <vector> | |
std::string all = "0123456789"; | |
std::random_device rd; | |
std::mt19937 gen(rd()); |
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
#include <algorithm> | |
#include <iostream> | |
#include <numeric> | |
#include <set> | |
#include <vector> | |
typedef std::vector<int> triplet; | |
// List all ways to choose K-element subsets of an N-element vector | |
// By abusing next_permutation |
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
primes = [2, 3, 5, 7] | |
parent = [-1, -1, -1, -1] | |
digits = [1, 3, 7, 9] | |
def isprime(N): | |
i = 2 | |
while i * i <= N: | |
if N % i == 0: | |
return False | |
i += 1 |
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
#include <algorithm> | |
#include <cmath> | |
#include <iostream> | |
#include <random> | |
#include <string> | |
#include <vector> | |
// RGB values | |
// Add arithmetic operations to take means squared deviations | |
struct rgb { |
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
#include <iostream> | |
#include <iterator> | |
#include <numeric> | |
#include <queue> | |
#include <string> | |
#include <vector> | |
bool notblocked(const std::string& str, char c) { | |
int L = str.size(); | |
if (L < 2) return true; |
OlderNewer