J2SE 5.0 (september 30, 2004) tiger [originally numbered 1.5]- Generics: provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion).- Metadata: also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities.- Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive wrapper classes (such as integer).- Enumerations: the enum keyword creates a typesafe, ordered list of values (such as day.monday, day.tuesday, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern).- Swing: new skinnable look and feel, called synth.- Var args: the last parameter of a method can now be declared using a type name followed by three dots (e.g. Void drawtext(string... Lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type.- Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over each member of either an array or any iterable, such as the standard collection classesfix the previously broken semantics of the java memory model, which defines how threads interact through memory.- Automatic stub generation for rmi objects.- Static imports concurrency utilities in package java.util.concurrent.- Scanner class for parsing data from various input streams and buffers.- Assertions- StringBuilder class (in java.lang package)- Annotations

Java SE 6 (december 11, 2006) sun replaced the name "J2SE" with java se and dropped the ".0" from the version number.Beta versions were released in february and june 2006, leading up to a final release that occurred on december 11, 2006.The current revision is update 14 which was released in may 2009.

- Support for older win9x versions dropped.- Scripting lang support: Generic API for integration with scripting languages, & built-in mozilla javascript rhino integration- Dramatic performance improvements for the core platform, and swing.- Improved web service support through JAX-WS JDBC 4.0 support- Java compiler API: an API allowing a java program to select and invoke a java compiler programmatically.- Upgrade of JAXB to version 2.0: including integration of a stax parser.- Support for pluggable annotations- Many GUI improvements, such as integration of swingworker in the API, table sorting and filtering, and true swing double-buffering (eliminating the gray-area effect).

Java se 6 update 10A major enhancement in terms of end-user usability.- Java Deployment Toolkit, a set of javascript functions to ease the deployment of applets and java web start applications.- Java Kernel, a small installer including only the most commonly used jre classes. Enhanced updater.- Enhanced versioning and pack200 support: server-side support is no longer required.- Java quick starter, to improve cold start-up time.- Improved performance of java2D graphics primitives on windows, using direct3D and hardware acceleration.- A new Swing look and feel called NIMBUS and based on synth.- Next-generation java plug-in: applets now run in a separate process and support many features of web start applications.

Friday, November 6, 2009

Adware: Adwares are software applications that are supported by advertisements (Advertising Software). It automatically display advertisement when the software is running. It is one of the way a programmer can offer his application at a reduce cost or even for free. Most of the time, a license can be bought to remove the advertisement permanently.Spyware: Spywares are a progression from adwares. In order to provide the user of adwares with more targeted advertisements, various forms of statistics and information on user's activity on the system is tracked and sent to advertising companies. Sometimes these are done under the hood without user's knowledge and consent. Like spying on your habits and activities on your computer. Thus the term spying software.Malware: Malware are malicious software that affects the normal functionality of your system. Sometimes, annoying pop up will appear out of no where to direct you to some sales sites. Sometimes emails spams will automatically be sent from your system. Adware and spyware progress to a malicious state if it start to affect the use of your system actively instead of just showing you passive advertisement.

Wednesday, October 7, 2009

design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.

Design Pattern TypesCreational Structural BehavioralConcurrency

creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.

structural design patterns are design patterns that ease the design by identifying a simple way to realize relationships between entities.

behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.

concurrency patterns are those types of design patterns that deal with multi-threaded programming paradigm.

Tuesday, September 29, 2009

A cardinal principle of Total Quality escapes too many managers: you cannot continuously improve interdependent systems and processes until you progressively perfect interdependent, interpersonal relationships.

Every human has four endowments- self awareness, conscience, independent will and creative imagination. These give us the ultimate human freedom... The power to choose, to respond, to change.

In the last analysis, what we are communicates far more eloquently than anything we say or do.

It's a fact that more people watch television and get their information that way than read books. I find new technology and new ways of communication very exciting and would like to do more in this field.

Live out of your imagination, not your history.

Management is efficiency in climbing the ladder of success; leadership determines whether the ladder is leaning against the right wall.

Our character is basically a composite of our habits. Because they are consistent, often unconscious patterns, they constantly, daily, express our character.

Public behavior is merely private character writ large.

The key is not to prioritize what's on your schedule, but to schedule your priorities.

The main thing is to keep the main thing the main thing.

There are three constants in life... change, choice and principles.

We are not animals. We are not a product of what has happened to us in our past. We have the power of choice.

We are not human beings on a spiritual journey. We are spiritual beings on a human journey.

We are the creative force of our life, and through our own decisions rather than our conditions, if we carefully learn to do certain things, we can accomplish those goals.

1. Parse the query. 2. Convert words into wordIDs. 3. Seek to the start of the doclist in the short barrel for every word. 4. Scan through the doclists until there is a document that matches all the search terms. 5. Compute the rank of that document for the query. 6. If we are in the short barrels and at the end of any doclist, seek to the start of the doclist in the full barrel for every word and go to step 4. 7. If we are not at the end of any doclist go to step 4.

Monday, September 21, 2009

Attitude makes a lot of difference. If you have a good attitude with requiredskills, you are the winner. The following tips may help you.

Be humble and polite to your co-workers and others. Do not criticize anyone. That is not your job.

Always be professional and do not take any thing personal. Be friendly with your opposite sex colleagues and do not get involvedin any sexual litigation

Do not break the client dress code. It is not a good idea to go to theoffice in jeans and sneakers even if they have a casual dress code. Light cologne is fine but do not use strong perfume.

Do not talk loudly when you talk over the phone or to your colleagues.Talk in a soft and clear voice. If you have any dental problems, make a dental appointment with yourdentist. If dental problems go unchecked, they lead to embarrassingsituations involving bad breath. Have breath mints, chewing gum orpeanuts in your desk. Check your breath before talking to yourcolleagues personally.

Wear fresh and neat clothes. Always be punctual.

Complete your assigned task within the time frame. Do not postpone it. Do not talk about politics and religion in the office premises.

If you are invited for a happy hour party or any party try to attend it atleast for some time. That is the best place to know more about yourcolleagues.

Do not play music loudly. Be as easy going. Do not get the "tough guy" label. Attend meetings regularly.

Be enthusiastic. Try to be helpful to your co-workers. Be a good listener. Do not interrupt when someone else is talking.

Discuss but do not argue. Do not lose your credibility

Some tips on behaving in OfficeHOW TO BEHAVE AT THE OFFICE TO ADVANCEYOUR CAREER

Workplace etiquette involves more than just saying “please” and “thankyou.” When you come to work you, step into a place where being politeinvolves a greater expanse of responsibility and thoughtfulness.When considering different forms of concrete career advice such as how topresent projects to your boss or get ahead, never forget the basics ofworking with others. The best career advice you may get will be how tobehave when working in small spaces such as offices. No one wants towork with someone who cannot follow the unspoken rules of theworkplace.

Read the following tips to ensure that you aren’t committing any of theseworkplace no-no’s. Taking Long Breaks – Few things annoy coworkers or supervisors morethan someone who takes extra-long lunch or smoking breaks. If you canavoid smoking at work altogether, you should. People who do notsmoke may become resentful of the extra time you take to indulge.When you go out to lunch, make sure you take only the allotted time.Stretching the time you spend away from your desk makes you look likeyou avoid hard work, no matter how productive you are.

Coming in Late, Leaving Early – No one likes someone who shirks his orher duties. Even if you complete all of your tasks, you should stay atwork the required amount of time. Coworkers are quick to noticesomeone who comes in late and leaves a little early. If you have troublegetting to work on time, talk to your supervisor about your tardy badhabit. Always put in at least as much time as the other people in yourworkplace, if not more. Be on time and leave on time.

Talking Loudly – It is not just what you say, it’s how you say it. Try tokeep your conversations between you and the person on the otherend. Everyone at work is trying to do the same thing you are – get his orher job done. It is hard to concentrate when someone nearby continuesto disrupt the workplace atmosphere with loud conversations, both onand off the phone. Monitor yourself and your voice. If you know thatyou tend to be loud, make a concerted effort to keep it quiet. Making a Mess – Your desk should be kept as clean as possible, butyour personal workspace is minor compared to the shared spaces thatare reserved for use by everyone. When you use a conference room orbreak area, always clean up after yourself. It is frustrating for thosearound you to discover the remains of your salad on the table in thelunchroom.

Leave Home at Home – Though everyone occasionally must deal withpersonal emergencies at work, do your best to leave what is meant forhome at home. If you have children, do not permit them to call youconstantly at the office. Your coworkers will notice and it will likely bothersome of them because it shows that your concentration is not centeredon your tasks and that you take company time for personal issues. Thesame rule goes for friends and adult family members. Finally, try to avoidscheduling doctor appointments or paying bills while at work.

Think Before you speak – This rule applies to many workplace etiquettebreaches. For example, do not complain about your supervisor in thelunch area, where he or she may overhear. This faux pas could result inuncomfortable situations. Similarly, do not gossip about coworkers.Tensions could easily result. When it is time to talk to your boss aboutyour progress or evaluation, do so in an appropriate setting, such as aclosed office. You never want to blurt out something that you will regret infront of the entire office.

Control your Emotions – It seems that younger employees struggle withthis issue more often. Issues at work may arise from time to time that elicitstrong reactions from you or those around you. Minimize any emotionalresponse you may have at work. Remember that constructive criticism ismeant to help you and is not personal. Strong emotions may make youappear out of control, which is an undesirable workplace trait.

Edit your Email – Review the company email policy and adhere to it. Donot forward email messages that you receive from friends and family tocoworkers. Never send religious or political emails to people in the office;it could make people uncomfortable. Do not gossip about or discussother people in email, as emails can be sent accidentally to the wrongperson or be intercepted by management. If you do not want others toread what you have to say, do not send it in an email. Email is apowerful tool and should be respected, not abused.

HOW TO BEHAVE IN OFFICE: WORKPLACEETIQUETTE TIPS

At the workplace one really needs to mind one’s manners. Everyonearound you is noticing your every move and you don’t want to get the titleof the boorish one in office. There are unwritten laws in the office that onemust follow whether it is India or anywhere in the world.First of all hold the door open for ladies and the boss or your oldercolleagues. If you are walking past the door first ensure that you do notleave the door because it will bang into the person coming in behind you.If you have just joined the office, then follow the behavior of the others. Beobservant and follow what the others are doing.

Secondly, never ever ask personal questions. It is not the accepted thingprofessionally. There are times when you might be tempted or out of habitwanting to do so. But, hold yourself back from it or else you will be avoidedlike the plague by your colleagues every time they see you around. Youdon’t want to be clubbed the nosy parker.

Remember that people are proud of their names and identify them with it. Ifyou want to build up rapport try and address the person by their name.Make it a point to take extra care and effort to pronounce their namecorrectly. Try out handy little tricks to remember the person’s name.Associate with some trait of the person and you will not forget the name thenext time you meet them. Also be careful of the title. Always, address ladieswith Ms. (pronounced as miss). If you are unsure of their marital status thisis a safe thing to do. Never use the first name and the title for instance if theperson’s name is Vivienne Smith, it is wrong to address her as Ms. Vivienne.The right way is Ms. Smith or Vivienne if you know her well or she hasgiven you the permission to address her by her first name.

Whenever you encounter anyone be it in the corridor or office or theelevator greet them with a pleasant and genuine smile. If you know yourcolleagues then greet them with a customary good morning or hello.Always ensure that you use these three words liberally. They are please,thank you and sorry. Of course apologize only when you need to and notagain and again or else you will sound insincere.

Learn to use your voice discreetly, whether you are talking face to face orover the phone. No one wants to hear your personal or professionalconversations and get disturbed. Keep your voice low and if you need tospeak loudly get up and move out.

Remember to wear a smile to work every day. It does not cost youanything but will go on to enlighten the place and add cheer. Also try tofollow some eating etiquette while enjoying your food at office during yourjob.

If you are the last person to leave the room, switch off the lights and the airconditioner and same with your workstation. Once you have finished forthe day make it a point to switch it off.

Tuesday, September 15, 2009

Emphasising the huge significance and opportunities in time management, a 2007 survey by the Proudfoot Consulting (Guardian 22 Oct 07) covering 2,500 businesses over four years and 38 countries, indicated that wasted time costs UK businesses £80bn per year, equivalent to 7% of GDP. The causes of wasted time - labour inefficiency in other words - were:

Clearly organisations are vastly under-utilising their people, and could be doing a lot more to enable more efficient working.

These failings of organisation and leadership make it all the more important for individual people to think creatively about time management, and particularly to start making changes to improve time management at a personal individual level.

Use this time management story to show how planning is the key to time management.

Start with a bucket, some big rocks enough to fill it, some small stones, some sand and water.

Put the big rocks in the bucket - is it full?

Put the small stones in around the big rocks - is it full?

Put the sand in and give it a shake - is it full?

Put the water in. Now it's full.

The point is: unless you put the big rocks in first, you won't get them in at all.

In other words: Plan time-slots for your big issues before anything else, or the inevitable sand and water issues will fill up your days and you won't fit the big issues in (a big issue doesn't necessarily have to be a work task - it could be your child's sports-day, or a holiday).

Friends, When I train for change management, I sometimes employ the following story to illustrate the fallacy of having change for change sake and differences in perception to change. I have found it to facilitate an enjoyable learning experience among the participants.... Here's the story:

A management consultant, on holiday in a African fishing village, watched a little fishing boat dock at the quayside. Noting the quality of the fish, the consultant asked the fisherman how long it had taken to catch them.

"Not very long." answered the fisherman.

"Then, why didn't you stay out longer and catch more?" asked the consultant.

The fisherman explained that his small catch was sufficient to meet his needs and those of his family.

The consultant asked, "But what do you do with the rest of your time?"

"I sleep late, fish a little, play with my children, have an afternoon's rest under a coconut tree. In the evenings, I go into the community hall to see my friends, have a few beers, play the drums, and sing a few songs..... I have a full and happy life." replied the fisherman.

The consultant ventured, "I have an MBA from Harvard and I can help you...... You should start by fishing longer every day. You can then sell the extra fish you catch. With the extra revenue, you can buy a bigger boat. With the extra money the larger boat will bring, you can buy a second one and a third one and so on until you have a large fleet. Instead of selling your fish to a middleman, you can negotiate directly with the processing plants and maybe even open your own plant. You can then leave this little village and move to a city here or maybe even in the United Kingdom, from where you can direct your huge enterprise."

"How long would that take?" asked the fisherman.

"Oh, ten, maybe twenty years." replied the consultant.

"And after that?" asked the fisherman.

"After that? That's when it gets really interesting," answered the consultant, laughing, "When your business gets really big, you can start selling shares in your company and make millions!"

"Millions? Really? And after that?" pressed the fisherman.

"After that you'll be able to retire, move out to a small village by the sea, sleep in late every day, spend time with your family, go fishing, take afternoon naps under a coconut tree, and spend relaxing evenings havings drinks with friends..."

" That's what i,m doing right now", said the fisherman and went his way.

* implements the Servlet 2.5 and JSP 2.1 specifications * support for Unified Expression Language 2.1 * designed to run on Java SE 5.0 and later * support for Comet through the CometProcessor interface * is not packaged with an admin console as in past releases

(((( ex 2: ))))1) create a java program "filename.java"2) set classpath and compile and place that .class into WEB-INF\classes folder3) create a deploy.wsdd and undeploy.wsdd file and store into your filename.java area4) run this wsdd cmd into cmd promt (( Note : tomcat server must be in run when u exectue this cmd )))

