Archive

Posts Tagged ‘review’

Interface vs Abstract classes, a practical difference

May 16th, 2011 510 views 2 comments

An Interface: This is a collection of methods. They have no definition whatsoever and their function is determined by the class that implements them. An example of an interface is a List. All lists (ArrayList, LinkedList) have add() and remove() methods because they implement the List interface, which demands them.

public interface List {
    public void add (Object o);
    public void remove (Object o);
}

public class MyList implements List {

    public void add (Object o) {
       // I must implement this method because of the interface List
    }

    public void remove (Object o) {
       // I must implement this method because of the interface List
    }
}

The implements keyword is used by a class to indicate that it is going to implement the methods demanded by an interface. A class can implement as many interfaces as it likes; the only requirement is that it provides a definition for each of those methods. It can also be defined as abstract and rely upon its subclasses to define some. Then, those methods are just like the abstract methods of any other abstract class.

Take an example of List interface. Most methods don’t care what kind of list they get; they just want to know that the object supports the common list methods. In the statement:

List<String> myList = new ArrayList();

You are creating an actual ArrayList object, but hiding it’s implementation under the List interface. Then, later, if you decide to use a LinkedList instead, you don’t have to change all of your code since it is also implementing the List interface.

Interface is programming structure where you define your functions/services that you want to expose to public or other modules. Kind of a contract where you promise that you are providing some functionalities or services, but hiding the implementation so that implementation can be changed without affecting your contract.

Abstract class is a partially implemented class and it has no real meaning other than serving as a parent for multiple child classes those with real meaning. Abstract class is special parent class that provides default functionalities to multiple child classes. It is created as abstract because of unavailability of suitable concrete parent class.

The extends keyword is used by a class to indicate that it is going to add functionality to some existing class. If the parent class is abstract, the extending class must implement any of those abstract methods in the parent.

Unlike interfaces, abstract classes can contain fields that are not static and final, and they can contain implemented methods. Such abstract classes are similar to interfaces, except that they provide a partial implementation, leaving it to subclasses to complete the implementation. If an abstract class contains only abstract method declarations, it should be declared as an interface instead.

Points to remember:

Interfaces and interface methods are implicitly abstract even if not declared as so. So there is no need to explicitly specify it.

Below code is senseless.

public abstract interface <interface-name> {
 public abstract void <function-name>(...);
}

Other differences

  1. An interface can extend any number of interfaces.
  2. A class can optionally extend exactly one class; it extends Object if you don’t specify anything.
  3. A class can implement any number of interfaces.
  4. Any class can be declared abstract.
  5. Any class that has abstract methods must be declared abstract.
  6. Any class that extends an abstract class or implements an interface must implement all abstract and interface methods or else must be declared abstract.

Practical usages and designs to inscribe clear picture in your mind

  • Interfaces allow the creation of proxies that encapsulate a concrete class. This is used extensively by frameworks in order to intercept method calls to the concrete class (e.g., for starting a transaction before the method is executed or to write to the log).
  • Keep watch over upload file size
  • Creating progress monitor in Java
  • If an abstract class contains only abstract method declarations, it should be declared as an interface instead.

I am designing an java based API. I’ll share its design once it is completed. It’ll help you to understand the concepts of interfaces, abstract classes, enum, modifers, creating your own data type, delegators, OOPS concept etc. with example. So keep reading….

Brute-force and dictionary attack, poor hacking tactics

April 29th, 2011 360 views No comments

Mr. Das noticed that his boss entered a 5-6 digit password in his personal management project. Mr. Das noticed only 1st digit of the password. Next day he made all possible combination with 5-6 digits where the first digit was known. He used brute-force attacker software to generate and apply combination in less time. And he cracked the password.

A brute force attack means trying every possible combination until you find the right one.

Alphabet combination on wallpaper

You are free to customize input characters, password length. For example

For letters 1,3,a,t,u, some possible combinations would be

13atu

13aut

