Saturday, December 5, 2015

How to use google fonts in your html

When we creating a web page one of the main problem we face is using fonts we want in our web page. That is not easy because in order to display the correct font in viewer's browser that font should be installed in that person's device.
Otherwise our web page will not be displayed properly in viewer's device.
Using google fonts is the best solution for that.

How to use Google fonts

  1. Type the name of font that you need and find it (In example below finding "Bree Serif" font is shown)
  2. Change the appearance of your font (bold, italic etc)
  3. Click add to collection.
  4. After adding all fonts you want by following step 1 to 3 repeatedly click on use button.
  5. In the next interface scroll down a bit and find the CSS link for your fonts and include it in your html as a style reference (It will render those fonts from that link)


Now you can use font you wanted as <FONT FACE="Bree Serif">Bree Serif font</FONT>
Because of Google fonts you don't need to worry about viewer's installed font styles. You can use what ever font you need and make an attractive web pages.

Feel free to add a comment if something was not clear to you or you have something to add.

Thursday, December 3, 2015

How to use a long URL using bit.ly URL shortner

Some times we have to deal with very long URLs and that is very annoying. Here is a simple solution foe that. This not only shorten your URL but provide many other supports such as keep track of number of clicks on the links.

Here you go.
You can download this cool video by this link

Thursday, November 26, 2015

Algorithm : Maximal possible sum of some consecutive items in an integer array


Lets think of an array like,
[ 2, 3, 8, 1, 12, 2, 4, 5]

In this array maximum sum of any 2 consecutive numbers is 14(12+2) and maximum sum of any 3 consecutive numbers is 21(8+1+12).

Here is a simple algorithm using Java for find the maximum sum of some consecutive numbers in an integer array. This is just a simple solution for this problem.

Feel free to add a comment if anyone has a optimized solution or anything hard to understand.

static int  arrayMaxConsecutiveSum(int[] inputArray, int k) {
 int result = 0; 
 int currentSum = 0; 
 for (int i = 0; i < k - 1; i++) { 
  currentSum += inputArray[i]; 
 } 
 for (int i = k - 1; i < inputArray.length; i++) {
  currentSum += inputArray[i] ; 
  if (currentSum > result) {
   result = currentSum; 
  } 
  currentSum -= inputArray[i - k + 1]; 
 } 
 return result; 
}


Go to this link to find out how to implement this code in Java

Wednesday, November 25, 2015

Useful and Elegant Terminal Emulators for Linux

terminal emulator is a program that emulates a video terminal within some other display architecture. Though typically synonymous with a shell or text terminal, the term terminal covers all remote terminals, including graphical interfaces.
That is how Wikipedia  define what a terminal emulator is.
It allows the user access to a text terminal and all its applications such as command-line interfaces (CLI) and text user interface (TUI) applications. On Unix-like operating systems, it is common to have one or more terminal windows connected to the local machine.
So people use different types of Terminal Emulators according to their performances and preference of users.
Lets see some of different terminal emulators that can be used in Linux operating systems.

  1. Tilda
    Tilda is a GTK+ Terminal emulator and it is based on the VTE terminal emulator widget underlying GNOME terminal. They say that its design was inspired from consoles which was in computer games like Quake. Running Tilda can be faster than launching a new terminal with a keyboard shortcut because the program is already loaded into memory. So it can be useful to people who frequently find themselves opening and closing terminals.
    It has a nice interface with highly customization options and excellent built in color schemes.

    It is a free software licensed under the terms of the GNU general public license.

    Tilda home page

  2. Guake
    Guake is a drop-down terminal made for the GNOME desktop environment. Guake's style of window is based on an FPS game, and one of its goals is to be easy to reach.
    Guake is mostly written in python and has a little piece in C. Guake is packaged by a number of distributions, among which are Fedora, Debian, Ubuntu or ArchLinux.
    special Features
    • Multi tab.
    • Lightweight
    • Open URL to your browser
    • Save terminal content to a file
    Guake Screenshots

    Guake home page

Tuesday, November 24, 2015

Log into a website using a IP address from another country



Today we are going to talk about very interesting topic and that is how we fake our real IP address and log into a web site.

First let me briefly explain how this happen.

Normally when we surfing the web what we do is we send our HTTP or HTTPS requests to a particular server. In that case server can know our real IP and someone in our path can block requests goes to a particular server if that person want.