Tuesday, March 24, 2009

Most large, complex systems are built as small collections of large subsystems instead of as large collections of small, independent subsystems. This is because of the potential for increased performance, security, economy, or some other key property that you can't get by decoupling the system into relatively independent, small elements. The tight coupling characteristics of large-scale systems generally result from optimizing the overall design and from minimizing redundancies and inefficiencies among the system's components. This results in closer coupling among the system's components and large numbers of critical interdependencies.

One disadvantage of tight coupling among a system's components is that failures within the individual components tend to disable the entire system. Loosely coupled Web services are seen as a better alternative; a Web service failure doesn't disable the entire system, provided a failover Web service server is in place.

You can change details in loosely coupled Web services as long as those changes don't affect the functionality of the called Web services. The tight-coupled systems can be difficult to maintain, because changes in one system subcomponent usually require the other subcomponent to adapt immediately.

Loosely coupled Web services require substantial redundancies unlike tight coupling between clients and service, which minimizes redundancies. The listening Web service and the requesting Web service might not trust each other. This means security and trust standards must be added to get both the listener and requester to trust each other. On the other hand, tightly calling and called coupled systems assume that both have the knowledge of what each requires to trust one another.

SQL injection is a code injection technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another. SQL injection attacks are also known as SQL insertion attacks.[1]

