Thursday, July 31, 2008

Zimbabwe's hyperinflation

A street vendor holds a recently issued Zimbabwe $250-million note in the capital Harare May 10, 2008. The Zimbabwe 's central bank released the new Z$100-million and Z$250-million notes this week in its latest attempt to ease the effects of hyperinflation. REUTERS/Philimon Bulawayo ( ZIMBABWE )


Zimbabwe 's President Robert Mugabe attends a U.N. crisis summit on rising food prices at the Food and Agriculture Organisation (FAO) in Rome June 3, 2008. World leaders opened a conference on the global food crisis on Tuesday with the World Bank and humanitarian agencies demanding action to curb soaring prices that could push up to 100 million people into hunger. REUTERS/Alessandro Di Meo/Pool ( ITALY )


A man shops inside a clothing shop in central Harare May 13, 2008. Traders in Zimbabwe --which has the highest inflation rate in the world above 165,000 percent, are now selling clothes in millions and billions of Zimbabwe dollars. The Zimbabwe dollar, which had been officially pegged at 30,000 to the United States dollar before the rules were changed, traded at an average Z$165 million to the greenback. The interbank exchange rate was significantly lower than black market rates, which hovered around Z$130 million to the United States dollar. REUTERS/Philimon Bulawayo ( ZIMBABWE )


Emily Moyo buys tomatoes at a market in the capital Harare March 21, 2008. Her husband Tendai is a school teacher earning 500 million Zimbabwe dollars a month. Tomatoes at this stall are normally sold at 3 million dollars for three. Zimbabwe is suffering an economic meltdown with inflation officially pegged at over 100,000 per cent per annum. REUTERS/Philimon Bulawayo ( ZIMBABWE )
Zimbabwe opposition Movement for Democratic Change (MDC) supporters show old worthless bank notes at an election rally in Chitungwiza, near the capital Harare , March 27, 2008. REUTERS/Howard Burditt ( ZIMBABWE )

Wednesday, July 30, 2008

Univesity Girl Raped inside University

This is a mail going throughout the internet saying happened inside a leading university in Sri Lanka

Following is edited version of that mail
i have removed the names
Here word "I " refers to the person who sent this mail
----------------------------------

Marshals of leading University in Sri Lanka, Raped a girl inside the University

I'm an undergraduate of University of ******* . I might not be able to get my degree if the marshals find who I am. But as this is the only thing I can do for the victims of this incident I made up my mind to do this even what happened after this. So please read this for your sons and daughters and brothers and sisters. Please inform them about this people and about the University of ********* and protect them from these maniacs called "Marshals".

Following incident is about two marshals called "Aba" and "Saba" who are two marshals of University of ******** . Marshal saba is the head of the marshals.

In this particular evening, (it was a holiday so there were very few people in the whole university and it was little dark at that time) I was on my way to home and came from the law faculty building side towards the gate and no one else in the area except one couple in the back side of the main library building (people who knows about the university knows that it is a famous area for university couples).

All of a sudden these two people came from the front side of the library building with another security guard and directly went to the couple without letting them to even think about it (It's a usual thing that these marshals walking around the university in evenings pretending that they are to stop misbehaviors of couples and this incident was also seemed like that). Once they went there these two disgraceful officials begun to shout at the couple saying that they misbehaved and asked their University Identity Cards.

Till this moment they didn't see me as I was behind the big columns of the law faculty building so I decided to hide and see what is they are going to do? Marshal "Aba" took the IDs from both students, kept them under his custody, refuses to return them back and shouted in very vulgarly words when they were asking for their ids back (He has no right to keep those as they had the IDs which mean they are University Students and they did nothing wrong, according to my knowledge). Two marshals demanded that they want to record their names and wants to take them to their office.

With this the couple begun to beg to not do so with all the ways they know and the girl started to cry. (If they recode it that will be the end of their university life and all we university students know that). Marshals laughed at them and started to touch and grab the girl (her private areas) by forcing them and saying them vulgarly words. The couple tried to shout and boy tried to pull them out but "Aba" slapped him on his face and stop him. The security guard and two marshals beat the boy and threaten them not to shout if they want their ids back and if they want to study in the University.

At that time saba demanded he must have to do his duty about this incident and for that the boy must go with him to his office (which is on the opposite side of the" R*** A****" - in the science faculty) and said "Umbalata badu thalanna ehe okkoma lesthi karala thiyenne". The couple was so helpless and I couldn't think what to do for them. If I go there, they might took my ID also (Whether they have the authority or not). Marshal saba and the security guard drag the boy away from there while they were crying and begging. As soon as they leave there Aba started to grab the girl's breasts saying "ai api mirikanakotada thopita amaru?" and took his penis and ugly big balls out and force the girl to grab it. Meanwhile I could do nothing to protect her but took my phone and got a photo as the only thing I could do at that time (Attachment) . In the photo you'll see "Aba" with his big balls out and the girl is beside him. Unfortunately my camera gave a shutter sound with that and Aba turned his head towards me. I feared like crazy and couldn't take photos anymore.

I was shocked from what he did and the girl was frightened like hell and was crying and begging from this sexual maniac (who is supposed to protect the discipline and students in the University) to leave her alone. But he didn't release the girl and forced her to suck his penis. After 5 to 10 minutes Saba came back alone and joined with Aba (Don't know what he did to the boy). It was dark at that time and they were watching all over the place and had to do my best to hide. I think I don't have to explain more about this unpleasant incident and all I have to say is I was an eye witness for a rape case within the University of ****** . After the incident when I go to go out only I realized all the gates were locked and security guards were at the gates so I had to use an alternate way to get out from the university.

Within two three days after this incident I kept my eyes open to find whether there is any incident reported or any rumor like that within students or anything similar to that. But there was nothing unusual. Everything was happening normally. So I decided to find about these marshals quietly. So the followings are some of what I have found.

· These marshals are given some unimaginable powers by the authorities and therefore no one going to complaints against them and if anyone does so, marshals will look after to neutralize him/her no matter what happens (They are more powerful than the police inside the university).

· Therefore this is not the first incident like this and it won't be the last one but there won't be any complaints about them.