In this approach we send our request to a special type of server called proxy servers. After that that proxy server sends our request and send the response to us. What end server notice is request coming from proxy server and some one on the way to proxy server will think that we are going to proxy server, but actually we are going to proxy server to ask that server to do some thing for us  that is go to website we want.. :)



That is how it happens lets get into work,

  1. Type "http free proxy" and search in google
  2. you will find many site that give free proxy server addresses.
  3. Choose a good proxy server according to your needs.
    • different servers are in different countries.
    • some servers does't allow HTTPS connections.
  4. Change your proxy settings in your browser using proxy server IP and port obtain from a site
That's it and now you can use a proxy server from another country to get web sites for you.

NOTE:  Be careful If you are going to use proxy servers for login Facebook, G mail or other sites which you have to provide your secret credentials. Those servers will direct you to wrong pages and steal your credentials.

Sunday, November 22, 2015

Shutdown computers running Linux using Terminal




Some times you might want to shutdown your computer which runs linux using terminal because of several reasons. GUI of your operating system might not work or you just want to be a smart user of linux. what ever it is, lets see how we can shutdown our computer using linux command line.

It is easy,

  1.    Press Ctrl+Alt+T for get in to the terminal.
  2.    Enter the code sudo shutdown -h now and press Enter.
  3.   Type in your password (if prompted) press Enter again.
There are some other methods to do the same task and mainly two commands.
  1. Shutdown command
    • this command will bring the system down with a warning message
  2. Poweroff command
    • this command will stop the system
So you can use these two commands as well,

  • poweroff
  • shutdown -h +0


Friday, May 1, 2015

Install apps in your android virtual device

Some times we want to install built apps (apk files) in our virtual device.
It is simple we just have to copy that apk file in to platform-tools folder in Android sdk directory.
Then execute this command in command prompt in platform-tools directory.

            adb install appName.apk

"appName.apk" should replaced by name of the app that you want to replace.

see the following example screen shot.


Thursday, February 12, 2015

importing .sql file into a database using wamp



















when you have a sql file you can easily import it in to a database Using wamp.

1. left click wamp -> phpmyadmin
2. select database then click import (top right)
3. locate the database and click go.
You can use the command prompt as well. For that,

1. Run the cmd (DOS) and get into the mysql folder, which in my case works like this
C:\>cd C:\wamp\bin\mysql\mysql5.0.51b\bin
2. Then use this command to fire up MySQL

C:\wamp\bin\mysql\mysql5.0.51b\bin>mysql.exe -use databasename -u username -p

you should provide a password if you have one.
After that copy .sql file to directory where mysql.exe is located and run the command ,
mysql> source myfilename.sql;

Sunday, February 8, 2015

Use java Comparable interface to sort objects

In previous tutorial we looked at how to sort int, double and String arrays using java Arrays.sort() method. That is not all that we can do with that method. We can sort Objects as well.
But when we come to Objects there is a small problem. Lets see that problem and solution for that using java Comparable Interface.

This is the code for Student class
public class Student {

 private String name;
 private int marks; 

 public Student(String name,int marks){
  this.name=name;
  this.marks=marks;
 } 

 public void setName(String name) {
  this.name = name;
 }

 public String getName() {
  return name;
 }

 public void setMarks(int marks) {
  this.marks = marks;
 }

 public int getMarks() {
  return marks;
 }
}


If we create few objects of Student class and try to sort them using Arrays.sort() method,
  
public class ObjSort {

 public static void main(String args[]){ 

  Student[] students = new Student[4];

  Student pineappale = new Student("nimal", 70);
  Student apple = new Student("Anuradha", 95);
  Student orange = new Student("Tharaka", 82); 
  Student banana = new Student("Isuru", 90); 

  students[0]=pineappale;
  students[1]=apple;
  students[2]=orange;
  students[3]=banana; 

  //sort with student's marks 
  Arrays.sort(students); 

  int i=0;
  for(Student temp: students){
   System.out.println("Students " + ++i + " : " + temp.getName() +
   ", Marks : " + temp.getMarks());
  }
    }
}

It will give an error because to sort there should be something to compare. But in Student objects there are multiple attributes to compare. To sort objects on particular attribute we have to implement Comparable class and override the  compareTo() method in Student class.
After making those differences it will look like this.
 
public class Student implements Comparable&lt;Student&gt; { 

 private String name;
 private int marks; 

 public Student(String name,int marks){
  this.name=name;
  this.marks=marks;
 }  

 public void setName(String name) {
  this.name = name;
 }
 public String getName() {
  return name;
 }

 public void setMarks(int marks) {
  this.marks = marks;
 }