Forms of SQL injection vulnerabilities

[edit] Incorrectly filtered escape characters

This form of SQL injection occurs when user input is not filtered for escape characters and is then passed into a SQL statement. This results in the potential manipulation of the statements performed on the database by the end user of the application.

The following line of code illustrates this vulnerability:

statement = "SELECT * FROM users WHERE name = '" + userName + "';"

This SQL code is designed to pull up the records of the specified username from its table of users. However, if the "userName" variable is crafted in a specific way by a malicious user, the SQL statement may do more than the code author intended. For example, setting the "userName" variable as

a' or 't'='t

renders this SQL statement by the parent language:

SELECT * FROM users WHERE name = 'a' OR 't'='t';

If this code were to be used in an authentication procedure then this example could be used to force the selection of a valid username because the evaluation of 't'='t' is always true.

While most SQL Server implementations allow multiple statements to be executed with one call, some SQL APIs such as php's mysql_query do not allow this for security reasons. This prevents hackers from injecting entirely separate queries, but doesn't stop them from modifying queries. The following value of "userName" in the statement below would cause the deletion of the "users" table as well as the selection of all data from the "data" table (in essence revealing the information of every user):

a';DROP TABLE users; SELECT * FROM data WHERE name LIKE '%

This input renders the final SQL statement as follows:

