Search

androidtour

Category

Computer

MicroController Progamming Tutorial[Link]]

https://www.youtube.com/user/AllAboutEE/playlists

http://www.mikroe.com/chapters/view/15/chapter-1-programming-microcontrollers/

Advertisements

Android Latest Technology

https://developers.google.com/cardboard/overview

Ubuntu Linux Unix

Ubuntu is a computer operating system based on the Debian Linux distribution and distributed as free and open source software, using its own desktop environment. It is named after the Southern African philosophy of ubuntu (“humanity towards others”). As of 2012, according to online surveys, Ubuntu is the most popular Linux distribution on desktop/laptop personal computers, and most Ubuntu coverage focuses on its use in that market.

Ubuntu is sponsored by the UK-based company Canonical Ltd., owned by South African entrepreneur Mark Shuttleworth. Canonical generates revenue by selling technical support and services related to Ubuntu, while the operating system itself is entirely free of charge.KrnDf

Unix was created in 1969 by Dennis Ritchie (also the creator of C programming language) & Ken Thompson

Slowly, an open operating system standardisation was thought of that led to the birth of POSIX (Portable Operating System Interface). The first POSIX standard was published in 1988

Then came 1991, when a college student in University of Helsinki decided to write his own operating system because he wanted a “powerful & Free Unix system“. His name was Linus Torvalds and he developed the 1st version of this new OS ( LINUX ) that was powered by Intel’s 80386 microprocessor (a 32 bit microprocessor launched in 1985)

Unlike other Unix systems, Linux is not a direct descendant of Unix source code. It implements Unix Application Programming Interface (API) defined by POSIX, but is classified as “Mostly POSIX-compliant” & not “Fully-POSIX compliant”

Difference between Unix and Linux

http://www.cyberciti.biz/faq/what-is-the-difference-between-linux-and-unix/

http://www.diffen.com/difference/Linux_vs_Unix

For Time Line,

http://futurist.se/gldt/

Watch this Video,

https://www.youtube.com/watch?v=GsHh2wfy_-4

Difference

  1. Apache tomcat server — Apache HTTP Server
  2. Server –Web server– Application Server –Database Server
  3. HTTP–HTTPS
  4. DBMS–RDBMS
  5. SQL–PL/SQL–NOSQL
  6. JSP–SERVLET
  7. Procedural Language–Object-oriented language
  8. JSON–GSON
  9. JQUERY–AQUERY–QUERY
  10. thread–asyntask

Best tutorial for learn Amazon webservices

http://meta-guide.com/videography/100-best-amazon-aws-tutorial-videos/

Best way to design good api

https://www.youtube.com/watch?v=aAb7hSCtvGw

Download Lecture PDF

Subject and link for Interview of Computer Engineering

————–For beginner/fresher—————

C Basic

Simple Program logic

Pointer

Structure

JAVA

SQL

http://www.studytonight.com/dbms/

PL/SQL

DataStructure

DBMS

http://blog.sqlauthority.com/sql-server-interview-questions-and-answers/

Algorithm

http://www.programcreek.com/2012/11/top-10-algorithms-for-coding-interview/

For understand algorithm basic

http://gonitsora.com/algorithm-types-and-classification/

JDBC

JSP

Servlet

JAVAbeans

Android Architecture

Android Basic

—————–Some advanced topic for JAVA developer———————

Object-oriented design in terms of Programming

Dependency Injection

Scalability in Programs

 

 

 

Best site for learn free cyber security

https://www.cybrary.it/

One of Best site for learn computer technology and practical example

http://slogix.in/project-titles-in-mobile-apps/index.html

http://slogix.in/project-titles-in-big-data/index.html

Program in JAVA for remove null production from CFG

NULL.txt

S@ABAC
A@aA/#
B@bB/#
C@c

 

 

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cd;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;

