This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include "bank.h" | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
static int current_balance; | |
int BalanceFlag = 0; /* 0 for No Activity, 1 for Activity in the last 10 seconds */ | |
pthread_mutex_t BalanceLock, FlagLock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
accel=0 | |
gyro=0 | |
mag=0 | |
exg1_24bit=0 | |
exg2_24bit=0 | |
gsr=0 | |
extch7=0 | |
extch6=0 | |
br_amp=0 | |
vbat=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Read quaternions */ | |
float q0 = float.Parse(values[3]); | |
float q1 = float.Parse(values[4]); | |
float q2 = float.Parse(values[5]); | |
float q3 = float.Parse(values[6]); | |
/* Read Gyro data */ | |
Gx = float.Parse(values[7]); | |
Gy = float.Parse(values[8]); | |
Gz = float.Parse(values[9]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Author Sonik Sharma 26/2/2017 | |
Program to ask the user for a number | |
then print its table from 1 to 10 | |
*/ | |
/* Include files */ | |
#include<iostream> /* includes cout cin */ | |
#include<conio.h> /* conio = console io. includes getch = get character from keyboard */ | |
/* */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Author Sonik Sharma 26/2/2017 | |
Program to ask the user for a number | |
then print its table from 1 to 10 | |
*/ | |
/* Include files */ | |
#include<iostream> /* includes cout cin */ | |
#include<conio.h> /* conio = console io. includes getch = get character from keyboard */ | |
/* */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Author Sonik Sharma 26/2/2017 | |
Hello World program | |
*/ | |
/* Include files */ | |
#include<iostream> /* includes cout cin */ | |
#include<conio.h> /* conio = console io. includes getch = get character from keyboard */ | |
/* My hello world program */ | |
int main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Raju Pengananapuram is a scientist from Chennai working in ISRO. His next project | |
is to create an algorithm for India's first Mars rover and has three days to do it. | |
However he also has to attend his brothers wedding in Trivendrum tomorrow. | |
He sits in his office worried. As he looks outside his window, he comes up with an idea. | |
He will ask one of his students, Sonik Sharma to help him with this work. | |
Your task is to calculate the distance the mars rover will travel given a velocity using | |
the formula distance = time * speed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Raju Pengananapuram looks at Sonik's program and finds it very useful. | |
However he realized that NASA's scientists want time to be between | |
1 seconds and 21 seconds with 2 second intervals (1, 3, 5... 21) | |
and the European Space Agency wants time between 30 and 180 seconds | |
with 30 second intervals (30, 60, 90... 180). | |
Recreate the program using while loops. Ask Raju for velocity, start time, end time | |
and interval. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Hello Mr. Raju Pengananapuram, please enter the velocity for MRover: 231.15 | |
Please enter start time = 1 | |
Please enter end time = 21 | |
Please enter increment = 2 | |
Results for distance calculation for MRover: | |
Time Distance Travelled (metres) | |
1 231.15 | |
3 693.45 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# imports | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Load the data | |
df = pd.read_csv("slope-lownoise.txt", sep='\t', header=None) | |
labels = np.asarray(df[0]).reshape((len(df[0]),-1)) | |
data = np.asarray(df.iloc[:,1:]) |
OlderNewer