SELECT * FROM users WHERE name = 'a';DROP TABLE users; SELECT * FROM DATA WHERE name LIKE '%';

[edit] Incorrect type handling

This form of SQL injection occurs when a user supplied field is not strongly typed or is not checked for type constraints. This could take place when a numeric field is to be used in a SQL statement, but the programmer makes no checks to validate that the user supplied input is numeric. For example:

statement := "SELECT * FROM data WHERE id = " + a_variable + ";"

It is clear from this statement that the author intended a_variable to be a number correlating to the "id" field. However, if it is in fact a string then the end user may manipulate the statement as they choose, thereby bypassing the need for escape characters. For example, setting a_variable to

1;DROP TABLE users

will drop (delete) the "users" table from the database, since the SQL would be rendered as follows:

SELECT * FROM DATA WHERE id=1;DROP TABLE users;

[edit] Magic String

The magic string is a simple string of SQL used primarily at login pages. The magic string is

'OR''='

When used at a login page, you will be logged in as the user on top of the SQL table.

[edit] Vulnerabilities inside the database server

Sometimes vulnerabilities can exist within the database server software itself, as was the case with the MySQL server's mysql_real_escape_string() function[2]. This would allow an attacker to perform a successful SQL injection attack based on bad Unicode characters even if the user's input is being escaped.