 public int getMarks() {
  return marks;
 } 

 public int compareTo(Student compStudent) { 
  int comparemark = compStudent.getMarks(); 

  //if we want to sort in ascending order
  return this.marks - comparemark; 
 } 
}

Now we can use Arrays.sort() method on array of Student objects because now it compares objects on marks attribute.

Sort an array using java Arrays class

There are lot of sorting algorithms to use. but if we are in a hurry or we just want to sort a small set of data using sort() method of java Arrays class is the best thing you can do.
So lets see how to sort an array using java Arrays class.
here is the coding example.

import java.util.Arrays;

public class ArraySort {
public static void main (String[] args){  

  String[] names = { "Nimal", "Sunil", "Tharaka", "Isuru","Anuradha"};
  int[] intNumbers = { 3, 5, 12, 7, 1, 9};
  double[] doubleNumbers = { 2.34, 45.213, 4.76, 4.23, 8.32};  

  //sorting String array 'names'
  Arrays.sort(names);  

  int i=1;
  System.out.println("After sorting String array");
  for(String name:names)
   System.out.println("item"+i+++" - "+name);  

  //sorting int array 'intNumbers'
  Arrays.sort(intNumbers);    

  i=1;
  System.out.println("After sorting int array");
  for(int num:intNumbers)
   System.out.println("item"+i+++" - "+num);   

  //sorting double array 'doubleNumbers'
  Arrays.sort(doubleNumbers);    

  i=1;
  System.out.println("After sorting double array");
  for(double num:doubleNumbers)
   System.out.println("item"+i+++" - "+num);  

 }
}

Output for this code will be like this.

After sorting String array
item1 - Anuradha
item2 - Isuru
item3 - Nimal
item4 - Sunil
item5 - Tharaka
After sorting int array
item1 - 1
item2 - 3
item3 - 5
item4 - 7
item5 - 9
item6 - 12
After sorting double array
item1 - 2.34
item2 - 4.23
item3 - 4.76
item4 - 8.32
item5 - 45.213

This Arrays.sort() method support not only for String, int and double arrays but also for byte, char, long, float and object arrays

Sorting strings using java Collections

In this tutorial Lets see how to sort collection of Strings in alphabetical order in a very simple way. We use java Collections for that.

Here is the coding example.

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CollectionSort {
 public static void main (String[] args){ 

  List<String> names = new ArrayList<String>();  

  names.add("Nimal");
  names.add("Sunil");
  names.add("Tharaka");
  names.add("Isuru");
  names.add("Suresh");
  names.add("Anuradha");
  names.add("Thilak");  

  Collections.sort(names);  

  int i=1;
  for(String name:names)
   System.out.println("item "+i+++" "+name);
 }
}

Output for this code will be like this.


item 1 Anuradha
item 2 Isuru
item 3 Nimal
item 4 Sunil
item 5 Suresh
item 6 Tharaka
item 7 Thilak


Friday, January 16, 2015

Implementation of Binary Search Tree

As mentioned in previous post Binary Search Tree is an important data structure to programmers, developers. It has following important features.

  1. All the values of nodes in the left sub-tree are less than the value in the root node.
  2. All the values of nodes in the right sub-tree are greater than the root node. 
  3. The left and right sub-trees are also binary search trees
  4. There mustn't  be any duplicate node.
A node implementation
    
public class TreeNode { 
 int value;
 TreeNode left;
 TreeNode right;
 
 public TreeNode(int val){
  value = val;
  left = null;
  right = null;
 }
 
 public TreeNode(){
  value = 0;
  left = null;
  right = null;
 }
 
 public void setLeft(TreeNode node){
  left=node;
 }
 
 public void setRight(TreeNode node){
  right=node;
 }
 
 public void setValue(int val){
  value = val;
 }
 
 public int getValue(){
  return value;  
 }
 
 public TreeNode getLeft(){
  return left;
 }
 
 public TreeNode getRight(){
  return right;
 }
}


set methods and get methods are implemented because they are helpful to implement binary search tree using class "TreeNode".

Here's the implementation for Binary Search Tree using "TreeNode" class

public class BST { 

 private TreeNode root; 

 public BST(){
  root = null;
 } 

 /*method to determine whether BST is empty or not*/
 public boolean isEmpty(){
  return root==null;
 } 

 /*method to insert a node to BST*/
 public void insert(int data){
  root=insert(root,data);
 } 

