Archive

Posts Tagged ‘Effortless’

Payroll System – source code

January 28th, 2012 218 views No comments

An analysis report on payroll system with diagrams is the 2nd most visited article. As per visitor’s interest I am writing this article to help you technically design your own payroll system.
I am not aware what computer language you prefer. So attaching source code for sample payroll system in maximum of languages. This is just for your reference and ideas. So you don’t leave any functionality by mistake while designing the whole system. It’ll also help you to complete your payroll system project in less time. And will give you an idea about screen designing.

Visual Basic .net

Payroll system in Visual Basic .net with source code
Account information
username: admin
password: admin

Java applet

Source code

Please rescan the downloaded files because I afraid from hackers before GOD ;-)

Let me know by your comments if you need more screen shots, source code or something else that can help you.

Java Collection Framework Doodle Chart – what to use when and why

November 21st, 2011 361 views 3 comments

I saw most of the people, including me, using ArrayList and HashMap only in their project. I was surprised why the Java provided us so many varieties of collection classes if we are done with only these two.

Since I was not interested to read a whole book for this so I made a doodle chart (cheat sheet, decision chart and short notes) that you can hang to your desk wall or somewhere on your notice board. I have tried to pin up all small aspects related to collection framework. It can help you to decide which class or data structure you should use in your project and why, to maintain high performance.

This is first version of the chart excluding the practical use of Queue interfaces and its classes. I’ll definitely cover them in next article or in next version of this chart.

java,cheat sheet,short notes,class diagram,collection framework,doodle chart

properties,hashtable,hashmap,set,map,sortedset,treemap,treeset,linkedlist,linkedhashmap,linkedhashset,hashset,IdentityHashMap,WeakHashMap,Dictionary,NavigableMap,NavigableSet

java,cheat sheet,short notes,class diagram,flowchart,collection framework,arraylist,hashtable,hashmap,set,map,sortedset,treemap,treeset,linkedlist,linkedhashmap,linkedhashset,hashset,IdentityHashMap,WeakHashMap,NavigableMap,NavigableSet

Above images are not suitable to reference. So you can download PDF version from below link.

This area is protected to registered users only.

*Above contents are copyrighted. You are free to redistribute the PDF or images but the credit to the author or author’s site must not be removed.

Interface vs abstract class – when to use what and why

November 13th, 2011 295 views No comments

After writing an article about practical difference between abstract class and interface, I found myself less practical in that article. So I am writing this revised article with some theoretical difference for your interview and practical differences so you can decide what to use when and why.

As we are aware with the concept of inheritance, child always inherits something from his parent. Sometimes it could be some assets, a child can use. And sometimes they can be some duties, a child is responsible for.

Real time scenario

Mr Gupta was very rich business man. He left 3 factories, 2 houses, 4 cars and a big bank balance to his only son Amit. But as per Gupta bequest, Amit was supposed to be agreed paying 17% of total profit to an organization as charity. He is not liable to change the procedure of charity. He was also supposed to renew some business licenses, insurance policies etc time to time. But he was free to do such payments in his own way.

Lets draw this situation…

abstract class vs interface when to use what example

Above class diagram depicts this real time scenario programmatically. Base class “Mr Gupta” is giving his assets to Amit. donate() is one of the method Amit received in inheritance. Amit will use donate() as it is, as Mr Gupta wanted. So the actual code for donate() will go in base class Mr Gupta. But there are some bequest conditions which must be followed by Amit but his own way. So the above diagram looks perfect for this situation. But the same can be drawn in following manner too.

abstract class vs interface when to use what example

When to use What?

Well it depends completely on your need. Basically, an abstract class is combined form of base class and interface.

Abstract class = Base class + Interface

But what is the base class then? In summary, a base class is a class which has something to give to his child. So the child can use it as it is without putting his own effort. However the child is free to decide his own way.

  • If a base class has no asset to give to his child then there is no sense to make it.
  • Similarly, if a base class has nothing to give but wants his child to implement some procedures then you must go for Interface not a class.
  • And if base class has something to give and something he wants from his child to do mandatory then you must go for an abstract class.

Mathematically


Abstract class = Base class + Interface
Interface = Abstract class – Base class
Base class = Abstract class – Interface

Now there are some thumb rules which can help you to design time confusion. Just follow them.

