This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Raj Sikka

Ranch Hand
+ Follow
since Apr 11, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raj Sikka

HI,
Can anyone tell me the link to download JOptimizeIt ?
Also is there any document available on how to solve memory leak problems using JOptimizeIt ?
Pls suggest.
TIA,
Raj
17 years ago
Hi,
I have one method which is called 4000 times (say).
I am getting OutOfMemoryException on calling the method for 4000 times.
Is there any error in my method .
Is there any way to take care of OutOfMemoryException in my method??
Please suggest.
My method is as follows.
protected void replaceSpecificComboBoxEditor(List l, int row, int column)
{
DefaultCellEditor editor = new DefaultCellEditor
(new JComboBox(l.toArray()));
removeCellEditor(row, column);
addCellEditor(row, column, editor);
}
I have also tried the following .Still the problem is coming .
protected void replaceSpecificComboBoxEditor(List l, int row, int column)
{
DefaultCellEditor editor = new DefaultCellEditor
(new JComboBox(l.toArray()));
removeCellEditor(row, column);
addCellEditor(row, column, editor);
//added the following lines.
editor = null;
System.gc();
}
Is there any way to force the garbage collector to collect unused object references ?
TIA for the suggestions.
Raj
17 years ago
Hi,
I have one method which is called 4000 times (say).
I am getting OutOfMemoryException on calling the method for 4000 times.
Is there any error in my method .
Is there any way to take care of OutOfMemoryException in my method??
Please suggest.
My method is as follows.
protected void replaceSpecificComboBoxEditor(List l, int row, int column)
{
DefaultCellEditor editor = new DefaultCellEditor
(new JComboBox(l.toArray()));
removeCellEditor(row, column);
addCellEditor(row, column, editor);
}
I have also tried the following .Still the problem is coming .
protected void replaceSpecificComboBoxEditor(List l, int row, int column)
{
DefaultCellEditor editor = new DefaultCellEditor
(new JComboBox(l.toArray()));
removeCellEditor(row, column);
addCellEditor(row, column, editor);
//added the following lines.
editor = null;
System.gc();
}
Is there any way to force the garbage collector to collect unused object references ?
TIA for the suggestions.
Raj
17 years ago
Hi,
I have a JTable with 2 columns(say).
I need to add a third column which should display the row number in it.
How do i display the row number .Is there any API to get the row number of a JTable?
When i remove a row from JTable the row numbers should automatically update.
How should i do?
Pls suggest.
Thanks,
Raj
17 years ago
Hi,
I am new to swing.
What is the purpose of renderers in swing ?(TableCellRenderer etc.)
any good material about the same ?
Pls suggest .
Thanks,
Raj
17 years ago
Hi,
I have a class which implements TableModel.
Inside the class i am using a JTable which has dynamic data.
So i need to refresh the JTable whenever data changes.
For that i am using following lines:
jtable.repaint();
jtable.invalidate();
But i couldnt refresh the JTable .It is showing old data.
I read somewhere that i need to refresh the "model" not the "jtable".
If it is true , how to refresh TableModel?
Pls suggest some solution.
Appriciate any Code samples.
Thanks,
Raj
17 years ago
Hi Kartik,
If you have idea about code to write in build.xml to compile jython file,
please send me one sample.
It is true as you said that jythonc creates class files from .py files.
Thanks,
Raj
17 years ago
Hi ,
I am new to ANT.
I have one build.xml file which builds some java files .
Now I have to include Jython files to it .
I mean i need to compile jython files along with java files.
Any idea how to do this ?
Also Can any one suggest where i can get some code samples for the same.
Thanks,
Raj
17 years ago
Barry,
Thanks for your help.
I am able to run the example with the changes you have done.
Raj
17 years ago
Thanks Berry,
I will try to download.
Raj
17 years ago
Hi Ko Ko,
Thanks for the reply.

Raj
17 years ago
Hi ,
I am getting NullPointerException on calling Jython class from java code.
Following are the source code files:
.py file is :
import java
import sys
from math import *

class CalledByJava(java.lang.Object):
def __init__(self, equation):
"@sig public CalledByJava(String equation)"
self.equation = equation

def solve(self):
"@sig public float solve()"
result = eva(self.equation)
return float(result)


if __name__ == '__main__':
jt = CalledByJava(sys.argv[1])
print jt.solve()
.java file is :
public class CallJython {
public static void main(String[] args) {
System.out.println("Calling Jython function :"+args[0]);
CalledByJava cbj = new CalledByJava(args[0]);
System.out.println(cbj.solve());
}
}
Error i am getting is :
Exception in thread "main" java.lang.NullPointerException
at org.python.core.PyJavaClass.lookup(PyJavaClass.java:43)
at org.python.core.PyObject.<init>(PyObject.java:46)
at org.python.core.PySingleton.<init>(PySingleton.java:8)
at org.python.core.PyNone.<init>(PyNone.java:10)
at org.python.core.PySystemState.initStaticFields(PySystemState.java:396
)
at org.python.core.PySystemState.initialize(PySystemState.java:375)
at org.python.core.Py.initProperties(Py.java:696)
at org.python.core.Py.initProxy(Py.java:738)
at CalledByJava.__initProxy__(CalledByJava.java:135)
at CalledByJava.<init>(CalledByJava.java:113)
at CallJython.main(CallJython.java:4)
Please help me out.
Thanks,
Raj
17 years ago
Hi Ko Ko,
I would like to listen direct answers .Please do not reply to anyone if you do not know the answer to the question.
Thanks,
Raj
17 years ago
Hi ,
Can anyone tell me how to become moderator in this site??
Thanks,
Raj
17 years ago
Thanks for your reply Barry.
Where can I download examples from the book "Jython for Java Programmers"?
Are they available free on net ?
If yes can you please tell me the link.
Thanks,
Raj
17 years ago