Skip to content

Instantly share code, notes, and snippets.

View rohanpadhye's full-sized avatar
🎓

Rohan Padhye rohanpadhye

🎓
View GitHub Profile
@rohanpadhye
rohanpadhye / bibnice.py
Created June 10, 2021 16:09
Clean up bibtex
import bibtexparser
with open('references.bib') as bibtex_file:
bib = bibtexparser.bparser.BibTexParser(common_strings=True).parse_file(bibtex_file)
# First, rename
# Remove duplicates
bib.entries = list(bib.entries_dict.values())
@rohanpadhye
rohanpadhye / test.py
Created February 27, 2020 22:48
ChocoPy program reduced by delta (counter-example for a student's parser)
class n_3(object):
def n_3(e_4:bool, n_3:str, o_5:str, j_0:object):
for x_12 in (-[(m_7), (None), (e_4), (g_13), (t_14)].y_15(([(t_11)])) and 310):
return
def b_33(a_34:object, u_35:str, o_5:object, f_36:str, q_17:bool, j_24:str, x_23:int, c_37:int, j_27:object):
def n_39(n_39:int, d_21:str, v_40:bool, j_27:bool, b_19:object, b_41:bool, d_42:bool, r_43:object):
(c_80)
pass
@rohanpadhye
rohanpadhye / test.py
Last active February 27, 2020 22:48
ChocoPy program reduced by C-reduce (counter-example for a student's parser)
for a in -[].b :
0
@rohanpadhye
rohanpadhye / test.py
Last active February 27, 2020 23:02
ChocoPy program generated by Zest (counter-example for a student's parser; AST produced differs from that produced by the reference compiler)
class j_0(object):
j_0:object = 513
m_1:int = True
t_2:int = "Udr"
m_1:str = None
class n_3(object):
n_3:int = False
j_0:str = False
m_1:object = False
j_0:str = 793
#include "stdlib.h"
#include "stdio.h"
#include "archive.h"
#include "archive_entry.h"
int main(int argc, char** argv) {
struct archive *a;
struct archive_entry *entry;
int r;
@rohanpadhye
rohanpadhye / CallGraphTransformer.java
Created June 13, 2017 16:04
Possible fix for issues with VASCO-created call graph not having InvokeExprs
/**
* Copyright (C) 2013 Rohan Padhye
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
var express = require('express');
var app = express();
var router = express.Router();
var M = 1000; // Size of path array
var N = 1000; // Size of middleware array
function fnNext(req, res, next) {
next();
}
@rohanpadhye
rohanpadhye / treemapBinary-perf.js
Last active May 27, 2016 00:27
Asymptotic performance test for d3-hierarchy's binary tree-map
var d3_hierarchy = require("d3-hierarchy");
var tile = d3_hierarchy.treemapBinary;
var M = 1000; // number of children
var N = 1000; // number of iterations for perf test
// Util: measure time
function timeit(name, f, N) {
console.time(name);