Skip to content

Instantly share code, notes, and snippets.

View robodhruv's full-sized avatar
🥑

Dhruv Shah robodhruv

🥑
View GitHub Profile
/*
Pure C code for multi-threaded matrix mutliplication of two
dynamically created and randomly instiated matrices.
Two different mutli-threading strategies are implemented, along
with the non-threaded multiplication kernel for comparison.
The functions are timed using system time.
CS347(M): Operating Systems, IIT Bombay (Autumn 2017)
*/
@robodhruv
robodhruv / udp_listener.py
Created August 27, 2017 13:30
Capture UDP packets on a port in JSON-like format.
# This program captures UDP packets on port identified in the variable
# port_no. The port will remain blocked until the script is killed.
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
port_no = 5555;
class Echo(DatagramProtocol):
@robodhruv
robodhruv / rosbag_extract.py
Last active November 18, 2022 12:40
Script to extract messages on desired topics, and save them in a CSV file. Easy to modify as per requirements.
"""
This script collects data from all the bag files in the directory passed as the first
argument when launching. In particular, it collects the rostopics listed in the
concerned list and generates a CSV file containing the same. The readings are triggered
by the trigger topic.
Author: Dhruv Ilesh Shah
[email protected] | [email protected]
"""
@robodhruv
robodhruv / sim.cpp
Created May 17, 2017 19:01
Multiple ROS publishers and subscribers in a single node
/*
* This can be seen as a sample node with 3 publishers
* and one subscriber, working perfectly. Hope this helps.
* Ignore the specifics, and marker topics etc. The heart of the
* program is the publish/subscribe statement. Full program at:
* https://github.com/PrieureDeSion/radiation-mapping/
*
* Copyright © 2017 by Dhruv Ilesh Shah
* [email protected] | [email protected]
* Robotics Institute, Carnegie Mellon University
@robodhruv
robodhruv / DFS.cpp
Created April 9, 2017 19:30
Depth-First Search on Graph
// C++ program to print DFS traversal from a given vertex in a given graph
#include <iostream>
#include <vector>
using namespace std;
// Graph class represents a directed graph using adjacency vector representation
class Graph {
int V; // No. of vertices
void DFSUtil(int v, bool visited[]); // A function used by DFS
@robodhruv
robodhruv / modelsim_installation.md
Last active July 21, 2024 23:06
Installing ModelSim on Ubuntu

ModelSim Installation issues

Ubuntu 14.xx and above

Ignore this if you have not encountered any issue with the installation and running of ModelSim and Quartus on your system. You are very lucky. (Just Kidding! You have surely had this issue, only sorted.)

Hence assuming you have been following the procedure given in this guide. Most certainly, Quartus will install jsut fine, and so will ModelSim. The issue is in launching due to inappropriate linking etc.

Stage 1

This is the simplest error you would encounter. Navigate to the modelsim_ase folder and run:

@robodhruv
robodhruv / bilayer_NN.py
Last active May 28, 2018 21:52
A simple bi-layer Neural Network to capture the features of XOR!
from numpy import exp, array, random, dot, sum, size, absolute
class NeuralNetwork():
def __init__(self, layer1, layer2):
self.layer1 = layer1
self.layer2 = layer2