Friday, December 25, 2015

Python Basics 01 - Hello World Application


Hello There!

Today we are going to develop a Hello World application using Python Programming Language.

Python is a widely used general purpose, high level programming language. Its syntax allows programmers to express concepts in fewer lines of code.

First of all to begin Python programming you should have to install Python to your computer. You will be able to download the Python Setup from the following link.
https://www.python.org/downloads/

After downloading and installing Python to your computer open your notepad or any text editor which you have installed in your computer.

Now lets write the "Hello World!" application using python.

print("Hello World!")

After typing the code you have to save the text file using ' .py 'extension. It is mandatory to save the file using .py extension.

After saving the file start your command prompt and go to the directory where you have saved the python file.
Then type:
python <filename>.py

Example : python helloWorld.py

Then Python compiler will compile and run the code. You will be able to see the output in the command prompt.

Let's meet with another tutorial.

Past Topics:-


Friday, November 6, 2015

GZIP with PHP



Hello there!

Today we are going to talk about GZIP compression with PHP.

GZIP is a compression method used by web servers to compress the content of a web page and send it to the client(web browser). Using this more bandwidth will be saved and the web pages are loaded faster.
But the problem is most of the web developers are not aware about it.
Google, Yahoo and Facebook are some examples for websites that use GZIP to compress web page contents.

First of all you should know that GZIP is an compression method, not an encryption method.
Most of the web servers and browsers support GZIP.
GZIP is actually a file format which is used for file compression and decompression. When a web server receive an page request from a client web server will send the page details as in the actual size of the page. (sometimes this page will be 100 KB large)
When a web server which uses GZIP receive an page request web server will use GZIP and compress the web page so that the web page size will be reduced. This will help user to load the web pages faster and save the bandwidth.

Adding GZIP to your web page is very simple and easy., you all have to do is add some simple line of code to your web pages.

Copy and paste the following code snippet to the very beginning of your web page.


<?php ob_start("ob_gzhandler"); ?>

Now your web page will be served to the user faster.


Comment for any questions, suggestions, compliments or complaints.

Past Topics :-

Sunday, October 25, 2015

Connecting Online Database to a Java Application



Today we are going to talk about connecting your java application to a online database.
It is very similar to connecting a offline database which is in your computer.

First of all you have to go to your control panel.

Then click on the Remote MySQL. Then you will be asked to add an access host. You  can enter the IP address of the computer that you are going to access the database. If you are accessing the database using a dynamic IP address, then you are allowed to enter percentage sign (%).
It will allow any IP address to access the database. (This is considered as a security risk)

Well, after you adding the access host, you can start connecting the java application to the database.


Now select the database driver and select connect using from the list.


Enter the correct data to the fields and click next and then finish.

Connecting to the online database is now completed. Retrieving and updating data is same as java offline databases.

Hope you got it correctly.
Please comment any questions.

Past Topics:-


Friday, September 25, 2015

Notice : Voila



How are you today?

Today this post is about to inform you about a new social media and online chatting website. Actually it was developed by me. So you are welcome to try it.

http://voilalk.com

Here is the link, experience the website and let me know what you think.

Thank You!

Wednesday, September 23, 2015

Creating Online Real-Time Chat Application in PHP and JavaScript




Hey guys, how are you today?
Today we are going to create a Simple Real-Time chat application using PHP and JavaScript.

Let's assume that we have created a suitable database. Following are the details of the database that i have created for the demo application.
Database Name - DemoChat
Table Name - ChatTbl
Column 1 - User
Column 2 - Message

Now we are good to go.

First we have to create the user interface for the chat application.
Here is the sample code:-


<html>
<head><title>Chat Application</title></head>
<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script>
function submitChat(){
if(form1.uname.value==""||form1.msg.value==""){
alert("Fill all fields!!");
return;
}



var uname = form1.uname.value;
var msg = form1.msg.value;
var xmlhttp = new XMLHttpRequest();

xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById('chatLog').innerHTML = xmlhttp.responseText;

}
}
xmlhttp.open('GET','insert.php?uname='+uname+'&msg='+msg,true);
xmlhttp.send();
}

//jquey lines 
$(document).ready(function (e){
$.ajaxSetup({cache:false});
setInterval(function(){$('#chatLog').load('logs.php');},2000);
}
)

</script>

<body>
<form name="form1">
Enter chat name : <input type="text" name="uname"/>
Your Message : <textarea name="msg"></textarea><br/>
<a href="#" onclick="submitChat()">Send</a><br/><br/>



<div id="chatLog">
This is the Chat LOG
</div>
</form>
</body>
</html>

Well let's see the code in detail.
In the first script tag we have added a jQuery file which will be needed in the code.
Then the function submitChat() is created. In this function first it checks whether the user name and the message fields are filled by the user. If not it will create an alert.

If these fields are not empty, the contents of these fields are assigned to JavaScript variables.
Then XML and HTTP object is created as follows.
var xmlhttp = new XMLHttpRequest();
This will allow us to load a PHP code without reloading the page.

