| |
| |
| |
|
Page: 1 2 3 4 5 6 7
Comments:
<0> one thing I'm wonderign about up front; what jdk are you using? an official sun one or a (IMO) ripped off "free" one ? <1> the official sun jdk is free no? <2> kwzh have you used a try/catch for this exception? <2> Sancy yes <1> why would someone rip it of?:) <0> Sancy: yes, but some people consider it non-free due to the license. <1> teh GPL license? <3> It's not an Exception, it's a compile-time warning. <0> Sancy: so they created "gnu/java" or whatever its called and presented their own JVM which is all but compatible. <2> but it's warning you about not catching an exception <2> have you used a try catch block ? <1> lool. huge is god's garden:) <3> No, it's not warning about an Exception, either. Sorry if I'm not being clear here. It's in http://pastebin.com/647185 <2> ok, what is the compile error <0> kwzh: still, my question remains; what jvm/java version are you using? <2> the code is not useful yet
<3> Sun's 1.5 <2> kwzh what is the compile error <3> javac 1.5.0_03 to be more precise. The compile warning is in the pastebin, as a comment line. <2> kwzh it's not relevant (any more) what jdk you are using <3> Foo.java:9: warning: [unchecked] unchecked generic array creation of type java.util.Collection<Foo>[] for varargs parameter <0> that is not in the pastebin <2> looks like you have the gereric syntax wrong <0> oh.. my mistake, spotted it. <3> The code does compile, despite the warning -- so if I got the syntax wrong, I must have accidentally written something that's still legal. <3> (Brb, bathroom...) <2> sorry I don't play with 1.5 so have little futher insight <3> Okay, let me see if it looks any more obvious on an empty bladder :-) <2> lol <4> kia ora calchas <2> hi, what? <3> Okay, I now have an even simpler test case. <3> Collection<Foo> co = new ArrayList<Foo>(); <3> Collection<Foo>[] coo = {co, co}; <3> That's sufficient to cause a warning about a "generic array". <2> to me having the [] looks wrong <3> As opposed to what? coo is an array of Collection objects. <3> Maybe I should have used something besides Collection for the example, to be less confusing. <2> is there an operator presidence issue <3> Collection<Foo> coo[] = {co, co}; // same results <3> "generic array creation", pointing at the left-brace. <2> that shouldn't change anything, btw I'm just brainstorming <3> Sure <2> (Collection<foo>)[] ? <3> The new complete example is in http://pastebin.com/647209 <3> ...and using an explicit "new" doesn't change anything (good; it would have been inconvenient to add that) <3> Oh ho... Google to the rescue... <2> what's the answer? <3> I found some discussion in a forum from 2004 <2> +a <3> Unless things have changed since then, it looks as though arrays of generic types simply aren't supported, <3> because of the way that generic types are discarded after compilation. <2> makes sense with the error I guess <3> http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf section 7.3 has more info about it, reading it now... <3> I guess in the original code, I'll declare the argument type to be Foo<?>... and then cast it to Foo<E>[]. Annoying, but at least most of the ugliness is tucked away in the utility cl***. <4> kwzh: that's why the collections framework exists <4> ArrayList<E> data = new ArrayList<E>(); <5> you have a cl*** named E? :) <3> My utility cl*** is parameterized by E. <5> hmm..maybe there's more to generics that I thought...I thought the values in the '<>'s had to be cl*** names..E doesn't seem very descriptive <3> In the cl*** declaration, E is a meta-variable for the cl*** name. <5> gotcha <3> Analogous to a function declaration f(int x), where x can match any int expression at the caller's end, <3> a cl*** declaration Foo<E> can be instantiated with Foo<String> or whatever. <5> doesn't that take away from what generics are intended for? seems more like a job for an abstract cl*** <5> admittidly, i had never heard of meta-variables until now but i'm looking it up <2> that is what generics are for <2> used to be reffered to as parameterised types <3> I don't know if any Java documentation calls them meta-variables, but that seemed like the right word to describe them. <3> So I don't know if you'll find anything useful in a search. <5> parameterized types seems to yield more results as calchas mentioned...at least when searching the forum.java.sun.com forums <2> was the old word for it before they were added to c++, and it descibes them well to my mind (but I'm old and old fashioned) <3> You know, I think a good deal of my confusion with this is caused by the fact that "Foo<Bar>" is called a "generic". In my mind, "Foo<Bar>" is specific, and unadorned "Foo" is generic (and to be avoided). <5> kwzh: i agree completely...but I think most everyone is familiar with the aspect of casting...generics just seem like the logical solution to catching Cl***CastExceptions before they happen <3> Sure
<5> I know it's a bad idea to think of things from the GUI perspective, but I am constantly reminded to use generics when Eclipse gives a warning for not doing so when the compiler is set at 1.5 <5> thus the reason I have used them for most of the projects I've done recently <3> I compile both with Eclipse and directly from the command line. <3> The former seems to have more warnings for some reason (is it using a built-in compiler instead of the native javac?), but the latter is much easier to processs. <5> I create jars from the command line but use an IDE for everything else...I've used and like JBuilder from its UI perspective but its expensive and robust...most of the guys I work with use IntelliJ which seems really nice, but I haven't had time to learn its intricities yet...my major preliminary beef is that it doesn't have an aspectj plugin <2> added edit time checking I think, but I use IDEA <5> although most would disagree, my primary beef with eclipse is the idea of a workspace...i wish I could just create a standalone project for each app I am working on like in Jbuilder...I understand the cons considering you have to setup your user libraries for each app you do, but that has never bothered me <3> Oh yes, there's a serious gripe I have about Eclipse... <3> When I use it to launch a program, I don't know of any way to specify args for main. <3> Also, I don't know of any way to generate an EOF from Eclipse's console. <5> to specify parameters you have to create a Runtime instance, but the problem with that it is that it shows up even if the project is closed as long as you are in the same workspace...this can be frustrating if you have a workspace set to C:\dev\apps like I do...basically means ALL of your project's runtime instances show up even if you are focused on just one...not sure about the EOF stuff...never needed or used it <6> what should i use to read in a txt? fileinputstream.read returns me int, i want strings <6> i juste wanna read lines one by one <3> BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) <3> String s = br.readLine(); // returns null for EOF, throws on error <7> when i do a cvs add , how come it says do 'cvs checkout' first? <5> Fleed: are you familiar with http://javaalmanac.com/ kwzh is right, but similar questions can be answered by lookign there <6> thanx <3> I've never actually sat down and gone through the Eclipse tutorials. <3> I should do that someday when there's nothing more critical in my queue (which probably means "never"). <5> kwzh: to be honest, neither have i, but i use aspects for a lot of my projects, so I've used eclipse exclusively the past year or so...as i said, i used to use jbuilder primarilly <5> kwzh: i was at borders bookstore earlier today and saw that there was a 600 page book covering eclipse so obviously there is a lot to know <3> I think my biggest Eclipse gripe is that (AFAIK) when you're in the debugger, there's no way to interact with the program by calling one of its functions. <3> In particular, I'd like to be able to do things like System.err.println(x) to inspect the current value of variable x. <3> I was just reminded of this by spending a significant amount of time inspecting x the hard way, by stepping through its substructure in the "Variables" panel -- when all the information I need is encoded in x.toString(). <5> kwzh: i've never really studied up on it or been taught how to do proper debugging, but I've always gone my intuition and added println() statements where I think they should occur after logging at the exception thrown...this is something I should probally look into <3> My supervisor gets upset when I do "primitive" debugging by inserting printlns, but often they're faster than the alternative. <5> kwzh: wish they taught this type of stuff in college...i'm graduate student and graduating in December...no course I've ever taken has covered basic debugging...hopefully I'll learn more through work experience <3> Hm, interesting. <3> I remember when I was an undergraduate, there was there was some cl*** using an old Unix system, which had a reasonably useful debugger... <3> But the professor only told the cl*** one command that used it -- effectively "dump the registers and exit the debugger" <5> kwzh: this may be something already common in most IDEs, but is there way to monitor a variable's state as it goes through the program cycle? <3> (I think that was the same cl*** where they were told that the way to invoke a program on Unix is "a.out <infile> outfile", as if those were angle brackets around the first file name, rather than two independent operators for read-from and write-to.) <3> Hm, you mean a watchpoint, to let you know when the value has changed? <5> that seems to be what i am thinking of...seems like it would be very useful debugging...will look into it <5> I took a software testing cl*** but it was primarilly concerned with the mentality you should have in order to test already compiled software...while useful, did not cover debugging or unit testing...i learned JUnit on my own, but haven't had time to experiment with debugging functinality existent in IDES so far <3> Hm, I wonder if there's already a simple web browser API implemented in Java, that could be invoked from the command line. (No rendering, just some way to make a remote web page act as if it were talking to a human interactively.) <5> i don't think i follow <3> I need a program that will tell me what text would be displayed if I were to visit web page X and press button Y. <3> It may need to honor the cookies on my system, too. <3> I can get to web page X by using the wget program, but I don't think I can do any further interaction through it. <5> kwzh: i see...admittidly i don't know the status of text based browsers as I've never really used them...my initial impression would be to submit the form containing button Y using javascript and capturing the redirected page using an input stream...should be able to access the text from there...know that I probally don't grasp your problem alltogether <3> Well, for a specific example, suppose I had the question "What interest rate does Bank of America offer on a three-year $1000 CD." <3> I know how to navigate to a page that tells me the answer, but it involves human interaction -- entering the URL and then clicking some buttons that have Javascript functions attached. Of course, I have no control over how that remote web page is implemented. <5> kwzh: interesting question...but I'm not sure the answer will arrive until people encode their web files with meta information...seems like a semantic web concept...i mean how else would one know to submit button X to receive answer/page Y? <3> So I'd like to be able to write a script that will simulate those fixed actions, and then just output the string that represents the final page content (I already have something that will parse the text and find the actual number that I want). <3> ***ume I already *know* what buttons need to be pressed; there's no need for the program to figure that out. It can be hard-coded. <3> How can I write a program that will answer this *specific* question? <5> kwzh: what are the limitations of current text based browsers? I've never used them so I honestly don't know...It seems like a of javascript to press the buttons specified and the job of java to catch the InputStream or whatever is returned by the page <5> but the meta information is what is going to tell you what buttons to press...it has to <3> I don't know how the any client is implemented that way, text-based or not. <3> s/the// <5> of course, most clients are written at a much lower level...something java would be unable to do as far as i know <5> i should rephrase that...the interactions between a client's request to a webpage and the return value is returned at a much lower leve <3> I can't imagine why it would be a problem for Java. All it has to do is send a string across the wire, and get a string back. <3> The lowest applicable level is just that one pair of I/O calls, and that'll be independent of what language is being used. <5> kwzh: are you just trying to get the return value/webpage based on the form attributes that you submit? If so, I would think most text based browsers would support this feature <3> I think the answer to your question is "Yes"... <3> But the point is that I want to be able to get the information programmatically, with no human interaction. Using a text-based browser instead of a graphical one isn't good enough, if I still have to press the button myself. <5> if you expect to perform a query such as "Get last 100 visitors to this website" I don't foresee any other way than having 1. Meta information to determine what buttons to press via a search and 2. A way to automatically submit the suggested button clicks as dervied from the meta information...the former in this case is much more difficult <3> I already said, the meta information isn't an issue. <3> ***ume a human *is* involved for that part, once only, before writing the program. <5> but since you said such meta information could be hard coded the latter might be more difficult...however, i'd expect most modern browsers to support posting to a form and returning the value <3> (If the program breaks because the remote end changed the page layout, that's acceptable.) <8> can anybody recommend any good java primers for c++ programmers? <9> Hello <9> I've got a little trouble <9> I visited http://java.sun.com/j2se/1.5.0/docs/api/java/util/Random.html in search of getting random numbers but don't know how to use it <9> could you help me? <10> morning <11> hi <11> does anyone know if there's an API that reads TomeRaider files? <12> tombraider by any chance?
Return to
#java or Go to some related
logs:
#windows #mirc #chatzone ALOOOOOOOOOOOOOOOOOOOO cin sucks C++
#MissKitten lukeneedsatrim how to recompile ida asm #AllNiteCafe #linux
|
|