Sunday, October 19, 2008

More Eclipse!!

1. Update the file <eclipse>\configuration\.settings\org.eclipse.ui.ide.prefs to edit or remove RECENT workspaces popup.
2. Useful short cut keys
<ctrl> + <space> = on the editor this does smart insert
<ctrl> + <shift> + r = open resource (can be any file java, xml etc)
<ctrl> + <shift> + t = open type (java/class file, even searches inside the library jars.
<ctrl> + w = close currently open editor window in workspace
<ctrl> + <shift> + w = close all open editor windows in workspace

Wednesday, June 25, 2008

UML - Building Blocks

UML defines how the system or application can be represented visually in number of diagrams. The System's design is basically made of diagrams and the diagrams contain many related elements. A system's architecture and specification is shown with multiple diagrams. There are various diagrams which UML defines which can be used to show the system at various levels and views. All the diagrams and the elements in it constitute the model of the software system or application. The model is nothing but the blueprint of the system.

To understand UML, one needs to understand basic building blocks, rules guiding them and the common design concepts.

The building blocks (vocabulary of language) of UML are:
1. Things
2. Relationships
3. Diagrams
Lets go one by one to get a better picture...

Things are the elements of UML model which is used to build a model
There are four kinds of things in the UML
i) Structural things (nouns) - Classes, Interfaces, Collaborations, Use Cases, Active Classes, components and nodes
ii) Behavioral things (verbs) - Interaction (messages exchanged), State machine
iii) Grouping things (organisation of structural things) - Package
iv) Annotational things (documentation) - Annotations

Relationships are the elements which indicate how two or more things are related to each other. There are various relationships, which are:
i) Dependency (semantic relation) - indicates that change to one thing may affect the semantics of other thing. One of the commonly seen relation is Use-Dependency, where one thing uses other thing to perform certain action.
ii) Association (structural relation) - indicates whole and its part relationship
iii) Generalization (inheritence relation) - the specialized element (the child) are substitutable for objects of generalized element (the parent). In this way the child shares the structure and behavior of the parent.
iv) Realization - one classifier specifies the contract that another classifier gaurantees to carry out. This relationship can be found in two places: between interfaces and the classes or components that realize them, and between use cases and the collaborations that realize them.

Diagrams are the graphical representation using things and relationships to visualize a system with specific perspective. So a diagram is a projection into a system. In theory, a diagram may contain any combination of things and relationships. In Practice, however, a small number of common combinations arise, which are consistent with five most useful views that comprise the architecture of a software-intensive system. In UML1.0 there are nine such diagrams supporting this.
1. Class Diagram
2. Object Diagram
3. Use Case Diagram
4. Sequence Diagram
5. Collaboration Diagram
6. Statechart Diagram
7. Activity Diagram
8. Component Diagram
9. Deployment Diagram

Out of these Class Diagrams, Object Diagrams, Component Diagrams and Deployment Diagrams indicate the structural specification of the software system and the rest of the diagrams are useful in projecting the behaviour of the system.

Saturday, May 24, 2008

preformated <pre> text wrap

Pre tag displays the text "As-Is" typed in the html tag. However some times it doesn't give the desired effect, when the text content is continuous and doesn't have line breaks. Below code-snippet could help in defining the pre tag style to wrap the text and render the remaining starting from next line.
/* Browser specific (not valid) styles to make preformatted text wrap */  
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
Reference and more information:
http://www.w3.org/TR/css3-text/#white-space
http://www.w3.org/TR/CSS21/text.html
http://users.tkk.fi/~tkarvine/pre-wrap-css3-mozilla-opera-ie.html

Wednesday, April 23, 2008

eclipse.ini

Troubleshooting steps when eclipse is not running.... (Learnings from web)

I.
1.) Go to where ever you extracted Eclipse
2.) Do you see any folders with the name of ".metadata"?
3.) If so, delete the following files:
\.metadata\.plugins\org.eclipse.core.resources\.sn ap
\.metadata\.plugins\org.eclipse.core.resources\.ro ot\.markers.snap

II.
1.) Look for any .log files present in the root directory of wherever you installed Eclipse? These give better idea of the problem.

III.
1.) Go to the Eclipse directory of where you installed it.
2.) Double click the eclipse.ini file to edit it.
3.) Find the following code:Code: --launcher.XXMaxPermSize
4.) Change it to:Code: -launcher.XXMaxPermSize Or, just remove that extraneous dash there.
5.) Save the file, re-open Eclipse.

