Skip to content

Instantly share code, notes, and snippets.

@sandeep-datta
sandeep-datta / repro
Created December 3, 2020 16:51
EpiJudge perf issue reproducer
#!/bin/bash
for i in {1..10}
do
make reverse_bits swap_bits count_bits parity
done
@sandeep-datta
sandeep-datta / perf_data.txt
Created December 3, 2020 16:49
EPIJudge perf data for some ch 4. problems
Test CountBits PASSED (10001/10001) [ 2 us]
Test CountBits PASSED (10001/10001) [ 2 us]
Test CountBits PASSED (10001/10001) [ 3 us]
Test CountBits PASSED (10001/10001) [ 3 us]
Test CountBits PASSED (10001/10001) [ 3 us]
Test CountBits PASSED (10001/10001) [ 3 us]
Test CountBits PASSED (10001/10001) [ 4 us]
Test CountBits PASSED (10001/10001) [ 4 us]
Test CountBits PASSED (10001/10001) [ 8 us]
Test Parity_divide_and_conquer_generic<unsigned long long> PASSED (10000/10000) [ 2 us]
import Html exposing (Html, div, text)
import Svg exposing (svg, circle, line)
import Svg.Attributes exposing (..)
import Time exposing (Time, second, hour)
main =
Html.program
{ init = init
, update = update
//HTML
//<div id="container"/>
//CSS
//table,td {border: 1px solid black;}
JAVASCRIPT
function createHLayout() {
var row = $('<tr/>')
@sandeep-datta
sandeep-datta / create_img
Last active November 16, 2024 16:41
A python script for creating a linux virtual disk with a ready to use rootfs
#!/usr/bin/python3
import sys
import os
import argparse
from os import path
from pprint import pprint
from tempfile import TemporaryDirectory
@sandeep-datta
sandeep-datta / testclang.d
Created May 19, 2012 14:22
A D program to analyse a C/C++ file supplied through the command line using the D bindings for libclang
import std.stdio;
import std.string;
import deimos.clang.index;
//Purpose: analyse a C/C++ file supplied through the command line using libclang
//How to compile:-
//dmd -c -gc testclang.d
//g++ -g -I../llvm/tools/clang/include -L../llvm/build/Debug+Asserts/lib -o testclang testclang.o -lclang -lphobos2 -lrt
//Note: libclang.so must be in the search path for this to work.
@sandeep-datta
sandeep-datta / testclang.cpp
Created May 19, 2012 14:17
A C++ program to analyse a C/C++ file supplied through the command line using libclang
#include <clang-c/Index.h>
//Purpose: analyse a C/C++ file supplied through the command line using libclang
int main(int argc, char *argv[])
{
CXIndex index = clang_createIndex(0, 0);
CXTranslationUnit tu = clang_parseTranslationUnit(index, NULL,
argv, argc, NULL, 0, CXTranslationUnit_None);