Saturday, 26 January 2013

Inheriting from an interface binds you to a contract




When you implement an interface, you are entering into a contract, that you will implement whatever methods you have inherited. Implementing a method means that you will provide the details of the function---you will supply the function body.
At first glance, it looks like more work for the programmer because you are duplicating code. First you will write the interface but the methods doesn't have details, then you will implement in a class then supply the details of the method. This argument maybe true for trivial applications 10, but for non-trivial applications, coding against an interface rather than a concrete class is good way to use the Java typing system to achieve maintainability of code. Another reason to use interfaces is when you truly need multiple inheritance. Let us expand the Phone program.
//MultiFunction.java

import static java.lang.System.out;

interface Printer {
    void print();
}

interface Phone {
    void answerCall();
    void dialNumber(String args);
}

interface Copier {
    void copy();
}

class MultiFunction implements Printer, Phone, Copier {

    public void print() {
        out.println("Printing");
    }

    public void answerCall() {
        out.println("Answering call");
    }

    public void dialNumber(String args) {
        out.println("Dialling " + args);
    }

    public void copy() {
        out.println("Copying");
    }   
}

class TestMultiFunction {

    public static void main(String[] args) {

        Printer printer = new MultiFunction();
        Phone phone = new MultiFunction();
        Copier copier = new MultiFunction();

        printer.print();
        phone.answerCall();
        copier.copy();

        System.out.println(copier.toString());
        copier.print();

    }

}
The Multifunction.java code defines three interfaces, the PhonePrinter and the Copier. The classMultiFunction implements all three interfaces. If you think about it, what the code is saying is---MultiFunction is a Printer, it is also a Copier and a Phone. As such, a MultiFunction object should behave as a Phone, a Printer or Copier will behave. That is the object contract between these three interfaces and the class.
If you review line 39-45 of Listing 4.8, I did not use the MultiFunction type when I created a MultiFunction object. I used the specific interfaces as the Type to be created.
Printer printer = new MultiFunction();
Phone phone = new MultiFunction();
Copier copier = new MultiFunction();

printer.print();
phone.answerCall();
copier.copy();
MultiFunction printer = new MultiFunction() would have been fine, the code will still compile and run perfectly, so why didn't I do that? Because I only need a Printer, I chose a more general type because I am not sure that I will not change the implementation details of the print() method in the future.
It can be argued that if I need to change some details of the print() function, I should just go inside the MultiFunction class and change it, but I would rather not do that for a host of reasons. The most important one being that at some point, some of my codes maybe depending on how I actually implemented the print function inside the MultiFunction class, and if I change that, some parts of the application could break. On the other hand, using the Printer interface as a type allows me to achieve loose coupling between the Type and its actual implementation. If I need to change some of the details of print() function, I could simply create another class that implements the Printer type and make that adjustments on the new class. This approach has some level of encapsulation because I am containing the possible (negative) impact of code change.
//If I need to change something on the print function()
class ColorPrinter implements Printer {
    public void print() {
        ...
    }
}

Printer printer = new ColorPrinter();
The above code shows a possible approach if I really need to make adjustments to the print() function in the future.

Advantages of Internet Marketing