/**
*
* @author soham
*/
public class null_removal {

static class OutputPrint {

void print() {
System.out.println();
}

void print(String msg) {
System.out.print(msg);
}

void print(Character c) {
System.out.println(c);
}

void print(StringBuilder c) {
System.out.println(c);
}

}

public static void main(String[] args) throws FileNotFoundException, IOException {
OutputPrint op = new OutputPrint();

byte[] datainBytes;
try (DataInputStream dis = new DataInputStream(new FileInputStream(“file/null.txt”))) {
datainBytes = new byte[dis.available()];
dis.readFully(datainBytes);
}
String content = new String(datainBytes, 0, datainBytes.length);
String input = content;
//Split data as per new line
String lines[] = input.split(“\\r?\\n”);
StringBuilder[] sb = new StringBuilder[lines.length];
//Store data in StringBuilder
for (int i = 0; i < lines.length; i++) {
sb[i] = new StringBuilder(“”);

char cm[] = lines[i].toCharArray();
for (int z = 0; z < cm.length; z++) {
if (cm[z] == ‘#’) {
sb[i].deleteCharAt(z – 1);
} else {
sb[i].append(cm[z]);
}
}
//op.print(sb[i]+”\n”);
}
//Store nonterminal which contain null in production
MyStack theStack = new MyStack(10);
for (String lin : lines) {
//op.print(lin);
if (lin.contains(“/”)) {

String[] bits = lin.split(“@”);
// TODO: Validate that there are exactly two parts
String first = bits[0];
String second = bits[1];
String production[] = second.split(“/”);
for (String pro : production) {
add_null(pro, theStack, first);
}
} else {
String[] bits = lin.split(“@”);
// TODO: Validate that there are exactly two parts
String first = bits[0];
String second = bits[1];
add_null(second, theStack, first);
}
}
//loop until stack not empty
while (!theStack.isEmpty()) {
Character value = theStack.pop();
//op.print(“Pop Character ” + value);
int k = 0;
for (StringBuilder pro : sb) {
printOutput(pro, op, value, sb, k);
k++;
}
op.print();
}
for (StringBuilder d : sb) {
op.print(d.toString() + “\n”);
}
}
//Ending Main Code , Method Implementation Start now

//for push non terminal which contain null
public static void add_null(String pro, MyStack theStack, String first) {
//op.print(first, pro);
if (pro.equals(“#”)) {
//op.print(“Found Null”);
theStack.push(first.charAt(0));
}
}

//Method for process and replace the RHS of production
public static void printOutput(StringBuilder pro, OutputPrint op, Character value, StringBuilder[] sb, int k) {
int q = k;
String[] bits = pro.toString().split(“@”);
// TODO: Validate that there are exactly two parts
String first = bits[0];
String second = bits[1];
StringBuilder h = new StringBuilder();
//op.print(“Second “+second+”\n”);
if (second.contains(“/”)) {
String production[] = second.split(“/”);
int r = 0;
ArrayList<Integer> number = new ArrayList<>();
for (String sec : production) {
char ch[] = sec.toCharArray();
//for two or more character value
for (int l = 0; l < ch.length; l++) {
if (ch[l] == value) {
r++;
number.add(l);
}
}
//      op.print(“Total Number of ch “+r+”\n”);
if (r > 1) {
for (int l = 0; l < r; l++) {
for (int j = 0; j < sec.length(); j++) {

if (j == number.get(l)) {

} else {
h.append(ch[j]);
//            op.print(“Append Ch “+ch[j]+”\n”);
}
}

appendString(sb, q, h, op);
if (l == r – 1) {
for (int j = 0; j < sec.length(); j++) {
if (ch[j] == value) {
} else {
h.append(ch[j]);
// op.print(“Append Ch “+ch[j]+”\n”);
}
}
appendString(sb, q, h, op);
}
}
} else {
if (sec.contains(String.valueOf(value))) {
for (int j = 0; j < sec.length(); j++) {
if (ch[j] == ‘#’ || ch[j] == ‘/’ || ch[j] == value) {
} else {
h.append(ch[j]);
//op.print(“Append Ch “+ch[j]+”\n”);
}
}
appendString(sb, q, h, op);
}
}
r = 0;
number.removeAll(number);
}
q++;
} else {
if (second.contains(String.valueOf(value))) {
for (int j = 0; j < second.length(); j++) {
char ch[] = second.toCharArray();
if (ch[j] == ‘#’ || ch[j] == ‘/’ || ch[j] == value) {
} else {
h.append(ch[j]);
//       op.print(“Append Ch “+ch[j]+”\n”);
}
}
appendString(sb, q, h, op);
} else {
//   op.print(sb[q]);
}
}
}

//function for append the String
public static void appendString(StringBuilder[] sb, int q, StringBuilder h, OutputPrint op) {
// sb[k].append(“/”);
sb[q].append(“/” + h);
h.delete(0, h.length());
// op.print(sb[q]);
}

//Method for Stack
public static class MyStack {

private final int maxSize;
private final Character[] stackArray;
private int top;

public MyStack(int s) {
maxSize = s;
stackArray = new Character[maxSize];
top = -1;
}

public void push(Character j) {
stackArray[++top] = j;
}

public Character pop() {
return stackArray[top–];
}

public Character peek() {
return stackArray[top];
}

public boolean isEmpty() {
return (top == -1);
}

public boolean isFull() {
return (top == maxSize – 1);
}

}
}

Installation of Hadoop in VMplayer in windows 8.1

Refer this for more info
http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/SingleCluster.html

Install ubuntu in vmware player

install JDK/JRE using command line
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
For JDK
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
For JRE
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Bydefault
JDK is installed in /usr/lib/jvm
for check wheather JDK is installed or not write java -version
http://www.howtogeek.com/191427/how-to-find-out-if-java-is-installed-in-ubuntu-and-how-to-install-it/

Download hadoop from this link
http://www.eu.apache.org/dist/hadoop/common/

Create hadoop folder in home directory and extract hadoop.tar in this folder

write sudo gedit /etc/profile
add this line in last of this file

JAVA_HOME=/usr/local/java/jdk1.8.0-60
PATH=$PATH:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.8.0-60
PATH=$PATH:$JRE_HOME/bin
HADOOP_INSTALL=/home/hadoop/hadoop-1.2.1
PATH=$PATH:$HADOOP_INSTALL/bin
export JAVA_HOME
export JRE_HOME
export PATH

sudo update-alternatives –install “/usr/local/java” “java” “/usr/local/java/default-java/bin/java” 1

bin/hadoop jar hadoop-examples-*.jar grep input output ‘dfs[a-z.]+’

For remove JDK
http://ajgupta.github.io/ubuntu/2014/09/18/Completely-uninstall-Java-from-Ubuntu-14.04/
sudo apt-get install ssh

open conf/core-site.xml
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>

mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>

open hadoop-env.sh
change JAVA_HOME /usr/local/java/jdk1.8.0_60
make sure # must be removed

install ssh and rsync

setup password key and run two command from first link of thisa artical

goto hadoop folder and write
bin/hadoop namenode format

for start all node and process regarding hadoop
bin/start-all.sh

jps is used for show the running process
jps is a command

bin/hadoop fs -put conf input

for install cludera installtion
http://pyfunc.blogspot.in/2012/05/hadoop-pseudo-cluster-installation.html

for kill the process on port
sudo kill `sudo lsof -t -i:9000`

netstat -nlp
for show the process

Find first( ) from CFG using JAVA

Under Testing….

UBUNTU update software command

Update software using command line

sudo apt-get update
sudo apt-get dist-upgrade

How to install ns in ubuntu
sudo apt-get install ns2

Easy way to learn Hadoop on windows

http://www.hadoopwizard.com/install-hadoop-on-windows-in-3-easy-steps-for-hortonworks-sandbox-tutorial/

Hortonworks

Hortonworks is a business computer software company based in Santa Clara, California. The company focuses on the development and support of Apache Hadoop, a framework that allows for the distributed processing of large data sets across clusters of computers.

http://hortonworks.com/

Cloudera

Cloudera Inc. is an American-based software company that provides Apache Hadoop-based software, support and services, and training to business customers.

Cloudera’s open-source Apache Hadoop distribution, CDH (Cloudera Distribution Including Apache Hadoop), targets enterprise-class deployments of that technology. Cloudera says that more than 50% of its engineering output is donated upstream to the various Apache-licensed open source projects (Apache Hive, Apache Avro, Apache HBase, and so on) that combine to form the Hadoop platform. Cloudera is also a sponsor of the Apache Software Foundation.

http://www.cloudera.com/content/cloudera/en/home.html

How to remove Unit production from CFG using JAVA

package cd;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
/**
*
* @author Soham Navadiya
*/
public class Unit_Production {
static int caseCheck(String c){
if(c.matches(“[A-Z]”)){
return 1;
}
else if(c.matches(“[a-z]”)){
return 2;
}
else{
return 0;
}
}
public static void main(String []args) throws FileNotFoundException, IOException{

int check;
ArrayList<String> terminal=new ArrayList<String>();
ArrayList<String> nonterminal=new ArrayList<String>();

DataInputStream dis = new DataInputStream (new FileInputStream (“file/production.txt”));
byte[] datainBytes = new byte[dis.available()];
dis.readFully(datainBytes);
dis.close();
String content = new String(datainBytes, 0, datainBytes.length);
String input = content;

String lines[] = input.split(“\\r?\\n”);

Character [][]production=new Character[10][10];
int k=0;
ArrayList<Integer> len=new ArrayList<Integer>();
for(String i:lines){
len.add(i.length());
//System.out.println(“Production:”+i+”—Length: “+i.length());
for(int j=0;j<i.length();j++){
char[] chara=i.toCharArray();
production[k][j]=chara[j];
//System.out.print(production[k][j]);
}
//  System.out.println();
k++;

/*check=caseCheck(i);
if(check==1){
nonterminal.add(i);
System.out.println(“Non terminal: “+i);
}
else if(check==2){
terminal.add(i);
System.out.println(“Terminal: “+i);
}*/
}

for(int i=0;i<len.size();i++){
//System.out.print(“Length is: “+l+”\n”);
for(int j=0;j<len.get(i);j++){
// System.out.print(production[i][j]+”|”);
if(j==0){
check=caseCheck(production[i][j].toString());
if(check==1){
nonterminal.add(production[i][j].toString());
//System.out.println(“Non terminal is:” +production[i][j]);
}
}
}
}
String firstSubString = null;
String secondSubString;
for(int i=0;i<len.size();i++){

String ln2=lines[i].substring(0, lines[i].indexOf(“@”));
String ln=lines[i].substring(lines[i].lastIndexOf(“@”) + 1);

//System.out.println(“Left Part part is “+ln2);
//System.out.println(“Right part is”+ln);

if(ln.length()==1){
int h=check(ln,nonterminal);

if(h==0){
System.out.println(ln2+” @ “+ln);
}

if(h==1){

System.out.print(“Replace with “+ln2+” @ “);
//System.out.println(“Unit Production is “+ln);
//System.out.println(“Left Part part is “+ln2);

for(int p=0;p<len.size();p++){

String[] split = lines[p].split(“@”);

firstSubString = split[0];
secondSubString = split[1];

//char c=production[p][0];

if(firstSubString.equals(ln)){

System.out.println(secondSubString);
//System.out.println(“You have to Replace with “+secondSubString);

}
}
//System.out.println(“Left part is “+firstSubString);
//System.out.println(“Right part is “+secondSubString);
}

}
else{

System.out.println(ln2+” @ “+ln);
}

//  System.out.println();
}
// System.out.println(“After @ Length of String “+ln.length());
// System.out.println();
// System.out.println(“———–“);
/*
String example = “A@bCd”;
System.out.println(example.substring(example.lastIndexOf(“@”) + 1));
*/
}
static int check(String c,ArrayList<String> arr){
if(testAllUpperCase(c)){

if(arr.contains(c)){

return 1;
}
else
{
return 2;
}

}
else{
return 0;
}
}

public static boolean testAllUpperCase(String str){
for(int i=0; i<str.length(); i++){
char c = str.charAt(i);
if(c >= 97 && c <= 122) {
return false;
}
}
//str.charAt(index)
return true;
}
}

Protected: Object oriented design interms of Programming ( Very usefull for develop the Efficient Software)

This content is password protected. To view it please enter your password below:

Create a free website or blog at WordPress.com.

Up ↑