13tau

:

atu31

31tua

:

You can give input characters to limit number of words. You can also limit the length of password like if you keep password length 4 for above example then combination would be;

3au1

3ta1

:

dictionary attack is very similar to Brute-force attack. But it is little bit faster. It doesn’t make combination of input characters but uses dictionary word. This is somewhat like making anagram.

Why do I call it as poor hacking tactics?

A hacker never believes in Hit & Try. They search for a proper method. There is always some logic behind any step they take. I hacked locked folders and locked ZIP files too. But I never used any brute force attacker.

How to protect you from Brute-force and dictionary attack?

Never let anyone enter password many times nor enter password in other’s presence.

You can’t control people to enter password many times. But a programmer can do. Read below mentioned points which would help a programmer and user as well to avoid such attacks.

Programmer’s point of view

  • Lock the account after fixed number of failed login attempts.
  • Block an IP, where you get many failed login attempts from.
  • You may increase interval between two logins.
  • Don’t let user set password less than 6 or 8 length.
  • Ask users to set password containing alphanumeric & special characters.

User’s point of view

  • Password length must be more than 6-8 characters.
  • Your password must not be any dictionary word.
  • You must use alpha numeric & special characters in your password.
  • Don’t use password like your PAN# or mob# or something that can be guessed easily.
  • Change password regularly, once in a month or as per your choice.
These attacks fail breaking lengthy and stronger passwords.

Remember that brute force & dictionary attacks are not only the way to hack your password. The worst technique for users is keylogger and for programmer is SQL injection.

Categories: Discussion & reviews Tags: , ,

What project you are planning to develop in this semester

January 11th, 2011 133 views No comments

I observed that in most of the colleges, distribution of projects (as a college assignment) is very much similar every year, as it is given below.

Project Name Group size Popularity in %
Library Management 4 20
Hotel Management 3-4 15
HR Management 7-8 30
Cyber cafe Management 2 5
Transportation management 2 5
Other application like antivirus, dictionary etc 2 each 3 – 5
Other Management projects 3-4 each 20-30
Inventory management 3-4 20
Payroll management 2-3 15
School or college management 3-4 20

*This table is applicable only for computer branch students. And it might not be fit for some colleges.

All the projects which I mentioned are generally developed every year. And their understanding and documents flow from seniors to juniors like heirloom.

Ideas for project planning

Why don’t you try something different in this semester?

If you are deeply interested to design only management projects, It is not necessary that your project must have database. You may go beyond of this.

  • Make a network based application like a chat messenger which supports video chatting.
  • Or a FTP client that let you uploads & downloads files from a server.
  • You may either go for your own SMTP server or a mail server.

If you had set up your mind for standalone applications but not network based application then you may refer these topics as well

  • Mobile based dictionary
  • Or mobile based local bus timetable.
  • You also can develop a rich text editor
  • Or a traffic monitor system

Have a look on some web based applications

  • Develop a web based application to manage your appointments. Who can remind you and can present a calendar view.
  • You can develop an application which let user submit their message to various online social networking sites.
  • You can redesign your college website. So that it can be controlled fully from the back end.

Why to develop management type of project

These projects increase your understanding in a particular domain. You can highlight your domain knowledge in your resume. Further you can easily join a firm or an organization belongs to a particular domain like banking, finance or something else. All management based application use database. So their development shall increase your database knowledge as well. Database knowledge is primary to get selected in an offline campus. I’ll support if you do some certification in a particular domain parallel with your study. It’ll definitely help you in project development and campus selection as well.

Why not to develop management type of project

Application like network or mobile based applications, increases your knowledge in a particular technology. They give you confidence to work independently. You can make many of open source applications to weight up your resume. Moreover, If you are working on something different application or project then it’ll definitely fetch attention of your whole class and teachers as well.

Highly Paid keywords

December 26th, 2010 15 views No comments

