Saturday, August 10, 2013

Hirikatu Oya Sri Lanka

Located between Balangoda town and Pamabahinna in A4 road, Hirikatu oya is nice place to have a bath on your way. 


Sunday, January 6, 2013

Ran Mal Holiday Resort Sri Lanka


Situated in Old Galle Road, Moratuwa lying next to Bolgoda lake, Ran Mal Holiday Resort is a eco friendly star hotel. Ran Mal Holiday Resort offers variety of facilities for its visitors.

Facilities offered by Ran Mal Holiday Resort

  • 25 Air Conditioned Rooms.
  • 2 House Boats with Air Conditioned Rooms.
  • 2 Holiday Bungalows Each With Two Rooms.
  • Air Conditioned Banquet Halls for Wedding Receptions and Conferences.
  • Swimming Pools for Adults and Children with Swimming Lessons.
  • Restaurant, Coffee Shop and Garden Restaurant.
  • Floating Restaurant (Illuminated At Night) Navigable.
  • Sight Seeing, Bird Watching Cruiser around the Island and Towards Kalutara.
  • Children’s Park.
  • Holiday Packages.
  • Fishing Boats.
  • Eco Island for Picnics, Conferences and Get-togethers etc.
  • Air Port Transfers.

Contact Ran Mal Holiday Resort

13th Mile Post (21 Km Post), South of Colombo. 346/5, Galle Road (Main Highway), Gorakana, Moratuwa, Sri Lanka. Tel : +94-38-2298921-5 Fax: +94-38-2298926 E- mail: ranmalhotel@rodesha.com web : www.ranmalholidayresort.com

Location of the Ran Mal Holiday Resort

(or click to view location of ran mal holiday resort)

View Larger Map

 

Wednesday, December 12, 2012

What are Closures in Javascript


Closures in javascript considered as an advanced feature. Closures is little tricky to understand. So understanding closure is an important thing.
Let’s look at a simple example

function start() {
  var text = "Hello World";
  function getText() {
    alert(text);
  }
  getText();
}
start ();

this is a very simple straight forward example. start() defines a local variable “text and a function getText(). And then it calls the getText function which returns the variable “text” which is not local to function getText but which is accessible from the outer scope. This is functional scoping.  
Consider the following example

function start() {
  var text = " Hello World ";
  function getText() {
    alert(text);
  }
  return getText;
}

var myFunc = start();
myFunc();

Basically local variables within a function exist only within the functions execution period.  But since myFunc() outputs an alert, it seems that it still has the access to the variable “text”.  The reason is the variable myFunc() has become a closure.

A "closure" is an expression (typically a function) that can have free variables together with an environment that binds those variables (that "closes" the expression).


Friday, November 30, 2012

URL rewriting

URL rewriting is a software running on web application framework. This software is used to generate more user friendly URL rather than a computer generated URL which are sometimes unreadable. 

Websites with dynamic content are often generated with URLs with computer generated content with query string parameters. URL rewriting can be applied in these situations to generate more readable URL. 

Ex: 
http://www.example.com/Content/Posts.php?Yr=2012&Mon=11&Day=18

this URL can be rewritten as 
http://www.example.com/Content/2012/11/18/article1

Benefits of URL Rewriting

  • More cleaner user friendly URLs
  • Query strings can be used to compromise information about the websites. URL rewriting minimizes this risk
  • Prevent inline linking
Web Frameworks
Almost all the popular web frameworks supports URL rewriting. Following are some of them.
  • Apache HTTP Server
  • IIS
  • Ruby on Rails
  • Java EE
  • Django
  • Codeigniter

Following are some of useful links for URL Rewriting

Thursday, November 29, 2012

Get Windows User ASP.NET


When developing ASP.NET applications, there might be situations where you need to know who is the currently logged in Windows user in to do things like authorization, authentication etc. These might b e useful when you are developing applications for the internal use within an organization. 

Luckily ASP.NET has few options built in to get the currently logged in user. You can use one of the following code snippet to get the current user.

1.

string user = HttpContext.Current.User.Identity.Name;


2. 

string user = Thread.CurrentPrincipal.Identity.Name;

2nd opiton only applies when you have specified in your web applications config file that the authentication mode is windows 

This is pretty straight forward and simple. 



Wednesday, September 12, 2012

Web Designing Guidelines Tips and Tricks

Web designing is a tricky business. It's a big market where lot of people day by day entering in to the profession. To survive the designer has to unique in what he or she designs. 

There are thousands of articles focusing on web designing therefore it is hard to find good set of rules to follow to be a great designer. Following are some of the articles which I find useful for web designing. 





Tuesday, September 4, 2012

User Input Handling in Windows Phone 7

In this tutorial we'll look at how to handle user interaction with Windows Phone. We'll use a Textbox a Button and a TextBlock to do this basic tutorial. This is very similar to the coding you do with Win forms or WPF. Difference is this is Windows Phone. 

1. First open Visual Studio Express 2010 for Windows Phone. Create a new project of the type "Windows Phone Application" . Give any name you like and select a location to be saved. Then the project will be created.

2. From the toolbox on left hand side. Drag and drop a TextBlock and a Textbox and place it in the Design view. Note that TextBlocks acts as the Labels you use in WPF. Remove the text in the Textbox from the properties window and replace the text of the TextBlock as "Enter your name"

3. Also drag and drop a Button and another TextBlock and place it in the Design view. Rename the content of the Button from "Button" to "Display". Remove the text in the TextBlock2. Finally the design view should appear similar to this (figure 1)

4. What we will do in this application is we'll prompt the user to enter his name and press display. Then a message will be displayed on the textBlock added in bottom. 

5. To do the coding for the button click event, double click the Display(button1) button. The event will be created in the code behind and you will be entered to the button1_Click method. 

6. Add the following code in the button1_Click event which will get the input from the textbox and display in the label.


Nothing really to explain. This will simply get the input from the textbox and display it in the textBlock.

7. Debug and run the application in the emulator. Try enter a name and pressing display.