Skip to content

Instantly share code, notes, and snippets.

View Spandyie's full-sized avatar
:octocat:

Spandan Mishra Spandyie

:octocat:
  • Palo Alto Networks
  • San Francisco
  • X @spandyie
View GitHub Profile
@Spandyie
Spandyie / ParticleFilter.py
Created October 11, 2019 03:31
Python code for Particle filter
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 11 00:02:58 2019
@author: spandan
"""
# Please only modify the indicated area below!
@Spandyie
Spandyie / splitString.cpp
Created July 25, 2019 00:13
C++ with takes a string and splits it based on the delimiter character and returns it in vector
#include <vector>
template<typename Out>
void split(std::string& s, char delim, Out result) {
std::stringstream ss(s);
std::string item;
while (std::getline(ss, item, delim)) {
*(result++) = item;
#include <vector>
#include <numeric>
#include <fstream>
#include <iterator>
#include <algorithm>
template<typename T>
class FindPeaks{
private:
std::vector<T> m_input_signal; // stores input vector
@Spandyie
Spandyie / DILoader.py
Last active May 22, 2019 18:27
The following python code compiles damage index files generated by SHMPAtch software into a single spreadsheet. SHMPatch software is Acellent Technologies's proprietary software. #Structuralhealthmonitoring
import os
import sys
import glob
import numpy as np
from pandas import DataFrame
import pandas as pd
def load_data_file():
"""reads the names of the files in data folder"""
path = os.getcwd()
@Spandyie
Spandyie / DG.txt
Created December 23, 2018 03:53
Given a set of job represented by set of nodes, with precedance constraint that specify that certain jobs to be completed before certain jobs are begun, topographical sorting which is based on depth first search gives the schedule of the jobs while respecting all the constraint.
13
0,1
0,6
0,5
2,0
2,3
5,4
6,4
6,9
7,6
@Spandyie
Spandyie / AceData.py
Created August 12, 2018 05:50
The code converts Lamb-wave data loaded from SHM Patch software sold by Acellent Technologies into Python data structure.
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 22 17:33:18 2018
@author: Spandan
"""
from scipy.io import loadmat
import numpy as np
@Spandyie
Spandyie / min-char-rnn.py
Created June 8, 2018 07:08 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.