Skip to content

Instantly share code, notes, and snippets.

View tomrockdsouza's full-sized avatar
🏠
Busy

Tomrock D'souza tomrockdsouza

🏠
Busy
View GitHub Profile
@tomrockdsouza
tomrockdsouza / palidrome-number.js
Created July 5, 2017 13:08
Small program to find if a number is a palindrome string in it's decimal form.
function palinum(a){
b=a;
c=0;
while(b!=0){
c*=10;
c+=b%10;
b/=10;
b=Math.floor(b);
}
console.log(c==a);
@tomrockdsouza
tomrockdsouza / manage-files.bat
Created June 28, 2017 18:16
Segregates files based on their type. This helps to manage important folders Like Desktop and Downloads and reduces their load time.
@echo off
if exist "*.aif" mkdir "data/Music"
echo no | move /-Y "*.cda" "data/Music"
if exist "*.cda" mkdir "data/Music"
echo no | move /-Y "*.cda" "data/Music"
if exist "*.mid" mkdir "data/Music"
echo no | move /-Y "*.mid" "data/Music"
if exist "*.midi" mkdir "data/Music"
echo no | move /-Y "*.midi" "data/Music"
if exist "*.mp3" mkdir "data/Music"
@tomrockdsouza
tomrockdsouza / adversarial.c
Created June 2, 2017 13:59
C Implementation of adversarial search ( MIN-MAX )
/**
* Implementation of adversarial search
* Example To Use Program :https://s15.postimg.org/yyh4lhdsr/Adversial.png
*
* Email: engineer.rc1@gmail.com
* @author Tomrock D'souza, St. Francis Institute Of Technology, University of Mumbai, 2017
* @copyright GNU General Public License v3.0
* No reproduction in whole or part without maintaining this copyright notice
* and imposing this condition on any subsequent users.
*/
@tomrockdsouza
tomrockdsouza / PUZZ8.C
Created June 2, 2017 11:27
C Implementation of 8puzzle problem using Heuristic Function
/**
* Implementation of 8puzzle problem using Heuristic Function
* Needed matrix can be changed by altering variable array[9]
* 1 2 3
* 8 0 4
* 7 6 5
*
* Input at the start Example
* Enter values:2 8 3 1 6 4 7 0 5
*
@tomrockdsouza
tomrockdsouza / Scm_matrix.c
Created June 2, 2017 11:07
C Implementation for Matrix Method using Transportation Problem SCM
/**
* @main-author Tomrock D'souza, St. Francis Institute Of Technology, University of Mumbai, 2017
* Email: engineer.rc1@gmail.com
* No reproduction in whole or part without maintaining this notice
* and imposing this condition on any subsequent users.
* Example: https://postimg.org/image/y55004t9z/
*/
#include<stdio.h>
#include<conio.h>
@tomrockdsouza
tomrockdsouza / buffer.c
Last active June 2, 2017 10:21
C Demonstration of Buffer Overflow
/**
* This Program Only Works in DOS-BOX on Turbo C++ Compiler
* To Get DOS-BOX emulator with Turbo C : https://www.google.com/search?q=turbo+C
*
* @author Tomrock D'souza, St. Francis Institute Of Technology, University of Mumbai, 2017
* Email: engineer.rc1@gmail.com
* No reproduction in whole or part without maintaining this notice
*/
#include<stdio.h>
#include<conio.h>
@tomrockdsouza
tomrockdsouza / Kmeans.java
Last active June 2, 2017 09:21
Java Implementation of Kmeans Algorithm on Linear Dataset ( Based on Random Input )
/** The class encapsulates an implementation of the Kmeans algorithm for Linear Dataset
*
* First argument is for Number of Elements
* Second argument is for Start of Randomizer
* Third argument is for End of Randomizer
* Fourth argument is for Number of Clusters
*
* Usage with the command line :
* >java Kmeans 7 10 20 3
* This Means 7 tupples of data will be created
@tomrockdsouza
tomrockdsouza / Kmean2D.java
Last active June 2, 2017 09:02
Java Implementation of Kmeans Algorithm on 2D Dataset
/** The class encapsulates an implementation of the Kmeans algorithm for 2D Dataset
*
* First argument is for Number of Elements
* Second argument is for Start of Randomizer
* Third argument is for End of Randomizer
* Fourth argument is for Number of Clusters
*
* Usage with the command line :
* >java Kmean2D 7 10 20 3
* This Means 7 tupples of data will be created
@tomrockdsouza
tomrockdsouza / Naive.java
Created June 2, 2017 08:14
Java implementation of the Naive-Bayes algorithm ( Play-Tennis Example )
/** The class encapsulates an implementation of the Naive-Bayes algorithm
*
* First argument is for Outlook
* Sunny=2 Overcast=1 Rain=0
*
* Second argument is for Temperature
* Hot=2 Mild=1 Cool=0
*
* Third argument is for Humidity
* High=1 Normal=0
@tomrockdsouza
tomrockdsouza / EvenOddTrans.java
Last active June 2, 2017 06:56
Java Implementation of Asynchronous Mulithreaded Odd-EvenTransposition Sort (Parallel Bubble Sort)
/**
* The class encapsulates an implementation of the Asynchornous Mulithreaded Odd-EvenTransposition
* @contributor Tomrock D'souza, St. Francis Institute Of Technology, University of Mumbai, 2017
* Part of This code is Taken from : www.roseindia.net/java/beginners/arrayexamples/OddEvenTranspositionSort.shtml
* No reproduction in whole or part without maintaining this notice
* and imposing this condition on any subsequent users.
*/
class EvenOddTrans extends Thread {
private int j;
public static final int array[] = {12,9,4,99,120,1,3,10,13};