Skip to content

Instantly share code, notes, and snippets.

View shikharbhardwaj's full-sized avatar

Shikhar Bhardwaj shikharbhardwaj

View GitHub Profile
@shikharbhardwaj
shikharbhardwaj / Dockerfile.fixed
Last active April 29, 2023 14:42
OpenSearch signal handling MVCE
FROM opensearchproject/opensearch:2.5.0
# Add a basic config to run OpenSearch container as a single-node cluster.
COPY opensearch.yml /usr/share/opensearch/config/opensearch.yml
USER root
# Install tools to be able to inspect the process tree more easily.
RUN yum install -y procps
var matchData = {
"team": [
{
"id": "",
"kills": "",
"assists": "",
"deaths": "",
"mvps": "",
"hs": "",
"score": ""
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="log.xsl"?>
<build time="5 seconds">
<task location="/Users/shikhar/Documents/dev/ant/build.xml:23: " name="property" time="0 seconds" />
<task location="/Users/shikhar/Documents/dev/ant/build.xml:24: " name="property" time="0 seconds" />
<task location="/Users/shikhar/Documents/dev/ant/build.xml:25: " name="property" time="0 seconds" />
<task location="/Users/shikhar/Documents/dev/ant/build.xml:32: " name="property" time="0 seconds" />
<task location="/Users/shikhar/Documents/dev/ant/build.xml:33: " name="property" time="0 seconds" />
<task location="/Users/shikhar/Documents/dev/ant/build.xml:35: " name="property" time="0 seconds" />
@shikharbhardwaj
shikharbhardwaj / gpp.sublime-build
Created January 20, 2020 07:44
Build system for competitive programming
{
"shell_cmd": "g++ \"${file}\" -std=c++1y -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run with optimizations",
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Roughly based on: http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration
from __future__ import print_function
import numpy as np
from time import time
// We don't want bots.
bot_kick
// Start warmup (till a player connects).
mp_warmup_start
mp_warmup_pausetimer 1
// These make the rounds end and start faster.
mp_round_restart_delay 2
mp_freezetime 2
@shikharbhardwaj
shikharbhardwaj / env_setup.md
Created January 6, 2018 13:35
Dev environment setup
// We don't want bots.
bot_kick
// Start warmup (till a player connects).
mp_warmup_start
mp_warmup_pausetimer 1
// These make the rounds end and start faster.
mp_round_restart_delay 2
mp_freezetime 2
// Run HOGWILD! on the Netflix dataset, with the regularized SVD function.
#include <mlpack/core.hpp>
#include <mlpack/core/optimizers/parallel_sgd/parallel_sgd.hpp>
#include <mlpack/core/optimizers/parallel_sgd/decay_policies/exponential_backoff.hpp>
#include <mlpack/methods/regularized_svd/regularized_svd_function.hpp>
using namespace std;
using namespace mlpack;
using namespace mlpack::optimization;
using namespace arma;
@shikharbhardwaj
shikharbhardwaj / shuffle_bench.cpp
Created July 23, 2017 17:52
Micro benchmark for arma::shuffle
#include <benchmark/benchmark.h>
#include <algorithm>
#include <armadillo>
static void baseline(benchmark::State& state) {
while (state.KeepRunning()) {
arma::vec test(100, arma::fill::randn);
benchmark::DoNotOptimize(test);
}
}