Later,
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById('chatLog').innerHTML = xmlhttp.responseText;

}
}
xmlhttp.open('GET','insert.php?uname='+uname+'&msg='+msg,true);
xmlhttp.send();
}

In this code it sends the user name and message content to a PHP page named insert.php.

Then,
$(document).ready(function (e){
$.ajaxSetup({cache:false});
setInterval(function(){$('#chatLog').load('logs.php');},2000);
}
)

In this code it runs the code in logs.php and prints the content inside the div tag where the id is equal to chatLog. And refreshes only the content of that particular div tag in every 2000 mili-seconds.

Code after the <body> tag is plain HTML, so I hope you will understand it.


Now let's look at the insert.php file.
Here is the sample code:-

<?php
$uname = $_REQUEST['uname'];
$msg = $_REQUEST['msg'];

//create DB connection and select DB
#Hope you know how to connect to a database and select the database in PHP
#If not please refer Connecting Database in PHP

mysql_query("INSERT INTO ChatTbl VALUES('$uname','$msg');");

?>

In this code it will insert or save the values what the user enters to the database. This code will run when the user hits the SEND link in the user interface.

Now let's look at the logs.php file.
Here is the sample code:-

<?php

//create DB connection and select DB
#Hope you know how to connect to a database and select the database in PHP
#If not please refer Connecting Database in PHP

$result = mysql_query("SELECT * FROM ChatTbl");//order by ACSC

while($row = mysql_fetch_array($result)){
echo($row['User'].":".$row['Message']);
}
?>

In this code it selects the content of the table ChatTbl and prints to the user interface.

Hope you got it correctly. Please comment for the questions.

Past Topics:-


Like Us on Facebook:-


Comment Box is open for your Ideas, Complaints, Questions, Suggestions and Comments.

Sunday, August 9, 2015

File Handling in VB.NET



Today we will look in to file handling in VB.NET.
File handling in VB.NET is not hard to understand and learn because it is very similar to file handling in other programming languages. Though the syntax of the language is different from most of the programming languages.

There are many VB.NET I/O stream classes available.

  • BinaryReader - Reads primitive data from a binary stream
  • BinaryWriter - Wrires primitive data in binary format
  • StreamReader - Used to read characters from a byte stream
  • StreamWriter - Used to write characters to a byte stream
There are many other I/O classes available for various purposes.

In order to handle files (read or write to) we have to import the IO class first as follows.

Imports System.IO

Now environment to read and write to files is set.

Let's read from a file to our VB.NET program.
In order to do this we have to create a new object from StreamReader class as shown below.

Dim readObject As New StreamReader("E:/new file.txt") 

StreamReader object needs a one argument in order to create the object. The argument should contain the file path that we need to read from.

Now we can read the file using methods available in the StreamReader class through the object  that we have created recently as follows.


 Dim read As String = readObject.ReadToEnd()
 Dim readFile As String = readObject.ReadLine()

There are many methods available that we can use, above shown are two methods available in the class.

Let's write to a file from our VB.NET program.
In order to do this we have to create an object from StreamWriter class as shown below.

Dim writeObject As New StreamWriter("E:/new file.txt", True)

StreamWriter object needs two arguments to create an object.One argument is same as the StreamReader, it requires the file path that we want to write to. Other argument is true or false. If it is true StreamWriter will append the file. If other argument is false StreamWriter will replace the contents of the file. The default argument is set to false.

writeObject.Write("This text will be written to the file")
writeObject.WriteLine("This text line will be written to the file")

After writing to a file always remember to use the flush method.

writeObject.flush()

With using this method that we can be sure that all the changes that we have done to the file have saved to the hard drive of the computer. Otherwise the changes that are still recorded in the RAM will not be saved to the file.

After opening a file (to read or write to) always remember to close the file. Otherwise it will use the system resources even after the program is closed or when we do not need them.
You can close the file using close() command as follows.

writeObject.close()

Past Topics:-
Like Us on Facebook:-



Comment box is open for your Ideas, Suggestions, Comments and Complaints...!

Wednesday, July 1, 2015

File Handling in Java



Hey Guys, today we will look in to file handling in Java.
File handling in Java is not very hard to understand, it's vary similar to file handling in other programming languages.

Well, let's read a file using Java first. To read a file in Java we can use 2 classes which are in-built.

  • FileReader Class - reads character by character
  • BufferedReader Class - reads word by word

When we are using FileReader Class to read a file,

First of all we have to create a object from the File class to open the file.
File myFile = new File("myTxt.txt");

Then we have to create a object from the FileReader class in order to read the content in the file.
FileReader reader = new FileReader(myFile);

There we have created all the relevant objects. Now let's read the content of the file to an character array.
char myArr[] = new char[200];
reader.read(myArr);