A lot of small business people that I speak with are very curious about online marketing, but don’t understand how it can directly increase their business. Many of them are seeing less return from their advertisements in traditional media like The Yellow Pages, newspapers and direct mailing campaigns, and are looking to explore new ways of expanding their market share. When the advantages of online marketing are laid out, it is easy to see how it is oftentimes a more cost-effective marketing solution for small businesses.
These are some of the many advantages that online marketing offers over traditional media outlets:
1. Reduced Cost
The starting cost of online marketing is only a fraction of the thousands of dollars that Yellow Pages, television and radio ads cost. For example, you can get a free listing on Google Local  that will be just as effective as a costly online Yellow Pages ad. In addition, while traditional ads may only run for a short time, a search engine optimization campaign can deliver long-term results. You can also save money with online Pay-Per-Click advertising where it is easy to experiment with small ad volumes until you perfect your strategy and then expand your marketing budget when you are assured of a positive sales return.
2. Everything Is Measurable
When you place an ad in the newspaper or a magazine, it can be difficult to assess the direct sales impact for your business. With online marketing, everything can be tracked and illustrated in detailed graphs that illustrate traffic growth, leads and sales conversions from your specific search marketing campaigns. Using a free traffic analysis tool like Google Analytics , it is easy to calculate your return on investment (ROI) so you can appreciate the excellent value generated from your online marketing budget.
3. Brand Engagement
In the crowded market, you need to establish and maintain positive brand awareness and client loyalty. Apart from word-of-mouth and leveraging your personal relationships with your established clients, a website is the most important marketing tool a business can have. A regularly updated website with well-written content that maintains people’s interest is essential to showing people exactly how your business is distinctive – and how you offer the best value to your clients.
4. Demographic Targeting
The degree to which an online marketing campaign can target and measure the response from specific demographics and regions is often astonishing to business owners who normally use traditional media. New demographic prediction  and online advertising platforms allow you to specifically target the specific consumer demographics most likely to buy your products. In particular, if you want to target young people between the ages of 16-30, you’ll need an online marketing strategy to reach them where they spend the bulk of their time: On the Internet and on social media sites.
5. Real-Time Results
With online marketing you don’t have to wait weeks to see a significant boost in your business. With a paid search marketing campaign you can experience real-time results that enable you to fine-tune your marketing message to achieve your desired effect. If your marketing strategy isn’t working effectively, real-time monitoring tools allow you to easily pin-point exactly where you are going wrong.
6. Easily Refine Your Strategy
Using online marketing analytics and tracking tools you can test conversion rates at a fraction of the cost of a traditional media campaign. Online marketing levels the playing field and allows savvy small businesses to compete in competitive niches that previously would only be open to large corporations and their massive marketing budgets. If your marketing strategy is not bringing in the return on investment (ROI) that you desire, you can work to perfect it without having to launch an expensive new campaign as would be required with most traditional media outlets.
 
7. Long-Term Exposure
The benefit of an organic search marketing campaign that optimizes a website for specific keywords is that you will achieve a long-term return on your investment. Once your website’s visibility is well-established with search engines, it is easy to do regular low-cost maintenance of your strategy. The early adopters of new online marketing platforms like social media marketing will have a significant head start over their competition.
8. Product Information
Today’s savvy consumers want to compare reviews and opinions of friends, trusted bloggers and industry experts before they make a decision. If you can provide quality, linkable information that is what people are looking for, then the next step of converting users into paying clients can be very easy. With social media networks like Facebook and Twitter re-enforcing the value of positive word-of-mouth exposure, trust is more important than ever in the marketing field.
9. Less Intrusive
Most savvy consumers dislike intrusive traditional marketing methods like direct mailing, print ads and television advertisements. When someone buys a newspaper or magazine, they want to read interesting articles not be bombarded with irrelevant ads. While mediums like television can still be useful for maintaining awareness of large corporate brands, it is not an effective medium for most small and medium-size businesses. With online marketing, you can target consumers precisely when they are searching for products and services that your business can provide.
10. Holds Their Attention
When people read the newspaper or a magazine they may scan over the advertisements beside the article but there is no way to engage their attention. With online marketing you can encourage them to take action, visit your website and read about your products and services which results in vastly increased “stickiness” of your marketing message.

Computer Ethics Q and A


a. What is Ethics?
Answer
Ethics are standards of conduct that examine between the right and the wrong.
  b. Why study Ethics
Answer
  I. Students will follow an explicit or implicit ethical code when they enter the professional world.
  II. To achieve moral autonomy
  III. To Help deal with ethical dilemmas in professional life
  IV. To recognize and solve moral dilemma
  V. To responsibly confront moral issues raised by technological activity
  c. Describe why there is interest in Professional ethics
Answer
  I. Professional ethics help in the authenticity of computing when is taken as a service to other human beings.
  II. It helps give a sense of professional responsibility to students.
  III. Help to give students good judgment and helpful intuitions
  d. What is Computing Ethics?
Answer
Computing ethics is the study of the moral issues and decisions confronting individuals and organizations engaged in computing. It is the study of related questions about the moral ideas, character, policies and relationships of people and corporations involved in technological activity.
  e. What is gender in ethics?
Answer
Gender in ethics means men and women should be treated as equals. To treat them differently would be unethical.
  f. What conclusively, should we think about gender in gillian’s frame work?
Answer
women feel inequality and fairness as less of an issue than do men because they do not break away from a close association with the mother as early as do boys, who assert their masculinity by asserting independence.
  g. Explain the differences between morality and ethics