Are you still eager to know how to earn more revenue from your posts? Well! This question is having no perfect answer. Because, it is all about your site traffic and contents quality. Writing about the topics which are highly searched might be a solution to increase the traffic. But your contents must have some uniqueness from others. So that earlier traffic can keep.

Here I am not discussing how you should improve contents quality. But about what you should write to earn largest revenue or profit. There is the list of highly paid keywords. Find out the highly searched keywords which are common in below list. Means, the list of keywords which are highly paid and highly searched. It’ll not only increase the traffic but will increase revenue.

How to earn more revenue from adsense

December 23rd, 2010 59 views No comments

Do you want to earn more money through adsense? You must had plant google adsense(or other) to your website. But if you check their performance, you’ll find that many of the clicks are unpaid. And many clicks have very less revenue. What are you planning to do now?


highly paid keywords

The same I was thinking some days ago. And I concluded with following points.

  1. There always a fight between adsense networks. I’ll suggest you to use at least 2 adsense like google, adbrite etc. After this I got better quality ads on my site.
  2. Write articles about keywords which are highly searched. It’ll increase traffic on your site.
  3. Never forget to write on topics which are unique and specific. Even if they are not covered in highly searched keywords. It’ll increase visitors interest, unique visitors, popularity etc
  4. Never publish more than 3-4 ads from the same adsense network on a web page. It’ll increase competition among ads provider. And you’ll get the chance to show highly paid ads.
  5. Try to cover highly paid keywords in your articles.

Highly paid keywords

From many of the sites, google adwords, trends and many more, i prepared the list of highly paid keywords.


Cheap
Loan
Insurance
Offer
Fare
Trip
Tour
Place
tickets
deal
discount
top
services
laptop
software
Credit card
car

You can group the above words suite to your articles. Like


Cheap car insurance
cheap holiday tour package
credit card offer
lowest air fare
cheap air fare
travel insurance
best deal on car sale
cheapest air tickets
auto insurance
:
:

I hope this will increase adsense revenue on your site very soon. Remember that you must not write any article only over these keywords. Because your adsense network may ban you. Better to use some of them and write articles so.

This article is about highly paid keywords. There are many SEO ways to increase your site popularity. Which will definitely increase traffic then revenue. We’ll discuss about it later

Disputed region on INDIA map, what Google and McaFee showing about

October 29th, 2010 243 views No comments

Google shows different maps to Indians and Chinese

In the Indian Version, it shows “ Arunachal Pradesh” as a Disputed region(Not even a part of India)
where as in the Chinese version, it shows Arunachal Pradesh as an INTEGRAL PART of CHINA. Don ‘t forget to look Jammu & Kashmir part.

India version


Google india map indian version including disputed area

Chinese version

Google india map Chinese version excluding disputed area

From last 22 months this map is not changed. Might be it is present from a long time

McaFee global virus map

On the other hand, McaFee global virus map is showing Arunachal Pradesh as a part of INDIA. But he has clearly removed disputed region of Jammu & Kashmir from INDIA. This map is not changed at least from last 3 years.


McaFee global virus map india excluding disputed area

Categories: News & Information Tags: , , ,

Is Google not safe for safe search

October 17th, 2010 59 views 1 comment

Google search banned During writing of Powerset vs Google, who is better?, I observed that google is not good in safe search. I found that if you search for some vulgar or spam words on google, it returns result which are not suitable for minors.

Now the question is,

if you don’t want unwanted result then why are you searching for those words?

Well! The answer is

As per the human mentality, a person ever try to search or discover the things or topics which are not clearly visible or available to them. But it doesn’t mean that you should serve them whatever they want.

For the sake of children career, their future and mental growth, parent control is required. Some days ago I wrote an article about some advertisements should be banned in public. Although the advertisements are first step of selling a product but sometimes they might be as harmful as an adult movie for children.

Please read, Why should you bane google on your home PC? if your child access that PC.

This is not only the point i wanted to discussion. Read Top 5 google fallouts to know “why indians are demanding google banned?”