When we use BufferedReader Class to read a file,
First we have to create File and FileReader class objects.
File myFile = new File("myTxt.txt");
FileReader reader = new FileReader(myFile);
BufferedReader buff  = new BufferedReader(reader);

or else we can do the same process using a single line.
BufferedReader buff  = new BufferedReader(new FileReader(new File("myTxt.txt")));

Now we can read line by line using the readLine function().
String line=null;
while((line=buff.readLine())!=null){ //<--- this will check whether the file pointer has reached the end of the file
System.Out.Println(line);
}



Now let's see how to write to a file using Java.
Same as the reading there are 2 classes that we can use to write in to a file.

  • FileWriter - writes character by character to the file
  • BufferedWriter - writes word by word to the file
When we use FileWriter class to write in to a file,
First we have to create an object from the File class and then Should create an object from the File Writer class.
I will sue the short form here to create objects form a single line.
FileWriter writer = new FileWriter(new File("myTxt.txt");

Then we can use write() function to write in to the file.
writer.write("This text will be written in to the file");

We can also use the BufferedWriter class to write in to the files.
BufferedWriter bwriter  = new BufferedWriter(new FileWriter(new File("myTxt.txt")));


After writing to a file it is advisable to use the flush() function, because it will save the data in the memory which is still not written in to the file.
beriter.flush();



After reading or writing to a file(after opening a file) always remember to close the file after using it. close() function is used to close opened files in java. If not it will reserve system resources such as memory and will slow down the program. Maybe degrade the performance of the system.



Past Topics :- 
Like Us on Facebook :-




Comment Box is open for your Comments, Suggestions, ideas and complaints..!

Friday, June 26, 2015

File Handling in C++



Hey, what's up guys??

Today we will look in to File Handling in C++.

Before read or write to files we must know what are the classes or the header files that we must include to our program.
There are three classes:

  • ofstream = Class to write in files
  • ifstream = Class to read from files
  • fstream  = Class to both read and write from and to files
Including the header file to the program can be done as follows:
#include<fstream>

After including the header file we can use all the methods declared in that class. Since C++ is object oriented we must have to create a object from one of the above classes to use the functions.

At first we are using the class to read a file, so its better to create the object from the ofstream class.

ofstream MyObj; //Created a object named MyObj

After creating the object we must first use the open() function to open the file for reading.(or writing)
This function accepts two parameters. First on is the file name and second one is the mode that we want to open the file. Second parameter is optional.

MyObj.open("myTextFile.txt"); //opened a text file named myTextFile.txt in the readable form

After opening the file in the readable format lets write something to the file. First lets define a string variable named myContent. And let's read from the file.

String myContent;
MyObj>>myContent; //Reading the whole file content  and storing in a single string variable

Or else we can read the file line by line.

while(getline(MyObj,myContent)){
    cout<<myContent<<endl;  //this will print the content in the file line by line to the screen till the end of the line reaches
}


Well there, we read the content from a file. Let's try to write in to a file in C++.

To write to a file, first we must open the file in writable mode. We can do it by creating an object from the ofstream and opening the file using open() method.

ofstream myObj2; //created an object using ofstream class
myObj2.open("myTextFile.txt"); //opened a text file named myTextFile.txt in the writable mode




After opening the file in writable form we can simply pass values or variables and write values and content to the file.

myObj2<<"This line will be added to the text file"<<endl;

myObj2<<myContent<<endl;

To check whether the file is still open in the program we can use is_open() method. This method does not accept any arguments and will return a boolean value.

if(myObj2.is_open()){
    //body of the if condition
}


After we read and write and using the file we must close the file from our program. Otherwise it will hold some memory space and will make the program inefficient and affect the system resources badly. To close the filr from the program we can use close() function in C++.

myObj2.close();

These are the basic functions used in file handling in C++.



Past Topics:-
Like Us on Facebook :-



Comment box is open for your comments, ideas, suggestions and complaints!

Sunday, June 21, 2015

File Read and Write in PHP


Hello guys, how are you?

Today we will look in to the File Operations in PHP.

Whether to read or a write to a file, first of all we must open the file using PHP. The function that we use to open a file in PHP is fopen() function. This function accepts two parameters:-

  • file path
  • the mode that the file should be opened
$fp = fopen("input.txt", "r");

Here file is opened and assigned to a variable. This variable is usually called as file pointer. This will make our operations easy.



Modes that we can open a file :-
  • r - read only
  • w - write only(existing data will be re-written)
  • a - write only(new text will be added to the end of the existing text)
  • x - creates a new file for write only
  • r+ - opens a file for read and write
  • w+ - opens a file for read and write
  • a+ - opens a file for read and write
  • x+ - creates a new file for read and write

After opening the file in read  mode we can read the text which is existing in the file and assign it to a PHP variable. To do that we can use fread()  function. This function accepts two parameters.
  • file path
  • maximum bytes to read
$content = fread("input.txt",1024);

Or else we can use the file pointer variable as parameter. If we use that as a parameter it will read the file till it reach the end of the file.

$content = fread($fp);

If we want to read a single line of the file we can do it using fgets() function. This function also accepts two parameters. 
  • file path
  • file open mode
$content = fgets("input.txt","r");
$content = fread($fp);

In some context we maybe want to check whether the file pointer has reached the end of the file. So we can do it using feof() function. This function accepts one parameter which is the file pointer variable.

if(feof($fp)){
     echo("End of the file has reached!");
}

After opening a file for reading or writing purpose we have to close the file. Otherwise the file pointer will keep the file open and that will lead for errors and unexpected problems. To close a file we can use fclose() function. This function accepts one parameter which is also the file pointer variable.

fclose($fp);

These are the basic and most used file handling functions in PHP and there are plenty of more functions available to do various tasks.
Below link will show some more functions :-


Past Topics :-
Like us on Facebook:



Comment box is open for your comments, ideas and suggestions!

Friday, May 8, 2015

Creating PDF Reports and Files in PHP


Hello everyone, how are you guys??
Sorry for my silence in past few days, had some projects and assignments to complete!

Well this article will focus on creating a PDF report or a PDF file using PHP.

So first of all we have to download the FPDF support library to generate PDF files. Visit  http://www.fpdf.org/ and go to downloads and download the latest version.

Well now we are ready to go.

Step 1 :- Import the library to our PHP file.
              include("includes/fpdf/fpdf.php");

Step 2 :- In order to use the functions in FPDF library we have to create a object of fpdf class.
                         $pdf = new FPDF('P','pt','A4');
 In here $pdf is our object name and P is for the page orientation, A4 is for page size.

Step 3 :- Now we have created the object and we have to open the pdf file.
                        //opening the pdf file
              $pdf->Open();

Step 4 :- Then add the first page of the PDF file.
                       //add the first page
             $pdf->AddPage("P","A4");

Step 5 :- Set the X and Y axis for the content in the PDF file
             //setting y axis through a variable
             $Yax = 30;
             $pdf->SetY($Yax);
             //setting X axis directly
             $pdf->SetX(40);



Well now, we have created our pdf file. Remember not to add PHP closing tag in the PDF generating code.

Lets see some functions that we can use to add some text and decorate them.

//setting title
$pdf->SetFillColor(234,44,234);
Above lines will add background color to the text.

//setting font $pdf->SetFont('Arial','B',25);
Above lines will define the font that we want our text to be printed in the PDF file

//adding the text to the pdf file $pdf->Cell(0,30,"Book Catalogue",0,1,"C",1);
Above lines will add the text or the line of text to the PDF file. 
$pdf->Cell(a,b,c,d,e,f,g);
a - X value of the position
b - Y value of the position
c - text that we want to print
d - border value of the text cell
e - line number
f - alignment of the text
g - indicates if the line cell background is filled(true,1) or not(false,0). Default value is false.

//adding more text to the pdf file(paragraphs)
$pdf->Write(0,"Error selecting values from database! ".mysql_error());
$pdf->Write(0,"your paragraph here");
Above lines will add text to pdf file.


At the end of the PHP code we have to add $pdf->Output(); function to make our PDF file visible. Without this function our PDF file will not be generated and printed to the screen.
Well hope you guys got some basic knowledge about generating a PDF file using PHP.
Comment box is open for your ideas, suggestions..
Thank You!

See you guys.. :)