Rules:

  1. If there are more than one inheritance trees in your application and you want some common functionalities in both tree then use Interface. If these functionalities are closely related to one inheritance tree then go for abstract class.
  2. Make three set of functionalities which must be followed by classes under a single inheritance tree:
    1. Common for all classes
    2. Common for some classes but not all
    3. Separate for each class

    for (a), create abstract class. For (b), create Interface. And for (c), include the functionality in class itself.

  3. Use interface to define the type of any class [Example: Serializable interface, Comparable interface].
  4. Use interface when you wants methods with same name among many classes. It helps you to call such methods without knowing class type using either reflection or a reference object of interface. [Example: Java Comparable, Java Collection, How to force a programmer to implement an interface]
  5. Dynamic proxies. The invaluable java.lang.reflect.Proxy class allows you to make an implementation of any interface at runtime, where calling any of the interface’s methods results in a call to a single invoke method. Read about Proxy Pattern before knowing more about Dynamic proxies.

What to care about

There are points you must keep in your mind before designing your class diagram.

  1. There should be as minimum as possible abstract methods in an abstract class or an interface. Because inclusion or exclusion of any method in the future require the change in all the classes of related inheritance tree.
  2. Since an abstract class is a base class so you can add an implemented method to this.
  3. Since an abstract class is a base class so it must have some implemented methods being used by child classes. So removing an abstract class from an inheritance tree requires changes in all classes beneath the abstract class. But converting it to base class would be an easier deal.
  4. Removing an interface from an inheritance trees is really an easier approach until that interface is not being used as a type of a class. [See this example: player]
  5. Retrofitting an interface to a class is much easier than a class since a class can implement any number of interface but can extent only single class at a time.
  6. Interfaces are designed with the concept of implementing its all methods. Some of them might not be suitable for all classes. But programmers are supposed to implement those useless methods in their class. It results ignoring interface.

*This article is copyrighted under creative common license. You are free to redistribute this article but with credit to original article

Sequence Diagrams

May 6th, 2011 258 views No comments

Time is running out for college students, they are hurried in preparing reports. I already had written article over UML Types with the purpose of helping them in preparing reports.

Diagrams, statistics, and UI designs are most important part of the project report. Fewer people are interested to read whole the report. They analyze your project from the diagrams inscribed in your report.

Here, one more short & sweet tutorial about Sequence diagram which helps you to understand the flow of your project. Sequence diagram helps you to know the sequence of interaction between various components(like classes, database etc). You can clearly show the steps of a complete process with these diagrams.

Please refer below guide for your reference. You can save it to read offline.



If you need more examples for your study, just comment here…

How to integrate Rupee or other currency symbol on your webpage without images

April 26th, 2011 117 views No comments

You would have seen many websites showing text with stylish fonts, even if those fonts are not available on client site.
It’s very simple. Just copy paste a CSS code somewhere in HEAD tag.

If you are aware with my new font amty currency then you can do it in next 2 steps very easily.

  1. You need fonts(various format) to keep on your web server. You can download them from the download link given in the end of this article.
  2. Use the following CSS code in your CSS file or on your webpage
@font-face {
	font-family: 'Conv_AmtyCurrency';
	src: url('fonts/AmtyCurrency.eot');
	src: local('?'),
	url('fonts/AmtyCurrency.woff') format('woff'),
	url('fonts/AmtyCurrency.ttf') format('truetype'),
	url('fonts/AmtyCurrency.svg') format('svg');
	font-weight: normal;
	font-style: normal;
}
Please note this

  1. Different browsers support different version of font. So we must to keep and reference all type of fonts on web server
  2. Amty Currency font is open source. So it can be used by any organization
  3. Remember that @font-face increase one extra http request since required font are not referred from client cache.
  4. Referring images instead of font could be a good option since images are stored in client cache. And they decrease http requests. In addition images can be merged with other images. And it can be used as image sprite.
  5. Using font is better than images since you can re-size it, color it as per your need. For every symbol of font you need not to create a separate image.

Sample Demo & required files

This area is protected to registered users only.

Simplest Shortest Sweetest Servlet tutorial – Part 1b including Tomcat configuration

February 13th, 2011 177 views No comments

Development and deployment of J2EE applications are different than java standalone applications.

Simplest Shortest Sweetest Servlet tutorial – Part 1 will tell you about basic concept of servlet. And will remove your fear to build any J2EE application

Sample Java Servlet for your reference has sample code for your reference purpose.

But now you need to know practically how to develop a servlet based J2EE application. Although it is possible to develop all the code with only JDK but I’ll suggest to use some IDE like Eclipse or NetBeans.

Watch below shortest servlet video tutorial….(Eclipse)

Servlet development using Eclipse and Tomcat


If you want to switch from Eclipse to Netbeans or vice versa refer below articles;
How to import NetBeans project into Eclipse

Virtual Lab

