Skip to content

Instantly share code, notes, and snippets.

View rvprasad's full-sized avatar

Venkatesh-Prasad Ranganath rvprasad

View GitHub Profile
@rvprasad
rvprasad / test_process.py
Last active October 20, 2017 22:34
Illustrates how the performance of multiprocessing.Process changes inside and outside of multiprocessing.Pool in Python.
# Python -- v3.6
import begin
import multiprocessing
import time
def worker(varying_data, fixed_data):
t = 0
for j in range(1, 10000):
@rvprasad
rvprasad / test_process_graph.gp
Created October 20, 2017 22:32
Creates the graph from the data generated by test_process.py.
set terminal png
set output "test_process.png"
set logscale
set xlabel "Size of fixed data [Number of ints]"
set ylabel "Performance [seconds per iteration]"
set title "Performance of options vs Size of fixed data"
plot "test_process.csv" using 1:2 title "builtin pool" with linespoints, \
"test_process.csv" using 1:3 title "custom pool" with linespoints
@rvprasad
rvprasad / test_pool_map_graph.gp
Created October 21, 2017 01:16
creates the graph from the data generated by test_pool_map.py.
set terminal png
set output "test_pool_map.png"
set logscale
set xlabel "Size of aux data [Number of ints]"
set ylabel "Performance [seconds per iteration]"
set title "Performance of options vs Size of aux data"
plot "test_pool_map.csv" using 1:2 title "without initializer / default chunksize" with linespoints, \
"test_pool_map.csv" using 1:3 title "with initializer / default chunksize" with linespoints, \
"test_pool_map.csv" using 1:4 title "without initializer / 250 chunksize" with linespoints, \
"test_pool_map.csv" using 1:5 title "with initializer / 250 chunksize" with linespoints, \
@rvprasad
rvprasad / testClosuresAndClasses.groovy
Last active October 21, 2017 02:06
Illustrates when Java's method resolution is not honored in Groovy.
class A {
protected foo() {
this.bar("Site foo1")
def x = {
println("This: ${this.class}")
this.bar("Site foo2")
}
x()
}
@rvprasad
rvprasad / build.gradle
Last active March 12, 2018 00:39
(Ghera) Automating multi-app functional testing against different versions of Android
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
@rvprasad
rvprasad / config.txt
Last active December 19, 2019 00:49
Configure a Raspberry Pi cluster using cloud-init and then install few packages
hdmi_safe=1
enable_uart=0
gpu_mem=16
@rvprasad
rvprasad / 3NumSorter.groovy
Last active April 11, 2018 18:59
Sorts three numbers by encoding the sorting problem as a SAT problem
/*
* Copyright (c) 2018, Venkatesh-Prasad Ranganath
*
* Licensed under BSD 3-clause License
*
* Author: Venkatesh-Prasad Ranganath
*/
// Sorts three numbers using SAT solving
// Script uses z3 solver (https://github.com/Z3Prover/z3)
@rvprasad
rvprasad / simpleSudokuSolver.groovy
Last active April 14, 2018 17:41
Solves a simplified version of sudoku (w/ only row and column constraints) using z3 SAT solver
/*
* Copyright (c) 2018, Venkatesh-Prasad Ranganath
*
* Licensed under BSD 3-clause License
*
* Author: Venkatesh-Prasad Ranganath
*/
// Solves a simplified version of sudoku (w/ only row and column constraints)
// using SAT solving
@rvprasad
rvprasad / bfsSolver.groovy
Created April 15, 2018 08:09
Identifies a BFS traversal order of nodes of a given directed graph using z3 solver
/*
* Copyright (c) 2018, Venkatesh-Prasad Ranganath
*
* Licensed under BSD 3-clause License
*
* Author: Venkatesh-Prasad Ranganath
*/
import groovy.transform.Field
@rvprasad
rvprasad / dfsSolver.groovy
Last active April 16, 2018 03:14
Identifies a DFS traversal order of nodes of a given directed graph using z3 solver
/*
* Copyright (c) 2018, Venkatesh-Prasad Ranganath
*
* Licensed under BSD 3-clause License
*
* Author: Venkatesh-Prasad Ranganath
*/
import groovy.transform.Field