Tuesday, March 31, 2015

System Development Life Cycle (part 1)



System Development Life Cycle(SDLC) is a series of steps or phases that provide a model for the development and life cycle management of an application or a software.
SDLC has 5 major steps or phases :-

  • Evolution
  • Requirement Analysis
  • System Design
  • System Implementation
  • System Testing
Evolution phase includes the identification and defining the need of a new system.
Requirement Analysis phase includes problem identification and analyzing the information need of the end users.
System Design phase includes designing or creating a blueprint with necessary hardware and software requirements.
System Implementation phase includes  creating or coding the final system.
System Testing phase includes evaluating the system's actual functionality in relation to expected functionality.

System Maintenance includes keeping the system up to date with the changes in the organization and technology and ensuring it meets the goals of the organization.


To develop a successful system these phases must be carried out in a certain manner. To full fill this requirement people built models for system development. These models eased the management of the each phase of the life cycle.
Some popular SDLC models are :-
  • Waterfall Model
  • Modified Waterfall Model
  • Iterative Model
  • Spiral Model
  • V Model
  • Big Bang Model
  • Agile Model
  • RAD Model
  • Software Prototyping
  • Incremental Model

Let's discuss some of these models in detail in the next article..!

Comment box is open for your suggestions,ideas and comments.... :)

Sunday, March 29, 2015

System Analysis and Design(SAD) - Part 2 (Types of Information Systems)



System Analysis and Design - Types of Information Systems

Well our today's topic is about Information System Types. We can divide information systems into 3 basic categories. 
  1. Operational Level Information Systems
  2. Middle Level Information Systems
  3. Top Level Information Systems