 private TreeNode insert(TreeNode node,int data){
  if(node==null){
   node = new TreeNode(data);
  }
  else{
   if(data<node.getValue())
    node.left=insert(node.left,data);
   else
    node.right=insert(node.right,data);
  }
  return node;
 } 

 /*method to delete a node from BST*/
 public void delete(int val){
  if(isEmpty()){
    System.out.println("Tree Empty");
  }
  else if(!search(val))
   System.out.println("Sorry "+ val +" is not present");
  else{
   root=delete(root,val);
    System.out.println(val+ " deleted from the tree");
  }
 } 

 private TreeNode delete(TreeNode node,int val){
  TreeNode n1,n2,k;  

  if(root.getValue()==val){
   TreeNode lt=root.getLeft();
   TreeNode rt=root.getRight();   

   if(lt==null&&rt==null)
    return null;
   else if(lt==null)
    return rt;
   else if (rt==null)
    return lt;
   else{
    n1=rt;
    n2=rt;
    while(n2.getLeft()!=null)
     n2=n2.getLeft();
    n2.setLeft(lt);
    return n1;
   }
  }

  if(val<root.getValue()){
   k=delete(root.getLeft(),val);
   root.setLeft(k);
  }
  else{
   k=delete(root.getRight(),val);
   root.setRight(k);
  }
  return root;  
 } 

 /*method to count number of nodes of BST*/
 public int countNodes(){
  return countNodes(root);
 } 

 private int countNodes(TreeNode node){
  if(node==null)
   return 0;
  else{
   int count=1;
   count+=countNodes(node.getLeft());
   count+=countNodes(node.getRight());
   return count;
  }
 } 

 /*method to search element of BST*/
 public boolean search(int val){
  return search(root,val);
 } 

 private boolean search(TreeNode node,int val){
  boolean found=false;
  while(node!=null && !found){
   if(val<node.getValue())
    node=node.getLeft();
   else if (val>node.getValue())
    node=node.getRight();
   else{
    found=true;
    break;
   }
   found=search(node,val);  
  }
  return found;
 }
}

In this implementation insert, delete, search, methods are also implemented to insert, delete, search data in BST. This BST is implemented only for integer data but remember we can implement Binary Search tree as compatible with any data type using java generics.

How to insert data to Binary Search Tree (BST)

Binary search tree is one of most important data structure in programming.So lets see how to work with a binary search tree manually.
Main property of a binary search tree is all of the values in the left sub-tree are less than the value in the root and all of the values in the right sub-tree are greater than the root. 

when we enter a data set to a binary search tree.first value goes to the root.If next value is greater than root it is the right child of root. If next value is less than root it is the left child of root.

Lets enter this data set in to a binary search tree.
{ 8, 3, 6, 10, 1, 4, 7, 14, 13}

8 is the root of this BST. 3 is the left child of 8 (root) because 3 is less than 8. 10 is the right child of the 8 (root) because  10 is greater than 8. Next element of the array is 1. 1 goes to left sub-tree of 8 because 1 is less than 8 and it is the left child of the 3 because 1 is less than 3. So on after completing the BST it will looks like this.



Lets try another exercise.
{ 50, 72, 54, 17, 12, 23, 19, 14, 76, 9, 54, 67}
After entering this data set into BST it will look like this




Thursday, January 15, 2015

fastest ways to determine primary numbers in java

For some of programs and for some programming exercises, we need to  determine whether a number is a primary number or not. That is very simple right... even newbies to programming can come up with a solution with java.
But when we are working with large number of numbers,we need more efficient piece of code. Here is some efficient piece of codes found on programming question and answer sites.

       public static boolean isPrime2(int n) {
            if (n <= 1) 
                return false;            
            if (n == 2) 
                return true;            
            if (n % 2 == 0) 
                return false;            
            for (int i = 3; i <= Math.sqrt(n) + 1; i = i + 2) {
                if (n % i == 0)
                    return false;                
            }
            return true;
        }

still we can do some improvements to this code
boolean isPrime(long n) {
    if(n < 2) return false;
    if(n == 2 || n == 3) return true;
    if(n%2 == 0 || n%3 == 0) return false;
    long sqrtN = (long)Math.sqrt(n)+1;
    for(long i = 6L; i <= sqrtN; i += 6) {
        if(n%(i-1) == 0 || n%(i+1) == 0) return false;
    }
    return true;
}