Answer
Morality usually refers to any aspect of human action while ethics refers only to professional behavior.
  h. What is moral dilemma?
Answer
Moral Dilemma is a situation in which two or more moral obligations, duties, rights or ideas come in to conflicts.

History of Mozilla Fire Fox



Long before this runaway train of adoration left the station, there was the release of Phoenix v0.1 in September 2002. The Phoenix browser, which would eventually become known as Firefox in later releases, started out looking like a stripped down version of the browser we know today.
Although lacking many of the features that make Firefox so popular today, the initial release of Phoenix did contain tabbed browsing and a download manager which were far from commonplace in browsers at that time. As later versions of Phoenix were made available to beta testers, the enhancements began to come in bunches. By the time Phoenix v0.3 was released in mid-October of '02, the browser already contained support for extensions, a sidebar, an integrated search bar, and more.
After several months of polishing the existing features and fixing bugs, Mozilla ran into a roadblock with the name of the browser in April 2003. It turned out that a company named Phoenix Technologies had developed their own open-source browser and they in fact owned a trademark for the name. It was at this point Mozilla was forced to change the project's name to Firebird.
The first release under the browser's new moniker, Firebird 0.6, became the first version available for Macintosh OS X in addition to Windows, giving the Mac community a taste of what was to come. Released May 16, 2003, version 0.6 introduced the very popular Clear Private Data feature and also included a new default theme. For the next five months, three more versions of Firebird would come out containing tweaks to plugin control and automatic downloading among others, as well as a collection of bug fixes. As the browser inched closer toward its first public release, another naming snafu would cause Mozilla to shift gears once again.
An open-source relational database project in existence at the time bore the Firebird label as well. After initial resistance from Mozilla, the database's development community eventually applied enough pressure to prompt yet another name change for the browser. For the second and final time, the browser's name was officially changed from Firebird to Firefox in February of 2004.
Mozilla, seemingly frustrated and embarrassed about the naming issues, released this statement after the change was made: "We've learned a lot about choosing names in the past year (more than we would have liked to). We have been very careful in researching the name to ensure that we will not have any problems down the road. We have begun the process of registering our new trademark with the US Patent and Trademark office."
With the final alias in place, Firefox 0.8 was introduced on February 9, 2004 containing the new name and new look. In addition, it contained the offline browsing feature as well as a Windows installer which replaced the previous .zip delivery method. Over the next several months intermediate versions were released to address some remaining defects and security glitches as well as to introduce features such as the ability to import Favorites and other settings from Internet Explorer.
In September, the first public release version was made available, Firefox PR 0.10. Several search engine choices were added to the search bar, including eBay and Amazon. Among other features, the RSS capability in Bookmarks made its debut.
It took only five days after the public release for Firefox to pass the one million download mark, exceeding expectations and beating Mozilla's self-imposed 10-day goal to hit the coveted mark.
After two release candidates were presented on October 27th and November 3rd, the much anticipated official launch finally happened on November 9, 2004. Firefox 1.0, available in over 31 languages, was well received by the public. Mozilla even raised money from thousands of donors to promote the launch, and a New York Times ad that ran in mid-December rewarded them by displaying their names along with the Firefox symbol.
The browser underwent more changes and new features were continuously added since that day in late 2004, leading up to the major release of version 1.5 and finally version 2.0 on October 24, 2006.
Firefox 2.0 introduced enhanced RSS capabilities, spell-checking within forms, improved tabbed browsing, a sleeker new look, Phishing Protection, Session Restore (which restores your open tabs and web pages in the event of a browser crash or accidental shutdown), and more. This new version really caught on with both the public and with add-on developers, who seemed to produce an endless supply of extensions almost overnight. The power of Firefox continued to grow with the help of a passionate and ingenuitive development community as these add-ons continued to take the browser to new heights.
Firefox, named after the Red Panda found in the Himalayas, Nepal, and southern China, continues to move up the charts in its chase of Internet Explorer and it is going to be exciting to see what comes next.
June 17, 2008. Download Day. Firefox 3 arrives.

What is Mozilla Fire Fox?