Operational Level Information Systems are used by Operational level managers and staff which will help in their decision making and making their work easier.
Middle Level Information Systems are used by Middle level managers and staff which will help them in decision making,summarizing data and creating daily,monthly and yearly reports and making their work easier.
Top Level Information Systems are used by the personals which are in the top levels of the organizational hierarchy. They use these kind of information systems to ease their decision making because the behavior and the future of the organization will depend on these decisions so the information which is provided by these kind of information systems must be reliable and accurate.



We can also categorize information systems according to their operational functionality.

  1. Transaction Processing Systems(TPS)
  2. Management Information Systems(MIS)
  3. Decision Support Systems(DSS)
  4. Executive Information Systems(EIS)
  5. Expert Systems(ES)
  6. Communication and Collaboration Systems(CCS)
  7. Office Automation Systems(OAS)

Transaction Processing Systems are designed to capture and process data about day today transactions. 

Management Information Systems are designed for management oriented reporting. These information systems generates reports based on the data which is captured from the Transaction Processing Systems.

Decision Support Systems helps to identify decision support opportunities for top level managers. It provides relevant information to help make decisions and provides its users or the top level managers with decision oriented information whenever decision making situation arises.

Executive Information Systems are also designed for the use of top level managers. These information systems will  support the planning and assessment needs of executive managers. These systems are capable of integrating of data all over the organization into a graphical indicators and controls.

Expert Systems is a programmed decision making information system. It is capable of capturing and reproduce knowledge and expertise of a human expert. It stimulates thinking of the expert. This is a best and an effective way to keep the knowledge of a human experts inside the organizations even though expert have left the organization.

Communication and Collaboration Systems helps to enable more effective  communication between workers,partners,customers and suppliers. Enhances their ability to collaborate.
Office Automation Systems supports wide range of business office activities. It provides improved workflow between workers.

If you haven't read the Introduction - Introduction to Information Systems


Well thanks for reading..Bellow comment box is open for your ideas,comments,suggestions...

Monday, March 23, 2015

Power Button එක නැතුව phone එක on කරන්න






ඔයලා දන්නවද  power button එක නැතුව කොහොමද screen එක on කරන්නේ කියලා?

මොකද කට්ටිය බයවෙලා, screen එක on කරන්න power button එක ඔබන ඔබන සැරේට power button එක කැඩෙයි කියලා. 
tongue emoticon ඒත් බයවෙන්න එපා. එහෙම power button එක ලේසියෙන් කැඩෙන්නේ නෑ. :D

ඒ කිව්වටත් හිතට හරි මදි වගේ නේ. tongue emoticon එහෙමනං මෙන්න ඒකට නියම විසදුම. Klick button එක.
මේක ඇවිල්ලා අපේ ෆෝන් එක headset පොර්ට් එකට ගහන්න පුලුවන් switch එකක්. මේක plug කරලා, මේකට අදාල app එක ෆෝන් එකට දැම්මම, ෆෝන් එක ගණන් ගන්නේ මේක button එකක් හැටියට. කොහොමද වැඩේ. නියමයි නේද?
හරි එහෙනන්. කරන විදිය මුල ඉදන්ම කියංනංකෝ.

1. මුලින්ම මේ gadget එක ebay එකෙන් ගෙන්න ගන්න. වැඩි ගානක් වෙන්නේ නෑ. රුපියල් 120ක් වගේ වෙන්නේ. හැබැයි මේක එන්නනම් සති 2ක් වගේ යනවා. එතකන් ඉවසන් ඉන්න වෙනවා. smile emoticon මෙන්න මේ link එකෙන් ගිහිල්ලා order කරන්න.

2. ඊට පස්සේ මේක ආවම playstore එකෙන් මේක run වෙන්න ඕනේ වෙන app එකක් ඩවුන්ලෝඩ් කරගන්න. හැබැයි මේකට apps ගොඩක් තියෙනවා. මං link ඔක්කොම දාන්නේ නෑ. playstore එකේ Klick කියලා සර්ච් කලාම එන apps ගොඩක් මේකට ගැලපෙනවා. එහෙම එන හොදම apps 3 link මං පහලින් දාන්නම්. මේ apps දැම්මේ නැත්තන්, ෆෝන් එක මේක detect කරන්නේ headset එකක් විදියට හොදේ.


