Posts

Showing posts from July, 2013

Android - GPS Tutorial

How GPS Works from Junho Kim Android GPS Tutorial from Ahsanul Karim

Yarl IT Hub Session on Sales and Marketing

Is there a God In Tamil Dr. Zakir Naik Part 2 of 2

Image

Is there a God In Tamil Dr. Zakir Naik Part 1 of 2

Where did Jesus made a mistake? - A question to Dr. Zakir Naik

Game Entry

*************************************************************************** public class GameEntry{ public String name; public int score; public GameEntry(String n, int s){ name = n; score = s; } public String getName(){ return name; } public int getScore(){ return score; } public String toString(){ return "("+name+","+score+")"; } } ************************************************************************** import java.util.Scanner; public class Scores{ public static final int maxEntries = 10; public GameEntry[] entries; public int numEntries; public Scores(){ entries = new GameEntry[maxEntries]; numEntries =0; } public void setEntry(String name, int score){ GameEntry gE  = new GameEntry(name,score); if(numEntries ==0){ entries[numEntries] = gE; numEntries++; } else if(numEntries >0 && numEntries !=0 && numEntries<=10){ entries[numEntries]

Hole with Random Generator

import java.util.Scanner; public class randomHole{ String[][] holeStore; static int Ncol=5; static int Nrow=3; int token; randomHole(){ holeStore = new String[Nrow][Ncol]; for(int i=0; i<Nrow; i++){ for(int j=0; j<Ncol; j++){ holeStore[i][j] = "Free"; } } } void set_full(int row,int col){ findToken(); boolean valid_token = false; for(int i=0; i<Nrow; i++){ for(int j=0; j<Ncol; j++){ if(holeStore[i][j] == Integer.toString(token)){ set_full(row,col); } else{ valid_token = true; } } } if(valid_token){ holeStore[row-1][col-1] = Integer.toString(token); System.out.println("Your Token is : "+token); } } void set_Null(int row, int col){ holeStore[row-1][col-1] = "Free"; } void findHole(int token){ boolean is_found = false; for(int i=0; i<Nrow; i++){ for(int j=0; j<Ncol; j++){ if( holeStore[i][j].equals(Integer

Hole without random

import java.util.Scanner; public class hole2{ String[][] holeStore; int Ncol=5; int Nrow=3; int token; hole2(){ holeStore = new String[Nrow][Ncol]; for(int i=0; i<Nrow; i++){ for(int j=0; j<Ncol; j++){ holeStore[i][j] = "Free"; } } } void set_full(int row,int col){ findToken(row,col); holeStore[row-1][col-1] = Integer.toString(token); } void set_Null(int row, int col){ holeStore[row-1][col-1] = "Free"; } void findHole(int token){ boolean is_found = false; for(int i=0; i<Nrow; i++){ for(int j=0; j<Ncol; j++){ if( holeStore[i][j].equals(Integer.toString(token))){ int row = i+1; int col = j+1; System.out.println("Your Row is : "+row); System.out.println("Your Colum is "+col); is_found = true;      break; } } } if(is_found == false){ System.out.println("Sorry Your Token Not Found!\nTry Again."); } }

Selection Sort

Image
  these picture shows that the algorithm of the selection sort the code is below in (java) ****************************************************************** public class selectionSort{ public void sort(int[] A){ for(int i=0; i<A.length; i++){ int minIndex =i; for(int j=i; j<A.length; j++){ if(A[minIndex] > A[j]){ minIndex = j; } }    // Swapping the minIndex Element and first element  int temp = A[i]; A[i] = A[ minIndex ]; A[ minIndex ] = temp; } } } ****************************************************************** public class selectionSortDemo{ public static void main(String args[]){ int A[] = {7,3,2,5,1}; selectionSort S = new selectionSort(); S.sort(A); for(int i=0; i<A.length; i++){ System.out.print(A[i]+" "); } } } ******************************************************************************

Bubble Sort in Java

Image
Bubble Sort is a simple sorting algorithm. It repeatedly comparing each of the adjacent pair and swap them like the above animation. 

An A-Z Index of the Bash command line for Linux.

alias Create an alias • apropos Search Help manual pages (man -k) apt-get Search for and install software packages (Debian/Ubuntu) aptitude Search for and install software packages (Debian/Ubuntu) aspell Spell Checker awk Find and Replace text, database sort/validate/index b basename Strip directory and suffix from filenames bash GNU Bourne-Again SHell bc Arbitrary precision calculator language bg Send to background break Exit from a loop • builtin Run a shell builtin bzip2 Compress or decompress named file(s) c cal Display a calendar case Conditionally perform a command cat Concatenate and print (display) the content of files cd Change Directory cfdisk Partition table manipulator for Linux chgrp Change group ownership chmod Change access permissions chown Change file owner and group chroot Run a command with a different root directory chkconfig Sy