Is Google not good for back link search?

October 15th, 2010 112 views 6 comments

A long time back when I searched for back links over google, I got 6 results. Which are decreased up to 4 when I searched today. On the other hand, Google webmaster tools tells me that there are total 12 back links for my site.


Google direct back link search

Google webmaster tools back link

Who is correct?

I raised this question on stackexchange (a QA site network). With other’s answers and my personal observation, I concluded that Google is not good in itself for back link search.

If you search

link:article-stack.com
and
link:article-stack.com site:some-domain.com

As per concept, 2nd query is the subset of 1st query. But practically 1st query returns only 4 results. While 2nd query returns more than 350 records.

DisgruntledGoat Says

regarding the fact the “subset” query shows more than the first query: It’s likely that the standard link: query only shows links without nofollow, whereas the subset simply includes all links from the specified site, whether they count or not.

I had checked manually all links on my site. No one is tagged as “nofollow”.

Moreover by the concept, “link:article-stack.com“ should not show results from my site itself.

But what if others sites ( referring to my site) are not cached or indexed by google? They also would not be counted and displayed in result. So I checked manually on google for all these pages which are referring my site. And I found that all the sites are indexed and cached at google end.

Finally, Simone Carletti suggested me one more online tool majesticseo. Just see back link search result on majesticseo.


majesticseo back link search

I am completely satisfied with the above result.

Why should you bane google on your home PC

October 10th, 2010 50 views No comments

I agree with these two facts

  1. Most of the people use only google for searching. Even now the google has has taken place in English dictionary as a synonym of search.
  2. Most of the parent uses parent control software on their PC. So that their children would not have to face any unwanted contents knowingly or unknowingly.

But…

Have you forgotten to ban google on your PC?

I need not to say “why?”. You experience it yourself. Lets do some exercise;

Search for some images with some spam or vulgar keywords on bing, yahoo and google.

You’ll see that Bing and Yahoo will not show you results which are banned by the government. Even you set safe search off in Bing, you’ll not get inappropriate result. On the other hand Yahoo will not allow you to off the safe search. If you get some vulgar suggestion and click them, still those results will be banned. This search depends on country to country. At least these results are banned in INDIA as per Indian Information Act.

bing image search result

yahoo image search result

On the other hand, if you search same keywords on google, you’ll surely get inappropriate result which are suitable for your children. You’ll get these results even if safe search is on.


google image search result

*i cropped the above image. Because the previous image, even after hiding the hiding some place, was banned.

Remember that the google is not only the option for searching in contrast of study. Read Powerset vs Google, who is better? for this.

How social networks predict epidemics

September 19th, 2010 15 views No comments

Mouth publishing is the best way to advertise something. It affects more than a TV advertisement. Social networking is spreading worldwide like an epidemic. Whatever people do, they share everything over the net. They even write about what they are currently doing, what they are feeling and what are their plans.



If you collects and analyze all data correctly then you can predict about what most of the people are about to do. You can know the people habits of particular region, or their need or current trend, fashion and many things.

Surprised Hindi Translation

September 15th, 2010 112 views No comments
online hindi translation result

While searching on Google I read about SAMSUNG. And this result made me read the article. This result was in Hindi which was translated by some online translation tools. After first reading, I thought about some breaking news about SAMSUNG. Just refer below image.


online hindi translation result

Now see what was the actual heading – “Samsung Unveils Orion, Dual-Core Processor Replacement Hummingbird”

There is one more picture that I took from that site. It is about donation, asking for a cup of coffee. But their Hindi translations will completely opposite. If I add one comma before last two words it’ll mean that why do we buy one cup tea? At least I don’t.

WordPress security plugins for complete security, only 4

September 15th, 2010 28 views No comments
wordpress army helmet

You’ll find many posts over wordpress security plug-ins. But I had excluded all plug-ins which do less work that you can do by changing some settings. Like creating .htaccess file etc.

