Tuesday, January 13, 2009

jpype usage " absolutely working " turorial

this tutorial tells basic usage of jpype , calling java class with python

suppose java file is this

..................................................................................................................................................................

package com;

class lohi
{
public lohi(String name){}
public static void main(String str[])
{
System.out.print("welcome\n");
}
public void look()
{
System.out.print("Ashish");
}
}
...................................................................................................................................................................

compile this code and add the class file lohi.class is folder "c:\com\" now python code


import jpype
import os.path
jarpath = os.path.join(os.path.abspath('.'), '.')
jpype.startJVM("C:/Program Files/IBM/Java50/jre/bin/classic/jvm.dll", "-ea","-Djava.class.path=C:/")
testPkg = jpype.JPackage('com')
lohith=testPkg.lohi
l=lohith("ashish")
l.look()
jpype.shutdownJVM()


run this code and it will work


you have to change "C:/Program Files/IBM/Java50/jre/bin/classic/jvm.dll" to your system jvm path

......................................................................................................................................................................
after facing lot of errors i got this code working . and doubts please feel free to mail me lookforlohith@yahoo.co.in

Sunday, August 10, 2008

improve selfconfidance

“Experience tells you what to do; confidence allows you to do it.”

Everybody could do with a confidence boost sometimes, so to start with, here are a few basic tips...

1) How to Feel Good When You Need to
Because self confidence and feeling good has a major 'hormonal' element, you can change the way you feel by re-living good times. If you can remember a time you felt really self confident, then excellent - use that! If not, then use a time you felt contented or happy. You could use a photo taken at such a time to remind you. This is just a start but an important one; taking deliberate control of your thoughts and emotions will have a huge impact on your self confidence and other areas of your life.

2) Beating Self Consciousness
Too much self consciousness is the No.1 enemy of self confidence. The trick is keeping your attention off yourself when you need to. Here's how...

a) When you feel self-conscious, (you can usually tell because you start to feel anxious), choose something outside of yourself to focus on and study it in detail. For example: examine a door, look at the different textures and shades of color, wonder about who made it and how and so on. The important thing is that you're learning how to keep your attention off yourself.

It is a good idea to practice this technique in private first. Just sit quietly, practicing focusing firstly on your own thoughts and then deliberately focusing outwards onto a picture or piece of furniture.

b) Social self confidence can be difficult to find sometimes because it is unclear what you are 'supposed to do'. In this event, concentrate on what your purpose in the situation is: whether you're there to...

- find out if you like the other people present
- make others feel comfortable
- find out some information
- make business contacts
- and so on...

It's much more difficult to feel self-conscious if your mind is occupied with a task.

People are often most comfortable with others when working towards a common goal. The common goal of socialising could be making friends, the exchange of mutually beneficial information, expanding your knowledge of different types of people... it could be whatever you want it to be! The key is to have an aim.

3) Watch Out for Undue Criticism - Especially Your Own!
Have you noticed that people will speak to themselves in a way they would never speak to others? You know the sort of thing - you break a glass and it's "You stupid idiot. You can't do anything right can you?"

Criticism that leaves the receiver feeling upset or depressed is rarely useful.

Challenging your own assumptions about yourself and other people can really help build self confidence. Here's a few to get you started:

  1. Those confident-looking people have bad moments too - you just don't get to hear about them!

  2. If you feel under-confident, it doesn't mean other people can tell. They're often too caught up with their 'own stuff' to notice!

  3. If you catch yourself saying things to yourself like "I'm no good at anything" then rest assured, you're wrong about that. Everyone can compose a sentence, get successfully to the store, eat without choking and do a million other things. Negative thinking can make things seem hopeless when they rarely are.

    Don't let yourself make sweeping statements about yourself - in the long run it is this sort of thing that can really damage your self image. If this happens, say to yourself calmly and gently, "Hold on a minute, that's not true". If you can come up with some evidence that disproves the sweeping statement, then even better. It may take a bit of effort at first, but the impact on your level of self confidence is huge.

    Building self esteem is not just about thinking good of yourself, it's about not thinking bad for no reason!

  4. Just because you have felt bad about yourself in the past doesn't mean you're always going to feel that way. I have seen hundreds of people surprise themselves once they have learned exactly how to build confidence in themselves in such a way that it stays built!

    The important thing is to get away from thinking "Why did that happen?" or "Why do I feel this way?" and instead move towards "How would I like to feel?", "In what situations do I feel confident?" or "What do I need to learn in order to have better self confidence in this situation?"

    This change in thinking is so important that we devote quite a bit of time to it on the Self Confidence Trainer, our premium package for teaching the skills of self confidence...