Monday, February 10, 2014

What is Subnet Masking



IP address:
subnet part - high order bits
host part - low order bits
Device identity in network is IP address like our home address and Identity card Number But in real world IPv4 or IPv6 are not enough to address whole device in network here Subnet Masking help to connect whole device with the network and provide unique ip address in networking
what’s a subnet ?
device interfaces with same subnet part of IP address can physically reach each other without intervening router 
recipe

to determine the subnets, detach each interface from its host or router, creating islands of isolated networks each isolated network is called a subnet


Tuesday, February 4, 2014

Make Voice Calculator in c#

To Make it simple our calculation here is the voice calculator  c# code try your self and enjoy


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Speech.Synthesis;
using System.Speech.Recognition;

namespace Add_speak
{
    public partial class Form1 : Form
    {
        SpeechSynthesizer sSyn = new SpeechSynthesizer();
        PromptBuilder pb = new PromptBuilder();
        public Form1()
        {
            InitializeComponent();
        }

        SpeechRecognitionEngine sReg = new SpeechRecognitionEngine();

        private void button1_Click(object sender, EventArgs e)
        {

        }
     

        private void Form1_Load(object sender, EventArgs e)
        {
         
         
            Choices cList = new Choices();
            cList.Add(new string[] { "next","add","1", "2", "3", "4", "5", "6", "7", "8", "9" });
            Grammar gr = new Grammar(new GrammarBuilder(cList));

            try
            {
                sReg.RequestRecognizerUpdate();
                sReg.LoadGrammar(gr);
                sReg.SpeechRecognized +=new EventHandler<SpeechRecognizedEventArgs>(sReg_SpeechRecognized);
                sReg.SetInputToDefaultAudioDevice();
                sReg.RecognizeAsync(RecognizeMode.Multiple);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }

     
        }
        bool ba = false;
        void sReg_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
     
         
            if (e.Result.Text.ToString() == "next")
            {
                this.ActiveControl = textBox2;
                ba = true;
               // textBox2.Text = e.Result.Text.ToString();
            }
         
            else if (e.Result.Text.ToString() == "add")
            {

                int a = Convert.ToInt32(textBox1.Text);
                int b = Convert.ToInt32(textBox2.Text);

                label3.Text = (a + b).ToString();
            }
            else if (ba)
            {
                textBox2.Text += e.Result.Text.ToString();
            }
         

            else
            {
                textBox1.Text += e.Result.Text.ToString();
            }
         
        }

    }
}

Sunday, February 2, 2014

A Simple Server Client Application in Java

A Simple Server Client Application in java using TCP Connection




import java.io.*;
import java.net.*;

public class TCPClient
    {
        public static void main(String[] arg) throws Exception
        {
            String sentence;
            String modifiedSentence;
            BufferedReader inFromUser=new BufferedReader(new InputStreamReader(System.in));
            Socket clientSocket=new Socket("localhost",6789);
            DataOutputStream outToServer=new DataOutputStream(clientSocket.getOutputStream());
            BufferedReader inFromServer=new BufferedReader(new InputStreamReader(clientSocket.getInputStream()) );
            sentence=inFromUser.readLine();
            outToServer.writeBytes(sentence + '\n');
            modifiedSentence=inFromServer.readLine();
            System.out.println("From Server: "+modifiedSentence);
            clientSocket.close();
        }
    }



import java.io.*;
import java.net.*;

class TCPServer
    {
        public static void main(String[] arg) throws Exception
        {
            String clientSentence;
            String capitalizedSentence;
            ServerSocket welcomeSocket=new ServerSocket(6789);
           
            while(true)
            {
                Socket connectionSocket=welcomeSocket.accept();
                BufferedReader inFromClient=new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()) );
                DataOutputStream outToClient=new DataOutputStream(connectionSocket.getOutputStream());
                clientSentence=inFromClient.readLine();
                capitalizedSentence=clientSentence.toUpperCase() +" success "+ '\n';
                outToClient.writeBytes(capitalizedSentence);
            }
        }
    }

Saturday, February 1, 2014

How To Pass value within Android Two Java Pages

When Develop a android application if we want to pass the values and receive the values from another activity



this is the code sent the value to another activivity here i'm sent the value to viewmap 
  

public void onClick(View view)
    {
           // Launching All products Activity
         Intent in = new Intent(getApplicationContext(), ViewMap.class);
        // sending pid to next activity
      in.putExtra("address",strAdd);
        // starting new activity and expecting some response back
       startActivityForResult(in, 100);   
      }



when we receive something from another activity and another main thiunk is both names are want to be same
in.putExtra("address",strAdd) and in.putExtra("address",strAdd);

   Intent i = getIntent();
        // getting product address  from intent
        Bundle extras = getIntent().getExtras();
        if (extras != null) {

            adress=extras.getString("address");
            }

Monday, January 27, 2014

What we Learnd from Industrial Visit

Industrial visit mean spend our few hours in industries during the academic period it will teach so many things to future and can understand industries how to survive in  this competitive world.


Sri Lankan IT industries achieve  remarkable victories in IT field and compete with international industries. IT is the 3rd national income source of Sri Lanka.

in this scenario, I got a chance to visit 5 of IT industries in Sri Lanka IFS, 99X Technology, hSenid Mobile, WSo2, and Virtusa. in my 3rd year academic period. so from this visit, I got a small frame about industries and it's expectation from fresh undergraduates.so I would like share with my followers.