and some elegant answers are also there(this is much slower than others)...

    public static boolean isPrime(int n) {
         return !new String(new char[n]).matches(".?|(..+?)\\1+");

But the tricks needed to achieve speed usually sacrifices elegancy.
So,there are lot of new,efficient,elegant algorithms to everywhere. find out, enjoy.. stay with LETS SEE to see more.. :)

Wednesday, January 14, 2015

Remove duplicate elements from an array in Java


In many programming problems we need to remove duplicate elements from an array.In this tutorial lets see how to remove duplicates from an array in java.

  public static int[] remove_duplicates(int[] a){
  int comp,n,numOfRepeats=0;

  for(int i=0;i<a.length;i++){
   n=0;
   comp=a[i];
   for(int j=0;j<a.length;j++){
    if(comp==a[j]&&(i!=j)){
     numOfRepeats++; 
    }
   }
  }

  int sol[]=new int[(a.length-numOfRepeats)];

  int solIndex=0;

  for(int i=0;i<a.length;i++){
   n=0;
   comp=a[i];
   for(int j=0;j<a.length;j++){
    if(comp==a[j]&&(j!=i)){
     n=2;
     break;
    }
   }
   if(n==0){
    sol[solIndex]=comp;
    solIndex++;
   }
  }
  return sol;
 }


The above code is a simple code that any one can imagine. But it may not be very efficient in some cases.
   In java there are lot of built in classes to make this kind of things easy. By using java collection we can create a method as follows.


  public static Integer[] removeDuplicates(Integer[] arr) {

  return new HashSet<Integer>(Arrays.asList(arr)).toArray(new Integer[0]);

}


you can explore more about duplicate removing algorithms using this link..

Monday, January 12, 2015

Repair GRUB2 When Ubuntu Won't Boot

If you have a dual boot system in your computer and if you have installed windows after ubuntu you may not able to log in to ubutnu because you MBR might be changed or overwritten.
Ubuntu and many other linux distributions use the GRUB2 boot loader. In that case you have to restore GRUB2 from a ubuntu live CD or USB drive.
There are two main methods to do this. One is Boot Repair graphical tool that can repair GRUB2 with single click. But i think most suitable way for most cases is use ubuntu terminal to restore GRUB2.

lest see how to restore the GRUB2
first you'll need to boot from a live CD or USB drive. Make sure that version of ubuntu in your live CD or USB drive is the same as the version of ubuntu installed on your computer.  As a example if you have installed ubuntu 14.04 you have to use live CD of ubuntu 14.04.

then open a terminal after booting in to the live environment. Use sudo fdisk -l command to identify the partition ubuntu is installed.

Then Use the following command to mount the ubuntu partition at /mnt

sudo mount /dev/sdX# /mnt

you should replace sdX# part with the device name of your ubuntu partition.
as a example, if the ubuntu installed partition is 'sda6' the command should be  'sudo mount /dev/sda6 /mnt'

Important: if you have a separate boot partition, skip the above command and mount the boot partition at /mnt/boot. if you don't know weather you have a separate boot partition , you probably don't.

Then use the following command to reinstall the GRUB2 from the live CD or USB drive, replacing the dev/sdX with the device name of the hard disk above.Omit the number.
for example if you used /dev/sda6 above use /dev/sda here.

sudo grub-install --boot-directory=/mnt/boot /dev/sdX

Finally restart your computer.
now ubuntu GRUB should be displayed and ubuntu should boot properly.


Saturday, January 10, 2015

Add a syntax highlighter to your blog

If you are doing a blog about programming or some other stuff some times you need to put some code (e.g Java, PHP)in your blog post. so it would be very nice and easy to reader if that code segment is syntax highlighted.

So lets see how to add a syntax highlighter to your blog.

1. First you have to take a backup of your  blog template ( to use if something goes wrong).
2. Then click on 'Template' in the right side of the  page and click on "Edit HTML"(shown in the picture below).


3. After opening the blogger template copy the all CSS given in this link before </b:skin> tag.
4. Then you have to paste the following code before </head> tag.


   <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'></script>

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'></script>

5. Then paste the following code before </body> tag.
<script language='javascript'>

dp.SyntaxHighlighter.BloggerMode();

dp.SyntaxHighlighter.HighlightAll('code');

</script>

6. Finally save the blogger template.
7. Now the syntax highlighter is ready for your page and your codes that syntax highlighting is needed should goes with in <pre></pre> tags as shown below.(code should be entered in HTML mode)

<pre name="code">
...Your html-escaped code goes here...
</pre>

<pre name="code" class="php">
    echo "I like PHP";
</pre>

This code will look like this,