[edit] Blind SQL Injection

Blind SQL Injection is used when a web application is vulnerable to SQL injection but the results of the injection are not visible to the attacker. The page with the vulnerability may not be one that displays data but will display differently depending on the results of a logical statement injected into the legitimate SQL statement called for that page. This type of attack can become time-intensive because a new statement must be crafted for each bit recovered. There are several tools that can automate these attacks once the location of the vulnerability and the target information has been established.[3]

[edit] Conditional Responses

One type of blind SQL injection forces the database to evaluate a logical statement on an ordinary application screen.

SELECT booktitle FROM booklist WHERE bookId = 'OOk14cd' AND 1=1

will result in a normal page while

SELECT booktitle FROM booklist WHERE bookId = 'OOk14cd' AND 1=2

will likely give a different result if the page is vulnerable to a SQL injection. An injection like this will prove that a blind SQL injection is possible, leaving the attacker to devise statements that evaluate to true or false depending on the contents of a field in another table.[4]

[edit] Conditional Errors

This type of blind SQL injection causes a SQL error by forcing the database to evaluate a statement that causes an error if the WHERE statement is true. For example,

SELECT 1/0 FROM users WHERE username='Ralph'

the division by zero will only be evaluated and result in an error if user Ralph exists.

[edit] Time Delays

