Switch to DuckDuckGo Search
   February 1, 2011  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | >


NOTICE: This channel is no longer actively logged.

Toggle Join/Part | bottom
[00:00:02] <cheeser> doesn't alternatives work on a user by user level? or is it all or nothing?
[00:00:09] <freeone3000> cheeser: All or nothing. It's a symlink.
[00:00:11] <cheeser> on gentoo, you can set up user-specific JVM settings.
[00:00:16] <cheeser> ~gentoo++
[00:00:16] <javabot> gentoo has a karma level of 12, cheeser
[00:00:20] <EuroTrash> Any opinions on app engine?
[00:00:31] <jesmon> the $PATH env variable, however...
[00:00:38] <EuroTrash> ~app engine
[00:00:38] <javabot> EuroTrash, I have no idea what app engine is.
[00:00:39] <StoneCypher> ok so
[00:00:41] <cheeser> javabot: jesmon++
[00:00:41] <javabot> jesmon has a karma level of 1, cheeser
[00:00:43] <EuroTrash> ~gae
[00:00:43] <javabot> EuroTrash, I have no idea what gae is.
[00:00:47] <StoneCypher> 1.4.2 and 1.5.0 run just fine in parallel
[00:00:52] <StoneCypher> what this really is is the installer failing
[00:01:02] <freeone3000> EuroTrash: It's a container that runs servlets, and will run your app for free! However, you're going to use the unpopular bits, like JDO.
[00:01:18] <cheeser> it runs something approximating servlets.
[00:01:22] <wyvern`> EuroTrash, check out AWS's new offering that lets you run plain ol tomcat instead of Google's custom java
[00:01:35] <EuroTrash> Same price?
[00:01:36] <wyvern`> GAE does weird things with reflection also
[00:01:43] <wyvern`> for low usage, yeah
[00:01:52] <EuroTrash> JDO somehow seems sort of attractive, but maybe it isn't, heh.
[00:02:09] <freeone3000> It's not as popular as JPA.
[00:02:16] <wyvern`> GAE is not "run your java code". It's "if you use exactly these parts of the jre that we happen to support, run your code"
[00:03:13] *** jonkri has quit IRC
[00:03:20] <dreamreal> GAE is kinda creepy but awesome if it does what you need
[00:03:29] <StoneCypher> so ... no help?
[00:03:36] <EuroTrash> That's sort of what I was thinking.
[00:03:51] <wyvern`> StoneCypher, at this point the help you need is on a centos channel
[00:03:59] <dreamreal> StoneCypher: I dunno, I don't use RPM, and I don't have a CentOS install handy
[00:03:59] <jesmon> StoneCypher: man alternatives
[00:04:04] <wyvern`> unless you decide to screw the rpm stuff and just download the standalone installer
[00:04:24] *** nabukadnezar43 has quit IRC
[00:04:30] <jesmon> StoneCypher: you can set it to 1.5 when you're working on the lame project and back to 1.6 when you're not
[00:04:56] *** tophyr has quit IRC
[00:05:14] <StoneCypher> this isn't a centos problem
[00:05:28] <StoneCypher> ok, i guess i'll figure it out.
[00:06:22] <dreamreal> StoneCypher: sorry about that
[00:07:06] *** jogla has joined ##java
[00:07:41] *** Gracenotes has quit IRC
[00:07:58] *** chipotle has quit IRC
[00:09:04] *** Gracenotes has joined ##java
[00:12:34] *** tizbac has quit IRC
[00:13:17] <Xabster> i have a simple jdialog with 2 elements, a textarea and a textfield
[00:13:31] *** neshaug has quit IRC
[00:13:37] <Xabster> i'd like the cursor to be in the textfield when the dialog is opened, so i put textfield.requestFocus() in the constructor, but it doesn't work, the textfield doesn't have focus
[00:15:32] <Xabster> oops, it's a jframe not a jdialog
[00:15:37] <Xabster> if that matters
[00:15:43] *** BeholdMyGlory has joined ##java
[00:15:47] <StoneCypher> okay, first problem down: oracle made a botched rpm
[00:15:52] <StoneCypher> got past that.
[00:15:57] *** factor has quit IRC
[00:16:03] <StoneCypher> second problem: oracle's java uninstaller is apparently dependant on java.
[00:16:08] <cheeser> no way!
[00:16:15] <cheeser> i doubt the rpm is corrupt.
[00:16:27] *** elux has quit IRC
[00:16:34] <StoneCypher> i didn't say corrupt, i said botched. there are naming standards and oracle isn't following them.
[00:16:37] *** jkirk has joined ##java
[00:16:41] <StoneCypher> on forcing the package name, it picks up again.
[00:16:47] <cheeser> fine. s/corrupt/botched/
[00:16:55] <StoneCypher> well you can doubt it if you like, but it's right there.
[00:16:56] <StoneCypher> so
[00:17:05] <StoneCypher> apparently i can't uninstall java if java is broken
[00:17:07] <StoneCypher> what do i do next
[00:17:21] <cheeser> there are no "standards." just suggestions. and there are 8 different groups with differing opinions on what's what.
[00:17:27] <StoneCypher> okay
[00:17:29] <cheeser> rm the dir
[00:17:44] <StoneCypher> wouldn't that just leave rpm's database incorrect?
[00:18:05] <cheeser> yes. you'd have to manually purge that.
[00:18:20] <cheeser> try #centos on how to manage that one, though. i quit using rpm based systems years ago.
[00:18:25] * StoneCypher sighs
[00:18:52] *** Behold has quit IRC
[00:19:11] *** shodan45 has quit IRC
[00:19:26] <StoneCypher> so since this _still_ isn't a question about rpms
[00:19:33] <wyvern`> run the standard installer. Then export JAVA_HOME=$HOME/local/jdk-1.6.0.23
[00:19:43] <StoneCypher> wyvern`: i can't, because the last time i did, it broke
[00:20:33] <wyvern`> just download the .bin, not the rpm-bin
[00:20:38] *** modernbob has quit IRC
[00:20:53] <StoneCypher> wyvern`: ok
[00:21:27] <wyvern`> when you run it, it gives you a directory. Put that directory in a place. Point $JAVA_HOME at that place. Done.
[00:21:46] <jesmon> StoneCypher: what does 'rpm -qa | grep java' say? that you have both rpms installed?
[00:21:47] <cheeser> knowing how to use your OS++
[00:22:03] <jesmon> maybe that should be 'grep jdk'
[00:22:17] *** mmello has quit IRC
[00:22:22] *** taitale has quit IRC
[00:22:29] <StoneCypher> cheeser: this really isn't an OS issue.
[00:22:32] *** ader10 has quit IRC
[00:22:47] <jesmon> StoneCypher: it kind of is
[00:22:55] *** Lymia has joined ##java
[00:23:10] <StoneCypher> no, it kind of isn't.
[00:23:16] <StoneCypher> this happened because oracle botched the rpm
[00:23:20] *** tty1 has quit IRC
[00:23:21] <cheeser> no, they didn't.
[00:23:23] *** PigFlu has joined ##java
[00:23:28] <StoneCypher> you know what
[00:23:33] <cheeser> it may not be compatible with your distro though.
[00:23:34] <jesmon> StoneCypher: I've used that rpm before, on a centos system
[00:23:36] <StoneCypher> i might as well say it because i'm going to get banned anyway
[00:23:44] *** ChanServ sets mode: +o dmlloyd
[00:23:45] *** Xabster has quit IRC
[00:23:46] <StoneCypher> cheeser, yet again you just don't know what the fuck you're talking about.
[00:23:48] *** dmlloyd sets mode: +b StoneCypher!*@*
[00:23:51] <cheeser> of course i don't.
[00:23:52] *** StoneCypher has left ##java
[00:23:57] <cheeser> becuase i've never used linux at all.
[00:23:59] <cheeser> dipshit
[00:24:20] <wyvern`> cheeser, fyi linux has a short 'i'. (Wouldn't want you to embarrass yourself) :)
[00:24:29] <cheeser> and a long 'u'
[00:24:37] * dreamreal sighs
[00:24:38] *** zatan has quit IRC
[00:24:47] <dmlloyd> lyewnyicks
[00:24:53] <dreamreal> remove the ban, please
[00:24:53] <cheeser> "i am linus torvalds and I pronoune linux 'leenooks'"
[00:24:54] <cheeser> 8^)=
[00:25:05] *** l2trace99 has quit IRC
[00:25:07] <EuroTrash> Leenoos Torvalds
[00:25:08] <cheeser> i think it's fine where it is, personally.
[00:25:15] <cheeser> but that's up to dmlloyd since he set it.
[00:25:32]
[00:25:37] <cheeser> anyway. dinner time.
[00:25:44] *** modernbob has joined ##java
[00:26:09] <dreamreal> dmlloyd: note that the centos channels agree that oracle screwed up the RPM
[00:26:18] <dreamreal> so you're kinda blaming the messenger, at best
[00:26:21] <dmlloyd> doesn't mean it's ok to be an asshole
[00:26:36] <dreamreal> yeah, well. pot, kettle, etc.
[00:26:42] <cheeser> dreamreal: like i said, i doubt the rpm is at fault. different distros do odd things with RPMs.
[00:26:43] <dmlloyd> sure
[00:27:03] <dreamreal> cheeser: why would the centos channel say the RPM is broken?
[00:27:06] <cheeser> anyway. the guy's a dick. he always is. and i have to go eay.
[00:27:23] <cheeser> dreamreal: why would I say it wasn't? because that's my inclination.
[00:27:32] <cheeser> saying something doesn't validate it just because you say it.
[00:27:40] * dreamreal remains frustrated by how retarded ##java can be.
[00:27:41] <cheeser> i could be wrong. they coudl be wrong.
[00:27:58] <dmlloyd> anyway the whole RPM thing is off-topic so I don't feel bad about it at all
[00:28:02] <cheeser> but my money is on centos being odd considering how many people have used those rpms successfully.
[00:28:07] <cheeser> javabot: dmlloyd++
[00:28:07] <javabot> dmlloyd has a karma level of 243, cheeser
[00:28:16] <dmlloyd> not like it's any secret
[00:28:21] <cheeser> i'm out!
[00:28:23] <dmlloyd> go eat
[00:28:44] * wyvern` tries and fails to come up with an rpm-based joke about eating
[00:29:47] *** cafesofie has quit IRC
[00:29:50] *** eric-atl has quit IRC
[00:30:16] <dreamreal> Not that it matters, but I'd rather focus on helping even jerk noobs than not.
[00:30:35] <dreamreal> If it's a help channel of any kind, or one that purports to try, then we should try.
[00:31:28] *** ader10 has joined ##java
[00:31:58] <jesmon> dreamreal: re. the oracle rpm: linux distros have some pretty strict packaging guidelines, and many, including Red Hat, also distribute their an open source java stack. I think when they say "broken", they mean that it doesn't play well with their custom java stack, and the packages that depend on it.
[00:32:17] <dreamreal> jesmon: sure
[00:32:26] <jesmon> In my experience, it's not too hard to remove or ignore the distro java bits and then the rpm should work fine.
[00:33:17] *** PelleTut has quit IRC
[00:33:19] *** c_axis has joined ##java
[00:33:27] *** wabash has left ##java
[00:33:35] <dreamreal> you should write that up so other people learn from your experience. I don't use RPM, so I am of no help.
[00:35:04] <jesmon> dreamreal: I usually don't use the rpm version of Oracle's jdk either, but I had to because of a dumb packaging dependency from an unnamed project. And I've had no problems so far
[00:35:27] <jesmon> this is also on centos 5.x
[00:35:55] <dreamreal> *nod* Apparently he has a fairly unique requirement? I don't know why - personally, I'd try to figure out why 1.6 couldn't compile a 1.5 source - but still.
[00:36:21] *** Behold has joined ##java
[00:36:58] *** hexmasta has quit IRC
[00:37:07] <jesmon> dreamreal: I think it's worth remembering that Oracle's linux distro is based on Red Hat, too ;P
[00:37:28] *** chipotle has joined ##java
[00:37:29] *** cbrock has quit IRC
[00:38:38] *** surial has quit IRC
[00:39:39] *** BeholdMyGlory has quit IRC
[00:39:50] *** Optic has left ##java
[00:40:19] <km> anyone got a link for all the jdk java options?
[00:40:36] <dreamreal> km: there isn't one; further, which JDK? :)
[00:41:13] <km> i am lookin for all the CATALINA_OPTS that i can use
[00:41:14] <wyvern`> http://blogs.sun.com/watt/resource/jvm-options-list.html
[00:42:19] <dreamreal> km: that's not the same as the jdk java options
[00:42:30] <dreamreal> but again, which JDK?
[00:42:32] *** ader10 has quit IRC
[00:42:32]
[00:42:55] <dreamreal> you do realize that those are passthroughs, right?
[00:43:09] *** Xabster has joined ##java
[00:43:33] <km> ok. that can i find all the valid options for catalina_opts or jvm_opts used in tomcat?
[00:43:39] *** jesmon has quit IRC
[00:43:45] * dreamreal sighs
[00:43:55] <dreamreal> look... the jvm options are the jvm options, they're not tomcat-specific
[00:44:06] <dreamreal> if you know of a property to set, you can set it
[00:47:13] *** Stormsys has quit IRC
[00:48:08] *** pipeep has quit IRC
[00:48:51] *** rretzbach has quit IRC
[00:49:53] *** thezall has joined ##java
[00:52:53] *** kermit has quit IRC
[00:56:41] *** gelignite has quit IRC
[00:57:07] *** cheezey has quit IRC
[00:57:10] *** Matuku has quit IRC
[00:58:23] *** _controller has joined ##java
[00:58:25] <_controller> hi guys
[00:58:31] <_controller> question:
[00:58:34] *** Matuku has joined ##java
[00:58:41] <_controller> i have a function that returns a long
[00:58:58] <_controller> but doesn't always have to be a long, it usually actually just returns ints, bytes, shorts casted to longs
[00:59:07] <_controller> to avoid having to cast everytime i call the function
[00:59:24] <_controller> like "int blah = (int) myFunction();"
[00:59:32] <_controller> im attempting to use generics to bypass this
[00:59:46] *** squi has joined ##java
[00:59:58] <_controller> but tbh, i try to avoid generics as much as i can mainly due to type erasure pissing me off]
[01:00:00] *** youdonotexist has quit IRC
[01:01:17] <_controller> so im doing right now <T> T myFunction() {...return (T) ((Long) myPrimitiveLongResult) }
[01:01:25] <_controller> is there any cleaner way of doing it?
[01:01:39] <_controller> i wanna make use of type inference, so i really dont want to like pass a Class
[01:01:44] <_controller> Class<T> as parameter
[01:01:55] <cheeser> ~~ _controller enter
[01:01:55] <javabot> _controller, enter is not punctuation. Please don't press your Enter or Return key until you've finished typing your question, sentence, or idea. It is annoying to see that and hard to follow.
[01:02:10] <_controller> sorry cheeser
[01:02:25] <wyvern`> _controller, a method that returns different types is kind of fundamentally weird. One way or another you're going to do the cast
[01:03:55] <_controller> but wyvern` does that function to a cast at runtime?
[01:03:59] <_controller> do*
[01:04:21] <wyvern`> casting is pretty cheap. I wouldn't worry about the cost of the cast
[01:04:39] *** cking_nj has quit IRC
[01:04:46] <_controller> im not concerned of checkcast instructions' performance cost
[01:04:53] <_controller> im just curious if it does it at all\
[01:04:59] <wyvern`> dunno, but javap will tell you
[01:05:13] <_controller> i see
[01:05:22] *** belugs has joined ##java
[01:05:37] <_controller> also, while researching information, i've seen the following being used as well: TClassName
[01:05:45] <_controller> what does this encompass, wyvern`?
[01:06:26] *** sbalmos has joined ##java
[01:06:30] <wyvern`> not sure
[01:06:57] <freeone3000> Generic runtime casts interperted as a cast to their bound at runtime. Not sure if unbounded casts cast to Object, or not at all. Presumably the latter.
[01:07:32] *** chipotle has quit IRC
[01:07:48] <wyvern`> hence the unchecked warnings I guess
[01:07:49] *** chipotle has joined ##java
[01:07:53] <_controller> could you reword that freeone3000?
[01:08:00] *** linusoleander has quit IRC
[01:08:07] <_controller> not sure what unbounded/bounded casts mean
[01:08:14] *** do0ob has joined ##java
[01:08:24] <freeone3000> _controller: Generics can be bounded, such as <T extends Comparable<T>>, or unbounded <T>.
[01:08:26] <wyvern`> bounded: <E extends Foo>
[01:08:38] <_controller> oh i see
[01:08:51] <_controller> so it doesnt cast at all?
[01:08:53] *** antigravity has quit IRC
[01:08:57] <_controller> what happens with type inference?
[01:09:02] <freeone3000> Haha type inference.
[01:09:16] <_controller> if i do: String str = myFunction();
[01:09:25] <_controller> that's the same function that does: <T> T myFunction() {...return (T) ((Long) myPrimitiveLongResult) }
[01:09:26] <freeone3000> Doesn't work. It doesn't know what to cast it to.
[01:09:48] <_controller> define "doesn't work". would it throw a runtime exception?
[01:09:53] <freeone3000> Doesn't compile, as posted.
[01:10:13] *** arborist has quit IRC
[01:10:30] <freeone3000> "String str = <String>myFunction();" would work, and would generate "String str = (String)myFunction();" (assuming that myFunction returns a T)
[01:10:42] <_controller> it seems to compile just fine freeone3000
[01:10:50] <_controller> it's inferring the type, as i said before
[01:10:54] <freeone3000> It doesn't do that.
[01:10:59] <Lymia> freeone3000, I thought the syntax was myFunction<String>()
[01:11:06] <freeone3000> Lymia: Probably.
[01:12:08] <_controller> no it isn't lymia, it's <String>myFunction()
[01:12:14] <_controller> <T> myFunction()
[01:12:40] <_controller> freeone3000, then maybe you'd like to enlighten me as to why it's compiling :)?
[01:12:46] *** hd1 has joined ##java
[01:12:56] <hd1> ~pastebin
[01:12:56] *** pipeep has joined ##java
[01:12:56] <javabot> http://rifers.org/paste - Paste the final url after you've pasted your stuff there.
[01:13:19] <freeone3000> _controller: Probably the unchecked cast. You put the compiler in a "Trust me on this one", so it'll stop type-checking.
[01:13:38] <freeone3000> Huh. I'm wrong. It does do type inference there. That's nice of it.
[01:13:43] <_controller> :)
[01:13:51] <freeone3000> Either way, the cast is with the caller, not the call-e.
[01:14:03] <_controller> ya i figured
[01:14:05] *** Nebulam has joined ##java
[01:14:28] <_controller> freeone3000, <_controller> also, while researching information, i've seen the following being used as well: TClassName. do you mind telling me what that does?
[01:14:48] <_controller> something like: <TClassName, TOtherClassName> T function()
[01:14:51] <hd1> http://rifers.org/paste/show/1185 any ideas?
[01:14:57] *** surial has joined ##java
[01:15:07] <freeone3000> _controller: Anything in the brackets are type parameters, regardless of their names.
[01:15:11] <_controller> oh ok
[01:15:21] <hd1> I can call other 'ls' using the same construct
[01:15:21] *** RLa has quit IRC
[01:15:21] <_controller> you can name them whatever you wish?
[01:15:33] <wyvern`> yes, which can be confusing. So name them well
[01:15:35] *** linusoleander has joined ##java
[01:15:52] <freeone3000> "well", here, meaning terribly - single letters are preferred to avoid confusing them with *real* types.
[01:16:37] <freeone3000> hd1: Read both stdout and stderr of the process, simultaniously.
[01:19:40] *** Xabster has quit IRC
[01:20:28] *** surial has quit IRC
[01:21:22] *** jesmon has joined ##java
[01:21:49] *** adamisme has left ##java
[01:22:26] *** surial has joined ##java
[01:24:31] *** Fernandos has joined ##java
[01:24:40] <Fernandos> hi
[01:25:35] *** ferret_ has quit IRC
[01:25:44] <Fernandos> I've read and used it so often, but somehow I got confused today no idea why.. static functions in java make the function available from inner classes only or what?
[01:25:46] <hd1> freeone3000: it would seem that I have to put the arguments in separate strings
[01:25:47] *** ferret_ has joined ##java
[01:26:58] <Fernandos> I know that staic variables can be accessed before an object has been created, and static functions?
[01:28:18] *** kinks has quit IRC
[01:29:15] *** dreamreal has quit IRC
[01:29:33] <Fernandos> and there are static imports too.. but static imports are for convenience only so that you don't need to type the classname everytime, right?
[01:29:35] *** thear has left ##java
[01:31:16] <surial> Fernandos: *ALL* import statements are convenience only.
[01:31:37] <surial> They don't change anything at all about your code. Replacing each instance of "List" with "java.util.List" and removing the import (Assuming you imported java.util.List before) is a no-op.
[01:31:58] <Fernandos> ok. and how about static functions?
[01:32:12] <surial> It's not like e.g. python where an import will actually run the code at the top level of that file, and cause the methods to enter the naming tables. In java the namespace tables are effectively set in stone from the moment the JVM boots. (Well, technically, you can use your own classloaders).
[01:32:15] <surial> Fernandos: No different.
[01:32:31] *** Bombstone has quit IRC
[01:32:34] <surial> Fernandos: plain imports let you omit package names. static imports also let you omit the classname in addition to the package name.
[01:33:30] <surial> You can import java.util.Collections so you can just type "Collections.unmodifiableMap(..)" instead of "java.util.Collections.unmodifiableMap(...)" and you can import static java.util.Collections.unmodifiableMap; so you can type just "unmodifiableMap(...)" instead of Collections.unmodifiableMap. Other than the convenience of not having to type as much, there is no change at all.
[01:33:33] <Fernandos> I guess static imports makes code unreadable..
[01:34:00] <surial> no, static imports make code more readable... IF used wisely. Like most things in programming, if you insist on blowing your feet off, you can do that. My theory is: If the language is turing complete, that's inevitable.
[01:34:26] <surial> for example, in test code, writing Asserts.assertEquals() all over the place is just clutter. Just plain "assertEquals" is nicer. Which is done by importing org.junit.Asserts.*.
[01:34:33] *** ^Mike\b has joined ##java
[01:34:35] <Fernandos> heheh yeah sounds "logical"
[01:34:56] *** pipeep has quit IRC
[01:35:10] <^Mike\b> Is there an easy way to make a shell in java? Some module that provides your loop and an easy way to dispatch commands etc?
[01:35:25] <surial> also, "unmodifiableMap" as a method name is pretty damn clear. Of course, you could import some OTHER unmodifiableMap, not from the well known java.util.Collections class, and especially if this method does something different from j.u.C.unmodifiableMap, you're going to confuse a lot of people who look at that and don't bother double-checking what method that "unmodifiableMap" ref is to.
[01:35:37] <surial> ~~ ^Mike\b javadoc Scanner
[01:35:37] *** bennett has quit IRC
[01:35:37] <javabot> ^Mike\b: http://is.gd/iUMar [JDK: java.util.Scanner]
[01:35:46] <^Mike\b> that is /so/ not what I wanted -_-
[01:35:55] <surial> ^Mike\b: You still have to print a prompt and all that, but at least reading lines from standard in is easy with that.
[01:35:59] *** pipeep has joined ##java
[01:36:17] <^Mike\b> the point was to not have to worry about the prompt, that should be done for me
[01:36:18] <surial> ^Mike\b: notthing in the standard libraries. Maybe some third party made something. Google around - there are a few bajillion billion 3rd party libraries for java :P
[01:36:34] <^Mike\b> or worry too much about reading in lines and parsing them, that should be mostly done for me
[01:36:34] <surial> ^Mike\b: A command line app with prompts is rather archaic, don't you think?
[01:36:51] <^Mike\b> No, I don't think that O_o
[01:36:52] <surial> ^Mike\b: There are a few excellent command line parameter parsers, which is usually a better plan.
[01:37:08] <^Mike\b> shell! shell! Not just a command line tool :)
[01:37:30] * ^Mike\b just wants a usable CJAN... surely that must exist
[01:37:40] *** ferret_ has quit IRC
[01:37:46] *** chipotle has quit IRC
[01:37:59] *** Behold has quit IRC
[01:38:04] *** chipotle has joined ##java
[01:38:17] <surial> ^Mike\b: Maven repo tries to be. Not sure we can solidly class this as 'usable'.
[01:38:20] <^Mike\b> "In 2004 the CJAN project has ceased development." :(
[01:38:24] <surial> http://mvnrepository.com/search.html?query=foo
[01:38:42] <surial> Of course, you need to know the name of the library before you search. I hear there's this thing called 'googol'... 'googlo'... I forgot.
[01:38:46] *** ferret_ has joined ##java
[01:38:56] *** glcrazy has quit IRC
[01:39:12] <^Mike\b> surial: duckduckgo!
[01:40:13] *** xiliax has quit IRC
[01:40:43] <Fernandos> could you please explain me what the static keywords does when used as "static class" and "static methdName()" ?
[01:41:04] <Fernandos> because I'm not sure if I understoof what I read about it
[01:41:09] <hiredman> ~static
[01:41:09] <javabot> hiredman, static is a keyword which indicates that a member is scoped to a class rather than an object instance. Members of interfaces (except methods) are always static. Nested interfaces and enums are always static. See http://tinyurl.com/3q7oc and http://tinyurl.com/34vr3u for more information.
[01:42:45] <Fernandos> yeah the 2nd link explains a lot better than oracle does
[01:43:21] <Fernandos> javaa doesn't support portable continuations like scala right?
[01:43:41] <Fernandos> haven't found a featurelist yet
[01:43:41] <sproingie> in that scala is written in java, you could say it does
[01:43:48] <sproingie> at the language level no
[01:43:55] <surial> Fernandos: If you can't grok static methods, you're fucked and should pick another language. static classes are easier: *INNER* classes (classes inside classes) can be non-static (a.k.a. an instance class), which means that any instance of that class always carries an instance of the outer class with it, thus, from inside the inner class, you can call methods from the outer class. Static inner classes are just a namespace kludge - you refer
[01:43:55] <surial> them as com.packagename.Outer.Inner. They have no special powers.
[01:43:58] <freeone3000> None of that sentance was a language feature.
[01:44:10] <Fernandos> ah.. ok I undestand. you mean a dsl within java would achieve portable continuations
[01:45:03] <surial> Fernandos: top-level classes (classes that are in a file, with no 'indent', i.e. not inside any other construct) are never marked as static, but from a semantic point of view, can only be (and are) 'static'.
[01:45:11] <surial> Just not marked as such, as it would be rather superfluous.
[01:45:23] *** Bombstone has joined ##java
[01:45:49] <Fernandos> surial: I'm mindfucked because I had to learn and switch between assembler,c,c++,c#,java,php and javascript this semester.. static has different meaning in c in example.. that was what probably confused me
[01:46:01] <surial> That'll probably do it.
[01:47:05] <Fernandos> thanks for explaining it =9
[01:47:06] <Fernandos> :)
[01:47:57] <^Mike\b> kinda like how I assumed case wouldn't need break;
[01:48:04] <^Mike\b> ...spent an hour trying to debug that
[01:48:18] <^Mike\b> then I remembered "Oh yeah, it's java" :(
[01:48:26] * ^Mike\b stabby stabby
[01:48:28] <Fernandos> switch cases are funnier in c.. heh..
[01:48:53] <Fernandos> you can do weird things in c
[01:49:20] <surial> ^Mike\b: Java was explicitly designed to be extremely familiar to C programmers. This includes a few choices which were at the time known to be really fucking stupid language design, including postfix array brackets and C's idiotic switch statement. I like to lump C's idiotic 'for' statement in there as well, but opinions are slightly more divided on that one.
[01:49:44] <surial> If it hadn't been, it wouldn't have been this popular, and if it hadn't been this popular, C would still have 70% of the market, probably, or at least would have had for a far longer time than it did. Fucked if you do, fucked if you don't.
[01:49:51] <^Mike\b> what are "postfix array brackets"?
[01:50:02] <surial> public int foo() [] {} <-- this is legal, and this method will return an array of ints.
[01:50:16] * ^Mike\b vomits
[01:50:16] <surial> Nobody writes like this. *NOBODY*. But it's legal java code, and javac will compile it.
[01:50:32] *** pipeep has quit IRC
[01:50:42] * ^Mike\b bribes a Java core dev to break this (and the test suite so nobody will notice) :D
[01:50:47] <surial> In C there's a reason this works. It's not a particularly good reason, but a reason. In java there is none whatsoever, other than, "It's legal in C".
[01:51:03] <surial> Also: private int foo[]; <-- this is a field named 'foo' of type 'int[]'.
[01:51:19] <Fernandos> actually d seems to be pretty decent.. altough it would be killer if it supported java/scala libraries however that's offtopic. sry
[01:51:21] <cbeust_> Yeah pity this was not disallowed
[01:51:23] <surial> And for an encore: private int[] foo, bar[]; <-- this is two fields, one named 'foo' of type 'int[]' one named 'bar' of type 'int[][]'. GUAHAHASDJAHKSDKAJH!!!!
[01:51:39] <surial> d is beyond hope.
[01:51:49] <surial> D is not open source, and its maintainer is not reliable.
[01:51:59] <surial> Somewhat of a shame, though I was never all that enamoured of D in the first place.
[01:52:02] *** meling has joined ##java
[01:52:07] <cbeust_> D has also a trouble past with respect to its versions and libraries
[01:52:29] <Teckla> surial: Google Go? ;)
[01:52:39] *** linusoleander has quit IRC
[01:52:43] *** Nebulam has quit IRC
[01:52:52] <surial> There are also a few conflicting versions and editions, which means that all D code is effectively unreadable, until you take the trouble of researching exactly what version and edition it was written for. It's the living, breathing opposite of Java's extremely strict "No forks, No backward incompatibilty, EVER, no matter the reason".... and it shows ther'es SOME point in java's stance. (More likely the right answer is in the middle).
[01:52:58] <Fernandos> cbeust_: that's true
[01:53:05] <cbeust_> Go was promising but oo antiquated to my taste, and a bit dogmatic on some of its design decisions (refusal to include exceptions proper)
[01:53:18] <surial> Teckla: Well, for starters, whomever named google go is a fucking jackass, and I don't think google go passes the effort test.
[01:53:51] <sproingie> surial: last i heard, walter open-sourced D 2.0 completely
[01:53:57] <surial> Teckla: i.e. svn was a fucking stupid project - it improved on cvs, but the sheer effort of moving version control system is BIG, and thus the reward has to be more than 'a teensy, tiny bit better, in dimensions that really don't matter much'. Go is a teensy tiny bit better without anything big. Thus, not worth it.
[01:54:06] <cheeser> ~~ surial blog
[01:54:06] <javabot> surial, ##java is not your personal blog. Take it back to the LiveJournal, where your ideas will be read by thousands of hungry followers. The next revolution will be led by YOU!
[01:54:11] <surial> sproingie: Oh, that might finally mean D could be going somewhere.
[01:54:12] *** rlubke has quit IRC
[01:54:16] <Fernandos> keeping an organic and forward/backwards friendly version tree is important.. rails in example has that problem. yeah last time I checked D was opensource too
[01:54:23] <sproingie> surial: too little too late imho
[01:54:27] <cheeser> seriously, dude. you've been ranting for a while now.
[01:54:33] <surial> cheeser: Hey, Teckla asked.
[01:55:08] <Fernandos> that bot is rude
[01:55:27] <surial> That bot is defined by the attitude of channel regulars, so, hmm.. That's awkard.
[01:55:36] *** Scorchin has quit IRC
[01:55:46] <cheeser> it's not rude. it's curt.
[01:55:49] <Teckla> surial: In my old age, I let *other* pioneers take the arrows; i.e., I wait until language X has reached some certain critical mass before devoting attention to it. Too many baby languages come and go to waste time on all of them. That includes Google Go.
[01:55:49] <cheeser> 8^)=
[01:56:00] <cheeser> ~~ Teckla interesting
[01:56:00] <javabot> Teckla, this is all very interesting (not really) but please take it somewhere else.
[01:56:11] *** jimi_hendrix has joined ##java
[01:56:39] <Sou|cutter> the goal of moderation is to reduce conversation to zero :D
[01:56:40] *** rgr has joined ##java
[01:56:42] <Teckla> cheeser: My ideas intrigue you and you wish to subscribe to my... blog? ;)
[01:56:49] <cheeser> indeed
[01:57:18] <Teckla> It's good to be gently guided back on-topic to keep channels reasonably focused.
[01:57:25] <surial> Teckla: Just interleave "Hey, how do you compare 2 strings" in your discussions to calm the cheeser.
[01:57:40] <Teckla> Why, strcmp(), of course!
[01:58:09] <Fernandos> I've got a selfmade java crawler (purpose price comparison), however I seem to get only 3-5 pages mapped and reduced per second on a dual xeon machine with 4gb ram and gbit connection, is that supposed to be normal java performance or is my code ineffcient?
[01:58:11] *** pipeep has joined ##java
[01:58:29] <surial> Teckla: The problem is defining critical mass. Has scala reached critical mass? Clojure? Same goes for java libraries, or just about everything else programming.
[01:58:36] <surial> Fernandos: Java is very fast. It could be many things.
[01:58:48] <Fernandos> it's indexing about 20attributes per page into the database
[01:58:52] <Teckla> surial: True. I guess each individual has to make their own determination.
[01:59:01] <cheeser> guys.
[01:59:05] <surial> Fernandos: Your pipe is slow. Your algorithm is waiting around for net stuff instead of opening up loads of connections in parallel. Who knows?
[01:59:20] <Teckla> Although I was a somewhat early adopter of Java (to get things back on topic).
[01:59:22] <surial> Fernandos: Possibly your DB is configured to be extremely resource friendly and is the bottleneck.
[01:59:27] <hd1> Fernandos: why not use Heritrix or nutch or another, well-tested crawler out there?
[01:59:31] <Fernandos> the code is opening 5 parallel connections per page
[01:59:48] <surial> Fernandos: You should run a profiler (or kludge profiling into your app yourself).
[01:59:51] <Fernandos> surial: mysql.. idk
[01:59:53] <hd1> Fernandos: or pastebinning the source so we can laugh at it?
[02:00:10] *** nmx has quit IRC
[02:00:21] <surial> Fernandos: Sigh. Use postgres. But mysql is unlikely to be the problem - the vast majority of mysql installs are configured for NOM NOM NOM Resources!
[02:00:24] <Fernandos> hd1: I didn't know that other opensource crawlers existed.. didn't search for it.. so
[02:00:45] <Sou|cutter> writing a crawler is a fun exercise
[02:01:15] <hd1> Sou|cutter: yes, but it reads like Fernandos is not doing this for fun
[02:01:25] <Fernandos> ah a profiling.. yeah why didn't I think of it...
[02:01:26] *** DJClean has quit IRC
[02:01:46] <Fernandos> it's for a class
[02:02:11] <hd1> ~homework
[02:02:11] <javabot> Homework is meant to be done by YOU, so that YOU learn something. Stop cheating; we don't like doing our own, why should we do yours? Also, answering homework questions is extremely frustrating. See "~why no homework" for more reasons why we won't answer your questions.
[02:02:18] <Fernandos> was just for fun, an elective subject
[02:02:27] *** jeukku has quit IRC
[02:02:28] <Sou|cutter> you may consider batching database inserts also... maybe you're doing something like opening and closing a db connection every time (complete speculation)
[02:02:43] *** mhahe has quit IRC
[02:02:45] <Sou|cutter> without code, it's hard to say
[02:02:51] <Fernandos> hd1 I have done my homework, don't judge soo fast :)
[02:02:56] <surial> hd1: Hey, I authored the fuck you homework guy factoids and I'm okay with something that's at least bordering on interesting enough by someone who seems to have more brains than an african anteater.
[02:03:09] <Fernandos> I'm using prepared statements for the inserts
[02:03:22] <Fernandos> I thought that should get a little boost
[02:03:25] <surial> Fernandos: None of that is relevant. I suggest you profile something instead of shooting in the dark.
[02:03:33] *** ojacobson has joined ##java
[02:03:37] * Sou|cutter nods to surial
[02:03:47] <surial> Fernandos: I'm sure it did boost the performance of db inserts from 0.00005 seconds per insert to 0.00004 seconds per insert.
[02:03:52] *** ejb has joined ##java
[02:03:53] <Fernandos> should I profile with netbeans/eclipse or is there a library for that?
[02:04:00] <surial> Fernandos: I pray you realize how pointless it was.
[02:04:29] <Sou|cutter> surial: in fairness, I'm a proponent of never using a non-prepared statement for sql injection reasons
[02:04:34] *** dmlloyd sets mode: -b StoneCypher!*@*
[02:04:35] <surial> Sure.
[02:05:11] <surial> As long as we all know that while theoretically prepared statements are faster, and probably there are actual cases where you might even notice, in practice, odds are 1 to a few million that'll solve your performance issues.
[02:05:26] * Sou|cutter nods in agreemend
[02:05:32] <Sou|cutter> +t
[02:05:57] <^Mike\b> ffs, you cannot switch on a String?
[02:06:06] * ^Mike\b wonders how you people get anything done
[02:06:19] <surial> ^Mike\b: You'll be able to on jdk7.
[02:06:29] <surial> Oh, I guess we can finally call it java7 now that the umbrella JSR has been rubberstamped.
[02:06:49] <ejb> Greetings, I'm having some issues with a Swing JTable. Is there a swing specific channel?
[02:06:50] <Fernandos> no you cannot swtich on a string in jdk6 only on concrete types if I translated correctly. like int,short,byte,enum
[02:06:54] <surial> Sou|cutter: But in fairness, yes, one should always go for prepared statements in any case :)
[02:07:00] <surial> ejb: I believe you're in it.
[02:07:12] <ejb> surial: great
[02:07:13] <ojacobson> Fernandos: only on integer and enum constant expressions
[02:07:23] *** jogla has quit IRC
[02:07:23] <surial> Fernandos: enums and primitives only. And not on booleans. And maybe not on longs. Shit, someone stumped my java skills.
[02:07:24] <cbeust_> ejb: unfortunately, there doesn't seem to be a dedicated #swing channel. Unfortunately for us, that is.
[02:07:35] <ejb> cbeust_: haha, sorry ;)
[02:07:58] <surial> okay, fuck. You can switch on ints and enums only. In practice this adds chars, shorts, and bytes into the mix as they will implicitly upcast to ints.
[02:07:58] *** chipotle has quit IRC
[02:08:23] <surial> ojacobson gets the props for apparently knowing this.
[02:08:28] <surial> ojacobson: showoff.
[02:08:30] <Teckla> What do Swing, Java NIO, C++, and quantum mechanics have in common? Never mind...the answer is too obvious.
[02:08:33] * ojacobson bows
[02:08:41] <ojacobson> ^Mike\b: you probably want a map anyways
[02:08:45] *** homie has quit IRC
[02:08:48] <ojacobson> A "switch" on strings is really an embedded lookup table
[02:08:50] <cbeust_> I really with we could have switched on strings since day one, if only so that jdk7 can't get away with incrementing the major version of the JDK just under the pretext of adding this feature.
[02:08:54] <ojacobson> and you know what they say about embedded magic values
[02:09:11] <surial> cbeust: Hmm, what was the bigger upgrade: Java7, or 6u10?
[02:09:17] <Sou|cutter> ... they're against it?
[02:09:20] * Sou|cutter grins
[02:09:21] <Fernandos> ojacobson: the foil of our prof reads: swtich is allowd only on discrete primitive types int, ··· and Enum-Types
[02:09:29] <cbeust_> surial: the biggest upgrade? JDK5 for me, not even close
[02:09:31] <ojacobson> Fernandos: it's even more restrictive than that
[02:09:32] <surial> Because together, especially if we contrast to e.g. 1.2 to 1.3, it's a major update.
[02:09:40] <ojacobson> the case labels must be constant expressions
[02:09:42] <surial> cbeust_: Sure, but, just between 6u10 and 7.
[02:09:47] <Fernandos> that's why I thought byte and short might be allowed
[02:09:48] <cbeust_> ah
[02:09:51] <ojacobson> you can't have, for example, int x = 7; ... switch (y) { case x: break; }
[02:09:53] *** homie has joined ##java
[02:09:56] <cbeust_> 7 should really be 6.1
[02:10:01] <ojacobson> (x is not a constant expression)
[02:10:08] <surial> Fernandos: They ARE, in practice, because those silently upcast to ints where needed.
[02:10:20] <ejb> Here is the issue: I'm using a custom TableModel (implementing AbstractTableModel, etc.) For testing, I only have one row of data. Everything looks fine until I do the following... I double-click the second cell to edit it, then click on the third cell to blur the second. When I do this, the value of the second cell is copied to the third.
[02:10:35] <surial> i.e. byte x = 10; switch (x) { case 10: ... } <-- this works fine, but a silent (int) cast is inserted here, and the case constant expressions are seen as ints too.
[02:10:37] <Fernandos> surial: yup, that's THE explanation
[02:11:09] <ejb> Here's my TableModel: http://pastebin.com/6UPDBfc2
[02:11:42] <ojacobson> Fernandos: this comes up with enums, too -- the compiler converts the enum constant expressions to their corresponding ordinals behind your back
[02:11:44] <surial> cbeust_: Well, if the updates in 1.3 warranted '1.3' instead of '1.2.1', this is certainly not worse than that. And everyone's been screaming their head off for a new java version, which I never really understand (I can understand asking for new features, but versions are as arbitrary as the gregorian calendar's months).
[02:11:59] <ojacobson> which can occasionally lead to surprises when you modify an enum without recompiling all the switch statements that use it
[02:12:21] <ojacobson> Fernandos: the gory details are in the JLS, of course
[02:12:21] <surial> ojacobson: ... unless you modify it by adding new constants only at the very end, as that wouldn't change any ordinals.
[02:12:32] <ojacobson> surial: I believe that's covered by "can"
[02:12:34] <surial> (I know you know, just completing the discussion).
[02:13:01] <ojacobson> One of the reasons I'm so violently against string switch is that string switch can't work that way
[02:13:03] <Fernandos> ojacobson: heh.. yeah damn.. gotta read the OCL and JLS to be prepared :)
[02:13:07] <ojacobson> it has to be compiled to an 'if' ladder under the hood
[02:13:22] <cbeust_> ojacobson: so what? It's still convenient.
[02:13:22] <ojacobson> which completely throws off various complexity assertions as well as being a needless language feature
[02:13:23] <Teckla> surial: I fear that Java may get over-complex-ified. I feel like C# has already jumped the shark.
[02:13:31] <ojacobson> cbeust_: if you want ruby, you know where to find it
[02:13:38] <ojacobson> I'd rather have map literals and lambda expressions
[02:13:43] <ojacobson> you get the same expressiveness in a more general way
[02:14:01] <cbeust_> ojacobson: No I don't want Ruby. String switch might not be useful to you but 1) it is useful to others and 2) it makes the language more consistent
[02:15:31] <Sou|cutter> map literals are such a low hanging fruit
[02:15:52] *** eoss has quit IRC
[02:16:10] <cbeust_> Sou|cutter: I don't have a lot ofuses for map literals myself, except sometimes in tests to create data to test against, but overall, my maps contents are pretty dynamic
[02:16:20] <cbeust_> Besides you can use {{ to kind of mimic it
[02:16:24] <ejb> Any help would be much appreciated... I've been scratching my head for a few days about this one. Seems like I'm missing something dead simple
[02:16:38] <cbeust_> ejb: nothing is ever simple with Swing :)
[02:17:10] <ejb> cbeust_: or any GUI toolkit
[02:17:48] <cbeust_> ejb: I've used a lot of GUI toolkits over the past 20 years, overall I agree, but I think Android and SWT are clear improvements of the state of the art
[02:17:54] <cbeust_> I hear the iPhone's is pretty good too
[02:18:13] <cbeust_> WinForms is also quite productive, apparently
[02:20:05] <ejb> Android is ok. Not a big fan of XML-backed systems, but you can't win them all.
[02:20:46] <cbeust_> ejb: declarative UI's make me more productive at the end of the day, I learned that much (and unfortuntately, SWT/JFace doesn't support this yet)
[02:20:52] <cbeust_> Layout out UI's in code is a pain in the neck
[02:21:10] <ejb> True, true. I definitely don't like that.
[02:22:11] <ejb> Bah, I have to run. If anyone has any ideas about this strange Swing issue, please highlight me.
[02:22:31] <cbeust_> Make sure you use the latest version of Swing. It's called SWT :)
[02:23:22] * cheeser kicks cbeust_ in the ball.
[02:23:38] <cbeust_> Careful cheeser, you'll hurt your foot, I have balls of steel
[02:23:50] <cheeser> but they're so small...
[02:23:51] <cheeser> 8^)=
[02:24:00] *** stateknife has joined ##java
[02:24:03] <cbeust_> It's not that size that matters
[02:24:09] <dmlloyd> it's all ball bearings these days
[02:25:15] *** Matic`Makovec has quit IRC
[02:25:25] *** Luc1fel has quit IRC
[02:25:36] *** Bombstone has quit IRC
[02:26:35] <wyvern`> nice fletch quote
[02:26:54] <cheeser> heh
[02:29:55] *** Matuku has quit IRC
[02:30:55] *** alanic has joined ##java
[02:31:25] *** do0ob has quit IRC
[02:32:56] *** pipeep has quit IRC
[02:37:36] *** zamN has joined ##java
[02:37:52] *** Bombstone has joined ##java
[02:37:53] *** teralaser has quit IRC
[02:42:10] <NodoLibero> hellouuww
[02:42:26] <^Mike\b> Are there heredocs in Java?
[02:42:49] <dmlloyd> no
[02:42:50] <NodoLibero> no
[02:43:07] <cheeser> are there what?
[02:43:30] <cbeust_> <<<HEREDOC
[02:43:32] *** Matic`Makovec has joined ##java
[02:43:44] <cbeust_> Like shell or Python
[02:43:46] <jesmon> multiline string literals
[02:44:01] <NodoLibero> or php
[02:44:05] <cheeser> ah
[02:44:09] <dmlloyd> ^Mike\b: usually what you do is put a file next to your .class file and use: MyClass.class.getResourceAsStream("yourFile.txt")
[02:44:16] *** Lymia has quit IRC
[02:44:36] <^Mike\b> or Perl!
[02:44:41] *** murz has quit IRC
[02:44:51] * ^Mike\b hugs his perl
[02:44:54] <cbeust_> dmlloyd: if he puts his file next to his class, he won't find it at the location "yourFile.txt"
[02:44:57] <NodoLibero> perl :S
[02:45:06] <dmlloyd> cbeust_: yes he will, read the javadoc
[02:45:13] <cbeust_> oh?
[02:45:15] <dmlloyd> Class.getResourceAsStream, not ClassLoader
[02:45:20] * cheeser nods.
[02:45:22] <dmlloyd> it uses the class' package
[02:45:27] <cbeust_> Ah ok, didn't know
[02:45:34] <cheeser> unless it has a leading /
[02:45:35] <dmlloyd> strangely, it's rarely used
[02:45:48] <cheeser> dmlloyd: i think wicket uses it. 8^)=
[02:46:02] *** neurodamage has quit IRC
[02:46:05] <cheeser> for loading the resources for a component
[02:46:14] <joed> It does.
[02:46:27] <NodoLibero> maybe struts2 too
[02:46:41] <cheeser> (i'm just guessing because i've not looked at the code but that's how i'd do it and those guys are smort like me.)
[02:46:54] * joed smorts cheeser with a pickle
[02:46:56] <NodoLibero> for action property file
[02:50:21] *** Gevaudan82 has joined ##java
[02:51:11] *** ZorbaBudha has joined ##java
[02:51:29] <Gevaudan82> Hello...before I go off reinventing the wheel, is there a java or commons collections data structure that will allow you to moveUp, moveToTop, moveDown and moveToDown a specific item in a collection? think of the need for tabular structure which can be re-ordered by the user
[02:52:34] <freeone3000> You can do arbitrary-index removal and arbitrary-index insertion with a List.
[02:52:49] *** NodoLibero has quit IRC
[02:53:00] <freeone3000> moving element x up is simply removing the element at index x, and adding the same element at index x-1.
[02:53:32] <Gevaudan82> that's what i was thinking of doing...but requires a List right under the covers
[02:53:57] <freeone3000> Sets and Trees aren't inherently ordered.
[02:54:20] <Gevaudan82> here's the tricky part...
[02:55:39] <Gevaudan82> the data that needs to be re-ordered contains both captured (user input) and retriee (database driven) values...i wonder if I should store both on a flat object (which would then exist in my list) or use a composition approach...it seems that if I override equals/hashcode i should exclude the captured data
[02:56:04] <cheeser> um. Trees are ordered.
[02:56:09] <freeone3000> Err, Map, sorry.
[02:56:11] <cheeser> that's the point of a tree
[02:56:13] <cheeser> 8^)=
[02:56:17] <freeone3000> And yes, TreeMap is ordered, but not Maps in general.
[02:56:28] <freeone3000> Gevaudan82: And how does this prevent you from using a List?
[02:56:45] *** chipotle has joined ##java
[02:56:54] *** palsword has joined ##java
[02:57:30] <freeone3000> Gevaudan82: Ah. Yes. Create an object to represent the data, and then use it like any other. And yeah, you'll need to override .equals()/hashCode(). Wouldn't worry about excluding retrieved data, though, as ordering is not important for a relational dataset.
[02:57:40] <Gevaudan82> freeone3000: oh it doesn't...but all my moveUp methods would be taking in an object so the equals/hashcode method is important....there can be no duplicates but as you pointed out sets aren't ordered
[02:58:26] <palsword> hi, I have some code block where I am calling .size() method of a HashSet multiple times on a very large HashSet. Would it be faster if I call it once at the beginning and store the value in an int?
[02:58:36] <freeone3000> palsword: Profile.
[02:58:36] *** ^Mike\b has left ##java
[02:58:43] <cbeust_> LinkedHashSet is kind of an exception about the ordering, though
[02:59:00] <palsword> what do you mean cbeust_?
[02:59:18] <cbeust_> LinkedHashSet will maintain the insertion order in its iterator
[02:59:45] <palsword> what are its disadvantages over HashSet?
[02:59:50] <Gevaudan82> all true...it seems i'll use an ArrayList and implement the moveUp methods myself...i need the random access the list doesn't provide (i.e. get(...)) and don't really need the key part of a map
[03:00:06] <freeone3000> palsword: It uses more memory.
[03:00:07] <cbeust_> As far as I remember, minimal (it maintains an extra doubly linked list)
[03:00:25] <palsword> would it be as fast to search?
[03:00:56] <freeone3000> Yes, since .contains() uses the HashSet method. Only the iterator differs.
[03:00:59] <cbeust_> I suspect retrieval would still be constant, only insertion is slightly more expensive, but read the javadoc for yourself
[03:01:06] *** optraz has joined ##java
[03:01:24] *** bjornju has quit IRC
[03:01:27] <palsword> thanks
[03:02:12] *** chipotle has quit IRC
[03:03:02] *** fims has quit IRC
[03:04:35] *** HardDisk_WP has quit IRC
[03:04:37] *** kinks has joined ##java
[03:05:31] *** wolfman2000 has joined ##java
[03:06:07] *** Cain has quit IRC
[03:06:18] <kinks> hello, does anyone know of an IDE that automatically inserts comments in the format noted here?: http://mentalstdout.net/file/cc.txt
[03:06:38] *** palsword has quit IRC
[03:06:55] <kinks> I'm marking assignments and.. well... I honestly don't know why on either a student would write that, then leave it
[03:07:31] <cbeust_> kinks: any Java IDE will do that
[03:07:54] <cheeser> yeah. why would it matter if he used an IDE?
[03:08:18] *** HardDisk_WP has joined ##java
[03:08:32] <cheeser> though, i think students *shouldn't* use IDEs but still.
[03:08:47] <kinks> it wouldn't, it just almost looked like they might have been stupid enough to have someone write a general structure for them and not fill out the given comments :p
[03:09:01] <Fernandos> kinks: eclipse even auto fills the javadoc when you type /* and enter.. or was it /** ..idk
[03:09:14] <kinks> I don't use IDEs, so I have no idea what kind of crap they insert.
[03:09:16] <kinks> I'm sure it's nothing.
[03:10:40] <Fernandos> don't kick ide's away. they are there for a reason. I use vim most times, but still eclipse makes a lot of sense.. esp when you write android programs or so..
[03:10:59] <joed> Fernandos: context.
[03:11:18] <Fernandos> joed: kinks: I don't use IDEs, so I have no idea what kind of crap they insert.
[03:12:01] <joed> Fernandos: Great.
[03:12:18] <Fernandos> true
[03:12:42] <joed> And it is configurable, the deal here was if you don't know why, don't use it. Learn for a while, then get happy.
[03:12:52] <cheeser> ~newbie ide
[03:12:52] <javabot> Newbies shouldn't start with IDEs. It's important to learn the environment and fundamentals of a language before offloading those to an IDE. Learn about packages and imports and classpaths. Learn how to compile and use the JDK tools. Get some basic grasp of the API layout. Learn how to do things then switch to an IDE to do them faster. See http://tinyurl.com/yvks48 and and http://tinyurl.com/2cpn6o for more info.
[03:13:07] *** cbeust_ has quit IRC
[03:13:30] <Fernandos> cheeser: of course newbies shouldn't use ide's.
[03:13:46] *** pipeep has joined ##java
[03:14:01] <surial> They should start in an IDE or BlueJ or something to get familiar with the very basics, then move out of them for a little while, and then move back in, permanently.
[03:14:05] <Fernandos> every teacher prays that
[03:14:40] <joed> An ide like a shell.
[03:15:50] <cheeser> i used vim for almost 10 years before picking up an IDE.
[03:15:59] <cheeser> it helped that all the IDEs were crap back then but hey
[03:16:00] <cheeser> 8^)=
[03:16:03] *** Gevaudan82 has quit IRC
[03:16:05] <kinks> irrespective of any of that, this code is frightening
[03:16:30] <kinks> I no longer wonder why everyone got such shitty marks in this class - no one knows what they're doing.
[03:16:47] <kinks> and I'll probably get slapped for marking them harshly and pointing out everything they're doing wrong such as to give them a chance to actually improve
[03:16:51] <Fernandos> cheeser: amazing 10years..
[03:17:08] <kinks> I just don't really plan to use an IDE unless I'm working on a gigantic project
[03:17:12] <cheeser> since '96 baby!
[03:17:20] <kinks> i.e. the codebase at work would be pretty terrible without an IDE to jump around for me
[03:18:59] *** Yvemath is now known as QuoZiY
[03:19:13] *** QuoZiY is now known as QZY
[03:19:45] <kinks> and even then, that IDE doesn't spew output that I don't ask for :p
[03:19:55] *** QZY is now known as qzy
[03:21:21] <surial> It would seem fairly obvious to me that java, as a language, is begging to be used inside an IDE. Not sure if it was intentional, but there you go. Contrast to e.g. python. Thus, folks that write java in a relatively dumb editor, I don't get it.
[03:24:27] *** magn3ts has joined ##java
[03:25:01] *** ziesemer has joined ##java
[03:25:08] *** ziesemer has left ##java
[03:25:19] *** ziesemer has joined ##java
[03:29:44] *** jfe has joined ##java
[03:30:30] <ziesemer> Anyone have any suggestions for debugging a Java memory dump? I've been using the Eclipse MAT, and I've found some memory concerns. However, I need to further inspect the data that was involved in the suspect threads. Is there anyway to "re-activate" a JVM from a memory dump, or load it into a non-performance-based debugger - e.g. in Eclipse or elsewhere?
[03:31:41] *** cbeust__ has joined ##java
[03:32:20] *** km has quit IRC
[03:33:03] *** Nach0z1337 has joined ##java
[03:33:05] <surial> Hmm, let's say you have 8 people of unknown skill, and they are all going to play chess against each other. Every pairing plays 2 games. At the end, how would one determine in the fairest fashion who was the best player? Sort of a parellel ELO - i.e. if player A has won 8 times and lost 8 times, but his wins were against players that mostly won, player A is better than player B who has also won and lost 8 times each, but he won mostly again
[03:33:05] <surial> bad players.
[03:33:36] <Nach0z1337> Hey i've got a question for yall... is there a Java version of a scripting engine? like, anything built into the Java language I can use to script stuff?
[03:34:09] <surial> Nach0z1337: Loads.
[03:34:15] <ziesemer> Nach0z1337: http://download.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html
[03:34:24] <surial> Nach0z1337: jython, jruby, rhino (= javascript), and loads more.
[03:34:27] <freeone3000> JSR-223.
[03:34:30] <surial> beanshell... (is that project still alive)?
[03:35:34] <Nach0z1337> o.O Wow. Um, anything that's actually similar to Java itself though? i'd rather not have to learn a whole new language to do this stuff :/
[03:35:51] <freeone3000> So you want to script Java with... Java?
[03:36:15] *** slocate has joined ##java
[03:36:29] <surial> ~beanshell
[03:36:30] <javabot> surial, beanshell is a small, free, embeddable, Java source interpreter with object scripting language features, written in Java. It can be found at http://www.beanshell.org.
[03:36:32] <Nach0z1337> Heh. I'm trying to set something up with a java-like scripting language at least. If there was a way I could set up Java-language script files to load into my Java program that'd be excellent
[03:36:57] <surial> Nach0z1337: You have two options. Beanshell, which is just like java but not maintained much, or groovy, which is an entirely new language with the property that virtually any java source file will parse as legal groovy and will probably do the same thing.
[03:37:00] <surial> Nach0z1337: Though it has much more than that.
[03:37:07] <surial> ~~ Nach0z1337 groovy
[03:37:08] <javabot> Nach0z1337, groovy is a dynamic language for the JVM which prides itself on running existing java code correctly; at least usually. See http://groovy.codehaus.org/
[03:38:16] <Nach0z1337> Awesome. thanks. i'll look into this and see if I can do anything with it.
[03:41:05] *** chipotle has joined ##java
[03:42:48] <surial> I think I have an idea for what I need: At the end of all matchups, I want to derive a set of ELO-like scores which, if used to predict how the games should have gone, is statistically more likely to pick the actual results, than any other set of ELO-like scores.
[03:44:42] *** maslen has joined ##java
[03:44:47] <surial> And now for the hard part: How would I write that? Preferably it should finish calculating on a single small PC within 10 minutes for at most 10 players. Let's see, if I assign to all players up to 100 variances and try them all, thats 100^10, or 1e20. Whoops. That won't finish.
[03:44:48] *** mhahe has joined ##java
[03:45:39] <mhahe> ~pastebin
[03:45:39] <javabot> http://paste.pocoo.org/ - Paste the final url after you've pasted your stuff there.
[03:46:52] <mhahe> http://paste.pocoo.org/show/330365/ can someone plz tell me why my result is always 5 less than it should be?
[03:47:07] <mhahe> i get -1995
[03:47:23] <mhahe> and when i used another value in my array (-100) i was getting -95
[03:50:39] *** daidoji has quit IRC
[03:51:24] *** andares has joined ##java
[03:52:06] *** andares has quit IRC
[03:52:51] *** rgr has quit IRC
[03:58:02] *** topher has joined ##java
[03:58:12] <Nach0z1337> Hey I've got one more question for yall... is there anything like an in-line Java compiler out there? like, something to compile and run Java code from within a program, while the program's still running itself
[03:58:32] <dmlloyd> javassist does that, sort of
[03:58:36] <dmlloyd> or beanshell (bsh)
[03:59:08] <pervy_sage> There is a way to compile, load, and run code, but it's not exactly, "in-line"
[03:59:11] <dmlloyd> if you don't mind mucking with bytecode, you can use one of the many generators out there like ASM, BCEL, etc.
[03:59:13] <cbeust__> mhahe: I see nothin in the code you pasted that could give this answer. Are you sure that's what you're running?
[03:59:20] *** Sliker has quit IRC
[03:59:28] <dmlloyd> you could use javax.tools to compile Java source on the fly and cram it in too
[03:59:43] <Nach0z1337> dmlloyd: I know nothing of bytecode. but thanks. I was looking at Beanshell, but it looks kind of confusing.
[03:59:48] <Nach0z1337> Javax.tools?
[04:00:11] <mhahe> cbeust__, was missing a comma between 5 and -2000... lol
[04:00:13] <topher> i'm a php / ruby on rails developer interested in doing java web development on eclipse with fedora. i dont know much about the culture though - tomcat is the web server? is there any particular web framework? spring? javabeans?
[04:00:31] <cbeust__> mhahe: haha excellent, that should be a Java puzzler
[04:00:35] *** belugs has quit IRC
[04:01:21] <cbeust__> topher: take a look at GWT if you've never used it
[04:01:35] <mhahe> cbeust__ no kidding, im tired and it was causing unnecessary pain at this hour :(
[04:02:19] <topher> cbeust__: gwt is the google java web framework?
[04:02:23] <joed> Oh, if you never looked at it, look at Haskell too, bound to give you hours of amusement.
[04:02:31] <cbeust__> topher: yes
[04:02:46] <cbeust__> And don't listen to joed, he's trying to troll you
[04:03:01] <joed> You'll really benefit from writing a few servlets and looking at some filter code though.
[04:03:25] <topher> :)
[04:03:34] <Nach0z1337> So this javassist, if I were to build something like an IRC client or bot that needed script capabilities, would be able to do something similar?
[04:03:40] <joed> The latter one wasn't a troll...
[04:03:55] <topher> i take it gwt as some kind of ORM library? or do i plug in jhibernate to it?
[04:04:01] <cbeust__> Nach0z1337: if you want scripting, embed a scripting language in you Java application, much cleaner
[04:04:14] <joed> Nach0z1337: That is a really bad idea.
[04:04:30] *** Aces1up has left ##java
[04:04:45] <Nach0z1337> how so? o_0 Too much risk of something getting fried?
[04:04:47] <joed> Nach0z1337: if you want pluggable stuff, look at osgi, spi, ~modules (via javabot)
[04:05:13] <Nach0z1337> ~modules
[04:05:14] <javabot> Nach0z1337, I have no idea what modules is.
[04:05:44] <joed> ~jpf
[04:05:44] <javabot> joed, jpf is the java plugin framework. It aims to simplify plugin based systems and can be found at http://jpf.sourceforge.net/.
[04:06:12] <joed> I'd just spend the 20 minutes it takes to learn osgi instead.
[04:06:25] <pervy_sage> Yeah, there's also a ton of drop-in languages.
[04:07:47] <Nach0z1337> heh. I appreciate it, and i'll absolutely look at some of these, but is there any way to make Java plugin stuff?
[04:08:11] <joed> What is your idea of a plugin? Perl?
[04:08:16] <pervy_sage> Nach0z1337: jpf...the framework joed just mentioned...
[04:08:32] <Nach0z1337> oh. alright xD
[04:09:03] <Nach0z1337> Joed: Not a clue. Something like with Mirc and just putting stuff into the script editor and stuff. xD
[04:10:00] <joed> Nach0z1337: Ah, although (I dunno about Mirc) but say you did irssi, your plugin follows a "contract", "describes" where and what it does and is "loaded" in a specific manner?
[04:10:05] *** divStar has quit IRC
[04:10:46] *** youdonotexist has joined ##java
[04:10:50] <Nach0z1337> um. i don't work with irssi at all... lol. But, i'd assume that's correct. Maybe a better example would be Eggdrop bots with TCL scripts though?rather than mirc?
[04:11:08] <joed> That whole idea is a bit easier in say a dynamic language, you can do the same thing in a strongly typed env. often with great results, you just have to work a bit more on the contract.
[04:11:15] *** Patt has quit IRC
[04:11:36] <joed> I think you should start with a few Java tutorials then read about classloading.
[04:12:08] <pervy_sage> I'll load your classes.
[04:12:11] <Nach0z1337> lol. start with a few java tutorials? I'm no great programmer but i HAVE worked with java for a while. i'll look at classloading though, thanks
[04:12:55] *** juanez has joined ##java
[04:12:59] <joed> Well, start with many then.
[04:13:06] *** chomping has quit IRC
[04:13:20] <Nach0z1337> xD
[04:13:32] *** flippo has joined ##java
[04:14:25] *** ziesemer has left ##java
[04:15:27] *** Matic`Makovec has quit IRC
[04:15:44] <cbeust__> joed: if he embeds something like BeanShell, there is no need for learning about classloading
[04:15:51] <cbeust__> BeanShell works great, pity it's pretty much abandoned
[04:16:33] <pervy_sage> Yeah.
[04:16:34] <flippo> cbeust__, for some time now.
[04:16:40] <pervy_sage> WHy's that, I wonder...
[04:17:01] <cbeust__> I'm not sure what language I would pick now, Groovy is an obvious choice but it's a big jar file to add to your dist
[04:17:05] <flippo> Same reason jython didn't go anywhere, or groovy, or ...?
[04:17:17] <pervy_sage> groovy isn't going anywhere?
[04:17:28] *** bojo has quit IRC
[04:17:30] <pervy_sage> I thought groovy had quite a bit of traction.
[04:17:32] <cbeust__> Groovy appears to be pretty healthy to me
[04:17:50] <cbeust__> I see it used in a lot of place, much more than, say, Ruby or even RoR
[04:17:53] <flippo> Too many groovy guys seem to have jumped to scala, including the author of groovy
[04:18:04] <pervy_sage> heh
[04:18:13] <flippo> Doesn't seem to have critical mass
[04:18:31] *** lamdk has quit IRC
[04:18:46] <cbeust__> flippo: depends what you mean by critical mass, but I agree it's not mainstream. Yet one of the JVM languages with the most traction (more than Scala IMO)
[04:19:15] <flippo> Seems like too narrow a niche to survive
[04:21:01] <flippo> I don't see how the groovy community grows at this point.
[04:21:03] <cbeust__> We'll see, I think we'll be talking about Groovy in a few years. Not so sure about many other JVM languages we're talking about today
[04:22:39] *** rjohnson19 has quit IRC
[04:22:40] * bearded_oneder is impressed
[04:22:58] <pervy_sage> cbeust__: fwiw, we've got a project at work that was groovy then was pretty much scrapped because presuambly nobody likes groovy
[04:23:01] *** maslen has left ##java
[04:23:13] <bearded_oneder> these javax.servlet.* packages are chock full of some very powerful classes.
[04:23:29] *** fuzzygroove has joined ##java
[04:24:16] *** cheezey has joined ##java
[04:25:21] *** Bombstone has quit IRC
[04:27:55] *** jabz has joined ##java
[04:30:41] *** jesmon has quit IRC
[04:31:01] *** cbrock has joined ##java
[04:33:17] *** Jon-- has joined ##java
[04:33:23] *** topher has quit IRC
[04:33:36] *** ldh has quit IRC
[04:33:38] <Jon--> Trying to override ArrayList<Double>.toString() and it is not working. This is what I have : http://pastebin.com/hXgtHfiL
[04:33:52] *** Error404NotFound has quit IRC
[04:33:54] <Jon--> It's calling the Java-provided toString, not overriding properly.
[04:34:12] <joed> Why should it?
[04:34:34] *** lwizardl has joined ##java
[04:34:58] <Jon--> I was told by someone in here to have it extend ArrayList<Double> and include the method and it would work. They were incorrect or I misread what they were telling me to do. How do I do this properly then?
[04:35:40] <flippo> Jon--, maybe you are calling toString() on the outer class instance, not the inner
[04:35:55] <dmlloyd> you actually have to *use* your extended ArrayList you know
[04:36:06] <dmlloyd> it doesn't actually somehow magically alter the ArrayList class itself
[04:36:38] *** sbalmos has quit IRC
[04:36:40] <flippo> Okay, all assumption of a plausible scenario are gone now.
[04:37:26] <paissad> guys, i need some help, actually, i want to write a program which play a sound at specified times (it must be a daemon since and a sort of cron job) ...
[04:37:26] <Jon--> dmlloyd: How would I do that? Design a constructor that just makes an ArrayList and just override the toString() and everything else will go to the super class (ArrayList) ?
[04:38:12] <dmlloyd> Jon--: you need to start with some basic tutorials man
[04:38:23] <paissad> i tried cron4j library, but the problem is that after starting the scheduler, the other following tasks in the program are not executed
[04:38:25] *** Bombstone has joined ##java
[04:38:48] <joed> paissad: so the first one bombed badly?
[04:38:52] *** perlsyntax has joined ##java
[04:38:58] <Jon--> dmlloyd: Please don't RTFM me, I'm in third year computer science and I'm a damn proficient C programmer, just new to OO/Java and wanted to save some time by coming here.
[04:39:05] *** Cain has joined ##java
[04:39:11] <joed> Jon--: RTFM.
[04:39:15] *** elux has joined ##java
[04:39:19] <Jon--> joed: -_-'
[04:39:23] *** elux has quit IRC
[04:39:38] <dmlloyd> you need to learn about classes, methods, overloading, constructors etc
[04:39:49] <dmlloyd> anything else is just us doing your homework
[04:39:58] <paissad> joed, i don't know what you mean mate :s
[04:40:03] <paissad> bombed badly ?
[04:40:07] <Jon--> I don't have to override anything, I'm just doing this to format the output nicer.
[04:40:17] <Jon--> So you're not "doing my homework" at all.
[04:40:27] <joed> Awesome.
[04:40:47] <Jon--> Instead of writing a custom print routine, I want to override the toString() and do it that way, I'm just not sure how I do that, ergo, I came here for help. Not to be told RTFM.
[04:40:50] *** lwizardl has quit IRC
[04:41:03] <Jon--> Or method** in Java terminology.
[04:42:29] <Jon--> Well? Is no one willing to help me a little?
[04:43:44] <joed> dmlloyd already did.
[04:44:05] *** openpercept has joined ##java
[04:44:12] <joed> All that despite your awesomness.
[04:44:51] *** _Maru_ has quit IRC
[04:45:04] <dmlloyd> ~~ Jon-- classes
[04:45:04] <javabot> Jon--, I have no idea what classes is.
[04:45:07] <dmlloyd> hmm
[04:45:10] <grug> Jon--: youre looking to override toString()? have you googled this?
[04:45:15] <dmlloyd> missing tutorial link there
[04:45:36] <dmlloyd> Jon--: http://download.oracle.com/javase/tutorial/java/javaOO/classes.html
[04:45:43] <Jon--> grug: I came here first, someone told me to do what I posted in that pastebin.
[04:45:45] *** ojacobson has quit IRC
[04:45:49] <dmlloyd> ~classes is http://download.oracle.com/javase/tutorial/java/javaOO/classes.html
[04:45:49] <javabot> OK, dmlloyd.
[04:45:53] <dmlloyd> ~class is <see>classes
[04:45:53] <javabot> I already have a factoid named class, dmlloyd
[04:45:56] <dmlloyd> ~info class
[04:45:57] <javabot> class was added by: cheeser on 10-22-2009 at 2:50 PM, EDT and has a literal value of: <reply>To run a java class simply give the class name: java com.foo.bar.OmgPonies, not java com/foo/bar/OmgPonies.class
[04:46:01] <dmlloyd> ah right
[04:47:00] <paissad> any guidelines ? ... in my program, i want to play a sound every hour for example (or at specified times) ... and the program must continue to execute some other tasks without ending
[04:47:43] <Jon--> dmlloyd: I understand classes, I'm slightly sketchy on inheritance and clueless on overriding.
[04:47:55] <Jon--> dmlloyd: I read your link and learned nothing new.
[04:47:55] <paissad> in other words, the process that plays the sound is a daemon ..
[04:48:03] <dmlloyd> ok there's some stuff on that...
[04:48:54] <dmlloyd> http://download.oracle.com/javase/tutorial/java/IandI/subclasses.html
[04:49:16] *** ojacobson has joined ##java
[04:49:53] <Nach0z1337> That reminds me. I've only ever been able to make my Java stuff do exactly one task at a time. What's the easiest way to make a Java program do multiple stuff at once? threading?
[04:50:08] <Jon--> Nach0z1337: Threading.
[04:50:47] <dmlloyd> ~~ Nach0z1337 jcip
[04:50:47] <javabot> Nach0z1337, jcip is Java Concurrency In Practice, a book focused on implementing threaded and concurrent applications in Java. http://jcip.net/
[04:50:54] <joed> Nach0z1337: Skip that and learn the concurrent
[04:51:05] <dmlloyd> threading is horrifyingly non-trivial
[04:51:14] * dmlloyd randomly combines adjectives
[04:51:36] <Nach0z1337> ok. I've actually messed with threading before a bit at least... lol. pain in the butt. like how Swing supposedly isn't thread safe....
[04:51:44] <Jon--> dmlloyd: So basically make a constructor that invokes the super classes (ArrayList's) constructor, and implement my own toString() in the MyArrayList class to override?
[04:51:54] <ojacobson> Nach0z1337: Keep in mind that your whole computer can only do one thing at a time per core
[04:52:00] <Jon--> dmlloyd: Then create instance(s) of MyArrayList, of course.
[04:52:10] <ojacobson> Threads provide a complex illusion of concurrency, beyond one ready thread per core
[04:52:11] <dmlloyd> yeah
[04:52:27] <Nach0z1337> So threads are basically just lame concurrency? lol
[04:52:29] <Jon--> Yeah to me?
[04:52:29] <ojacobson> "multitasking" really just means switching between tasks very quickly
[04:52:41] <ojacobson> Nach0z1337: No, threads *are* concurrency, up to the limits of the underlying hardware
[04:52:50] <ojacobson> but those limits are not very high on commodity computers
[04:52:50] <Jon--> Nach0z1337: Threads ARE concurrency.
[04:53:03] <dmlloyd> on a single CPU, your system really only does one thing at a time.
[04:53:07] *** _Maru_ has joined ##java
[04:53:20] <dmlloyd> it just looks like a lot because it's much better at juggling than you or I
[04:53:34] <grug> i can juggle 4 balls at once
[04:53:38] <grug> is that close?
[04:53:44] <Jon--> grug: My CPU's faster, I can juggle 5.
[04:53:45] <Nach0z1337> Ok. So can I mess with concurrency without trying to do threading?
[04:53:49] <Nach0z1337> lol Jon--
[04:53:57] <dmlloyd> no, it's basically the same thing
[04:53:57] <ojacobson> Nach0z1337: No, but you can avoid needing concurrency at all
[04:54:11] <ojacobson> Event-y systems often look concurrent if each event is handled very quickly
[04:54:25] <Jon--> dmlloyd: So basically make a constructor that invokes the super classes (ArrayList's) constructor, and implement my own toString() in the MyArrayList class to override?
[04:54:29] <Jon--> dmlloyd: Then create instance(s) of MyArrayList, of course.
[04:54:36] <ojacobson> (lots of classic network services are single-threaded but support hundreds or thousands of clients - look at any MUD codebase, for example)
[04:54:45] *** chomping has joined ##java
[04:54:52] <Nach0z1337> hm. makes sense.
[04:55:03] <dmlloyd> Jon--: it's true that every class has a constructor, but in this case you don't need to define one - if you don't, the compiler generates a "public YourClass() { super(); }" constructor automatically
[04:55:20] <Jon--> dmlloyd: Then why does my code fail in it's current form? Looks fine to me.
[04:55:38] <dmlloyd> maybe because you've created an inner class
[04:55:44] <dmlloyd> which you are probably not ready for
[04:56:32] <Jon--> dmlloyd: First thing I tried was pulling the class outside, still uses super.toString()
[04:56:45] <dmlloyd> because you're not *using* your class
[04:57:05] <dmlloyd> you're defining your class, then you're proceeding to ignore it and use ArrayList
[04:57:16] <Jon--> fml. You're right, I am.
[04:57:24] <ojacobson> of course he is
[04:57:32] <Jon--> I get an error though: No enclosing instance of type FunctionEval is accessible. Must qualify the allocation with an enclosing instance of type FunctionEval (e.g. x.new A() where x is an instance of FunctionEval).
[04:57:45] <dmlloyd> because you made it an inner class
[04:57:53] <Jon--> dmlloyd: It's no longer an inner class.
[04:57:53] <dmlloyd> don't put classes inside other classes
[04:57:58] <dmlloyd> yes it is
[04:58:01] <dmlloyd> it just told you so
[04:58:18] <Jon--> The same .java file, but the classes are now seperate.
[04:58:41] <ojacobson> Today's lesson is: 'clean' is your friend
[04:58:44] <joed> Dear lord and the fucking pygmies.
[04:59:00] <ojacobson> Remove all the .class files and recompile from scratch, you still have the old classes around to make your life fun and entertaining.
[04:59:17] <whaley> yes, clean works for your java projects and your body
[04:59:28] <Jon--> Hmm. Clean worked. Thanks.
[04:59:31] <Jon--> Silly Eclipse.
[04:59:34] <grug> clean is my best mate
[05:04:47] *** AMcBain has joined ##java
[05:05:00] *** fuzzygroove has left ##java
[05:05:28] * joed gives Jon-- about 3 weeks as a consultant before customer says, "could you please take that arrogant ass back?"
[05:05:31] *** Nach0z1337 has quit IRC
[05:06:29] <Jon--> joed: That wasn't very nice.
[05:06:34] *** epalm has joined ##java
[05:07:01] <joed> I thought it was extremely nice, since you'd not go through a standup in a startup.
[05:07:05] <ojacobson> Jon--: how astute.
[05:07:19] *** _jesse_ has quit IRC
[05:07:55] *** [floyd] has quit IRC
[05:08:00] *** eoss has joined ##java
[05:08:14] <Jon--> Awesome. You're continuing the reputation of trolling in IRC programming channels. ##c has you beat though.
[05:08:41] *** marens has quit IRC
[05:08:45] <ojacobson> Jon--: Less back talk, more using your ignore list.
[05:09:09] <ojacobson> Muting someone is way more effective than encouraging them to talk to you more.
[05:09:22] *** ChanServ sets mode: +o joed
[05:10:28] *** marens has joined ##java
[05:15:22] *** c_axis has quit IRC
[05:15:24] *** qzy is now known as yvemath
[05:15:30] *** yvemath is now known as Yvemath
[05:17:41] *** Jon-- has left ##java
[05:18:33] *** nmx has joined ##java
[05:19:19] *** jabz has quit IRC
[05:24:07] *** palsword has joined ##java
[05:24:13] *** Niamkik has joined ##java
[05:24:14] *** Bombstone has quit IRC
[05:24:25] *** _controller has quit IRC
[05:27:17] *** palsword has left ##java
[05:29:07] *** bearded_oneder has quit IRC
[05:29:52] *** jeukku has joined ##java
[05:30:35] *** elux has joined ##java
[05:30:51] *** openpercept has quit IRC
[05:31:57] *** wolfman2000 has quit IRC
[05:37:19] *** Bombstone has joined ##java
[05:38:25] *** Niamkik has quit IRC
[05:41:02] *** happyface has joined ##java
[05:41:46] *** bearded_oneder has joined ##java
[05:43:49] *** elux has quit IRC
[05:46:17] *** ojacobson has quit IRC
[05:47:48] <happyface> what's a data structure that complies to: 1) each element is a key, 2) if a key does not exist it will be created, 3) return list of elements by a key
[05:48:15] <joed> happyface: Isn't it awesome mapping homework?
[05:48:33] *** drindt has quit IRC
[05:49:10] <happyface> joed: what? I just made those rules up
[05:49:27] <happyface> I can't think right now
[05:51:00] <happyface> maybe something like that doesn't exist, I guess i'll implement my own map
[05:51:46] *** openpercept_ has joined ##java
[05:52:06] <mhahe> ~pastebin
[05:52:07] <javabot> http://paste.pocoo.org/ - Paste the final url after you've pasted your stuff there.
[05:52:43] <mhahe> http://paste.pocoo.org/show/330380/ can someone tell me why "waka" isnt printed?
[05:53:10] <mhahe> ive check the loop and it runs fine... all the way to the bound and exits as expected... but never goes past that point
[05:55:35] *** opakavic has joined ##java
[05:56:28] *** zemanel has quit IRC
[05:57:33] <mhahe> anybody?
[05:58:21] *** kinks has quit IRC
[05:58:43] *** Robba has joined ##java
[05:59:13] *** epalm has quit IRC
[06:00:03] <Robba> I'm new to the language. Why is passing large amounts of data to a function not an issue in Java?
[06:00:16] <Robba> For example, I have a large array of strings that I want to pass.
[06:00:26] <Robba> But apparenly, there is no pass by reference option.
[06:00:32] <cbeust__> Robba: because they are passed by reference, although this is an incoplete answer
[06:00:34] <Robba> But this website tells me it is not an issue.
[06:01:19] <mhahe> cbeust__ could u take a look at my code and give me some of ur thoughts on why "waka" in not printed?
[06:01:38] <Robba> Okay, so I can pass this large array however I want, and I will avoid repeated copying?
[06:01:52] <mhahe> http://paste.pocoo.org/show/330380/ can someone tell me why "waka" isnt printed?
[06:01:57] <mhahe> ive check the loop and it runs fine... all the way to the bound and exits as expected... but never goes past that point
[06:02:18] *** Robba is now known as robba
[06:02:47] <cbeust__> mhahe: this is weird, are you sure it's not making it there? Maybe the println is being swallowed somewhere?
[06:03:13] <mhahe> swallowed? not sure i follow
[06:03:31] <cbeust__> It's printed somewhere but you're not seeing it. Did you set a breakpoint on that line?
[06:03:50] <cbeust__> Maybe an exception is being thrown that makes the function exit before it gets there
[06:03:58] <cbeust__> and you're not seeing that exception for some reason
[06:03:59] <mhahe> java MyProgram | grep -i waka
[06:04:05] <mhahe> its not showing up im sure
[06:04:34] <mhahe> it exits normally, which is past the point of this method
[06:04:38] <cbeust__> Is table[targetIndex] always non null?
[06:04:44] *** _Maru_ has quit IRC
[06:04:54] *** wabash has joined ##java
[06:05:02] <mhahe> yes
[06:06:05] <cbeust__> Fire a debugger and debug, it will probably be obvious
[06:06:12] *** jabz has joined ##java
[06:06:42] <joed> ~cbeust++
[06:06:49] <javabot> cbeust has a karma level of 11, joed
[06:06:49] *** alanic has quit IRC
[06:07:08] <cbeust__> Report back, I'm curious
[06:08:33] *** chipotle has quit IRC
[06:08:59] *** Bombstone has quit IRC
[06:09:30] *** platzhirsch has joined ##java
[06:10:09] *** platzhirsch has left ##java
[06:10:39] <mhahe> yup its a null pointer... uuuuuuuh, i suck
[06:10:43] <mhahe> thanks cbeust__
[06:10:59] *** symbole has joined ##java
[06:13:18] *** Cain has quit IRC
[06:14:42] <cbeust__> Where exactly?
[06:14:47] <cbeust__> And why didn't you get a stack trace?
[06:15:48] *** kinks has joined ##java
[06:16:05] <joed> mhahe: Did you write a test or fire up a debugger?
[06:16:18] <joed> mhahe: could you write a test?
[06:17:26] <joed> mhahe: I'm one of those off people that will test String to avoid a debugger since I always think my own code is wrong
[06:18:02] *** impulse150 has joined ##java
[06:19:39] *** tjsnell is now known as waz
[06:20:36] *** yxz97 has joined ##java
[06:20:41] <yxz97> Hello there..
[06:20:54] <mhahe> joed, i've found the problem. it was a variable that was named similarly to to another (got them mixed up) and looped out of bounds because of that, but the exception never showed up.... :S
[06:21:19] <joed> mhahe: Are you just starting out?
[06:22:12] *** Bombstone has joined ##java
[06:22:33] <mhahe> joed, with what exactly?
[06:22:51] <cbeust__> mhahe: my advice to you is find out why you didn't get a stack trace and make sure this will never happen again, or you'll waste countless hours trying to diagnose problems
[06:22:51] <joed> mhahe: Java.
[06:23:18] <joed> mhahe: And what cbeust__ said.
[06:23:33] <mhahe> not really, i just dont code frequently enough to be ontop of debugging.. i suck :P
[06:23:34] *** yxz97 has quit IRC
[06:23:44] <mhahe> ill do that
[06:23:49] <mhahe> and thanks heaps!
[06:23:54] *** jeukku has quit IRC
[06:23:55] <mhahe> both u guys
[06:23:59] <cbeust__> Happy to help
[06:24:53] <joed> Haha
[06:28:11] <symbole> Is it possible to have all links within a JSP be context relative, without using the BASE element? Since BASE doesn't work with localhost, I can't use it.
[06:28:32] <symbole> I want to avoid prepending the context path to every link too.
[06:28:55] <joed> symbole: You probably want to write a filter.
[06:29:43] <symbole> I was thinking of writing my own action, but I thought there was a standard solution.
[06:30:01] *** freeksh0w86 has joined ##java
[06:32:35] <symbole> And c:url + <a> looks a bit ugly. I guess I know what to do. Thanks.
[06:34:47] *** Cain has joined ##java
[06:36:04] *** dcope has joined ##java
[06:36:19] <dcope> Does anyone have the book Java Programming: From the Begninning?
[06:37:25] <wabash> Amazon might. Or did you have a question about something in the book?
[06:37:40] <symbole> $100 for a Java book? Jesus!
[06:37:42] <dcope> wabash: I had a question.
[06:37:49] <dcope> symbole: It's a textbook.
[06:37:54] <wabash> dcope: Ah, I see.
[06:38:01] *** impulse150 has quit IRC
[06:38:14] <wabash> No, I can't refer to the book, I don't have it. But if you have a 2 line snippet, you could probably type it.
[06:38:28] * wabash denies encouraging copyright infringment
[06:39:04] <AMcBain> symbole, all text books are overly inflated in price to steal from already poor students.
[06:39:14] <wabash> dcope: If there's a concept that you need help with, go ahead and shoot.
[06:39:26] <symbole> AMcBain: Right, but Java?
[06:39:31] <AMcBain> if you sell them back to the place you bought them from (if they do that) they just turn around and sell it again for a large chunk of the original price while giving you peanuts.
[06:39:38] <AMcBain> symbole, doesn't matter, any text book.
[06:39:38] <symbole> Isn't Thinking in Java free?
[06:39:46] <waz> ~tij
[06:39:46] <javabot> waz, tij is Thinking in Java by Bruce Eckel, see http://www.mindview.net/Books/TIJ/ for the 3rd edition (free download, published in 2002) or see http://www.mindview.net/Books/TIJ4 for the current edition which covers Java 5 features.
[06:39:51] <AMcBain> symbole, sure! and there's lots of free tutorials and guides on the net.
[06:39:59] <zamN> AMcBain: chegg.com (not a paid advertisement, hehe) works wonders
[06:40:00] <waz> ~getstarted
[06:40:00] <javabot> waz, getstarted is http://download.oracle.com/javase/tutorial/getStarted/
[06:40:18] <wabash> AMcBain: Yeah, what you do is go back to the place you bought it from and hawk it to the students taking it next quarter... Meet them halfway, and screw the bookstore.
[06:40:20] <zamN> im renting my english book and got my unix book 1/2 off
[06:40:31] <AMcBain> zamN, wabash, I went to a university that subscribed to the idea of renting books. I saved a fortune :)
[06:40:49] <wabash> Wow, enlightened for mayfly territory!
[06:41:16] <zamN> haha you sound like a drug dealer wabash
[06:41:17] <AMcBain> You only had to buy paperbacks (reading books) and things that were workbooks. Of course if you were an art student, you had to buy lots of stuff, they kinda got the shaft.
[06:41:29] <wabash> AMcBain: Did they really do that at a state school/
[06:41:37] <AMcBain> wabash, yup!
[06:41:41] <zamN> what school is thsi
[06:41:43] <wabash> zamN: What do yo umean? Is mayfly a slang? I meant it literally.
[06:41:55] <zamN> wabash: your bookstore statement
[06:42:09] <wabash> hahaha
[06:42:22] <wabash> zamN: No, I just hate bookstores on campus. That is, until I own one.
[06:42:26] <wabash> Then I'll like it.
[06:42:30] <AMcBain> wabash, it worked out pretty well. They more than make the money back on books through rentals assuming most come back in good condition, just don't be the last one to pick up your books, otherwise you get the sad ones.
[06:43:05] <AMcBain> I got one calculus book I ended up ducttaping by the end of the semester just to ensure I'd have something to return it was that bad. I worked to get there sooner after that! :P
[06:43:27] <wabash> AMcBain: Sounds like high school all over again.... Were the previous renters of your books "Ben Dover", "Hugh G. Rection", and "Phillip McCreviss"?
[06:43:43] <AMcBain> wabash, nah, nobody wrote in them, it was rare to find one even highlighted, since you didn't own them.
[06:43:55] <AMcBain> occasional pencil markings.
[06:44:50] <AMcBain> wabash, if you really did want to keep the book though every year (twice a year I think, don't remember) there'd always be some sort of booksale of older editions they wanted to get rid of, etc.
[06:44:57] <AMcBain> Could get them for cheap :)
[06:45:57] <wabash> I just looked up the class schedule, and hung out in front of the classroom 10 min befor ethe first class, plenty of people wanted to buy a book.
[06:46:09] <wabash> Or else posted to the class usenet.... gawd I'm old.
[06:46:43] <AMcBain> Too much work :P
[06:47:14] <wabash> AMcBain: Yeah, but 10 min of work, $20 higher price.... That's like.... infinity fortune to a student.
[06:47:26] <AMcBain> I think the one time I had to buy a book, I found out (not directly though) that I would have either gotten $20 back for an $80 book (that was used to start) or nothing at all because they were changing versions.
[06:47:51] <AMcBain> So I passed it off back to my highschool or somewhere. The book went somewhere, I didn't keep it or recoup, oh well.
[06:47:56] <robba> can a function always return null, regardless of its declared return type?
[06:48:03] <AMcBain> robba, no.
[06:48:27] <AMcBain> Only return values of a reference type can contain null.
[06:48:53] <wabash> robba: well, what do you mean? You could write your function to do that. String myMethod(){return null;} <== Like that?
[06:49:03] <robba> yes, like that
[06:49:23] <robba> Hm. I want to write a function that takes a char array. If a certain condition holds, I want it to return an array, but otherwise I want to return a value that tells me something went wrong.
[06:49:32] <wabash> robba: yes, you could do it that way.
[06:50:01] <cbeust__> robba: sounds like an exception might be more appropriate, otherwise, create a class that holds both your array and a return code. But it's a bit fishy
[06:50:05] *** ader10 has joined ##java
[06:50:09] *** chipotle has joined ##java
[06:50:14] *** chipotle has quit IRC
[06:50:34] *** chipotle has joined ##java
[06:51:03] *** ejb has quit IRC
[06:51:03] *** FalsAlarm has quit IRC
[06:51:32] <robba> that would work, but the way wabash stated is the first thing that came to mind. It will work if, say, !null is true.
[06:51:50] <ader10> I have a large class with 2 rather complex JFrames (many Components) that need to be able to edit some private class members and each other. How can/should I split the file up?
[06:53:02] <robba> wabash: to your knowledge, will something like char[] myMethod(){return null;} work as well?
[06:53:04] *** Hyphenex has joined ##java
[06:53:32] <robba> (the difference being that char[] isn't an object)
[06:53:38] <wabash> robba: Yes, yo ucan return null for any object typep
[06:53:43] <robba> cool.
[06:53:43] <wabash> char[] actually is an object.
[06:53:57] <wabash> robba: It's a direct descendent of Object.
[06:53:57] <robba> Oh okay. Obviously I am unfamiliar with the language.
[06:54:09] <wabash> robba: It's ok. gotta start somewhere.
[06:54:31] <robba> to me, java is still like C++, plus magic.
[06:54:36] <wabash> robba: You can return null for any objec type. But primitives, you cannot. So "int myMethod()" can't return null.
[06:54:58] *** Yvemath has quit IRC
[06:55:03] <wabash> robba: A better description was Guy Steeles, about dragging C++ programmers kicking and screaming halfway to lisp.
[06:56:39] *** Yvemath has joined ##java
[07:00:33] *** gimix has joined ##java
[07:01:11] *** VooDooNOFX has quit IRC
[07:02:03] *** Hyphenex has quit IRC
[07:02:19] *** VooDooNOFX has joined ##java
[07:02:51] *** MacGyverNL has joined ##java
[07:03:45] *** tty1 has joined ##java
[07:04:24] *** grug has quit IRC
[07:04:42] *** LinuxFetus has joined ##java
[07:05:21] *** cbrock has quit IRC
[07:05:27] *** cbrock has joined ##java
[07:05:38] <LinuxFetus> Hey I have a short Java program here: http://java.pastebin.com/zn5M2BKt Whenever I click the button, a JDialog appears, as it should, but when I close the JDialog, the frame it's attached to minimizes. Why is this?
[07:05:46] *** grug has joined ##java
[07:07:49] *** fisted has joined ##java
[07:08:48] <cbeust__> I believe that by default, close doesn't close
[07:08:53] <AMcBain> LinuxFetus, doesn't minimize for me.
[07:09:11] <AMcBain> It does appear to get hidden behind window which would be topmost save for that one.
[07:09:26] *** freeone3000 has quit IRC
[07:09:29] *** wabash has quit IRC
[07:10:00] <LinuxFetus> AMcBain, I just presumed it was minimizing, but I see that you're right.
[07:10:52] *** fisted_ has quit IRC
[07:11:21] <cbeust__> "minimizing" means differnet things on different OS
[07:11:29] <cbeust__> And of course, Swing has this talent for having all kinds of stupid defaults
[07:12:17] *** LinuxFetus_ has joined ##java
[07:12:35] <AMcBain> My guess is if you really want to stop that you could try asking it to be brought to the front again after the dialog is closed.
[07:12:53] <LinuxFetus_> AMcBain, so set always on top to true and then set it to false again?
[07:13:02] <AMcBain> LinuxFetus_, nooo.
[07:13:05] <AMcBain> toFront()
[07:13:31] *** Niamkik has joined ##java
[07:13:34] <LinuxFetus_> AMcBain, Sweet, it worked.
[07:13:44] <ernimril> if a dialog is supposed to be attached to a specific parent window, then create the dialog with that parent
[07:13:47] *** kieran491 has joined ##java
[07:14:02] <AMcBain> That's best, you can given dialogs parents.
[07:14:09] <AMcBain> Also, you really shouldn't be extending JFrame.
[07:14:09] *** LinuxFetus has quit IRC
[07:14:09] <AMcBain> You
[07:14:27] <AMcBain> You're not adding anything to it in terms of new features that other code might want to have also.
[07:14:29] *** bradford- has joined ##java
[07:14:39] <AMcBain> (in essence a reason to use your JFrame-extending class over JFrame)
[07:15:22] *** symbole has quit IRC
[07:15:37] *** bradford has quit IRC
[07:15:46] <LinuxFetus_> AMcBain, Well it's actually a condensed version of a program I'm writing that doesn't extend a JFrame... I just did that because I needed to have something be an action and component listener.
[07:16:14] <AMcBain> LinuxFetus_, that doesn't require you to extend JFrame either ;)
[07:16:21] <LinuxFetus_> AMcBain, Yeah, I know.
[07:17:43] <LinuxFetus_> But how do I do this dialog thing? I see that you can give a JDialog a Frame owner - is that what I want?
[07:18:46] <AMcBain> If it's related to that frame.
[07:20:12] *** skylord5816 has joined ##java
[07:21:09] *** L-----D has joined ##java
[07:25:14] *** zamN has quit IRC
[07:26:50] *** chipotle has quit IRC
[07:30:32] *** cbeust__ has quit IRC
[07:30:51] *** cbeust_ has joined ##java
[07:39:23] *** Thorn has quit IRC
[07:40:09] *** LinuxFetus_ has quit IRC
[07:40:11] *** chipotle has joined ##java
[07:40:26] *** bradford has joined ##java
[07:41:17] *** bradford- has quit IRC
[07:41:23] *** grug has quit IRC
[07:42:33] *** Bombstone has quit IRC
[07:42:37] *** cbeust_ has quit IRC
[07:43:19] *** grug has joined ##java
[07:44:03] *** chipotle has left ##java
[07:44:33] *** happyface has quit IRC
[07:45:02] *** bradford- has joined ##java
[07:45:35] *** bradford has quit IRC
[07:49:48] *** glcrazy has joined ##java
[07:50:07] *** bearded_oneder has quit IRC
[07:52:19] *** impulse150 has joined ##java
[07:53:21] *** cbeust_ has joined ##java
[07:55:27] *** Bombstone has joined ##java
[07:55:29] *** rejser has joined ##java
[07:59:03] *** cbrock has quit IRC
[07:59:32] *** opakavic has quit IRC
[08:05:17] *** skylord5816 has quit IRC
[08:05:59] *** drindt has joined ##java
[08:06:14] *** Niamkik has quit IRC
[08:06:15] *** Zesturian has quit IRC
[08:07:08] *** Niamkik has joined ##java
[08:12:55] <magn3ts> I've got a string and I need to read X characters at a time from the line and then treat it as an integer...
[08:13:24] <magn3ts> so like 199901570 would be (4) 1999, then (2) 01, then (1) 5, then (2) 70.
[08:13:40] <magn3ts> Is my best option to use something like a forloop and readByte?
[08:13:48] <magn3ts> Or would there be a way to use nextPattern()?
[08:15:18] *** robba has left ##java
[08:16:14] *** coalado has joined ##java
[08:16:20] *** gentunian has quit IRC
[08:17:54] *** modernbob has quit IRC
[08:18:41] *** modernbob has joined ##java
[08:20:36] *** Error404NotFound has joined ##java
[08:22:28] *** Niamkik has quit IRC
[08:25:01] <Planck_> I think I'd use a regex with matching groups
[08:25:31] <hd1> SimpleDateFormatter?
[08:25:55] *** LouisJB has quit IRC
[08:26:06] <Planck_> I hope it's not a date :)
[08:26:24] <Planck_> Not with a 1-digit field :)
[08:27:04] *** frangiz has joined ##java
[08:28:04] *** youdonotexist_ has joined ##java
[08:28:41] *** youdonotexist has quit IRC
[08:29:45] <hd1> NumberFormatter, then?
[08:30:16] <hd1> one of the problems with Java is that there are a couple of trillion ways to do anything
[08:30:43] <magn3ts> A number formatter might work... I'm not sure. I also have to handle 19867 turning into 198.67 too.
[08:30:55] <magn3ts> I hate governmental data. what a fucking nightmare this is.
[08:31:29] <hd1> magn3ts: use perl to parse it.. it's a joy to parse data in
[08:31:54] <magn3ts> too late
[08:31:57] * hd1 processes 300mb/day using perl into Java
[08:32:00] <magn3ts> I'm far too invested at this point :(
[08:33:09] *** terranova has joined ##java
[08:33:27] <hd1> magn3ts: when I started at this place, it was all Java, very fragile, so I ripped out EVERYTHING, wrote an REST interface into the database and a bunch of perl scripts to parse the data... presto it works faster and more robustly. More importantly, memory footprint's been reduced
[08:33:39] *** DJClean has joined ##java
[08:34:21] <magn3ts> this is a one-few time use thing
[08:34:27] <magn3ts> it's for a professor
[08:34:33] <magn3ts> nothing that's going to be reused or anything
[08:35:31] <magn3ts> lol, I'm an idiot, I have the indices of the values in the line, no need to use the scanner anyway, just substr it
[08:37:20] *** ntoll has joined ##java
[08:40:26] *** fewgie has joined ##java
[08:41:22] *** impulse150_ has joined ##java
[08:41:34] *** xianny has quit IRC
[08:41:38] *** impulse150_ has quit IRC
[08:42:02] *** xianny has joined ##java
[08:44:23] *** impulse150 has quit IRC
[08:49:15] <hd1> heh
[08:49:23] *** thezall has quit IRC
[08:51:12] *** rretzbach has joined ##java
[08:54:20] *** Ch30ps has joined ##java
[08:57:17] *** sz332 has joined ##java
[08:57:36] *** ChUrP has joined ##java
[08:58:36] *** kieran491 has quit IRC
[08:58:46] *** mazzachre has joined ##java
[09:01:10] *** dframe has joined ##java
[09:01:56] *** alx has quit IRC
[09:04:07] *** perlsyntax has quit IRC
[09:05:45] *** cbeust_ has quit IRC
[09:05:49] *** Olathe has quit IRC
[09:05:56] *** Olathe has joined ##java
[09:06:44] *** amitev has joined ##java
[09:07:39] *** rretzbach has quit IRC
[09:07:45] *** harrowbits has joined ##java
[09:07:55] *** rretzbach has joined ##java
[09:08:30] *** bjornju has joined ##java
[09:09:01] *** harrowbits has quit IRC
[09:09:06] *** eoss has quit IRC
[09:10:18] *** pen has joined ##java
[09:10:37] *** shervin_a has joined ##java
[09:10:46] *** chasha has joined ##java
[09:10:53] *** amitev has quit IRC
[09:11:59] *** amitev has joined ##java
[09:12:42] *** kriko has joined ##java
[09:13:32] *** rretzbach has quit IRC
[09:13:33] *** neshaug has joined ##java
[09:16:43] *** amitev has quit IRC
[09:20:32] *** omy has quit IRC
[09:22:33] *** grimboy has quit IRC
[09:23:01] *** Striife has joined ##java
[09:23:12] *** supercosmonaut has quit IRC
[09:23:44] *** eitch0000 has joined ##java
[09:25:35] *** AMcBain has quit IRC
[09:26:00] *** mah01 has joined ##java
[09:27:31] *** bjornju has quit IRC
[09:27:53] *** ArikChan has joined ##java
[09:29:31] *** sebrock has joined ##java
[09:32:43] *** Soliah has joined ##java
[09:33:16] *** TzilTzal has joined ##java
[09:35:46] *** Mkop has quit IRC
[09:41:59] *** mah01 has quit IRC
[09:42:22] *** mah01 has joined ##java
[09:42:32] *** bjornju has joined ##java
[09:43:02] *** Striife has quit IRC
[09:43:28] *** fewgie has quit IRC
[09:43:43] *** erikhh has joined ##java
[09:45:57] *** rgr has joined ##java
[09:46:44] *** Sbrun has joined ##java
[09:49:10] *** pen has quit IRC
[09:50:14] *** amitev has joined ##java
[09:51:46] *** xiliax has joined ##java
[09:51:47] *** rgr has quit IRC
[09:52:23] *** xiliax has quit IRC
[09:52:40] *** xiliax has joined ##java
[09:54:09] *** Tasyne has quit IRC
[09:54:22] *** Yud_Zroc has joined ##java
[09:55:32] <Yud_Zroc> good evening everyone, im in the works for self learning the java programming language and am looking for a quick study guide on the syntax...any tips would be helpful in my journey
[09:55:54] <jink> ~tutorial
[09:55:54] <javabot> Please see http://download.oracle.com/javase/tutorial/
[09:56:41] *** sebrock has quit IRC
[09:56:46] <Yud_Zroc> i am learning from that site
[09:57:13] *** amitev has quit IRC
[09:57:35] <Yud_Zroc> is there no guide to just the syntax?
[09:57:45] <Yud_Zroc> ~syntax
[09:57:46] <javabot> Yud_Zroc, syntax is your friend.
[09:58:54] <_W_> ~jls
[09:58:54] <javabot> _W_, jls is The Java Language Specification: http://java.sun.com/docs/books/jls/
[09:59:18] *** javaPythonSnake has joined ##java
[10:01:39] <Yud_Zroc> thanks _W_
[10:01:52] *** nvictor has joined ##java
[10:01:54] <nvictor> yo
[10:02:22] <nvictor> since when java allows embedded classes?
[10:02:31] <nvictor> new to me :)
[10:03:03] <DroidAgent> Since.. the start? Maybe not but pretty long anyhow.
[10:03:32] *** Railgun has joined ##java
[10:03:48] *** chasha has quit IRC
[10:03:50] <jink> 1.1
[10:05:04] <jink> ~javadoc Class.getDeclaringClass()
[10:05:06] <javabot> jink: http://is.gd/AfC450 [JDK: java.lang.Class.getDeclaringClass()]
[10:05:30] <jink> nvictor: ^^^
[10:06:26] <nvictor> thanks jink
[10:09:59] *** amitev has joined ##java
[10:15:03] *** LouisJB has joined ##java
[10:18:08] *** glaksmono has joined ##java
[10:18:19] <glaksmono> can you add action listener to JMenu?
[10:18:52] <Railgun> glaksmono: maybe you could check
[10:19:05] <glaksmono> it seems that it's possible
[10:19:09] <glaksmono> but for some reason it doesn't work on mine :(
[10:19:10] *** Gyuszk has joined ##java
[10:19:11] <glaksmono> http://pastebin.com/3MENmVb3
[10:19:19] <glaksmono> i can't even print to the console
[10:19:46] <Gyuszk> hello guys, how to initialize an Integer (the wrapper class) array to a specified size?
[10:20:00] <Gyuszk> if i do it in the int way, it says "generic array creation" error
[10:20:29] <Gyuszk> i have private Integer[] opts;
[10:20:31] <glaksmono> any ideas?
[10:20:49] <Gyuszk> and I want to assign reference values in a loop like opts[i] =
[10:21:08] <Gyuszk> and before the loop, i want to init the Integer array because it says nullpointer exception
[10:21:15] <Railgun> glaksmono: what kind of action would you like to capture?
[10:21:24] <glaksmono> click
[10:21:46] <glaksmono> Railgun: clicking
[10:22:00] <Railgun> on a menuitem?
[10:22:01] <mitch0> gyuszk: private Integer[] opts = new Integer[10];
[10:23:09] <Railgun> glaksmono: you need a MenuListener
[10:23:19] <Gyuszk> mitch0: generic array creation error :(
[10:23:43] <mitch0> paste your code then
[10:23:58] <glaksmono> hmm ic
[10:24:04] <Railgun> glaksmono: and use addMenuListener not addActionListener
[10:24:06] <glaksmono> btw, how do you exit the program and kills it
[10:24:07] <Gyuszk> http://pastebin.com/b0sNs7sz
[10:24:18] <glaksmono> it doesn't seem that System.exit(1) kills it
[10:25:01] *** mag1c has joined ##java
[10:26:21] <Railgun> glaksmono: dont use System.exit. It's overkill for swing
[10:26:33] <mitch0> gyuszk: well, that code is almsost certainly wrong ;)
[10:26:56] <Railgun> glaksmono: have a look at JFrame's default close action
[10:26:59] *** soa2ii has joined ##java
[10:27:15] <glaksmono> that one there's setDefaultCloseOperation i know
[10:27:19] <Gyuszk> what are the main probs with it?
[10:27:19] <mitch0> gyuszk: use an ArrayList if you don't know the size of the array in advance
[10:27:20] <glaksmono> but that one only applies when we click that x button
[10:27:26] <Gyuszk> thanks
[10:27:28] <glaksmono> i want it to close when exit menu item is clicked
[10:27:31] *** teralaser has joined ##java
[10:27:52] <mitch0> gyuszk: and what's the point of depth when you should index by i?
[10:28:13] *** amitev has quit IRC
[10:28:53] <Railgun> glaksmono: it could probably help if you looked at the api for JFrame
[10:29:15] <mag1c> hello everyone. I'm trying to write a class that is able to download a file from a webserver. I have written this code http://pastebin.com/BBKCnwA9
[10:29:16] <Railgun> one method is: dispose() - not going to do this again for you
[10:29:48] <mag1c> unfortunately the class just stalls, it does make the file, and the server does reply 200 OK, but I get nothing inside of the file.
[10:29:51] <mag1c> any ideas?
[10:30:24] <glaksmono> Railgun: I'm..
[10:30:24] <javaPythonSnake> just use has next
[10:30:46] <soa2ii> Hi. I write a JavaEE application which has to generate XML strings for plotting data. What is the best approach to generate XML? I think there is something better than a StringBuilder isn't it? :)
[10:31:11] *** Yud_Zroc has quit IRC
[10:31:23] <mitch0> mag1c: I'm fairly sure you need at least one CRLF after the GET line (possibly two)
[10:31:35] <DroidAgent> soa2ii: probably some object to xml tool like JAXB or simple.sf.net
[10:31:50] <DroidAgent> Or if you have to, plain DOM building.
[10:32:01] <soa2ii> DroidAgent: I thought about that but then I would need XSDs which I do not have
[10:32:19] <soa2ii> DroidAgent: Hm, fine. The let's have a look at DOM building
[10:32:25] <DroidAgent> No you don't necessarily need them, you can just annotate your classes.
[10:32:29] <mitch0> soa2ii: if you're xml is simple enough, I'd just go with stringbuilder
[10:32:43] <mitch0> s/you're/your/ doh...
[10:32:48] <selckin> just use any dom api, never use stringbuilder
[10:32:54] <sz332> ~pastebin
[10:32:54] <javabot> http://pastie.org - Paste the final url after you've pasted your stuff there.
[10:33:03] <DroidAgent> Yeah stringbuilder looks like road to failure.
[10:33:10] <mitch0> uhum
[10:33:12] <Railgun> mag1c: "GET /"+args[2]+" HTTP/1.1\r\n\r\n"
[10:33:27] <Railgun> mag1c: also you need a host header
[10:33:29] <javaPythonSnake> why do you need to flush?
[10:33:30] <DroidAgent> No use trying to maintain consistency if you can let java do it.
[10:33:33] <Railgun> if your using http 1.1
[10:33:37] <sz332> gents, i need some help
[10:33:39] <sz332> http://pastie.org/1517464
[10:33:52] <Railgun> mag1c: try it with HTTP/1.0 first
[10:34:06] <sz332> on line 28, i get a "Current transaction is aborted, commands ignored until end of transaction block" exception
[10:34:47] <sz332> the problem is, that the sql at line 12 return an exception, so, perhaps that causes aborting the transaction
[10:36:39] *** Matic`Makovec has joined ##java
[10:37:37] <ronr_> sz332: if line 12 throws an exception, you shouldn't reach line 28.
[10:38:48] <sz332> i mean, it's an error in postgresql, because function is not available
[10:39:29] <DroidAgent> Thank you for using ##java self help
[10:42:03] <ronr_> sz332: I would guess that the current transaction is aborted.
[10:42:59] <sz332> yes
[10:43:01] <sz332> but why?
[10:43:27] <sz332> oh, because there was an error
[10:44:05] <ronr_> wait, errors cause transactions to be aborted?
[10:44:18] <sz332> i don't know
[10:44:22] <sz332> perhaps,
[10:44:40] <javaPythonSnake> finally{} :)
[10:44:50] <sz332> shot the bastard
[10:44:55] <ronr_> sz332: if only there was a way to test it.
[10:45:05] <sz332> the worst is try{}finally{}
[10:45:20] *** cafesofie has joined ##java
[10:45:54] <javaPythonSnake> can't you just put a breakpoint there and check you db?
[10:46:47] <Gyuszk> guys, another prob,... :) can u help me?
[10:46:49] <Gyuszk> java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Integer;
[10:47:48] <Gyuszk> im calling this class: http://pastebin.com/muiUw9bc
[10:47:55] <Gyuszk> it works, if i test it seperately
[10:49:49] *** LyQuid has joined ##java
[10:50:00] <javaPythonSnake> generic types are not inherited.
[10:50:31] *** Junior has joined ##java
[10:50:44] <Gyuszk> if i use it from my test class, it works
[10:51:15] <Gyuszk> what conditions could be different?
[10:51:46] <jink> Gyuszk: Show more code. Like where the exception happens. This is just a frame. I can't see anything wrong with it. (Although I wouldn't know why add(T...) would return T, for example. But that's up to you.
[10:52:00] <javaPythonSnake> see put and get rule for genrics.
[10:52:50] <javaPythonSnake> no covarieant.
[10:53:00] <javaPythonSnake> woo.. Not covariant *
[10:53:40] <sz332> javaPythonSnake: not really, it's a library used by geoserver
[10:54:28] <javaPythonSnake> what?
[10:56:28] *** Versuchen has joined ##java
[10:58:15] <sz332> javaPythonSnake: the code i pasted is a library used by a server application. I found a bug and i'd like to fix it somehow, because it affects our product :D
[10:58:53] <mapreduce> Gyuszk: So you haven't posted the code that actually fails, have you?
[10:58:57] <javaPythonSnake> do you know what generics are or covariance/
[10:59:12] <jink> mapreduce: Correct.
[10:59:22] <mapreduce> That's a bit daft.
[10:59:39] <mapreduce> javaPythonSnake: Are you egosurfing?
[11:00:45] *** supercosmonaut has joined ##java
[11:00:52] <nvictor> javaPythonSnake, ha ha ha
[11:00:59] <nvictor> didn't notice
[11:06:31] *** javaPythonSnake has left ##java
[11:06:38] *** javaPythonSnake has joined ##java
[11:06:44] *** Henryx has joined ##java
[11:06:49] <Henryx> hi all
[11:07:14] *** fr0ggler has joined ##java
[11:09:40] <Gyuszk> no, i didn't
[11:09:46] <Gyuszk> i read some generics guide
[11:09:57] <Gyuszk> and i see that my classes and interfaces were totally wrong
[11:10:00] <Gyuszk> now its okay :)
[11:11:24] <Gyuszk> i have another question
[11:11:25] <Gyuszk> private Map<String, Integer> variables;
[11:11:33] <Gyuszk> it returns Integer objects
[11:11:41] <Gyuszk> how to gather the primitive int values from them?
[11:11:44] <javaPythonSnake> I didn't know whether you left the brackets out because you din't paste all the code or on accient.
[11:12:12] *** jkirk has quit IRC
[11:12:20] <javaPythonSnake> well that returns a Map
[11:12:33] <javaPythonSnake> but primitive wrapper types will autobox
[11:12:34] <Gyuszk> i meanvariables.get(actNode.getFirstChild().getNodeValue()));
[11:12:37] <javaPythonSnake> 1.5 >
[11:12:43] <Gyuszk> *i mean variables.get(actNode.getFirstChild().getNodeValue()));
[11:12:59] <Gyuszk> yeah, i use 1.6
[11:13:03] <sz332> .intValue()
[11:13:24] <sz332> int i = variables.get("test").intValue()
[11:13:35] <javaPythonSnake> or you can do that.
[11:13:37] <Gyuszk> well yeah that should have an intValue(), but it doesnt
[11:13:42] <javaPythonSnake> but I don't think you have to.'
[11:13:48] <sz332> but it can cause some error, if it's null
[11:13:52] <Gyuszk> if i type a "." after it, netbeans brings an empty list of methods
[11:13:54] *** terranova has quit IRC
[11:14:01] <Gyuszk> its some Integer that is not java.lang.Integer or somethin'
[11:14:23] <javaPythonSnake> I mean I odn't know check you imports
[11:14:44] <sz332> Map<String,Integer> variable = new HashMap<String, Integer>(); int i = variable.get("test").intValue();
[11:14:54] <sz332> it works fine
[11:15:27] *** BeholdMyGlory has joined ##java
[11:15:34] <Sbrun> When implementing equals I often see if (!(obj instanceof Foo)) return false; Foo foo = (Foo)obj; Given that obj will seldom (right?) be not an instanceof Foo, wouldn't a try { Foo foo = (Foo)obj; ... } catch(ClassCastException) {return false;} pattern make more sense?
[11:15:45] <javaPythonSnake> hard to please Gyusk, never heard someone complain about auto complete :p
[11:16:40] <javaPythonSnake> object is going to the parent to any object right
[11:17:16] <fr0ggler> Sbrun, why would it be seldom a Foo (or subtype of Foo)?
[11:17:19] <javaPythonSnake> Oh I see what your saying
[11:17:36] <Sbrun> fr0ggler: seldom NOT be a Foo
[11:17:42] <javaPythonSnake> hahhahahahah
[11:17:55] <fr0ggler> Sbrun, make sense.
[11:18:40] <Sbrun> I am mainly wondering whether the instanceof check has any performance advantage over the try-catch pattern, because otherwise the latter looks more sensible to me.
[11:19:01] <javaPythonSnake> exception handling is expensive right
[11:19:33] <sz332> is it?
[11:19:45] <Sbrun> But there will not be many exceptions thrown, so the cost might be lower? Mhm.
[11:19:53] <sz332> DO NOT CARE
[11:20:18] <sz332> 90% of the application code can be optimized with architecture and good algorithms
[11:20:28] <sz332> the 10% rest can be optimized by "hacking"
[11:20:37] <fr0ggler> i would imagine a try catch when doing equals for large datasets would be less sensible than a cast (which, as far as I know, is cheap) and instanceof
[11:20:47] <sz332> so, if you want more performance, think about architecture, and not about "handcoding"
[11:20:57] <javaPythonSnake> Generally not a good practice to code towards the likelihood it probably won't happen.
[11:21:31] *** gelignite has joined ##java
[11:21:46] <Sbrun> Oh well, I will stay with the generally accepted pattern then and possibly run a benchmark some day if I get bored.
[11:22:23] <fr0ggler> ~benchmark
[11:22:23] <javabot> fr0ggler, I have no idea what benchmark is.
[11:22:48] <fr0ggler> hm coulda sworn there was a benchmark factoid...
[11:23:11] <fr0ggler> Sbrun, generally accepted patterns are generally accepted for good reason.
[11:23:28] <javaPythonSnake> doesn't get benchmark thing either... gonna read again
[11:23:29] <sz332> Sbrun: agree
[11:23:31] <javaPythonSnake> pretty tired though
[11:24:11] <fr0ggler> Sbrun, if you want a nice explanation, read the section in Effective Java about implementing equals()
[11:27:07] *** dasilvj has quit IRC
[11:27:27] <javaPythonSnake> chapter 3 ... :)
[11:27:50] <fr0ggler> item 7!
[11:28:00] <javaPythonSnake> stand by
[11:28:23] <javaPythonSnake> yes item 7 :p
[11:28:32] <fr0ggler> yes i know. i just looked at it.
[11:29:46] <javaPythonSnake> BigDecimal
[11:33:06] *** dasilvj has joined ##java
[11:34:26] <Sbrun> It doesn't really explain why to use instanceof over try/catch, though. Still, good idea to look it up again.
[11:35:39] <sz332> Sbrun: write code that is cleaner, easier to understand
[11:35:46] <fr0ggler> i just don't understand why you'd want to go through a try catch procedure when a cast and instanceof does the job perfectly well
[11:36:19] *** wh1t3 has quit IRC
[11:37:25] <selckin> http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ this real? only on 32bit i guess
[11:38:26] <Gyuszk> can u tell me an xpath expression that counts the number of _direct_ child nodes (at one level) of a node?
[11:39:11] <fr0ggler> ~aolbonics
[11:39:11] <javabot> aolbonics is using unnecessary abbreviations such as 'u', 'r', 'ur', 'thx', etc. Using this kind of abbreviation is annoying and pointless. You have a full keyboard and presumably a full brain. Please use both. If you want intelligent answers, the least you can do is speak intelligently.
[11:40:32] <Sbrun> fr0ggler: Just wondering whether the instanceof+cast would be more expensive than try+cast given that it's used so often or whether I was missing something. And no, I don't expect any major performance gains even if it is faster.
[11:40:33] <javaPythonSnake> recurssion?
[11:41:09] <fr0ggler> Sbrun, do a test case and profile them if you're that concerned, but benchmarks are mostly useless.
[11:41:25] *** eoss has joined ##java
[11:41:33] <Ragnor> selckin: The Jacks regression tests used by jikes contain some of these conversions. Last time I checked the Java runtime still did hang reliably running these tests.
[11:44:54] <javaPythonSnake> null instanceOf Object
[11:45:02] <javaPythonSnake> (foo) null
[11:47:06] <mapreduce> null instanceof Object gives false.
[11:48:46] *** Nurbs has joined ##java
[11:48:46] <javaPythonSnake> making one point of many... Best answer use polymorphism.
[11:48:47] <mapreduce> Sbrun: The performance of instanceof versus having two or more catch blocks will be negligible.
[11:48:56] <mapreduce> Sbrun: Do you have a performance problem?
[11:49:15] <mapreduce> javaPythonSnake: Neither try..catch nor instanceof are polymorphism.
[11:49:25] <javaPythonSnake> yeah ok.
[11:50:46] *** hoxily has joined ##java
[11:50:54] <Nurbs> mapreduce: No, just wondering why instanceof became the accepted pattern and whether I missed any serious reason for that.
[11:51:13] <mapreduce> instanceof isn't the accepted pattern.
[11:51:17] <javaPythonSnake> I said the best solution is polymophic...not try catch is polymorphism?
[11:51:28] <javaPythonSnake> morph*
[11:51:33] *** Sbrun has quit IRC
[11:51:50] *** Matuku has joined ##java
[11:52:07] <fr0ggler> javaPythonSnake, perhaps reading about polymorphism would help.
[11:52:16] <javaPythonSnake> why?
[11:52:43] *** openpercept_ has quit IRC
[11:52:45] *** TheWarrior has quit IRC
[11:53:30] <Nurbs> mapreduce: The alternative that I have seen was getClass, but I cannot see how that works with inheritance.
[11:53:36] *** rodrigorocha has joined ##java
[11:53:53] *** hoxily has left ##java
[11:54:32] <mapreduce> Nurbs: What's the problem you're solving?
[11:54:55] *** realtime_ has joined ##java
[11:55:25] <mapreduce> Nurbs: In general, the Visitor pattern is a good alternative to instanceof/getClass, if you cannot simply move all the method declarations up a level.
[11:55:49] <mapreduce> Some APIs (org.w3c.dom..) force you to cast though, which is annoying.
[11:56:13] <Nurbs> mapreduce: I was talking specifically about an implementation pattern for equals
[11:56:25] <mapreduce> Ah, equals is one of those APIs.
[11:56:59] <mapreduce> public boolean equals(Object o) { if (o instanceof Foo) return ((Foo)o).legs == legs; }
[11:57:09] <mapreduce> That works unless a subclass may override equals.
[11:57:20] <mapreduce> In which case you'll want the .getClass() version.
[11:57:27] *** bitterman has joined ##java
[11:57:30] <Nurbs> ... or not.
[11:57:40] <mapreduce> Why 'or not'?
[11:58:04] <selckin> getclass is annoying when you get proxies and other fun stuff
[11:58:18] <mapreduce> The Scala folks came up with a clever way of doing it that is applicable to Java. I'll see if I can find it.
[11:58:37] <Nurbs> Because a subclass may want to use the same equals implementation. I would even say: Most of the time it really should use the same equals implementation if the base class is not abstract.
[11:59:08] <Nurbs> Eclipse generated obj.getClass() == this.getClass(), which I imagine to fail with e.g. JPA-generated proxy classes
[11:59:48] <fr0ggler> javaPythonSnake, because you seem to be making up random sentences concerning it, when it's not really relevant.
[12:00:11] <mapreduce> Nurbs: I suppose you could add a .getType() that normally returns the same thing getClass() does.
[12:00:30] <mapreduce> Nurbs: And then your proxy would end up calling getType on the original object and everything would be happy.
[12:00:47] <mapreduce> You'd still have to cast to some interface containing getType first though.
[12:01:26] <mapreduce> (or to the 'current' class, i.e., the class your equals implementation is within)
[12:01:28] * Nurbs detects an error in what he wrote, but has to leave for now.
[12:01:31] *** kriko has quit IRC
[12:01:39] <javaPythonSnake> downcasting and using instance of is obsurd in this context... Anyway done with this one lol.
[12:02:19] <fr0ggler> ...
[12:02:22] <mapreduce> javaPythonSnake: Can you write me an equals implementation?
[12:02:37] * fr0ggler moves away slowly
[12:02:38] <selckin> if you want to obay the letter of the equals contract, the getclass == is the only correct options, but in the real world you're ofter better off doing instanceof
[12:02:39] <javaPythonSnake> you're right
[12:03:22] <mapreduce> selckin: With a Proxy around, I expect foo.equals(bar) != bar.equals(foo)
[12:03:24] <flippo> Uh oh, an "in the real world" argument.
[12:03:29] <mapreduce> with the getClass approach.
[12:03:40] *** Sliker has joined ##java
[12:03:44] <fr0ggler> mapreduce, agreed
[12:03:51] <mapreduce> In my real world I just make the class final, use instanceof, and move along.
[12:04:11] <fr0ggler> then you're in the realms of stuff like isAssignableFrom(). in an equals()? eesh.
[12:04:19] *** openpercept has joined ##java
[12:04:57] <fr0ggler> i'd rather do what Bloch suggests. he's way cleverer at Java than me.
[12:05:44] <mapreduce> Odersky's even clevererer at it.
[12:06:40] *** Yvemath has quit IRC
[12:06:56] <mapreduce> Incidentally, Bloch has corrected himself since Effective Java was first published.
[12:07:04] <selckin> bloch suggests instanceof i think
[12:07:13] <mapreduce> He used to, now he suggests getClass.
[12:07:28] <fr0ggler> interesting. link?
[12:07:46] <mapreduce> Bear in mind his first experience of Java was designing the collections libs, so he wasn't as experienced as he seemed. :)
[12:08:16] <mapreduce> ~~ fr0ggler google josh bloch getClass
[12:08:17] <javabot> fr0ggler, http://letmegooglethatforyou.com/?q=josh+bloch+getClass
[12:08:39] <flippo> mapreduce, yes, I think Odersky solved that one finally.
[12:08:50] *** epure_ has joined ##java
[12:09:36] <javaPythonSnake> Doesn't directly come to play fr0ggler, but was thinking beyone instanceOf.. So not entirely outrageous.
[12:10:07] <flippo> fr0ggler, Odersky used the isAssignableFrom trick. :)
[12:10:18] <selckin> thats basicly instanceof anyway
[12:10:33] <mapreduce> A lot of these problems disappear if you stop writing 'extends' so much. :)
[12:11:10] <fr0ggler> mapreduce, indeed. tell that to javaPythonSnake with his polymorphism infatuation.
[12:11:22] *** Goliath has joined ##java
[12:11:29] <Goliath> hey
[12:11:31] <Goliath> does the netbean do a verification check on downloaded plugins? (cause i have a bad net connection)
[12:11:49] <mapreduce> ~~ Goliath google netbeans verify plugins
[12:11:50] <javabot> Goliath, http://letmegooglethatforyou.com/?q=netbeans+verify+plugins
[12:12:48] <javaPythonSnake> lol
[12:14:13] <mapreduce> Wow, the google results for anything netbeans-related are terrible.
[12:14:53] <mapreduce> It looks like some plugins have a .md5 on the download site, so you could manually verify the download if Netbeans doesn't.
[12:15:23] <mapreduce> I can't tell if Netbeans does or not though.
[12:15:37] <DroidAgent> I'm making something that resembles a template engine, i.e. I'm replacing {someTag} with Strings. I'm building a chain of someString.replace("{someTag}", "someValue") commands, is this the way to do this or is there some standard method I could use?
[12:16:24] <flippo> mapreduce, extends only seems to be a problem for equals if you add state. And if you do, then the equals contract is going to be unsatisfactory. Decorating an interface seems to make life easier.
[12:18:06] *** hzroot has joined ##java
[12:19:19] *** Luc1fel has joined ##java
[12:21:48] <javaPythonSnake> and not that interfaces have anything to do with polymorphism.. Sorry to open up again..
[12:21:59] *** ferret_ has quit IRC
[12:22:41] <flippo> javaPythonSnake, no you're not. :)
[12:22:55] <javaPythonSnake> :p
[12:23:14] <fr0ggler> *sigh*
[12:23:55] *** iik has joined ##java
[12:24:36] *** Bombstone has quit IRC
[12:24:39] *** ferret_ has joined ##java
[12:29:12] <mapreduce> fr0ggler: I personally would prefer a Comparator-like approach to equality.
[12:31:16] *** BeholdMyGlory has quit IRC
[12:31:26] <mapreduce> interface Equalator<T> { boolean areEqual(T t, T u); int hash(T t); } but that won't work at all with HashSet etc.
[12:33:48] *** ItsMeMario has joined ##java
[12:34:04] <flippo> Very odd: http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
[12:34:08] *** LouisJB has quit IRC
[12:34:41] *** Quadresce_ has joined ##java
[12:35:11] <fr0ggler> mapreduce, yeah i was thinking how any hashing might be implemented there for a collection
[12:35:19] *** TheWarrior has joined ##java
[12:35:26] <ItsMeMario> Hey guys, there's a way to define a different securty police to a specific classloader? I've an app that start various others app and this app can't shutdown the JVM. Do you know how to solve this problem???
[12:36:36] <mapreduce> flippo: That affects PHP too.
[12:36:53] <selckin> it's actually a diffrend numbers in both
[12:37:00] <mapreduce> Luckily it doesn't affect any real programming languages. :)
[12:37:51] *** Bombstone has joined ##java
[12:39:18] <flippo> mapreduce, slightly different value than PHP. Might be a widely imitated algorithm.
[12:39:52] <javaPythonSnake> interesting
[12:39:54] <TheWarrior> ItsMeMario, you can assign permissions to codebases - isn't that going to work for you?
[12:41:31] <flippo> The "correctionLoop:" in http://www.docjar.com/html/api/sun/misc/FloatingDecimal.java.html would offend most IDEs
[12:42:21] <ItsMeMario> no, because theres no way to know who's the app that called the system.exit
[12:42:28] <ItsMeMario> TheWarrior: no, because theres no way to know who's the app that called the system.exit
[12:43:06] <javaPythonSnake> wish you could use git w/NetBeans
[12:43:32] *** sebrock has joined ##java
[12:44:13] <fr0ggler> ~~javaPythonSnake google netbeans git
[12:44:13] <javabot> javaPythonSnake, http://letmegooglethatforyou.com/?q=netbeans+git
[12:44:18] *** gimix has quit IRC
[12:44:25] <javaPythonSnake> love this thing
[12:44:33] <javaPythonSnake> not out yet..
[12:45:22] <fr0ggler> so what's nbgit then? I see downloads.
[12:45:31] *** bjornju has quit IRC
[12:46:20] <Gyuszk> guys, can u help me? a have my last question... :)
[12:46:22] <Gyuszk> http://pastebin.com/ZPWUtKiQ
[12:46:35] *** Quadresce_ has left ##java
[12:46:39] <Gyuszk> in my working class, i just cannot use that fckin Map
[12:46:46] <javaPythonSnake> http://netbeans.org/projects/versioncontrol/pages/Git_main
[12:46:47] <Gyuszk> it must be <String,Integer>
[12:47:01] <Gyuszk> but if it is, i just cannot cast a primitive int from its get method
[12:47:18] *** Quadresce_ has joined ##java
[12:47:21] <Gyuszk> String,String works fine, but it would brake the specification
[12:47:42] <Quadresce_> Hi
[12:47:45] <mapreduce> Gyuszk: Map<String, Integer> variables = new HashMap<String, Integer>();
[12:47:54] <mapreduce> Gyuszk: variables.put("fooBar", 23);
[12:48:01] <Gyuszk> yeah, that worked
[12:48:03] <Gyuszk> in the main class
[12:48:07] <Gyuszk> but not in the working class
[12:48:11] <Gyuszk> i tried to get a value
[12:48:16] <Gyuszk> it only returns Integer
[12:48:28] <Gyuszk> that just DONT have any valueof method
[12:48:30] <Gyuszk> :(
[12:48:38] <Quadresce_> Why doesnt #define NUM_FUNS 5 work in NetBeans Java?
[12:49:21] <fr0ggler> ~~Gyuszk enter
[12:49:21] <javabot> Gyuszk, enter is not punctuation. Please don't press your Enter or Return key until you've finished typing your question, sentence, or idea. It is annoying to see that and hard to follow.
[12:49:35] <flippo> Quadresce_, you naughty boy
[12:50:06] <Quadresce_> flippo: huh?
[12:50:09] <fr0ggler> Quadresce_, say what now?
[12:50:12] <javaPythonSnake> use generics inside the parameter list as well
[12:50:20] *** Goliath has quit IRC
[12:50:32] *** Boon has joined ##java
[12:50:37] <Quadresce_> fr0ggler: #define NUM_FUNS 5
[12:50:40] <mapreduce> Gyuszk: Why do you need a valueOf method?
[12:50:44] *** Boon has left ##java
[12:50:52] <mapreduce> Gyuszk: You've got an Integer, what are you hoping to have instead?
[12:51:11] *** Luc1fel has quit IRC
[12:52:02] <fr0ggler> Quadresce_, that doesn't look like Java
[12:52:38] <Quadresce_> fr0ggler: mayve camalCase is more javaish?
[12:52:46] <Quadresce_> Maybe**
[12:52:46] <flippo> Quadresce_, did you remember to run the C preprocessor first?
[12:52:53] <fr0ggler> Quadresce_, Java is more Java-ish
[12:53:21] <Quadresce_> flippo: i am using NetBeans Java (with BeanShell)
[12:53:26] <TheWarrior> maximumtrolling.jpg
[12:53:26] <javaPythonSnake> android emulator sdk.. LIke unusably slow.
[12:53:40] <fr0ggler> ~~javaPythonSnake blog
[12:53:40] <javabot> javaPythonSnake, ##java is not your personal blog. Take it back to the LiveJournal, where your ideas will be read by thousands of hungry followers. The next revolution will be led by YOU!
[12:53:43] *** bjornju has joined ##java
[12:53:45] <javaPythonSnake> in the and initializaiton
[12:54:19] <javaPythonSnake> you mean like talking about using comparators instead of equals ?
[12:54:57] <javaPythonSnake> That kind of blogging? night
[12:55:00] *** javaPythonSnake has left ##java
[12:55:12] <Quadresce_> fr0ggler: so what is the issue? (this is for CS203 course)
[12:55:56] <fr0ggler> Quadresce_, i don't do Beanshell sorry
[12:56:05] <Quadresce_> Ah ok
[12:56:32] <fr0ggler> and homework questions are usually avoided
[12:57:00] <Quadresce_> It isnt homework, just studying for exam in a couple hours
[12:57:14] *** elnur has joined ##java
[12:57:19] <fr0ggler> Quadresce_, that counts in my book, but others may disagree.
[12:57:22] <elnur> What's wrong with this: ${fn:startsWith(requestURI, pageContext.request.contextPath + '/book/finished')} ?
[12:57:46] <Quadresce_> fr0ggler: well u sure are unhelpful :)
[12:58:09] <fr0ggler> elnur, what do you see and what do you expect to see?
[12:58:22] *** bitterman has quit IRC
[12:58:29] *** hiwk has joined ##java
[12:58:31] *** gigabytes has joined ##java
[12:58:54] <Quadresce_> Hi gigabytes
[12:58:55] *** dreamreal has joined ##java
[12:59:06] <elnur> fr0ggler, initially it was ${fn:startsWith(requestURI, '/book/finished')} but then I tried to prepend the path with context and it started to fail. What's wrong with that syntax?
[12:59:12] *** javaPythonSnake has joined ##java
[12:59:35] <fr0ggler> elnur, I don't know. I haven't seen any errors.
[12:59:49] *** erikhh has quit IRC
[12:59:57] <fr0ggler> are pageContext, request, and contextPath available?
[13:00:17] <fr0ggler> (or getRequest(), getContextPath(), whatever)
[13:00:21] <gigabytes> hi Quadresce_
[13:00:40] <elnur> fr0ggler, it gives my number format exception. Shouldn't + be concatenating string?
[13:00:46] <elnur> s/my/me
[13:00:55] *** erikhh has joined ##java
[13:01:51] <fr0ggler> elnur, not in JSTL EL i don't think *checking*
[13:02:22] <fr0ggler> elnur, nope. http://stackoverflow.com/questions/3640254/string-concatenation-in-el
[13:03:20] <elnur> fr0ggler, aha, that's the problem. thanks
[13:03:32] *** bjornju has quit IRC
[13:04:06] *** platzhirsch has joined ##java
[13:06:54] *** red-lichtie has joined ##java
[13:08:47] <red-lichtie> Is there a way to force the security manger
[13:08:58] <dmlloyd> force it to do what
[13:09:01] <platzhirsch> I have a problem with the structure of my project. Basically it is a web application implemented with Servlets. My model is a Scheduler with different functionalities. However, the scheduler was designed as a stand-alone application and was integrated into the web application. In order to integrate it AND add some additonal functionalies which would be associated with the tasks of this scheduler I created a SchedulerController which provid
[13:09:03] <red-lichtie> to be turned on?
[13:09:09] <dmlloyd> ~~ red-lichtie enter
[13:09:09] <javabot> red-lichtie, enter is not punctuation. Please don't press your Enter or Return key until you've finished typing your question, sentence, or idea. It is annoying to see that and hard to follow.
[13:09:11] *** openpercept has quit IRC
[13:09:14] <red-lichtie> Sorry, hit enter too early
[13:09:16] <dmlloyd> okay
[13:09:22] *** LyQuid has quit IRC
[13:09:23] <platzhirsch> but to my understanding, this SchedulerController is no controller in the meaning of MVC, is it?
[13:10:14] <fr0ggler> platzhirsch, naming your classes doesn't inherently define their function. how about something like SchedulerManager if you're concerned about confusion?
[13:10:52] <platzhirsch> fr0ggler: Manager is a good word, I agree
[13:11:02] <fr0ggler> or SchedulerDefinitelyNotAssociatedWithMvcController
[13:11:06] <dmlloyd> red-lichtie: http://download.oracle.com/javase/6/docs/technotes/guides/security/smPortGuide.html
[13:11:17] <red-lichtie> I want to set the command line option "-Djava.security.manager" to forced, even if an application starter doesn't define it. I was looking for a mechanism for defining global system properties in lib/security or something along those lines.
[13:11:35] <fr0ggler> red-lichtie, System.setProperty()?
[13:11:38] <platzhirsch> fr0ggler: but my guess is right, that this is no controller implementation (MVC), as it does not take any user input or similiar, it just provides methods
[13:12:15] <fr0ggler> platzhirsch, i'd stop worrying about it, and just rename the class to avoid confusion if you think that'd be a problem.
[13:12:22] <red-lichtie> fr0ggler, that requires that every program implements the call. I want it installed system wide
[13:13:33] *** dreamreal has quit IRC
[13:13:46] <fr0ggler> red-lichtie, well without knowing what your application context, it's hard to guess a fair solution. properties files?
[13:13:47] <platzhirsch> fr0ggler: *nod*
[13:13:52] <fr0ggler> s/what//
[13:14:03] *** Geek29 has quit IRC
[13:14:04] *** dreamreal has joined ##java
[13:14:18] <red-lichtie> Gutsat5
[13:14:42] <red-lichtie> With the system wide I mean ever application
[13:14:49] <red-lichtie> *every
[13:16:35] <ItsMeMario> how can i create a thread pass as paramenter for addShutdownHook that stop the shutdown process??
[13:17:20] <ItsMeMario> how can i create a thread to pass as parameter for addShutdownHook that stop the shutdown process??
[13:17:55] *** hiwk has left ##java
[13:18:10] <fr0ggler> red-lichtie, yes I understand what "system-wide" means. i meant that you haven't specified the way your application is designed enough to give a decent answer.
[13:18:23] *** tty1 has quit IRC
[13:18:41] <dmlloyd> ~~ red-lichtie javadoc System.getProperties()
[13:18:41] <javabot> red-lichtie: http://is.gd/Dq1E8S [JDK: java.lang.System.getProperties()]
[13:19:09] <dmlloyd> not sure if you can create a default property somehow though
[13:19:45] *** perlsyntax has joined ##java
[13:20:23] <red-lichtie> Its for an enterprise environment. I want to for a company security manager, regardless of how the JVM is started. An was hoping there was a standard way of doing that
[13:20:32] *** ExtraSpice has joined ##java
[13:20:46] <paulweb515> ItsMeMario: it looks like no ... see the javadoc for addShutdownHook
[13:21:01] <dreamreal> red-lichtie: an application is able to set its own security manager
[13:21:02] <ItsMeMario> paulweb515: ahm?
[13:21:34] <ItsMeMario> paulweb515: is not possible to stop the jvm system halt process???
[13:21:37] <red-lichtie> dreamreal: I want to set it, even if an application didn't. Policy enforcement
[13:22:12] *** gigabytes has quit IRC
[13:22:33] <fr0ggler> red-lichtie, hm. swap the system java command for a dummy script that sets your property?
[13:22:41] <dreamreal> there's a security policy file
[13:22:47] <paulweb515> ItsMeMario: read it, it says once started the shutdown will run ... unless you call halt() to terminate the JVM immediately
[13:23:20] *** Quadresce_ has left ##java
[13:23:20] <fr0ggler> dreamreal, hm good point. a bit of sick appeared in my mouth at my suggestion.
[13:23:24] <ItsMeMario> paulweb515: i already read javadoc if I'm asking here is because i could not understand
[13:24:07] <ItsMeMario> paulweb515: the question is: can i stop the java's system halt?
[13:24:21] <paulweb515> ItsMeMario: OK ... the gist of it is once you are in shutdown, you can either 1) finish the shutdown or 2) kill the JVM immediately ... you can't stop the shutdown
[13:24:24] <red-lichtie> there doesn't seem to be an option to force the security manager to turned on in "java.security", well not one that was obvious to me
[13:24:38] <dreamreal> red-lichtie: errrrr
[13:25:15] <cheeser> it's always on
[13:25:36] <ItsMeMario> paulweb515: ok... i want to "1) finish the shutdown" how can i do it?
[13:26:07] <red-lichtie> lib/security/java.security defines the security policy, but doesn't enforce it. Its optional if "-Djava.security.manager" isn'r defined on the command line
[13:26:14] <paulweb515> ItsMeMario: sorry, #1 refers to what will happen if you do nothing. The shutdown hooks will run and the JVM will exit
[13:26:20] <fr0ggler> ItsMeMario, he means the shutdown will either complete by itself, or you can force the JVM to die immediately. they're the only 2 options.
[13:27:22] <paulweb515> ItsMeMario: or are you asking how to run a proper shutdown with hooks if someone calls Runtime.halt(13) ?
[13:27:23] *** petisnnake has joined ##java
[13:28:26] <dmlloyd> red-lichtie: correct, and I don't see any way to "force-feed" a system property
[13:28:32] *** elnur has quit IRC
[13:29:39] <ItsMeMario> paulweb515: the thing is that i've a unkowned app that i use reflection to start it up. These unkowned apps have jframes that can call system.exit and this cant happend because it'll finalize all my program.... there's a way to solve this??
[13:29:45] *** red-lichtie has left ##java
[13:30:09] <petisnnake> Hi, can anyone tell me why this gives an error ? LinkedList<Integer>.MyIterator<Integer> it = LinkedList<Integer>.MyIterator<Integer>(l.head); . MyIterator is an inner class of LinkedList
[13:30:14] *** jabz has quit IRC
[13:30:45] <cheeser> why not tell us what the error is?
[13:31:22] <cheeser> is that a java.util.LinkedList or did you write your own LinkedList class?
[13:31:34] <dreamreal> I bet he wrote his own
[13:31:44] <petisnnake> my own :)
[13:31:45] <dreamreal> because that would be the sillest approach
[13:31:51] <dreamreal> petisnnake: why?
[13:31:54] <petisnnake> I had to
[13:32:17] <cheeser> homework
[13:32:19] <dreamreal> ah, homework
[13:32:19] <Ragnor> And both classes use different type parameters?
[13:32:43] <petisnnake> The error is: Cannot allocate the member type LinkedList<Integer>.MyIterator<Integer> using a parameterized compound name; use its simple name and an enclosing instance of type LinkedList<Integer>
[13:32:50] <petisnnake> Ragnor: same
[13:33:15] <paulweb515> ItsMeMario: no, but ... exit(*) says that the thread must have permission to exit. You could use a security policy that prevents System.exit(*) from working, see the javadoc for System.exit(*)
[13:34:04] <petisnnake> any ideas to my question? isn't my initialization wrong?
[13:34:04] <cheeser> um. it doesn't look like you're calling a method there but trying to call a constructor for MyIterator
[13:34:23] <petisnnake> I forgot to paste the 'new' keyword
[13:34:29] * cheeser sighs
[13:34:33] <petisnnake> LinkedList<Integer>.MyIterator<Integer> it = new LinkedList<Integer>.MyIterator<Integer>(l.head);
[13:34:39] <cheeser> is MyIterator static?
[13:34:41] <dmlloyd> what?
[13:34:44] *** FrozenKnight has joined ##java
[13:34:49] <petisnnake> I'm just trying to create a new MyIterator<T> object
[13:34:53] <petisnnake> no,
[13:34:55] <Ragnor> To me it looks like he's using new Outer.Inner() instead of outer.new Inner().
[13:34:58] <petisnnake> inner class, not nested
[13:35:00] <cheeser> yeah. that's one reason.
[13:35:05] <cheeser> Ragnor: exactly
[13:35:06] *** pen has joined ##java
[13:35:16] <petisnnake> ah so I should outer.new Inner()?
[13:35:18] *** EricInBNE has quit IRC
[13:35:25] <dmlloyd> the error literally means "don't put a type parameter on there you rube"
[13:35:25] <cheeser> petisnnake: but you should call myLinkedList.iterator() instead.
[13:35:50] <dmlloyd> I mean it tells you exactly what to do
[13:35:50] <cheeser> dmlloyd: well, the inner class needs an instance of the outer in this case
[13:35:58] <dmlloyd> yeah.
[13:36:23] <petisnnake> okay, thanks
[13:36:28] *** red-lichtie has joined ##java
[13:36:39] <flippo> My goodness.
[13:37:07] *** FrozenKnight has quit IRC
[13:37:10] *** pschriner has joined ##java
[13:37:28] *** FrozenKnight has joined ##java
[13:38:11] *** Gyuszk has quit IRC
[13:38:34] *** tr3x has quit IRC
[13:38:38] *** red-lichtie has quit IRC
[13:38:48] *** red-lichtie has joined ##java
[13:38:50] *** gremmachook has joined ##java
[13:39:06] *** bjornju has joined ##java
[13:39:20] *** ItsMeMario has quit IRC
[13:39:38] *** ItsMeMario has joined ##java
[13:39:41] <ItsMeMario> paulweb515: guy... thank you for the help, i already ready the javadoc and did some experiences with controlling the checkexit from secuitymanager, but it didnt work because the unique possibility is to throw an exception and i cannot catch it from an unkowned app, can u understand???
[13:42:12] *** Garibaldi has quit IRC
[13:42:44] <paulweb515> ItsMeMario: overriding checkExit(*) didn't prevent System.exit(*) from working? Or it caused an exception to bubble up through where you started the other application and you didn't deal with it?
[13:42:47] *** Bombstone has quit IRC
[13:43:32] *** tr3x has joined ##java
[13:45:04] <ItsMeMario> paulweb515: yes, it can prevent but it prevent system.exit throwing an exception. Alright? But this exception can be catched only from the "unknowed" app and i cant catch it this is simply unkowned.
[13:46:03] *** Garibaldi has joined ##java
[13:47:35] <paulweb515> ItsMeMario: is your concern you don't know what exception could come out of the unknown app? While generally frowned upon, you can catch Exception or even Throwable around your call to the app
[13:47:53] *** mhahe has quit IRC
[13:48:51] *** platzhirsch has left ##java
[13:50:39] <ItsMeMario> paulweb515: this is the question: http://stackoverflow.com/questions/4827892/how-to-avoid-jframe-exit-on-close-operation-to-exit-the-entire-application
[13:52:52] <dmlloyd> why not change the JFrame to DISPOSE_ON_CLOSE
[13:53:11] <dmlloyd> if you know it's a JFrame
[13:53:53] *** msieradzki has joined ##java
[13:54:10] <red-lichtie> ItsMeMario: You can check for your codebase when topping the system exit.
[13:54:57] <red-lichtie> If its you code allow it, if the code was loaded from another path then disable it and throw a security exception
[13:55:57] *** FrozenKnight has quit IRC
[13:56:53] *** hzroot has quit IRC
[13:59:02] *** FrozenKnight has joined ##java
[13:59:43] *** Henryx has quit IRC
[14:00:07] *** Henryx has joined ##java
[14:00:10] *** psst has joined ##java
[14:00:25] *** deSilva has joined ##java
[14:04:57] *** ItsMeMario has quit IRC
[14:05:23] *** pepone has joined ##java
[14:05:54] <pepone> Hi, what is the meaning of this code: Class<?> c = null;
[14:06:10] <jink> What does it look like? What do you think it is?
[14:06:35] <dreamreal> pepone: it declares c as an instance of a Class, basically
[14:06:38] <pepone> seems like a generic type declaration
[14:07:03] <dreamreal> indeed
[14:07:15] <jink> That wasn't so hard. :) Why are you asking?
[14:07:34] <pepone> just to be sure, i not very familiarized with Java generics
[14:07:39] <jink> Ah. :)
[14:07:41] <jink> ~generics
[14:07:41] <javabot> For a tutorial on generics, please see http://javachannel.net/wiki/pmwiki.php/Main/Generics
[14:07:52] <pepone> thanks
[14:08:28] *** jabz has joined ##java
[14:09:18] <mapreduce> The days immediately preceding giving one's notice are hard to get through.
[14:10:02] <paulweb515> mapreduce: just pretend you are in gastro-intestinal distress ... that will explain away any strange facial expressions
[14:11:44] <cheeser> mapreduce: but the days after are smooth sailing. 8^)=
[14:12:49] *** passwordoff has joined ##java
[14:13:42] <passwordoff> #android-dev have a 2 times more users, then #java
[14:13:57] <cheeser> oh no!
[14:14:13] <cheeser> we've failed the intarwebz
[14:14:33] <passwordoff> ~intarwebz
[14:14:33] <javabot> passwordoff, I have no idea what intarwebz is.
[14:14:35] <realtime_> than*
[14:14:45] <sz332> but most of them are writing they ultimate hello world application :D
[14:14:46] *** Henryx has quit IRC
[14:15:49] *** caverdude has joined ##java
[14:17:12] <passwordoff> javabot should use http://www.urbandictionary.com/define.php?term=intarweb
[14:17:12] <javabot> passwordoff, I have no idea what should use http://www.urbandictionary.com/define.php?term=intarweb is.
[14:19:02] <mapreduce> ~should $1 is <reply>$who's mom should $1
[14:19:02] <javabot> OK, mapreduce.
[14:19:10] <mapreduce> javabot should use a dictionary
[14:19:11] <javabot> mapreduce's mom should use a dictionary
[14:19:18] <cheeser> 8^)=
[14:20:52] *** LouisJB has joined ##java
[14:21:30] *** CrimsonHat has joined ##java
[14:22:18] *** eoss has quit IRC
[14:23:25] *** HolyGoat has joined ##java
[14:25:13] *** solars has joined ##java
[14:25:32] *** kaydsoft has quit IRC
[14:25:40] *** homie has quit IRC
[14:25:45] <solars> hey, how do I replace " with \" in a string? I heard that I should not use replaceALl
[14:26:11] <_W_> who told you that?
[14:26:15] <fr0ggler> solars, where did you hear that from?
[14:26:57] <solars> ah, its from 2004 apparently
[14:26:58] <_W_> you should probably use replace
[14:27:16] <fr0ggler> ah yes replaceAll() ceased to work in 2004. they fixed it in 2005.
[14:27:18] <_W_> but replaceAll would work too
[14:27:20] <solars> I am not sure about the escaping though, how do I escape the above identifiers properly?
[14:27:21] *** deSilva has quit IRC
[14:27:34] <solars> ah, great
[14:27:39] <_W_> solars, both the \ and the " have to be escaped (by \)
[14:27:48] <_W_> in a string literal, anyway
[14:27:53] <solars> I will give it a try, thank you
[14:28:41] <solars> replaceAll("\"", "\\\"") like this I guess
[14:29:01] <_W_> that would work
[14:29:16] *** squi has quit IRC
[14:29:21] <ronr_> are there any java libraries to support and create DSLs?
[14:29:35] <_W_> like I said, you should probably just use replace though, as you're not using the regexp facilities of replaceAll
[14:29:43] *** ojacobson has joined ##java
[14:29:46] <solars> _W_, yep thats right, I will do so
[14:29:53] *** nix8n82 has quit IRC
[14:30:49] <solars> _W_, hm but the above still results in an unescaped ", weird
[14:31:08] <_W_> it's probably not a " then
[14:32:55] <_W_> might it be a », '', or perhaps ″
[14:33:10] <_W_> ~show us
[14:33:10] <javabot> Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems.
[14:38:58] *** efflicto has joined ##java
[14:40:55] *** Fuzion24 has quit IRC
[14:40:55] *** ldh has joined ##java
[14:41:05] <mapreduce> ronr_: Internal DSLs don't need any tools. For external DSLs take a look at ANTLR.
[14:41:24] <mapreduce> Though if you can stretch to Scala, its parser combinators won't bore you to tears like ANTLR documentation.
[14:41:41] *** teralaser has quit IRC
[14:43:51] <ronr_> mapreduce: danke.
[14:44:07] *** epure_ has quit IRC
[14:45:11] *** cafesofie has quit IRC
[14:45:53] *** ArikChan has quit IRC
[14:46:54] *** kaydsoft has joined ##java
[14:48:29] <dmlloyd> I still really want to like cookcc
[14:48:38] *** stateknife has quit IRC
[14:48:46] <dmlloyd> it needs some work though, and its author seems to be MIA
[14:49:04] <ojacobson> Stick a fork in it, it's not done?
[14:49:06] *** cmxiv has joined ##java
[14:49:10] <ojacobson> (You know, in your copious free time.)
[14:49:25] <dmlloyd> I can't fork it, it's too nasty for me
[14:49:55] <dmlloyd> I could be convinced to start afresh if there are any parser nerds around here who want to collaborate
[14:50:05] *** jabz has quit IRC
[14:50:20] <dmlloyd> LR(k) parser generation, come on you know it sounds like fun
[14:50:34] <mapreduce> LLR(1)!
[14:50:38] <mapreduce> Sorry, I mean LOL!
[14:50:44] *** Punker has joined ##java
[14:51:00] <Punker> greetings :)
[14:51:25] *** arborist has joined ##java
[14:51:28] *** Gyuszk has joined ##java
[14:51:31] <Gyuszk> hello guys
[14:51:44] <dreamreal> hi
[14:51:44] <Gyuszk> i'm having trouble with scrinting api (javascript)
[14:51:46] <Gyuszk> Number result = (Number) inv.invokeFunction("add", params);
[14:51:46] <Gyuszk> return result.intValue();
[14:51:52] <Gyuszk> i'm calling some simple methods like this
[14:52:08] <Gyuszk> but it returns some String that has no real numeric value
[14:52:18] <Gyuszk> it used to work some hours ago, i dont know what i messed up :))
[14:52:19] <fr0ggler> ~~Gyuszk enter
[14:52:19] <javabot> Gyuszk, enter is not punctuation. Please don't press your Enter or Return key until you've finished typing your question, sentence, or idea. It is annoying to see that and hard to follow.
[14:52:33] <mapreduce> Gyuszk: So go back to the version you had earlier.
[14:53:09] <Gyuszk> for what reasons could return invokeFunction a string (that has no real numeric value just crap)
[14:53:44] <mapreduce> Dunno, you didn't even specify what type inv is.
[14:54:09] <Gyuszk> i have to return it as an int immidiately
[14:54:18] <Gyuszk> so i can't do anything with an Object or something
[14:54:21] *** glcrazy has quit IRC
[14:54:31] <mapreduce> This newbie has gone into write-only mode.
[14:54:43] <Gyuszk> sry
[14:55:09] *** supercosmonaut has quit IRC
[14:55:31] <fr0ggler> Gyuszk, what's stopping the invokeFunction returning something that cannot be cast to Number? check for a ClassCastException?
[14:55:50] <Gyuszk> java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
[14:56:07] <fr0ggler> Gyuszk, well there we go. handle that properly.
[14:56:40] <Gyuszk> yeah, i know how to get int and so on from a string that contains a number, but this isnt
[14:56:41] <cheeser> params is probably a String
[14:56:44] <Gyuszk> this string is just crap
[14:56:56] <ojacobson> "crap" that probably has something to do with the problem
[14:57:02] *** Soarez has joined ##java
[14:57:10] <ojacobson> Stop omitting facts just because you don't know how to use them - if you knew what was relevant, you wouldn't be here asking for help
[14:57:36] <flippo> Oh boy, casting Strings to numbers.
[14:57:46] *** ItsMeMario has joined ##java
[14:57:48] *** tizbac has joined ##java
[14:58:08] <fr0ggler> Gyuszk, stop casting, and check your objects accordingly
[14:58:22] <fr0ggler> ~cast
[14:58:23] <javabot> casting is a way of changing the type of a reference (it NEVER changes an object), or a sloppy way of converting between different primitive types. '(Type) expression' casts the result of expression to Type.
[14:58:33] <ojacobson> I have a sneaking suspicion your javascript program doesn't do what you think it does, but you haven't given anything like a useful amount of information to base that on
[14:58:35] <ojacobson> it's just a guess
[14:58:38] <fr0ggler> Gyuszk, the bit in parenthesis is crucial.
[14:58:38] <ojacobson> ~show us
[14:58:38] <javabot> Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems.
[14:58:43] *** stateknife has joined ##java
[14:58:50] <ojacobson> fr0ggler: you mean Number? ;)
[14:58:53] <mapreduce> Gyuszk: What 'crap' is in this string then?
[14:59:06] <fr0ggler> ojacobson, very drole ;)
[14:59:07] *** Nach0z has joined ##java
[14:59:30] <ItsMeMario> hey guys, i'm trying to look the totalmemory used from an java app. I'm using Runtime.getRuntime().totalMemory() the result is 58MiB but my OS show that the process is using 6MiB which is the correct THE OS OR THE JVM???
[14:59:30] <ojacobson> droll :)
[14:59:36] <fr0ggler> gah
[14:59:43] <ojacobson> ItsMeMario: both.
[14:59:51] <flippo> Are we looking for Double.parseDouble?
[15:00:01] <ItsMeMario> ojacobson: lol.... how its possible?
[15:00:03] <ojacobson> Runtime.totalMemory() gives a number calculated as explained in the docs
[15:00:07] <ojacobson> the OS is measuring something else entirely
[15:00:29] <cheeser> there's active memory and total memory. some might be swapped out, e.g.
[15:00:41] *** randoms has joined ##java
[15:00:44] <mapreduce> I like how ItsMeMario went from reasonable text to CAPS LOCK and lots of punctuation!!! in one sentence.
[15:01:02] <mapreduce> It's like the sum of human progress from 1995 to 2005 in one IRC message.
[15:01:05] <cheeser> he's just that EXCITED BY THE DRAMA!!!!!
[15:01:19] <Nach0z> lol
[15:01:45] <randoms> ~pastebin
[15:01:45] <javabot> http://mysticpaste.com - Paste the final url after you've pasted your stuff there.
[15:01:52] <fr0ggler> mapreduce, short fUSE!!
[15:02:03] <mapreduce> I resemble that remark.
[15:02:05] *** gremmachook has quit IRC
[15:02:16] <flippo> Yow!
[15:02:21] <Nach0z> lol.
[15:02:25] *** tizbac has quit IRC
[15:03:19] *** ItsMeMario has quit IRC
[15:03:31] *** Matuku has quit IRC
[15:03:33] <randoms> Hi guys, i have a assignment to create a 3d 4x4x4 grid, and display it using LineArray in java3d. for some reason the Apperance Attributes i set does not work so well, also now its not a cube, only 4 seperate grids. any ideas? http://mysticpaste.com/view/6403
[15:03:55] <flippo> Oh boy, an Applet
[15:03:57] *** l2trace99 has joined ##java
[15:04:05] <ojacobson> That's still the most interesting question I've seen here in months
[15:04:14] <ojacobson> (Not that I have an answer)
[15:04:34] <flippo> Maybe we can ignore the Applet part
[15:04:47] <fr0ggler> do lets.
[15:04:51] <randoms> hehe, ignore the applet.
[15:05:02] *** CrimsonHat has left ##java
[15:05:15] *** Matuku has joined ##java
[15:05:20] <Gyuszk> okay, i got the problem, i'm trying to invoke the javascript function with an array of integers instead of int1,int2... http://pastebin.com/fQZb3NQf
[15:05:21] *** openpercept has joined ##java
[15:05:28] *** chittoor has joined ##java
[15:05:31] <Gyuszk> could you help me how to fix this?
[15:05:42] <flippo> Now, javascript!
[15:05:45] <ojacobson> s/int/Integer/g and move on
[15:05:49] <flippo> Who has a gcj question?
[15:05:51] *** skylord5816 has joined ##java
[15:05:52] *** tizbac has joined ##java
[15:05:53] *** chittoor has quit IRC
[15:06:09] <ojacobson> Gyuszk: An int[] can't be expanded into Object... varargs, because ints aren't references
[15:06:12] <ojacobson> an Integer[] can.
[15:06:22] <mapreduce> ~object--
[15:06:22] <javabot> object has a karma level of -1, mapreduce
[15:06:25] <Gyuszk> okay guys, sory for breaking the rules, i was tired and forgot them
[15:06:26] <ojacobson> (Say, from Integer... params)
[15:06:30] <Gyuszk> you are very helpful
[15:06:49] *** Garda has joined ##java
[15:06:53] *** LyQuid has joined ##java
[15:06:55] <Garda> hey guys
[15:06:58] <flippo> Gyuszk, actually, you are invoking from java, so I think we're okay
[15:07:00] <cheeser> what up, yo?
[15:07:01] *** jabz has joined ##java
[15:07:27] <mapreduce> word
[15:07:44] <mapreduce> it crash
[15:08:16] <flippo> Haiku: "I have javascript. / I want to make an applet. / But gcj crashed."
[15:08:37] *** ExtremeDevilz has joined ##java
[15:08:47] <ExtremeDevilz> Hey
[15:09:21] <ExtremeDevilz> Brb
[15:09:22] *** jonkri has joined ##java
[15:09:40] <Garda> I have a question: what exactly is going on here?
[15:09:41] <Garda> http://pastebin.com/TjDxkKN9
[15:10:00] <Garda> I get that there is the addMouseListener
[15:10:00] <Gyuszk> thanks, it works, fixed version: http://pastebin.com/BuPgvA5e
[15:10:14] *** skylord5816 has quit IRC
[15:10:16] <Garda> and it takes a MouseAdapter object
[15:10:28] <Garda> what is in the curly brackets right after that
[15:10:38] <DroidAgent> What an irritating way to write (), ( )
[15:10:44] <ojacobson> ~~ Garda anonymous classes
[15:10:44] <javabot> Garda, anonymous class is essentially a local class without a name. See http://www.developer.com/java/other/article.php/3300881
[15:10:45] <mapreduce> ~~ Garda anonymous class
[15:10:45] <javabot> Garda, anonymous class is essentially a local class without a name. See http://www.developer.com/java/other/article.php/3300881
[15:11:00] *** Luc1fel has joined ##java
[15:11:27] <mapreduce> Garda: http://pastebin.com/sdf4mn3J is the same without the retarded formatting.
[15:12:40] *** pen has quit IRC
[15:12:59] *** rtdos has joined ##java
[15:14:24] *** jabz has quit IRC
[15:16:49] *** mitch0 has quit IRC
[15:18:22] *** epalm has joined ##java
[15:18:26] *** Gyuszk has quit IRC
[15:18:58] *** gelignite has quit IRC
[15:19:00] *** grimboy has joined ##java
[15:19:15] *** cafesofie has joined ##java
[15:20:09] *** teralaser has joined ##java
[15:20:50] <ExtremeDevilz> ok guys I know about basics about Java
[15:21:03] <ExtremeDevilz> now should I learn about networking in Java ?
[15:21:12] <_W_> ~io
[15:21:13] <javabot> For information on handling input/output in java see http://download.oracle.com/javase/tutorial/essential/io/
[15:21:27] <_W_> ~index
[15:21:27] <javabot> _W_, I have no idea what index is.
[15:21:51] *** jfe has quit IRC
[15:21:51] <_W_> ~docs
[15:21:51] <javabot> _W_, api is http://download.oracle.com/javase/6/docs/api/index.html
[15:22:02] <_W_> there ya go ExtremeDevilz
[15:22:49] <ojacobson> ~networking
[15:22:49] <javabot> ojacobson, networking is http://java.sun.com/tutorial/networking
[15:22:55] <ojacobson> ~g beej's guide
[15:22:55] <javabot> http://www.google.com/search?q=beej%27s+guide
[15:23:16] <ojacobson> (beej's is for C, but much of what it discusses is relevant to other languages. Just ignore the struct sockaddr... bits.)
[15:24:35] *** cafesofie has quit IRC
[15:25:11] *** homie has joined ##java
[15:26:57] *** Xabster has joined ##java
[15:28:00] <soa2ii> Hej, if I want to offer a file download in my JavaEE app how do you that normally? Store the file somewhere to disk and then point the browser somehow to this file or can you do this somehow in memory?
[15:28:29] *** cafesofie has joined ##java
[15:31:13] *** supercosmonaut has joined ##java
[15:31:53] *** Garda has quit IRC
[15:31:58] *** bearded_oneder has joined ##java
[15:32:36] <TheWarrior> soa2ii, you can stream it directly to the client as a ServletResponse
[15:33:13] <soa2ii> TheWarrior: So my function should return a ServletResponse or better something else?
[15:33:23] <cheeser> uh.
[15:33:29] *** kermit has joined ##java
[15:33:32] <cheeser> you client makes the request through a servlet
[15:33:36] <cheeser> or a web service
[15:33:53] <soa2ii> Servlet
[15:34:15] <tolland> I have an app with a UserManager interface, but we don't have the specs for the implementation backend any suggestions on how to select which implementation at runtime?
[15:34:58] *** Soarez has left ##java
[15:36:35] <tolland> hello?
[15:36:41] *** ugoubuntu has joined ##java
[15:36:45] <dreamreal> tolland: err... usermanager from where?
[15:36:58] <cheeser> that question doesn't even make sense.
[15:36:58] <ojacobson> tolland: SPI, perhaps
[15:37:07] <ojacobson> I agree with cheeser and mapreduce though
[15:37:26] *** saml has joined ##java
[15:37:29] <mapreduce> That's kind, as I hadn't said anything.
[15:37:35] <ojacobson> er
[15:37:36] <tolland> ive got a mock UserManagerImpl while I am waiting for the real details to be delivered
[15:37:36] <TheWarrior> soa2ii, you should get the OutputStream from the ServletResponse object provided to you by the servlet, and then use that OutputStream to stream the file's contents to the user
[15:37:36] <ojacobson> dreamreal:
[15:37:38] <cheeser> you have a reputation
[15:37:38] <ojacobson> not mapreduce
[15:37:39] <cheeser> 8^)=
[15:37:39] <whaley> mapreduce: implied
[15:37:42] <dreamreal> yes?
[15:37:51] <ojacobson> Sorry, confused by highlight colours.
[15:38:45] *** passwordoff has left ##java
[15:38:50] <dreamreal> tolland: I'm still a bit lost. What are you trying to do, and where?
[15:39:20] <soa2ii> TheWarrior: I just wondered what my export() function should return … an OutputStream so
[15:40:02] *** dmiles_afk has quit IRC
[15:40:15] *** stateknife has quit IRC
[15:40:34] <tolland> I have a web app where the users are stored on some other system, and at some point I need to write a UserManagerImpl to access that, but I don't have any details for that. So to make the site work I have a managed bean that is just a mock that is created in the servlet constructor
[15:40:50] *** jeukku has joined ##java
[15:41:01] <tolland> hmm i guess I haven't thought this through.
[15:41:05] <dreamreal> right. So you have a UserManager in what package?
[15:41:18] <dreamreal> There's nothing wrong so far, but you seem to think there's a piece you're missing and I don't quite see why yet
[15:41:55] <mapreduce> I'd just take the code back to IKEA and ask for the extra bit of wood.
[15:42:10] *** gremmachook has joined ##java
[15:42:10] <tolland> my app package has a UserManager that is a managed bean, but really i need it to be able to use multiple implementations
[15:42:15] <TheWarrior> soa2ii, no, not OutputStream either
[15:42:32] <TheWarrior> it should take an OutputStream as an argument, and then write the data in it
[15:43:09] *** tangatools has joined ##java
[15:43:12] <dreamreal> tolland: how would it use multiple implementations in practice?
[15:43:15] <dreamreal> A chain?
[15:43:20] <soa2ii> TheWarrior: Ahh
[15:43:31] *** perlsyntax has quit IRC
[15:43:46] <soa2ii> TheWarrior: And return nothing?
[15:43:48] *** dangertools has quit IRC
[15:43:50] *** dmiles_afk has joined ##java
[15:44:03] *** tangatools is now known as dangertools
[15:44:09] *** Evelynn has quit IRC
[15:44:26] <dreamreal> tolland: who wrote the UserManager interface?
[15:45:12] <tolland> well i want to present a UserManager facade to the clients, which are either servlets or batch processes and have the actual implemetation (which might be flat files(mock) or LDAP) selected by some logic
[15:45:30] <TheWarrior> soa2ii, it could return something else, if you like, but neither the OutputStream nor the ServletResponse
[15:45:40] <dreamreal> so why would it not be located via JNDI?
[15:45:43] <soa2ii> okej
[15:45:45] <soa2ii> Let me see
[15:46:00] <dreamreal> I mean, you're in J2EE or Java EE, which has a UserManager abstraction, why not use that?
[15:47:16] <tolland> dreamreal: ok i will take a look at that
[15:47:19] <tolland> thnx
[15:47:30] *** Soliah has quit IRC
[15:47:47] *** hexmasta has joined ##java
[15:48:15] <ader10> Is using setters and getters any less efficient than using variables with larger scope?
[15:48:20] *** Ch30ps has quit IRC
[15:48:39] <hexmasta> oh boy.
[15:48:43] <selckin> not in a way you can mesure
[15:48:57] <hexmasta> ader10: you're from perl aren't you?
[15:49:41] <dreamreal> ader10: it has a lot of implications
[15:49:54] <cheeser> it's measurably less efficient to not use getters/setters because you'll be spending more time debugging. 8^)=
[15:49:57] <dreamreal> but realistically: no, it's not less efficient to use accessors and mutators
[15:50:12] <saml> x instance of Long Vs. Long.class.isAssignableFrom(x.getClass()) what's recommended?
[15:50:19] <dreamreal> and using them also means that you're conforming to the java way of doing things
[15:50:25] <saml> x instanceof Long
[15:50:39] <dreamreal> saml: between them? instanceof, usually
[15:50:42] *** To3alt has joined ##java
[15:50:51] <ader10> I assume that you mean yes, it is less efficient, but it's not like the extra call makes much difference
[15:50:56] <dreamreal> it'll probably end up in isAssignableFrom()
[15:51:01] <saml> dreamreal, thanks.
[15:51:02] <hexmasta> dreamreal: well it's not the java way of doing things. It's being strictly confined to OO
[15:51:02] <dreamreal> ader10: no, I don't mean it's less efficient
[15:51:12] *** Kamaran has joined ##java
[15:51:13] <saml> dreamreal, so........ isAssignableFrom?
[15:51:22] <dreamreal> saml: I'd use instanceof
[15:51:36] <dreamreal> six of one, half a dozen of the other.
[15:51:40] <saml> and eventually refactor to isAssignableFrom?
[15:51:46] *** randoms has quit IRC
[15:51:58] <dreamreal> saml: jesus. Use isAssignableFrom(), please, because it's what you want to do.
[15:52:02] <Nach0z> Has anyone here worked with InstantJ?
[15:52:12] <cheeser> ~anyone
[15:52:12] <javabot> Chances are someone has, so why not just ask your question and save some time? If someone knows and wants/has time to help, perhaps he/she will.
[15:52:12] *** EuroTrash has quit IRC
[15:52:29] *** Plouj has joined ##java
[15:52:30] <Plouj> hi
[15:52:46] *** gremmachook has quit IRC
[15:53:04] <Plouj> is it possible to print to an OutputStream a1 and then send that output to an OutputStream (PrintStream) a2?
[15:53:10] <Nach0z> How do you actuall turn it on then -_-' I can't seem to get it to run correctly.
[15:53:31] <hexmasta> Nach0z: turn on?
[15:53:33] <ojacobson> Plouj: writing an OutputStream that multiplexes other output streams isn't terribly hard
[15:53:41] <ojacobson> The worst part is figuring out what to do in error cases
[15:53:44] <ojacobson> and even that's not too bad
[15:54:23] <Nach0z> lol. Yes... turn it on. Basically i'm trying to use some InstantJ stuff in my code, but the documentation seems out of date. I can't find some of the files it says should be there....
[15:54:38] <Plouj> ojacobson: I don't think multiplexing is what I'm after. What I want to do is to peek at some of the output going to the final PrintStream, parse it, but leave it going to the same PrintStream
[15:54:39] *** sz332 has quit IRC
[15:54:46] *** tempoe has left ##java
[15:55:10] <ojacobson> Plouj: So do exactly that. Write a small adapter stream that lets you monitor the output passing through it.
[15:55:32] <saml> can I have Map where .get() actually calls isAssignableFrom?
[15:55:37] <dreamreal> Nach0z: it sounds like instantj isn't, like, useful
[15:55:47] <Plouj> ojacobson: but how would I write/append the contents of my temporary OutputStream to an exiting PrintStream?
[15:56:16] <Plouj> I don't see any print(OutputStream) methods :/
[15:56:17] <Nach0z> dreamreal: Nah. it looks like exactly the thing i've been trying to find for a while lol. i just gotta find how to USE it...
[15:56:25] <Plouj> in http://download.oracle.com/javase/6/docs/api/java/io/PrintStream.html
[15:56:58] <mapreduce> saml: Sure, override get.
[15:57:26] <saml> mapreduce, i think i was confused. I think what I want is Map<Class, int>
[15:57:34] <mapreduce> Map<Class<?>, Integer>
[15:57:36] <saml> where int is used in this sytem to represent type
[15:57:37] *** perlsyntax has joined ##java
[15:57:40] <ojacobson> Plouj: public void println(String s) { tapln(s); underlying.println(s); }
[15:57:49] <mapreduce> int is used to represent type? Why would you do that?
[15:58:05] *** sbalmos has joined ##java
[15:58:11] *** EuroTrash has joined ##java
[15:58:13] <saml> can I use Map, instead of ConcurrentMap, as static final? and initialize it in static{} block?
[15:58:27] <saml> if multiple threads access the Map
[15:58:29] <dreamreal> Nach0z: hmm, I'm unable to download it.
[15:58:33] <dreamreal> saml: of course.
[15:59:03] <saml> i see. i remember some issues with having static final SimpleDateFormat
[15:59:12] <Nach0z> dreamreal: You have to select a different mirror. the default doesn't work.
[15:59:13] <saml> since SimpleDateFormat is not thread safe
[15:59:16] <Plouj> ojacobson: I don't have access to the actual string that is being printed. All I can do is access and change the OutputStream where my command logs to.
[15:59:34] <ojacobson> Plouj: I'm saying that you should replace that output stream with a proxy output stream
[15:59:42] <ojacobson> that does what you want, and also forwards all calls to the original output stream
[15:59:49] <dreamreal> Nach0z: well, in all honesty, I'm not that concerned about it, because I still don't know what the project does
[16:00:01] <ojacobson> if you can neither do that nor modify the calling code, break out your debugger and break on all method calls to the appropriate streams.
[16:00:32] <Plouj> ojacobson: oh you mean create a new class overriding the println() method
[16:00:45] <Nach0z> Hah. Dreamreal: Basically it's supposed to be able to take Java code out of a text box and compile it and run it on-the-fly
[16:01:23] <dreamreal> Nach0z: *nod* still not my thing, I guess
[16:01:46] <Nach0z> eh. s'alright. I just need to find how to use this... >_<
[16:01:48] <saml> typesMap.put(Long.class, PropertyType.LONG); typesMap.get(new Long(23L).getClass()); is this good?
[16:02:01] <saml> it works.. but it's not using instanceof or isAssignableFrom
[16:02:13] <dreamreal> why should it?
[16:02:26] <dreamreal> it seems horribly inefficient, but...
[16:02:29] <saml> ok i'll do if-else
[16:02:51] <cheeser> wtf, saml ?
[16:03:06] <ader10> The reason I asked about the efficiency of setters and getters is because I extracted a few classes in an attempt to make my code more readable, and while I have far fewer class members, it is difficult to read and type all these set and get methods so frequently.
[16:03:06] *** openpercept has quit IRC
[16:03:08] <ader10> If the jre inlines these, that's enough reason for me to keep trying this for a little while, but if it doesn't, the fewer number of class members doesn't help.
[16:03:23] <cheeser> they are not inlined, no.
[16:03:39] <saml> given java object, I need to get int that represents PropertyType
[16:03:45] <ader10> Thank you, cheeser
[16:03:50] *** glcrazy has joined ##java
[16:03:57] <dreamreal> ader10: welcome to java. And it does inline them. And plus the javabeans spec uses accessors and mutators.
[16:04:01] <saml> so, I was thinking of creating a Map that maps Class to int.
[16:04:07] <dreamreal> it'll inline them in JIT at runtime
[16:04:09] <saml> or i can do if-else
[16:04:23] <cheeser> right. the JIT might inline but the compiler will not.
[16:04:33] <ader10> this is good to know
[16:04:35] <cheeser> the javac compiler at least. P^)=
[16:04:42] <dreamreal> Ah, I see - I was thinking of the entire compilation chain, not just javac
[16:05:03] <dreamreal> I don't think of efficiency at the static compilation stage any more, thank you java
[16:05:15] <cheeser> 8^)=
[16:05:46] <ader10> What's that notation that says the data type in front of the variable called
[16:06:07] <ader10> right, Hungarian notation
[16:06:08] <sbalmos> reverse Polish / Hungarian / *JUST PLAIN UGLY*
[16:06:14] <Nach0z> lol
[16:06:25] <dreamreal> ader10: don't use that any more, really
[16:06:26] <sbalmos> oh yes, Microsoft notation
[16:06:35] *** yxz97 has joined ##java
[16:06:40] <dreamreal> most people didn't even use it right in environments in which it sort of made sense
[16:07:11] <dreamreal> in java it makes no sense whatsoever
[16:07:18] <dreamreal> just name the darn variable correctly
[16:07:18] <sbalmos> dreamreal: g_s_lpwcszMyAss
[16:07:45] *** [floyd] has joined ##java
[16:07:47] <dreamreal> sbalmos: simonyi would have rejected crap like that. hungarian was meant to embed the intent of the variable, not the raw type.
[16:07:59] <sbalmos> agreed
[16:08:11] <ader10> I think it would be easier to read and write this program with Hungarian notation to group objects instead of using these setters and getters
[16:08:14] <dreamreal> szThis <-- string, zero terminated, "this" --- wrong. "descThis" has a *chance*
[16:08:22] <dreamreal> ader10: sure, go for it.
[16:08:50] <sbalmos> ader10: just be sure to give those who read the code after you some cyanide pills
[16:08:53] <ader10> I don't think java strings are zero-terminated anyway ;>
[16:08:59] <dreamreal> They're not.
[16:09:18] <dreamreal> the point is that embedding types into names makes no sense in a strongly-typed language.
[16:09:38] <cheeser> hehe
[16:09:43] <dreamreal> in a weakly typed language, it makes no sense, because duck typing means the type is coerced to a valid type no matter what.
[16:09:46] <ader10> maybe what I'm thinking of isn't exactly Hungarian notation
[16:09:55] <dreamreal> ader10: what ARE you thinking of, then?
[16:10:02] *** eidolon has joined ##java
[16:10:32] <ader10> something like dreamreal's example
[16:10:44] <sbalmos> dreamreal: Auto-type-coercion is another fun gray area I grimace at
[16:11:00] *** Yvemath has joined ##java
[16:11:12] <dreamreal> ader10: which one?
[16:11:16] *** mitch0 has joined ##java
[16:11:19] <ader10> descThis
[16:11:34] <ader10> and everything related to that variable would be descVariable
[16:11:35] <dreamreal> ader10: objectName.getDescription() is *muuuuuch* better
[16:11:59] <dreamreal> plus all the rest of the java programmers won't point and laugh at you
[16:12:45] <dreamreal> ader10: the time for you to step up and forge a new standard would have been 1997
[16:12:53] <dreamreal> if you're counting, that's roughly 14 years ago
[16:12:54] <ader10> dreamreal: the classes I extracted all have to be able to mutate each other and my driver class is filled with getters and setters all over. Is it still preferred to use getters and setters in this situation?
[16:13:01] <dreamreal> ader10: yes.
[16:13:05] <ader10> okay
[16:13:06] <ader10> thanks
[16:13:35] <ader10> Also! Does javac include unused methods?
[16:13:49] <dreamreal> yes. how does it know the methods are unused?
[16:13:59] <[floyd]> If I'm calling a Java method 'byte[] foo()' from native code, what is the lifetime of the returned array?
[16:13:59] <whaley> all java classes must have getters and setters
[16:13:59] <dreamreal> java isn't statically compiled or linked.
[16:14:06] <whaley> else it's not idiomatic java
[16:14:10] <dreamreal> [floyd]: depends on the lifetime of the reference.
[16:14:10] <whaley> </sarcasm>
[16:14:16] <mapreduce> s/ma//
[16:14:28] <whaley> mapreduce: :P
[16:14:30] <ronr_> in XStream, when I parse an xml, I can tell it to ignore the root element?
[16:14:49] <dreamreal> yes.
[16:14:55] *** L-----D has quit IRC
[16:14:58] <cheeser> the website shows you how
[16:15:09] <[floyd]> dreamreal: So I'm fully responsible for creating and deleting a local reference from native code then?
[16:15:57] <dreamreal> [floyd]: if you allocate a valid java reference, and use it, you are responsible for its scope.
[16:16:35] *** pareidolia has joined ##java
[16:17:58] <ojacobson> [floyd]: If you didn't call NewLocalRef or NewGlobalRef, then you have no references you're responsible for
[16:18:23] <ojacobson> the one that's returned from CallObjectMethod/CallObjectNonvirtualMethod is not your problem, since you didn't allocate it
[16:18:45] <pareidolia> Hi all. Does anyone know an algorithm for distributing a certain set of objects with a size to a certain amount of "containers" so that by the size of the objects the containers are evenly filled? I have googles, but such a thing is not easy to find... Thanks!
[16:19:26] <[floyd]> dreamreal / ojacobson: I understand that. But I'm calling foo() from native code and don't understand how JNI deals with a reference that passes to native land. All the documentation considers scenarios where Java code calls into native code.
[16:19:30] <ojacobson> extensive discussion at http://download.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp16785
[16:19:44] <[floyd]> ojacobson: Oh... that clears it up for me. Thanks.
[16:20:27] <ojacobson> "Objects are passed to native methods as local references. All Java objects returned by JNI functions are local references."
[16:20:32] <ojacobson> I don't think it gets any clearer, dude.
[16:20:59] <[floyd]> ojacobson: Well, almost. If the local reference returned from CallObjectMethod is not my problem when is it released then? The native code never returns to Java land.
[16:21:08] <ojacobson> It's a local reference.
[16:21:14] <ojacobson> That section of the JNI spec expands on what that implies.
[16:21:18] <ojacobson> I'm not going to read it to you. :)
[16:21:52] *** Error404NotFound has quit IRC
[16:21:57] <ojacobson> (You're using the invocation API to embed the JVM in another program, aren't you :)
[16:22:00] <[floyd]> ojacobson: I understand that, but 'local' means it's global to native code. It won't get garbage collected until control passes through JNI back to Java.
[16:22:22] <ojacobson> Fortunately, there are functions for managing local references in the function ref
[16:22:29] <[floyd]> ojacobson: Nope, I'm not. I'm writing native code on Android.
[16:22:43] <ojacobson> Then ask the Android guys what the rules are
[16:22:44] <saml> android is java
[16:22:49] <ojacobson> #android-dev is down the hall and to the left
[16:22:59] <[floyd]> ojacobson: #android-dev is not about JNI.
[16:23:02] <saml> it's on the 2nd floor
[16:23:09] <ojacobson> Sure, but the JNI spec doesn't cover android, either.
[16:23:15] <ojacobson> Dalvik isn't quite Java.
[16:23:20] <ojacobson> (saml's actually wrong)
[16:23:24] *** jesmon has joined ##java
[16:23:33] <[floyd]> ojacobson: And Dalvik implements a full JNI. So what's the issue at hand?
[16:23:33] <saml> ojacobson is actually right
[16:24:00] <saml> [floyd], android supports jni? are you trying to run iOS apps on android using jni pipeline?
[16:24:04] <ojacobson> The issue is that you're calling into Dalvik from native code, so you should probably go somewhere that can tell you about Dalvik
[16:24:24] <[floyd]> saml: No, I'm implementing an OpenGL ES application.
[16:24:28] <dreamreal> oh lord
[16:24:34] <ojacobson> If they claim it's exactly JNI, then the JNI spec is interesting, but I wouldn't be at all surprised if there are differences
[16:24:39] <dreamreal> this is ##java, not ##dalvik
[16:24:47] <dreamreal> ~android
[16:24:47] <javabot> dreamreal, android is Google's OS based on Linux and a non-Java-bytecode Virtual Machine. See http://code.google.com/android/ . Start in #android-dev if you have questions.
[16:24:50] <ojacobson> the people most likely to be familiar with those differences are in #android-dev and android mailing lists.
[16:24:51] <saml> he asked life time of byte[]
[16:25:05] <[floyd]> ojacobson: This is *not* about Dalvik. Dalvik conforms to the JNI specs. So it is essentially JNI regardless of the underlying VM.
[16:25:10] <dreamreal> saml: yes... and the answer is "as long as the reference is in scope."
[16:25:23] <saml> even from C code?
[16:25:24] <ojacobson> No, he asked the lifetime of a reference returned from a method call to a JNI invocation. Short answer: it's a local reference, with local reference lifetime; long answer: ask the Dalvik guys, since that's your target platform.
[16:25:43] <dreamreal> but JNI is a maze of twisty passages, all alike, and I don't know (or trust) that Dalvik's JNI is identical to Java's standard, even if it's stated to be so.
[16:25:50] *** cbeust_ has joined ##java
[16:25:56] <ojacobson> Local references are automatically released when your native method returns to the VM; if you're not *in* a native method, they're never automatically released, but you can use the JNI reference management functions to manage references
[16:26:00] <cheeser> unless it passes the TCK...
[16:26:01] <saml> heed ojacobson, [floyd]
[16:26:03] <ojacobson> I can't believe you're having a hard time with this
[16:26:05] <cheeser> or JCK in this case
[16:26:14] <mapreduce> It would seem to be identical, because there's a guy trying it out who says it's shitty.
[16:26:17] <ojacobson> Basic logic: did you sleep through it
[16:26:21] <mapreduce> at work somewhere
[16:26:22] <cheeser> mapreduce: hahahaha
[16:26:32] <dreamreal> cheeser: how does it GET the TCK?
[16:26:33] <[floyd]> ojacobson: That was what I initially asked. Thanks for confirmation.
[16:27:03] <mapreduce> cheeser can FTP the TCK to a password-protected site.
[16:27:04] <cheeser> by paying us lots of money
[16:27:04] <cheeser> 8^)=
[16:27:12] <cheeser> well, actually...
[16:27:13] <cheeser> 8^)=
[16:27:34] <mapreduce> Android would fail anyway, so there's no point.
[16:27:54] <cheeser> indeed
[16:28:59] <mapreduce> I closed 214 tickets in the same time Derek's closed 24.
[16:29:03] * mapreduce chases that mythical 10x.
[16:29:29] <ader10> Almost every instruction in my driver is now a getter or setter ;_;
[16:29:47] <hexmasta> ader10: problem?
[16:29:51] <ojacobson> ~jvz--
[16:29:51] <javabot> jvz has a karma level of -1, ojacobson
[16:29:55] <ader10> it is difficult to read
[16:30:00] <ader10> no other problem, though
[16:30:06] <mapreduce> I mean Dirk, clearly. I wouldn't type his real name in IRC.
[16:30:08] <ojacobson> ader10: Perhaps some of the things that are calling getters should be moved to the classes that have the data
[16:30:09] <hexmasta> how is it difficult to read?
[16:30:35] <hexmasta> did you decide to code in Martian?
[16:30:35] <ojacobson> pervasive get/set methods are a smell: they point to unnecessary division between data and logic
[16:30:36] <ader10> ojacobson: I can't, because the classes I extracted all need to be able to mutate each other
[16:30:43] <ojacobson> well, that's not exactly good news either
[16:30:44] <ader10> well
[16:30:50] <ader10> I could, but it'd be even more ugly
[16:31:05] <mapreduce> ader10: If you control all the code, you could just make the fields public.
[16:31:20] <mapreduce> That would improve readability, but it'd still be spaghetti.
[16:31:57] <petisnnake> If I am defining my own exceptions, should I put them in a sepparate package from my main program?
[16:32:02] <ader10> yes, and everybody that's seen me use public variables tells me to just use accessors and mutators
[16:32:25] <ojacobson> That's a step, but the second step is to put logic with the data it works with
[16:32:37] <ojacobson> That's sort of the point of using an OO language in the first place
[16:32:48] *** vmnew has joined ##java
[16:33:03] <mapreduce> ader10: Is this project on github or somewhere?
[16:33:03] *** jeukku has quit IRC
[16:33:04] <ojacobson> There are plenty of techniques for sharing data among collaborating classes; have a look at, oh, the entire gang of four book
[16:33:20] <ojacobson> set/get methods are the least structured way to do it
[16:33:28] <ojacobson> second-least; they're not public fields
[16:33:51] <ader10> mapreduce: it's currently private, but it's been feature-complete for a couple days so I might put it up
[16:34:05] <ader10> this is one of the reasons I'm worrying about these variables so much right now
[16:34:42] *** Error404NotFound has joined ##java
[16:34:47] *** freeone3000 has joined ##java
[16:34:48] <mapreduce> If there's one thing you shouldn't do in programming, it's worry.
[16:35:11] <mapreduce> Doubt is fine, doubt makes you test. Worry makes you do nothing.
[16:35:18] *** ChUrP has quit IRC
[16:35:58] <vmnew> Got a constructor that receives an array - public Matrix (int[][] array) - how can I initalize it via that constructor? can I do something like - Matrix[][] a1 = { new Matrix[3][3](1, 2, 3),(4, 5, 6),(7,8,9)}; ?
[16:36:30] <saml> vmnew, no
[16:36:34] *** gelignite has joined ##java
[16:36:41] <saml> {{1,2,3}, {4,5,6}, {7,8,9}} ?
[16:36:43] <hexmasta> i wonder what's ader10 object relevance/treee
[16:38:16] <vmnew> saml: Matrix[][] a1 = new Matrix[3][3] {{1,2,3}, {4,5,6}, {7,8,9}}; ?
[16:38:32] <saml> what is Matrix?
[16:38:34] *** thezall has joined ##java
[16:38:41] <saml> paste your entire class to pastebin
[16:38:55] <ojacobson> vmnew: are you trying to make an array of matrices or are you trying to make one matrix?
[16:39:03] <ojacobson> I think you've got your wires crossed.
[16:39:47] <hexmasta> or he has a class called "Matrix
[16:40:40] *** freeone3000 has quit IRC
[16:40:48] <vmnew> 1 2d array of Matrix. That's it. This is my constructor http://java.pastebin.com/7kUTZ9jX
[16:40:49] *** Johannes13 has joined ##java
[16:41:11] <ojacobson> vmnew: Then you would create one Matrix object
[16:41:13] <ojacobson> not an array of matrices
[16:41:24] <ojacobson> so Matrix m = new Matrix(your constructor arguments here); is the first step
[16:42:05] <vmnew> ojacobson: right, but my argument is an array, how do I write that?
[16:42:19] <ojacobson> The same way you'd write it in any other context
[16:42:28] <saml> vmnew, so you are converting int[][] to a Matrix
[16:42:35] <ojacobson> saml: "converting" is a loaded term
[16:42:43] <ojacobson> I'd talk about what's actually happening, rather than higher-level mental shorthand
[16:43:38] <vmnew> so, Matrix m = new Matrix ({{1,2,3}, {4,5,6}, {7,8,9}}); ? or with int[][] ?
[16:44:31] *** Nach0z has quit IRC
[16:44:41] <saml> isn't {{1,2,3}, {4,5,6}, {7,8,9}} int[][] ?
[16:44:49] <ojacobson> only in certain magic contexts
[16:44:54] <saml> oh my you are making me write some code
[16:45:06] <ojacobson> the general form for array instance creation expressions is new T[] {a, b, c, ...}
[16:45:19] <ojacobson> new T[][] {{a, b, c}, {d, e, f}, ... }
[16:45:20] <ojacobson> and so on
[16:45:27] <saml> ah thanks
[16:45:30] *** DerHorst has joined ##java
[16:45:47] <ojacobson> You can omit the 'new T[...]' part when initializing a variable or field, but only then
[16:45:50] <ojacobson> this isn't either of those things
[16:45:55] <ExtremeDevilz> guys does Java has dictionary kinda confuse with C#?
[16:45:55] <vmnew> ok
[16:46:03] <saml> vmnew, so, it'll be final Matrix m = new Matrix(new int[][] {{1,2,3}});
[16:46:03] <ojacobson> ~~ ExtremeDevilz javadoc Map
[16:46:03] <javabot> ExtremeDevilz: http://is.gd/iNT0X [JDK: java.util.Map]
[16:46:29] *** ExtraSpice has quit IRC
[16:46:31] *** Quantum_Ion has joined ##java
[16:46:34] *** jonkri has quit IRC
[16:46:55] <Plouj> ojacobson: so I have http://fpaste.org/m7e8/, but I'm not quite sure what's a good way to actually store the hijacked bytes from the outputstream.
[16:47:11] <ojacobson> Perhaps in a ByteArrayOutputStream?
[16:47:13] *** Nach0z has joined ##java
[16:47:16] <ojacobson> (Hence my remark about multiplexing...)
[16:47:51] <saml> Plouj, make sure you close realStream
[16:47:57] *** CrimsonHat has joined ##java
[16:48:06] <saml> after you done using it
[16:48:15] <Xabster> I have several chatwindows (JFrame's) open and I want the make the one with activity "flash"
[16:48:17] <Xabster> any advice?
[16:48:22] <saml> i don't like having private final someStream
[16:48:42] <Nach0z> 'lo yall. Got yet another question for ya. I just got a bit of code that references sun.tools.java.ClassPath, but the compiler tells me that sun.tools.java doesn't exist. How do I actually get sun.tools.java? Google has been totally unfruitful in this scenario.
[16:48:58] <hexmasta> Xabster: you mean get the user's attention by flashing in start menu bar?
[16:49:02] <Plouj> saml: even if I didn't open it?
[16:49:05] <Xabster> yeah
[16:49:09] <ojacobson> saml: this is a conventional idiom for wrapper streams
[16:49:13] <ojacobson> your dislike is nonsensical
[16:49:14] <Xabster> i do, hexmasta
[16:49:20] <ojacobson> (have a look at how, for example, DataOutputStream is implemented)
[16:49:43] *** ftc has left ##java
[16:49:46] *** pipeep has quit IRC
[16:49:48] <saml> ojacobson, ah i see.
[16:50:09] <ojacobson> or BufferedOutputStream, which is probably closer to what he's doing
[16:50:21] <vmnew> ojacobson: Matrix m = new Matrix (new int[][] {{1,2,3}}); gives me an outofbound error from the constructor's last line ie - this.array[row][col] = array[row][col];
[16:50:53] <ojacobson> vmnew: You'll have to give us more than that to go on
[16:50:54] <dreamreal> vmnew: did you declare this.array?
[16:50:57] <ojacobson> most of us don't have crystal balls
[16:51:07] *** pipeep has joined ##java
[16:51:08] <dreamreal> or, rather, instantiate it
[16:51:13] *** bojo has joined ##java
[16:51:35] <ojacobson> initialize, perhaps
[16:51:46] <Plouj> ojacobson: you like: http://fpaste.org/U96s/ ?
[16:51:48] *** modernbob has quit IRC
[16:52:06] <ojacobson> Plouj: you probably want to extend FilterOutputStream, which is designed for this
[16:52:11] <vmnew> ojacobson: right, I didn't patebin that. http://java.pastebin.com/6YVjpx67
[16:52:19] <dreamreal> vmnew: you know java doesn't actually have two-dimensional arrays, right?
[16:52:23] * Plouj takes a look
[16:52:40] <vmnew> dreamreal: don't confuse me just yet :)
[16:52:56] <ojacobson> vmnew: consider using the copy methods in java.util.Arrays rather than your copy loop
[16:52:59] <ojacobson> they'll do the same thing, but correctly
[16:53:08] *** Fratyr has joined ##java
[16:53:17] <Fratyr> anyone uses NetBeans?
[16:53:20] <ojacobson> Plouj: primarily, FilterOutputStream takes care of the close() method for you
[16:53:34] <vmnew> ojacobson: not allowed, it's for a university course.
[16:53:39] <sbalmos> Fratyr: No, absolutely not, we all use tablets and chisels
[16:54:06] <dreamreal> Fratyr: I aim quarks at my cpu and flip registers that way
[16:54:08] <Fratyr> sbalmos: Hey, I need help with that, no time for sarcasm. :)
[16:54:19] <sbalmos> ~~ Fratyr anyone
[16:54:19] <javabot> Fratyr, Chances are someone has, so why not just ask your question and save some time? If someone knows and wants/has time to help, perhaps he/she will.
[16:54:25] <ExtremeDevilz> dreamreal,are you joking
[16:54:34] <Fratyr> Alright..
[16:54:35] <dreamreal> ExtremeDevilz: no.
[16:54:41] <ExtremeDevilz> <dreamreal> vmnew: you know java doesn't actually have two-dimensional arrays, right?
[16:54:54] <ojacobson> ExtremeDevilz: it has arrays of arrays
[16:54:59] <ExtremeDevilz> int [][] hello = [5][]
[16:55:01] <ojacobson> which are not the same thing (importantly, they can be jagged)
[16:55:01] <ExtremeDevilz> etc
[16:55:02] <sbalmos> dreamreal: No wonder you're off-center. It's those radiation doses when trying to aim the beam
[16:55:12] *** sebersole has joined ##java
[16:55:28] *** sebersole has quit IRC
[16:55:28] <dreamreal> ExtremeDevilz: http://www.enigmastation.com/?p=373
[16:55:56] *** bradford has joined ##java
[16:56:05] *** sebersole has joined ##java
[16:56:09] <Fratyr> (#netbeans channel is dead.. no answer there) I use the latest version of NetBeans. When editing files, It creates temporary files, f.e "index.php.0.nblh~". It screws my svn. Can I disable this? Or set another temp.files directory? :-0
[16:56:10] *** bradford- has quit IRC
[16:57:28] *** modernbob has joined ##java
[16:58:40] <mitch0> add *~ to svn:ignore
[16:58:56] <Fratyr> umm...
[16:59:15] <ojacobson> That's definitely a good idea
[16:59:16] <Plouj> ojacobson: I might be a bit rusty in terms of Java language, but how do I override the FilterOutputStream methods while keeping it's functionality (eg: calling close()) and adding my own (eg: writing to an additional stream0?
[16:59:25] <ojacobson> Plouj: by only overrwiting the three 'write' methods
[16:59:28] <ojacobson> overriding
[16:59:58] <Plouj> yeah, but how? Do I call super.write(b) at the beginning or something?
[16:59:59] <ojacobson> The underlying stream is available as a protected field, for your implementation
[17:00:02] *** Johannes13 has quit IRC
[17:00:03] <mitch0> or calling super.someMethod() from your .someMethod() when necessary
[17:00:11] <ojacobson> or you can delegate to the FilterOutputStream implementation that way
[17:00:12] <ojacobson> either way works
[17:00:18] <Plouj> what's the other way?
[17:00:21] <Plouj> I only see one way
[17:00:22] <ojacobson> doing it yourself
[17:00:27] <Fratyr> Regarding the "svn:ignore": I said svn to get rid off more questions, alright, It's a problem with folder sync that copies my local files to remote server when file changes.. so when NetBeans creates temp file, It immediately goes to remote server - and Its bad, and sync program currently has no file extension ignore
[17:00:28] <ojacobson> this.out.write(b);
[17:00:40] <ojacobson> which is all FilterOutputStream's write methods do (read the docs! it says so)
[17:00:57] <Plouj> I'm not seeing the ponit of FilterOutputStream if I essentially have to re-write its code.
[17:01:02] <ojacobson> Fratyr: rsync + --exclude-from + go home you're done
[17:01:11] <ojacobson> Plouj: You have to rewrite marginally less code
[17:01:24] <ojacobson> in particular, not close() or flush()
[17:01:24] <dreamreal> Fratyr: so... wait, let me get this straight. You asked the wrong question because you thought the right question wouldn't get answered?
[17:01:35] <Fratyr> ojacobson: I wish I could use rsync, but It's slow as hell for me... so we wrote our own sync.
[17:01:37] <Plouj> ok, let me try
[17:01:51] *** Johannes13 has joined ##java
[17:01:54] <mitch0> so add the ignore thing to it ;)
[17:02:03] <Fratyr> can do It only tomorrow :-(
[17:02:14] <Fratyr> I need to do something now xD
[17:02:34] <mitch0> find . -name '*~' -exec rm "{}" \;
[17:02:45] *** red-lichtie has quit IRC
[17:02:53] *** servo has joined ##java
[17:03:07] <Fratyr> they doesn't exists.. netbeans cleans them, but.. sync is crashing when seeing them and trying to sync, but after a second they disappear...
[17:03:13] <Fratyr> ok, nevermind, thank anyway.
[17:03:17] *** cbrock has joined ##java
[17:03:18] <Fratyr> thanks*
[17:03:24] <vmnew> ojacobson: how can I manage that error?
[17:03:36] <dreamreal> why not just use dropbox?
[17:03:56] *** dframe has quit IRC
[17:05:47] *** cappslocke has quit IRC
[17:05:50] *** pen has joined ##java
[17:05:59] <Quantum_Ion> Maybe someone can help me I was trying to creat a Java program with a splash page gif that could be used to order Pizza http://pastebin.com/TzByFNpv
[17:06:23] <Quantum_Ion> I got 23 errors so far
[17:06:42] <hexmasta> Quantum_Ion: pastebin?
[17:07:20] *** platzhirsch has joined ##java
[17:07:25] <Quantum_Ion> hexmasta, yeah -> http://pastebin.com/TzByFNpv
[17:07:47] *** platzhirsch has left ##java
[17:08:05] *** jnoos4 has joined ##java
[17:08:17] <Xabster> i dont read unindented code
[17:08:58] *** coalado has quit IRC
[17:09:19] *** coalado has joined ##java
[17:10:07] <fr0ggler> i see no errors.
[17:10:29] <Quantum_Ion> fr0ggler, it doesnt compile
[17:10:36] *** Jemt has joined ##java
[17:10:42] <fr0ggler> so, what are the compilation errors?
[17:10:49] <Quantum_Ion> 23 errors
[17:10:55] * fr0ggler walks away
[17:11:09] <fr0ggler> for future reference, "what" doesn't mean "how many"
[17:11:11] *** jabz has joined ##java
[17:11:43] <Quantum_Ion> fr0ggler, I have it down to 3 errors
[17:11:51] *** fuzzygroove has joined ##java
[17:12:09] *** fuzzygroove has left ##java
[17:12:51] <fr0ggler> Quantum_Ion, so error 1 is definitely fixed by moving line 24 to line 86. reverse the String in line 88 for error 2, and sit upside down and say "I'm an idiot" 15 times for error 3.
[17:13:05] <Quantum_Ion> lol
[17:13:21] <dreamreal> no, no, you're supposed to rot13 the error message for a klew
[17:13:24] <fr0ggler> ~~Quantum_Ion show us
[17:13:24] <javabot> Quantum_Ion, Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems.
[17:13:40] <fr0ggler> Quantum_Ion, note "(and any errors)"
[17:13:52] <Quantum_Ion> fr0ggler, I just pasted the code
[17:13:56] <Quantum_Ion> scroll back
[17:13:57] <dreamreal> but don't paste anything
[17:13:58] <cheeser> but not the errors
[17:14:00] <Quantum_Ion> SplashDemo2.java:15: illegal start of type
[17:14:01] <Quantum_Ion> new public SplashDemo() {
[17:14:03] <cheeser> so it's useless
[17:14:04] <fr0ggler> this is amazing.
[17:14:17] <dreamreal> Quantum_Ion: really? "new public SplashDemo()?"
[17:14:21] <dreamreal> You really wrote that?
[17:14:33] <dreamreal> really?
[17:14:33] <Quantum_Ion> http://pastebin.com/TzByFNpv
[17:14:35] <cheeser> format code. pastebin code and errors.
[17:14:44] <fr0ggler> Quantum_Ion, note "and errors"
[17:14:49] <dreamreal> Quantum_Ion: I see the problem
[17:14:54] <cheeser> reposting the same link over and over isn't going to help.
[17:15:04] <dreamreal> Quantum_Ion: you should go read the java tutorial, and try writing Java, if you like
[17:15:22] <dreamreal> otherwise, go back to PHP or VB or whatever rock from under which you climbed out
[17:15:37] <dreamreal> that's... sort of maybe java-like if you ignore most of the rules of java
[17:15:56] <Quantum_Ion> dreamreal, down to 1 error now I removed the word new
[17:16:00] <Quantum_Ion> SplashDemo2.java:132: reached end of file while parsing
[17:16:00] <Quantum_Ion> }
[17:16:00] <Quantum_Ion> ^
[17:16:00] <Quantum_Ion> 1 error
[17:16:03] <dreamreal> uh huh
[17:16:21] <Quantum_Ion> dreamreal, let me post new code
[17:16:28] <dreamreal> Oh, I can't prevent you
[17:16:34] *** shervin_a has quit IRC
[17:16:35] <cheeser> and format it properly
[17:16:37] <dreamreal> so asking me to let you post new code is pointless
[17:17:54] *** terranova has joined ##java
[17:18:18] *** andares has joined ##java
[17:18:28] <Quantum_Ion> dreamreal, new code -> http://fpaste.org/Kroc/
[17:18:51] <dreamreal> still well-formatted too
[17:19:06] <dreamreal> and still no errors! And still stupid java!
[17:19:16] <Quantum_Ion> dreamreal, javac keeps telling me there is a problem with line 132
[17:19:28] <dreamreal> *sigh*
[17:19:32] <fr0ggler> Quantum_Ion, if you indented your code properly, you'd most likely see the problem. actually, scratch that.
[17:19:38] <dreamreal> and... Frame.
[17:20:07] <Quantum_Ion> dreamreal, this is the error -> SplashDemo2.java:132: reached end of file while parsing
[17:20:07] <Quantum_Ion> }
[17:20:07] <Quantum_Ion> ^
[17:20:07] <Quantum_Ion> 1 error
[17:20:14] <fr0ggler> :|
[17:20:21] <Quantum_Ion> ?
[17:21:04] <Quantum_Ion> let me see if I can fix that error
[17:21:09] <fr0ggler> good idea.
[17:21:19] *** juanez has quit IRC
[17:21:27] *** andares has quit IRC
[17:22:09] *** CrimsonHat has left ##java
[17:22:26] <dreamreal> let's see. two constructors with the same signature. Check!
[17:22:37] <dreamreal> use of JFrame methods in a class extending Frame. Check.
[17:22:54] <dreamreal> Duplication of actionPerformed (including signature) in the same class. Check!
[17:23:05] <dreamreal> inner class with static declaration. Check!
[17:23:13] <dreamreal> Boy.
[17:23:25] <Quantum_Ion> dreamreal, Can you fix it for me
[17:23:29] <dreamreal> Quantum_Ion: i see the problem, but i can't tell you what it is.
[17:23:49] *** SeyZ has joined ##java
[17:23:53] <cheeser> stattic inner classes are fine
[17:23:58] *** SeyZ has left ##java
[17:23:59] *** teralaser has quit IRC
[17:24:00] *** DerHorst has quit IRC
[17:24:05] <dreamreal> cheeser: not with a static method in it
[17:24:08] <fr0ggler> Quantum_Ion, you have a nice list of problems with your code. asking someone to fix it for you is just plain damn lazy.
[17:24:09] <cheeser> ah. yeah.
[17:24:22] <Quantum_Ion> lol
[17:24:38] <cheeser> fr0ggler: especially when he systematically ignores all requests/advice
[17:24:51] <fr0ggler> cheeser, it's actually admirable. he'd do well in management.
[17:24:54] <dreamreal> Quantum_Ion: to be specific, I can't tell you what the problem is because I decided a while back to be nice/kind on ##java. To tell you what the problem is would violate that.
[17:25:36] *** tigger0jk has quit IRC
[17:25:36] <dreamreal> I've pointed out the problems to fix (thanks to a handy... compiler.) If you can't fix them, perhaps Darwin is suggesting that there are other fields of endeavor in which you would excel.
[17:25:47] <Quantum_Ion> dreamreal, Where are the real java experts, when you need them ?
[17:25:53] *** tigger0jk has joined ##java
[17:25:58] <dreamreal> Quantum_Ion: in your case? Looking at your code in horror.
[17:26:07] <fr0ggler> i was sick in my lap.
[17:26:14] <fr0ggler> i would help but i have to clean up.
[17:26:20] <whaley> Quantum_Ion: working
[17:26:26] <cheeser> Quantum_Ion: does the phrase "pearls before swine" mean anything to you?
[17:26:36] <Quantum_Ion> cheeser, lol
[17:27:22] <Quantum_Ion> I have to come up with a solution to this problem within a week or so
[17:27:24] <dreamreal> Quantum_Ion: i could be wrong, but I think you're the swine in the expression, not the pearl
[17:27:31] <dreamreal> you have a whole week?
[17:27:33] <dreamreal> holy cow
[17:27:34] <fr0ggler> Quantum_Ion, well you have a week or so to work on it. off you go.
[17:27:35] <Quantum_Ion> yup
[17:27:41] *** jnoos4 has quit IRC
[17:27:42] <dreamreal> with any brains at all, this would take five minutes at most
[17:27:48] <dreamreal> with a four minute break
[17:28:19] <dreamreal> I think you're falling prey to the trap of low expectations
[17:28:25] <Quantum_Ion> first I have to get a splash.gif to show then I have to produce a menu to order pizza
[17:28:42] <fr0ggler> Quantum_Ion, how about you learn how to fix compilation errors first?
[17:28:59] <fr0ggler> you know. programming.
[17:29:41] <ojacobson> ~splash screens
[17:29:41] <javabot> ojacobson, I have no idea what splash screens is.
[17:29:42] <ojacobson> ~splash screen
[17:29:42] <javabot> ojacobson, I have no idea what splash screen is.
[17:29:45] <ojacobson> well now
[17:29:57] <Quantum_Ion> splash screen gif
[17:30:04] *** AMcBain has joined ##java
[17:30:05] <fr0ggler> try it!
[17:30:17] <Quantum_Ion> every program has to have a splash screen gif you know that right
[17:30:21] <ojacobson> ~splash screen is -splash: or SplashScreen-Image. See http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/splashscreen/ for details.
[17:30:21] <javabot> OK, ojacobson.
[17:30:25] <ojacobson> ~splash is <see>splash screen
[17:30:26] <javabot> OK, ojacobson.
[17:30:30] <ojacobson> ~splash screens is <see>splash screen
[17:30:30] <javabot> OK, ojacobson.
[17:31:06] *** BeholdMyGlory has joined ##java
[17:31:11] *** bduncan has joined ##java
[17:31:19] <ojacobson> Quantum_Ion: ^ is relevant to your interests
[17:31:34] *** mazzachre has quit IRC
[17:31:50] *** rubydiamond has left ##java
[17:31:52] <Quantum_Ion> I think I have to print this code out on paper and work through it line by line
[17:32:00] <dreamreal> Quantum_Ion: wait... it has to be a gif?
[17:32:04] *** pschriner has quit IRC
[17:32:10] <dreamreal> A splash screen can't be a BMP, or a PNG?
[17:32:13] *** jabz has quit IRC
[17:32:19] <Quantum_Ion> dreamreal, Yes because you can make animations with .gifs
[17:32:21] *** arborist has quit IRC
[17:32:25] *** ftc has joined ##java
[17:32:36] <dreamreal> ohhhh. And you can't with anything else. And animations are crucial. Gotcha.
[17:33:03] <fr0ggler> Quantum_Ion, may I suggest you sellotape a pre-existing fast food menu to your screen?
[17:33:06] <Quantum_Ion> dreamreal, Right, the opening splash page in a java program most likely will be an animated .gif it just looks nicer
[17:33:20] * dreamreal is trying hard but failing
[17:33:25] <dreamreal> sorry about that.
[17:34:04] *** jabz has joined ##java
[17:34:37] *** cafesofie has quit IRC
[17:34:44] <Quantum_Ion> I would use this command to display my animated .gif java -splash:images/splash.gif SplashDemo
[17:34:53] *** solars has quit IRC
[17:35:16] <Quantum_Ion> then make a MANIFEST.MF file and wrap it up into a .jar
[17:35:18] *** eitch0000 has quit IRC
[17:35:19] <cheeser> dude. stop worrying about the fucking until you get your app working.
[17:35:28] <Quantum_Ion> and distribute to my audience
[17:35:31] <cheeser> make it work. then make it shiny.
[17:35:48] <Quantum_Ion> cheeser, That is what I am trying to do
[17:35:54] <cheeser> then stop talking about the gif
[17:36:46] <Quantum_Ion> sigh
[17:37:12] <dreamreal> cheeser: maybe his app is a "display this gif as a splash screen" application.
[17:37:18] <dreamreal> It displays the gif, then shuts down.
[17:37:20] <cheeser> could be.
[17:37:36] *** Peste_Bubonica has quit IRC
[17:38:08] <Quantum_Ion> dreamreal, No no no what happens is I can make the .gif appear as a splash screen but I cannot get the menu to order pizza appear
[17:38:25] <dreamreal> Quantum_Ion: oh. fail.
[17:38:31] <Quantum_Ion> bingo
[17:39:09] *** waz has quit IRC
[17:39:42] *** nphase_ has joined ##java
[17:40:02] <Quantum_Ion> dreamreal, This is the original code I am working off of - >http://download.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html
[17:40:08] <dreamreal> I don't care, man
[17:40:24] <dreamreal> you've clearly gone off the reservation, and I am sorry, but I have no motivation to help you
[17:40:33] *** sebrock has quit IRC
[17:40:37] *** tjsnell has joined ##java
[17:40:56] <fr0ggler> Quantum_Ion, slow down for one second and listen. you need to fix the code that you pasted up. you've been told what's wrong with it. no-one is going to do this for you.
[17:41:02] <Quantum_Ion> dreamreal, That is fine I will find a way to come up with a solution
[17:41:02] <nphase_> "java.lang.NoClassDefFoundError: javax/mail/MessagingException"
[17:41:10] <nphase_> where exactly do i have to put the mail.jar for that to go away?
[17:41:17] <fr0ggler> ~~nphase_ classpath
[17:41:17] <javabot> nphase_, The classpath tells Java or the compiler in which jar files and folders to look for classes and resources. Use the -cp/-classpath run-time options to specify the classpath (does NOT work with -jar!). Also see http://is.gd/j4gM [sun.com] for more info. If you're on windows see: http://is.gd/9qq26 [sun.com].
[17:41:18] <joed> On your classpath
[17:41:24] *** joed sets mode: -o joed
[17:42:36] *** Quantum_Ion has quit IRC
[17:43:06] *** Evet has joined ##java
[17:43:37] *** AMcBain has quit IRC
[17:43:47] *** Peste_Bubonica has joined ##java
[17:44:26] <nphase_> how do i find where the classpath is?
[17:44:36] <sbalmos> One of these days, we need to ask Quantum_Ion how his "Installing Java on Linux for n00bs" is coming.
[17:44:41] <nphase_> :)_
[17:44:50] <ojacobson> nphase_: you set it.
[17:44:52] <ojacobson> See link.
[17:44:54] <ojacobson> links.
[17:44:55] <hexmasta> well most noobs have ubuntu right?
[17:44:55] <sbalmos> nphase_: It isn't anywhere, you define it
[17:45:02] <hexmasta> can't they just apt-get java?
[17:45:05] <nphase_> ojacobson: but what if i dont want to set it. im guessing its already set yes?
[17:45:08] <ojacobson> There's no system-wide library directory in Java.
[17:45:10] <sbalmos> no
[17:45:13] <nphase_> ahh
[17:45:13] <ojacobson> You always set one.
[17:45:15] <sbalmos> you must set it
[17:45:22] *** cmxiv has quit IRC
[17:45:26] <ojacobson> (That's not strictly true, but there are good reasons nobody uses the system-wide one)
[17:45:50] <nphase_> got it.
[17:46:02] <sbalmos> ojacobson: Let's not go there. Especially with how Quicktime on Windows' installer overwrites the system-wide one.
[17:46:12] *** wlfshmn has joined ##java
[17:46:25] *** Nach0z has quit IRC
[17:48:16] <ojacobson> gnnngh.
[17:48:58] *** aLeSD has quit IRC
[17:49:06] *** sebersole has quit IRC
[17:49:32] <nphase_> the directions im following say
[17:49:34] <nphase_> Move ( not copy! ) the activation and mail jar files from the /WEB-INF/lib folder to the /common/lib (Tomcat 5.5) or /lib (Tomcat 6) folder.
[17:49:40] <nphase_> but i moved them to /lib, didnt work
[17:49:46] <nphase_> moved them to the tomcat6 lib folder, also didnt work
[17:49:49] *** km has joined ##java
[17:49:52] <dreamreal> heh
[17:49:53] <ojacobson> /lib in this case refers to TOMCAT_HOME/lib
[17:49:55] <dreamreal> so... much fail
[17:50:03] <ojacobson> not the directory literally named /lib
[17:50:15] <nphase_> ojacobson: "moved them to the tomcat6 lib folder, also didnt work"
[17:50:24] <sbalmos> and you restarted Tomcat... ?
[17:50:33] <ojacobson> I believe the tomcat docs discuss how to set up javamail
[17:50:37] <nphase_> its built in with jira
[17:50:39] <ojacobson> http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#JavaMail_Sessions
[17:50:48] <ojacobson> Also, Atlassian provides really good support
[17:50:55] <ojacobson> if you're using JIRA you're going to be paying for it, so get them to help
[17:52:01] *** pareidolia has quit IRC
[17:52:36] <fr0ggler> ojacobson, if you're working on open source and can prove it, JIRA's free
[17:52:42] *** Deeewayne has joined ##java
[17:52:44] <ojacobson> True! I'd forgotten about that.
[17:52:45] <fr0ggler> but their support is still available of course
[17:53:19] <ronr_> gotta love javadocs that are empty. very useful: http://xstream.codehaus.org/javadoc/index.html?com/thoughtworks/xstream/converters/UnmarshallingContext.html
[17:53:20] *** erikhh has quit IRC
[17:53:49] *** jabz has quit IRC
[17:55:24] *** rlubke has joined ##java
[17:56:45] <yxz97> Hello
[17:56:48] *** yxz97 has quit IRC
[17:56:56] *** servo has quit IRC
[17:57:45] *** ExtremeDevilz has quit IRC
[17:58:48] *** chasha has joined ##java
[18:00:53] *** cafesofie has joined ##java
[18:00:53] *** JaVaSan has joined ##java
[18:01:04] <JaVaSan> Hi, I have a doubt about JPA. How to get this "@Id @GeneratedValue(strategy=GenerationType.AUTO)" in the XML mapping file?
[18:01:45] <cheeser> why would you want to?
[18:01:56] *** Punker has quit IRC
[18:03:29] *** meling has quit IRC
[18:03:41] *** TheWarrior has quit IRC
[18:03:43] <JaVaSan> cheeser: the mapping must be done in the XML.
[18:04:02] <cheeser> um. not really.
[18:04:06] <cheeser> annotations++
[18:04:17] <joed> Must schmust.
[18:04:18] <cheeser> who/what is saying it must be?
[18:05:18] <JaVaSan> cheeser: this is a requirement from the specification
[18:05:35] <ojacobson> I'm fairly sure all of the annotations have XML equivalents, but you'd have to look in the JPA spec/docs/XSDs
[18:05:40] <ojacobson> (that being where I'd look)
[18:05:43] <dreamreal> JaVaSan: it's not required in the XML
[18:05:52] <dreamreal> but you can in fact get it in the XML
[18:06:55] <joed> It is not a requirement, you can use XML.
[18:07:30] *** Willy has joined ##java
[18:07:39] <dreamreal> javabot: <entity-mappings><entity class="javasan.EntityClass" access="PROPERTY"><attributes><id name="id"><generated-value strategy="AUTO"></id>...</attributes></entity>...
[18:07:39] <javabot> dreamreal, I have no idea what <entity-mappings><entity class="javasan.EntityClass" access="PROPERTY"><attributes><id name="id"><generated-value strategy="AUTO"></id>...</attributes></entity>... is.
[18:07:44] <dreamreal> damn it
[18:07:49] <dreamreal> javasan: <entity-mappings><entity class="javasan.EntityClass" access="PROPERTY"><attributes><id name="id"><generated-value strategy="AUTO"></id>...</attributes></entity>...
[18:08:21] *** tizbac has quit IRC
[18:08:24] <JaVaSan> joed: by requirement from the specification I meant the specification of the component I'm developing.
[18:10:04] <joed> Great!
[18:10:07] <sbalmos> lovely
[18:10:41] <sbalmos> I know there are cases where people prefer XML over annotations... Though I'm still trying to find them.
[18:11:06] <JaVaSan> dreamreal: let me try <generated-value strategy="AUTO">
[18:11:39] <cheeser> JaVaSan: what specification would that be? because JPA *clearly* allows annotation only configuration.
[18:12:57] *** Ivellina has joined ##java
[18:13:21] <JaVaSan> cheeser: like I said to joed, by specification I meant the specification of the component I'm developing. I would use annotation if I could.
[18:13:43] <cheeser> why would you spec it that way?
[18:13:51] <cheeser> you *like* living in the stone age?
[18:14:25] *** andylockran has left ##java
[18:14:25] <JaVaSan> dreamreal: it worked, thank you.
[18:14:29] <cheeser> anyway, time for lunch
[18:14:59] <JaVaSan> cheeser: I don't, the one who did the spec maybe.
[18:16:19] <dreamreal> nothing wrong with XML configuration of entities, it's one way to prevent JPA from polluting your object model
[18:17:32] <sbalmos> dreamreal: It's a tightly-coupled pairing, and is just one more file for one to edit should a change be needed
[18:17:42] <dreamreal> sbalmos: in my case, it's not.
[18:17:46] *** jabz has joined ##java
[18:17:55] <sbalmos> meh
[18:18:06] <dreamreal> I have an app for which the entities can be modeled in multiple datastores, and I don't want the object model to have a dependency on the datastores.
[18:18:14] <dreamreal> One datastore is JPA, another is $employer, etc. etc. etc.
[18:21:29] <dreamreal> "XML is bad" is a crutch for people who ... just... I dunno, it's a crutch. It has its uses. Shhh.
[18:21:38] <sbalmos> ...
[18:22:43] *** coalado has quit IRC
[18:23:05] *** coalado has joined ##java
[18:24:30] <cbeust_> My rule of thumb is: if you are trying to decorate a Java element (package, class, method, field, parameter), an annotation is usually better. For the rest, XML is good.
[18:24:36] *** mah01 has quit IRC
[18:24:43] *** meling has joined ##java
[18:25:06] *** Nach0z has joined ##java
[18:25:12] <cbeust_> To be more accurate, I should say "an external file is good", but XML is the standard so...
[18:25:28] *** teralaser has joined ##java
[18:25:29] *** iik has quit IRC
[18:25:31] <eidolon> hey anyone using ActiveMQ? they're using Kahadb, and say "You should use this, it's awesome we love it" - but we're having consistent KahaDB corruption and trashed installs. I'm considering shunting it to using MySQL - but would like suggestions.
[18:25:54] *** odinsbane has joined ##java
[18:26:00] *** Bombstone has joined ##java
[18:26:02] <dreamreal> cbeust: so are JPA annotations decorations of java elements?
[18:28:22] <JaVaSan> dreamreal: do you know if in order to the auto-generation to work, the id must be a non-primitive value (if it is a primitive value it will always have a value assigned to it: the default one)?
[18:29:44] <lahwran> http://www.eclipse.org/swt/ <<< sweeeeeeet
[18:30:01] <dreamreal> JaVaSan: I do not.
[18:30:04] <dreamreal> lahwran: ugh.
[18:30:13] <lahwran> "ugh"?
[18:30:20] <cbeust_> An SWT fan!
[18:30:27] <lahwran> uh, no, not a fan, I just found it
[18:30:39] *** fr0ggler has quit IRC
[18:31:02] *** ZorbaBudha has left ##java
[18:31:05] *** unperson has joined ##java
[18:31:06] <eidolon> er. you know SWT is like 7 years old, right?
[18:31:09] <eidolon> eclipse is written using it?
[18:31:26] <lahwran> wanted to know why eclipse looked native, found my answer :|
[18:31:43] *** ventsislav has joined ##java
[18:31:59] *** chasha has quit IRC
[18:32:13] <lahwran> I googled "eclipse's gui library" and this was the first result ..
[18:32:15] <dreamreal> lahwran: well, you found the literal explanation, yes.
[18:32:23] *** chasha has joined ##java
[18:32:31] <cbeust_> Indeed, Eclipse is written with SWT+JFace
[18:32:33] <dreamreal> cbeust_: so is JPA decoration of java elements? XML isn't appropriate?
[18:32:50] <lahwran> so is there a 'better' alternative?
[18:32:57] <dreamreal> Swing.
[18:33:05] <lahwran> swing looks disgusting
[18:33:05] <dreamreal> Swing can look native, too.
[18:33:10] <dreamreal> Oh. I see.
[18:33:14] <cbeust_> lahwran: Swing comes with the JDK but it's pretty much its only advantage over SWT :)
[18:33:27] <lahwran> dreamreal: can it?
[18:33:33] <dreamreal> yes.
[18:33:41] <JaVaSan> dreamreal: It almost worked, it seems the auto-generation of the ID is not working properly: http://codepaste.net/v895gd
[18:33:54] <dreamreal> JaVaSan: bummer.
[18:34:03] <joed> ~life
[18:34:03] <javabot> don't talk to me about life.
[18:34:06] *** bn` has quit IRC
[18:34:10] <Nach0z> lol
[18:34:14] *** hanstech has quit IRC
[18:34:39] <eidolon> ummm
[18:34:44] <dreamreal> JaVaSan: the hibernate channel may have more information about that. I do not. (I'm not a JPA user, normally.)
[18:34:45] <eidolon> lahwran, you have no clue what you're talking about
[18:34:49] <odinsbane> I don't find swing to look so bad. Nearly everything about it is customizeable. Plus the look and feel settings can change the appearance quite a bit.
[18:34:51] <lahwran> apparently not
[18:34:51] <eidolon> there's virtually no reason to use SWT anymore
[18:35:02] <JaVaSan> /j #hibernate
[18:35:26] <cbeust_> eidolon: you're kidding, there is a lot of development happening in the SWT space, if only around the Eclipse RCP space
[18:35:27] <eidolon> SWT was written to fix problems with AWT-rooted swing components 7-8years ago, and perforrmane problems therein. Since then, swing has improved DRAMATICALLY
[18:35:46] * ojacobson gets the popcorn.
[18:35:46] <cbeust_> eidolon: doesn't matter, people have been turned off Swing. It takes too much effort to get something decent
[18:35:57] <eidolon> cbeust - perhaps, but the argument "Swing is ugly, Use SWT!" or "Swing is slow, Use SWT!" went out the window half a decade ago
[18:35:57] <ojacobson> Normally, I have a lot to say about this, but I'd rather watch cbeust fanboy himself to death
[18:36:02] <JaVaSan> dreamreal: great, didn't realize I was java channel, ty.
[18:36:03] <dreamreal> yeah, that's the argument for Spring, too
[18:36:26] <dreamreal> people got turned off from J2EE, but instead of someone saying "why not try using it correctly?" they went to an external dependency.
[18:36:35] <eidolon> so, your argument to not use Swing is that people have been turned off by it?
[18:36:46] <dreamreal> So I'm all for SWT! Why not repeat the stupidities of the past?!
[18:36:51] <eidolon> nt that it's better or worse, or that it's good or bad, but that... it's not politically correct?
[18:36:59] <cbeust_> eidolon: No, people move away from Swing because of all the problems that it has, even today
[18:37:04] *** Gracenotes has quit IRC
[18:37:10] <dreamreal> cbeust_: and SWT has none of those problems, true
[18:37:24] <eidolon> the problems like performance, look and feel, and native support? You mean all the problems that have been fixed?
[18:37:35] <dreamreal> I typed random stuff on my keyboard, and a SWT gui, clean and pure, popped out
[18:37:49] <joed> Oh, you made eclipse?
[18:37:51] <eidolon> wasn't there a dilbert cartoon like that?
[18:38:00] <cbeust_> Some of these problems include poor native integration (the infamous file dialog problem), layout managers with terrible defaults and in general, the fact that it takes experts to get good UI. And of course, the fact that the Swing team has been gutted and moved to JavaFX
[18:38:04] <eidolon> joed: Azureus.
[18:38:31] <eidolon> ~azureus
[18:38:32] <javabot> eidolon, azureus is the other SWT app.
[18:38:35] * eidolon cackles.
[18:38:45] <dreamreal> cbeust_: It takes experts to get a good UI no matter what widget layer you use. It's pointless to blame Swing for GUIs not being an innate skill for developers; GUIs are hard.
[18:38:48] <dreamreal> Barbie doesn't lie.
[18:38:56] <dreamreal> ~barbie GUI development
[18:38:56] <javabot> <barbie>GUI development is hard!</barbie>
[18:39:31] * eidolon got dope-slapped about CSS / HTML ui design recently. was reminded I suck at it, and bought someone elses CSS theme. Saved me months of trying to write a decent UI. Let someone else do it.
[18:39:38] *** iik has joined ##java
[18:39:46] <dreamreal> I was going to curse a few times, and misspell, and use poor grammar too, just to keep my couthness down, but failed miserably. I'm such a failure.
[18:39:50] <dreamreal> Must be my homeschooling.
[18:43:24] *** shodan45 has joined ##java
[18:43:44] *** Patt has joined ##java
[18:44:42] <hexmasta> ~barbie 1+1
[18:44:42] <javabot> <barbie>1+1 is hard!</barbie>
[18:44:46] *** TheWarrior has joined ##java
[18:44:58] *** Prezioso has joined ##java
[18:44:59] <hexmasta> ~barbie my dick
[18:45:00] <javabot> <barbie>my dick is hard!</barbie>
[18:45:04] <hexmasta> >_>
[18:45:06] *** hexmasta was kicked by cheeser (hexmasta)
[18:45:13] <whaley> ~barbie showing restraint
[18:45:14] <javabot> <barbie>showing restraint is hard!</barbie>
[18:45:14] *** hexmasta has joined ##java
[18:45:21] <hexmasta> sorry
[18:45:21] <joed> ~barbie whaley
[18:45:21] <javabot> <barbie>whaley is hard!</barbie>
[18:45:30] <shodan45> o_O
[18:45:34] <whaley> ...
[18:45:50] *** Punker has joined ##java
[18:45:53] <dreamreal> you guys must be homeschooled, or not watch enough TV. :)
[18:45:58] <hexmasta> ~killing creepers
[18:45:59] <javabot> hexmasta, I have no idea what killing creepers is.
[18:46:02] <hexmasta> ~barbie killing creepers
[18:46:03] <javabot> <barbie>killing creepers is hard!</barbie>
[18:46:08] *** cheeser sets mode: +b hexmasta!*@*
[18:46:12] <eidolon> heh
[18:46:13] <Sniffy> lol
[18:46:18] *** hanstech has joined ##java
[18:46:33] *** epure_ has joined ##java
[18:46:34] <eidolon> there's an 8 year old kid here who does that. "STOP DOING THAT!" "Sorry!" *keeps doing it*
[18:46:42] *** gentunian has joined ##java
[18:47:02] <joed> Clearly not homeschooled.
[18:47:14] <eidolon> actually he is.
[18:47:28] <joed> Then you let him watch too much tv.
[18:47:35] <eidolon> dude, not my kid. :)
[18:47:38] <joed> :)
[18:47:42] <shodan45> "eidolon", like from farscape?
[18:47:58] <ojacobson> shodan45: it's a perfectly normal English word
[18:47:59] * eidolon makes a chalk mark under 'farscape'.
[18:48:16] <tolland> if i had some function that either suceeded or failed, like login, and threw an exception is there any value in returning Boolean or should i just have a void method?
[18:48:17] <eidolon> i'm going to write a book on how many people think this nick is TOTALLY from their little geek corner of the world.
[18:48:28] <dreamreal> It's from a lucasarts game from the 80s, of course
[18:48:36] * eidolon makes another mark.
[18:48:46] *** Prezioso has quit IRC
[18:48:51] *** deSilva has joined ##java
[18:49:00] <cheeser> clearly it's named after a boutique store here in brooklyn. i walk by it once a week.
[18:49:06] *** youdonotexist has joined ##java
[18:49:14] <eidolon> [12:44] -hexmasta- DCC Chat (172.16.11.25)
[18:49:14] <eidolon> [12:44] * Received a DCC CHAT offer from hexmasta
[18:49:24] <eidolon> why is this idiot still here?
[18:49:34] <ojacobson> We're not going to ban him for stuff that's not happening in channe;
[18:49:39] <cheeser> i can't do anything about that one.
[18:49:46] <cheeser> i'dhave to be a net op.
[18:49:47] <ojacobson> Your ignore list presumably works :)
[18:49:57] <dreamreal> ojacobson: he ignored the ignore command :/
[18:50:00] <eidolon> nah, i'd rather whine about it publically.
[18:50:07] <dreamreal> publicly
[18:50:21] <LtHummus> eidolon = game store near me
[18:50:33] <eidolon> dreamreal, http://www.merriam-webster.com/dictionary/publically
[18:50:41] <joed> An eidolon eidolon
[18:50:47] <dreamreal> well, blow me down and call me Susan!
[18:50:56] <dreamreal> thanks, eidolon
[18:50:57] <cheeser> go go homeschooling
[18:50:57] <cheeser> 8^)=
[18:51:10] <dcope> double firstResult = (-1.0 * b) + Math.sqrt((b * 2.0) - (4.0 * a * c)) / (2.0 * a);
[18:51:12] <cbeust_> FWIW, hexmasta's latest attempt at being clever was probably a Minecraft reference
[18:51:14] <eidolon> also, http://www.merriam-webster.com/dictionary/eidolon
[18:51:14] <dcope> Why is that returning NaN?
[18:51:16] <dreamreal> if only I'd have been homeschooled. I'd have had teachers four times as smart as the ones I had.
[18:51:20] <dcope> a, b, and c are all doubels
[18:51:22] <dcope> doubles*
[18:51:22] <eidolon> cbeust: duh. :)
[18:51:25] <ojacobson> dcope: b * 2.0 is not b squared
[18:51:39] <ojacobson> and because your descriminant is less than zero
[18:51:45] <ojacobson> gb2math class
[18:52:02] <cheeser> cbeust_: that makes it doubly offensive
[18:52:03] <cheeser> 8^)=
[18:52:06] <dcope> ojacobson: thanks
[18:52:17] *** dcope has left ##java
[18:52:21] <cbeust_> Well, he does have a point, creepers are hard to kill
[18:52:24] *** Dux has quit IRC
[18:52:56] <eidolon> minecraft: doing more to show people java + gl can create something profitable than any other app in the last 10 years.
[18:52:57] <shodan45> farscape eidolon -> http://www.sadgeezer.com/Legacy/html/uploads/preop.JPG
[18:53:24] <cbeust_> And since Minecraft is written in Java, you could even argue that it's on topic
[18:53:38] <cheeser> one could argue that and still be wrong.
[18:53:39] <cheeser> 8^)=
[18:53:48] <lahwran> eidolon: don't decompile it, it's the shittiest code I've seen in as long
[18:53:53] <eidolon> just because you CAN doens't mean you SHOULD.
[18:53:59] *** bojo has quit IRC
[18:54:00] <shodan45> isn't minecraft an.... APPLET?!
[18:54:02] <cbeust_> lahwran: well, it's obfuscated, so... doh
[18:54:08] <eidolon> shodan45, no.
[18:54:09] <whaley> speaking of games that end in "craft"...
[18:54:09] <ojacobson> cbeust_: You're welcome to argue that
[18:54:10] *** melignus has joined ##java
[18:54:13] <lahwran> cbeust_: for(int i=0; i<1; i++)
[18:54:15] <whaley> time to go play the superior one
[18:54:21] *** ChanServ sets mode: +o ojacobson
[18:54:21] <ojacobson> I'm just going to disagree with you. Forcefully.
[18:54:22] <lahwran> cbeust_: if(h || !h)
[18:54:49] *** gremmachook has joined ##java
[18:55:22] *** Dux has joined ##java
[18:55:29] *** kaydsoft has quit IRC
[18:57:18] *** kaydsoft has joined ##java
[18:57:46] *** Kamaran has quit IRC
[18:58:23] *** starcoder has quit IRC
[19:01:07] *** starcoder has joined ##java
[19:02:24] *** jquerier has joined ##java
[19:03:01] *** coalado has quit IRC
[19:03:43] *** kerrick has joined ##java
[19:03:46] <jquerier> Hello is there a good way to connect to a VNC Server from a from a webbrowser which runs windows xampp?
[19:03:50] *** kerrick has left ##java
[19:04:05] <sproingie> use the vnc applet
[19:04:55] *** Yvemath has quit IRC
[19:05:45] *** Yvemath has joined ##java
[19:06:49] *** irufus has joined ##java
[19:07:35] *** bjornju has quit IRC
[19:08:44] *** xttocs has joined ##java
[19:08:46] *** LouisJB has quit IRC
[19:08:46] *** poindontcare has quit IRC
[19:09:27] *** hexmasta has left ##java
[19:10:26] *** jesmon has quit IRC
[19:10:51] *** Gracenotes has joined ##java
[19:13:16] *** youdonotexist has quit IRC
[19:13:29] *** futureleader has joined ##java
[19:13:39] *** jquerier has quit IRC
[19:13:59] *** youdonotexist has joined ##java
[19:14:19] *** poindontcare has joined ##java
[19:14:23] *** youdonotexist_ has joined ##java
[19:15:22] *** wolfman2000 has joined ##java
[19:17:51] *** Engin has joined ##java
[19:17:59] *** TheSchoolinator has joined ##java
[19:18:21] *** youdonotexist has quit IRC
[19:18:22] *** youdonotexist_ is now known as youdonotexist
[19:20:34] <shodan45> ermmm... is javac supposed to not complain if you pass it crap for -cp? (javac -cp idontexist.jar;meneither.jar foo/bar/baz.java)
[19:21:04] <petisnnake> can I check what a generic type T is being set to(String, Integer etc)?
[19:21:22] <ernimril> petisnnake: no
[19:21:38] *** ^man_pld has joined ##java
[19:21:59] <petisnnake> ty
[19:23:13] *** IsmAvatar has joined ##java
[19:23:27] *** ugoubuntu has quit IRC
[19:23:36] *** unperson has quit IRC
[19:23:52] *** AqD has joined ##java
[19:24:02] <futureleader> when I inherit from a superclass, i understand that I inherit the variables, but do i inherit the values too???
[19:24:53] <IsmAvatar> Hey guys, I need help with Drag and Drop on a customized JList. How do I tell if the transfer is a COPY or a MOVE? I need to know because COPY is essentially doing a LINK instead of cloning...
[19:24:54] <irufus> futureleader: you mean constants/
[19:25:41] <futureleader> yes sorry the constants
[19:29:06] <IsmAvatar> futureleader: yes, constants (e.g. public/protected/blank static final) are inherited with the same value.
[19:31:03] <IsmAvatar> unless you make your own field with the same name.
[19:31:17] <irufus> which final prevents
[19:31:20] <IsmAvatar> yes
[19:32:39] *** ioss has joined ##java
[19:33:01] <cheeser> static members are not inherited.
[19:33:06] <wyvern`> final does not prevent you from shadowing a constant
[19:34:09] *** ioss has left ##java
[19:34:32] <sproingie> static final means immutable, no?
[19:34:35] *** Kraln has quit IRC
[19:34:43] <wyvern`> sproingie, assuming hte value itself is immutable, yes
[19:34:52] <wyvern`> static final int[] foo is not immutable
[19:35:08] <sproingie> but foo can't be rebound to a different array, right?
[19:35:12] <wyvern`> right
[19:35:19] *** kasu300 has joined ##java
[19:35:19] <cheeser> but the contents can be changed
[19:35:29] <sproingie> right. seems intuitive enough
[19:35:44] *** Kraln has joined ##java
[19:36:17] *** futureleader has left ##java
[19:36:48] *** pen has quit IRC
[19:37:04] *** navi_sir has joined ##java
[19:38:31] *** navi_sir has quit IRC
[19:38:42] *** navi_sir has joined ##java
[19:38:55] *** meoblast001 has joined ##java
[19:39:17] <meoblast001> hi
[19:39:21] <irufus> hi
[19:39:31] *** wyvern` has quit IRC
[19:39:38] <meoblast001> is there a way to get the amount of bytes actually written to a ByteBuffer?
[19:39:45] <meoblast001> or can i only get the capacity of the entire buffy?
[19:39:47] <meoblast001> buffer*
[19:40:27] *** sebrock has joined ##java
[19:41:04] <ernimril> meoblast001: it depends, do you always start your writes at position 0?
[19:41:04] *** kasu300 has quit IRC
[19:41:25] <meoblast001> ernimril: i always start my writes from the point of the previous write
[19:41:26] <ernimril> meoblast001: the normal usage is to write some data and then flip() and then use the data
[19:41:29] <meoblast001> and i start the first write at 0
[19:41:45] *** kasu300 has joined ##java
[19:42:00] <ernimril> meoblast001: and possibly use the remaining() number of bytes
[19:42:03] *** tizbac has joined ##java
[19:42:15] <meoblast001> ah, so when i flip it discards everything past the current position?
[19:42:16] *** msetim has joined ##java
[19:42:22] <msetim> hi folks
[19:42:33] <ernimril> meoblast001: not discards, it just sets the limit to the current position
[19:42:51] <msetim> I got this error from netbeans ide: Can't connect to X11 window server using '/home/setim/NetBeansProjects/jitsi/0' as the value of the DISPLAY variable
[19:42:54] *** LouisJB has joined ##java
[19:42:56] <ernimril> meoblast001: this means that if you get data out of the BB you will get only data up to the limit
[19:42:58] <msetim> I'm running a test case
[19:43:06] <meoblast001> so let's say i have 50 byte capacity, fill in 25 bytes, flip(), then print capacity()
[19:43:09] <meoblast001> will it be 25?
[19:43:13] *** gremmachook has quit IRC
[19:43:25] <ernimril> meoblast001: capacity is still 50, limit will be 25
[19:43:29] <meoblast001> ah
[19:43:34] <msetim> I already set DISPLAY env var to :0 but that is not read when I run a test case
[19:43:39] <ernimril> meoblast001: position will be 0, remaining will be 25
[19:43:47] *** Fisiu has joined ##java
[19:43:48] *** kasu300 has quit IRC
[19:43:48] <meoblast001> ernimril: and previous to flipping, limit() and capacity() are equal?
[19:43:57] *** Bombstone has quit IRC
[19:44:12] <ernimril> meoblast001: if it was a newly created BB, yes, or if you have clear():ed it
[19:44:28] <meoblast001> ah, that should work perfectly :
[19:44:29] <meoblast001> :)
[19:44:30] <meoblast001> thanks
[19:46:03] *** rretzbach has joined ##java
[19:46:44] *** jesmon has joined ##java
[19:46:53] <IsmAvatar> How do I tell if a Drag and Drop transfer is a COPY or a MOVE at either export or import (doesn't matter which)? I need to know because COPY is essentially doing a LINK instead of cloning...
[19:47:03] *** epure_ has quit IRC
[19:47:28] *** msetim has quit IRC
[19:47:36] *** ^man_pld has quit IRC
[19:50:03] <irufus> IsmAvatar: have you looked at http://download.oracle.com/javase/tutorial/uiswing/dnd/intro.html?
[19:50:16] <IsmAvatar> rather, instead of Drag and drop, I meant clipboard transfer
[19:50:28] <irufus> CUT and COPY
[19:52:20] *** lamdk has joined ##java
[19:52:29] *** hanstech has quit IRC
[19:56:18] *** cafesofie has quit IRC
[19:56:28] *** Bombstone has joined ##java
[20:01:16] *** hanstech has joined ##java
[20:02:57] <IsmAvatar> irufus: I have looked at it, but I'm still not seeing what I'm looking for. I already have it set up as both DND and clipboard support (both seem to pretty much use the transfer handler - this is a customized JList, so Cut essentially = Move).
[20:03:57] <jim> is there an infobot, need info on random numbers (integers in a range)
[20:06:10] *** stateknife has joined ##java
[20:07:01] *** chasha has left ##java
[20:09:37] <jim> !hi
[20:09:55] <IsmAvatar> ~hi
[20:09:55] <javabot> Hello IsmAvatar, and welcome to ##java
[20:10:10] <jim> ~random
[20:10:10] <javabot> http://is.gd/90vE
[20:10:17] <jim> thank you
[20:10:20] <IsmAvatar> LOL
[20:10:34] *** supercosmonaut has quit IRC
[20:11:02] <IsmAvatar> jim: you might have more luck if you just ask your question
[20:11:04] *** stateknife has quit IRC
[20:11:43] <jim> I sorta did, I need a random integer in a specified range
[20:12:04] *** Gracenotes has quit IRC
[20:12:06] <sbalmos> ~~ jim google java random range
[20:12:07] <javabot> jim, http://letmegooglethatforyou.com/?q=java+random+range
[20:12:48] <jim> keiut
[20:13:05] <jim> very keiut
[20:13:36] *** navi_sir has quit IRC
[20:13:45] *** arborist has joined ##java
[20:16:08] *** bjornju has joined ##java
[20:16:24] <pucko> http://blogs.sun.com/mr/entry/openjdk_gov_reboot <- interesting
[20:16:31] <jim> anyway thanks, Min + (int)(Math.random() * ((Max - Min) + 1)) is good
[20:16:57] *** arborist has quit IRC
[20:17:41] *** cbeust__ has joined ##java
[20:17:54] *** arborist has joined ##java
[20:18:19] *** wyvern` has joined ##java
[20:18:35] *** cbeust_ has quit IRC
[20:21:27] *** To3alt has quit IRC
[20:22:15] *** eoss has joined ##java
[20:23:42] *** mescalinum has joined ##java
[20:25:57] *** stateknife has joined ##java
[20:26:09] *** pkkm has joined ##java
[20:26:47] *** Bombstone has quit IRC
[20:26:58] *** epure_ has joined ##java
[20:28:58] <pkkm> How to delete current element of ArrayList inside for-each loop like for(type var : arrayList)?
[20:29:37] <ernimril> pkkm: no can do...
[20:29:43] <ernimril> pkkm: use an iterator instead
[20:30:13] *** OldCode101 has joined ##java
[20:30:27] *** lolzie has joined ##java
[20:30:30] <IsmAvatar> which is ironically what the advanced for-each loop does anyways
[20:30:39] <OldCode101> is javax.* not included in the SE 1.6 JDK?
[20:31:50] <lolzie> Hi guys. How can I paint something which will fit exactly within the size of my jpanel?
[20:31:53] <IsmAvatar> OldCode101: a lot of javax is 1.7, so I can see why you might be tempted to think that. But a lot of javax is still 1.6, like javax.swing
[20:31:55] <lolzie> i.e. to stretch
[20:32:32] *** epure_ has quit IRC
[20:32:47] <OldCode101> I was attempting to import javax.servlet.* and eclipse politely gave me the finger
[20:32:56] <OldCode101> only reason I asked
[20:32:59] <irufus> OldCode101 lol
[20:33:46] <paulweb515> javax.servlet is part of JEE
[20:33:53] *** DerHorst has joined ##java
[20:34:18] <IsmAvatar> servlet is not part of the Java SE API so you will need to provide classpath entries to the locations of the jars containing the Java EE api implementations
[20:34:48] *** LouisJB has quit IRC
[20:37:18] <ojacobson> OldCode101: more completely: "javax." is not one package
[20:37:20] *** To3alt has joined ##java
[20:37:36] <OldCode101> i realize this, I was abreviating
[20:37:42] <ojacobson> Sure, but it changes the question
[20:37:52] <OldCode101> I should of been more specific
[20:37:54] <ojacobson> "is the servlet API" is more specific than "is every extension ever written" :)
[20:38:01] <OldCode101> lol
[20:38:04] <ojacobson> the answer happens to be no to both this time
[20:38:11] <OldCode101> javax.servlet.http.HttpServlet
[20:38:12] <ojacobson> but if you'd meant javax.sql, for example, it would've been "yes"
[20:38:33] <ojacobson> (or jaxb, or swing, or...)
[20:39:02] <OldCode101> it was working in my 1.4 build, just not when I move it up to 1.5 compliance
[20:39:29] <Nach0z> If I'm trying to get a file by it's full filepath for FileReader, would I use \\ or / to separate directories? or does it matter?
[20:39:30] *** Bombstone has joined ##java
[20:39:45] <ojacobson> It wasn't part of SE in 1.4
[20:39:48] <ojacobson> and it isn't part of SE now
[20:40:03] <ojacobson> You may have accidentally stuck the servlet API (or the full EE API) into your 1.4 environment's extension directory
[20:40:13] <ojacobson> (a) don't put stuff there and (b) that's not Java's fault :)
[20:40:33] *** freeksh0w86 has left ##java
[20:40:42] *** nphase_ has quit IRC
[20:40:48] <IsmAvatar> Nach0z: it ultimately delegates to File
[20:41:05] <Nach0z> um. ok. what does that mean?
[20:41:23] <IsmAvatar> it means the File docs should be able to answer your question
[20:41:54] <OldCode101> ojacobson; fair. I will double check
[20:41:58] *** mascix has joined ##java
[20:43:20] <pkkm> Is using iterator better than using for(int i = 0; i < arrayList.size(); i++)?
[20:43:43] <ojacobson> pkkm: by what metric?
[20:44:00] *** hzroot has joined ##java
[20:44:21] <ojacobson> Using an index over a list may have a higher time complexity, depending on the list type, but if arrayList is actually an ArrayList then (assuming that then calls arrayList.get(i) somewhere) they have the same time complexity
[20:44:28] <pkkm> ojacobson, Speed of execution
[20:44:52] <ojacobson> See my last remark, then.
[20:46:25] <pkkm> Which one should I use?
[20:46:56] <IsmAvatar> for Speed of execution - whichever you prefer
[20:47:00] *** [twisti] has joined ##java
[20:47:02] <ojacobson> If all you care about is execution speed (which is basically a useless metric, but it's yours, so let's run with it) then the only difference is constant factors
[20:47:07] <ojacobson> which means it's negligible
[20:47:16] <cheeser> except for *really* large lists.
[20:47:21] <cheeser> which i doubt you're dealing with.
[20:47:36] <irufus> cheeser: what would you do for really large lists?
[20:47:39] <cheeser> though i don't know that the differences are linear
[20:47:42] <cheeser> iterator
[20:48:01] <cheeser> with an ArrayList, it won't matter, either way
[20:48:30] *** wabash has joined ##java
[20:48:46] *** chomping has quit IRC
[20:48:53] *** TheSchoolinator has quit IRC
[20:49:29] *** Gracenotes has joined ##java
[20:50:15] <irufus> oh wow.. that makes so much sense iterator vs for-loop
[20:50:35] <irufus> i had a problem using an arraylist and for-loop when trying to remove items
[20:51:05] *** Niamkik has joined ##java
[20:51:09] <cheeser> ended up with an index mismatch, eh?
[20:51:15] * irufus nodes
[20:51:18] * irufus nods
[20:51:46] <irufus> I couldn't figure out for a while what was going on. Now i can't remember which program I was...
[20:51:47] <irufus> OH YEAH!
[20:51:57] <irufus> it was the facebook hacker cup open
[20:51:57] <ojacobson> ListIterator (which isn't what's used by for-each, but is easy to use in a normal for loop) is a good way to make in-place modifications to a list
[20:52:13] <ojacobson> whether that's a good thing to be doing in the first place I'll leave alone
[20:52:31] <ojacobson> origami (folds and filters) might be a nicer way to do it ;)
[20:52:38] <soa2ii> Is there a difference between XMLOutputFactory.newInstance(); and XMLOutputFactory.newFactory();? If so I don't get it.
[20:53:36] *** [Justice] has joined ##java
[20:53:47] *** zatan has joined ##java
[20:53:56] <cheeser> i'd say read the javadoc
[20:54:28] <ojacobson> I'm reading the javadoc, and he's right
[20:54:54] <ojacobson> The docs neither say that they are the same nor explain how they're different
[20:55:06] <cheeser> use the source, luke.
[20:55:09] <ojacobson> Gut feel is that they're probably the same, but
[20:55:18] <cheeser> probably one defers to the other then
[20:55:29] <cheeser> one might be a legacy method
[20:56:12] <ojacobson> in fact, there are a few baffling things in that method list
[20:56:27] <ojacobson> Deprecated. This method has been deprecated because it returns an instance of XMLInputFactory, which is of the wrong class.
[20:57:46] <cheeser> heh
[20:58:11] *** epure_ has joined ##java
[20:58:18] *** epure_ has quit IRC
[20:58:20] <cheeser> ah, yeah. who called it? i did, that's who.
[20:59:00] *** stillRise has joined ##java
[20:59:48] *** j-invariant has joined ##java
[20:59:50] <j-invariant> 2.2250738585072012e-308
[21:00:07] <sbalmos> ah, I needed new lottery numbers.
[21:00:29] <ojacobson> shit, that's the combination to my luggage.
[21:00:30] <dmlloyd> j-invariant is the first one to come up with that all day!
[21:00:32] <dmlloyd> well, not really.
[21:00:51] <ojacobson> j-invariant: we'd fix it, but our IDEs keep crashing
[21:00:51] <cheeser> j-invariant: i'm assuming you have a point to make?
[21:01:01] <ojacobson> (*hat tip* to whoever I stole that joke from)
[21:01:04] <ojacobson> (you know who you are)
[21:01:16] <j-invariant> http://i.imgur.com/tgE5W.png
[21:01:27] <ojacobson> Yeah, ok, move along now.
[21:01:41] <wabash> I think that joke belongs in #php or something.
[21:01:45] <cheeser> j-invariant: do you have a question?
[21:01:53] <cheeser> wabash: it affects the JVM, too.
[21:01:57] <ojacobson> wabash: No, there's a Java bug with basically the same root cause
[21:02:05] <ojacobson> Someone dug it out this morning/last night
[21:02:21] <cyth> PHP was actually affected by that bug too
[21:02:24] <cyth> already been patched
[21:02:30] <ojacobson> In summary: yes, you can lock up any Java program that uses Double.parseDouble, and yes, that includes the compiler
[21:02:32] <Stephmw> howdy
[21:02:37] <cyth> I think a lot of VM's use that code
[21:02:41] <ojacobson> and yes, the root cause is approximations in the parser
[21:02:58] <cyth> likely it isn't just jvm and php
[21:03:18] *** waos has joined ##java
[21:03:23] <sbalmos> SIGSEGV?: Probably segmentation fault. Core approximately dumped.
[21:03:31] * cheeser tags that bug with "who gives a shit"
[21:03:53] <sbalmos> cheeser: That's the default tag for Firefox bugs, right?
[21:04:01] <cheeser> yeah. and hibernate.
[21:04:08] <cyth> cheeser, anyone who takes in input from untrusted sourse and tries to parseDouble it
[21:04:35] <cheeser> so ... idiots then.
[21:04:37] <cheeser> 8^)=
[21:04:41] <ojacobson> I'm trying to think of the last time I used parseDouble
[21:04:44] <wabash> ojacobson: I was not aware of that bug being in Java. hm....
[21:04:48] <ojacobson> other than for compiling stuff with floating point literals in it
[21:04:53] *** Diogo has quit IRC
[21:04:56] <j-invariant> why are you guys so rude>?
[21:04:56] <ojacobson> (trusted input)
[21:04:57] *** Nach0z has quit IRC
[21:05:07] *** pschriner has joined ##java
[21:05:07] *** pschriner is now known as DerSchreiner
[21:05:07] <cheeser> ruce? we haven't been rude.
[21:05:08] <wabash> j-invariant: I hear that a lot.
[21:05:21] <cheeser> j-invariant: why do you come in hear just to gloat about a bug no one cares about?
[21:05:24] <wabash> j-invariant: are we rude?
[21:05:24] <saml> i'm not rude. i'm kind and sweet
[21:05:25] <cheeser> s/hear/here/
[21:05:28] <j-invariant> if you're interested in discussing this floating point thing I don't think you should have been so nasty to me when I came in
[21:05:35] <ojacobson> We're not.
[21:05:40] <ojacobson> There isn't really a lot to say about it.
[21:05:40] <j-invariant> k
[21:05:41] <wabash> glib, not nasty.
[21:05:47] <ojacobson> Well, I'm not.
[21:05:52] <ojacobson> I don't speak for anyone else. :)
[21:05:54] <saml> i'm a nice girl
[21:05:54] <cheeser> j-invariant: if *you* were interested you wouldn't have posted flamebait comics like you did.
[21:06:07] <j-invariant> ojacobson: you've been talking about it since I jonied, I put cheeser on ignore for being a dick etc.
[21:06:15] <wabash> hahahahah
[21:06:19] <ojacobson> Sure, to wabash
[21:06:22] *** ChanServ sets mode: +o kinabalu
[21:06:25] * wabash knows what's next.
[21:06:27] <kinabalu> ojacobson: you're such a dick
[21:06:32] <OldCode101> ahh thats it.moved my tomcat6 instance and forgot to update my build path
[21:06:40] <ojacobson> kinabalu: fuck you and the horse you rode in on, man. You just don't understand me. :D
[21:06:47] <ojacobson> OldCode101: that'll do it
[21:06:47] *** cheeser sets mode: +b j-invariant!*@*
[21:06:50] <kinabalu> ojacobson: fucking canadians
[21:06:52] * ojacobson whispers "maven" and "ivy"
[21:06:56] <cheeser> for being a douchenozzle
[21:06:59] * wabash basks in closure.
[21:07:02] <ojacobson> (javax.servlet is available in maven's central repo)
[21:07:32] <cheeser> it is under jetty's artifacts at least.
[21:07:35] <cheeser> probably tomcat's too
[21:07:46] <ojacobson> javax.servlet:servlet-api exists up to 2.5
[21:07:48] <ojacobson> (last I checked)
[21:07:56] <kinabalu> indeed.
[21:07:58] <ojacobson> 3.0 is in glassfish's repo, as well as in central under various vendors' groupIds
[21:08:09] <kinabalu> iOS SDK 4.3 beta 3 now available. wheeee
[21:08:25] <saml> is iOS java?
[21:08:35] <ojacobson> kinabalu: it'd cost me $5 to download it, though, because of the f***ing usage-based billing changes
[21:08:41] <kinabalu> saml: are you really here asking stupid questions?
[21:08:44] <ojacobson> (Just in bandwidth charges)
[21:08:47] <kinabalu> ojacobson: wha?
[21:08:54] <kinabalu> ojacobson: Rogers is trying to roger you?
[21:09:00] <ojacobson> Oh no
[21:09:03] <ojacobson> It's much more coordinated than that. :)
[21:09:08] <ojacobson> More would be off-topic here
[21:09:18] <kinabalu> fancy a bit of a rogering from big tel eh?
[21:09:25] <saml> ojacobson is canada lol i can send you iOS SDK on SSD and it's cheaper
[21:09:50] *** cbrock has quit IRC
[21:11:54] *** To3alt has quit IRC
[21:12:28] *** Behold has joined ##java
[21:12:54] *** jimi__hendrix has joined ##java
[21:13:40] *** peeps[lappy] has joined ##java
[21:14:02] <peeps[lappy]> what does it mean when a method is declared as transient
[21:14:29] *** irn has joined ##java
[21:14:31] *** BeholdMyGlory has quit IRC
[21:14:37] <ojacobson> peeps[lappy]: it means the compiler gives you an error, if I recall right.
[21:14:51] <cheeser> it means the dev'er doesn't understand transient probably
[21:14:59] *** Deeewayne has quit IRC
[21:15:05] <kinabalu> transient method? wtf?
[21:15:07] <ojacobson> cheeser: it's an error
[21:15:11] * cheeser nods.
[21:15:22] <kinabalu> peeps[lappy]: what does JAVAC say?
[21:15:22] <cheeser> unless he means @Transient which he should say if that's what he menas
[21:16:20] *** irn has quit IRC
[21:16:35] *** jimi_hendrix has quit IRC
[21:16:57] *** lamdk has quit IRC
[21:17:22] <Jemt> How do I execute a binary on Linux, which I would usually invoke like this: ./binary.bin
[21:17:43] <IsmAvatar> Jemt: this is ##java, not ##linux
[21:17:55] <Jemt> ... using Runtime.getRuntime().exec - e.g. ....exec("binary.bin") (which doesn't work)
[21:18:16] <Jemt> IsmAvatar: ^^ NOW it's a Java question ;)
[21:18:16] <wabash> ~~ Jemt: doesn't work
[21:18:16] <javabot> The user Jemt: is not on ##java
[21:18:22] <IsmAvatar> :-)
[21:18:26] <wabash> ~~ Jemt doesn't work
[21:18:26] <javabot> Jemt, doesn't work is useless. Tell us what it is, what you want it to do, and what it is doing. Consider putting some code and any errors on a pastebin. (use ~pastebin for suggestions)
[21:18:44] <Jemt> Doesn't work = Exception: "Cannot run program "binary.bin" (in directory ".....")
[21:18:53] <Jemt> ... "No such file or directory"
[21:18:59] <Jemt> And that's not true - the file is there
[21:19:05] <cheeser> clearly it isn't.
[21:19:22] <cheeser> the JVM is almost never wrong about such things so check your assumptions.
[21:19:42] <cyth> almost
[21:20:02] <cheeser> well, we've already covered the double parsing bug. P^)=
[21:20:09] <Jemt> The file is there - I just changed it's file access with the exact same file path - with success.
[21:20:20] <Jemt> its*
[21:20:20] <ojacobson> I bet the cwd isn't what you think it is
[21:20:35] <Jemt> It is
[21:20:35] *** bn` has joined ##java
[21:20:40] <cheeser> we get it
[21:20:54] <ojacobson> Jemt: then it's working
[21:20:56] <ojacobson> ~next
[21:20:56] <javabot> Another satisfied customer. Next!
[21:21:01] *** Gracenotes has quit IRC
[21:21:03] <Jemt> I think it has something to do with how the binary is invoked
[21:21:36] <Jemt> I would invoke it like ./binary in a shell. Can I invoke it like ...exec("binary") in Java ?
[21:21:42] <Jemt> (without ./)
[21:21:58] <wabash> Jemt: It depends on what Java thinks teh CWD is.
[21:22:01] * LadySerena wonders if its possible to create a JDBC wrapper that uses a real JDBC via a custom protocol
[21:22:30] <wabash> Jemt: But yes, the "./" is there because you are not supposed to put "." on your path. But that's a Unix/Linux security thing.
[21:22:30] <Jemt> wabash: Current working directory is logged out - it's where the file is located
[21:22:31] <cheeser> LadySerena: 1. yes. 2. you can just ask your question without all the /me theatrics.
[21:22:33] <ojacobson> LadySerena: HA-JDBC and other proxy-based JDBC drivers do this
[21:22:33] *** LouisJB has joined ##java
[21:22:44] <ojacobson> Basically agree with the theatrics remark, too
[21:22:44] <Jemt> wabash: Okay, I see
[21:22:53] <LadySerena> :D
[21:22:59] *** TheSchoolinator has joined ##java
[21:23:15] *** hellyeah has joined ##java
[21:23:21] * Stephmw wonders if wondering about the wonder will lead to wonderers wondering about thinking of wonders
[21:23:22] <hellyeah> what is the channel for java script
[21:23:30] *** SpaceDoG has quit IRC
[21:23:31] <hellyeah> ops sorry
[21:23:35] * ojacobson scrolls up to the /topic.
[21:23:37] * ojacobson scrolls back down.
[21:23:39] <wabash> Stephmw: Yes.
[21:23:45] <cheeser> ~mock hellyeah
[21:23:45] * javabot points at hellyeah and laughs
[21:23:47] <cheeser> 8^)=
[21:24:25] <hd1> ~mock hd1
[21:24:25] * javabot points at hd1 and laughs
[21:24:31] *** Auv5 has joined ##java
[21:24:38] <peeps[lappy]> hmm, the transient method i saw appears to be a bug in my IDE, it was incorrectly showing the method signatures from a compiled jar. i downloaded the source, and there is no transient keyword there
[21:24:51] <IsmAvatar> All this wondering brings me back to Age of Empires...
[21:25:02] <hd1> ~mock javabot
[21:25:02] * javabot points at javabot and laughs
[21:25:04] <LadySerena> yayness, zeroconfig database + mysql over ipv6
[21:25:08] <hd1> ok, I'm done
[21:25:08] <Sniffy> Hey guys. I've been looking into ways to call methods that might not exist (sounds weird when I word it like that). I've been doing some reading and it seems reflection using the Method class is an way to go about it. Does anyone know of any other solutions?
[21:25:08] *** KarlThePagan has joined ##java
[21:26:07] *** e_ has quit IRC
[21:26:11] <Jemt> Aha! Interesting. I can't execute the binary like this (in a shell): ./path/to/folder/with/binary. This is what I do in Java, more or less. However, this works: cd /path/to/folder/with && ./binary
[21:26:22] <Jemt> So you are right - it's related to CWD
[21:26:49] <IsmAvatar> Sniffy: as far as I know, the usual approach is to either use an interface to guarantee that the method exists, or use reflection.
[21:27:22] <ojacobson> I'd be very surprised if that worked as written
[21:27:34] <ojacobson> && and 'cd' are both shell intrinsics and Runtime.exec (and ProcessBuilder) do not run shells
[21:27:37] *** SpaceDoG has joined ##java
[21:27:55] <ojacobson> You can use them to run shells, obviously, but they don't run one for you
[21:27:59] <Jemt> I would expect Runtime.getRuntime().exec("binary.bin", new String[0], new File("/path/to/folder")) to be much identical to "cd /path/to/folder && ./binary.bin" - isn't it ?
[21:28:02] <IsmAvatar> I'm seeing a difference in the two paths. The first one is reletive, the second is absolute
[21:28:07] <Sniffy> OK seems reflection it is then
[21:28:25] <ojacobson> Sniffy: Interfaces are the way to go here
[21:28:35] <ojacobson> The grain of the language is not to get into situations where a method "might exist"
[21:28:42] <ojacobson> ensure it always exists, but sometimes does nothing interesting, instead
[21:28:56] <Sniffy> I'd be interested to hear your opinion on my project, please give me a min to collect my thoughts
[21:29:12] *** mascix has quit IRC
[21:29:19] *** realtime_ has quit IRC
[21:31:42] <Sniffy> I have a collection of objects that implement some Effect interface. These objects take a BufferedImage, do stuff to it and pass it back. I need to connect JSliders to the fields within these objects. All this would work fine if all these Effects had the same number of fields to change but they don't.
[21:32:53] <Sniffy> It's not ideal but if I just call some getP1(), getP2() methods until an exception gets thrown then I know I'm done
[21:33:01] <ojacobson> There are a couple of ways to handle this
[21:33:03] <Sniffy> My thoughts are so confused though so I feel I'm missing something obvious
[21:33:09] <ojacobson> One is to have each strategy create its own UI directly
[21:33:18] *** supercosmonaut has joined ##java
[21:33:23] *** amimusa has joined ##java
[21:33:29] <amimusa> good night
[21:33:32] <ojacobson> another is to make the whole thing a bit more data-driven by providing a mechanism for interrogating each one for the settings it accepts *as data* (not compile-time symbols, like methods)
[21:33:56] <wabash> amimusa: Surely you meant to say "Good evening"?
[21:33:58] <ojacobson> You could hypothetically use the beans system and one of the various UI bean binding mechansisms, too
[21:34:00] <Sniffy> I do currently have an implementation that stores AWT components within these Effects but I don't like it
[21:34:04] <ojacobson> (this being basically the problem beans were invented to solve)
[21:34:09] <Sniffy> and I can't serialize the objects
[21:34:17] <Sniffy> I see
[21:34:36] <amimusa> I need to know how I can run the app that requires mysql-connector into a GNU/Linux box, anybody could show me the way ? thanks in advance
[21:34:49] <ojacobson> (beans use reflection under the hood, but it's a much more structured approach than what you had in mind)
[21:34:50] <amimusa> yeah wabash ... good evening ... hehe
[21:35:19] <Sniffy> interesting, I'll check out beans. Thanks ojacobson
[21:35:23] <amimusa> could I create the package from eclipse that includes all necesary ?
[21:35:29] <tolland> I have a Interface for importing files, so I have an interface ImportFile and some implementations like CSVImportFile, tsvImportFile, SomeOtherImportFile I need to ask the user what file type it is as some of the extensions are ambiguous. Should I use some sort of reflection to determine the implementations available to the app? or is there some other pattern recommended?
[21:35:38] *** Omen_20_ has joined ##java
[21:35:40] *** irufus has quit IRC
[21:35:44] <wabash> amimusa: Sí. I think you'd have to install MySQL.
[21:35:57] <amimusa> I have it installed yet
[21:36:37] <Omen_20_> Hi. I'm having some issues with an array. To me the way I have my method written, it should be passing by value as Java always does. But it seems to be editing the original, as if the method is referencing it.
[21:36:52] <amimusa> anyway the DDBB will be remote, the app just need to connect
[21:37:05] <amimusa> but in linux the controller is not found
[21:37:40] <wabash> Omen_20_ Java will pass the value of the reference.
[21:37:44] <wabash> not the object itself.
[21:38:53] *** jimi__hendrix is now known as jimi_hendrix
[21:39:18] *** drindt has quit IRC
[21:39:26] <Omen_20_> wabash: ok, could you look at my short snippet and see what I'm overlooking? http://pastebin.com/RzYUmsRR
[21:40:18] *** stateknife has quit IRC
[21:40:47] <IsmAvatar> Omen_20_: that's an ArrayList, not an array
[21:40:49] <wabash> ok, sure.
[21:41:10] <wabash> Omen_20_: First, tell me what you are passing where.
[21:41:59] *** Johannes13 has quit IRC
[21:42:05] <Omen_20_> IsmAvatar: yes, but I've done the same sort of app twice. One with Canvas, the other OpenGL. One it's easier to use an ArrayList, the other an Array. Both apps are affecting the original data when I sort.
[21:42:24] *** sbalmos has quit IRC
[21:42:29] <cyth> Omen_20_, wouldn't it make more sense to write a comparator and use Collections.sort?
[21:42:53] <wabash> Omen_20_: Correct. Java is pass by value only. But when you handle objects in Java, you are always handling references to objects. So you are passing by value the reference to your ArrayList object.
[21:42:55] *** bartj has joined ##java
[21:43:01] <wabash> Hence, the object can be altered.
[21:43:04] <cyth> I think if you switch it to an array you can use Arrays.sort the same way
[21:43:30] *** Johannes13 has joined ##java
[21:43:45] <bartj> I am looking for a soundex library and am thoroughly confused as to which I should pick
[21:43:45] <bartj> or even which is the most appropriate
[21:43:51] <bartj> because the soundex returned by the in-built mysql function
[21:43:52] <bartj> is different from that of Apache commons library - http://commons.apache.org/codec/apidocs/src-html/org/apache/commons/codec/language/Soundex.html#line.252
[21:43:55] <Omen_20_> cyth, I would but the data has coordinates and I'm sorting on just X or just Y. So the partner has to be caried along.
[21:43:55] <cbeust__> Omen_20_: if you modify the array in your method, your caller will see the modifications too. This is working as expected
[21:43:59] <wabash> cyth: it would make more sense in deed. But I think it's a learning project, correct Omen_20_+
[21:44:21] *** kamoricks has joined ##java
[21:44:31] <cyth> Omen_20_, pretty sure you can do that in a comparator
[21:45:07] <cyth> also honestly your datastructure could make more sense
[21:45:12] <Omen_20_> wabash: yeah. I'm doing it for a class, and to show Android off at a meeting later, which is why I did it twice once with Canvas, the other with OpenGL.
[21:45:15] *** aydiosmio has quit IRC
[21:45:42] <wabash> Omen_20_: Ok, one problem at a time then.
[21:45:59] <wabash> First, you'd better go figure out what's happening with pass by value and changing objects.
[21:46:52] <wabash> It's a basic mechanism of how Java works; it will be true for all methods.
[21:48:12] <Omen_20_> The examples I've read lead me to believe that this method should work. Pass the data, the method make a copy, sort it and return it, without ever affecting the original.
[21:48:42] *** armyriad has quit IRC
[21:48:46] <wabash> Omen_20_ You never made a copy.
[21:49:13] <wabash> Omen_20_: You assigned the reference again. But I think you may be confused about objects vs. references.
[21:49:13] <Omen_20_> ahh, ok so that first line is doing a pointer to the original?
[21:49:17] <wabash> Yes
[21:50:44] <Omen_20_> So to get a copy, would I use the copyOf method?
[21:52:01] <wabash> Omen_20_: No, you should look at ArrayList's constructors
[21:52:38] <wabash> ~~ Omen_20_ javadoc ArrayList
[21:52:38] <javabot> Omen_20_: http://is.gd/iOQj8 [JDK: java.util.ArrayList]
[21:53:58] *** bartj has quit IRC
[21:54:10] *** tizbac has quit IRC
[21:54:43] *** IsmAvatar has quit IRC
[21:55:53] <Omen_20_> oh ok.. dang I didn't know you could do that. Got ArrayList working now with OpenGL. Thanks!
[21:56:13] *** JaVaSan has quit IRC
[21:57:12] <Omen_20_> Man I'll be glad when I graduate. Jack of all trades is tough. Looking forward to specializing.
[21:58:05] <shodan45> why do applets suck so much ;_;
[21:58:20] *** ftc has left ##java
[21:58:29] <Planck_> Because browsers suck.
[21:58:33] <wabash> shodan45: I dunno, but that's not the topic here.
[21:59:53] *** amimusa has quit IRC
[22:00:26] *** gigabytes has joined ##java
[22:00:34] *** sebrock has quit IRC
[22:01:25] *** gigabytes has quit IRC
[22:01:29] *** wabash has left ##java
[22:01:41] *** gigabytes has joined ##java
[22:02:00] *** mvno_subscriber has joined ##java
[22:04:05] <mvno_subscriber> Hi, what does really SelectionKey.OP_ACCEPT and SelectionKey.OP_CONNECT in java.nio mean? The doc isn't really meaningful (OP_CONNECT doesn't fire on frst connection etc).
[22:04:23] *** shodan45 has left ##java
[22:06:58] <jimi_hendrix> do all of the default java exceptions have messages that may be retrieved by getLocalizedMessage()?
[22:07:58] <Ragnor> Where did you find the docs "fire on first connection etc"?
[22:08:51] *** Johannes13 has quit IRC
[22:09:11] <mapreduce> jimi_hendrix: What I find annoying is that some of them are localised even with .getMessage()
[22:09:17] *** Johannes13 has joined ##java
[22:09:18] <mapreduce> Descripteur non valide
[22:09:48] <jimi_hendrix> mapreduce, well both getMessage() and getLocalizedMessage() are returning null
[22:10:32] <mapreduce> For what exception type?
[22:10:53] *** jabz has quit IRC
[22:12:51] *** stateknife has joined ##java
[22:15:15] *** jonkri has joined ##java
[22:16:52] *** Xerochrono has joined ##java
[22:17:18] *** caverdude has quit IRC
[22:17:25] *** hanstech has quit IRC
[22:18:35] *** dmiles_afk has quit IRC
[22:19:06] *** Xabster has quit IRC
[22:19:57] *** dmiles_afk has joined ##java
[22:22:52] *** stateknife has quit IRC
[22:24:19] *** mascix has joined ##java
[22:25:19] *** mparadise is now known as mparadise1
[22:25:33] *** mparadise1 is now known as mparadise2
[22:25:48] *** mparadise2 is now known as mparadis1
[22:25:56] *** mparadis1 is now known as mparadise
[22:26:33] *** mparadise has quit IRC
[22:27:10] *** Gracenotes has joined ##java
[22:27:11] *** tizbac has joined ##java
[22:27:23] <jimi_hendrix> mapreduce, i just catched the general Exception
[22:27:35] <saml> jimi_hendrix, that's good of you
[22:27:42] <saml> catch specific exception
[22:27:51] *** wtfness has joined ##java
[22:28:05] <jimi_hendrix> saml, so how is that good of me?
[22:28:46] *** mparadise has joined ##java
[22:29:27] *** alpha^ has quit IRC
[22:29:48] <saml> because that way, you are registering event listener for all kinds of events
[22:30:04] <saml> i mean exception listener for all kinds of exceptions
[22:31:12] *** Xerochrono has quit IRC
[22:31:55] *** rodrigorocha has quit IRC
[22:32:21] *** hanstech has joined ##java
[22:32:31] <ojacobson> saml: er.
[22:32:42] <ojacobson> jimi_hendrix: generally, only catch exceptions you can actually do something about.
[22:32:55] *** caverdude has joined ##java
[22:32:59] <mapreduce> jimi_hendrix: For what exception type did getMessage return null?
[22:33:00] <ojacobson> Either let other exceptions carry on up-stack to somewhere that can deal with them or catch and rethrow them wrapped in API-appropriate exceptions.
[22:33:25] *** cbrock has joined ##java
[22:33:30] *** cbrock has quit IRC
[22:34:59] <jimi_hendrix> ojacobson and mapreduce: i figured it out, thanks anyway
[22:34:59] *** navi_sir has joined ##java
[22:35:06] <saml> jimi_hendrix, you are welcome
[22:35:13] <jimi_hendrix> and saml :)
[22:36:35] *** tewecske has joined ##java
[22:38:01] *** BeholdMyGlory has joined ##java
[22:39:14] *** Fernandos has left ##java
[22:39:52] *** amimusa has joined ##java
[22:40:11] *** stateknife has joined ##java
[22:40:19] *** Behold has quit IRC
[22:41:40] *** epalm has quit IRC
[22:42:01] *** epalm has joined ##java
[22:42:16] *** Evet has quit IRC
[22:42:41] *** gigabytes has quit IRC
[22:42:50] <amimusa> iep, i need to use addrow method but the jtable model doesn't allow it, here is the code http://pastebin.com/mTMvwiar
[22:43:01] <petisnnake> if there's no exception being thrown, is the finally block going to be executed?
[22:43:06] <amimusa> how could I allow the table to be able to addrow
[22:43:08] <amimusa> ?
[22:43:31] *** Scorchin has joined ##java
[22:43:33] <amimusa> i need to do commented line 125
[22:43:49] *** Niamkik has quit IRC
[22:43:51] *** wolfman2000 has quit IRC
[22:44:00] <amimusa> table is created at line 42
[22:44:11] <ojacobson> petisnnake: Yes.
[22:44:25] <amimusa> modeloTabla extends AbstractTableModel
[22:44:28] <ojacobson> If the try block is entered and the VM is still running, exiting the try block will always evaluate the finally block
[22:44:33] *** epalm has quit IRC
[22:44:53] *** epalm has joined ##java
[22:45:03] *** Dragonai has joined ##java
[22:45:13] <amimusa> if I do extends DefaultTableModel the rest of code doesn't work
[22:45:46] *** pkkm has quit IRC
[22:46:18] <petisnnake> ty ojacobson
[22:47:15] <Omen_20_> What's the difference in parseFloat and valueOf ?
[22:47:29] <ojacobson> On what type?
[22:48:17] <Omen_20_> When you are converting a String to float
[22:48:29] <saml> i think no difference
[22:48:31] <ojacobson> What would you write on the left of the dot?
[22:48:54] *** the_new_you has joined ##java
[22:49:17] *** tsolox has joined ##java
[22:49:32] <saml> http://download.oracle.com/javase/6/docs/api/java/lang/Float.html#parseFloat%28java.lang.String%29
[22:49:40] <saml> Returns a new float initialized to the value represented by the specified String, as performed by the valueOf method of class Float.
[22:50:17] <ojacobson> something something return type something, assuming saml's right about the type you're asking about
[22:50:22] *** belugs has joined ##java
[22:50:37] <tsolox> I have an observation: java program's main() will exit when it's UI loop starts to run..This is not the case as in C or C++. Any comments.!??
[22:50:45] <ojacobson> tsolox: Not true.
[22:51:01] <ojacobson> main() exits when evaluation reaches the end of main(), a return statement, or if something raises an exception
[22:51:03] <saml> tsolox, testcase?
[22:51:07] *** Engin has quit IRC
[22:51:11] <ojacobson> The JVM exits when no non-daemon threads are runnable.
[22:51:26] <ojacobson> In Swing apps there is always a non-daemon thread other than the one that 'main' was run in.
[22:51:47] *** _controller has joined ##java
[22:51:51] <the_new_you> hi, is it possible to bypass a security constraint on a specific URL pattern for a webapp that already has basic authentication required for the /* pattern?
[22:51:53] <saml> ah i see
[22:51:56] <tsolox> i put some printf statements... and main does seem to exit...
[22:52:15] *** dmiles_afk has quit IRC
[22:52:25] <ojacobson> tsolox: sure, but what of it?
[22:52:30] <ojacobson> There's nothing magical about the thread main runs in.
[22:52:45] <ojacobson> It's just the only thread 'java' starts.
[22:52:52] <petisnnake> How can I ensure that the file will be closed regardless of an exception being thrown before rd.close(); I can't put the rd.close() statement in a finally block because I get an error, and that would be in my oppinion the most logical place to put it. http://codepaste.net/qfws1i
[22:53:08] <ojacobson> ~~ petisnnake resource management
[22:53:08] <javabot> petisnnake, proper resource management is easy to get right - see http://dmlloyd.blogspot.com/2008/07/proper-resource-management.html for more information. Or, even better, just use Project Lombok (projectlombok.org); then @Cleanup FileOutputStream fos = ....; is all you need. Type ~lombok for more info.
[22:53:10] <tsolox> ojacobson: just an observation...funny i never notice of this before...
[22:53:13] <_controller> Hi, I need to use a HashSet in my program for performance reasons, but it's also vital that the iteration order remains directly relative to the insertion order: FIFO. If the elements were added as "1", "2", "3", I need my program to return the elements in that same order for the remainder of the program.
[22:53:19] <the_new_you> i alreadying tried adding the specific URL in a sperate security constraint element below /* and assigned it to a user w/o a password... this doesnt seem to work
[22:53:24] <kamoricks> _controller: Then you want a LinkedHashSet.
[22:53:31] <ojacobson> petisnnake: the short version is FileInputStream in = new FileInputStream(f); /* NO CODE HERE */ try { /* work here */ } finally { in.close(); }
[22:53:33] <perlsyntax> Does anyone know a good gui for java?
[22:53:44] <kamoricks> perlsyntax: You have Swing, which is bad, and SWT, which is worse.
[22:53:46] <_controller> kamoricks, i'll take a look at it; thanks a lot
[22:53:58] *** ventsislav has left ##java
[22:54:15] <petisnnake> but can't FileInputStream in = new FileInputStream(f); throw an exception ?
[22:54:20] <perlsyntax> Kamoricks,is there any other gui for java?
[22:54:20] <the_new_you> _controller: have you seen LinkedHashMap?
[22:54:31] <cheeser> petisnnake: read the api and see
[22:54:32] <_controller> just looked through it, looks good
[22:54:58] <kamoricks> perlsyntax: There's Qt's Jambi, but it's unmaintained and unsupported, and there's AWT, which is exactly like Swing, only worse.
[22:54:59] *** Nurbs has quit IRC
[22:55:00] <ojacobson> petisnnake: If it does, you are not responsible for closing the stream
[22:55:06] <tsolox> ojacobson: so, it's already threaded from the start. In C/C++, this is never possible coz when main() exits, it's the end and kill all threads...
[22:55:08] <_controller> the_new_you, kamoricks: is the contains() function also O(1) (assuming there are no collisions)?
[22:55:10] <ojacobson> since it never opened (and you never got a reference to it, since exceptions in a constructor abort construction)
[22:55:13] <petisnnake> thanks again ojacobson
[22:55:18] <perlsyntax> i see
[22:55:23] <saml> _controller, so do you want List ?
[22:55:23] <kamoricks> _controller: Yeah, should be. Only difference is the iterator.
[22:55:27] <ojacobson> tsolox: that's part of the C runtime's contract for hosted implementations
[22:55:31] <ojacobson> it's not part of Java's
[22:55:37] <saml> i mean Queue
[22:55:43] <_controller> ok, saml, i just wanted an ordered iteration set with O(1)
[22:55:54] <_controller> LinkedHashSet seems to be perfect
[22:56:00] <saml> set?
[22:56:09] <the_new_you> _controller: i think so, google java collection performance characteristics
[22:56:12] <saml> that's thread safe?
[22:56:18] <_controller> not necesarilly
[22:56:27] <_controller> i handle synchronization very well in my program
[22:56:30] <kamoricks> That's what Collections.synchronizedSet() is for.
[22:56:40] <saml> how about exceptions?
[22:56:48] <_controller> concurrentmodificationexceptions, you mean?>
[22:56:54] <_controller> they won't occur
[22:56:56] <kamoricks> Those have nothing to do with concurrency.
[22:56:59] <saml> can collection api throw? what's the state of the collection in case of exception
[22:57:09] *** gkffjcs has quit IRC
[22:57:11] <ojacobson> saml: well-defined in most cases.
[22:57:15] *** bn` has quit IRC
[22:57:33] *** Sporadique has joined ##java
[22:57:41] <ojacobson> Concurrently modifying a collection can hypothetically reach invalid states (it's not guaranteed not to) but in practice even if you fuck up that badly it's hard to "break" a list or hashmap
[22:57:51] <tsolox> with regards to MyFile.java, i notice the file can have two public classes..The book I'm reading mentioned, only one public class is allowed...
[22:57:58] *** kh31d4r has quit IRC
[22:58:03] <_controller> another random question: what happens if an exception is thrown from within a synchronized block; will th underlying exception handler still contain the monitor on the object?
[22:58:06] *** bn` has joined ##java
[22:58:13] <_controller> the*
[22:58:16] <jimi_hendrix> also, i am sure that i am making a silly error since i do not often use java, but i have a String s = new String(). i am doing s.concat(someOtherStringThatDefinitelyContainsABunchOfChars). After this call, s still remains empty
[22:58:19] *** mvno_subscriber has quit IRC
[22:58:34] <kamoricks> jimi_hendrix: You're not getting the return of that. Strings are immutable.
[22:58:39] <saml> i think .concat() returns new string
[22:58:41] <Sporadique> hello, I'm looking for some help with a java applet, I can't manage to display the ImageIcons when I start the applet from a html file
[22:58:46] <kamoricks> ~applets
[22:58:46] <javabot> Check the topic, read http://javachannel.net/wiki/pmwiki.php/FAQ/Applets - Basically, we don't support them here. Try the sun forums at http://tinyurl.com/2q2hog; consider the new Windows/OS X/Linux 32/64bit JNLP-compatible "Plugin2" from Java 6u10 (http://java.sun.com/javase/6/webnotes/6u10/plugin2/index.html)
[22:58:54] <jimi_hendrix> kamoricks / saml thanks
[22:58:56] <_controller> another random question: what happens if an exception is thrown from within a synchronized block; will the underlying exception handler still contain the monitor on the object?
[22:59:08] <saml> what?
[22:59:13] <saml> what's exception handler?
[22:59:28] <ojacobson> _controller: the monitor is released when control exits the synchronized block.
[22:59:28] <saml> catch (SomeException e) { you mean if you can access monitor from e?
[22:59:31] <ojacobson> Doesn't matter how.
[22:59:43] *** tsolox has quit IRC
[22:59:51] <saml> are you doing synchronized (o) { ..} ?
[23:00:03] <kamoricks> How *else* would one do a synchronized block?
[23:00:14] <_controller> oh ok ojacobson, thanks
[23:00:17] <ojacobson> If you synchronize inside a try statement, then it will be released before any catch or finally blocks are evaluated. If you synchronize around a try statement, the try as well as any catch or finally blocks will be evaluated while holding the monitor.
[23:00:19] *** DerHorst has quit IRC
[23:00:30] <_controller> i see
[23:00:41] *** rjohnson19 has joined ##java
[23:00:48] *** mparadise has quit IRC
[23:01:10] <_controller> the LinkedHashMap documentation contains no hints as to whether contains() is also O(1)?
[23:01:38] <ojacobson> _controller: The only difference between the two is that LinkedHashMap has a guaranteed iteration order independent of hashing
[23:01:46] <kamoricks> _controller: It's inheirited from HashMap and not overridden.
[23:01:53] <ojacobson> contains, get by key, and other operations that are driven by the underlying hash table are still driven by the underlying hash table
[23:02:33] <_controller> i see
[23:02:35] <_controller> Like HashSet, it provides constant-time performance for the basic operations (add, contains and remove), assuming the hash function disperses elements properly among the buckets. Performance is likely to be just slightly below that of HashSet, due to the added expense of maintaining the linked list, with one exception: Iteration over a LinkedHashSet requires time proportional to the size of the set, regardless of its capacity. Iteration
[23:02:41] <_controller> i skipped that :S
[23:02:52] <lolzie> I have a base class, and multiple derived classes. The derived classes always call the parent constructor via super (with a parameter). However, the parent constructor also needs another particular parameter - it seems almost redundant to define this as being a parameter for each of the subclass constructors
[23:03:15] <lolzie> But either so, is it possible to somehow standardize/enforce the derived constructors to be passed this argument?
[23:03:16] <saml> lolzie, i see
[23:03:20] *** cbrock has joined ##java
[23:03:22] <ojacobson> lolzie: No.
[23:03:34] *** Sporadique has left ##java
[23:03:35] <saml> what is "this" argument?
[23:03:38] *** kh31d4r has joined ##java
[23:03:52] <ojacobson> saml: The one he described *literally* the line before.
[23:04:05] *** OldCode101 has left ##java
[23:04:11] <saml> why don't you provide protected Parent() without the parameter?
[23:04:18] <kamoricks> Cause constructors aren't inheirited.
[23:04:24] <saml> then you can call super(a,b)
[23:04:33] <lolzie> saml: I have a game, and the JPanel (basically the game screen) needs to be passed to the Parent constructor of these classes
[23:04:37] <saml> without c ; super(a,b,c)
[23:04:53] <saml> where do you get JPanel?
[23:05:06] <ojacobson> lolzie: Do the obvious thing
[23:05:09] <saml> super(jPanel)
[23:05:13] <ojacobson> There's no "clever" solution that isn't worse
[23:05:20] <kamoricks> (Dependency injection!)
[23:05:24] *** navi_sir has quit IRC
[23:05:24] <lolzie> saml: it seems as though the derived classes shouldn't need to know/deal with that variable, as it's used only in the parent class (seems as though this is leaking implementation details to derived classes)
[23:05:30] <ojacobson> That's the obvious thing! it happens to be what he was already doing.
[23:05:35] <ojacobson> Just, without a framework. :)
[23:05:47] <kamoricks> Here I was preparing a whole infomercial on the "glories" of Spring DI.
[23:05:50] <lolzie> Hmm, not sure if I'm actually using DI as such
[23:05:58] <saml> maybe manager.. or visitor
[23:06:11] <kamoricks> Yes. Let's write more code, so we can avoid writing less code.
[23:06:15] *** amitev has joined ##java
[23:06:21] <lolzie> I'm not sure if applying design patterns here is really going to reduce complexity
[23:06:25] <ojacobson> lolzie: you have a dependency and you're providing it at creation rather than having things create it directly
[23:06:30] <ojacobson> that's the core of every DI framework out there
[23:06:41] <ojacobson> you can do DI without a framework, and it's just as elegant
[23:06:53] <lolzie> The *immediate* solution is really to have each of these derived classes take the parameter and pass it up via super()
[23:07:01] <kamoricks> Is there a problem with this?
[23:07:01] <ojacobson> That's also the best solution
[23:07:05] <saml> who are creating derived classes?
[23:07:11] <lolzie> ojacobson: okay, cool :)
[23:07:21] <saml> whoever is creating derived has jpanel
[23:07:22] *** Behold has joined ##java
[23:07:47] <lolzie> saml: they're being created in the JPanel itself, which currently I see as passing itself (this) as a parameter to each of the derived constructors
[23:07:54] <saml> to create derived, you need jpanel. because to create derived, you need to create base.. and to create base, you need jpanel
[23:08:23] <saml> then extend jpanel /me hides
[23:08:43] *** hzroot has quit IRC
[23:08:47] <ojacobson> ~~ saml stupid
[23:08:48] <javabot> saml, what you've just said is one of the most insanely idiotic things I have ever heard. At no point in your rambling, incoherent response were you even close to anything that could be considered a rational thought. Everyone in this room is now dumber for having listened to it. I award you no points, and may God have mercy on your soul.
[23:08:52] <lolzie> lol
[23:09:07] <ojacobson> Never before has that been more appropriate
[23:09:27] <ojacobson> Your responses (a) didn't address anything he asked about and (b) were demonstrably worse in the places where they made sense at all
[23:09:42] <ojacobson> I respect your right to share your thoughts, but I'm going to object to having to listen to them :)
[23:09:55] *** linusoleander has joined ##java
[23:10:34] *** BeholdMyGlory has quit IRC
[23:10:48] *** linusoleander has quit IRC
[23:10:58] *** linusoleander has joined ##java
[23:11:17] <_controller> lolzie, what about a mediator design pattern?
[23:11:45] <saml> i agree with ojacobson fully. i'm typing this so that he'll get charged more data bandwidth by his ISP lol
[23:11:46] *** c_axis has joined ##java
[23:11:51] *** craftyfox has joined ##java
[23:12:38] <ojacobson> _controller: That doesn't change the fact that 1. he has a class whose instances depend on a thing and 2. that constructors are usually the best way to express those dependencies
[23:12:43] *** nvictor has left ##java
[23:12:44] <craftyfox> <3 Java <3
[23:12:58] *** rejser has quit IRC
[23:13:04] <ojacobson> Subclasses are subject to the dependencies of their superclasses - either they provide them directly or they have to pass them along as their own dependencies
[23:13:24] <ojacobson> (It's one of the ways "extends" is a tightly-coupled relationship - interface inheritance and composition is more flexible in a lot of cases)
[23:13:39] <lolzie> I think that statement sums it up completely, I just needed to consider it in such coherent terms
[23:13:49] *** LyQuid has quit IRC
[23:14:31] *** Omen_20_ has quit IRC
[23:14:36] <lolzie> Although composition in this case, I believe would still have the same particular issue (the container needing to be passed the arg, to pass on to the object it contains)
[23:14:54] *** cafesofie has joined ##java
[23:15:07] <saml> that's not a problem. that's expressing dependency
[23:15:17] <saml> or you can use DI framework and write some xml files
[23:15:25] <ojacobson> lolzie: well spotted
[23:15:32] <cbeust__> or no XML files if you use Guice
[23:16:32] <lolzie> To be honest, I think most of my stumbling blocks are actually paranoia about trying to be an OO principle purist
[23:16:54] *** Punker has quit IRC
[23:17:32] <ddima> b/win 3
[23:17:37] <ddima> sry :D
[23:17:58] <whaley> lolzie: git'r'done, refactor later. just remember to refactor eventually
[23:18:15] <ojacobson> lolzie: Write code. Think. Read. Learn. Repeat. :)
[23:18:16] <cheeser> get it working. make it pretty.
[23:18:27] <lolzie> Sound advice guys
[23:18:28] <ojacobson> If you never put anything into practice, you won't ever learn what works, no matter how much of the other steps you do.
[23:18:33] <saml> eliminate PermGen issues
[23:18:53] <whaley> eliminate permgen issues, buy an azul box
[23:19:09] <cheeser> use BigMemory!
[23:19:19] <saml> can i use ssd as memory?
[23:19:27] <saml> wait ssd is not still random access
[23:19:31] *** cbrock has quit IRC
[23:19:35] <whaley> saml: yes, it is called a swap file/partition
[23:20:09] <saml> off topic: did you try ssd as your swap to have 100GB of RAM?
[23:20:35] <whaley> saml: no, because I don't have a ssd :( </offtopic>
[23:22:31] *** perlsyntax has left ##java
[23:23:00] <_controller> so im looking for some design books; are these two good: INtroduction to algorithms (CLR), Design Patterns: Elements of Reusable Object-Oriented Software
[23:23:36] <cbeust__> the GOF book is a bit dated IMO, but some of it is still relevant
[23:23:41] <saml> for what purpose?
[23:23:58] *** Ivellina has quit IRC
[23:23:58] *** iik has quit IRC
[23:24:05] *** frangiz has quit IRC
[23:24:22] <ojacobson> Less "dated" and more "heavily inflected by C++'s idiosyncratic problems"
[23:24:27] <saml> are there any design patterns that are so nobel and cleaver that normal programmer would never thought of ?
[23:24:33] <ojacobson> much of it is still useful knowledge, if you can resist the temptation to make your code look like an explosion in the pattern factory
[23:24:49] <_controller> lool
[23:25:00] <_controller> i just like to learn about different approaches
[23:25:09] <ojacobson> saml: Turn that around - are you holding that a normal programmer would think of *all* of them?
[23:25:18] <_controller> granted a regular programmer can come up with some of them
[23:25:23] <_controller> but i like seeing the bigger picture
[23:25:31] <_controller> ojacobson, do you recommenda ny>
[23:25:33] <_controller> any?
[23:25:35] <ojacobson> Several of them (the most useful ones, to my mind) are ways of reframing functional composition techniques in OO languages
[23:25:37] *** mparadise has joined ##java
[23:25:43] *** epalm has quit IRC
[23:25:46] <cbeust__> Every programmer has come up with these DP at some point, the value of the book is naming them and trying to describe them in general terms
[23:25:49] <saml> i mean.. aren't design patterns collection of normal programming idioms.. but GOF gave names to idioms?
[23:25:54] <cbeust__> so pay more attention to the text than the code
[23:25:56] <ojacobson> that's still useful, and being able to describe them in shorthand that's easily understood is also useful
[23:26:34] <cbeust__> I think it's important to know what a facade, visitor or strategy pattern is
[23:26:50] <saml> what's facade and stratege?
[23:27:07] <cbeust__> saml: that's the kind of thing you'll learn from the GOF book :)
[23:27:12] *** Soliah has joined ##java
[23:27:34] *** craftyfox has quit IRC
[23:27:43] <saml> facade is composition?
[23:27:48] <ojacobson> It's all strategies eventually
[23:27:58] *** cbrock has joined ##java
[23:28:09] <ader10> Is there a reason not to import with wildcards other than showing explicitly what you're importing? (does javac import classes that the source doesn't need?)
[23:28:11] <ojacobson> in as much as strategy is the closest to something borrowed directly from function composition, and most of the other behavioural patterns can be reduced to it
[23:28:21] *** lamdk has joined ##java
[23:28:22] <ojacobson> ~star imports
[23:28:22] <javabot> ojacobson, star imports is http://en.wikibooks.org/wiki/Java_Programming/Packages#Wildcard_imports
[23:28:23] <saml> ader10, explicit imports read better
[23:28:33] <ojacobson> read Star imports are a great way to surprise yourself later
[23:28:42] <kamoricks> ader10: It doesn't have any effect on generated code. It's programmer convienence.
[23:28:42] *** cking_nj has joined ##java
[23:28:50] <ojacobson> (the canonical example is java.awt.List vs java.util.List, but there are plenty of others)
[23:28:54] <cbeust__> If you're using a modern IDE, you will never have to worry about imports
[23:29:02] <ader10> kamoricks: Thank you
[23:29:03] <kamoricks> ...Except for the above, which most won't catch.
[23:29:16] <ader10> ojacobson: saml: thank you, too
[23:29:41] <cbeust__> kamoricks: Eclipse can learn which import you use the most often and offer you that one first. I suppose IDEA has that as well
[23:30:09] <kamoricks> cbeust__: Yeah, it does the auto-import, but when you've already got java.awt from another source, the context-inferrence sometimes messes up.
[23:30:20] <cbeust__> kamoricks: true
[23:30:40] *** _controller has quit IRC
[23:30:40] *** Fisiu has quit IRC
[23:30:43] <cbeust__> Personally, I never use Swing or AWT so I told Eclipse never to offer these packages
[23:31:49] *** Johannes13 has quit IRC
[23:32:49] <ernimril> Date from util and sql are also common name clashes
[23:34:45] *** pepone has quit IRC
[23:35:52] *** gtrak has joined ##java
[23:36:35] *** arborist has quit IRC
[23:36:56] *** arborist has joined ##java
[23:37:14] *** zhulikas has joined ##java
[23:37:21] <zhulikas> can i parse html with xml parser?
[23:37:39] <gtrak> are there any restrictions on what file paths an app deployed on Tomcat can open?
[23:37:57] *** TzilTzal has quit IRC
[23:38:03] *** Soliah has quit IRC
[23:38:28] *** Soliah has joined ##java
[23:39:11] <cbeust__> zhulikas: xhtml probably, html... unlikely
[23:39:29] <zhulikas> hmm
[23:40:00] <zhulikas> I need to parse only <head> part of a page and search for links to rss feeds.
[23:40:24] *** eoss has quit IRC
[23:40:25] <zhulikas> so link doesn't have a </list> part I gues.. It must end with />
[23:40:37] <odinsbane> zhulikas: use an html parser.
[23:40:49] <cbeust__> Like neko
[23:40:53] <cbeust__> ~~html parser
[23:40:53] <javabot> The user html is not on ##java
[23:41:02] <cbeust__> ~html parser
[23:41:02] <javabot> cbeust__, html parsing is best accomplished with one of - NekoHTML @ http://sf.net/projects/nekohtml - HTML Parser @ http://htmlparser.sf.net/ - TagSoup @ http://home.ccil.org/~cowan/XML/tagsoup/ - JTidy @ http://jtidy.sf.net
[23:41:04] <zhulikas> There are so many parsers...
[23:41:22] <zhulikas> ok, I'll look into neko then
[23:41:24] <zhulikas> thanks
[23:41:58] <zhulikas> uhm... yeah. I need a library
[23:42:04] <ernimril> zhulikas: if you get html from the internet you want a parser that handles oddities, people tend to be very creative when they build html sites
[23:42:04] <zhulikas> neko seems to be a complete application :)
[23:42:26] *** ojacobson has quit IRC
[23:43:27] <TheWarrior> zhulikas, neko is a library, same as the others described in the factoid
[23:43:54] *** TheSchoolinator has quit IRC
[23:44:05] *** Junior has quit IRC
[23:44:05] <zhulikas> library with a size of 9MB? seriously?
[23:44:32] <cbeust__> Parsing sloppy HTML is surprisingly complicated
[23:44:41] <TheWarrior> with dependencies, why not
[23:45:00] <ernimril> zhulikas: does the size matter? (it may or it may not)
[23:45:10] <bearded_oneder> parsing HTML is complicated - period.
[23:45:11] <zhulikas> It's going to be an android application
[23:45:23] <cbeust__> I was going to say: unless it's for mobile you shouldn't care
[23:45:51] <kamoricks> There's only about five valid closing tags for <link, so you could just read until you hit one of those.
[23:46:14] <ernimril> kamoricks: now you assume well formed html and html has never been well formed
[23:46:17] <kamoricks> ( />, >, </link>, </head>, </body>, and EOF are the ones that come to mind.)
[23:46:27] <kamoricks> ernimril: It's suprisingly hard to get un-well-formed HTML4.
[23:46:28] <ernimril> kamoricks: quote handling
[23:46:34] <kamoricks> Oh. Right.
[23:46:41] <ernimril> kamoricks: double << or double >>
[23:46:47] <cbeust__> If all he wants is the rss links, might be worth rolling your own implementation
[23:46:48] <ernimril> kamoricks: (yes, they are not that uncommon)
[23:46:49] *** zatan has quit IRC
[23:46:49] *** hellyeah has quit IRC
[23:47:06] *** Versuchen has quit IRC
[23:47:34] *** Matic`Makovec has quit IRC
[23:47:35] <ernimril> zhulikas: there is small html parser/lexer in my proxy, you might want to take a look at it, at least it has been used for a long time and seems to work ok with whatever I throw at it
[23:47:49] <ernimril> zhulikas: you would have to rip out only that part though
[23:47:50] *** odinsbane has quit IRC
[23:47:51] <TheWarrior> zhulikas, the library itself is 128k
[23:47:58] <ernimril> ~~zhulikas rabbit
[23:47:58] <javabot> zhulikas, rabbit is a web proxy used to speed up slow connections. For more information see: http://www.khelekore.org/rabbit/
[23:48:24] <ernimril> zhulikas: the html parsing weigh in at 1390 lines of code in total
[23:49:42] *** peeps[lappy] has quit IRC
[23:50:56] *** ormaaj has quit IRC
[23:51:12] <gtrak> is it possible to load an arbitrary file outside of the classpath from within Tomcat?
[23:51:12] *** TheSchoolinator has joined ##java
[23:52:18] <TheWarrior> gtrak, an arbitrary class file?
[23:52:44] <gtrak> just a properties file
[23:53:15] <ernimril> gtrak: you can use File and InputStream if you want to, most developers will probably think that you are insane, but technically it works
[23:53:29] <TheWarrior> gtrak, shouldn't be a problem - it won't be portable, and it's recommended not to, but nothing stops you from doing it.
[23:53:30] <gtrak> hmm
[23:53:40] *** cbeust__ has quit IRC
[23:53:56] <gtrak> so technically, if you use File, you can do it? there's no protection?
[23:54:08] <TheWarrior> nope.
[23:54:37] <petisnnake> What do I need to do to throw my own exception, besides marking the method with throwable MyException?
[23:54:41] <TheWarrior> the only protection is the developers common sense, and the recommendation against it.
[23:54:49] *** amimusa has quit IRC
[23:54:57] <cyth> well
[23:55:13] <cyth> I wouldn't recommend against it. it's a war file?
[23:55:23] <cyth> you redeploy a war file, everything is removed
[23:55:30] * bearded_oneder begins work on a "managed" code API for the JVM.
[23:55:38] <gtrak> petissnake, create a class that extends exception
[23:55:41] <kamoricks> petisnnake: "throw new MyException", and MyException needs to extend Throwable (but preferably either Exception or MyException)
[23:55:42] <bearded_oneder> ;-)
[23:55:43] <cyth> so if you want to use the file system for persistent data of any kind... doing it in the war classpath is foolish.
[23:55:52] *** adamcopp has joined ##java
[23:55:59] <gtrak> correct
[23:56:09] <kamoricks> bearded_oneder: Java security managar is pluggable, so all you really need to do is install one that suits your needs. Unless you mean managed in the way C++/CLI means managed, in which case, there's already one.
[23:56:27] <TheWarrior> cyth, yep, you shouldn't use the filesystem for persistent data in a Java EE application
[23:56:28] <petisnnake> kamoricks: thanks!
[23:56:30] <gtrak> my case is I'm passing in a file URI for properties through a jvm parameter
[23:56:40] <gtrak> but it doesn't seem to be working, trying to figure it out
[23:57:02] <gtrak> it's supposed to work, I'm learning an existing codebase :-), so I'm doing something wrong obviously
[23:57:03] <cyth> TheWarrior, then what? filesystem is just as viable for persistent data for some applications, just as much as a DB.
[23:57:05] <bearded_oneder> i meant the latter and it was a joke. i subscribe to TheWarrior's philosophy about developer responsibility.
[23:57:22] <cyth> what's the difference between a rdbms and the filesystem?
[23:57:30] <paissad> guys, basically, i have something like this http://pastebin.com/MxkfQijC
[23:57:30] <paissad> here is the class containing the method main() http://pastebin.com/A4kkxy2A
[23:57:31] <paissad> at line 15 in the method main(), i would like to pass through that thread and let the process continue, in other words, i would like to see "test2" and "test3" ...
[23:57:31] <paissad> here is what i get http://pastebin.com/ayEddK26
[23:57:45] <kamoricks> cyth: It's a lot harder to put an update trigger on a filesystem.
[23:57:55] <paissad> how should i proceed in order to pass through line 15 without stopping that thread ?
[23:57:59] <TheWarrior> cyth, you should use a managed resource - be it an javax.sql.DataSource, or something else
[23:58:01] <adamcopp> Hi folks. I have a list of rooms, which each need to know their own ID, but must be stored in a list by ID. I really want to avoid duplicating the ID in the room and the list. Is there a better option?
[23:58:20] <cyth> kamoricks, sometimes it's not needed. and storing large binary blobs is way more foolish
[23:58:21] <paissad> btw, there is an equivalent of "while(true)" in the class MuezzinCallDaemon
[23:59:03] <cyth> TheWarrior, so as long as a the filesystem is a "managed resource" it's ok?
[23:59:03] <TheWarrior> cyth, you could implement your own Resource, with your own custom API, and use it to do whatever you want
[23:59:30] <TheWarrior> cyth, yes, as long as it lives outside the scope of your application
[23:59:51] <kamoricks> paissad: Runnables are not threads. You want to create a new Thread around that Runnable, and call .start() on it. Or use an ExecutorService.
top

   February 1, 2011  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | >