Skip to content

Instantly share code, notes, and snippets.

@abrarShariar
abrarShariar / activity_selection.cpp
Created October 26, 2016 03:51
activity selection lab algorithms
#include<iostream>
using namespace std;
int* getActivitySelection(int*,int*,int*,int,int*);
void doSwap(int*,int*,int*,int,int);
int main(){
int total_job;
cout<<"Total Jobs: ";
cin>>total_job;
@abrarShariar
abrarShariar / get_magento.sh
Last active October 13, 2016 17:41
Magento qucik start on script
# running these cmd's manually one by one will also do the job
# get necessary php modules for running magento
apt-get install php5-curl php5-gd php5-mcrypt
#set mod_rewrite
a2enmod rewrite
php5enmod mcrypt
#apache restart
/etc/init.d/apache2 restart
#creating a new database for magento
@abrarShariar
abrarShariar / sorting_time.cpp
Created October 2, 2016 19:06
Calculating execution time of different sorting algorithms using clock()
#include<iostream>
#include<ctime>
using namespace std;
void bubbleSort1(int*,int);
void bubbleSort2(int*,int);
void bubbleSort3(int*,int);
void insertionSort(int*,int);
void selectionSort(int*,int);
void doSwap(int*,int*);
@abrarShariar
abrarShariar / test.sh
Created August 27, 2016 17:19
lab test OS
#!/bin/bash
#take input as km
read input_distance
echo $input_distance "km"
d_meter=$(echo $input_distance \* 1000 | bc -l)
echo $d_meter "m"
d_cm=$(echo $d_meter \* 100 | bc -l)
@abrarShariar
abrarShariar / my_brief_interaction_with_R.md
Last active August 28, 2016 13:36
A personal note on the statistical programming language R

My brief interaction with R : the statistical programming language

I started digging into R around August 2016 mostly because at that time I was taking the course - "Statistics and Probabilty" (MAT3103) and I was curious to get a slight taste of actual statistical computations done in research or real world data analysis.

This note mostly contains things I found amazing about R and also the things I disliked about it. A the same time this will also serve as a future reference for myself. Please note that I only had a brief intereaction with the language and barely scratched the surface. And this is not another Python vs. R thing, since I have little or no experience with Python (at this time) so, I won't be able to do justice in comparing them.

This is just my personal take on R

@abrarShariar
abrarShariar / BankersAlgoUtil.h
Last active August 16, 2016 15:32
Banker's Algorithm
/*
header file defining the following matrixes
- ALLOCATION
- MAX
*/
#include<iostream>
using namespace std;
//for available vector
struct Available{
@abrarShariar
abrarShariar / graph_101.cpp
Created August 12, 2016 16:23
Graph implementation using C++
/*
Graph implementation following tutorial http://www.geeksforgeeks.org/graph-and-its-representations/
*/
#include<iostream>
#include<cstdlib>
using namespace std;
//struct for an adjacency list node
struct AdjListNode{
int data;
@abrarShariar
abrarShariar / BST_template.cpp
Created August 7, 2016 13:56
BST implemented using template
/*
implementing BST using template
*/
#include<iostream>
using namespace std;
template<typename Type>class BinarySearchTree{
private:
int treeSize;
int currentSize;
@abrarShariar
abrarShariar / max_heap.cpp
Created July 31, 2016 13:55
MAX HEAP CREATION WITH ARRAY
#include<iostream>
using namespace std;
#define LIMIT 5
int maxHeap[LIMIT];
/*
MAX HEAP CREATION
*/
void insertItem(int,int);
@abrarShariar
abrarShariar / grab.sh
Created July 29, 2016 23:01
shell script to grab the dependencies of binary
#!/bin/bash
#grab and copy dependencies
#get file path
ldd ./YouTube-Player | cut -f2 -d '>' | cut -f1 -d '(' > test
while read -r line || [[ -n "$line" ]];
do
if [ -f $line ]
then