3. ඊට පස්සේ, අර gadget එක 3.5mm පොර්ට් එකට (headset පොර්ට් එකට) plug කරලා, app එක run කරලා අපිට කරන්න ඕනේ වැඩේ ඒ app එකෙන් assign කරන්නයි තියෙන්නේ. ඊට පස්සේ ඉතින් වැඩ කරන්නයි තියෙන්නේ.
මේකෙන් අපිට ඕනේ විදියට screen එක on/off කරන්න. apps launch කරන්න. camera button එකක් හැටියට use කරන්න. තව වැඩ ගොඩාක් කරන්න පුලුවන්.
(මං පහල ෆොටෝස් දාල තියෙන්නේ මං use කරන iKey app එකේ ඒවා. ඒ app එකේනම් 3.5 පොර්ට් එකට මොකක් හරි plug කරපු ගමන්ම ඔය screenshot එකේ වගේ අහනවා headset එකක්ද, නැත්තන් මේ button එකද plug කලේ කියලා. එතකොට එතනින් තෝරලා දෙන්නයි තියෙන්නේ.






මං නම් මේකට assign කරලා තියෙන්නේ,
එකපාරක් press කලාම screen එක on/off වෙන්න,
දෙපාරක් press කලාම running apps clean වෙන්න,
ඔබාගෙනම හිටියම sound record වෙන්න)
මං මේක ටෙස්ට් කලේ android සහ windows mobiles වල විතරයි. එකෙනුත් මේක වැඩ කලේ android එකේ විතරයි. මොකද windows වලට මේ වගේ apps නෑ. මේක plug කලාම windows ෆෝන් මේක headset එකක් විදියටයි ගන්නේ.

ඇත්තම කියනවා නම් මම මේ පොස්ට් එක facebook එකෙන් copy කරගත්ත එකක්. වටිනවා කියලා හිතුන නිසයි හැමෝටම කියවන්න කියලා පොස්ට් කරේ.

මේක originally ලියුවේ Gevindu Aloka.

ප්‍රශ්න තියෙනවනම් අහන්න.

Monday, March 16, 2015

System Analysis and Design(SAD) - Part 1(Introduction to Information Systems)


System Analysis and Design - Introduction to Information Systems




Computers are now becoming part of virtual reality in every action in an organization, even in our personal lives. Every computer system consists of  six (6) basic components.
  • People
  • Interface
  • Data
  • Information Technology
  • Network
  • Process


System Stakeholders

System Stakeholder is any person who has an interest in an existing or proposed information system. Stakeholders can be divided into 5 major categories. It maybe include technical people, non-technical people and external and internal workers.

  1. System User
  2. System Owner
  3. System Builders
  4. System Designers
  5. System Analysts

System User is a person is a person who will use or affected by an information system on a regular basis in many ways.

System Owner is the person who owns the system, sponsor and advocate, set the vision and priorities,determine the policies ane responsible for the funding the project.

System Designer is a technical specialists. He can translate system user's business requirements and constraints to technical solutions. Designs the computer files, databases, inputs, outputs, user interfaces, networks and programs that will meet the user requirements.

System Builder is the person who construct, test and deliver the information system based on design specifications generated by the system designer.

System Analysts are the people understand both business and computing. Studies the problems and needs of the organization and determine how people, data, processes and information technology can best accomplish improvements for the business. 

Legacy Systems

Legacy System is an existing computer system or a application program which continues to be used because users does not want to replace of redesign it. (Antique System)
There are some potential problems in using these kind of systems.
  1. Often run on obsolete hardware which is usually slow
  2. Hard to maintain, improve and expand because there is a general lack of understanding of the system
  3. Ones who developed and designed the system may have left the organization, so there is no one to explain how it works
  4. Difficult to integrate with new systems because technology difference may occur
There are some difficulties also when upgrading or replacing these systems.
  1. The technology and the programming languages which are used in these systems may obsolete and there maybe no skilled personal to understand the system.
  2. Maybe these systems are still working fine and the processes which are done by the system are critical, so stakeholders can not afford a chance of occurring an error during the upgrading process.


Sources - University of Colombo School of Computing Teachers Notes(BIT Degree Program)



Comment box below is open for your ideas, suggestions and discussions...

Tuesday, February 17, 2015

Administrator Password Hack

අද මම අරගෙන ආවේ hacking වැඩක්. ඇත්තම කියුවොත් මේක hacking වලට වඩා back door එකක් use කරනවා කියුවොත් හරියටම හරි.

එහෙනම් අපි වැඩි කතාවට යන්නෙ නැතුව බලමු කොහොමද කරන්නෙ කියලා.


  • Step 1 - Open CMD as Administrator. 

මුලින්ම Command Prompt icon එක උඩ right click කරලා Run as Administrator select කරන්න ඔනි. එතකොට computer default admin විදියට තමයි command prompt එක run වෙන්නෙ.. අපිට මේක ඔනිම account එකක ඉදන් කරන්න පුලුවන්.




  • Step 2 - Type 'net user' in CMD
දැන් net user කියල type කරල enter කරන්න. එතකොට computer එකේ තියෙන user account list එකක් display වෙනවා.



  • Step 3 - Type 'net user ACCOUNT NAME'
මේ කියන්නෙ net user එකත් එක්ක computer එකේ තියෙන user account එකේ name එක type කරන්න කියල. මගේ computer එකේ විදියට නම් Acer1 හෝ guest. අපි Guest එක use කරමු.




  • Step 4 - To delete current password 'net user ACCOUNT NAME *'
