« first day (921 days earlier)      last day (4019 days later) » 

6:39 AM
hello
 
7:27 AM
Ah! This room is always with almost no people. I need a real help in java now.
 
Hey
 
@GreekFire Hey! Haven't seen you before here. Anyways many be can you?
 
Not sure whether I will help you or not but you ask your query, let me try.
ya, busy with business.
 
I need help with simpledateformatting.
 
yes
 
7:34 AM
Actually I get date in the form of 1-5-2013 from android date picker view.
 
BRB. Please waitl.
 
8:00 AM
@GreekFire there?
 
DD.
8:12 AM
hello@Appu
 
Hey! how is it going?
 
DD.
not bad... wat abt urs?@Appu
 
Same here. Thanks.
 
DD.
i did splash screen, menu n game layer:) maa
ul always rock in ur work
 
Yay! Great.
maa?
 
DD.
8:15 AM
just like ra, da, ma
 
me? rocking? No ya. I am stuck with this SDF. Agh.
 
DD.
ur working on android apps right?
 
Oh! Okay. Indian native English :D
 
DD.
:) ya
 
Yeah.
 
DD.
8:16 AM
south indian terms:)
y victor din cum today?
 
I don't know. He must be busy I guess. How do you know him?
Please use full words.
 
DD.
ok
 
They tend to represent very vulgar words. You know the real meaning of what you have spoken I think.
 
DD.
you both used chat in SO na
 
Yeah :)
 
DD.
8:19 AM
seriously i dont know, if it was like that i would not have used it
 
Okay. Just type the shortcut word what you have used in google
followed by meaning
Thanks. NP. I have been kept on saying that to everyone who use short cuts because they sometimes tend to represent those kinda things unknowingly.
 
DD.
ur the room owner?
 
9:13 AM
Java....!! I love you..!!
 
So do I. Yay!
@DD. No. Why?
 
DD.
to remove messages of mine@Appu
 
Don't worry. It is pushed up.
Or it will be.
@GokulNath May be can you suggest with simple date format?
 
 
6 hours later…
3:25 PM
@DD. I'm a room owner.
 
@KIRANKJ no.
 
because. I'm just a moderator.
 
then, what is the use of this chat room ???
 
good question.
Why did the original question get three downvotes?
 
3:42 PM
first time the question was very hard to understand.now ok..i think
 
Where is nList being declared and initialized?
Namely, @kannan?
Also,@KIRANKJ, are you using two StackOverflow accounts?
if so, having two accounts for one person is frowned upon on StackOverflow, and could result in one account being deleted permanently.
 
How can I popup JPopMenu with rightclick key of the keyboard? KeyListener?? Or is there an easier way?
 
@ShotgunNinja good question.but goo.gl/C1Kwu
if u block,i need to sign up new one.sorry 4 my previos mistakes.but i want the stackoverflow help everytime.so....
 
4:15 PM
Hey everyone!
@ShotgunNinja sup!
 
 
2 hours later…
5:46 PM
@KIRANKJ You should review and follow the Stack Overflow guidelines more carefully, and you won't get your account blocked.
You seem to be leeching help before showing much evidence of actual background research, from my investigations.
 
 
2 hours later…
7:50 PM
Hi, I had a quick question. I am using javax.script.* with Rhino for scripting in a Java program. A script can implement an interface just fine, but when I try to use similar syntax to instantiate an abstract class(giving the definitions for the unimplemented methods) I get an error saying that MyTestAbstractClass(the class I am trying to instantiate) is an interface or abstract. Am I doing something very wrong?
I'll just ask on the site, never mind.
 
That's probably a good idea. This room is usually empty, and most of the people who frequent it don't speak decent English.
 
0
Q: Instantiating an abstract class in Rhino interpreter in Java Scripting