Sri Lankan industries are maintaining Quality in there products so industries expect Quality peoples to work . quality peoples mean they expect some requirements like best results in academic, good communication skills , contribution in university projects , participation in extra curriculum activities like GSoC  and other soft skills.

 From the presentation by industries they mentioned about their requirements, it differs industry to industry some companies expect only the batch top students and they ready to teach technical staff and some companies expect that students want to have some sort of experience in technical staff but not reject the results. another most important aspect is communication skills it's a very important to work in industries . because most customers of industries are from foreign countries , there are so many meetings within industry and industries maintain multicultural within the industry  so employee wants to collaborate with the different background individuals so without communication skill can't survive in the industry. 

 another point is university projects in our university life we never bother about projects but when we face interview it's playing the main role and it's going to show our whole knowledge what we get from our university carrier. so when we select the project we need to satisfy the industrial aspects also and want to do in our own passion .

participation in extra curriculum activities like GSoC is giving the plus point in interview board . there are so many thinks to work on this category like working on open source projects , doing some other individual projects and competitions. maintaining the blogger and LinkedIn also bigger point in the interview board.

Wednesday, December 11, 2013

Display Data as ListView in Android

here we have a string jSon values in in productList arrayList labeled as TAG_PID,TAG_NAME and we are going to display our data as list view
but actually it's View of many activities that activities only have two values here one is TAG_PID,TAG_NAME here so here i'm calling list_item layout for store data one by one
AroundMe.this a name of this class

public void run() {
                    /**
                     * Updating parsed JSON data into ListView
                     * */
                    ListAdapter adapter = new SimpleAdapter(
                            AroundMe.this, productsList,
                            R.layout.list_item, new String[] {
                            TAG_PID,TAG_NAME},
                            new int[] {R.id.pid, R.id.name });
                    // updating listview
                    setListAdapter(adapter);

                }

Wednesday, November 6, 2013

Create Option Menu in Android Application

<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"/>
</menu>



enter a label for your option in
android:title="@string/action_settings
==============================================================

and type this coding in your layout java page
// this for create a menu in the layout
public boolean onCreateOptionsMenu(Menu menu) {

=============================================================

        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.page, menu);
        return true;
    }

  //to catch the click option from the menu to identify which option selected 
// import MenuItem Library also
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
       
        case R.id.action_settings:

//if action_setting id is chosen it will cal newproductactivity class
            Intent i = new Intent(getApplicationContext(), NewProductActivity.class);
            startActivity(i);
            return true;


        default:
            return super.onOptionsItemSelected(item);


        }
    }


===================================================
now we have one option in option menu
 import MenuItem Library also

Call Another Activity From one Activity in Android Development

to Open new activity or page
here is the android code to open new activity from one another activity





package com.one.click;//Package name
//libraries want to import
import android.R.string;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class MainScreenActivity extends Activity{

//Declare a button
Button btnNewProduct;

//declare a layout which is want to open when this class called
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_screen);//here is the place to enter layout name

// Buttons assign the id of the buton in our layout
btnNewProduct = (Button) findViewById(R.id.btnCreateProduct);


// here is the place show when click btnNewProduct buton which class want to open btnNewProduct.setOnClickListener(new View.OnClickListener() {

public void onClick(View view) {
// Launching create new product activity
Intent i = new Intent(getApplicationContext(), NewProductActivity.class);
startActivity(i);

}
});
}

Monday, October 14, 2013

Homologous chromosome

Homologous chromosomes (also called homologs or homologues) are chromosome pairs of approximately the same length, centromere position, and staining pattern, with genes for the same characteristics at corresponding loci. One homologous chromosome is inherited from the organism's mother; the other from the organism's father.[1] They are usually not identical, but carry the same type of information. When mitosis occurs, however, the daughter chromosomes carry exactly the same nucleotide sequence, assuming there are no errors during replication.


In diploid (2n) organisms, the genome is composed of pairs of homologous chromosomes. One chromosome of each homologous pair comes from the mother (called a maternal chromosome) and one comes from the father (paternal chromosome). Homologous chromosomes are involved in the process of meiosis in which they cross over.
Homologous chromosomes are similar but not identical. Each carries the same genes in the same order, but the alleles for each trait may not be the same. In garden peas, for example, the gene for pod colour on the maternal chromosome might be the yellow allele; the gene on the homologous paternal chromosome might be the green allele.
Chromosomes are made of two sister-chromatids, and the chromatids are attached by centromeres

Wednesday, September 11, 2013

What I learned From Presentation

Presentation is the practice of showing and explaining the content of a topic to an audience or learner. Presentations come in nearly as many forms as there are life situations. In the business world, there are sales presentations, informational and motivational presentations, first encounters, interviews, briefings, status reports, image-building, and training sessions.


in this order we must learn how to do a attractive and   meaningful presentation so university environment is the good place to develop our presentation skill and other skills .academic year will give lots and lots of opportunities to us to develop our skills we want to use it.opportunities are always with us we want to find out it.

we did our 1st individual academic presentation in our E-Technology subject about various topics related with E-Technology

we well prepared for the presentation on that day my topic is intellectual property rights that was an very impotent topic because of we are computer science students so we want to know about copyright violation

Before i do my presentation i afraid to do that because i don't have a experience to do that at that time but i believed i can do this presentation well . before i start the presentation i think 20 minuets  time is lot to me and my presentation  but while I'm present i think time is not enough to do a this type of presentation but the content of the presentation is easy to understand but area is wide.