මේ command එකෙන් ඔයාලට පුලුවන් net user list එකෙන් ආපු ඔනිම account එකක password එක replace කරන්න. අපි මගේ computer එකේ guest එක ගත්තොත් command එක එන්න ඔනි net user guest * කියලා. මේක type කරලා enter කරාම password reset කරන්න අහනවා. ඔයාලට අලුත් password එකක් ඔනි නැත්තම් නිකන්ම enter කරගෙන යන්න.



  • Step 5 - To assign a new password or change password
අපිට ඕනි නම් single command එකෙන් password එක වෙනස් කරන්නත් පුලුවන්. ඒකට use කරන්න ඔනි net user ACCOUNT NAME NEW PASSWORD command එක.
මගේ computer එකේ නම් අපිට use කරන්න වෙන්නේ guest account එකනේ. Guest account වලට password දාන්න දෙන්නේ නෑ නේ. එත් අපි කරලම බලමු.
ඔයාලට පුලුවන් වෙන ඔනිම account එකකට මේ method එක use කරන්න.


අහ්හ්..වැඩ කරා නෙ! ;)



අන්තිමටම කියන්න තියෙන දේ තමයි   අනිත් අයගෙ computer වලට හොරෙන් යන එක, password හොරෙන් ගන්න එක, hack කරන එක එහෙම හරිම නරක වැඩ. (මම නම් ඕවා මුකුත් දන්නෙ නෑ. ;) :p )

ඔයාලගෙ computer එකෙ password එක අමතක වෙලා log වෙන්න බැරි වුනාම විතරක් වගේ මේවා use කරන්න.


අහ්හ්..අමතක වුනා නෙ කියන්න, මේ  method එක හරියන්නෙ Windows Operating  System  එකට විතරයි.



එහෙනම් see you with the next tutorial.. :) 

Thursday, January 29, 2015

Blog හෝ Website එකේ visits වලට money!


මම අද අරන් ආවේ අලුත්ම වැඩක්!

ඔයාලට website එකක් හෝ blog site එකක් තියෙනවද?
එහෙනම් ඒ site එකට එන visits ගානට ඔයට money හම්බවෙනවා නම් කොච්චර හොඳයි ද, නේද? :D

වැඩි දෙයක් නැහැ..ඔයාලට තියෙන්නෙ  http://adf.ly/wm9j6 මේ ලින්ක් එකෙන් හෝ http://adf.ly/?id=8819237 මේ ලින්ක් එකෙන් ගිහින් register වෙන්න!

Register වුනාට පස්සෙ Tools Tab එක හරහා ඔයාලට මේ වගෙ ඔප්ටිඔන්ස් වලට යන්න පුලුවන්!

Mass Shrinker
Multiple Links
Easy Link
Bookmarklet
API Documentation
Web Analytics
Full Page Script
Website Entry Script
Export Links and Stats
Domains
Pop Ads
Plugins

Full Page Script එකෙන් ඔයලට පුලුවන් ඔයලගෙ මුලු blog හෝ website page එකේ හැම ලින්ක් එකක්ම කවුහරි click කරොත් ඔයාලට amount 1k හම්බවෙන විදිහට හදන්න.

Website Entry Script එකෙන් පුලුවන් ඔයාලගෙ blog හෝ website එකට enter වෙනකොටම ad එකක් load වෙන්න set කරලා ඔයාලට amount 1k හම්බවෙන විදිහට හදන්න. (මම නම් හිතන්නෙ ඒක තමයි හොදම)

තව තව සල්ලි හම්බවෙන විදි ගොඩක් තියෙනවා මේ සිටෙ එකෙ. ඔයාලම බලන්නකො එහෙනම්. 

Wednesday, January 28, 2015

Creating a Drop Down List from CSS

මම හිතනවා ඔයාලට HTML & CSS ගැන basic knowledge 1k ඇති කියල!

අපි හිතමු අපිට හදන්න ඔනි මේ පහලින් පෙන්නලා තියෙන වගෙ drop down list එකක් කියල.



හරි,එහෙනම් අපි මුලින්ම ඩ්‍රොප් ඩව්න් ලිස්ට් එකේ sketch එක හදාගෙන ඉමු.

To create the sketch we use Unordered List in HTML.

Ok now,First we have to create main lists :- locations, The Menu, Our Story, Contact Us

ඒක කරන්නෙ මෙන්න මෙහෙමයි.

<ul>
      <li>Locations</li>
</ul>
<ul>
      <li>The Menu</li>
</ul>
<ul>
      <li>Our Story</li>
</ul>
<ul>
      <li>Contact Us</li>
</ul>

Now we have done creating our main tabs/lists. එහෙත් මේක තාම sketch එක විතරයි.

Now we have to create our drop down list part.

ඒක කරන්නෙ මෙන්න මෙහෙමයි.