Mozilla Firefox is a free and open source web browser developed forMicrosoft WindowsOS X and Linux (including Android) coordinated by Mozilla Corporation and Mozilla Foundation. Firefox uses the Gecko layout engine to render web pages, which implements current and anticipated web standards.
As of October 2012, Firefox has approximately 20% to 24% of worldwide usage share of web browsers, making it the second or third most widely used web browser, according to different sources. According to Mozilla, Firefox counts with over 450 million users around the world. The browser has had particular success in IndonesiaGermany, and Poland, where it is the most popular browser with 65%, 47% and 47% of the market share, respectively.

History of Internet Explorer



Firstly IE (Internet Explorer) is the Property ofMicrosoft, It is been developed by Microsoft, Formerly known as Microsoft Internet Explorer, commonly abbreviated IE or MSIE. Microsoft has done constant changes year after year. Internet Explorer was derived from Spyglass Mosaic, In May 1994, Spyglass licensed NCSA’s Mosaic browser, There intention was to develop there own browser, They developed the browser and were shared across different platforms such as MicrosoftWindows, UNIX and Mac OS, Spyglass Mosaic’s codebase was licensed to Microsoft, Now it is known as Internet Explorer.
The browser was modified and then release as Internet Explore by Microsoft. The original source code for the development was initiated by Netscape. Within few years Microsoftdominated Netscape. Previously people preferred Netscape browser for accessing internet, the reason IE was an instant hit among the users was the cost, Netscape charged for their browser but Microsoft gave Internet Explorer for free.
Internet Explorer has released around 10 versions. The First IE was released on August 16, 1995, and The First Version of IE is IE1.0, It was released in Windows3.1 95 NT. Windows 95 was selected for this experiment as it was Microsoft primary Operating System at that Time. We had to install the IE in 95 in order to access internet, the user interface was very simple in appearance and barely deviates from the Standard application design pyridine. By default the Homepage was MSN in IE.
I wanted myself to find out the main difference between IE1.0 of IE8.0, and the Latest Version, so I had installed both the version of IE and I used wireshark packet sniffer to sniff the packets sent from both the IE browsers.
From this I had discovered that in IE 1.0 does not send the host header that many sites rely on to distinguish between several websites on the same server and because of this there will be no CSS and java script. Within 2 months IE released 2nd version of IE, There was no much difference in it either. Couple of years later Microsoft released IE3 which had was better than the previous version, because it had supported frames, JavaScript and finally the host header. There journey was successful within few years in the browser industry.
IE was most popular in 1999, 2002, 2003 With IE5 and IE6 version released, because of some clever marketing from Microsoft, But from then It has decreased a bit, Its facing constant competition from many competitors, One of the main competitors are Mozilla, Google Chrome and Apple safari. But Still IE Tops the List among the browsers.

What is Internet Explorer?



Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated IE or MSIE) is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windowsline of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year. Later versions were available as free downloads, or in service packs, and included in the OEM service releases of Windows 95 and later versions of Windows.
Internet Explorer is one of the most widely used web browsers, attaining a peak of about 95% usage share during 2002 and 2003. Its usage share has since declined with the launch of Safari (2003), Firefox (2004), and Google Chrome(2008), each of which now has significant market share. Estimates for Internet Explorer's overall market share range from 27.4% to 54.13%, as of October 2012(browser market share is notoriously difficult to calculate). Microsoft spent overUS$100 million per year on Internet Explorer in the late 1990s, with over 1000 people working on it by 1999.
Since its first release, Microsoft has added features and technologies such as basic table display (in version 1.5); XMLHttpRequest (in version 5), which aids creation of dynamic web pages; and Internationalized Domain Names (in version 7), which allow Web sites to have native-language addresses with non-Latincharacters. The browser has also received scrutiny throughout its development for use of third-party technology (such as the source code of Spyglass Mosaic, used without royalty in early versions) and security and privacy vulnerabilities, and boththe United States and the European Union have alleged that integration of Internet Explorer with Windows has been to the detriment of other browsers.
The latest stable release is Internet Explorer 10, with a new interface allowing for use as both a desktop application, and as a Windows 8 application.
Versions of Internet Explorer for other operating systems have also been produced, including an Xbox 360 version called Internet Explorer for Xbox and an embedded OEM version called Pocket Internet Explorer, later rebrandedInternet Explorer Mobile, which is currently based on Internet Explorer 9 and made for Windows PhoneWindows CE, and previously, based on Internet Explorer 7 for Windows Mobile. It remains in development alongside the desktop versions. Internet Explorer for Mac and Internet Explorer for UNIX(Solaris and HP-UX) have been discontinued.