I also not mentioned plug-ins related to SSL. SSL certificates let you connect to your server with encrypted channel which is very secure. You need to buy SSL certificate. You can use shared or private certificates. But in both cases you need to payment. Since most of the bloggers doesn’t go for buying SSL certificates. So I avoided them.

Try to use plug-ins as less as possible for the sake of performance. Some plugins may lead security hack

Moreover, I don’t consider a plug-in for database operation or backup procedure in security category. So all those plug-ins I’ll discuss in other article later.

You can achieve full security by using very less number of plug-ins. Some of them are;

Akismet - It helps you to protect from SPAM. In simple words you can say. If someone comments on a post just for advertisement or uses offensive word then Akismet can stop them.

Block Bad Queries (BBQ) - I hope all of you are aware with SQL injection. SQL injections are nothing but some complex SQL queries written with the aim of breaking your site security. And to get internal information of your site database as much as possible. This plug-in can control SQL injection & base64 attacks till some extension.

Login LockDown - Login LockDown controls number of unsuccessful login attempts. So you ever be safe from brute force & dictionary attack.

WordPress File Monitor - As its name suggest, it monitors all files on your server. This plug-in tells you about what files are changed on your server. So that you can identify whether the mentioned files are changed by you or by some script.

Twitter custom background on low resolution

September 8th, 2010 67 views No comments

Have you ever changed background image of your twitter background? You can do it from its setting page.

Now see what problem may arise when someone looks your twitter profile on low resolution screen. I found it while designing theme for my site.


Twitter custom background bug

If you are building a site with big background don’t forget to read fix for web page background position.

How to test a web page in many browsers and platforms in one short

September 1st, 2010 47 views No comments

If you already had read article over margin fix and float fix then you must be interested to test your website on various browsers, their versions and various platforms.
It is not easy to install all browsers on your local machine. Nor you can arrange many platforms. It’ll not only be expensive but time consuming. If you your website on one browser it must take 1 min on average.
Well!! I have a solution. Use browsershots. Browsershots lets you test any website online in few seconds.

It generates screen shot from various browsers on various platforms. You can select your desire platform, browser or their version.


browsershots options

Once your request is processed, you can see thumbnail for all results. Click on any thumbnail to see full image and detail.

browsershots result

Problems

  1. You cannot test a site which is not published since you need to give URL of a site.
  2. You might stick in queue. If there are many requests for a browser then it’ll put you in queue. You will have to revisit the site for screenshots. You need not to search again. Just use the URL looks like http://browsershots.org/http://article-stack.com/

Once you analyze generated screen shots, you might need CSS compatibility charts to identify the problem, if any and to fix them.

when Yatra failed

August 4th, 2010 88 views 1 comment

On date 2nd Aug, I found Yatra.com, a popular site for traveling, in trouble. I can’t say whether there was a problem in their database or they were cheating with their customers. As you can see in below screen shots, you’ll found some coding related issues. These issues are expected while web pages are changed frequently. Or it runs across various platforms. I run YATRA on IE7 on windows machine.

1
I entered FROM station name then i moved to next text box. Suddenly i found that i filled a wrong entry. But i was unable to move to any text box. Neither using key board nor using mouse. I was supposed to refresh page. Or to continue search with wrong entries.

yatra locked


2
Even though the page was not showing any error in loading java script, I found that their AJAX based search was not working properly It was not giving any station name” suggestion.

yatra suggestion failed

We also found many errors that time. But as per our assumption, some back end activities must going on. They must launch site in their testing servers first.

3
Well Now see what happen when my one colleague tried to book a ticket. YATRA was giving an offer that “Book any one rail ticket and get one airline ticket free” (domestic traveling). He found that most of the trains were canceled. We were surprised that how could it be happen with many trains while no one is seasonal train. We found same train on railway’s site. You can see it screen shot.

yatra fake entries

Categories: Discussion & reviews Tags: , ,

Powerset vs Google, who is better?