<ul class="list1">
      <li>Locations
          <ul class="list2">
               <li>Maps</li>
                <li>Address</li>
          </ul>
     </li>
</ul>
<ul class="list1">
      <li>The Menu
          <ul class="list2">
                <li>Breakfast</li>
                 <li>Lunch</li>
                 <li>Dinner</li>
           </ul>
      </li>
</ul>
<ul class="list1">
      <li>Our Story
          <ul class="list2">
                <li>Breakfast</li>
                 <li>Lunch</li>
                 <li>Dinner</li>
           </ul>
      </li>
</ul>
<ul>
      <li>Contact Us</li>
</ul>

හරි,දැන් අපි අපේ sketch එක හදාගෙන ඉවරයි! දැන් ඔයාල ලියපු file එක .html extention එක එක්ක save කරල web browser එකෙන් open කරලා බලන්නකො. කැතයි නේද?

This is the point that CSS comes in to action! Now we have to write our CSS file.

මම CSS ලියන්නේ <head> tag එක ඇතුලෙ but ඔයලා කැමති නම් external style sheet එකක් ලියලා page එකට link කරත්  අවුලක් නෑ. මම ලියුවෙ <head> tag එක ඇතුලෙ!


<style type="text/css">
*{margin:0; padding:0;}


.list1 ul
{
margin : 0;
padding : 0;
line-height:30px;
/*background-color:#096;*/
}

.list1 li
{
margin : 3px;
padding : 8px;
list-style:none;
float:left;
position:relative;
background-color :green;
border-radius:10px;
}


/*Nested UL*/
ul ul
{
position:absolute;
visibility:hidden;
/*height:30px;*/
}

ul li:hover ul
{
visibility:visible;

}

.list1 li:hover
{
background:#0C6;
}


  ul li:hover  ul li  a:hover
{
background-color:#0C3;
color:#000;
}
</style>

මේ තියෙන්නේ CSS part එක. මම notepad එකෙන් type කරපු නිසා ලොකුවටම ලස්සන කරන්න බැරි වුනා එත් ඔයාල try කරන්න තව ලස්සන කරන්න සහ තව ගොඩාක් වැඩ කෑලි තියෙනවා. හොයගෙන කරන්න!

Further Reference - http://www.w3schools.com/css/default.asp


එහෙනම් පස්සෙ හම්බවෙමු!
එතකන් Good Luck! :)

Monday, January 19, 2015

Connecting Database in PHP

කොහොමද කට්ටිය ගොඩ කාලෙකට පස්සෙ?


අපි අද බලමු කොහොමද MySQL database එකක් අපේ PHP page එකට connect කරගන්නෙ කියලා!


First of all  we have to start our Apache Server in WAMP or XAMP. මම හිතනව ඔයලා ඒක නම් දනටමත් දන්නවා ඇති කියලා. ;)

Now we have to create our basic PHP file and save it in the WAMP or XAMP.

In WAMP you have to save your PHP file in the "www" folder in WAMP folder in "C" directory.
In XAMP you have to save your PHP file in the "htdocs" folder in XAMP folder in "C" directory.

Now we have to create our database in MySQL, so you have to start the MySQL server in XAMP.



දැන් අපි අපේ database එක create කරමු. First of all we have to login to MySQL.

දැන් අපි බලමු කොහොමද command prompt එකෙන් MySQL login වෙන්නෙ කියල.



After typing and pressing Enter button in the command prompt you will be asked to enter a password. Just don't type anything! Just Press Enter Button.

දැන් ඔයලා MySQL වලට login වෙලා ඉන්නෙ.

-u root = root is the default user in MySQL.
-p = password for the user, but root does not have any password so we keep it blank.
-h = this is the host where the database is located. We use localhost because our database is located in our local machine.


We create database with the command:- CREATE DATABASE test123;

test123 කියන්නෙ අපි create කරන database එකේ name එක.

හරි දැන් අපේ database එක create වෙලා ඉවරයි.

Now we have to select our database using:- USE DATABASE test123;

හරි,දැන් අපි PHP පැත්තට හැරෙමු.

First of all we have to establish the connection with the database server. 

$host = "localhost";
$user = "root";
$password = "";

$conn = mysql_connect('$host','$user',$password');    //This will select and establish the connection to the database server
if(!$conn){ die("Could not connect :".mysql_error());}
else { echo "Connection established to the Server!"}

දැන් database server එකට connection එක establish වෙලා තියෙන්නේ.

Now we have to select our database to use.

$dbName = "test123";

mysql_select_db('$dbName','$conn') or die ("Can not select Database".mysql_error());

දැන් අපේ database එකට අපි connect වෙලා ඉවරය.


Die is a PHP function which we use to handle exceptions such as database unavailability. It will terminate the attempt and returns an error if the database in unavailable.


ඊළඟ post එකෙන් අපි database එකෙන් data retrieve කරන හැටි බලමු.


ගැටලු සඳහා පහතින් comment කරන්න.