February 12th, 2011 108 views No comments

The Virtual Lab is intended as a flexible teaching and learning tool. It can be used for in-class discussions, pre-lab activities, or novel types of homework problems. The aim of this project is to increase student learning and motivation.


Virtual Chemistry Lab



Plan all Halts of your Life

February 11th, 2011 774 views No comments

Normally people start feeling their responsibility once they cross age of 30 or when they got married. But some out of them starts planning their budget from the initial halt of their life. Like me…. Ha ha ha..

If you are not very good in finance and avoid bulky & boring clerical work then below excel templates would help you surely to plan your budget

Halt 1 : Personal Budget Planning

Personal budget planner excel template

Halt 2 : Wedding Budget Planning

Wedding budget planner excel template

Halt 3 : Family Budget Planning

Family budget planner excel template

Halt 4 : Kids Money Management

Kids Money Management planner excel template

Halt 5 : Retirement Plan

How to extract all images from PDF in one short?

January 11th, 2011 87 views No comments

If you are a web designer or graphics designer then you must be aware with this trick. But if you are not then it can become very helpful to save your time and effort.

For this, Import your PDF file in photoshop software. From the dialog box appeared, select image option and continue your work.

PDF in Photoshop import dialogbox

Manage your project timeline, timesheet, effort and much more without effort

January 10th, 2011 2743 views No comments

Preparing a classical ugly textual report using some word editor may make your impression down in your supervisor attention. On the other hand, if you prepare a report containing charts, graphs, figures and data arranged in tabular format then it may require extra technical knowledge and time.
Well!! I have solution for both. Use below excel templates which can minimize your official documentation work as per your need.

1
Timesheet
Timesheet excel template
2
Timeline
Timeline excel template
3
Gantt Chart
Gantt chart excel template
4
Critical Path Method
Critical time method excel template
5
Vacation
track Employee vacation excel template

Faster way to pay off credit card bill

January 9th, 2011 338 views No comments
  1. Ever wondered what it may take to come out of a credit card debt?
  2. How long it will take to pay off credit card balance with and without making more monthly payments?
  3. What to do to pay off faster?
  4. Handout the below excel template Credit Card Payoff Calculator which can help you to answer above questions

With help of this calculator it will be easier to figure out the ways to completely pay off your credit card debt and helps to understand just how much it can really cost you in interest.

faster way to pay off credit card bill excel template

*click above image for downloading

Manage your schedules with excel templates

January 9th, 2011 3956 views No comments

If you know how to work with excel then these working sample excel templates shall give you better experience. Here are some excel templates to schedule your weekly,monthly or yearly work, shifts etc. effectively.

A good reason about working with excel sheet is, you need not to install any software.

Download the below excels and organize your time. All the best.

1
Schedule your work
work schedule excel template
2
Organize work assignments for an entire week
shift schedule excel template
3
Schedule the week
weekly schedule excel template
4
Baby feeding Schedule
Baby feeding schedule excel template

Embed Everything

December 13th, 2010 78 views No comments

Many visitors are never interested to download the contents first then check them. They want to take snapshot about the contents from your site/article/post itself. You must help them to view documents online instead of downloading any document to their local PC or to installing any plugin. It’ll remove an overhead from your visitor and will increase hits on your site.


noticeboard embed everything to a webpage

What you need to embed

  1. Word document
  2. Power point presentation
  3. Excel worksheet
  4. PDF documents
  5. Video

I already had suggested about how to embed documents using google . But if you want to avoid any manual intervention then TGN plugin (for wordpress users) would be a good option.

How to use TGN

While writing an article, you can use short code to embed any document on your page. TGN must be installed in advance.

YouTube
[ youtube article-stack]

VideoReadr
[ videoreadr article-stack]

PDF
[ pdf article-stack]

PowerPoint
[ powerpoint article-stack]

Microsoft Word
[ word article-stack]

Note that: remember to replace “article-stack” keyword with valid link for your documents or video ID.

Use the power of wordpress inbuilt thickbox

December 12th, 2010 170 views No comments

Many people search for plugins to add support of jquery based thickbox. But do you know this is already included in your wordpress bundle. Let’s try
article-stack in wordpress inbuilt jquery thickbox

Suppose you want to open a webpage into thickbox. Just add following code at the end of last link we made above

&embedded=true&KeepThis=true&TB_iframe=true&height=400&width=650

And add following code to your anchor tag.

  class="thickbox"

For Example

For more guidance, refer jquery thickbox

Eco friendly signature

October 11th, 2010 298 views No comments