July 30th, 2010 33 views No comments
kangana on google

Database size of powerset search engine is very less than google. So it display limited search results. Still I prefer powerset. Specially when I don’t have exact word to search.
Searching over powerset is based on natural language processing. It can understands your question and arranges the results accordingly.


I searched for “kangana”. Powerset identifies it as people name. And gave little bibliography of the person. Then it displayed the rest results. While google takes it as a word only. Google doesn’t categorized or grouped the result.

kangana on powerset

Even though I prefer google. Why?
I prefer powerset when I am not having exact word to search. I searched over powerset, collects word and prepare new search query for more relevant search through google. I never prefer powerset for recent news or images or any activities. As per my opinion, powerset is very good search engine but for historical search only.
I feel powerset is just a very good replacement of wikipedia. If you are preparing reports or working on some case study then powerset can help you a lot.

What I missed in powerset…

Safe search off
There is no option to enable or disable safe search. Although the contents provided by powerset are filtered in itself.

Real time search
Powerset doesn’t search for current activities or news. It just searched over wikipedia.

Less data base size
Large database provide you better results. It also helps to bring most popular and relevant web pages in front of users. Even though powerset give most relevant search. Still the contents provided them are not sufficient to me.

Why powerset is best?

If you consider powerset and google as two people and whole world as library then I would say that powerset will bring you only the books you really required. On the other hand, google will bring many books which may or may not suite to your searches.

Why google is best?

Powerset searches over limited data. So the results are not rich enough. If you are searching for basic principal then one good book may be sufficient for you. But if you are searching for tips & tricks or some smarter ways to do the same task then you’ll have to refer other books and research papers as well. Google has huge amount of data. So it gives more result. Some of them may suggest you some different and better result which you might not expected. Moreover google scans all web periodically. So the contents provided by google are generally latest.

When to use powerset?

As I already had written above, If you are not having exact word what you are searching for, then you must prefer powerset. Moreover if you are doing some case study or preparing reports then powerset can help you a lot. Besides, google search for words in a statement but powerset can understand a question. So if you are writing a question like “Where is mumbai?”, then powerset can give you more relevant results.
Please note this
There is no comparison between google and powerset. It depends on what you are searching for.

India’s Right to Education 2010, a hope

July 29th, 2010 510 views 1 comment
child education


Highlight

  1. Every child between the ages of 6 to 14 years has the right to free and compulsory education. This is stated as per the 86th Constitution Amendment Act added Article 21A. The right to education act seeks to give effect to this amendment
  2. The government schools shall provide free education to all the children and the schools will be managed by school management committees (SMC). Private schools shall admit at least 25% of the children in their schools without any fee.
  3. The National Commission for Elementary Education shall be constituted to monitor all aspects of elementary education including quality.

Our finance department has provided approximately 25,000 crore RS./ For this act.

Categories: News & Information Tags: , ,

irrelevant image search results

July 24th, 2010 28 views 2 comments

I tried to search “amty thumb” over various popular image search engines. I found that all search engines gives irrelevant results.
Bing suggested around 15 results. None of them were related to actual search.
Yahoo and altavista shown exactly same images. These images were also out of search.
Google returned highest quantity as usual. But none of them were useful.
NachoFoto returned no result.

amty thumb recent is a wordpress plugin that I made around 7 months ago. I wrote a post on this site around 2 months before for the same. I was expecting at least one search result from my site. I hadn’t submitted my site to any search engine. I just wanna see how relevant a search engine can search image or text without getting any submission from a site.

Categories: Other Tags: , , , , ,

Wordweb suggests better than MS Office

July 10th, 2010 64 views No comments
MS office 2007 spelling suggestion

Yesterday while writing an article over how to hack PC Security? & How to hack winzip? i committed spelling mistake. I found that MS Office 2007 was not having any perfect solution for that spelling as you can find in given screen shot. But when i searched for right word in wordweb, i found single & correct spelling.