Time Delays are a type of blind SQL injection that cause the SQL engine to execute a long running query or a time delay statement depending on the logic injected. The attacker can then measure the time the page takes to load to determine if the injected statement is true.

[edit] Preventing SQL Injection

To protect against SQL injection, user input must not directly be embedded in SQL statements. Instead, parameterized statements must be used (preferred), or user input must be carefully escaped or filtered.

[edit] Using Parameterized Statements

In some programming languages such as Java and .NET parameterized statements can be used that work with parameters (sometimes called placeholders or bind variables) instead of embedding user input in the statement. In many cases, the SQL statement is fixed. The user input is then assigned (bound) to a parameter. This is an example using Java and the JDBC API:

In ColdFusion, the CFQUERYPARAM statement is useful in conjunction with the CFQUERY statement to nullify the effect of SQL code passed within the CFQUERYPARAM value as part of the SQL clause.[8] [9]. An example is below.

SELECT *FROM COMMENTSWHERE COMMENT_ID =

[edit] Enforcing the Use of Parameterized Statements

There are two ways to ensure an application is not vulnerable to SQL injection: using code reviews (which is a manual process), and enforcing the use of parameterized statements. Enforcing the use of parameterized statements means that SQL statements with embedded user input are rejected at runtime. Currently only the H2 Database Engine supports this feature.

[edit] Using Escaping

