Skip to content

Instantly share code, notes, and snippets.

Avatar

Raziman T V razimantv

  • Imperial College London
  • London, United Kingdom
  • Twitter @razimantv
View GitHub Profile
@razimantv
razimantv / primes.cpp
Last active Oct 12, 2020
Comparing prime generation the old way and the C++20 way
View primes.cpp
#include <chrono>
#include <iostream>
#include <numeric>
#include <ranges>
#include <vector>
const int N = 10000000;
int main() {
auto t1 = std::chrono::steady_clock::now();
@razimantv
razimantv / towers.cpp
Created Apr 9, 2020
Solution to the towers puzzle
View towers.cpp
/******************************************************************************
* File: towers.cpp
*
* Author: Raziman T V
* Created: 04/09/20
* Description: Solving the Towers puzzle
*****************************************************************************/
#include <algorithm>
#include <cassert>
@razimantv
razimantv / Randomstrip.ipynb
Created Feb 18, 2019
Generate random points in an angle range around a given latitude and longitude
View Randomstrip.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View IqbalPuzzle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / population_evolution.cpp
Last active Nov 20, 2018
Dependence of population evolution on age of giving birth
View population_evolution.cpp
#include <fstream>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <tuple>
// Birth/death events
// If birth: time, +1, 0
// If death: time, -1, birthday
@razimantv
razimantv / Pi_MC.ipynb
Created Oct 4, 2018
Monte Carlo estimation of Pi
View Pi_MC.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / ImpossiblePuzzle.ipynb
Last active Oct 4, 2018
Programmatic solution to the "Impossible puzzle"
View ImpossiblePuzzle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / battleship.cpp
Created Feb 25, 2018
Given the shape of a ship and the location of one cell, bomb the remaining cells in minimum attempts
View battleship.cpp
#include <iostream>
#include <map>
#include <random>
#include <tuple>
#include <vector>
std::random_device rd;
std::mt19937 gen(rd());
typedef std::vector<std::string> pattern;
View stackify.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / covfefe.ipynb
Created Jan 5, 2018
Solving the covfefe problem
View covfefe.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.