· Not like any other University in Sri Lanka , University of ******** is located in a HSZ. Therefore everyone (including academic and non-academic staff members) have to leave the University before 8.00p.m. So after 8.00p.m, only marshals and security guards (and some maintenance staff) will stay within the university premises.

· Usually one or two marshals with security guards are doing the duties overnight. Therefore those marshals will be the only authorized persons in the university at that time.

· These people (marshals) take prostitutes and other outsiders into the university at the night (and facilitate them of course). They can do this easily since they keep most of the keys of the university buildings during the night. (you can see evidence about this from your eyes if you can walk by the university silently at about 9-10p.m)

· These marshals broke some benches here and there so that no one can seat, to pretend that they are doing their best to control misbehaviors of university students.

· One of the marshals caught drunken during the daytime recently and students complaint against him but nothing happened. He is still working as a marshal.

· Marshal Saba' s daughter is leaning in the ******s College and doing the A Levels this year (2008) and he is raping girls in his daughter's age.

· Marshal Aba's wife is a lecturer in ***i ****d**** University and he didn't think about at least his wife's dignity since at least he is depending on his wife..

· Aba sold his wife's old car and (######) and bought a new one for his wife's car permit (#####) recently and Saba' s car is (#####). So you have to be careful if you see any of these vehicles on the way (Rapers inside).

I put all the above information (including their vehicles) so that you can identify these sexual maniacs anywhere if you see them. Please protect your self and your loved ones from them. Please forward this mail to others whom you love before it's too late. Dear brothers and sisters you have to be very careful if you are studying or if you are planning to come to the University of ****** to protect from these uneducated old sexual maniacs. You can't do anything against them. Only thing you can do is to know who they are and protect yourself. Please add to this if you have more experiences about these maniacs.

----------------------------------------------------------------------------------------


So this is the story behind the mail
I do not know whether this is true or not
but i beleive somebody should confirm about the real status about this incident cause mails like these never bring any good to the Academics and Image of the University.

Tuesday, July 29, 2008

½ a second before tsunami

This is mail i received
well as we do not have recordings we really do not know the real height
looking at this picture its looks like a enormous wave
but i really don't know whether this is a edited photo
for me it looks like that

Following is the message and picture i received


This picture was taken on the banks of Sumatra Island (the height of waves was of approx. 32 m = 105 ft).
It was found saved in a digital camera, 1 ½ years after the disaster.

We cannot know for sure, but very likely the one who took the picture is not alive any more (it was just a matter of seconds).
Today we can see the last image he/ she saw before ending life on Earth!
------------ -----

Sunday, July 27, 2008

Nokia 6639 well this dream phone


well this is still not in real world

Someone has taken it upon himself to spend some serious time in PhotoShop designing the answer to all devices. The superphone picture popped up on Chinese site bbs.imobile.com.cn and apparently this Nokia 6639 boasts an incredible 1024 x 768 display and an absolutely ginormous interchangeable camera lens, complete with support for both Leica and Nikon. The megapixel count has not been discussed, but I have no idea how the lens could stay attached when you slide open the zippo lighter.

Other dreamed-up specs include integrated WiFi connectivity, a connection for an external flash, and the magical lighter. It also appears to sport a full Swiss Army knife-esque supply of clippers, saws, and other tools. Yup, definitely PhotoShop, but it looks so cool we had to share it with ya... a gadget geek can dream can't he?

Review system under the scanner


On the stroke of lunch on the fourth day, Virender Sehwag entered the record books as the first batsman to be given out by the third umpire under the review system being trialled in the series. But the decision opened the door for more questions than answering the original one.

Sehwag had padded up to a Muttiah Muralitharan ball which was delivered from round the stumps, had just pitched on leg - half of it was inside the mat - and straightened. It hit the inside of the front pad, which was barely on leg stump, and deflected onto the back pad, which was plumb in front of middle.

Mark Benson turned down the appeal, but when the review was sought, the Virtual Eye, the ball-tracking device, failed to note the deviation off the front pad, instead showing the ball to be going on in the direction of middle. With these inputs, and the knowledge that Sehwag hadn't even offered a shot, Benson was left with no choice but to reverse his decision.

The technology has been brought in to aid the umpire, but in this case, both technology and umpire made errors. The tracker should have frozen the moment when the ball hit the front pad, but the technology completely missed the fact that the ball had deviated towards middle stump after hitting the front pad. Even so, Rudi Koertzen, the third umpire, should have noticed it and taken it into account during his discussion with Benson. The ball might still have grazed leg stump, but there was enough doubt to sway the decision in favour of the batsman. As it turned out, Sehwag was given out on the basis of evidence which was incriminating, but incorrect.

The review technology came under the scanner on the second day as well, when Tillakaratne Dilshan successfully challenged a caught-behind decision originally given against him. He had immediately asked for the review on the grounds that bat had hit ground, not ball. The snickometer - a device not used in the review system - showed later, though, that the ball had grazed the edge just before bat hit ground.

However, the review system made a case for itself on two occasions soon after, when Sachin Tendulkar and Rahul Dravid were both rightly given out. Tendulkar was adjudged dismissed off a deflection off the back of the bat and the thumb after Billy Doctrove had turned down the appeal. Tendulkar looked to paddle sweep a doosra from Muralitharan that pitched outside the leg stump, but missed and from the front angle, the ball seemed to have gone off his front pad to leg slip. Tendulkar stood his ground but fielders behind the wicket were convinced about the edge and were proved right by the replay. Dravid got a thick inside edge to a googly from Mendis on the stroke of tea, but stayed his ground as Benson turned down the appeal. Mahela Jayawardene opted for the review, and Dravid was soon on his way.

As it turned out, all the decisions went against India, both wrong and right. Had there been no review in place they would have got Tillakaratne Dilshan early and Sehwag wouldn't have been out - as it turned out, the on-field umpires had made the right decisions, only to be overruled - and Tendulkar and Dravid would have be reprieved.

Anil Kumble made no excuses for India's defeat, but he did say that the the system would need to be reviewed. "A few dismissals were obviously negated under the referral system," he said. "The new system is something we have to take forward. It definitely requires a review but it is too early to say."

Jayawardene was in support of it saying it helped rectify mistakes. "If it wasn't used in this Test we'd probably have had four bad decisions go against us," he said. "The decisions for both Tendulkar and Dravid were tough ones for the on-field umpire."

Sidharth Monga is a staff writer at Cricinfo

India losing as Sri Lankans to putup new records at SSC


  • The victory margin of an innings and 239 runs is Sri Lanka's third biggest in Tests, and their heaviest at home. Their two largest wins were both in Zimbabwe.

  • For India, on the other hand, it was their third heaviest defeat, and easily their worst against Sri Lanka. Their previous worst was on their last trip to the SSC, in 2001, when they lost by an innings and 77 runs. It isn't a venue India will want to return to in a hurry.

  • Muttiah Muralitharan, who finished with match figures of 11 for 110, has now taken 65 five-wicket hauls, and 21 ten-fors, in Tests. It's the second time he has taken ten in a match against India - his first effort had also been at this ground, on 2001. He has now taken 160 wickets at the SSC in just 23 Tests, at an average of 20.49, with 14 five-fors. The list of most number of five-fors at a venue has Murali taking the top three spots.

  • Much had been written about Ajantha Mendis before the match, and he completely lived up to the hype. His match figures of 8 for 132 is the best by a Sri Lankan debutant. The last time a bowler took more than eight on debut was in 2006, when Stuart Clark managed nine against South Africa in Cape Town, but before that, you'd have to go back ten further years, to 1996, when Pakistan's Mohammad Zahid took 11 for 130 against New Zealand in Rawalpindi. (Click here for the list of bowlers who have taken six or more wickets on debut since 1990.)

  • Indians have traditionally been excellent players of spin bowling, but here they were completely dominated by Murali and Mendis - it's only the third time spinners have taken 19 wickets against India, and the first in 39 years. (Click here for a list of most dominant performances by spinners against India.)

  • Of the 186 balls bowled by Murali and Mendis in the second innings, the Indian batsmen were not in control of 36, which converts into 19.35%. In the Indian first innings the corresponding percentage was 18.47, while the number was just 10.71% when Sri Lanka batted.

  • India managed to survive just 707 deliveries over the two innings, which is the among the least they have faced in their 135 Test defeats. One of their 14 poorer efforts came only a couple of Tests ago, when they faced 686 deliveries in their innings-and-90-run defeat against South Africa in Ahmedabad earlier this year.

  • Sachin Tendulkar has fallen to Murali seven times in 13 Tests. No other bowler has dismissed him as often. Glenn McGrath and Jason Gillespie have got him out six times each.

  • Murali has won 19 Man-of-the-Match awards, which is second only to Jacques Kallis' 20.
  • Friday, July 25, 2008

    Jayawardena mounting , Sri lanka booming


    COLOMBO (AFP) — Mahela Jayawardene equalled former Australian legend Don Bradman's record of nine centuries at one venue to put Sri Lanka in a commanding position in the opening Test against India here on Thursday.

    Skipper Jayawardene cracked a stylish 136 to help his side post 422-4 in the first innings at stumps on the second day.

    The Sri Lankan captain's ton at the Sinhalese Sports Club ground equalled Bradman's nine at one venue -- the Australian great's coming at the Melbourne Cricket Ground.

    "I wasn't really thinking about all that," said Jayawardene.

    "It is a very friendly venue for me as I've been playing almost 12 years of first-class cricket here."

    Jayawardene was not the lone batsman to feast on the Indian bowling on a placid track as opener Malinda Warnapura (115) and Thilan Samaraweera (111 not out) also contributed handsomely to their team's total.

    Tillakaratne Dilshan was unbeaten on 20 after earning a reprieve under a new experimental rule allowing players to seek a second opinion on umpiring decisions.

    He was on one when given out caught behind off left-arm fast bowler Zaheer Khan by umpire Mark Benson of England, but asked the official to review the decision.

    Benson consulted TV umpire Rudi Koertzen of South Africa before changing his decision as the ball had not made contact with the bat.

    Jayawardene earlier added 155 for the third wicket with Warnapura and 148 for the next with Samaraweera to put his team on course for a big total. He hit one six and 10 fours in his 23rd hundred in 96 Tests.

    Left-hander Warnapura, 50 overnight, smashed 14 fours in his second Test century in five matches.

    India's seamers and spinners failed to put pressure on Jayawardene, Warnapura and Samaraweera, who were quick to punish errors in line and length during their knocks.

    The visitors took just two wickets in the day after the hosts resumed at 85-2, with off-spinner Harbhajan Singh and fast bowler Ishant Sharma the successful bowlers.

    Harbhajan struck in the afternoon when he had Warnapura caught by former captain Rahul Dravid in the slips, but not before the batsman had strengthened the team's position.

    There was no respite for India as Samaraweera also gathered runs comfortably against the Indian attack, having so far struck 16 fours in his seventh Test hundred.

    India were also let down by wicket-keeper Dinesh Karthik, who dropped Jayawardene on 55 and 93 off leg-spinner Anil Kumble.

    The lapses proved costly as the Sri Lankan captain, 16 overnight, continued to dominate the Indian attack. He reached his hundred just before the tea-break when he turned Kumble to mid-on for a single.

    Jayawardene fell in the closing session when he was caught behind off Sharma, bowling with the second new ball.

    Warnapura, nephew of Sri Lanka's first Test captain Bandula Warnapura, completed his hundred with an aggressive shot when he cut Sharma for his 13th four.

    The opener survived a leg-before appeal off Harbhajan when on 86 after India captain Kumble asked Benson to review the initial not-out decision. The official consulted the TV umpire and was proved right.

    India's second leg-before appeal -- this time against Dilshan off Harbhajan -- was also unsuccessful. The umpire again was Benson.

    The rule is on trial in the current three-Test series. A batsman or fielding captain can request a review of any decision by referring it to the third official monitoring television replays.

    Each team is allowed three unsuccessful review requests per innings but if one is successful they will get an additional appeal.

    Danielle Kerkoven - Indian fashion industry is full of opportunities for models as compared to its Sri Lankan counterpart



    Sri Lankan beauty Danielle Kerkoven, Miss Sri Lanka 2006, says the Indian fashion industry is full of opportunities for models as compared to its Sri Lankan counterpart, which is small and at a nascent stage.

    The petite Kerkoven, who won the Miss Sri Lanka title when she was just 17, was in town for a product launch today.

    “I want to make India my home as I believe there are better opportunities for a model here,” she said when asked about shifting base here. She also plans to enrol herself in a Hindi learning course.

    Currently based in Delhi, Kerkoven says her mother’s influence has been her support during her formative years.

    “My mother Rehana was also a model and today she is one of the oldest designers in Sri Lanka. And since fashion has been all around me as a child, I took to ramp for my mother’s designs at 14.”

    “I have always loved to occupy the ramp and the Miss World title gave me an unmatchable experience in my life,” says Kerkoven, who deeply bonded with Miss India Natasha Suri during the race for Miss World title.

    On her slim physique, Kerkoven claims she has been naturally thin since childhood. “I hate the fact that some people take pills to be slim. I would never recommend any girl to use such slimming techniques. One should follow a healthy diet and a proper regimen to be fit,” says Kerkoven, fond of all kind of music.

    A die heart Bollywood actor Shah Rukh Khan fan, Kerkoven says if given a chance, she would love to act in a Hindi movie, for she has grown up watching them.

    While speaking about the hectic schedules models have, making them vulnerable to alcohol and drugs, she said: “Everyone copes up with high stress in different manners. There, certainly, is a huge stress level involved in the glamour world though it may look like an easy profession. And those who cannot handle it can get into drugs. But one should be aware of one’s capabilities to be able to deal with stress.”

    Saturday, July 19, 2008

    Don't publish with IEEE - D. J. Bernstein

    Following is an article i got from internet..

    i really need to know whether these things are true or false
    i thought of publishing in my blog to get your comments on this
    ---------------------------------------------------------------------------------------------------


    Don't publish with IEEE!

    Before you read this page, you should understand (1) authors putting papers online to benefit readers, (2) commercial publishers using copyright to limit #1, and (3) authors dedicating papers to the public domain as one way to stop #2. I have a separate page discussing these issues.

    It turns out that, in response to #3, IEEE is overriding its scientific referees and flat-out refusing to accept public-domain papers.

    I learned about this from a UIC graduate student who had submitted a paper to a conference whose proceedings were to be published by IEEE. After the paper was accepted, IEEE notified the student that a copyright transfer was required. The student declared his intention to put his paper into the public domain. The IEEE Intellectual Property Rights Manager threatened the student with non-publication of the paper. Faced with this pressure, the student capitulated and, rather than eliminating the copyright, transferred it to IEEE.

    When I heard about this incident, I asked the IEEE Intellectual Property Rights Manager to explain his overall assertion that IEEE refuses to publish public-domain papers:

    Works from government authors are in the public domain, and I find it difficult to believe that IEEE refuses papers from government authors. I see that the IEEE Copyright Form has a special section for government authors.

    How many public-domain papers does IEEE actually publish? Surely you have the exact figures for each year. Is it fair to say that, in fact, IEEE publishes many public-domain papers?

    The IEEE Intellectual Property Rights Manager refused to answer these questions.

    In his messages to the student, the IEEE Intellectual Property Rights Manager had asserted that ``IEEE needs to be the owner of the work ... by assignment.'' Obviously this is impossible for papers in the public domain: copyright assignment isn't possible when the copyright no longer exists. I looked at the IEEE Copyright Policies and found that public-domain papers were clearly exempted from the copyright-transfer requirement:

    Such transfer shall be a necessary requirement for publication, EXCEPT for material in the public domain.
    (Emphasis added.) I asked the IEEE Intellectual Property Rights Manager to explain the contradiction between his statements and the IEEE Copyright Policies. His only response was the rather idiotic comment that ``IEEE policy requires authors to submit an IEEE Copyright Form in order for publication to occur''; needless to say, the IEEE Copyright Form is written by the IEEE Intellectual Property Rights office.

    In his messages to the student, the IEEE Intellectual Property Rights Manager had explained IEEE's alleged need for being ``the owner of the work'' as follows: ``We can put it into the Xplore database and license it to others as one of our ongoing electronic distribution of IEEE publications.'' I asked the IEEE Intellectual Property Rights Manager for clarification:

    When there is no copyright, IEEE is completely free to do these things. It can distribute the work as widely as it wants, and it can authorize others to do so. All IEEE gets out of a copyright is the power to _stop_ the distribution of the information.

    If the public domain is a problem for IEEE, how does IEEE publish works from government authors? Do you have a better explanation for your desire to be the owner of the work? Is it fair to say that IEEE actually _does_ want to stop the distribution of scientific information?

    Naturally, the IEEE Intellectual Property Rights Manager refused to respond.

    The IEEE Intellectual Property Rights Manager had also devoted some effort to trying to fool the student into believing that papers could not simply be dedicated to the public domain. I asked for clarification:

    The Ninth Circuit Court of Appeals has commented that ``It is well settled that rights gained under the Copyright Act may be abandoned.'' The standard way to abandon copyright is by a clear written dedication of the work to the public domain. One example of a public-domain dedication is http://creativecommons.org/licenses/publicdomain; surely you're aware of attorney Lawrence Lessig's Creative Commons effort.

    You stated that ``there is a specific legal process for placing your work in the PD.'' When the student asked you for details, you refused to answer. Instead you said that you were ``dubious about the idea of simply declaring one's intention to inject a work into the public domain,'' and that IEEE needed to be able to ``prove'' its rights.

    If IEEE has trouble ``proving'' its rights to publish a public-domain paper, then how does IEEE ``prove'' alleged authorship of a paper whose copyright is allegedly transferred, and how does IEEE ``prove'' an allegation of government employment? Is the ``legal process'' you mentioned something more than making a clear written dedication of the work to the public domain? If so, what exactly is the process? Why didn't you answer the student's question regarding this process? Is it fair to say that the IEEE Intellectual Property Rights Office is trying to intimidate authors into transferring copyright to IEEE?

    The IEEE Intellectual Property Rights Manager refused to respond.

    The bottom line is that IEEE is refusing to accept public-domain papers except from government authors. IEEE has no justification for this position. IEEE's action is a blatant attempt to maintain control over papers that would otherwise have been freely available to the public. Unfortunately, at least in this student's case, the attempt succeeded: a paper that was accepted by IEEE's scientific referees, and that would have been in the public domain without IEEE's pressure, is now part of IEEE's copyright portfolio.

    Consequently, I am blacklisting IEEE here. I recommend that authors find another publisher. Springer, for example, tacitly (although quite unhappily) allows public-domain papers, and AMS explicitly does not require a copyright transfer.

    Friday, July 18, 2008

    Design Patterns - why we need these

    Everybody is talking about the Design Patterns, few knows the existence of it and very very few people do the real application of the design Patterns to coding.
    Well why we all need Design Patterns.
    Before going into details let's see what design Patterns are...

    A design pattern is a formal way of documenting a solution to a design problem in a particular field of expertise.

    So when come to the the process of Software Engineering it is

    a general reusable solution to a commonly occurring problem in Software design

    So i believe you got a some sort of a idea about design pattern, the word.

    designing a Software is one of the most important factors when come to the process of Software engineering.
    If you have come across Softwares which has been coded without a proper design, you will really feel the need of a proper software design and need of a better design.

    Well i have worked with programmed softwares.
    Maintaining them , fixing the bugs , making new developments as requested by the clients is a real night mare. I don't think any Software engineer will ever like to experience such a feeling.

    Difference of the Programming and designing will come across , more the software been used and more the software continues to grow.

    If u design well
    less coding - more re usability
    less complicated
    can maintain without having nightmares

    but come to the programming
    Everything becomes horrible as time runs

    Java

    History


    The Java language was created by James Gosling in June 1991 for use in one of his many set-top box projects.[4] The language was initially called Oak, after an oak tree that stood outside Gosling's office—and also went by the name Green—and ended up later being renamed to Java, from a list of random words.[5] Gosling's goals were to implement a virtual machine and a language that had a familiar C/C++ style of notation.[6] The first public implementation was Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA), providing no-cost runtimes on popular platforms. It was fairly secure and its security was configurable, allowing network and file access to be restricted. Major web browsers soon incorporated the ability to run secure Java applets within web pages. Java quickly became popular. With the advent of Java 2, new versions had multiple configurations built for different types of platforms. For example, J2EE was for enterprise applications and the greatly stripped down version J2ME was for mobile applications. J2SE was the designation for the Standard Edition. In 2006, for marketing purposes, new J2 versions were renamed Java EE, Java ME, and Java SE, respectively.

    In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process.[7][8][9] Java remains a de facto standard that is controlled through the Java Community Process.[10] At one time, Sun made most of its Java implementations available without charge although they were proprietary software. Sun's revenue from Java was generated by the selling of licenses for specialized products such as the Java Enterprise System. Sun distinguishes between its Software Development Kit (SDK) and Runtime Environment (JRE) that is a subset of the SDK, the primary distinction being that in the JRE, the compiler, utility programs, and many necessary header files are not present.

    On 13 November 2006, Sun released much of Java as free and open-source software under the terms of the GNU General Public License (GPL). On 8 May 2007 Sun finished the process, making all of Java's core code free and open-source, aside from a small portion of code to which Sun did not hold the copyright.[11]



    Philosophy

    [edit] Primary goals

    There were five primary goals in the creation of the Java language:[12]

    1. It should use the object-oriented programming methodology.
    2. It should allow the same program to be executed on multiple operating systems.
    3. It should contain built-in support for using computer networks.
    4. It should be designed to execute code from remote sources securely.
    5. It should be easy to use by selecting what were considered the good parts of other object-oriented languages.

    [edit] Platform independence

    Main article: Java Platform

    One characteristic, platform independence, means that programs written in the Java language must run similarly on any supported hardware/operating-system platform. One should be able to write a program once, compile it once, and run it anywhere.

    This is achieved by most Java compilers by compiling the Java language code halfway (to Java bytecode) – simplified machine instructions specific to the Java platform. The code is then run on a virtual machine (VM), a program written in native code on the host hardware that interprets and executes generic Java bytecode. (In some JVM versions, bytecode can also be compiled to native code, either before or during program execution, resulting in faster execution.) Further, standardized libraries are provided to allow access to features of the host machines (such as graphics, threading and networking) in unified ways. Note that, although there is an explicit compiling stage, at some point, the Java bytecode is interpreted or converted to native machine code by the JIT compiler.

    The first implementations of the language used an interpreted virtual machine to achieve portability. These implementations produced programs that ran slower than programs compiled to native executables, for instance written in C or C++, so the language suffered a reputation for poor performance. More recent JVM implementations produce programs that run significantly faster than before, using multiple techniques.

    One technique, known as just-in-time compilation (JIT), translates the Java bytecode into native code at the time that the program is run, which results in a program that executes faster than interpreted code but also incurs compilation overhead during execution. More sophisticated VMs use dynamic recompilation, in which the VM can analyze the behavior of the running program and selectively recompile and optimize critical parts of the program. Dynamic recompilation can achieve optimizations superior to static compilation because the dynamic compiler can base optimizations on knowledge about the runtime environment and the set of loaded classes, and can identify the hot spots (parts of the program, often inner loops, that take up the most execution time). JIT compilation and dynamic recompilation allow Java programs to take advantage of the speed of native code without losing portability.

    Another technique, commonly known as static compilation, is to compile directly into native code like a more traditional compiler. Static Java compilers, such as GCJ, translate the Java language code to native object code, removing the intermediate bytecode stage. This achieves good performance compared to interpretation, but at the expense of portability; the output of these compilers can only be run on a single architecture. Some see avoiding the VM in this manner as defeating the point of developing in Java; however it can be useful to provide both a generic bytecode version, as well as an optimised native code version of an application.

    [edit] Implementations

    Sun Microsystems officially licenses the Java Standard Edition platform for Microsoft Windows, Linux, and Solaris. Through a network of third-party vendors and licensees[13], alternative Java environments are available for these and other platforms. To qualify as a certified Java licensee, an implementation on any particular platform must pass a rigorous suite of validation and compatibility tests. This method enables a guaranteed level of compliance and platform through a trusted set of commercial and non-commercial partners.

    Sun's trademark license for usage of the Java brand insists that all implementations be "compatible". This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support the RMI and JNI interfaces and had added platform-specific features of their own. Sun sued in 1997, and in 2001 won a settlement of $20 million as well as a court order enforcing the terms of the license from Sun.[14] As a result, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a third-party plugin. However, Sun and others have made available Java run-time systems at no cost for those and other versions of Windows.

    Platform-independent Java is essential to the Java Enterprise Edition strategy, and an even more rigorous validation is required to certify an implementation. This environment enables portable server-side applications, such as Web services, servlets, and Enterprise JavaBeans, as well as with Embedded systems based on OSGi, using Embedded Java environments. Through the new GlassFish project, Sun is working to create a fully functional, unified open-source implementation of the Java EE technologies.

    [edit] Automatic memory management

    See also: Garbage collection (computer science)

    One of the ideas behind Java's automatic memory management model is that programmers be spared the burden of having to perform manual memory management. In some languages the programmer allocates memory for the creation of objects stored on the heap and the responsibility of later deallocating that memory also resides with the programmer. If the programmer forgets to deallocate memory or writes code that fails to do so, a memory leak occurs and the program can consume an arbitrarily large amount of memory. Additionally, if the program attempts to deallocate the region of memory more than once, the result is undefined and the program may become unstable and may crash. Finally, in non garbage collected environments, there is a certain degree of overhead and complexity of user-code to track and finalize allocations. Often developers may box themselves into certain designs to provide reasonable assurances that memory leaks will not occur.[15]

    In Java, this potential problem is avoided by automatic garbage collection. The programmer determines when objects are created, and the Java runtime is responsible for managing the object's lifecycle. The program or other objects can reference an object by holding a reference to it (which, from a low-level point of view, is its address on the heap). When no references to an object remain, the unreachable object is eligible for release by the Java garbage collector - it may be freed automatically by the garbage collector at any time. Memory leaks may still occur if a programmer's code holds a reference to an object that is no longer needed—in other words, they can still occur but at higher conceptual levels.

    The use of garbage collection in a language can also affect programming paradigms. If, for example, the developer assumes that the cost of memory allocation/recollection is low, they may choose to more freely construct objects instead of pre-initializing, holding and reusing them. With the small cost of potential performance penalties (inner-loop construction of large/complex objects), this facilitates thread-isolation (no need to synchronize as different threads work on different object instances) and data-hiding. The use of transient immutable value-objects minimizes side-effect programming.

    Comparing Java and C++, it is possible in C++ to implement similar functionality (for example, a memory management model for specific classes can be designed in C++ to improve speed and lower memory fragmentation considerably), with the possible cost of adding comparable runtime overhead to that of Java's garbage collector, and of added development time and application complexity if one favors manual implementation over using an existing third-party library. In Java, garbage collection is built-in and virtually invisible to the developer. That is, developers may have no notion of when garbage collection will take place as it may not necessarily correlate with any actions being explicitly performed by the code they write. Depending on intended application, this can be beneficial or disadvantageous: the programmer is freed from performing low-level tasks, but at the same time loses the option of writing lower level code. Additionally, the garbage collection capability demands some attention to tuning the JVM, as large heaps will cause apparently random stalls in performance.

    Java does not support pointer arithmetic as is supported in, for example, C++. This is because the garbage collector may relocate referenced objects, invalidating such pointers. Another reason that Java forbids this is that type safety and security can no longer be guaranteed if arbitrary manipulation of pointers is allowed.

    [edit] Syntax

    Main article: Java syntax

    The syntax of Java is largely derived from C++. Unlike C++, which combines the syntax for structured, generic, and object-oriented programming, Java was built exclusively as an object oriented language. As a result, almost everything is an object and all code is written inside a class. The exceptions are the intrinsic data types (ordinal and real numbers, boolean values, and characters), which are not classes for performance reasons.

    [edit] Hello, world program

    This is a minimal Hello world program in Java with syntax highlighting:

    // Hello.java
    public class Hello {
    public static void main(String[] args) {
    System.out.println("Hello, world!");
    }
    }

    To execute a Java program, the code is saved as a file named Hello.java. It must first be compiled into bytecode using a Java compiler, which produces a file named Hello.class. This class is then launched.

    The above example merits a bit of explanation.

    • All executable statements in Java are written inside a class, including stand-alone programs.
    • Source files are by convention named the same as the class they contain, appending the mandatory suffix .java. A class that is declared public is required to follow this convention. (In this case, the class Hello is public, therefore the source must be stored in a file called Hello.java).
    • The compiler will generate a class file for each class defined in the source file. The name of the class file is the name of the class, with .class appended. For class file generation, anonymous classes are treated as if their name was the concatenation of the name of their enclosing class, a $, and an integer.
    • The keyword public denotes that a method can be called from code in other classes, or that a class may be used by classes outside the class hierarchy.
    • The keyword static indicates that the method is a static method, associated with the class rather than object instances.
    • The keyword void indicates that the main method does not return any value to the caller.
    • The method name "main" is not a keyword in the Java language. It is simply the name of the method the Java launcher calls to pass control to the program. Java classes that run in managed environments such as applets and Enterprise Java Beans do not use or need a main() method.
    • The main method must accept an array of String objects. By convention, it is referenced as args although any other legal identifier name can be used. Since Java 5, the main method can also use variable arguments, in the form of public static void main(String... args), allowing the main method to be invoked with an arbitrary number of String arguments. The effect of this alternate declaration is semantically identical (the args parameter is still an array of String objects), but allows an alternate syntax for creating and passing the array.
    • The Java launcher launches Java by loading a given class (specified on the command line) and starting its public static void main(String[]) method. Stand-alone programs must declare this method explicitly. The String[] args parameter is an array of String objects containing any arguments passed to the class. The parameters to main are often passed by means of a command line.
    • The printing facility is part of the Java standard library: The System class defines a public static field called out. The out object is an instance of the PrintStream class and provides the method println(String) for displaying data to the screen while creating a new line (standard out).

    [edit] A more comprehensive example

    // OddEven.java
    import javax.swing.JOptionPane;

    public class OddEven {
    public static void main(String[] args) {
    // This is the main method. It gets called when this class is run through a Java interpreter.
    OddEven number = new OddEven();
    /* This line of code creates a new instance of this class called "number" and
    * initializes it, and the next line of code calls the "showDialog()" method,
    * which brings up a prompt to ask you for a number
    */

    number.showDialog();
    }
    private int input; // A whole number("int" means integer)
    // "input" is the number that the user gives to the computer

    public OddEven() {
    /* This is the constructor method. It gets called when an object of the OddEven type
    * is created.
    */

    }

    public void showDialog() {
    try
    /* This makes sure nothing goes wrong. If something does,
    * the interpreter skips to "catch" to see what it should do.
    */

    {
    input = Integer.parseInt(JOptionPane.showInputDialog("Please Enter A Number"));
    calculate();
    /*
    * The code above brings up a JOptionPane, which is a dialog box
    * The String returned by the "showInputDialog()" method is converted into
    * an integer, making the program treat it as a number instead of a word.
    * After that, this method calls a second method, calculate() that will
    * display either "Even" or "Odd."
    */

    }
    catch (NumberFormatException e)
    /* This means that there was a problem with the format of the number
    * (Like if someone were to type in 'Hello world' instead of a number).
    */

    {
    System.err.println("ERROR: Invalid input. Please type in a numerical value.");
    }
    }

    public void calculate() {
    if (input % 2 == 0)
    System.out.println("Even");
    /* When this gets called, it sends a message to the interpreter.
    * The interpreter usually shows it on the command prompt (For Windows users)
    * or the terminal (For Linux users).(Assuming it's open)
    */

    else
    System.out.println("Odd");
    }
    }
    • The import statement imports the JOptionPane class from the javax.swing package.
    • The OddEven class declares a single private field of type int named input. Every instance of the OddEven class has its own copy of the input field. The private declaration means that no other class can access (read or write) the input field.
    • OddEven() is a public constructor. Constructors have the same name as the enclosing class they are declared in, and unlike a method, have no return type. A constructor is used to initialize an object that is a newly created instance of the class. The dialog returns a String that is converted to an int by the Integer.parseInt(String) method.
    • The calculate() method is declared without the static keyword. This means that the method is invoked using a specific instance of the OddEven class. (The reference used to invoke the method is passed as an undeclared parameter of type OddEven named this.) The method tests the expression input % 2 == 0 using the if keyword to see if the remainder of dividing the input field belonging to the instance of the class by two is zero. If this expression is true, then it prints Even; if this expression is false it prints Odd. (The input field can be equivalently accessed as this.input, which explicitly uses the undeclared this parameter.)
    • OddEven number = new OddEven(); declares a local object reference variable in the main method named number. This variable can hold a reference to an object of type OddEven. The declaration initializes number by first creating an instance of the OddEven class, using the new keyword and the OddEven() constructor, and then assigning this instance to the variable.
    • The statement number.showDialog(); calls the calculate method. The instance of OddEven object referenced by the number local variable is used to invoke the method and passed as the undeclared this parameter to the calculate method.
    • For simplicity, error handling has been ignored in this example. Entering a value that is not a number will cause the program to crash. This can be avoided by catching and handling the NumberFormatException thrown by Integer.parseInt(String).

    [edit] Applet

    Main article: Java applet

    Java applets are programs that are embedded in other applications, typically in a Web page displayed in a Web browser.

    // Hello.java
    import java.applet.Applet;
    import java.awt.Graphics;

    public class Hello extends Applet {
    public void paint(Graphics gc) {
    gc.drawString("Hello, world!", 65, 95);
    }
    }

    The import statements direct the Java compiler to include the java.applet.Applet and java.awt.Graphics classes in the compilation. The import statement allows these classes to be referenced in the source code using the simple class name (i.e. Applet) instead of the fully qualified class name (i.e. java.applet.Applet).

    The Hello class extends (subclasses) the Applet class; the Applet class provides the framework for the host application to display and control the lifecycle of the applet. The Applet class is an Abstract Windowing Toolkit (AWT) Component, which provides the applet with the capability to display a graphical user interface (GUI) and respond to user events.

    The Hello class overrides the paint(Graphics) method inherited from the Container superclass to provide the code to display the applet. The paint() method is passed a Graphics object that contains the graphic context used to display the applet. The paint() method calls the graphic context drawString(String, int, int) method to display the "Hello, world!" string at a pixel offset of (65, 95) from the upper-left corner in the applet's display.


    <
    <head>
    <title>Hello World Applet</title>
    </head>
    <body>
    <applet> code="Hello" width="200" height="200">
    </applet>
    </body>
    >

    An applet is placed in an HTML document using the <applet> HTML element. The applet tag has three attributes set: code="Hello" specifies the name of the Applet class and width="200" height="200" sets the pixel width and height of the applet. Applets may also be embedded in HTML using either the object or embed element[16], although support for these elements by Web browsers is inconsistent.[17] However, the applet tag is deprecated, so the object tag is preferred where supported.

    The host application, typically a Web browser, instantiates the Hello applet and creates an AppletContext for the applet. Once the applet has initialized itself, it is added to the AWT display hierarchy. The paint method is called by the AWT event dispatching thread whenever the display needs the applet to draw itself.

    [edit] Servlet

    Main article: Java Servlet

    Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems. Servlets are server-side Java EE components that generate responses (typically HTML pages) to requests (typically HTTP requests) from clients. A servlet can almost be thought of as an applet that runs on the server side—without a face.

    // Hello.java
    import java.io.*;
    import javax.servlet.*;

    public class Hello extends GenericServlet {
    public void service(ServletRequest request, ServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    final PrintWriter pw = response.getWriter();
    pw.println("Hello, world!");
    pw.close();
    }
    }

    The import statements direct the Java compiler to include all of the public classes and interfaces from the java.io and javax.servlet packages in the compilation.

    The Hello class extends the GenericServlet class; the GenericServlet class provides the interface for the server to forward requests to the servlet and control the servlet's lifecycle.

    The Hello class overrides the service(ServletRequest, ServletResponse) method defined by the Servlet interface to provide the code for the service request handler. The service() method is passed a ServletRequest object that contains the request from the client and a ServletResponse object used to create the response returned to the client. The service() method declares that it throws the exceptions ServletException and IOException if a problem prevents it from responding to the request.

    The setContentType(String) method in the response object is called to set the MIME content type of the returned data to "text/html". The getWriter() method in the response returns a PrintWriter object that is used to write the data that is sent to the client. The println(String) method is called to write the "Hello, world!" string to the response and then the close() method is called to close the print writer, which causes the data that has been written to the stream to be returned to the client.

    [edit] JavaServer Page

    Main article: JavaServer Pages

    JavaServer Pages (JSPs) are server-side Java EE components that generate responses, typically HTML pages, to HTTP requests from clients. JSPs embed Java code in an HTML page by using the special delimiters <% and %>. A JSP is compiled to a Java servlet, a Java application in its own right, the first time it is accessed. After that, the generated servlet creates the response.

    [edit] Swing application

    Main article: Swing (Java)

    Swing is a graphical user interface library for the Java SE platform. This example Swing application creates a single window with "Hello, world!" inside:

    // Hello.java (Java SE 5)
    import java.awt.BorderLayout;
    import javax.swing.*;

    public class Hello extends JFrame {
    public Hello() {
    super("hello");
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setLayout(new BorderLayout());
    add(new JLabel("Hello, world!"));
    pack();
    }

    public static void main(String[] args) {
    new Hello().setVisible(true);
    }
    }

    The first import statement directs the Java compiler to include the BorderLayout class from the java.awt package in the compilation; the second import includes all of the public classes and interfaces from the javax.swing package.

    The Hello class extends the JFrame class; the JFrame class implements a window with a title bar and a close control.

    The Hello() constructor initializes the frame by first calling the superclass constructor, passing the parameter "hello", which is used as the window's title. It then calls the setDefaultCloseOperation(int) method inherited from JFrame to set the default operation when the close control on the title bar is selected to WindowConstants.EXIT_ON_CLOSE — this causes the JFrame to be disposed of when the frame is closed (as opposed to merely hidden), which allows the JVM to exit and the program to terminate. Next, the layout of the frame is set to a BorderLayout; this tells Swing how to arrange the components that will be added to the frame. A JLabel is created for the string "Hello, world!" and the add(Component) method inherited from the Container superclass is called to add the label to the frame. The pack() method inherited from the Window superclass is called to size the window and lay out its contents, in the manner indicated by the BorderLayout.

    The main() method is called by the JVM when the program starts. It instantiates a new Hello frame and causes it to be displayed by calling the setVisible(boolean) method inherited from the Component superclass with the boolean parameter true. Note that once the frame is displayed, exiting the main method does not cause the program to terminate because the AWT event dispatching thread remains active until all of the Swing top-level windows have been disposed.

    [edit] Criticism

    Main article: Criticism of Java

    Java's performance has improved substantially since the early versions, and performance of JIT compilers relative to native compilers has in some tests been shown to be quite similar.[18][19][20] The performance of the compilers does not necessarily indicate the performance of the compiled code; only careful testing can reveal the true performance issues in any system.

    The default look and feel of GUI applications written in Java using the Swing toolkit is very different from native applications. It is possible to specify a different look and feel through the pluggable look and feel system of Swing. Clones of Windows, GTK and Motif are supplied by Sun. Apple also provides an Aqua look and feel for Mac OS X. Though prior implementations of these looks and feels have been considered lacking,[citation needed] Swing in Java SE 6 addresses this problem by using more native widget drawing routines of the underlying platforms. Alternatively, third party toolkits such as wx4j, Qt Jambi or SWT may be used for increased integration with the native windowing system.

    As in C++ and some other object-oriented languages, variables of Java's primitive types were not originally objects. Values of primitive types are either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap, as is the common case for objects (but see Escape analysis). This was a conscious decision by Java's designers for performance reasons. Because of this, Java was not considered to be a pure object-oriented programming language. However, as of Java 5.0, autoboxing enables programmers to write as if primitive types are their wrapper classes, with their object-oriented counterparts representing classes of their own, and freely interchange between them for improved flexibility.

    Java suppresses several features (such as operator overloading and multiple inheritance) for classes in order to simplify the language, to "save the programmers from themselves", and to prevent possible errors and anti-pattern design. This has been a source of criticism,[citation needed] relating to a lack of low-level features, but some of these limitations may be worked around. Java interfaces have always had multiple inheritance.

    [edit] Resources

    [edit] Java Runtime Environment

    The Java Runtime Environment, or JRE, is the software required to run any application deployed on the Java Platform. End-users commonly use a JRE in software packages and Web browser plugins. Sun also distributes a superset of the JRE called the Java 2 SDK (more commonly known as the JDK), which includes development tools such as the Java compiler, Javadoc, Jar and debugger.

    One of the unique advantages of the concept of a runtime engine is that errors (exceptions) should not 'crash' the system. Moreover, in runtime engine environments such as Java there exist tools that attach to the runtime engine and every time that an exception of interest occurs they record debugging information that existed in memory at the time the exception was thrown (stack and heap values). These Automated Exception Handling tools provide 'root-cause' information for exceptions in Java programs that run in production, testing or development environments.

    [edit] Components

    [edit] APIs

    See also: Free Java implementations#Class library

    Sun has defined three platforms targeting different application environments and segmented many of its APIs so that they belong to one of the platforms. The platforms are:

    The classes in the Java APIs are organized into separate groups called packages. Each package contains a set of related interfaces, classes and exceptions. Refer to the separate platforms for a description of the packages available.

    The set of APIs is controlled by Sun Microsystems in cooperation with others through the Java Community Process program. Companies or individuals participating in this process can influence the design and development of the APIs. This process has been a subject of controversy.

    [edit] See also

    [edit] Notes

    [edit] References

    [edit] External links

    Wikibooks
    Wikibooks has a book on the topic of
    Wikiversity
    At Wikiversity, you can learn about: java
    From Wikipedia