Using green accessories might be helpful to spread “Go green” message among the people. But it’ll be better if you explain it to people about how to go green. It doesn’t require any effort. You just need to replace existing go green images in your signature with the images given below.

My sister (Manisha Gupta) made all below images to give words for “Go Green” message. These all images and messages are self explanatory. Just use them in your mail signature or wherever you can.

Use cycle avoid bike for short distances

Avoid rickshaws support car pooling use public transportation

*open above images in new browser

Best suitable for your signature

Use cycle avoid bike for short distances  signature image

Avoid rickshaws support car pooling use public transportation signature image

*Please suggest if you have some other ideas.

Regular Expressions: Common elements part 2 (Range Search)

September 30th, 2010 82 views No comments


Regular Expression

I had covered following components in last chapter of common elements

  1. ^(Start),
  2. $(End),
  3. .(Any char),
  4. *( zero or more occurrences),
  5. +( one or more occurrences) and
  6. ?( zero or one occurrences)
What if you need to limit your search up to some characters only? For example, you have to search for mobile number.

Range Search

Range search let you search for specified characters or their range. You need to enclose all characters with in square brackets as follows

 	[abcd987ABCD] 

Example

        [0123456789]+

You can use above RE for mobile number searching. However, there are two things wrong with this RE.

1) If characters increased then length of RE is increased
2) Mobile numbers are generally 10 digits. While this RE will search all numeric words contain at least 1 digit.

Lets resolve these issues,

1
Define range to decrease RE length. You can define numeric and character range as follow

[0-9] It means any character from 0 to 9.
[a-z] any character from a to z.
[A-Z] any character from A to Z.

You can limit the range like [/c],[01] or [A-J].
Or you can combine them as [a-z0-9A-U].
You can also use some special characters, back slashes characters and spaces like [a-z@\. \t]

Examples
1. Search for all CAPITAL Words.

     [A-Z]+ 

2. Search for Moblie numbers

 	[0-9]+ 

3. Search for email ids (An email id can contain “.”,”_”. And website name can contain “-“ )

 	[a-z0-9\_\.]+@[a-z0-9\-]+\.[a-z]+ 

If you add “^” just after “[“ then it search for exclusion of characters. For example;

 [^0-9]* 

Above RE will search for every character excluding numeric chars.

2
Fix number of occurrences

*, + are used to set minimum occurrence. We can define maximum or minimum limit of occurrences of RE.

r{m} exact m occurrences of r
r{m,} at least m occurrences of r
r{n,m} n to m occurrences of r

Examples

Mobile number has 10 fixed digits.

	[0-9]{10}

Domain name should be less than 5 characters.

 	[a-z0-9\_\.]+@[a-z0-9\-]+\.[a-z]{2,5}

How to test Regular expression across the programming languages?

September 29th, 2010 218 views 2 comments


Regular expression

Prerequisite

Regular expression, in introduction with full of example

A regular expression (regex or regexp for short) is a special text string for describing a search pattern.

There are various flavours of Regular Expressions. All the flavours are 80% common. Some languages provide more elements, functions and keywords for efficient searching. Maximum of them have common regular expression elements. You can test them in various languages as follow.

AWK

    awk ‘/RE/’ filename

JAVA

	boolean b = Pattern.matches("RE", "contents");

PHP

        preg_match_all(‘/RE/’,$contents,$result_array)

PERL
I havn’t gone through PERL syntax. But they are similar to AWK.

C# (.NET)

	Regex pattern=new Regex("RE");
        bool matching = return pattern.IsMatch("Contents");

Common elements are also supported by rich text editor programs like textpad or notepad++.

You can also try Online Tool to test for testing regular expression.

Test Regular expressions online, save time and effort

September 27th, 2010 106 views No comments

If you are having internet and less time to build any application for testing Regular expressions then you can go for online tester. You just need to copy paste your contents. Write appropriate regular expression. And see the result.


Regular Expression Online tester

Another sample inventory database for boutique

September 20th, 2010 732 views 2 comments
database for boutique
I had made a project in college on a boutique shop. And this time I am sharing its dummy database with you. You may use its database to build your own application.

This database contains enough data for your practice and to test your application completely. Still if you do some changes or populate it with more data then please share it with me. So I can spread your work.

Download here
This area is protected to registered users only.

Know about Social Networking in next 2 minutes

September 20th, 2010 20 views No comments

Social networking is nothing but a process/ way to keep contacts with many people over the net. Even you don’t know many of them.

You say others about you, about what are you doing or what are your future plans. Many times there is no reason behind talking, but talking only. In other words you can say that it is a way of public sharing.