Wednesday, April 9, 2014

Find birthday from NIC number (Sri Lanka) PL/SQL code

This program is design to find birthday from NIC number (Sri Lanka). Fell free to comment and optimize the code.

    TYPE daysInMonthArray IS VARRAY(12) OF VARCHAR2(2);
    days daysInMonthArray;
    year1 VARCHAR2(4);
    idText VARCHAR2(12);
    dayOfMonth NUMBER;
    j NUMBER;
    dateOfBirth DATE;
    daysOfYear NUMBER;
    month1 VARCHAR2(4);
    daysOfYear := 0;
    idText := '900780826v'; -- Enter your NIC number here
    days := daysInMonthArray('31','29','31','30','31','30','31','31','30','31','30','31');
    year1 := '19' || SUBSTR(idText,0, 2);
    daysOfYear := SUBSTR(idText,3, 3);
    IF (daysOfYear > 500) THEN
        daysOfYear := daysOfYear-500;
    END IF;

Sunday, February 16, 2014

Java Fraction Calculator Example

This example show you how to implement a simple calculator which can calculate fractions. Some best practices have been used. This example also will be helpful with University of Westminster / Informatics Institute of Technology - BEng(Hons) in Software Engineering 1st year modules.

Validated For :

  • Non numeric inputs
  • x/0 type fractions
  • 0/0 and 0/y type fractions
  • x/1 and x/x type fractions
  • -x/-y and x/-y  type fractions

IDE used : Eclipse (Kepler)

Download source from GitHub (Eclipse project)

Join code review

How to Open Existing Project in Eclipse

In Eclipse opening existing project is called as importing project into Eclipse. These steps tell you how to do it.

1. Open Eclipse and go to File > Import

2. Select General > Existing Project into Workspace and click Next.

Restrict Followers (Non Friends) From Commenting On Your Public Facebook Posts

Sometimes you have experienced that people who are not your friends commenting on your public Facebook posts and sometimes it's embarrassing. This post show you how to restrict those comments.

1. Go to Settings.

Step 1: Click on Settings.

Saturday, October 19, 2013

Angry Birds Go! - Racing Game Trailer

Get ready to race with Angry Birds! This time Rovio Mobile crater of Angry Birds has come up with a new idea to there Angry Birds game. It's a downhill race set on a 3D Piggy Island and they gonna call it Angry Birds Go which will be released on December 11th this year. Supports to your iOS, Android, Windows Phone 8 and BlackBerry 10 devices.

Game Trailer

Keyboard Shortcuts for Windows (Windows shortcut keys)

This article brings you a list of Microsoft Windows keyboard shortcuts and they are tested in Windows 7 environment.
Windows logo

  • F1 - Help
  • F2 - Rename objects (folders, files, ... )

  • Windows Logo (Windows key) - Start menu
  • Windows Logo + D - Minimizes all open windows and displays the desktop
  • Windows Logo + E - Open windows explorer (AKA My Computer /  Computer)
  • Windows Logo + F - Find computer (search files and folders)
  • Windows Logo + L - Lock the computer (without using CTRL+ALT+DELETE)
  • Windows Logo + M - Minimize all
  • Windows Logo + R - Run dialog box

Friday, September 20, 2013

What is Android?

Android logo
Android is a Linux-based operating system designed primarily for touchscreen mobile devices such as smartphones and tablet computers. Initially developed by Android, Inc., which Google backed financially and later bought in 2005.

Android is open source and Google releases the code under the Apache License. This open-source code and permissive licensing allows the software to be freely modified and distributed by device manufacturers, wireless carriers and enthusiast developers. Additionally, Android has a large community of developers writing applications ("apps") that extend the functionality of devices, written primarily in a customized version of the Java programming language.