Hope Zhu

Ranch Hand
+ Follow
since May 11, 2004
Merit badge: grant badges
For More
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 Hope Zhu

I understand now. problem fixed, thanks a lot!
Hope
Thanks Eric! I am still confused. By using "webcam1.jpg?ts=" + encodeURIComponent( new Data().toString() ), do you mean I need another file name instead of webcam1.jpg to break the caching?

Hope
I am working on a test html page to auto refresh an image, the image is taken by my webcam. If the image name remain the same the image won't refresh automatically. Can someone please help!! Below is my code.
Hi,

I wonder if anyone here have seen similar problem as I am having. I
have a
java process running as a service (using javaservice) on Windows 2003
Server, it starts and runs fine most of the time. The problem is when
the
process quit sometimes due to db connection down the service is still
showing running (started), not every time though. if anyone knows how
to
fix it please help.

Thanks in advance.
Hope
17 years ago
Hi,

I am working on a project which uses embedding jess in java. The system first load a .clp file which has all modules & rules definitions in. Later in java I assert all facts into Jess. The problem is that I don't know how to assert fact objects into a specifical module. I use eng.assertFact(fact) but it goes into MAIN module all the time. Does anyone knows how to do it?

Thanks in advance.
Hope
18 years ago
Hi,

I wonder anyone here could help me to figure out how to set nil as a slot value from java.

I have a template in a .clp file define as below:

(deftemplate test1
(slot x)
(slot y (default nil))
(slot z (default nil))
)

Inside my java code I call Fact.setslotvalue and Rete.assertFact to do what I want. The problem is if I want to set null(java) to y or Z I always get null exception. I tried in jess enviorment it works fine, but why not from java?

Below is my java code snippet. If anyone knows why it did not work please help. Thanks in advance.

Rete eng = new Rete();
Fact testFact = new Fact("test1", eng);
testFact.setSlotValue("x", new Value(new Date()));
testFact.setSlotValue("y", null); //with or without this line I get exception, but different exception.
eng.assertFact(testFact);

By the way we use Jess 6.1P7.

Thanks
18 years ago
Forgot one more thing. I know if I always retract the shadow fact which has the older timestamp then I will only have the latest left. But I may need the old facts to stay in for other rules. So the question should be without retracting any facts how to find out which one is the latest.

Thanks again.
18 years ago
Hi,

I am working on writing a rule to figure out which shadow fact in a group has the latest timestamp. Then use the found out in another rule. All shadow facts are the same java object and the size of the group is changable. If there are only two in the group I know how to achieve the goal, but more than two in a group I could not figure out how to do it. Can someone please help!!!

Thanks in advance
18 years ago
I think it's better to put my question this way: if it's possible to have more than one transacted session against the same physical queue at the same time? If the answer is yes, then is there any special configuration needed when create the queue?

Thanks
Hope
18 years ago
Hi,

We have two applications read from the same queue. If the queue is not transacted we have no problem. But in our case we have to use transacted queue and call commit at the end. In the test two applications work fine most of the time but encounter commit error once in a while. Does anyone know why?

Thanks in advance.
Hope
18 years ago
Hi,

I have a java application receiving message from an IBM Queue then processing the message. The application runs fine most of the time. But sometimes when there are no message for long time the call to qrec.receive(60000) seems hang and does not come back again. Has anyone had similar problem? Please help!

Thanks in advance!
18 years ago
Hi,

I have a java application which runs as a service on a windows platform. I would like to find a way to catch the stop signal from the service control window then I will be able to free all resource properly. Anyone knows how to do it please help.

Thanks in advance!
Hope
19 years ago
Ernest, thank you so much! The problem solved.
19 years ago
Great! Below is the rule:



fltdata is a shadow fact. When I put the fact into the working memory most of the time the current time won�t be exactly 2hrs before sched_gmt_dt. If I don�t do modify or reset at the right time the fact won�t trigger the rule.

Thanks a lot!!
[ November 16, 2004: Message edited by: Ernest Friedman-Hill ]
19 years ago
I don't know if I get you right. Do you mean I should add a time property in my bean and use it as a dynamical shadow fact? For this to work do I have to keep the bean in my java application memory too? It's hard to do so since I may have max 7 millions shadow facts (same kind of bean) in my working memory at one time. I can not afford to keep both in memory unless both bean & fact ref to the same memory area. This is why I asked before how to get javabean back from a fact. I did try to call "modify" for all facts in the fact-list every time before I call "run". It worked better than calling �reset� but still took a long time. I really don't know what I can try next. Please help.

Thanks
19 years ago