A straight-forward, though error-prone way to prevent injections is to escape dangerous characters. One of the reasons for it being error prone is that it is a type of blacklist which is less robust than a whitelist. For instance, every occurrence of a single quote (') in a parameter must be replaced by two single quotes ('') to form a valid SQL string literal. In PHP, for example, it is usual to escape parameters using the function mysql_real_escape_string before sending the SQL query:

// input: a';DROP TABLE users; SELECT * FROM data WHERE name LIKE '%// output: aDROP TABLE users SELECT FROM data WHERE name LIKE

?>

This sort of escaping is error-prone as it relies on the programmer to escape every parameter. Also, if the escape function (either custom or built-in in the language) fails to handle a special character correctly, an injection is still possible.

Thursday, March 5, 2009

This is a general example of a termination letter. UK employers should refer to the process outlined on the dispute resolution summary page which is law effective from 1st October 2004, and also to the samples of disciplinary action and dismissal hearings letters templates below.

name, address, date, reference

Dear Mr/Ms/etc .........

Further to our meeting of (date) I (regretfully) confirm that your employment with us is terminated with effect from (date)/with immediate effect.

As stated at our meeting the reason(s) for terminating your employment with us is/are as follows:

* (Employer must clearly state reasons - transgressions and relevant policies if applicable) * (Employer must clearly state previous warnings, informal, formal, written etc., and circumstances and person's response and subsequent behaviour/performance for each warning.)

(Clearly state requirements regarding return of documentation, equipment, car, submission of final expenses claims, and any other leaving administration issues.)

(Clearly state actual leaving date, requirement or otherwise to serve period of notice, holiday pay, and other pay and pension details.)

(Clearly state the position regarding the employee's right of appeal, and state the appeal process and timescales.)

(Optional sign-off, for example: Thank you for your past efforts and all the best for your future endeavours.)

Yours, etc.

name and position

(Optionally and recommended: attach, at the foot of the letter refer to, a copy of your written disciplinary process, and also attach and refer to copies of written/printed evidence gathered during the employee's case. This enables employees to understand clearly the case against them, and also the process and their rights during the disciplinary process, which are central to the principles of the employment dispute regulations.)

(Optional section at foot of letter, requiring person to sign, confirming receipt of the letter and any attachment(s), by way of returning a signed copy of this letter.)

Tuesday, February 24, 2009

I had the need of having three different singleton remoting object in the same process.This post explains how I solved out the trick.

I have a windows application exposing via remoting three singleton objects, let' call them "S_a", "S_b" and "S_Main" .

"S_a" and "S_b" are instantiated by remote client applications."S_Main" object is instantiated by "S_a" and "S_b"."S_a", "S_b" and "S_Main" resides on the same process, as I told before."S_a" and "S_b" are WellKnownServiceTypes."S_Main" is to be both a WellKnownServiceType (this is inside the server-application code where a port is open in listening mode) and a WellKnownClientType when configuring "S_a" and "S_b" for its instantiation (i.e inside "S_a" and "S_b" class definition there will be a point in which we say that "S_Main" is not a local object and is to be instantiated via remoting at a certain URL).

Triing to configure remoting in this way, leads to the generation of the Exception:"Remoting configuration failed with the exception System.Runtime.Remoting.RemotingException"

"Attempt to redirect activation for type" [...]"This is not allowed since either a well-known service type has alreadybeen registered with that type or that type has been registered has aactivated service type"

The solution is to have the three singletons in three different appdomains hosted in the same windows process.

First thing to setup is to have three assemblies every one exposing a method which will configure remoting server-side for a single singleton. The classes inside these assemblies must inherit MarshalByRefObject.In this way instantiating these three classes and calling the method on them, will open three ports in listening mode.

Every assembly is to be loaded in a different appdomain. In this way, inside the "S_A_AppDomain" (and also in "S_B_AppDomain") the "S_Main" object is configured as a WellKnownClientType, while in the S_Main_AppDomain it is configured as a WellKnownServiceType.AppDomains provide proper isolation.

dim S_A_Domain As AppDomain = _AppDomain.CreateDomain("S_A_RemotingServer", Nothing, domaininfo)Here is the code used to load an assembly (ex: "Assembly.dll") inside the appdomain, instantiate the class (ex: "namespace.classname", which will reside in the newly created appdomain) and invoke the method that will configure remoting server-side (ex: "ActivateServer") :

Dim ann As [Assembly] = [Assembly].LoadFrom("Assembly.dll")

'Load the assembly in the appdomainDim a As [Assembly] = S_A_Domain.Load(ann.FullName)

'Create an instance (on the new appdomain)Dim obj As Object = S_A_Domain.CreateInstanceAndUnwrap(ann.FullName, "namespace.classname")

'Get the type to use.Dim myType As Type = a.GetType("namespace.classname")'Get the method to call.Dim mymethod As MethodInfo = myType.GetMethod("ActivateServer")

'Execute the method.mymethod.Invoke(obj, Nothing)

The method is invoked in the instance of the class which resides in the separate appdomain, configuring remoting.

Suppose we have two Wellknown singleton remoting objects.the former is instantiated by the latter, and sends events to it.

Let's call S_A and S_B the two wellknown remoting objects.These object reside on two different appdomains. S_B is instantiated by S_A.S_B is the source of events, and S_A has to receive them.Note that S_A is a wellknown on his turn.

After S_B is instantiated in S_A, an exception is thrown:

Wellknown objects cannot marshal themselves in their constructor, or performany action that would cause themselves to be marshalled (such as passing thethis pointer as a parameter to a remote method)

The error happens at runtime, either when a handler is added for an S_B event or as soon as S_B is instantiated.

To understand why this happens, a first resume of how events works is useful.Events are simple to use. What happens behind the curtains, is that a function is called on the target (the object handling the event -S_A-) by the sender of the event (S_B).

Since we are talking about wellknown server objects, what happens when S_B sends an event to S_A, is:the remoting server (S_B) becomes a client of S_A (in fact S_B is calling a function on S_A) .

The exception is thrown because the wellknown object S_B is a SERVER fof S_A, so it is not allowed to use it as also as CLIENT. This is not allowed by remoting. It is allowed elsewhere.

SOLUTION :Create a new class (C_C). Inside this class instantiate the wellknown S_B and receive his events here. S_A will instantiate C_C and receive events from it. C_C can become a client of S_A without problem since it is not a wellknown object.

Wednesday, February 4, 2009

The first computers were people! That is, electronic computers
(and the earlier mechanical computers) were given this name because they
performed the work that had previously been assigned to people.
"Computer" was originally a job title: it was used to describe
those human beings (predominantly women) whose job it was to perform the
repetitive calculations required to
compute such things as navigational tables, tide charts, and planetary
positions for astronomical almanacs. Imagine you had a job where hour after
hour, day after day, you were to do nothing but compute multiplications.
Boredom would quickly set in, leading to carelessness, leading to mistakes. And
even on your best days you wouldn't be producing answers very fast. Therefore,
inventors have been searching for hundreds of years for a way to mechanize
(that is, find a mechanism that can perform) this task.

This picture shows what were known as "counting tables" [photo courtesy IBM]

A typical computer operation back when computers were people.

The abacus was an early aid for mathematical computations. Its only
value is that it aids the memory of the human performing the calculation. A skilled
abacus operator can work on addition and subtraction problems at the speed of a
person equipped with a hand calculator (multiplication and division are
slower). The abacus is often wrongly attributed to China. In fact, the oldest
surviving abacus was used in 300 B.C. by the Babylonians. The abacus is still
in use today, principally in the far east. A modern abacus consists of rings that
slide over rods, but the older one pictured below dates from the time when
pebbles were used for counting (the word "calculus" comes from the
Latin word for pebble).

A very old abacus

A more modern abacus. Note how the abacus is really just a representation
of the human fingers: the 5 lower rings on each rod represent the 5 fingers
and the 2 upper rings represent the 2 hands.

In 1617 an eccentric (some say mad) Scotsman named John Napier invented
logarithms, which are a technology that allows multiplication
to be performed via addition. The magic ingredient is the logarithm of each
operand, which was originally obtained from a printed table. But Napier also
invented an alternative to tables, where the logarithm values were carved on
ivory sticks which are now called Napier's Bones.

An original set of Napier's Bones [photo courtesy IBM]

A more modern set of Napier's Bones

Napier's invention led directly to the slide rule, first built
in England in 1632 and still in use in the 1960's by the NASA engineers of
the Mercury, Gemini, and Apollo programs which landed men on the moon.

A slide rule

Leonardo da Vinci (1452-1519) made drawings of gear-driven calculating machines
but apparently never built any.

A Leonardo da Vinci drawing showing gears arranged for computing

The first gear-driven calculating machine to actually be built was
probably the calculating clock, so named by its inventor, the
German professor Wilhelm Schickard in 1623. This device got little publicity
because Schickard died soon afterward in the bubonic plague.

Schickard's Calculating Clock

In 1642 Blaise Pascal, at age 19, invented the Pascaline as an
aid for his father who was a tax collector. Pascal built 50 of this gear-driven
one-function calculator (it could only add) but couldn't sell many because of their
exorbitant cost and because they really weren't that accurate (at that time it
was not possible to fabricate gears with the required precision). Up until the
present age when car dashboards went digital, the odometer portion of a car's
speedometer used the very same mechanism as the Pascaline to increment the next
wheel after each full revolution of the prior wheel. Pascal was a child
prodigy. At the age of 12, he was discovered doing his version of Euclid's
thirty-second proposition on the kitchen floor. Pascal went on to invent
probability theory, the hydraulic press, and the syringe. Shown below is an
8 digit version of the Pascaline, and two views of a 6 digit version:

The Mousesite - a resource for exploring the history of human computer interaction beginning with the pioneering work of Douglas Engelbart and his colleagues at Stanford Research Institute in the 1960s.