...Your html-escaped code goes here...
    echo "I like PHP";

8. Here is list of supported language for <class> attribute.
9.If you want you can escape your code here 

now you can have a nice syntax highlighter for your blog

Saturday, January 3, 2015

Internet Connection එකක් නැතුව .NET Framework 3.5 Install කරන හැටි.

අපි අද පාවිච්චි කරන ගොඩක් Software ව්ලට ඕන් දෙයක් තමයි Microsoft .NET Framework කියන්නේ.එක එක සොෆ්ට්වෙයාර් වලට ඕන එක එක Frameworks :). ඒ කියන්නෙ සමහර සොෆ්ට්වෙයාර් වලට ඕන .NET Framework 2.0. සමහර සොෆ්ට්වෙයාර් වලට ඕන .NET Framework 3.5. මේ වගේ අවශ්‍ය Frameworks වෙනස් වෙනවා. ඒත් ගොඩක් Software වලට අවශ්‍ය එකක් තමයි .NET Framework 3.5 . Windows 7 තියනවනම් අපිට .NET Framework 3.5 අමුතුවෙන් ඉන්ස්ටෝල් කරන්න දෙයක් නෑ.මොකද Windows 7 ඉන්ස්ටෝල් කරනකොට මෙකත් ඉබේම ඉන්ස්ටෝල් වෙනවා.

ඒත් ඔයාලා වැඩ කරන්නෙ Windows 8 වල හරි 8.1 වල හරි නම් ඔයාලට .NET Framework 3.5 වෙනමම ඉන්ස්ටෝල් කරන්න වෙනවා.Windows 8 හරි 8.1 වල හරි .NET Framework 3.5 අවශ්‍ය වෙන ප්‍රොග්‍රැම් 1ක් run කරොත් ඔයාලා .NET Framework 3.5 ඉන්ස්ටෝල කරලා නැත්තම් මේ වගෙ Dialog box 1ක් එයි.




අපි Install this feature කියන Option 1 තේරුවොත් ඉන්ටෙර්නෙට් Connect වෙලා .NET Framework 3.5 Download කරල Install කරනවා.

නමුත් මේ ලිපියෙන් අපි බලමු Internet Connection 1 ක් නැතිව කොහොමද .NET Framework 3.5 Install කරන්නෙ කියලා.


  1. ඉස්සෙල්ලම අපිට ඕන Windows 8 ISO File 1ක් හරි Setup disk 1ක් හරි. අපි ලඟ තියෙන්නෙ ISO File 1ක් නම් Power ISO,7-Zip වගේ Software 1ක් පාවිච්චි කරලා ISO File 1ක Extract කරගන්න ඕන.(මේකෙදි ඔයාලට ලේසි විදිහකට Extract කරගන්න.)අපි ලඟ තියෙනනේ Setup Disk 1ක් නම් කරන්න තියෙන්නෙ නිකන්ම Disk 1 CD/DVD Drive 1ට ඇතුල් කරන්න විතරයි.
  2. ඊලඟට Command Prompt 1 Open කරන්න ඕන (As Administrator).
  3. ඊට පස්සෙ පහල තියන Command 1 Command Prompt 1කේ Type කරලා Enter කරන්න (කැමති නම් Paste කරන්නත් පුලුවන් :-) )
          Dism /online /enable-feature /featurename:NetFx3 /All /Source:F:\sources\sxs /LimitAccess 

     මේකෙ "F:" කියන්නෙ Setup Disk 1 තියන CD/DVD Drive එකේ Drive Letter 1.අපි අපේ System 1 ට අනුව ගැලපෙන Drive Letter 1 යොදන්න ඕන.

අපි ISO File 1ක් extract කරා නම් "F:\sources\sxs /LimitAccess " කොටස වෙනුවට ගැලපෙන File Path එක දෙන්න ඕන.

ඒ Command 1 execute කරපු ගමන්ම .NET Framework 3.5 Install වෙන්න පටන් ගන්නවා.ඊට පස්සෙ කරන්න තියෙන්නෙ Install වෙලා ඉවර වෙනකම් බලගෙන ඉන්න විතරයි.



   මේ ක්‍රමයට ගොඩක් ලේසියෙන්, Internet Connection එකක් නැතුව .NET Framework 3.5 install  කරගන්න පුලුවන්.









Optimize you working enviorenment : Single command to create & move to a directory in linux (C Shell, Bash)

Usually move to a directory just after creating is bit of a anxious task specially if the directory name is too long. mkdir long-name-of...