IV.
1.) Go to the Eclipse directory of where you installed it (like the last two), and make a copy of eclipse.ini and paste it OUTSIDE of the Eclipse directory.E.g., for me, I have Eclipse installed at: C:\projects\tools\eclipse; I copy eclipse.ini into C:\.
2.) With the eclipse.ini in the eclipse directory, double click it to edit it, select all, delete all contents, save, and then try opening Eclipse again.

V.
1.) Download an unaltered, unmodified, and latest version of Eclipse and extract it anywhere, apart from where you previously extracted the instance of Eclipse you are using now, and start it up.
2.) If it exhibits the same symptoms as before, i.e. it doesn't start and shows the same error message, then there's something wrong somewhere, log files may help.

VI.
1.) Although this is IBM's Rational Software Development Platform, at its core, it's still Eclipse: http://www-1.ibm.com/support/docview...04%204rational
2.) Follow the instructions, linked above, and see if it works out for you.

----------------------------------------------------------------------
Make sure no eclipse or Java™ process is running in Task Manager, and see if you can kill all processes before this test is run.
1. Manually delete the cache files at:
C:\Documents and Settings\\Local Settings\Application Data\javasharedresources
Now run .
2. If it does not work:
- set CLASSPATH to be empty by issuing a command line "set CLASSPATH=" and try starting using eclipse.exe/eclipse and delete cache again if it fails
- set PATH to "." by issuing command line "set PATH=." and try starting using eclipse.exe/eclipse and delete cache file if it fails

Increase the amount of virtual memory available on the system from the Windows settings (reboot machine to take effect) and also ensure the running the app has plenty of free space and their user profile is not size restricted. If a user's profile (C:\Documents and Settings\) has a space limitation set on it, the JVM may not be able to allocate space to cache.
***Save a copy of the "eclipse.ini" before making any changes ***

----------------------------------------
Final Try (for windows os)!!!
In the above method, it may help to set the environment variable 'Path' with the <jdk_install_path>\bin in the beginning of the path variable ("Note: we are NOT appending this value in the end").
The reason for doing this is because while installing few programs, the java executables (java.exe, javaw.exe...) gets installed under windows system folder. And as this occurs in the beginning of the 'Path' there can be jdk version mismatch, because of which eclipse doesn't startup.
This can be set in advanced tab of system properties dialog box.
eg., set path=c:\j2sdk1.4.2_05\bin;%path% and start eclipse.
----------------------------------------
Wiki: http://wiki.eclipse.org/Eclipse.ini

UML - Why?

The so called "Programming World" started much before the world's first single chip microprocessor, Intel 4004 was invented in November, 1971. It has been evolving since then, with newer paradigms seeding the birth of new languages. As the computing power of the processors increasing at a rapid pace from 8085, 80x86, etc, the programming languages are able to stretch themselves making the language more flexible, efficient and readable. Today, robots are being programmed to understand not just the syntax and semantics but also the pragmatics of the language. Let us not get that far but try to understand where the current programming languages are leading to. For those who are interested in the chronology of languages they can take a look at this site http://www.scriptol.org/history.php.

Broadly the programming styles can be categorized into two: Imperative and Declarative (See http://en.wikipedia.org/wiki/Programming_paradigm for more paradigms). Every language is basically a set of language grammar which the language compiler translates to machine understandable instructions.

Most of the languages which were used for development were typed and with the increasing complexity of software development, there arose a necessity for a language which a human can easily understand. The advent of Object Oriented paradigm helped in this direction with the concepts of objects and behavior similar to the real world objects. During 1990's UML or Unified Modeling Language took birth gradually with the union of ideas from three people Grady Booch, Jim Rumbaugh, and Ivar Jacobson. This language gave a visual representation of the system from various aspects which even an average programmer could easily understand. By being able to put it into diagrams, UML eased the software development to a great extent. With the various views and diagrams of the system one could easily get both the bigger picture as well as the surgical view of the system. In general UML introduced a standardized visual specification for object modeling.

Now lets talk about the need and how UML helps.
In the current situation,


Interested ones can look at the more links below,
UML History graph: http://en.wikipedia.org/wiki/File:OO-historie.jpg
UML Specifications: http://www.omg.org/technology/documents/modeling_spec_catalog.htm#UML

What is techwheel

Saved for future..

Learning programming

    Programming is an interesting world where you apply your skills to build a software program that comes into life when it is run on a com...