ObsessiveSSOℲI am using javax.script.* with Rhino for scripting in a Java program. A script can implement an interface just fine, but when I try to use similar syntax to instantiate an abstract class(giving the definitions for the unimplemented methods) I get an error saying that MyTestAbstractClass(the cla...

More details given as well. Is it sufficient?
 
Well, first of all, I added the tag into the question.
 
Ah, I missed that.
 
Yeah, it's cool.
Aside from that, though, I've never worked with Rhino or any JS engine in Java before.
 
8:00 PM
OK. Thanks for the tips...
 
Yeah, sorry I couldn't help more.
 
No worries.
 
But on the other hand... you are trying to instantiate an abstract class?
Isn't that impossible?
 
I've seen something where each instance has its own implemntation of abstract methods, is that something different?
 
@ObsessiveSSOℲ Yeah, that's anonymous subclassing.
 
8:02 PM
Googling...
 
Look at anonymous class java on Google.
 
Sorry, my browser went haywire for a secons.
 
Found it.
 
wb @Moiz
 
8:04 PM
Thanks...
 
Hi Shotgun!!
thanks!
 
Yeah, no problem. I'm not sure if Rhino supports the syntax of creating anonymous classes that implement a bound Java interface or abstract class.
 
Yeah, that might be a problem. I'll edit the post.
 
Can you extend a Rhino-bound Java class with a Javascript subclass? I don't think that is supported, since Javascript's version of class polymorphism is based on prototypes instead of traditional subtype polymorphism.
 
Yeah, that's a bit of a problem...
 
8:09 PM
I have an application that uses 3rd party library. The library creates some threads or lets say I create some threads.. When user hit close button, I need to check if there is any thread that is working or is alive. I don't have access to the object, so I cannot do Thread.isAlive(). How would I check that...Basically I need to check all the thread that spawned from my main method process?
 
Java, C#, and C++ use LSP polymorphism, whereas Javascript uses prototypical polymorphism.
 
So if I make a concrete outer class and an inner interface, where can I create anonymous classes that can implement the inteface. Anywhere within the outer class? Or just anywhere using new Blah{String foo{return "bar"}}?
 
polymorphism is horrible in JS
 
@ObsessiveSSOℲ Anywhere.
@Moiz I'm really not sure; what third-party library is making threads that you don't have the ability to kill safely?
 
OK, understood. Now just to try to get Rhino to listen to me...
 
8:13 PM
Also, if you want some helpful pointers on stopping threads in general, read this.
 
@ShotgunNinja I don't want to kill it. I want to wait for it to finish.
 
@Moiz Can't you just use Thread#yield()?
 
@ShotgunNinja and I'd need to use new OuterClass.InnerInterface(){String foo......}
Or just Outerclass(){String foo.....}
 
@ObsessiveSSOℲ Wrong part of the article.
You were looking at the section (on the same page, for some God-forsaken reason) about inner classes, not anonymous classes.
Let me clarify.
 
My apologies.
 
8:15 PM
One of the big areas where anonymous classes are used is in Event Listeners.
You can extend the pre-written EventListener interface from anywhere where you'd need a concrete implementation.
Say you have a call to addEventListener(EventListener l).
You can make the call as follows:
 
Otherwise that would be a lot of extra unnecessary code
 
@ShotgunNinja I have some worker threads that are copying some files...A user may hit close button which may kill those threads...I need those threads to finish copying and then let the user close it.
 
foo.addEventListener(new EventListener() {
    @Override
    public void onEvent(Event evt) {
        // Do something.
    }
});
So, in one fell swoop, you declare an anonymous implementation of EventListener, implement its onEvent(Event) method, and create an instance of that anonymous class.
@Moiz Do you have access to the Thread objects at all?
if not, then do you have an event producer you can listen on?
Generally speaking, if you have a well-designed library (which is often a stretch), you'd have a worker task that generates some event you can listen for, so you know when the worker's task is complete.
 
OK, it looks like I've gotten the script working with something similar.
 
Doing anything interesting at the moment @ShotgunNinja ?
 
8:22 PM
I do have access to Thread objects...I was just hoping to do it without having references of those objects inside main method or MainApp class ( this class has main method that initializes the UI)
 
So, what you could do is, keep track of any copy threads working in the background by a synchronized list of event listeners, then when they complete, lock the list, remove them, and unlock. If you want to close the window, lock the list, get its size, unlock it, then send up an error message if the size is non-zero.
@Adude11 Nah, just writing up a verification procedure for some sites at work that I have to test.
Really boring stuff.
 
ok
 
@ShotgunNinja I think that would be the best solution.
Thank you!
 
@ShotgunNinja OK, but how would I implement something like EventListener on my side? Googling, the source of EventListener is a giant comment, a package name, and a blank interface.
This is what I haveL
public class TestObject {

	interface TestInterface {

		public abstract String test();
	}
}
Now I can do:
 
Why is the interface inside another class?
 
8:27 PM
engine.eval("var testObj=new com.merkle.TestObject.TestInterface(){" +
					"test: function(){" +
					"return \"foo\";" +
					"}" +
					"};" +
					"var foo=new com.merkle.Foo();" +
					"foo.setTo(testObj);");
 
You can declare interfaces at the same level as classes.
 
I was still following the wrong section of the article there.
 
Yeah, for sure.
Interfaces are first-class citizens, as far as having representation on the namespace level.
 
But I need to have some non-final fields that are part of the anonymous class, and I still haven't found the java-side source that will allow that.
I need both predefined fields and implemented methods. An interface allows the latter, a class allows the former.
 
@ObsessiveSSOℲ Use an abstract class.
 
8:30 PM
That's what I was trying originally. That was the root of the original problem.
 
public abstract class Foo {

protected int x;
public abstract void bar();
public void baz() { /*...*/ }
}

doSomething(new Foo() {
@Override
public void bar() {}
}
});
 
I'm kindly informed by the interpreter that " class com.merkle.TestObject is interface or abstract (<Unknown source>#1) in <Unknown source> at line number 1".
The trick is that I can do most of this on the Java side. But I cannot get a class instance (or anonymous class) on the Javascript side.
Would it be possible for the script to pass a method over the js-java bridge and have the method used as the implementation on the Java side with some sort of reflection?
 
@ObsessiveSSOℲ I don't think so, although you could probably make it into an anonymous interface which takes the information as arguments and gives it back via returns.
I forgot the design pattern's name
Probably "Functor" or "Function Object".
 
Maybe...
 
Possibly "Visitor".
 
8:36 PM
Could you point me to a site that can explain this in a bit more detail?
 
I wouldn't be able to find one at the drop of a hat.
 
Oh, googling helped.
I'll try that and come back if I still have trouble.
Thanks!
 
Yeah, no problem
 
I'm a bit busy atm, so I might not be back until tomorrow.
 
Understood.
 
 
2 hours later…
10:09 PM
@LightnessRacesinOrbit What else?
form feeds?
 
I see. We're no longer friends then.
 
WHY would anyone EVER use spaces for indentation...Seriusly?...
 
Spaces do what they promise.
 
@StackedCrooked You use spaces? Ugh!
 
user142019
10:11 PM
7 messages moved from Java Sucks
 
For the record, I had nothing to do with those messages appearing here.
 
The robot started it!
 

« first day (921 days earlier)      last day (4019 days later) »