Skip to content

Instantly share code, notes, and snippets.

View prasadtalasila's full-sized avatar

Prasad Talasila prasadtalasila

View GitHub Profile
@prasadtalasila
prasadtalasila / submit.js
Created March 27, 2017 10:30
node.js submit script for socket.io client
var argv = require('minimist')(process.argv.slice(2));
var io = require('socket.io-client');
var submit = function(host, id_no, current_lab, commit_hash, language) {
var req = [id_no, current_lab , commit_hash, language];
var socket = io.connect(host);
socket.emit('submission', req);
socket.on('invalid', function(data) {
console.log('Access Denied. Please try submitting again');
@prasadtalasila
prasadtalasila / pycallgraph.txt
Created April 10, 2017 15:00
pycallgraph usage
pythoncallgraph is useful for plotting callgraphs of python code base. The software works by default, but has quirky behavior for some of the options.
To reproduce this tutorial, do the following.
(graphviz already installed)
$pip install pycallgraph
$cat > scrapyTest.py <<EOF
import scrapy
class BlogSpider(scrapy.Spider):
@prasadtalasila
prasadtalasila / snakefood.txt
Last active April 10, 2017 15:52
snakefood
Snakefood (http://furius.ca/snakefood/) is a python dependency graph generator. The package performs static call sequence analysis on a set of given python files. We can use it to identify static call graph of the project.
As a sample, install snakefood and then the following instructions generated a decent result.
$git clone
$cd IRCLogParser/IRCLogParser
$sfood lib/* | sfood-graph | dot -Tpdf -o graph.pdf
sfood lib/* | sfood-graph | dot -Tpng -Gsize=9,15\! -Gdpi=300 -o graph.png
The graph generated is available at: http://pasteboard.co/2ENQSGA5j.png
@prasadtalasila
prasadtalasila / compiler.js
Created April 19, 2017 11:34
autolab revaluation
# to be run inside tests/functional_tests/ directory after "npm install" command
const argv = require('minimist')(process.argv.slice(2));
const io = require('socket.io-client');
const submit = function submit(host, idNo, currentLab, commitHash, language) {
const req = [idNo, currentLab, commitHash, language];
const socket = io.connect(host);
@prasadtalasila
prasadtalasila / autolab-code-tips.txt
Created April 20, 2017 20:41
autolab-code-tips
To remove restriction on the length of usernames, remove / comment out the lines 311 - 314 of main_server.js. The lines are shown below.
if(id_number.length!=12)
{
flag=0;
}
pending submission block is happening on lines 277-282 of main_server.js
@prasadtalasila
prasadtalasila / gitlab-install.txt
Last active May 16, 2017 06:50
gitlab installation
1) gitlab installation
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-gitlab-on-ubuntu-16-04
generate SSL certs for gitlab and configure gitlab for https
self-signed certificates are a problem for runners; to overcome this problem, follow the instructions on
http://moonlightbox.logdown.com/posts/2016/09/12/gitlab-ci-runner-register-x509-error
a) specify common name default for SSL certs (instruction different from above URL)
$vi /etc/ssl/openssl.cnf
[ v3_ca ]
@prasadtalasila
prasadtalasila / .travis.yml
Last active May 16, 2017 16:40
autolab setup for autolabcli
sudo: required
dist: trusty
language: node_js
node_js:
- "6"
cache:
apt: true
@prasadtalasila
prasadtalasila / alan kay notes
Last active May 25, 2017 18:17
notes from videos
As the complexity increases, architecture dominates materials.
each object should be thought of as having a virtual computer inside.
In networked environment, each object must have a URL and an IP address.
Object solutions need a universal interface language using which an object can interact with another object. HTTP-like REST protocols seem like good candidates for this kind of work. SOAP was actually written for this kind of work, but never took off.
It seems Alan Kay's idea of universal interface language was much broader than HTTP/SOAP.
programming in the large and programming in the small are very very different.
@prasadtalasila
prasadtalasila / Alan Kays Objects
Last active May 30, 2017 08:14
advice to oop students
From paper
An Early History of Smalltalk, Alan Kay
(Ref: http://www.vpri.org/pdf/hc_smalltalk_history.pdf)
Essential principles
1) Everything is an object
2) Objects communicate by sending and receiving messages (in terms of objects)
3) Objects have their own memory (in terms of objects)
Principles that kept on changing between versions of smalltalk
@prasadtalasila
prasadtalasila / scratch pad
Last active May 22, 2017 13:47
scratch pad
Interasting courses
OS using Rust, Prof David Evans rust-class.org/
Jude Nelson, student of Prof Larry Peterson
http://www.cs.princeton.edu/~jcnelson/index.html amazing work