Switch to DuckDuckGo Search
   March 6, 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 | 29 | 30 | 31 | >

NOTICE: This channel is no longer actively logged.

Toggle Join/Part | bottom
[00:00:00] <TomyLobo> if you use eclipse, just press F1
[00:00:19] *** plarsen has quit IRC
[00:02:07] *** ModusPwnens has quit IRC
[00:02:35] <TomyLobo> Description Resource Path Location Type
[00:02:36] <TomyLobo> Type safety : A generic array of Map<String,Iterable<String>> is created for a varargs parameter JailEngine.java /yiffbukkit/src/de/doridian/yiffbukkit/jail line 110 Java Problem
[00:02:51] <TomyLobo> oh nice, way too much info
[00:03:21] <TomyLobo> "Type safety : A generic array of Map<String,Iterable<String>> is created for a varargs parameter" - what does that warning mean?
[00:03:51] *** echo_mirage has quit IRC
[00:04:00] <TomyLobo> sections.put("inmate "+entry.getKey(), Arrays.asList(section));
[00:04:13] <TomyLobo> this is the line that is from
[00:05:34] *** frangiz has quit IRC
[00:05:48] *** nixness has quit IRC
[00:06:04] <dextro_> ah ty
[00:06:06] <davidmogar> how can I set the cookie in a post request with urlconnection?
[00:06:16] <dextro_> what about while in a loop like: for ( org.bukkit.entity.Player p : plugin.getServer().getOnlinePlayers() )
[00:07:03] <dextro_> is there a easy way to check if you are on the last cycle of the loop
[00:07:17] <dextro_> or do i need to add a counter
[00:07:25] <dextro_> and check .length
[00:07:40] <TomyLobo> dextro_ you're concatenating them, right?
[00:07:49] <TomyLobo> there is no easy way to determine the last
[00:07:55] <TomyLobo> but there is one for the first
[00:12:56] *** namidark has joined ##java
[00:13:25] <TomyLobo> dextro_ you should come to #bukkitdev on esper
[00:24:43] *** davidmogar has quit IRC
[00:26:36] *** Scorchin has quit IRC
[00:26:52] *** Tashtego has joined ##java
[00:27:09] *** uestra has quit IRC
[00:29:30] *** `moebius` has quit IRC
[00:29:30] *** X-Scale has joined ##java
[00:32:09] <dextro_> im there TomyLobo :P
[00:32:19] <dextro_> my questions are more java though as im learning
[00:32:33] *** supercosmonaut has quit IRC
[00:39:10] *** sphenxes has quit IRC
[00:39:54] *** Bombstone has quit IRC
[00:40:01] *** zatan has quit IRC
[00:42:01] *** Tashtego has quit IRC
[00:42:18] *** gucko has joined ##java
[00:42:20] <gucko> hi guys
[00:43:19] <gucko> if I'm using a jar lib with Servlets, should I added to the descriptor or something? Because I'm getting a java.lang.NoClassDefFoundError
[00:43:26] <gucko> *add
[00:43:31] <gucko> *it
[00:43:49] <lf94> Hey guys, the compiler tells me I have no identifier yet I do, what the hell? What should I do?: http://pastebin.com/31GpSDMw
[00:44:10] *** PelleTut has quit IRC
[00:44:33] *** demifuror has quit IRC
[00:45:18] <wyvern> lf94, what line
[00:47:56] <Planck_> What is "import java.util.ArrayList;
[00:47:56] <Planck_> import java.util.List;
[00:47:56] <Planck_> import java.util.Timer;
[00:47:56] <Planck_> import java.util.TimerTask;
[00:47:59] <Planck_> Crap.
[00:48:08] <Planck_> #
[00:48:17] <Planck_> What is "import java.awt.geom;" supposed to do?
[00:50:19] *** monty_hall has joined ##java
[00:51:20] *** Soliah has joined ##java
[00:53:12] *** gemelen has quit IRC
[00:54:38] *** kbotnen has joined ##java
[00:56:55] *** fisted_ has joined ##java
[00:58:00] *** obvivity has joined ##java
[00:58:02] *** fisted has quit IRC
[00:58:51] *** glcrazy has quit IRC
[01:02:00] *** PhoenixSTF has quit IRC
[01:03:17] *** kieran491 has left ##java
[01:04:39] *** io2 has quit IRC
[01:04:59] *** aitd has joined ##java
[01:05:32] *** rretzbach has quit IRC
[01:07:22] <bearded_oneder> Planck_: do you mean that particular class or the "import" keyword?
[01:08:30] *** obvivity has quit IRC
[01:08:44] *** cool123 has quit IRC
[01:09:13] <dextro_> what would be the best method to remove last 3 chars of a string
[01:09:28] <RLN> substring?
[01:09:30] *** DbPs2AOBH has joined ##java
[01:09:37] <RLN> bearded_oneder, you're not referencing any class to import
[01:09:42] *** QshelTier is now known as Bombe
[01:10:00] <RLN> or rather.. whoever asked the question
[01:10:43] *** Kamaran has quit IRC
[01:14:27] *** pyrony has joined ##java
[01:15:17] *** arborist has quit IRC
[01:16:48] *** DbPs2AOBH has quit IRC
[01:19:12] *** Determinist has quit IRC
[01:20:19] *** hyppias has quit IRC
[01:20:29] *** Rainier has joined ##java
[01:21:07] *** sphenxes01 has joined ##java
[01:21:24] *** bijoo has joined ##java
[01:22:08] <bearded_oneder> dextro_: s.substring(0, String.length()-3)
[01:22:38] <bijoo> Hi, Anyone recommend a laptop for J2ee development?
[01:22:49] <bearded_oneder> where s is the String to truncate
[01:23:18] <bijoo> dextro_ : String.length() is not going to work
[01:23:37] <Bombe> Also, this will fail if s has less than three characters.
[01:23:51] <Bombe> bijoo: It should be a laptop that works.
[01:23:53] <bijoo> Unless String is your variable name, which is not tho convention.
[01:24:08] <bijoo> Bombe: Yea, but do you recommend any specific one?
[01:24:17] <Bombe> bijoo: One that is not broken?
[01:24:20] *** DbPs2AOBH has joined ##java
[01:24:53] <bijoo> Bombe: The one my company has given me works, has ~3GB ram, Dell Latitude D626, but I want something better.
[01:24:55] <bearded_oneder> {rolling eyes} where "String" is the String to truncate and where "s" or "String" is longer than three characters.
[01:25:01] <Bombe> bijoo: Then get something better.
[01:25:03] <bijoo> Bombe: It doesn't have SSD
[01:25:05] *** Nikelandjelo has quit IRC
[01:25:05] *** Versuchen has quit IRC
[01:25:13] <Bombe> bijoo: Then get one with an SSD.
[01:25:16] <bijoo> Bombe: Do you recommend anything?
[01:25:40] <bearded_oneder> s.substring(0, s.length()-3) where s.length > 3 :-P
[01:25:59] <Bombe> bijoo: Now that you ask the same stupid question for the third time, yes. Don’t get a machine with a CPU faster than 1.8 GHz, Java can not handle that.
[01:26:09] *** kbotnen has quit IRC
[01:27:50] <bijoo> Bombe: What do you mean "Java can not handle that."?
[01:28:13] <Bombe> bijoo: It stops working mysteriously so don’t get a faster laptop.
[01:28:27] <Bombe> bijoo: Some old Fujitsu or Toshiba will do nicely, though.
[01:28:35] <Bombe> bijoo: Stay away from more recent Dell machines, though.
[01:28:41] <Rainier> Wth? I ran Eclipse off of a 1.6Ghz laptop, there's nothing wrong with that.
[01:28:42] <Bombe> Also, less though.
[01:28:54] <Bombe> Rainier: Sure. 1.6 GHz < 1.8 GHz so you’re all set.
[01:28:58] <bijoo> Rainier: Bombe woke up on the wrong side of the bed last night.
[01:29:17] <Rainier> Bombe, oh, I get what you're saying. Java can definitely handle more than 1.8Ghz, and even multiple cores! You're off your rocker.
[01:29:24] <Rainier> Have the squirrels come to take you away yet?
[01:29:35] <Rainier> bijoo, I see that.
[01:29:43] <bijoo> Rainier: I meant this morning* haha
[01:29:45] <bijoo> ;)
[01:29:59] <Bombe> Rainier: Great. Then you do recommend a single laptop that is suited for j2ee development.
[01:30:17] <Rainier> bijoo, either way, meaning got. hey, well, you know some people sleep most of the day and get up to work at night :P
[01:30:27] <Rainier> Bombe, any. I don't see why one would be less suited than another.
[01:30:28] <bijoo> Rainier: hehe, true that.
[01:30:34] *** kbotnen has joined ##java
[01:30:40] <Rainier> Bombe, I wouldn't recommend you run a public server off of one, though ...
[01:30:48] <Rainier> but I'm sure it's been done.
[01:31:03] <Bombe> Rainier: Well, I know that, tell it to bijoo.
[01:31:19] <Rainier> Bombe, you were the one complaining.
[01:31:46] <Bombe> Rainier: “but I want something better” was not uttered by me. :)
[01:32:07] <Rainier> Well, "better" is a very relative term. :)
[01:32:36] *** kriko has joined ##java
[01:33:03] <bijoo> Bombe: Point taken. I see it is relative, but why would you give bad advice?
[01:33:19] <bijoo> Thanks Rainier.
[01:33:23] *** bijoo has quit IRC
[01:33:25] <Rainier> I could do renders on that 1.6 laptop, but they took 4 hours :P
[01:33:38] <Rainier> (for a good one)
[01:33:45] *** IanWizard has joined ##java
[01:33:55] <Bombe> Well, I tried.
[01:34:27] <Rainier> Which sucked, because I screwed up the settings on one try, another try the fan-pad was unplugged and so it shut itself off to protect itself, and the third time I finally got it :P
[01:34:51] *** IanWizard has quit IRC
[01:35:35] *** firefly2442 has joined ##java
[01:35:56] <Bombe> Rainier: At least you’re persistent. :)
[01:36:33] <Rainier> I wasted 4 hours to get to the 3rd attempt. I wasn't giving up :P
[01:37:26] *** tigger0jk has joined ##java
[01:37:47] <Rainier> Now if I could only get better at the stuff I make to render ... but that's a different problem. ;)
[01:38:07] <firefly2442> I have a Java Date object as a member property of a class, when I get the time (epoch) it's always returning the same value, how can I get it to update?
[01:38:31] <Rainier> Dates are a point in time, and they're also immutable.
[01:38:47] <Rainier> So if you want to update it you need to create a new Date object with the time desired and assign it to that field.
[01:39:07] <wyvern> Dates are not immutable.
[01:39:53] <Rainier> oh, oop. they do have setters. sorry.
[01:39:54] <wyvern> If possible, use Joda time instead of JDK's Date or Calendar.
[01:40:16] <Rainier> yeah. I think I was thinking of Joda Time, they are immutable iirc.
[01:40:27] <wyvern> yes, joda time DateTime is immutable
[01:40:50] <firefly2442> thank you
[01:40:56] <Planck_> The only non-deprecated setter on Date is setTime()
[01:41:16] <Rainier> Right, if you're dealing with just the long integer representations of Date, that's fine.
[01:41:34] <Planck_> But yes, a Date object represents a fixed moment in time
[01:41:41] <Rainier> Somewhere I found the JavaDoc for the progress so far on what could be the Calendar replacement by the guys that did Joda. It was awesomely (and not in a good way) "Western world" centric.
[01:41:57] <wyvern> Rainier, talking about JSR310?
[01:42:06] <Rainier> yeah.
[01:42:54] <Rainier> I saw a talk they gave on it (video with slides interspersed) and what they said sounded good, but I'm not entirely sure they "got it right", but since that API isn't done nor fixed, hey with time maybe ...
[01:43:35] *** amnesiac has joined ##java
[01:44:15] <Rainier> and it's definitely hard (especially for something like Dates, Times, etc) to get an API just right.
[01:44:16] *** CodeWar has joined ##java
[01:45:27] *** ogl92 has joined ##java
[01:45:40] <Rainier> So in a way I guess I'm happy they didn't just say "hey, move Joda Time in to replace" and instead said "we can learn from all that's been done before this and make JSR310 even better"
[01:46:04] * Rainier returns to hacking on some code :P
[01:46:08] <Planck_> There are so many calendar systems :(
[01:46:31] <Rainier> Planck_, APIs or Gregorian, Julian, etc?
[01:46:33] *** mrapple has joined ##java
[01:46:43] <Planck_> The latter
[01:46:51] <Rainier> ah, well, that's what makes it hard.
[01:47:38] <mrapple> if i do hasmap.put(something, another); will it update the value of another, or add an extra something=>another
[01:47:43] <Rainier> if you only cared about the minimum necessary to create a system that worked with a single well-accepted calendar system, I'm sure you could make something simple, easy, and concise :)
[01:48:24] <Rainier> mrapple, it will store a pairing of something to another, so you can later do get(something) and get back another, but it does not change another.
[01:48:34] <Planck_> mrapple: Conceptually, remove any previous mapping for 'something' and add a new mapping something=>another
[01:48:36] <Rainier> If another is a primitive type, it may autobox it to a wrapper.
[01:48:55] <mrapple> Planck_: is that what it does or do i need to remove it first
[01:49:02] <Planck_> That is what it does do
[01:49:03] <Rainier> automatic overwrite
[01:49:09] <mrapple> oh k good
[01:49:19] *** xiliax has quit IRC
[01:49:21] *** aitd has left ##java
[01:49:22] <ogl92> Hi, just question about Expression Language using stripes framework
[01:49:25] <Planck_> It says so right in the docs.
[01:49:33] *** mrapple has left ##java
[01:49:39] <Planck_> "If the map previously contained a mapping for the key, the old value is replaced by the specified value."
[01:49:53] <Rainier> he left :P
[01:49:59] <Planck_> Yeah :-/
[01:51:09] <ogl92> Is it possible to call a method with string parameter from jsp as ${actionBean.methodName('stringparameter')} ?
[01:51:27] <ogl92> I'm use StripesFramework.
[01:52:01] *** monty_hall has left ##java
[01:52:25] *** ScottishPig has joined ##java
[01:52:59] *** Fuco has quit IRC
[01:54:30] *** DbPs2AOBH has quit IRC
[01:54:33] *** hanstech has quit IRC
[01:57:39] *** user17 has quit IRC
[01:57:44] *** t0rc has joined ##java
[01:57:50] *** amnesiac has quit IRC
[01:59:15] *** DJClean has quit IRC
[02:00:39] *** mrapple has joined ##java
[02:00:51] <mrapple> i clearly define public String getBlock(String who) {
[02:01:01] <mrapple> yet i get incompatible types
[02:01:03] <mrapple> saying required: java.lang.Integer
[02:01:42] <mrapple> hm return blocks.get(who); and heres my hasmap HashMap<String, Integer> blocks = new HashMap<String, Integer>();
[02:02:01] <mrapple> it says im sending an integer, but im sending a string? this is confusing -_-
[02:02:23] <RLN> paste your code
[02:02:29] *** wraithguard01 has joined ##java
[02:02:46] *** wraithguard01 has quit IRC
[02:03:32] <Planck_> blocks.who(who) does return an Integer.
[02:03:40] <Planck_> Err, .get(who)
[02:03:48] <mrapple> oh
[02:03:49] <mrapple> dur
[02:04:03] <mrapple> haha thanks Planck_ i see my mistake now :P
[02:09:29] *** topriddy has joined ##java
[02:12:08] *** jfisk1987 has joined ##java
[02:12:11] <jfisk1987> hey guys
[02:13:04] <jfisk1987> newbie question, im using an enhanced for loop for the first time so instead of (int i=0;array.length;i++) { "print value of i here") im doing (int i:array) { "show vlaue of i here" } but its not working the same
[02:13:11] <jfisk1987> the value of i never changes from 0
[02:13:36] <Rainier> Did you fill the array with anything?
[02:13:45] <CodeWar> :)
[02:13:49] <Rainier> The "for each" loop has no concept of indexes.
[02:14:25] <jfisk1987> theres null entries
[02:14:47] <jfisk1987> the for loop actually builds up the array, but its initialized with 10 entries
[02:14:49] <Rainier> Wouldn't that result in an NPE when trying to autobox from Integer to int then?
[02:14:52] *** supercosmonaut has joined ##java
[02:15:14] <jfisk1987> 1 sec ill post code
[02:15:19] <Rainier> yeah, you don't want to use a "for each" loop to build up something. That's for iterating over an existing item.
[02:15:22] <Rainier> (pastebin please)
[02:15:31] <Rainier> existing items*
[02:15:58] *** Railgun has quit IRC
[02:16:04] <jfisk1987> this is what i have now: http://pastebin.com/WVYMDxx9
[02:16:21] *** Caleb-- has quit IRC
[02:16:31] <Rainier> jfisk1987, yeah, that won't work.
[02:16:41] <jfisk1987> heres the standard for loop version that works:
[02:16:41] <Rainier> The "for each" loop operates on the idea of an Iterator.
[02:16:49] <Rainier> So there are no indexes.
[02:17:07] <Rainier> Since your arrays were declared of type "primitives char" all the indexes defaulted to '0'
[02:17:12] <jfisk1987> http://pastebin.com/UF4TL88L
[02:17:35] <Rainier> and so when you ran the "for each" loop, it casted each char back to an int, and thus you printed out 0.
[02:18:13] <Rainier> As I said, you don't really want to use a "for each" loop to build up an item you're iterating over, it's more for iterating over a collection/array that is already initialized with what you want.
[02:18:23] <jfisk1987> ok
[02:18:31] <jfisk1987> so in this case stick with the "standard" for loop
[02:18:45] <jfisk1987> and use the enhanced on an array already setup
[02:19:37] <RLN> you're not really building it up if the buffers are the same length anyway
[02:20:13] <CodeWar> p
[02:20:27] <jfisk1987> k thanks guys
[02:20:28] *** CodeWar has left ##java
[02:20:30] <jfisk1987> have a good weekend!
[02:20:31] *** jfisk1987 has quit IRC
[02:23:15] *** topriddy has quit IRC
[02:25:54] <lf94> wyvern, starting from byte[] r;
[02:26:25] *** svm_invictvs- has quit IRC
[02:30:58] <mrapple> this is a noob question, but how do i make a new HashMap(); with bytes already in it? :D
[02:31:10] <mrapple> er HashSet i mean
[02:31:44] *** flippo has joined ##java
[02:32:08] <mrapple> or should i just do .add()
[02:33:22] <Rainier> Just use .add, though there might be a copy constructor if you have an existing one ...
[02:34:48] <Planck_> If you already have the bytes in an array, you can wrap it in a List and use addAll
[02:35:43] <Planck_> Or the Collection constructor for HashSet
[02:36:13] <Rainier> I'd think the Collections API would return an immutable HashSet?
[02:36:25] *** L-----D has joined ##java
[02:36:28] <Rainier> iirc, pretty much everything that comes out of those initialization methods are unmodifiable
[02:36:44] <Rainier> is unmod*
[02:36:46] *** wcfs96 has joined ##java
[02:36:56] <Planck_> Sure, but that's just a transition step, not modified
[02:37:23] <Rainier> well, you could do new Item(Collections.makeItem(...)) ... but I think that's a little verbose.
[02:37:43] <Rainier> and it means you're copying the data out of the Collections instance.
[02:37:54] <Planck_> E.g. something like Set<Byte> set = new HashSet<Byte>(Arrays.asList(byteArray));
[02:38:27] <mrapple> Planck_: thats exactly what im looking for
[02:38:36] *** wchun has joined ##java
[02:39:44] <flippo> Not looking for a ByteBuffer?
[02:39:49] *** pZombie has joined ##java
[02:39:57] <Planck_> Except it doesn't work due to byte[] being primitive and not generic
[02:40:10] *** Guest95104 has quit IRC
[02:41:01] <Planck_> It works for arrays of non-primitive objects
[02:41:32] *** plarsen has joined ##java
[02:42:01] <mrapple> ok maybe that wasnt what i was looking for, heh
[02:42:42] <mrapple> code and error .... http://pastebin.com/yu1WRptV
[02:43:07] <pZombie> has anyone worked with JNI and loading dlls? I see that there is no way to unload a dll, and my program which records displays some strange behavior. Recording fine the first time, yet all subsequent recordings seem to either work or not work, seemingly random. I would like to reload the dll, but this is no option in java.
[02:43:18] <mrapple> wait this error too http://pastebin.com/BqxyzanG
[02:43:40] <pZombie> Should i just create a new instance of the class which is using the dll? Would that equal reloading it?
[02:44:07] <Planck_> mrapple: Yes, Set is just an interface. You need a concrete type, e.g. HashSet or TreeSet
[02:44:34] <Planck_> pZombie: I have no idea how JNI interacts with .dlls
[02:44:52] <mrapple> Planck_: so Set<Byte> transparent_ids = new HashSet<Byte>(Arrays.asList(byteArray));
[02:44:56] <mrapple> ?
[02:45:08] <Planck_> Only if byteArray is of type Byte[]
[02:45:12] <Planck_> and not byte[]
[02:46:05] <pZombie> Me neither, but on second thought, i would run into other issues if i had to reload it, since i am using jintellitype for global keys, and it fails to create a d3d device within the dll when i call it from within a game window
[02:46:21] <mrapple> got it
[02:46:26] <mrapple> Planck_: now my only error is getTargetBlock(java.util.HashSet<java.lang.Byte>,int) in org.bukkit.entity.LivingEntity cannot be applied to (java.util.Set<java.lang.Byte>,int)
[02:46:53] <mrapple> which can be resolvevd with HashSet<Byte>
[02:46:57] <mrapple> huzzah it compiled >:D
[02:47:07] *** emet has joined ##java
[02:47:39] <mrapple> stop
[02:47:42] <mrapple> oops wrong window
[02:47:47] <Planck_> WT sort of API asks for a HashSet?
[02:48:27] *** tewecske has quit IRC
[02:48:52] <mrapple> Planck_: obviously this one...
[02:48:53] <mrapple> :P
[02:48:55] <Planck_> Apparently, a bukkit sort of API :-/
[02:48:59] <mrapple> heh
[02:49:53] <Planck_> That's bad API design, asking for concrete types when an interface is available and standard :-(
[02:50:14] <mrapple> dont talk to me, talk to the folks on irc.esper.net #bukkit :P
[02:50:23] <mrapple> or submit a pull request :P
[02:50:48] <Rainier> Why not you?
[02:50:53] <Planck_> I can't be bothered fixing the world's bad API's, it's your problem not mine :-)
[02:51:12] <mrapple> heh its not my problem any more
[02:51:17] <mrapple> it compiles, thats all i can ask for :P
[02:51:49] * Rainier .oO( Seriously? )
[02:56:35] *** surial has joined ##java
[03:02:08] *** teralaser has quit IRC
[03:04:59] *** wcfs96 has left ##java
[03:06:29] *** giantrobot has joined ##java
[03:07:01] <giantrobot> is this the place to ask grails questions or is there a better channel?
[03:08:11] <lf94> Hey guys, why does this give me an <identifier> expected error?: r = new byte[4];
[03:08:29] <Rainier> giantrobot, just ask.
[03:08:44] <Rainier> though you might find better help in a specific channel for that.
[03:09:24] <Rainier> lf94, if you haven't defined the variable "r" in some prior code that is scope visible to the line being executed, you need to supply a type.
[03:09:34] <giantrobot> im new to grails, ive got gorm setup and talking to my mysql db perfectly. im using richui, specifically the autocomplete tags that draws data from my database and autocompletes a list. my issue is its slow, i suspect because its querying a 100k record table.
[03:09:51] <lf94> Rainer, r is a byte array defined with: byte[] r;
[03:09:56] <lf94> rainier*
[03:10:27] <Rainier> lf94, then you may have to pastebin the relevant code and the error as given.
[03:10:32] <giantrobot> im trying to figure out if i can delay the query, i.e. not launch it with ever inserted/deleted character, but instead on the 3 character entered, or should i be looking at a caching technique?
[03:10:42] <giantrobot> *every
[03:10:44] <Rainier> The compiler errors usually have an arrow pointing into the line that is the problem.
[03:10:45] <lf94> Rainier, the same error shows up countless times for other variables too.
[03:11:04] *** psst has quit IRC
[03:11:13] <lf94> But will do.
[03:11:39] <Rainier> lf94, then there is probably something missing that's not being noted here. can you pastebin the relevant code or (better) make a test-case with the same compile problem?
[03:12:16] <lf94> Yep, pastebinning
[03:12:27] <lf94> Just run javac mycode.java and the same errors will show
[03:13:19] <surial> lf94: Just a general hint: Debugging your first steps into java on an IRC channel is not going to work as well as one might imagine.
[03:13:54] <lf94> surial, I thought I might be doing something extremely simple, wrong.
[03:14:55] <lf94> Rainier: pastebin.com/Vf7cEiNS
[03:15:32] <Rainier> Yeah, you can't execute code like that outside of a method.
[03:15:50] <lf94> Where
[03:15:57] <Rainier> class bodies can only contain fields, methods, or other class definitions.
[03:16:15] <lf94> Oh I can use statements, ok
[03:16:17] <Rainier> Lines 35-38
[03:16:23] <lf94> Yep gotcha
[03:16:24] <lf94> Thanks :D
[03:16:37] <lf94> can/cant
[03:16:53] <lf94> wait, my first few work though...
[03:16:59] <lf94> int GB_WIDTH = 160;
[03:17:04] <Rainier> That's a field.
[03:17:17] <lf94> r = new byte[4] isnt?
[03:17:20] <lf94> What if I did
[03:17:28] <Rainier> no, that's an assignment to the field "r"
[03:17:28] <lf94> byte[] r = new byte[4];
[03:17:35] <Rainier> that is possible, yes.
[03:17:47] <lf94> Ok, thanks again :)
[03:18:06] *** deadbeef has joined ##java
[03:18:26] <Rainier> byte[] r = ...; is a field declaration, whereas "r = ...;" is an statement.
[03:18:45] <deadbeef> guys, i've an abstract class and a few classes extending it; i'm implementing a clone() method for all of them, should i new the new object inside the metod or just invoke super.clone() ?
[03:19:16] * Rainier recommend using a different pattern instead of clone.
[03:19:25] <deadbeef> Rainier: which one ?
[03:19:29] <Rainier> Clone is just broken.
[03:19:29] *** ogl92 has quit IRC
[03:19:39] <Rainier> deadbeef, copy constructors is another valid pattern.
[03:19:45] *** Carnage\ has quit IRC
[03:19:55] <deadbeef> Rainier: isn't clone a way to implement the copy constructor in java?
[03:20:08] <deadbeef> i was thinking it was the "most standard" way
[03:20:11] <Rainier> copy constructors are not the same as clone, no. clone is a broken pattern.
[03:20:20] <Rainier> ~clone
[03:20:20] <javabot> Rainier, clone is making deep copies of objects http://mindprod.com/jgloss/clone.html
[03:20:29] <Rainier> blah. not the article I wanted.
[03:20:50] <Rainier> In essence, there's very few almost no reasons at all to use clone over something like copy constructors.
[03:21:06] <deadbeef> ah maybe you mean passing the object you want to copy to the new object's constructor
[03:21:12] <Rainier> yes.
[03:21:22] <lf94> Hm I probably dont have java.awt installed...
[03:21:24] <Rainier> and there is precedence for it in Java, so it's not new.
[03:21:57] <deadbeef> you're right, i'll do it that way
[03:21:58] <deadbeef> thanks
[03:22:12] <Rainier> :)
[03:23:22] <Rainier> ~info clone
[03:23:22] <javabot> clone was added by: tieTYT on 07-06-2010 at 8:49 PM, EDT and has a literal value of: making deep copies of objects http://mindprod.com/jgloss/clone.html
[03:24:45] <Rainier> ~no, clone is making copies of objects ( http://mindprod.com/jgloss/clone.html ). Also read Josh Bloch on "Copy Constructor versus Cloning": http://www.artima.com/intv/bloch13.html
[03:24:45] <javabot> OK, Rainier.
[03:25:37] <Rainier> ~no, clone is making copies of objects ( http://mindprod.com/jgloss/clone.html ). Also read an interview of Josh Bloch on why to use a "Copy Constructor versus Cloning": http://www.artima.com/intv/bloch13.html
[03:25:37] <javabot> OK, Rainier.
[03:26:10] <Rainier> I <3 Google :) first search found that article again.
[03:27:07] *** Sliker has quit IRC
[03:30:59] *** Mkop has joined ##java
[03:32:20] *** Matuku has joined ##java
[03:33:14] *** rfw has joined ##java
[03:33:33] <rfw> hi there, has anyone had java segfault with longest_match in libz
[03:33:39] <rfw> http://pastebin.com/VzFRr5yP trace
[03:33:40] *** dj_pi has joined ##java
[03:40:29] *** CodeWar has joined ##java
[03:45:35] *** halhorn has quit IRC
[03:51:00] *** detinho has joined ##java
[04:00:33] *** TomyLobo has quit IRC
[04:02:04] *** encKe has joined ##java
[04:04:20] *** CodeWar has quit IRC
[04:10:28] <Planck_> No, I've never seen that.
[04:11:37] <Planck_> It would be interesting to see what happens if you feed the inflater completely random data (not a result of compressing anything)
[04:12:20] <EricInBNE> Is there a collections class in java for O(n) lookups with small item counts? eg... Collection<String, File, Integer, Arbitrary> table
[04:12:59] <Planck_> You mean like a database?
[04:13:12] <EricInBNE> Planck_, in memory
[04:13:24] <EricInBNE> but if that fits your def'n yes.
[04:13:26] <Planck_> Some databases operate in memory
[04:14:15] <Planck_> It's pretty hard to specify typesafe tuples of arbitrary length
[04:14:47] <Planck_> The standard Java API doesn't have such a thing
[04:15:13] <EricInBNE> ok, just curious if that existed...get bored with creating custom classes & ArrayLists
[04:15:42] <Planck_> There are in-memory databases implementations though
[04:16:21] <EricInBNE> such as? java seems like a bad lang for something like that ..eg gc
[04:16:37] <Planck_> They tend to use database APIs for accessing data
[04:16:57] <Planck_> I'm not sure why gc would introduce any difficulty
[04:16:58] <tjsnell> bad for GC?
[04:17:29] *** boringwall has quit IRC
[04:17:50] <EricInBNE> tjsnell, if I was going to create an in memory db I'd write it in a language where I can control memory
[04:18:03] *** gelignite has quit IRC
[04:18:11] <Planck_> Whatever floats your boat I guess
[04:18:27] *** terranova has quit IRC
[04:18:35] *** rjohnson19 has quit IRC
[04:19:42] *** Matuku has quit IRC
[04:20:19] <tjsnell> yeah
[04:20:22] <tjsnell> good for you
[04:20:37] <tjsnell> some amazingly well done in mem DBs in java
[04:20:55] *** BeholdMyGlory has quit IRC
[04:21:24] *** lighta has joined ##java
[04:21:38] *** tilerendering has joined ##java
[04:21:54] <EricInBNE> such as?
[04:24:55] *** firefly2442 has left ##java
[04:33:06] *** diminish has quit IRC
[04:35:53] *** choongii has quit IRC
[04:35:58] *** tilerendering has quit IRC
[04:37:39] *** rannmann has joined ##java
[04:38:02] *** rannmann has left ##java
[04:40:16] *** nous1024 has joined ##java
[04:40:37] *** BoF has joined ##java
[04:43:43] *** oso96_2000 has joined ##java
[04:43:54] <karstensrage> hsql
[04:44:06] *** Cymage has quit IRC
[04:44:37] *** McMAGIC-- has joined ##java
[04:45:06] *** millertimek1a2m3 has joined ##java
[04:45:43] *** hex` has quit IRC
[04:46:36] <winux> is there a way to delete a node in a binary tree by bubbling up an element to fill in the deleted node?
[04:47:13] <Rainier> winux, you mean some sort of self-balancing tree?
[04:47:20] <winux> yes
[04:47:27] <Rainier> AVL and Red-Black both do that.
[04:47:41] <winux> Rainier: ya, im having to write the structure myself
[04:47:48] <winux> Rainier: i see lots of sift down examples
[04:48:12] <Rainier> Well, check them both out. They both employ some sort of "rotation" of nodes to fill in from below the one that was removed.
[04:48:20] <Rainier> iirc, anyway.
[04:48:29] <winux> ah
[04:48:31] <winux> ill check it out
[04:48:39] <Rainier> AVL wasn't hard, from what I remember, but Red-Black looks fun :) I never wrote one though.
[04:49:22] *** L-----D has quit IRC
[04:53:40] <winux> Rainier: i guess i should have specified, it has to be a priorityqueue, and i believe a bubbledown is the only option .. but those trees look like fun to write
[04:53:58] *** eidolon has quit IRC
[04:54:13] <Planck_> Priority queues can be implemented by either type of tree (or other data structures)
[04:55:28] <winux> ah
[04:55:31] <winux> im a noob
[04:57:09] <winux> do you guys implement trees at work (assuming a job working with java) .. ?
[04:57:13] <winux> or use the API
[04:57:24] <Planck_> Where the API has what's needed, use it
[04:58:01] <Planck_> It does have priority queues.
[04:59:19] *** flippo has quit IRC
[04:59:34] <winux> Planck_: ya, i still have to write.. you can guess what its for..
[04:59:50] <Planck_> Although, Oracle's implementation of java.util.PriorityQueue is much worse than necessary for random membership tests and removal.
[05:03:53] *** Dux has joined ##java
[05:03:58] <Rainier> Well I don't specifically see why a PriorityQueue need be a tree ...
[05:04:07] <Planck_> It doesn't need to be
[05:04:17] <Rainier> If you don't care for an incidental overhead, you could use a List + Collections.sort
[05:04:25] <Rainier> That allows random access.
[05:04:55] <Rainier> I used that when I wanted the items sorted to be able to get their position.
[05:05:20] <Rainier> Which I suppose is no worse than dequeing every item.
[05:05:32] *** Cymage has joined ##java
[05:06:03] <Planck_> Yep, the main reason to use one data structure over another is performance for the common operations required.
[05:06:05] <Rainier> actually dequeing would probably be cheaper for large sets since indexOf would have to loop for each one.
[05:06:18] <Rainier> but my data sets are very small, so it doesn't matter :)
[05:06:23] <Planck_> Yep :)
[05:06:27] <Rainier> On the order of oh, 3, 6, etc :P
[05:06:49] *** SpaceDoG has quit IRC
[05:07:28] <Rainier> Plus with a Priority queue I need to remove an item to get it to resort. With a List, I just keep a map around with a key being an item I need to look it up (but can't with the list methods), tell it to recalculate, then resort.
[05:07:34] <Rainier> remove an readd*
[05:07:50] <Planck_> The structures rapidly get a lot bigger if you're doing something like A* pathfinding :)
[05:08:16] <Rainier> ah, I'm just calculating out the "value" of something, and using this to find out what "place" it is (1st, 2nd, etc).
[05:08:31] <Rainier> The calculated values are shown in a bar chart as a table.
[05:10:10] *** Cymage has quit IRC
[05:11:03] *** SpaceDoG has joined ##java
[05:11:08] *** shaunren has quit IRC
[05:13:07] *** Midir has joined ##java
[05:13:25] *** xianny has quit IRC
[05:13:41] *** xianny has joined ##java
[05:17:56] *** devkhadka has joined ##java
[05:22:49] *** lf94 is now known as lf94_
[05:25:18] *** ScottishPig has quit IRC
[05:28:41] *** detinho has quit IRC
[05:30:20] *** Fanook has joined ##java
[05:32:00] *** Xgc has joined ##java
[05:37:16] *** surial has quit IRC
[05:37:26] *** eidolon has joined ##java
[05:40:56] *** Error404NotFound has joined ##java
[05:42:08] *** tokam has joined ##java
[05:42:41] <tokam> hi, is it possible and if it is, how is it possible to set the priority for a thread the get a lock in a synchronized block
[05:43:54] <Midir> I think it isn't. It's first come first served.
[05:45:40] <tokam> I am raeading here now http://tutorials.jenkov.com/java-concurrency/starvation-and-fairness.html#locks
[05:46:00] <tokam> I have written my own barrier and now i want to implement an increase and a decreaseParties method
[05:46:28] <tokam> but implementing this i would need some priority on the locks
[05:46:35] *** nomi1988 has joined ##java
[05:46:38] <tokam> otherwise I could look my barrier to death :D
[05:48:09] <tokam> or is it somehow possible to combine two locks?
[05:48:23] <tokam> I'd like to join in a block if two locks are available
[05:49:08] <nomi1988> hey guys simple math formula, but answers don't match with my calculator
[05:49:10] <nomi1988> http://pastebin.com/u4jNVbz2
[05:50:30] <Planck_> nomi1988: You're doing integer math
[05:50:40] <Midir> nomi1988: try changing to: double x = (double)(-6*m+2*m*m-2)/(1+(m*m));
[05:50:43] <nomi1988> my x is double
[05:50:50] <Planck_> Your m isn't.
[05:51:07] <Planck_> So it does all that integer calculation with m, then converts the result to double
[05:51:34] <nomi1988> cool thank you.
[05:51:58] <nomi1988> now can i convert the decimals to fractions?
[05:51:58] *** Xgc has quit IRC
[05:52:18] *** sorabji52 has joined ##java
[05:52:51] <Planck_> Not really.
[05:53:29] *** emet has quit IRC
[05:57:24] <Midir> nomi1988: there's a way you can convert it to a fraction if you really want
[05:58:58] <Planck_> Well yes technically there's a few ways.
[05:59:04] <nomi1988> no i'm good
[05:59:12] <nomi1988> how to increase by .1?
[05:59:27] <Planck_> "+ .1"
[05:59:32] <nomi1988> m=m+.1?
[05:59:39] <Planck_> Yes
[05:59:44] <Planck_> Or even m += .1
[06:01:20] <Planck_> One thing to watch out for is that a double variable can't exactly represent .1
[06:01:45] *** Xgc has joined ##java
[06:01:46] <nomi1988> oh no?
[06:02:05] <RLN> Planck_, what you mean by that?
[06:02:36] <Midir> yeah 0.1 in binary is like 0.333333.... in decimal, usually never matters
[06:03:21] *** fwaokda has quit IRC
[06:03:33] <nomi1988> i see.
[06:08:09] *** giantrobot has quit IRC
[06:12:35] <Planck_> Yes, the double value closest to 0.1 is 14411518807585587/144115188075855872, which is about 0.09999999999999999861
[06:13:34] *** kbotnen has quit IRC
[06:15:04] *** terranova has joined ##java
[06:18:31] *** kieran491 has joined ##java
[06:19:09] <Planck_> It matters mainly if you try something like add up 0.1's until you reach 1. You'll get to about 1.0999etc instead.
[06:19:14] *** winux has quit IRC
[06:19:21] *** tokam has quit IRC
[06:21:18] *** meonkeys has joined ##java
[06:30:24] *** terranova has quit IRC
[06:31:28] *** Midir has quit IRC
[06:35:46] <Rainier> ~vampire is http://slash7.com/2006/12/22/vampires/
[06:35:47] <javabot> OK, Rainier.
[06:35:51] <Rainier> ~vampires is <see>vampire
[06:35:51] <javabot> OK, Rainier.
[06:36:00] *** rfw has quit IRC
[06:37:04] <Rainier> "#2: Cease Enabling Behavior: [...] Enforce autonomy. No matter how beneficent you?re feeling, never directly answer a common question. This is the lazy way out, and you only enable the Help Vampires instead of truly helping them. Let the URL to your help resources be your only answer, but tell the vamp you are happy to help if he explores those avenues of self-help and still cannot find an answer."
[06:37:06] <Rainier> :)
[06:37:07] *** CodeWar has joined ##java
[06:39:14] <Rainier> A useful helpful non-"how to ask the right questions" (interesting resource, but quite the tome) that's grokable and not condescending. :)
[06:39:31] <Rainier> and, more importantly, supports our bot-stuffing URL behaviors! ;)
[06:39:37] <Rainier> :P
[06:40:19] *** Wyzard has quit IRC
[06:41:40] * Rainier is such an enabler for that last bit just now :P
[06:43:18] *** meonkeys has left ##java
[06:43:35] *** eidolon has quit IRC
[06:43:54] *** topriddy has joined ##java
[06:48:59] <topriddy> hey
[06:49:35] *** t0rc has quit IRC
[06:51:42] *** ormaaj has quit IRC
[06:53:35] *** ormaaj has joined ##java
[06:55:16] *** ormaaj has joined ##java
[07:01:41] *** RobotCow has quit IRC
[07:02:37] *** CodeWar has quit IRC
[07:05:06] *** RobotCow has joined ##java
[07:08:04] *** caverdude has quit IRC
[07:09:19] <topriddy> hello am researching auto-generation of java files giving a pattern, do i have to start from scratch or there is an open source lib i can hook into?
[07:14:36] <Rainier> antlr? javacc?
[07:15:07] *** Rainier has left ##java
[07:15:38] *** Rainier has joined ##java
[07:15:49] <Rainier> That was certainly the wrong button!
[07:16:02] *** pZombie has quit IRC
[07:17:01] <Rainier> parboiled also if what you really need is a grammar.
[07:19:16] <Rainier> You can ask Javabot about parboiled, but it doesn't have an entry on javacc or antlr. Someone gave him a lobotomy at some point :(
[07:20:13] *** [[thufir]] has quit IRC
[07:23:51] *** sorabji52 has quit IRC
[07:27:50] <topriddy> Rainier: are you talking to me?
[07:28:08] <Rainier> uh, yes.
[07:30:39] <topriddy> Rainier: i was talking about generating a java project
[07:31:04] <Rainier> I don't have the scrollback, but I think I read "generate a Java class"
[07:31:14] <Rainier> Quite different from generating a project.
[07:31:22] <topriddy> Rainier: you are correct
[07:31:39] <Rainier> As to which? :P
[07:31:43] <topriddy> Rainier: say i wanted a use case where i have a pattern of how a file should look like, what tools should help me define these...like a template sort of
[07:32:05] <topriddy> Rainier: currently looking at apache velocity for the task
[07:32:09] <topriddy> ~~javacc
[07:32:09] <javabot> The syntax is: tell nick about factoid - you missed out the 'about', topriddy
[07:32:17] <topriddy> ~javacc
[07:32:17] <javabot> topriddy, what does that even *mean*?
[07:32:27] <Rainier> javacc and antlr are more grammer related.
[07:32:27] <topriddy> ~antlr
[07:32:28] <javabot> topriddy, what does that even *mean*?
[07:32:29] <Rainier> grammar*
[07:32:40] <Rainier> javacc being able to generate Java code to match a given pattern.
[07:32:59] <Rainier> They're both more along the lines of a custom language/grammar sort of thing.
[07:33:10] <Rainier> DSL perhaps.
[07:33:59] <topriddy> Rainier: I want to write an utility such that i pass in an Entity name, e.g Student, then it generates the skeleton Student class, and then the DAO and DAOImpl classes a pattern as defined by me
[07:35:13] <Rainier> Sooo, Java "scaffolding"
[07:35:29] *** McMAGIC-- has quit IRC
[07:35:32] <topriddy> Rainier: now a combination of all this should somehow result to a project, would look at what could be done with archetypes too. what is scaffolding?
[07:35:56] *** bojo has joined ##java
[07:36:10] <Rainier> It's a name of a rails concept that generates model related files for a given project.
[07:36:37] <Rainier> including basic crud, etc (as rails is web oriented), but I'm sure there's similar Java projects that might provide what you want given the right keyword.
[07:37:29] <topriddy> Rainier: okay i want to implement same. but first of all i want to be able to generate a Java class by hand ie if i define a template for entity, i should be able to generate source given same
[07:37:55] *** JohnnyDavidson has quit IRC
[07:38:10] <Rainier> point missed.
[07:38:29] <topriddy> Rainier: e.g public class $Entity extends DomainObject{ public $Entity(){}}; i should be able to pass in $Entity as a variable to generate a Student class for example
[07:38:40] <topriddy> Rainier: looking at velocity for that
[07:38:42] <Rainier> "[you] want to implement the same" but at the same time "first you want to be able ..." why does the latter have to not be part of the former?
[07:39:02] <Rainier> and okay, I get you're looking at velocity for that. so what's the question then?
[07:39:16] <Rainier> if velocity fits the job then haven't you answered yourself?
[07:39:54] <Rainier> I suggested you search for projects which offer "Java scaffolding" as those keywords might bring up something that could help you.
[07:39:57] <topriddy> Rainier: i dont know for sure velocity fits the job. you suggested javacc and antlr earlier?
[07:40:09] <Rainier> Only because I didn't understand what you wanted.
[07:40:11] <topriddy> Rainier: okay
[07:40:17] <Rainier> Have you tried Velocity and found it not to fit?
[07:40:23] <Rainier> Or are you just assuming?
[07:44:31] <topriddy> Rainier: i am just beginning my research and i thought i would ask first.
[07:46:03] <topriddy> Rainier: i am on the apache velocity page though at the moment and reading the docs. I am also looking at my stuff generating a maven project with all these stuffs already included. i am doing all this basically for research and learning.
[07:47:06] *** BoF has quit IRC
[07:48:02] *** platzhirsch has joined ##java
[07:48:10] *** platzhirsch has left ##java
[07:48:16] *** glcrazy has joined ##java
[07:50:49] *** McMAGIC-- has joined ##java
[07:56:19] *** c_axis has quit IRC
[07:56:33] *** supercosmonaut has quit IRC
[07:59:43] *** chandan_kumar has joined ##java
[08:04:41] *** millertimek1a2m3 has quit IRC
[08:08:19] <mapreduce> What would cause surefire to mark a test as skipped?
[08:08:36] <mapreduce> I can tell it ran because of printlns.
[08:14:13] *** Error404NotFound has quit IRC
[08:15:43] *** kaemo has joined ##java
[08:26:55] *** Error404NotFound has joined ##java
[08:27:40] *** terranova has joined ##java
[08:28:10] *** gkmngrgn has joined ##java
[08:29:59] *** ExtraSpice has joined ##java
[08:30:01] *** DJClean has joined ##java
[08:35:38] *** Naith has joined ##java
[08:39:38] *** ferret_ has quit IRC
[08:40:37] *** ferret_ has joined ##java
[08:47:57] *** Tashtego has joined ##java
[08:49:06] *** nomi1988 has quit IRC
[08:49:27] *** srji has joined ##java
[08:50:18] *** Kamaran has joined ##java
[08:57:23] *** kaemo has quit IRC
[09:04:06] *** bn` has joined ##java
[09:04:10] *** winux has joined ##java
[09:05:09] *** yoshx has joined ##java
[09:09:25] <wyvern> mapreduce, is there an exception that gets thrown that marks it skipped perhaps?
[09:09:41] *** bojo has quit IRC
[09:13:23] *** epure_ has joined ##java
[09:13:24] *** bojo has joined ##java
[09:21:14] *** pZombie has joined ##java
[09:21:58] *** Error404NotFound has quit IRC
[09:28:19] *** irenicus09 has joined ##java
[09:32:28] *** cbeust has quit IRC
[09:35:33] <Tashtego> hi can someone give me a hint about this? http://java.net/jira/browse/EMBEDDED_GLASSFISH-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
[09:35:50] <Tashtego> "specify a glassfish property" ?...where? whats its name..
[09:36:51] *** riotz has joined ##java
[09:37:28] *** Error404NotFound has joined ##java
[09:38:43] *** frangiz has joined ##java
[09:39:35] *** io2 has joined ##java
[09:41:54] * Rainier kicks his code and XStream with a virtual steel-toed boot.
[09:45:05] <Rainier> It's not really XStream's fault, but while I have the virtual boot out, I might as well :P for all the other trouble it's given.
[09:45:23] *** frangiz has quit IRC
[09:46:18] *** optraz has joined ##java
[09:46:44] *** brundlefly has joined ##java
[09:47:05] *** brundlefly is now known as daark
[09:49:24] *** bearded_oneder has quit IRC
[09:52:14] *** plarsen has quit IRC
[09:52:48] *** ktorn has quit IRC
[09:53:10] *** ktorn has joined ##java
[09:54:57] *** Pozejdon has joined ##java
[09:55:44] *** frangiz has joined ##java
[09:56:53] *** jjido has joined ##java
[09:57:13] *** shookees has quit IRC
[10:05:20] *** riotz has quit IRC
[10:07:48] <aLeSD> what's the cost of List.get(n) ?
[10:07:57] <aLeSD> O(n) ?
[10:08:08] <Planck_> It depends upon the implementation
[10:08:38] <aLeSD> Planck_, I have to check the list from the last element uo ...
[10:08:42] <aLeSD> s/uo/up
[10:08:44] <Planck_> ArrayList.get(int) runs in constant time.
[10:09:06] <io2> (oh my god, not another list question....)
[10:09:18] *** rfw has joined ##java
[10:09:25] <aLeSD> io2 : P
[10:09:48] <Planck_> LinkedList.get(int) very likely runs in O(n)
[10:09:55] *** bojo has quit IRC
[10:11:34] <aLeSD> Planck_, yes ... no index
[10:11:51] <aLeSD> but i will lost in resizing
[10:12:07] <aLeSD> so I had to "suppose" the size of the array before
[10:12:12] *** magn3ts has quit IRC
[10:12:15] *** shookees has joined ##java
[10:12:20] *** magn3ts has joined ##java
[10:12:54] <aLeSD> Planck_, yes ... no index <---- wrong
[10:13:01] *** daark has quit IRC
[10:13:07] *** yoshx has quit IRC
[10:13:09] <aLeSD> I mean that array is continuous in memery
[10:13:55] *** Wyzard has joined ##java
[10:14:16] <_W_> aLeSD, you are not making sense at all
[10:14:25] <aLeSD> as usual
[10:15:13] *** frangiz has quit IRC
[10:15:28] <selckin> Rainier: what trouble do you have with it?
[10:15:37] <aLeSD> _W_ I think that ArrayList is continuous in memory ... so you can access like pointer + indexElement
[10:15:42] <aLeSD> O(1)
[10:16:15] <_W_> ~javadoc ArrayList
[10:16:15] <javabot> _W_: http://is.gd/iOQj8 [JDK: java.util.ArrayList]
[10:16:20] <selckin> that's what constant time meanss
[10:16:39] <_W_> aLeSD, it doesn't matter how it is implemented - contiguous or not - as ArrayList's documentation specifies it runs in O(1)
[10:16:40] *** Ivellina has joined ##java
[10:17:51] *** daark has joined ##java
[10:17:52] <aLeSD> uff ... well ... it's good to think about the implementations . no ?
[10:18:24] *** jjido has quit IRC
[10:18:25] <_W_> no
[10:18:59] <aLeSD> sometimes I think that programming in java make you think in a different way a computer works
[10:19:08] <Rainier> selckin, ah, well this time around I'd commented out my reader.moveDown() and reader.moveUp() because it took me down too far, turns out that was because the converter said it handled a different type than I wanted it to handle (oops) so I fixed that, but forgot to uncomment those and it did a nice infinite loop of trying to call the same converter over and over again.
[10:19:12] <_W_> that's a good thing aLeSD
[10:19:23] <_W_> it's what's called a "high-level programming language"
[10:19:26] <aLeSD> _W_ I really dunno
[10:19:54] <_W_> aLeSD, well, let me qualify then; it's good for the purpose of development speed of large projects over long timeframes
[10:20:29] <_W_> which is the chief measure businesses are (or should be) concerned with when it comes to development
[10:20:56] <aLeSD> but makes the coders better ?
[10:21:14] *** frangiz has joined ##java
[10:21:28] <aLeSD> I mean ... I think I start to understand why people are in difficult when they pass to a low level language
[10:21:40] <Planck_> Coders are responsible for making themselves better.
[10:22:36] <aLeSD> I like java ... but until now I think is dangerous
[10:22:37] *** bojo has joined ##java
[10:23:37] <Planck_> For that matter, even low-level languages don't map well to how computers really work anymore.
[10:23:41] <aLeSD> I always thounght that if I know how a stuff works I can understand where it fails
[10:23:59] <aLeSD> but here is a melting pot
[10:24:08] <aLeSD> mmm
[10:24:11] <aLeSD> ok ... sorry
[10:24:22] <aLeSD> I just woke up
[10:24:50] <Planck_> Even machine code instructions get ripped apart, reordered, translated into RISC and stuffed into multiple pipelines simultaneously.
[10:25:24] <Planck_> And that's without considering caches and multiple CPUs
[10:25:30] <aLeSD> Planck_, u right.. but the way u have to think is very like a computer works
[10:26:25] <aLeSD> however .. I am nooby here ... no I shut up
[10:26:32] <Planck_> Yes — independently of language.
[10:27:10] <Rainier> selckin, I guess it's just not always so friendly :( like right now I have a class with a non-annotated field that should pull from the tag's contents it is mapped to (class has an @XStreamAlias) but it ends up being null.
[10:27:15] <Planck_> It does help to know how your code will be expected to run at the machine level.
[10:27:34] <aLeSD> Planck_: I chat for one week to understand (in C) if a int i; u=5; is atomic
[10:27:43] <aLeSD> maybe more
[10:28:27] <Planck_> The C language makes essentially no guarantees about behaviour in multiple threads.
[10:28:40] *** lmatteis has joined ##java
[10:28:42] <lmatteis> hey
[10:28:52] <Planck_> At least Java does :)
[10:29:02] <lmatteis> what's the best environment for writing web-apps in java? i find the re-compile and refresh process rather annoying
[10:29:16] <Rainier> ~playframework
[10:29:16] <javabot> Rainier, what does that even *mean*?
[10:29:21] <Planck_> Anyway, afk :)
[10:29:22] <Rainier> ~play
[10:29:23] <javabot> the Play Framework is found at http://www.playframework.org/ - it's a web framework. Go to the site and watch the short intro video for more information.
[10:29:46] <lmatteis> Rainier: i need to deploy a standard war
[10:29:48] <aLeSD> Planck_: yes ... int the end I decided that it depends on the implementation and on the arch
[10:29:57] <Rainier> lmatteis, and?
[10:30:04] <lmatteis> Rainier: can i use this for development and deploy a standard .war out of it
[10:30:09] *** jjido has joined ##java
[10:30:13] <_W_> ~playframework is <reply>The Play Framework is found at http://www.playframework.org/ - it's a web framework. Go to the site and watch the short intro video for more information.
[10:30:13] <javabot> OK, _W_.
[10:30:20] <_W_> ~play is <see>playframework
[10:30:20] <javabot> I already have a factoid named play, _W_
[10:30:22] <Rainier> lmatteis, visit their site. They'll tell you.
[10:30:28] <_W_> ~no, play is <see>playframework
[10:30:28] <javabot> OK, _W_.
[10:30:34] *** irenicus09 has quit IRC
[10:30:46] <lmatteis> Rainier: they provide a bunch of data storage libs... i'm using JDO
[10:30:56] <Rainier> and?
[10:30:58] <lmatteis> using this Play! thing will probably require me to use something else instead
[10:31:07] <Rainier> Why would it?
[10:31:58] <Rainier> The only person limiting your potential here with my suggestion is you. Not it.
[10:32:06] <lmatteis> there's a Hibernate section
[10:32:18] <Rainier> You are not required to use it.
[10:33:15] <aLeSD> however I have a collections problem
[10:34:20] <aLeSD> I need a List (or similar) . I need to read elements from the last up , add element at the end .. and remove elements form beginning.
[10:34:38] <Rainier> Any List will let you do that.
[10:34:42] <selckin> ~javadoc deque
[10:34:42] <javabot> selckin: http://is.gd/XyPq26 [JDK: java.util.Deque]
[10:34:45] *** Tashtego has quit IRC
[10:34:53] <aLeSD> Rainier: I need an efficent one
[10:34:57] <Rainier> That is also probably a better choice if that's all you need.
[10:36:46] *** devkhadka has quit IRC
[10:38:17] *** arborist has joined ##java
[10:39:25] <lmatteis> Rainier: thanks but all this extra stuff isn't what i need - template framework, db framework, MVC bullshit. I just want a servlet container that lets me be productive in development without having to recompile everytime i make a change in a .java file
[10:39:53] <Rainier> No comprende, senior.
[10:40:14] <selckin> ~tell lmatteis about jrebel
[10:40:14] <javabot> lmatteis, what does that even *mean*?
[10:40:15] <Rainier> Java works on compilation to create runnable stuff.
[10:40:28] <selckin> ~javarebel
[10:40:28] <javabot> selckin, what does that even *mean*?
[10:40:32] <Rainier> Play! takes care of that for you in dev mode.
[10:40:44] <Rainier> In prod mode it just compiles everything ahead of time once.
[10:41:01] <Rainier> and I just *love* your opinion of MVC there.
[10:41:16] <selckin> ~jrebel <reply>JRebel is a commericial product that allows you to update classes at runtime without redeploying http://www.zeroturnaround.com/jrebel/
[10:41:16] <javabot> OK, selckin.
[10:42:00] <lmatteis> Rainier: i dont want a framework or pattern to enforce my programming methodology
[10:42:00] <Rainier> Well, given that description, Play! does the same thing ... but he's already expressed his displeasure at all its "bullshit"
[10:42:04] *** Carnage\ has joined ##java
[10:42:09] <lmatteis> with MVC i'm forced to do things in a certain way
[10:42:15] <selckin> Rainier: the solutation to i have a problem with x is not rewrite your entire application in y
[10:42:26] <selckin> Rainier: when the problem is not even related to that
[10:42:47] <lmatteis> Rainier: are you offended by my "bullshit" expression?
[10:43:00] <Rainier> selckin, I gave a possible solution to the original question he asked, and got back "that's all bullshit".
[10:43:14] <Rainier> lmatteis, hell no. shit, fuck, etc. I don't give a damn. but I do think that Play! is more than that.
[10:43:28] *** ModusPwnens has joined ##java
[10:43:37] <Rainier> If it doesn't fit the problem at hand, a simple "that won't work" would have sufficed.
[10:43:46] <selckin> you didn't, he said my car runs out of gas, and you told him to use a spaceshuttle
[10:43:51] <ModusPwnens> Are you allowed to have multiple tab locations for a JTabbed component?
[10:44:16] <lmatteis> i don't care about your feelings towards the framework man. it just too many things that i don't need
[10:44:23] <lmatteis> *has
[10:44:30] <ModusPwnens> The constructor seems to only allow you to specify one dimension for tabs, but I am wondering if there is a way around that.
[10:44:34] <selckin> just drop it and go pay for jrebel
[10:44:37] <Rainier> selckin, let me refresh you: <lmatteis> what's the best environment for writing web-apps in java? i find the re-compile and refresh process rather annoying
[10:45:03] <Rainier> lmatteis, see, now wasn't that simpler to say without resorting to derogatory comments?
[10:45:11] *** jjido has quit IRC
[10:45:41] <Rainier> ModusPwnens, not that I know of. One location is it.
[10:45:59] <Rainier> Makes it easier for JTabbedPane to provide actions when there's too many tabs to display at once.
[10:46:27] <Rainier> Plus all native tabbed panes I know of only use one location so I think that's valid.
[10:46:47] *** jjido has joined ##java
[10:47:11] <lmatteis> so in essence. a servlet container is meant to contain .class files, not the .java ones (apart from the jsps)
[10:47:31] <Rainier> ModusPwnens, You're kinda own your own if you want what you've described.
[10:47:37] <lmatteis> so in essence, you always need to re-compile and move the war to the servlet if you make changes to the .java files. right?
[10:47:41] <Rainier> Maybe someone has found a solution if you Googled.
[10:47:54] *** homie has quit IRC
[10:47:59] <Rainier> Swing doesn't have a built in solution (nor AWT)
[10:48:41] <selckin> lmatteis: not really, and jsps are compiled to class aswell, usually you develop from 'exploded war' which is easy/fast to update
[10:48:49] *** homie has joined ##java
[10:49:36] *** rretzbach has joined ##java
[10:49:54] *** homie has quit IRC
[10:51:47] *** chandan_kumar has quit IRC
[10:52:33] <ModusPwnens> rainier, I didn't think so. I googled but couldn't find anything so I thought i would ask here to see if anyone knew of anything
[10:52:41] <Rainier> ah, okay.
[10:53:04] <Rainier> Ugh. If I write my own converter for the class being deserialized with an empty value, I get "" instead of null (so effectively the same). I wonder why it won't pull in my tag's contents? :(
[10:53:16] *** ModusPwnens has quit IRC
[10:53:29] <Rainier> Maybe I'm loading the wrong file somehow over and over.
[10:54:16] <Rainier> argh. *now* it grabs the right one.
[10:54:22] *** homie has joined ##java
[10:55:13] <Rainier> and it only works with my converter present. how lovely.
[10:56:20] *** devkhadka has joined ##java
[11:01:24] *** mxweas has joined ##java
[11:05:19] *** lmatteis has quit IRC
[11:06:33] *** jjido has quit IRC
[11:07:45] *** jjido has joined ##java
[11:07:52] *** rfw has quit IRC
[11:10:05] *** mxweas has quit IRC
[11:10:27] *** Johannes13 has joined ##java
[11:10:28] *** mxweas has joined ##java
[11:10:59] *** forneus has quit IRC
[11:12:20] *** srji has quit IRC
[11:12:56] *** Tashtego has joined ##java
[11:13:20] *** Rainier has quit IRC
[11:13:45] *** xiliax has joined ##java
[11:13:46] *** inktri has joined ##java
[11:14:51] <inktri> if during an interview, you're asked to reverse a linked list in java... should your code return the new head node from the function? or should it somehow try to just change all the data for each node, but keep the original "head node" parameter as the head?
[11:15:09] *** pranay_09 has joined ##java
[11:15:51] *** webczat has joined ##java
[11:16:01] <webczat> Hey, can javax.management.loading be used for dynamic loading?
[11:16:27] *** ctburley has joined ##java
[11:17:16] *** devkhadka has quit IRC
[11:17:57] <aLeSD> Is there a List implementation of a circular buffer ?
[11:17:58] <_W_> inktri, why on earth would anyone do such a thing? If someone asked me something like that, I'd question their ability to fairly judge my skill
[11:19:03] *** gelignite has joined ##java
[11:19:51] <inktri> _W_ i don't understand, what seems ridiculous?
[11:20:09] <_W_> inktri, making your own linked list to begin with, for starters
[11:20:14] <_W_> ~javadoc LinkedList
[11:20:14] <javabot> _W_: http://is.gd/75QGnI [JDK: java.util.LinkedList]
[11:20:39] <inktri> _W_: it's a popular question apparently
[11:20:57] <_W_> inktri, and I don't want to work at most places, so that makes sense :p
[11:21:20] *** forneus has joined ##java
[11:21:42] *** selckin has quit IRC
[11:21:50] <_W_> inktri, any place that use a "popular question" don't really know how to judge skill - they're just following what someone else thought out for them
[11:22:27] <_W_> I mean you could try to follow the script, and make sure you don't given an answer outside their checkboxes, but imagine the coworkers you probably will have?
[11:22:35] *** devkhadka has joined ##java
[11:26:24] *** greenIT has joined ##java
[11:27:01] <greenIT> hi
[11:27:27] <greenIT> does anyone know what service enablers in java me are?
[11:27:40] *** [twisti] has joined ##java
[11:28:21] *** greenIT has left ##java
[11:33:30] *** L-----D has joined ##java
[11:33:38] *** Pozejdon has quit IRC
[11:33:47] *** inktri has left ##java
[11:35:39] *** jjido has quit IRC
[11:37:14] *** choongii has joined ##java
[11:38:14] *** jjido has joined ##java
[11:40:12] <topriddy> does anyone know why Guice doesnt inject objects in a Jersey annotated class by default?
[11:41:24] *** kieran491 has left ##java
[11:41:59] *** kieran491 has joined ##java
[11:42:50] *** dextro_ has left ##java
[11:44:37] *** Johannes13 has quit IRC
[11:47:17] *** zatan has joined ##java
[11:47:37] *** yoshx has joined ##java
[11:52:11] *** Johannes13 has joined ##java
[11:52:44] *** DerHorst has joined ##java
[11:56:15] *** devkhadka has quit IRC
[11:56:45] *** devkhadka has joined ##java
[11:56:55] <dreamreal> morning
[12:00:03] *** bitshuffler has joined ##java
[12:01:35] <ctburley> gnah
[12:04:56] <dreamreal> ftagh'n
[12:10:00] *** yoshx has quit IRC
[12:10:39] *** marlaw has joined ##java
[12:10:53] <marlaw> good morning!
[12:11:09] *** cbeust has joined ##java
[12:13:37] *** blbrown_win3 has quit IRC
[12:13:53] *** beasty has joined ##java
[12:14:50] <marlaw> quick question, JVM loads a JNI (C extern, written in CPP) library, I've wrapped a couple of static jobject in a RAII (for newglobalref/deleteglobalref). Unfortunately when the jvm calls exit() and the destructor kicks in I get a coredump as the environment attached on the jvm (which succeeds) is probably no good. Any idea ?
[12:17:01] *** Indigenous has quit IRC
[12:17:44] <aLeSD> is it possible to override a protected method ?
[12:17:55] <aLeSD> uff .. s/protected/private/
[12:17:58] <dreamreal> aLeSD: try it and see.
[12:18:08] <dreamreal> And what, exactly would you think overriding it would do?
[12:18:29] <aLeSD> dreamreal: use my method instead of the super implementation
[12:18:47] <dreamreal> Try it and see.
[12:18:51] <marlaw> yeah you can. Be carefull calling that method from the constructor of base though
[12:19:05] <dreamreal> marlaw: that would mean "no" :)
[12:19:37] <marlaw> i.e. if the derived relies on objects constructed by the base constructor you're fucked ;)
[12:19:50] <dreamreal> you can override it - i.e., use the same definition- but it's not the same as it is if it's a protected method.
[12:20:31] <aLeSD> can for a pivate
[12:20:34] <aLeSD> private
[12:20:37] <aLeSD> can't
[12:20:37] *** jjido has quit IRC
[12:20:41] <marlaw> I meant for protected, sorry, not private
[12:20:47] <aLeSD> yes
[12:20:51] *** ManOwl has joined ##java
[12:21:08] <ManOwl> Would you guys consider this good or bad style for a local variable name: Date date;;
[12:21:22] <dreamreal> fortunately, it's REALLY EASY TO TEST
[12:21:33] <dreamreal> with the double colons? or the "date"?
[12:21:43] *** neuro_sys has quit IRC
[12:21:53] *** magentar has joined ##java
[12:22:35] <ManOwl> ignore the extra semi, it was a typo
[12:22:42] <marlaw> ManOwl, yeah, that's fine then
[12:22:49] <ManOwl> i was debating whether it was confusing
[12:22:52] <dreamreal> I don't see why "date" is a bad name if it's representative in context
[12:22:54] <ManOwl> for case-impaired developers
[12:23:05] *** jjido has joined ##java
[12:23:08] <ManOwl> some people would use 'd'
[12:23:22] <marlaw> even better if you can assign to it in one go and make it final :)
[12:23:33] <dreamreal> ManOwl: that would be stupid
[12:23:47] <dreamreal> "d" has no meaning except for the fourth letter of the english alphabet
[12:23:56] <dreamreal> whereas "date" says "hey, I'm a DATE"
[12:24:05] <marlaw> and makes s/d/blah more difficult :)
[12:24:29] <dreamreal> marlaw: well, only a moron would need sed replace, nowadays
[12:24:41] <marlaw> what do you mean ?
[12:24:43] *** mxweas has quit IRC
[12:24:57] *** supercosmonaut has joined ##java
[12:25:08] <marlaw> don't know you guys but I only use vim
[12:25:08] <dreamreal> most modern IDEs (meaning, "from 2004 on") have refactorings that rename variables
[12:25:19] <[twisti]> thats just sad
[12:25:23] <marlaw> don't like IDEs
[12:25:25] * dreamreal chuckles into his palm to try to hide his laughter from marlaw
[12:25:40] <[twisti]> well theres people still writing windows programs in assembler
[12:25:49] <[twisti]> so at least youre not alone
[12:25:58] <ManOwl> I am a vim fanboy
[12:26:05] <marlaw> I code in both cpp and java, and I find that I know less of a codebase when I use an ide
[12:26:06] <ManOwl> but I just bought a new PC, 4g ram and a quad core
[12:26:08] <dreamreal> I know people who say vim is still the one for java. They ALSO have a tendency to prefer not using Java, because "writing java is such a pain." :)
[12:26:09] <ManOwl> so I've been using eclipse
[12:26:19] <[twisti]> haha dreamreal
[12:26:19] *** Xgc has quit IRC
[12:26:29] <marlaw> at least I'm not using emacs!
[12:26:30] <marlaw> :)
[12:26:37] <ManOwl> java in eclipse is so easy
[12:26:44] <ManOwl> I would never dream of trying to use vim for it
[12:26:52] *** tilerendering has joined ##java
[12:26:58] <marlaw> too much, I can argue that If I ask you in what package is such and such thing you wouldn't know
[12:27:02] <marlaw> or where the file lives in the tree
[12:27:11] <[twisti]> marlaw: thats a good thing
[12:27:11] <aLeSD> mmm .. doesn't work
[12:27:17] <ManOwl> it has beastly static analysis and quick fix is priceless
[12:27:21] <aLeSD> my method isn't called
[12:27:23] <[twisti]> it means we dont waste our brain remembering things we dont need to know
[12:27:25] <ManOwl> mouse over anything and find out what it does
[12:27:37] <dreamreal> aLeSD: really? Are you sure? :)
[12:27:40] <marlaw> it also means that without an ide you're lost :)
[12:27:47] <dreamreal> marlaw: no, it doesn't
[12:27:53] <ManOwl> i write all my python code in vim
[12:27:57] <[twisti]> marlaw: yes, and when ww3 finally comes, that will be a real issue
[12:27:57] <dreamreal> just because you have an IDE doesn't mean your retention goes to 0
[12:28:03] <aLeSD> dreamreal: am I in wrong ?
[12:28:04] <CallToPower> marlaw agreed
[12:28:15] <dreamreal> aLeSD: nope. Not in the least. This is why you try it out.
[12:28:47] <aLeSD> dreamreal, you mean that the supercalss doesn't 'see' the override ?
[12:28:55] <[twisti]> marlaw: but until then, im more comfortable than you, i write my code faster than you, and i spend less time remembering arcane error prone commands, like using sed to refactor code
[12:28:56] <marlaw> I used to be a NetBeans fan at the beggining of my java experience, made it easier.. I hate IDE automation, gets on my way .. I control manually imports and all
[12:29:09] <dreamreal> aLeSD: I mean that "private" means *private*.
[12:29:13] <ManOwl> Even if I am "lost" in java without an ide, isn't that like saying without a character encoding we'd be "lost". There's lots of stuff in a computer we can treat as a black box. The more we can black box, the more we can build alone and faster and better.
[12:29:14] <marlaw> not sure you write code faster then me, the bottleneck is not typing mate
[12:29:22] <aLeSD> dreamreal, I changed the declaration to protected
[12:29:37] <[twisti]> ManOwl: well put
[12:29:42] <[twisti]> ~ManOwl++
[12:29:42] <javabot> manowl has a karma level of 1, [twisti]
[12:29:44] <dreamreal> show a test case.
[12:29:48] <marlaw> ManOwl, I agree, black box and abstraction is good, but that's why we program in java and not c
[12:30:21] <aLeSD> can't .. no standard java
[12:30:32] <ManOwl> one of the things I would miss immediately if i switched to vim for java would be the automatic compilation
[12:30:33] <dreamreal> hahaha
[12:30:35] <dreamreal> oh lord
[12:30:37] <ManOwl> but I am gonna install eclim
[12:30:40] <ManOwl> eclim is sweet
[12:30:44] <aLeSD> darvin
[12:30:46] <aLeSD> :)
[12:30:50] <dreamreal> yeah.
[12:30:58] <dreamreal> We need to alter the topic to say "no android."
[12:31:16] <aLeSD> hey ... I am only asking general java questions
[12:31:17] <[twisti]> ManOwl: i dont use it every minute, but id REALLY miss proper refactoring
[12:31:30] <ManOwl> i've never really learned the refactoring features of eclipse
[12:31:30] <[twisti]> autocompile you can probably jury rig in the text editor of your choice anyways
[12:31:31] <marlaw> there is one expection, to sign and do android apps ( I tried once) I used eclipse
[12:31:34] <ManOwl> I know, ctrl +h is nice
[12:31:36] <dreamreal> aLeSD: yet you say general java answers aren't appropriate?
[12:31:38] <ManOwl> but that 's it
[12:31:48] <dreamreal> aLeSD: in other words, make up your freaking mind
[12:31:51] <aLeSD> and I am sure I am wrong ... Override is basical in java
[12:31:56] <marlaw> well, that's all stuff that if you want you can run from vim too though
[12:32:01] *** bindaas has left ##java
[12:32:07] <marlaw> i.e. I run make from within vim
[12:32:14] <dreamreal> [twisti]: refactoring is overrated
[12:32:16] *** bitshuffler_ has joined ##java
[12:32:28] <ManOwl> i shotgun refactor
[12:32:30] <[twisti]> aLeSD: just make a test case, even if we cant compile it we can still look at it
[12:32:35] <ManOwl> bad code? rm file.java
[12:32:39] *** bindaas has joined ##java
[12:32:46] <dreamreal> ManOwl: vim user? :)
[12:32:52] <[twisti]> dreamreal: i disagree. at least for me its a huge convenience
[12:32:56] <ManOwl> dreamreal: not for java :/
[12:33:03] <dreamreal> [twisti]: did you miss the </sarcasm>?
[12:33:04] <[twisti]> but then i work with a lot of old, legacy and newbie code
[12:33:07] <[twisti]> oh, yes
[12:33:12] *** bitshuffler has quit IRC
[12:33:21] <ManOwl> at my last job I spent 2 weeks refactoring a project before I could bear to work on it without feeling disgusted
[12:33:43] <[twisti]> sometimes the advantages are subtle
[12:33:56] <ManOwl> i unearthed a pretty serious bug too
[12:34:05] <[twisti]> for example, some day i just started to apply my custom code formatting template BEFORE looking at newbies code
[12:34:09] *** jjido has quit IRC
[12:34:11] <[twisti]> and i didnt notice it at that time
[12:34:39] <[twisti]> but when i looked back a few months later, that was the exact week that i stopped spending my nights in my empty bathtub, crying and getting drunk
[12:34:55] <ManOwl> haha
[12:35:11] <[twisti]> i know correlation doesnt prove causality, but still ...
[12:36:11] <aLeSD> my fault. I found the error
[12:36:45] <dreamreal> aLeSD: let me guess: didn't know scoping?
[12:36:57] <[twisti]> aLeSD: youll find that 9 out of 10 times, you find the error while trying to make a small test case
[12:37:26] <aLeSD> no .. the code wasn't executed
[12:37:56] <aLeSD> I think I made a project error
[12:38:47] <dreamreal> aLeSD: http://pastebin.com/8ScrQaKm
[12:38:58] <dreamreal> including an explanation, which you should have been able to reason out on your own.
[12:39:14] *** ManOwl has quit IRC
[12:40:10] *** Versuchen has joined ##java
[12:40:14] <aLeSD> dreamreal, uff . I understant those stuff
[12:40:15] <aLeSD> :P
[12:40:58] *** Luc1fel has joined ##java
[12:41:46] *** LouisJB has quit IRC
[12:41:58] <dreamreal> okay. Well, that answers the question you asked. If it's not appropriate for dalvik, you shouldn't have asked in ##java.
[12:42:56] <aLeSD> dreamreal, .. thanks anyway
[12:43:21] *** LouisJB has joined ##java
[12:43:54] *** Fuco has joined ##java
[12:45:11] *** L-----D has quit IRC
[12:47:35] *** bitshuffler__ has joined ##java
[12:50:10] *** L-----D has joined ##java
[12:50:47] *** Indigenous has joined ##java
[12:50:58] *** bitshuffler_ has quit IRC
[12:51:14] *** ManOwl has joined ##java
[12:51:56] *** riotz has joined ##java
[12:52:36] *** diminish has joined ##java
[12:54:57] *** gkmngrgn has quit IRC
[12:59:13] <beasty> anyone here played around with a acs acr122l reader ?
[12:59:46] <paissad> guys, i would like to have a sort of JComboBox with a JTextField so that when i enter un text (a city/country) into the JTextField, i have all proposals into the JComboBox, it would be something like the Google search representation
[13:00:15] <paissad> is there a sole component which handles that feature in swing/awt ?
[13:00:27] *** tewecske has joined ##java
[13:01:43] *** bitshuffler has joined ##java
[13:03:23] *** lighta has quit IRC
[13:04:46] *** harry_ has joined ##java
[13:04:50] *** bitshuffler__ has quit IRC
[13:05:04] *** Sliker has joined ##java
[13:06:08] *** sebrock has joined ##java
[13:07:08] <webczat> I just read papers about dynamic class reloading and I'm satisfied.
[13:12:09] *** Cher has joined ##java
[13:13:22] <webczat> Why javax ssl thing provides an eventlistener for handshake completion, but it is not possible to actually do something like firing events on a line sent through the socket or on data available?
[13:13:28] <webczat> ls
[13:13:29] <javabot> webczat: wrong window, pal
[13:14:23] *** Error404NotFound has quit IRC
[13:15:56] *** bitshuffler_ has joined ##java
[13:16:31] *** eaxxae has joined ##java
[13:19:00] *** bitshuffler has quit IRC
[13:19:29] * aLeSD my first ConcurrentModificationException
[13:19:45] *** milligan has joined ##java
[13:22:07] *** veasmkii has joined ##java
[13:23:10] <Tashtego> is anyone in here able to tell me how i can fix this Cannot obtain lockfile location error message from glassfish?
[13:27:10] *** matsebc has joined ##java
[13:28:13] *** Naith has quit IRC
[13:30:52] *** Sliker has quit IRC
[13:31:35] *** Error404NotFound has joined ##java
[13:32:08] *** hex` has joined ##java
[13:36:21] <topriddy> trying to get a good resource on how to create my own project templates a sort of archetype thingy
[13:36:40] <dreamreal> topriddy: maven has archetypes for helping you create archetypes
[13:37:38] <topriddy> dreamreal: i am reading this, http://maven.apache.org/guides/mini/guide-creating-archetypes.html, i dont see how to specify my own files in them, where my files are generated automagically too.
[13:38:18] <dreamreal> topriddy: in main/resources you put your own files, using $packageName for replacement stuff
[13:38:39] <topriddy> dreamreal: working with velocity, such that my user specifies names for entities, and then i use this info to generate a maven project with Entity Place holders, Entity DAOs, and DAOImpl
[13:38:50] <topriddy> dreamreal: cool.
[13:39:14] <topriddy> $packageName as a foder name?
[13:39:19] *** Rissien has joined ##java
[13:39:29] <dreamreal> It's something like that
[13:39:30] *** harry_ has quit IRC
[13:39:35] *** devkhadka has quit IRC
[13:39:47] *** Behi has quit IRC
[13:42:19] <topriddy> dreamreal: am looking at stuff like delivering a : mvn archetype:newProj -entities Student Teacher Lecturer School Department etc
[13:42:35] * topriddy maybe i should just take this one at a time
[13:42:48] <dreamreal> yes :)
[13:43:59] *** sebrock has quit IRC
[13:45:43] <deadbeef> guys, how would you study the behaviour of \prod_{i} (a_{i}x + b_{i}y) wrt x and y, with the a_{i}s and the b_{i}s fixed ?
[13:45:47] <deadbeef> (and all quantities in [0,1])
[13:46:20] *** tty1 has quit IRC
[13:47:11] *** Rissien has quit IRC
[13:47:18] <Planck_> What sort of behaviour would you be interested in?
[13:47:55] <deadbeef> i'd like to find global/local maxima
[13:48:02] *** yoshx has joined ##java
[13:48:19] <Planck_> Differentiate
[13:48:57] <topriddy> dreamreal: inside a .java file for example, can i do package $packageName.dao;
[13:48:59] <Planck_> You could also consider what happens on "slices" for which y = c x.
[13:49:14] <dreamreal> topriddy: You could always try!
[13:49:28] <topriddy> dreamreal: true! i should get running.
[13:50:02] <deadbeef> Planck_: indeed it's part of a bit bigger equation, i was trying to make that part a bit more "readable"
[13:51:00] <Planck_> Local minima&maxima are where the gradient (derivative) is zero, or on the boundary of the domain.
[13:51:49] <deadbeef> yup you're right, i should go with the partial derivatives instead of trying to make it more "readable"
[13:51:52] <deadbeef> thanks
[13:52:19] <Planck_> It's fairly clear that the function you gave has no interior minima or maxima
[13:52:32] <Planck_> But the bits you left out may change that
[13:53:24] <Planck_> It will have a global minimum at (0,0), and a global maximum at (1,1).
[13:53:36] <Kryigerofe> Hello. I have a problem with Java Web Start: It seems to cache the images inside my .jar so when I update the .jar file, it keeps using the old data.
[13:53:39] <Tashtego> dreamreal may i ask you to take a look at this link? maybe you know something about it? http://stackoverflow.com/questions/5210509/embedded-glassfish-configuration-with-arquillian-tmpdir
[13:54:05] <Planck_> Kryigerofe: do you bump up the version numbers?
[13:54:42] <Kryigerofe> No. Didn't know that was a feature.
[13:54:46] <dreamreal> Tashtego: no clue
[13:55:45] <Tashtego> k :( thx anyways
[13:56:33] <Kryigerofe> Planck_: Can you give a quick hint on where I do the bumping? The .jnlp file?
[13:56:35] *** bra1nf00d has joined ##java
[13:56:42] <deadbeef> Planck_: do you think there's any way to express it in "simpler terms", like avg(a_{i}) and so on?
[13:56:54] <deadbeef> because the whole thing is a mess
[13:57:03] <Planck_> Kryigerofe: Yes, if I recall correctly. It's been a while since I dealt wih that though, I may misremember.
[13:57:18] <Kryigerofe> OK. Thanks. I'll read some tutorial somewhere.
[13:58:00] <Planck_> deadbeef: Well, as written the location of the maximum and minimum don't depend upon the a's or b's at all.
[13:58:15] <Planck_> (So long as none are negative)
[13:58:24] *** rjohnson19 has joined ##java
[13:59:02] *** Error404NotFound has quit IRC
[13:59:34] *** bra1nf00d has left ##java
[13:59:42] <deadbeef> Planck_: the whole thing is \prod_{i} (a_{i}x + b_{i}y) \prod_{i} (c_{i} (1 - x) + d_{i} (1 - y))
[14:00:12] <Planck_> Ahh, that may change the behaviour ...
[14:00:37] <deadbeef> (all quantities in [0,1] in this case too)
[14:00:52] *** teralaser has joined ##java
[14:02:12] <deadbeef> i was trying to "simplify it" before going with the gradient
[14:02:32] *** snoopdave has joined ##java
[14:02:56] <deadbeef> like, to get out the x's and the y's, so i can simplify with other parts of the function
[14:03:18] <deadbeef> (that was a denumerator)
[14:03:37] <Planck_> It's going to be pretty messy ... there are obvious minima at (0,0) and (1,1), but the rest will be much harder to work out
[14:04:06] *** topriddy has quit IRC
[14:04:11] *** kUrld has joined ##java
[14:04:20] *** topriddy has joined ##java
[14:05:23] *** snoopdave has left ##java
[14:06:56] *** Huulivoide has joined ##java
[14:08:04] *** inktri has joined ##java
[14:08:13] <Kryigerofe> Hmm. Does anyone know how to update Java Web Start applications so that it won't keep using outdating cached files (like images)? I tried looking in the internet without much luck.
[14:09:00] <Kryigerofe> If I simply replace the .jar file, it will notice the new code but not the new images...
[14:09:13] <inktri> what's the best way to have a PriorityQueue<Integer> poll() the largest int as opposed to the smallest?
[14:09:58] *** rretzbach has quit IRC
[14:10:41] *** harry_ has joined ##java
[14:11:05] <dreamreal> inktri: pass in a comparator that inverts the comparison
[14:11:24] <aLeSD> I don't understandf why I get a java.util.ConcurrentModificationException
[14:11:38] <dreamreal> aLeSD: are you modifying the list while something is iterating over it?
[14:11:50] <cheeser> "yes"
[14:12:05] <aLeSD> I have one ReentrantLock that lock unlock everytime I read or write the list
[14:12:18] <dreamreal> cheeser: we should alter the topic, to say to expect java answers for android questions
[14:12:20] <aLeSD> cheeser: of course
[14:12:41] *** devkhadka has joined ##java
[14:12:41] <dreamreal> aLeSD: you can't modify the the list while iterating over it
[14:12:54] <cheeser> outside of using the itertor to modify it
[14:12:57] <inktri> dreamreal: do i have to define my own inversion Comparator class or does one already exist?
[14:13:14] <dreamreal> inktri: I imagine you'd need to write your own, but it'd be trivial
[14:13:26] <Huulivoide> If I have java lib that has 3 jars lib.jar lib-min.jar lib-xpath.jar. Would these be commonly separate libraries that differend apps use or are they just differend versions of the same lib with the min example having just the base functionality? Are these names hard coded in the apps, so would it be enought to put the biggest (most functionality) in to the shared lib folder. Im Trying to make the minuscule java support in Arch Lin
[14:13:47] <aLeSD> dreamreal: promise me that nobody can lock one ReentrantLock when is locked
[14:13:51] <aLeSD> wait
[14:13:55] <dreamreal> aLeSD: um.
[14:14:04] <aLeSD> um
[14:14:10] <Tashtego> +l
[14:14:38] <aLeSD> I want a f**********g basic, pure , standard mutex!!!!
[14:15:50] *** Lectus has joined ##java
[14:16:55] <dreamreal> then use one
[14:17:18] *** inktri has left ##java
[14:17:40] *** pZombie has quit IRC
[14:17:47] <Planck_> Also, mutexes often have little to do with ConcurrentModificationExceptions
[14:17:58] <Planck_> You can get that exception in a single threaded program
[14:18:30] <topriddy> velocity under maven behaving real strange, throwing a cannot find resource error. am basically doing a VelocityEngine ve = new VelocityEngine(); then ve.getTemplate("file.tpl");
[14:18:41] *** gdoko has joined ##java
[14:18:56] <aLeSD> dreamreal: where
[14:18:58] <aLeSD> ?
[14:19:08] <Planck_> foreach (Object a : aList) { aList.add(anotherObject); // BAM! }
[14:19:39] <topriddy> wishing i could do a normal Foo.class.getResourceAsStream("file.tpl"); to locate the file. my first guess was that maven was excluding the file extension from build, but even with the <include> directive i still get the error
[14:19:58] <aLeSD> Planck_: what do u mean ?
[14:20:04] <aLeSD> I think that's mu case
[14:20:11] <dreamreal> aLeSD: then stop doing that!
[14:20:34] <dreamreal> I mean, that's the case that the concurrentmodificationexception exists for
[14:20:46] <dreamreal> you're altering the list outside of the context of the iterator
[14:23:59] <Planck_> There are two simple fixes: either create a new list to store the elements you want to add, then append them in bulk after you're done iterating, or use an explicit ListIterator and its .add() method.
[14:24:21] <cheeser> rtfm++
[14:24:58] <aLeSD> Yes!!!!
[14:25:02] <aLeSD> I found Semaphore
[14:25:05] * dreamreal sighs
[14:25:10] <cheeser> tee hee hee
[14:25:13] <Planck_> Oh God :(
[14:25:17] *** Lartza has joined ##java
[14:25:19] <cheeser> aLeSD: why do you ask for help if you ignore all the answers?
[14:25:22] *** jor has joined ##java
[14:25:35] <Lartza> So... jar that doesn't work on Linux but works on windows? :/
[14:25:45] <Lartza> cannot find main class
[14:25:48] <dreamreal> because it's dalvik and therefore any unpleasant answer is just wrong
[14:25:53] <dreamreal> Lartza: because you're doing it wrong
[14:25:55] <Lartza> but when I look at build/classes there is the class
[14:26:00] <dreamreal> jar works the same across platforms.
[14:26:12] <dreamreal> "build/classes?"
[14:26:13] <Lartza> dreamreal: For some reason it can't find the main class in linux :/
[14:26:15] <beasty> anyone here used the rxtx lib ?
[14:26:19] <dreamreal> Lartza: then you're doing it wrong
[14:26:35] <dreamreal> show the command you're using to invoke it
[14:26:40] *** eyesUnclouded has joined ##java
[14:27:46] *** Tashtego has quit IRC
[14:29:30] <Lartza> dreamreal: http://pastebin.com/rDZNLiQE
[14:30:31] <dreamreal> and so you run this in a directory that contains /net/world/WorldServer?
[14:30:50] <Lartza> no I...
[14:30:56] <dreamreal> and why not?
[14:31:01] <Lartza> CLASSPATH contains the jar that has all the class files
[14:31:16] <dreamreal> so display the classpath too
[14:31:55] <Lartza> Yea just realized :)
[14:31:56] <Lartza> http://pastebin.com/tjmErEJt
[14:32:20] <Lartza> And java is run on the folder that contains the folder dist
[14:32:22] <dreamreal> and jar tvf dist/HelloWorld.jar
[14:32:55] <Lartza> error in opening zip file?
[14:33:14] <dreamreal> well, if you can't open it, that might be a problem. You said you'd checked?
[14:33:25] <Lartza> Checked what? :)
[14:33:30] <Lartza> Iäll ftp it to my widnows box
[14:33:36] <Lartza> *I'll
[14:33:37] <dreamreal> that "build/classes had the class"
[14:33:49] <dreamreal> you don't know how to fix it/check it on linux?
[14:33:54] <dreamreal> Why are you using linux then?
[14:34:13] <Planck_> It would be really amusing if it was FTPed in text mode.
[14:34:21] <dreamreal> Planck_: to an extreme
[14:34:28] <Lartza> Planck_: It was compiled and jar'd in Linux :)
[14:34:30] <aLeSD> ok ... I am done : http://codepad.org/58qIgtPt
[14:34:48] <aLeSD> if I comment the subList line .. it works.
[14:35:01] <Lartza> dreamreal: apache ant created build/classes that has net/world/WorldServer.class
[14:35:09] <Lartza> and jar was created from taht build/blasses
[14:35:12] <Lartza> *classes
[14:35:15] <dreamreal> Lartza: right. jar tvf on the jar
[14:35:20] <aLeSD> I lock before and after work with the return value of the function
[14:35:43] <Lartza> dreamreal: And then?
[14:36:21] <dreamreal> Lartza: *sigh* look: for some reason the java command is unable to read the resources from the jar. So we need to figure out why. Java isn't special.
[14:36:33] *** veasmkii has quit IRC
[14:36:42] <Lartza> I'll tr to run it in windows...
[14:36:48] <Lartza> Because there it did work
[14:36:51] <Lartza> Which is weird
[14:36:51] <dreamreal> Lartza: no need.
[14:37:02] <Lartza> Well...
[14:37:05] <dreamreal> and if it works in windows, the problem is on linux somehow.
[14:37:49] <Lartza> dreamreal: How about netbeans jar is 1,9MB and Apache Ant only 790kb?
[14:37:56] <Lartza> bytes
[14:38:01] <dreamreal> Lartza: examine what's in the jar that's different.
[14:38:06] *** surial has joined ##java
[14:38:10] * dreamreal sighs. Triage over IRC is nuts.
[14:38:41] <Lartza> dreamreal: Regardless of the size difference windows can run the jar :/
[14:38:53] <dreamreal> Lartza: *sigh* you're making it hard for me to keep caring
[14:38:57] * tjsnell yawns
[14:39:08] <Lartza> dreamreal: Sorry :)
[14:39:39] <dreamreal> Lartza: if you want someone to keep helping you, focus and work on the stuff you're supposed to be focusing on.
[14:39:58] <dreamreal> Namely: what is different? If it works on one but not the other, SOMETHING is different. File sizes aren't enough.
[14:40:21] <Lartza> something is different on the systems
[14:40:27] <dreamreal> no doubt.
[14:40:33] <Lartza> Since the smaller jar runs on both, so it's not the jar
[14:40:47] <dreamreal> gee. What are the permissions on the linux system?
[14:40:52] <aLeSD> maybe this is better http://codepad.org/ukYCq6r6
[14:40:58] *** drindt has joined ##java
[14:41:16] *** EricInBNE has quit IRC
[14:41:33] <Lartza> dreamreal: ;)
[14:41:34] <Lartza> 644 for the jar :P
[14:42:21] <dreamreal> okay. strings HelloWorld.jar, then unzip -t HelloWorld.jar
[14:42:24] <Lartza> well still :/
[14:43:04] <dreamreal> validate the contents
[14:43:10] *** kUrld has quit IRC
[14:43:49] <Lartza> dreamreal: Sigh...
[14:43:55] *** Nikelandjelo has joined ##java
[14:43:58] <Lartza> It was wrong casing
[14:44:19] <Lartza> Helloworld vs HelloWorld on the CLASSPATH and the real name of the jar
[14:44:28] <Lartza> Windows doesnät care
[14:44:31] <Lartza> *doesn't
[14:44:34] <dreamreal> indeed.
[14:44:40] * Lartza hides in shame
[14:44:42] <Lartza> :P
[14:44:51] <dreamreal> hey, at least it works out
[14:44:59] <Lartza> Hopefully :)
[14:45:16] <tjsnell> ~ridicule Lartza
[14:45:16] * javabot points at Lartza and laughs
[14:45:36] <Lartza> :D
[14:45:52] <tjsnell> there's a reason OSX's default is case insensitive file system
[14:46:05] <Lartza> Linux FTW
[14:46:06] <Lartza> :)
[14:46:15] <tjsnell> can't afford it
[14:48:06] *** ker has joined ##java
[14:48:40] <aLeSD> you are right
[14:49:09] <ker> is it normal that interfaces designed with netbeans aren't "what you see is what you get" ?
[14:49:56] <dreamreal> ker: no
[14:53:12] *** rigved has joined ##java
[14:53:34] *** Lartza has quit IRC
[14:54:24] <ker> I think this happens because some items, like comboboxes, do auto-resize depending on the text
[14:54:27] <ker> is there a way to avoid this?
[14:54:31] <ker> I'm using swing
[14:54:45] <dreamreal> oh, THAT kind of interface
[14:55:31] <ker> yes :D
[14:55:34] <ker> user interface
[14:58:24] <tjsnell> dirty words
[15:00:36] *** nmx has quit IRC
[15:05:06] *** nmx has joined ##java
[15:05:31] *** BeholdMyGlory has joined ##java
[15:11:11] *** tokam has joined ##java
[15:12:05] *** Alundra has joined ##java
[15:12:36] *** whaley has quit IRC
[15:16:29] *** ab500 has quit IRC
[15:17:05] *** ab500 has joined ##java
[15:19:24] *** chomping has quit IRC
[15:21:28] *** toki78 has joined ##java
[15:24:28] *** toki78 has quit IRC
[15:25:21] *** gdoko has quit IRC
[15:29:32] *** neuro_sys has joined ##java
[15:29:55] <Alundra> what's wrong with this: http://pastebin.com/4mQTZpRc
[15:30:30] <FauxFaux> Alundra: It doesn't work.
[15:30:42] *** srji has joined ##java
[15:30:54] *** flip28 has joined ##java
[15:31:02] <Alundra> FauxFaux: obviously. But I can't see why
[15:34:06] <tjsnell> ~doesn't work
[15:34:06] <javabot> tjsnell, 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)
[15:34:46] <Alundra> tjsnell: is that directed at me?
[15:35:06] <tjsnell> really?
[15:36:11] *** eidolon has joined ##java
[15:36:45] <Alundra> I think the code speaks for itself. I have a panel, and I add a text area and a text field to the the panel, and I want the text you write in the text field to display in the text area when an action event is fired.
[15:37:41] *** squeakytoy is now known as mordu
[15:39:07] <mordu> Can anyone tell me why this "String a = "abc"; String b = "abc"; System.out.println("abc" + a == b);" returns "false"?
[15:39:37] <Alundra> because "abcabc" != "abc"
[15:40:02] <mordu> string conjugation before.. hm
[15:40:06] <mordu> ok, got it :)
[15:40:36] <mordu> so its really ("abc"+a) == b?
[15:41:02] <eidolon> ~tell mordu about tias
[15:41:03] <javabot> mordu, Try it and see. You learn much more by experimentation than by asking without having even tried.
[15:41:10] <tjsnell> mordu: don't use ==
[15:41:35] <tjsnell> you don't understand what that's doing user a.equals(b) to compare the content of the strings
[15:41:36] <mordu> I did try, but i was something about something else
[15:41:44] <mordu> but I prefecly clear now
[15:41:55] <mordu> its
[15:42:06] <mordu> wow, i cant type
[15:42:08] <tjsnell> a == b says does the reference value in a = the reference value b
[15:42:13] *** Huulivoide has left ##java
[15:42:41] <mordu> yea, but that wasnt the point of the "trick code" tho?
[15:42:41] *** frangiz has quit IRC
[15:43:27] *** frangiz has joined ##java
[15:43:31] <mordu> String a = "abc"; String b = "abc"; System.out.println("abc" + a == b);" - one would expect "abctrue"
[15:43:34] <Alundra> so, why isn't my piece of code working?
[15:43:53] <Alundra> mordu: what?
[15:43:53] <mordu> unless they know that abc and a are added before the object reference
[15:44:04] <tjsnell> mordu: no one wouldn't if they understood == and java
[15:44:31] <mordu> tjsnell: its nothing about the ==
[15:44:38] <mordu> tjsnell: its about the prio order
[15:44:43] <tjsnell> OK, you're smarter than me
[15:44:45] <Alundra> mordu: Like I said, "abcabc" != "abc"
[15:44:55] <tjsnell> oddly I'm not having silly issues
[15:44:59] <tjsnell> goodluck
[15:45:14] <mordu> Alundra: exactly. Exactly, the trick code isnt about the "==" which is totally valid.
[15:45:35] <Alundra> trick code?
[15:45:48] <mordu> tjsnell: the problem is that people see the code as: x == y
[15:46:03] * tjsnell boggles
[15:46:15] <Alundra> mordu:
[15:46:26] <tjsnell> you're an idiot!
[15:46:30] <Alundra> in Java, you don't compare the contents of strings using ==
[15:46:41] <tjsnell> even in 'trick' code
[15:46:44] <mordu> Alundra: I dont you shouldn't, but you "can"
[15:46:56] <tjsnell> not and get reliable results
[15:46:57] <Alundra> mordu: Ehm... no...?
[15:47:00] <mordu> but thats not the purpose of the exercide code..
[15:47:28] *** whaley has joined ##java
[15:47:30] <mordu> Alundra: its physically impossible to use == on two strings?
[15:47:51] <Alundra> mordu: no, but == doesn't compare the contents of the strings
[15:47:56] <whaley> mordu: uhm... what?
[15:48:07] <tjsnell> == will NEVER reliably tell you if the 2 strings are equal
[15:48:08] <mordu> Alundra: or what did you disagree on when i said "I dont you shouldn't, but you "can" (which I meant, I know)
[15:48:08] <tjsnell> never
[15:48:13] <whaley> mordu: == works just fine on Strings, it compares reference equality
[15:48:16] <whaley> just like any other object
[15:48:22] <tjsnell> since this is code, non of it is physical
[15:48:44] *** CrossWired has joined ##java
[15:49:10] *** rigved has quit IRC
[15:49:11] <mordu> whaley: exactly
[15:49:24] <tjsnell> and you expected it to be true
[15:49:29] <whaley> ~~ whaley five minutes
[15:49:29] <javabot> whaley, what does that even *mean*?
[15:49:34] <whaley> ugh, what is that factoid :P
[15:49:35] <tjsnell> meaning you don't understand what whaley just said
[15:49:40] <mordu> tjsnell: a == b is true
[15:49:43] <tjsnell> no
[15:49:46] <tjsnell> it's not
[15:49:47] <[twisti]> mordu: by random chance
[15:49:51] <[twisti]> it could be false too
[15:49:51] *** Lectus has quit IRC
[15:49:53] <tjsnell> not reliably
[15:49:58] <[twisti]> depending on where you run it, it might be
[15:50:28] <[twisti]> == does not do what you think it does in this context
[15:50:35] *** frangiz has quit IRC
[15:50:39] *** tigger0jk has quit IRC
[15:50:40] <[twisti]> i know that i just HAPPENS to give you the result you expect
[15:50:45] <[twisti]> but thats a coincidence
[15:50:51] <whaley> that depends on whether the String was interned or not
[15:50:52] <mordu> It was apparently a bad example to use Strings
[15:50:55] *** devkhadka has quit IRC
[15:50:58] <[twisti]> yes, it was
[15:51:07] <whaley> mordu: probably, Strings get some slightly special treatment in regards to allocation
[15:51:17] <tjsnell> it's a bad example to use any Object that way
[15:51:25] *** CrossWired has quit IRC
[15:51:25] *** frangiz has joined ##java
[15:51:25] <mordu> I should have used another object, because people like tjsnell got confused what the purpose of the exercise was
[15:51:28] <tjsnell> no
[15:51:31] <tjsnell> you shouldn't have
[15:51:35] <tjsnell> you still don't understand
[15:51:38] <whaley> (unless you really want to compare for reference equality, which is somewhat rare in my experience)
[15:51:42] <[twisti]> no, == doesnt work with any objects at all the way you want to
[15:51:55] <mordu> the way i want?
[15:51:55] <whaley> just use .equals and be done with it
[15:51:55] <[twisti]> you can ONLY use == with primitives to do what you want
[15:51:57] <whaley> :P
[15:52:05] <tjsnell> == on any Object, including String, checks for referential equality not value equality
[15:52:13] <mordu> yes
[15:52:15] <mordu> I know that
[15:52:16] *** ChanServ sets mode: +o tjsnell
[15:52:19] <[twisti]> and you dont understand what referential equality is
[15:52:20] *** tjsnell sets mode: +b *!*@107-232-96-87.cust.blixtvik.se
[15:52:26] *** CrossWired has joined ##java
[15:52:42] <tjsnell> you don't know that and your refusal to listen has grown old
[15:52:56] <[twisti]> ~tjsnell++
[15:52:56] <javabot> tjsnell has a karma level of 1, [twisti]
[15:52:58] <CrossWired> anyone use IntelliJ, I think I'm doing something wrong with webservices
[15:53:03] <whaley> ~equals
[15:53:03] <javabot> whaley, equals is http://leepoint.net/notes-java/data/expressions/22compareobjects.html
[15:53:04] <Alundra> on an unrelated note, I'll ask again: consider this piece of code: http://pastebin.com/4mQTZpRc I want to write something in the text field, and when I press Enter, I want the text to be added to the text area. It's not working. Why?
[15:53:18] <whaley> CrossWired: what do you want to do? chances are it isn't specific to Intellij
[15:53:26] *** Carnage\ has quit IRC
[15:53:34] <whaley> CrossWired: and what kind of WebServices? SOAP?
[15:54:00] <CrossWired> Whaley: trying to import a webservice, so i use 'Generate JAVA code from WSDL' its a run of the mill SOAP
[15:54:33] <[twisti]> ~tell Alundra about doesnt work
[15:54:33] <javabot> Alundra, what does that even *mean*?
[15:54:37] <[twisti]> hm
[15:54:37] <whaley> CrossWired: I typically solve this in my build script/system with a wsdl2java (or similar) invocation
[15:54:39] *** kieran491 has quit IRC
[15:54:41] <[twisti]> ~doesnt work
[15:54:41] <javabot> [twisti], what does that even *mean*?
[15:54:47] <[twisti]> whats that stupid factoid
[15:54:58] <[twisti]> anyways, Alundra, you need to tell us what the actual problem is
[15:54:59] <CrossWired> whaley: the IDE sees it and validates the calls fine, but when i export it doesn't seem to be exporting
[15:55:01] <whaley> CrossWired: if you are maven, for instance: http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html
[15:55:04] <[twisti]> "doesnt work" can mean a million things
[15:55:13] <CrossWired> whaley: java.lang.NoClassDefFoundError: com.ProgramClass.smsClass.Send
[15:55:28] *** Carnage\ has joined ##java
[15:55:32] <whaley> CrossWired: I don't know what Intellij might be doing there :(
[15:55:33] <[twisti]> for example, it seems from the code that you want the entire contents of the text field to be added every time the puser presses or releases a button
[15:55:36] <Alundra> [twisti]: Well, it's not copying the text over to the text area
[15:56:08] <whaley> CrossWired: export in this context means what?
[15:56:25] <[twisti]> does enter get called at all ?
[15:56:33] <CrossWired> whaley: includes in the build for the device (doing Android dev)
[15:57:08] <CrossWired> whaley: preface I am new to java, coming from a strong C# background, so it very well possible i'm doing something wrong
[15:57:08] <whaley> CrossWired: oh. check your .jars or whatever your android artifact is to make sure those generated classes made it in
[15:57:21] <Alundra> I know the ActionListener is working because if I replace the code in lines 9 and 10 with something like JOptionPane.showMessageDialog(null, "Hello, World!"); then the dialog shows
[15:57:23] <Alundra> up
[15:57:27] <CrossWired> whaley: good idea
[15:57:45] <[twisti]> is it actually getText for text fields and not getValue or something ?
[15:58:08] <Alundra> [twisti]: according to the Java tutorial, it is getText()
[15:58:35] <[twisti]> then im not sure
[15:58:35] <whaley> CrossWired: http://www.jasonwhaley.com/script_for_finding_files_within_jars_within_a_directory_hierarchy <--- that might help unless the are in another zipped package meant for android
[15:58:38] <whaley> (shameless plug)
[15:58:53] <whaley> this assumes you have bash on your system
[15:58:57] *** L-----D has quit IRC
[15:59:01] <gener1c> what can balanced binary trees be used for in real world programming?
[15:59:01] <[twisti]> are you sure the same instances are used ? cant tell from your code, but you might try to update the wrong textarea
[15:59:26] <gener1c> (what would they be an optimal choice for)
[15:59:35] <Alundra> hmm
[15:59:38] <Alundra> I've been considering this
[15:59:42] <whaley> ... and someone spammed that page with a viagra ad. time to switch to disqus </offtopic>
[16:00:14] <Alundra> but if I create a JTextField and JTextArea, instantiate them...
[16:00:24] <Alundra> well nevermind that now
[16:00:37] <whaley> CrossWired: btw, good selection on choosing Idea initially for your java dev. Were you using resharper for C# earlier?
[16:00:49] <Alundra> let me actually look into that quckly
[16:00:52] <CrossWired> whaley: yes
[16:02:11] <whaley> CrossWired: i'm about to try resharper on some c# code I'm going to have to write today. Wish me luck :P </offtopic>
[16:02:12] <Alundra> okay, that's probably it
[16:02:38] <CrossWired> whaley: will deifinately help
[16:02:51] <CrossWired> whaley: unless you write amazingly perfect code frm the start :)
[16:02:58] <whaley> never.
[16:03:28] <whaley> CrossWired: anyways... any luck on finding out if those generated classes made it in your deployable android package?
[16:04:09] <CrossWired> whaley: looking here: http://forum.sdx-developers.com/android-2-1/%28learn-to-fish%29-general-structure-of-an-apk/ it appears as though i need to decompile a file
[16:04:34] <whaley> CrossWired: there's also #android here, for android specific questions
[16:04:48] <whaley> (most folks here are android ignorant, actually. myself included)
[16:04:55] <CrossWired> whaley: android-dev is dead as can be this morning
[16:05:05] <CrossWired> whaley: i'll try standard Android
[16:05:09] <whaley> *nod*
[16:05:28] <whaley> oh, it is #android-dev for actual coding questions. I'm wrong
[16:05:29] <whaley> CrossWired: ^
[16:05:49] <whaley> CrossWired: maybe ask on stackoverflow.com if you get stuck
[16:05:58] <CrossWired> whaley: thats my next step
[16:06:16] <CrossWired> whaley: i've asked on jetbrains.com forum to see if its IntelliJ specific, but no answer there
[16:06:53] <Alundra> uugh
[16:07:51] <Alundra> [twisti]: How do I reference an object somewhere else
[16:08:26] *** ChanServ sets mode: +o tjsnell
[16:09:19] *** tjsnell sets mode: -b *!*@107-232-96-87.cust.blixtvik.se
[16:09:21] *** Matuku has joined ##java
[16:09:32] *** ChanServ sets mode: +o tjsnell
[16:09:47] *** choongii has quit IRC
[16:10:59] *** bindaas has quit IRC
[16:11:00] *** [twisti] has quit IRC
[16:11:21] *** bindaas has joined ##java
[16:11:26] *** McMAGIC-- has quit IRC
[16:13:34] *** choongii has joined ##java
[16:14:13] *** spaek has joined ##java
[16:14:40] <spaek> heya.. i want to get into some 3D programming with java.. and there seems to be a jungle of API's out there.. which one would you suggest?
[16:15:10] <zChris_> CrossWired, from the looks of it it cant find the class
[16:15:36] *** magentar has quit IRC
[16:16:02] *** supercosmonaut has quit IRC
[16:16:09] <CrossWired> zChris: yeah i see that so I'm assuming its something I have to setup to tell it to export that class to the device, i'm looking at the AndroidManifest.xml for possible solutions at this point
[16:16:53] <_W_> spaek, depends on your purpose
[16:17:00] <_W_> games? probably lwjgl
[16:17:22] <zChris_> CrossWired, alright, let me know if you fix it :)
[16:17:32] <CrossWired> will do
[16:17:38] *** matsebc has quit IRC
[16:17:43] *** _Tristan_ has joined ##java
[16:18:59] *** ker has quit IRC
[16:20:20] *** pipeep has quit IRC
[16:20:26] *** supercosmonaut has joined ##java
[16:23:51] *** Versuchen has quit IRC
[16:25:36] *** nous1024 has left ##java
[16:25:39] *** eidolon has quit IRC
[16:28:01] *** McMAGIC-- has joined ##java
[16:28:22] *** bearded_oneder has joined ##java
[16:31:18] *** pipeep has joined ##java
[16:33:39] *** yoshx has quit IRC
[16:41:56] *** xastey has joined ##java
[16:42:01] <xastey> soo.. java --classpath ./*.jar doesn't pick up all the jars??
[16:42:27] <_W_> ~classpath
[16:42:27] <javabot> 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].
[16:42:57] <xastey> um lies o_0
[16:43:05] *** eyesUnclouded has quit IRC
[16:43:28] <xastey> o nvm
[16:43:31] <xastey> user error
[16:43:39] <xastey> could just do -classpath *
[16:43:43] <_W_> always helps to read the docs :)
[16:43:50] <xastey> didn't work when i did -classpath ./*.jar
[16:43:53] <_W_> *.jar does not work, but * does
[16:44:00] *** tilerendering has quit IRC
[16:44:06] <xastey> well perfect.. back to working i go
[16:44:10] <xastey> thanks _W_
[16:44:26] <_W_> (in fact, * is equivalent to *.jar in normal globbing
[16:44:33] <Alundra> alright guys, how about this: http://pastebin.com/ND3FwaDk
[16:45:01] <_W_> Alundra, how about describing the problem a little in the channel, for those of us who might not easily open links?
[16:45:02] <Alundra> same problem: I write something in the JTextField, and I want that text to copy over to the JTextArea when I press Enter.
[16:45:18] <_W_> ah, swing stuff, nevermind then
[16:45:40] <Alundra> ...right
[16:45:58] *** cbeust has quit IRC
[16:46:24] *** madhat has joined ##java
[16:46:33] *** cbeust has joined ##java
[16:46:33] <Alundra> so, why isn't it working now?
[16:46:49] <Alundra> I know it responds to the user pressing Enter
[16:47:59] *** jor has quit IRC
[16:48:11] <xastey> crap can't do *
[16:48:27] <xastey> some of my jars need to be loaded in the correct order.. well that sucks
[16:49:52] <Alundra> and it shouldn't be a reference problem because whenever a new Enter object is created, it passes on existing attributes.
[16:53:08] *** c_axis has joined ##java
[16:53:55] *** darkredandyellow has joined ##java
[16:54:16] *** Sliker has joined ##java
[16:54:50] <darkredandyellow> We are looking for java developers in berlin, germany. PM me if interested
[17:00:23] <madhat> is it possible to have a method in an abstract that isn't public?
[17:00:59] <webczat> Hey, dwhen I open swt shell and enter an event loop, why it's the case that pressing ctrl+c causes the program to, like, hang?
[17:02:24] <webczat> I mean sending sigint to it, not pressing ctrl+c in the window.
[17:02:46] <webczat> madhat: yes.
[17:02:56] *** xiliax has quit IRC
[17:04:05] *** FrozenKnight has quit IRC
[17:04:32] *** FrozenKnight has joined ##java
[17:06:04] <xastey> hey guys, i'm trying to use reflection to invoke some methods, but I'm getting an method not found. but I dont see were I went wrong
[17:06:05] <xastey> http://pastebin.com/1VMu414s
[17:06:20] <xastey> java.lang.NoSuchMethodException: application.Application.doGoogleDocsLogin(com.milgra.server.api.WrapperMap)
[17:07:45] *** shaunren has joined ##java
[17:08:19] <TheTrash> I'm not an expert on reflection, but can it invoke a method even if a method is private?
[17:08:36] *** xiliax has joined ##java
[17:09:21] <xastey> yeah i tried setting it to public
[17:09:21] <xastey> still didn't work
[17:09:58] <cheeser> TheTrash: yes, you can.
[17:09:58] *** Versuchen has joined ##java
[17:09:58] <_W_> TheTrash, you can, if you set it as accessible
[17:09:58] <TheTrash> Ok
[17:09:58] <xastey> think you guys could check out my pastebin?
[17:10:50] <_W_> we did
[17:10:50] <cheeser> xastey: call setAccessible(true) on the Method first
[17:10:50] <_W_> ~test case
[17:10:50] <javabot> _W_, sscce is a minimal independently runnable program, which demonstrates the problem; see http://www.pscode.org/sscce.html for details and a HOWTO
[17:10:50] <xastey> ok cheeser
[17:10:58] <xastey> umm wait.. its failing at method = clazz.getMethod(id, parameterTypes);
[17:11:55] <_W_> yes
[17:11:55] <xastey> so how do I do that
[17:11:55] *** darkredandyellow has quit IRC
[17:11:55] <_W_> I see the problem
[17:11:55] <xastey> google time
[17:11:55] <_W_> xastey, you are asking about the method of the subclass, presumably
[17:11:55] <cheeser> getDeclaredMethod()
[17:11:55] <_W_> indeed
[17:11:57] <xastey> ok testing
[17:12:20] <_W_> ~javadoc class.getMethod(*)
[17:12:20] <javabot> _W_: http://is.gd/ZZg686 [JDK: java.lang.Class.getMethod(String,Class[])]
[17:14:20] <_W_> it's not very clear from the docs
[17:14:56] <xastey> seems to not error out
[17:15:17] <xastey> just need to add more debug outputs
[17:15:27] *** porkchopdiet has joined ##java
[17:16:14] <webczat> What about this swt 3.6 thing?
[17:16:35] <porkchopdiet> Java, in Terms of Grammar, is a _context-free_ grammar. right?
[17:16:59] <madhat> webczat: so all fields in interfaces are public static final or public abstract and fields in abstract can be anything, right?
[17:17:14] <webczat> madhat: yeah.
[17:17:30] <webczat> Interfaces are so special so their fields must be public abstract.
[17:17:33] *** daark has quit IRC
[17:17:52] <webczat> But abstract classes are still normal classes.
[17:18:27] <xastey> eh argument type missmatch
[17:18:54] <webczat> madhat: and to clarify, methods are not fields
[17:18:57] <xastey> ~javadoc class.getDeclaredMethod(*)
[17:18:58] <javabot> xastey: http://is.gd/ueHCeC [JDK: java.lang.Class.getDeclaredMethod(String,Class[])]
[17:19:03] <madhat> webczat: wait, so they have to be public abstract or can they be public static final in an interface?
[17:19:15] *** supercosmonaut has quit IRC
[17:19:43] *** VJTachyon has joined ##java
[17:19:51] *** nucc1 has joined ##java
[17:20:09] <cheeser> interface methods can not be final
[17:20:12] <cheeser> or static
[17:20:13] <webczat> madhat: fields are not methods and methods are not fields
[17:20:32] <webczat> you're mixing those terms
[17:20:38] <whaley> hooray for symmetry
[17:20:43] <nucc1> to create an array of 20 new objects, do i need a loop?
[17:20:49] <madhat> i meant fields for public static final, sorry
[17:21:07] <madhat> fields can be public static final and methods can be abstract?
[17:21:15] <whaley> nucc1: new Object[20]; gives you an array 20 indicies that you can put objects in to. from there loop or use Arrays.fill
[17:21:32] <webczat> madhat: in interfaces, they must be
[17:21:38] <nucc1> whaley, i see. i thought it would do what it does for primitives :p
[17:21:39] <whaley> nucc1: chances are you want new SomeObjectClassThatIsInteresting[20] though
[17:21:55] <nucc1> yes, i did new OBject[20]
[17:21:56] <cheeser> public static final is redundant for an interface field
[17:22:10] <cheeser> public is always redundant in an interface
[17:22:11] <ojacobson> I tend to write it out in full anyways, for no particularly good reason
[17:22:19] <nucc1> whaley, but apparently, it doesn't call the constructor 20 times and fill the array with the new objects, or does it?
[17:22:21] <whaley> nucc1: well, each index value refers to null until you set the index to an actual reference
[17:22:21] <ojacobson> If you press me I'll say I do it for consistency, but
[17:22:37] <whaley> nucc1: it doesn't... you have to do that yourself
[17:22:39] <webczat> When java started to contain the jit compiler?
[17:22:41] <nucc1> whaley, yea, i got a null pointer exception when i tried to use the object
[17:22:52] *** matsebc has joined ##java
[17:23:09] <whaley> nucc1: any reason you are using arrays instead of Lists for this, btw?
[17:23:27] <nucc1> whaley, just for simplicity :p
[17:23:32] <nucc1> forgive me :)
[17:23:40] <xastey> cheeser
[17:23:49] <nucc1> i've never studied the java class library enough to know about it's lists implementation
[17:23:58] <xastey> after doing method = clazz.getDeclaredMethod(id, parameterTypes); i'm getting an IllegalArgumentExpection
[17:24:18] <xastey> but the caller is an instance of the clazz
[17:24:26] <xastey> and the method sig looks correct
[17:24:37] <xastey> o nvm
[17:24:38] *** surial has quit IRC
[17:24:39] <xastey> stupid ass me
[17:25:29] <whaley> chr
[17:25:58] <xastey> sweet works
[17:26:11] <webczat> Why java can't compare bool and int?
[17:26:49] <ojacobson> webczat: Java booleans have no intrinsic integer value
[17:27:08] <ojacobson> what number is 'true' equal to? (not as trivial as it sounds, and all answers are equally arbitrary)
[17:27:41] <madhat> webczat: so if i have abstract void draw(); is that abstract and not public?
[17:27:44] <Candle> ojacobson: heh, the bytecode oprtations are the same for boolean/byte/short/integer though. :)
[17:27:59] <ojacobson> Candle: the JVM is not the Java language :)
[17:28:09] <nucc1> why doesn't java support operator overloading?
[17:28:27] <ojacobson> nucc1: Long-standing design decision. Long threads about it are easily googled up from the vasty deeps.
[17:28:27] <webczat> Hemm, I heart that java is very slow, is that right?
[17:28:40] <nucc1> webczat, not really.
[17:28:54] *** Cymage has joined ##java
[17:28:55] <webczat> So how fast is it?
[17:28:59] <Candle> nucc1: My thoughts on that are that there are many 'features' that make C/C++ harder to read and understand, operator overloading is one.
[17:29:03] <ojacobson> webczat: Now you've heard that it's not, too. Guess you're going to have to go measure something you care about.
[17:29:16] <ojacobson> Can we stop bringing up old, old flamebait?
[17:29:21] <_W_> webczat, 87 miles per hour
[17:29:24] <nucc1> webczat, write two programs in C/C++ and compare with java.
[17:29:39] *** DerHorst has quit IRC
[17:30:05] <nucc1> Candle, well, that's arguable, but i do miss operator overloading though.
[17:31:00] *** whaley has quit IRC
[17:31:08] <ojacobson> nucc1: There are JVM languages that have it
[17:31:31] <webczat> nucc1: there are times that operator overloading is handy.
[17:31:35] *** flippo has joined ##java
[17:31:36] <nucc1> ojacobson, that kills one of java's biggest strengths. write once, run almost everywhere.
[17:31:46] <ojacobson> ... what
[17:31:58] <nucc1> java's the only language i know that comes close
[17:32:13] <_W_> nucc1, you did not understand what you responded to
[17:32:24] <nucc1> hmmm
[17:32:32] <nucc1> there are JVM languages that have it.
[17:32:36] <_W_> ojacobson said that there are languages that run on the Java virtual machine that has operator overloading
[17:32:43] <nucc1> heh
[17:32:54] <_W_> "write once, run anywhere" is a property of the JVM, not the language
[17:32:56] <nucc1> i read there are JVMs that have it
[17:33:02] <ojacobson> Yeah, no
[17:33:07] <ojacobson> "operator" isn't a JVM-level concept
[17:33:14] <ojacobson> (It's bytecode all the way down :)
[17:34:10] * nucc1 goes off to check the syntax for getting an array's length :p
[17:34:36] <nucc1> ah, i put () after it :)
[17:34:45] <webczat> hey, actually openfire jabber server, when starting up and initializing, made my cpu temperature jump from 70c to 90c (cpu was slightly broken but still...), and was doing that for few seconds.
[17:35:06] <nucc1> webczat, well, what does that matter?
[17:35:23] <webczat> no c/c++ program i've seen did that.
[17:35:28] <nucc1> ha ha ha
[17:35:31] <webczat> neither python or perl too
[17:35:32] <nucc1> HU HU HE HA HA HA
[17:35:57] <nucc1> i have a small C++ program here that eats 2G of RAM, and zaps the CPU flat out for about 3 seconds.
[17:36:14] <nucc1> its a random number generator.
[17:36:22] <webczat> but openfire, being just a jabber server, should not initialize 5 seconds or more
[17:36:34] <nucc1> well, you can go look for a c++ server to use.
[17:36:52] <nucc1> human time is much more valuable than cpu time.
[17:36:59] <ojacobson> Back to ejabberd you go, then
[17:37:00] <webczat> it's like is this because java is so slow, because of the server design, or my cpu, or all three?
[17:37:08] <ojacobson> Run a profiler and see
[17:37:20] <ojacobson> If the bulk of that time is spent in app code, then it's hardly the JVM's fault
[17:37:25] <webczat> Actually I don't have anything to test on.
[17:37:27] <nucc1> webczat, are you bothered about the startup time, or the throughput of the system?
[17:37:46] <webczat> hmm, startup time.
[17:37:56] <nucc1> do your users care about that?
[17:38:04] <ojacobson> You're worried about startup time of a server?
[17:38:09] <nucc1> you're trying to optimise an unnecessary problem, IMO
[17:38:10] <ojacobson> They're supposed to start up *rarely*
[17:38:13] <webczat> because the cpu does things like that regularly. or maybe... did things like that regurarly
[17:38:37] <ojacobson> Anything under "minutes" is fine, usually (and I'm saying this despite spinning up new servers regularly as part of my integration testing)
[17:38:41] *** bindaas has quit IRC
[17:38:48] <webczat> ojacobson: if you do testing and often restart it then it matters
[17:39:02] <nucc1> apparently, he doesn't mind
[17:39:06] <nucc1> he/she :p
[17:39:41] <webczat> Especially if it at the same time starts for a long time and makes your cpu want to jump out of the pc
[17:40:04] <nucc1> dude, CPU temperatures are a good source of random number generators if you could read them :p
[17:40:41] <webczat> The only thing that did things like that to my cpu was compiling something.
[17:40:50] <nucc1> you're just trolling.
[17:40:51] <webczat> So it isn't good if it's comparable.
[17:41:55] <webczat> i'm just finding many arguments saying java is bad and want to check one of them. I don't have a program to look at that can be slow on java
[17:42:09] *** jdolan_ has joined ##java
[17:42:12] *** harry_ has quit IRC
[17:43:01] <nucc1> webczat, java is slower than C/C++ because it's an interpreted language. but in most practical situations, the difference is not enough to matter.
[17:43:12] <ojacobson> nucc1: even that's not entirely true any more
[17:43:14] <cbeust> I think operator overloading is hardly ever useful outside of mathematics
[17:43:23] <_W_> ~~ nucc1 jit
[17:43:23] <javabot> nucc1, JIT stands for "Just in time," and refers to a Just-in-time compilation phase for most modern bytecode interpreters (including many scripting languages.) It's why line numbers in Java stacktraces don't always match up. Different runtimes have different JITs; Sun's is "hotspot." See http://java.sun.com/javase/technologies/hotspot/ for more.
[17:43:24] <nucc1> ojacobson, yea, i know. still, just to pacify him.
[17:43:30] *** przem has joined ##java
[17:43:35] <cbeust> nucc1: Java stopped being interpreted a while ago, look up JIT and Hotspot
[17:43:55] <ojacobson> webczat: Go forth and google - there are tons of pages talking about actual comparative measurements
[17:44:00] <ojacobson> rather than gut "this feels slow" feelings
[17:44:35] <nucc1> i sort of realised that while doing experiments with Random number generators. the difference btw a C++ implementation and a java one for my program was too small to make the drudgery of C++ worthwhile.
[17:45:05] <cbeust> nucc1: Agreed, it's hard to justify using C++ these days except for very specific tasks.
[17:45:16] <Alundra> C++ rocks
[17:45:22] <webczat> When java started to have jit?
[17:45:31] <ojacobson> 1.3
[17:45:32] <nucc1> just in time compilation
[17:45:34] <cbeust> C++ rocked circa 1995, stopped being cool around that time
[17:45:58] <nucc1> C++ is still cool, but i find myself wishing they evolved along the lines of java :)
[17:46:13] <nucc1> i never grasped OOP until i started doing java :p
[17:46:21] *** Kamaran has quit IRC
[17:46:27] <nucc1> now i have trouble thinking in structured terms...
[17:46:40] <nucc1> i find myself wondering what impact on performance the dependence on classes has
[17:46:56] <cbeust> nucc1: Very, very little.
[17:47:02] <nucc1> good to know :)
[17:47:28] <cbeust> But don't guess, just run a profiler to see what your code is doing. Very often, the results will surprise you.
[17:47:42] *** Alundra has left ##java
[17:47:45] *** eyesUnclouded has joined ##java
[17:47:46] <nucc1> i will need to do that soon enough
[17:48:04] <nucc1> a class without methods is just as fast as a C++ struct, eh?
[17:48:39] <cbeust> nucc1: How would you measure the speed of a class without methods?
[17:48:53] <nucc1> creation time.
[17:49:05] <nucc1> he he.
[17:49:11] <nucc1> structs hve no constructors
[17:49:18] <nucc1> lol
[17:49:46] <cbeust> In C++, the only difference between a struct and a class is a vtable pointer pretty much. I don't think construction time would even be measurable.
[17:50:09] *** Lone_Rifle has joined ##java
[17:51:37] *** eyesUnclouded has quit IRC
[17:52:26] *** chandan_kumar has joined ##java
[17:53:58] *** drindt has quit IRC
[17:54:15] <webczat> How do you profile java code?
[17:54:30] <Lone_Rifle> ~jprofiler
[17:54:30] <javabot> Lone_Rifle, what does that even *mean*?
[17:54:34] <Lone_Rifle> ~g jprofiler
[17:54:34] <javabot> http://www.google.com/search?q=jprofiler
[17:54:51] <ojacobson> ~profiler
[17:54:51] <javabot> a profiler is a tool to find performance bottlenecks. VisualVM is included in JDK nowadays and is great for a free profiler; jprofiler and jprobe cost money (jprofiler has a free eval period). Some more are listed here: http://javafaq.mine.nu/lookup?169
[17:56:10] <webczat> I want a cmdline profiler
[17:56:19] <Lone_Rifle> ok
[17:58:34] *** Luc1fel has quit IRC
[18:00:48] <webczat> Class loading itself makes startup slower, right? :/
[18:01:34] <bobbytek> what is a command line profiler?
[18:02:06] <Lone_Rifle> ojacobson: good day sir. Have fun with the questions fielded today. I take my leave.
[18:02:14] <ojacobson> Lone_Rifle: eff that nosie
[18:02:15] <ojacobson> noise
[18:02:16] <nucc1> ha ha
[18:02:24] <ojacobson> I have things to do that don't involve conversations from the nineties.
[18:02:32] *** Lone_Rifle has quit IRC
[18:03:06] <webczat> profiler working on the command line without a gui. also, I checked python, c++ and java programs with time command. time java a (a is my main class) gave 0.086 sec, checking python program gave 0.020, c++ program was 0.002, those were hello worlds.
[18:03:45] <nucc1> webczat, try a program that does say 1 million calculations.
[18:03:58] <webczat> hmm
[18:04:11] <webczat> like count in a loop from 1 to million?
[18:04:13] <nucc1> just us a loop
[18:04:21] <nucc1> use a loop and do some multiplicationa nd division
[18:04:29] <webczat> hmm
[18:04:30] *** harry_ has joined ##java
[18:04:30] <ojacobson> Oh, good, more badly-designed meaningless microbenchmarks
[18:04:36] <nucc1> ha ha
[18:04:41] *** KwikkSilva has joined ##java
[18:04:41] <ojacobson> timing "hello world" at least tells you something about how long the environment takes to start up
[18:04:51] <KwikkSilva> hey guys
[18:05:56] <KwikkSilva> JAI Image I/O is confusing the life and soul of me here.... i am using Java 6 - it seems everything is there in Java 6 already - as many JAI Image I/O example seem to run out of the box
[18:06:35] <KwikkSilva> Is it already in Java 6?
[18:06:49] <webczat> java a.java
[18:06:52] <webczat> uh
[18:06:56] <webczat> fuck
[18:06:58] *** Peej has quit IRC
[18:08:20] *** Peej has joined ##java
[18:10:32] *** harry_ has left ##java
[18:11:48] *** chandan_kumar has quit IRC
[18:13:06] *** chandan_kumar has joined ##java
[18:14:41] *** Fisiu has joined ##java
[18:14:46] *** daark has joined ##java
[18:14:52] *** chandan_kumar has quit IRC
[18:15:12] *** chandan_kumar has joined ##java
[18:18:08] *** ctburley has quit IRC
[18:19:08] <KwikkSilva> Can anyone explain the JAI Image I/O and Java 6 dillemma - is it already in Java 6? The JAI downloads are pretty old on Sun.... but i dont see the native libs in Java 6 JRE? (any ideas?
[18:20:42] <webczat> what's javax.imageio?
[18:21:40] *** frangiz has quit IRC
[18:22:38] *** frangiz has joined ##java
[18:23:28] <KwikkSilva> well i guess thats my question - the difference between the javax.imageio package which ships with the JVM and the JAI imageio stuff that you can download
[18:23:54] *** fahadsadah has quit IRC
[18:23:55] *** bindaas has joined ##java
[18:24:39] *** kaemo has joined ##java
[18:24:44] *** pranay_09 has quit IRC
[18:24:52] *** fahadsadah has joined ##java
[18:25:23] <kaemo> have you seen or used 'goto' and labels in java?
[18:25:37] <ojacobson> kaemo: the keyword 'goto' is illegal in all contexts
[18:25:45] <ojacobson> It's reserved, but unused.
[18:26:07] *** Bombstone has joined ##java
[18:26:08] <kaemo> ojacobson: yea, i mean continue label1 and break label1 for example
[18:26:18] <ojacobson> ~anyone
[18:26:19] <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.
[18:27:07] <kaemo> ojacobson: i don't have any question about it. just wanted to know if anyone use it ;-)
[18:27:32] *** chandan_kumar has quit IRC
[18:28:16] * LtHummus uses goto all the time
[18:28:23] * LtHummus is now in goto rehab
[18:28:49] *** madhat has left ##java
[18:28:51] <LtHummus> My name is LtHummus and I've been a goto-er for 15 years
[18:29:16] <TheTrash> GOTO AWAY
[18:29:39] <X-Scale> heh
[18:31:39] *** chandan_kumar has joined ##java
[18:35:17] *** ExtraSpice has quit IRC
[18:37:40] *** LouisJB has quit IRC
[18:37:46] *** LouisJB_ has joined ##java
[18:40:21] *** psst has joined ##java
[18:42:26] <bearded_oneder> seriously? i was comparing ball to bawl and encountered this, http://encarta.msn.com/encnet/features/dictionary/DictionaryResults.aspx?lextype=3&search=ball
[18:43:10] <spaek> The dictionary entry you requested contains language that may be considered offensive. .. uhoh!
[18:43:42] *** ormaaj has quit IRC
[18:43:44] *** zChris_ has quit IRC
[18:43:54] *** ormaaj has joined ##java
[18:43:57] <spaek> since when has ball been highly offensive when refered to a testicle? :D
[18:44:16] *** LouisJB_ has quit IRC
[18:44:36] *** daark has quit IRC
[18:45:14] *** cubeen has joined ##java
[18:45:25] *** sukumarasingha has joined ##java
[18:45:32] *** cubeen has left ##java
[18:46:04] *** webczat has left ##java
[18:46:19] *** namidark has quit IRC
[18:46:37] <bearded_oneder> spaek: the "offending" definition, "9. taboo term: a highly offensive term for a testicle ( taboo )"
[18:46:42] *** namidark has joined ##java
[18:47:02] *** irn has joined ##java
[18:49:30] *** scruz has joined ##java
[18:49:34] <scruz> hullo
[18:49:47] *** Mkaysi has joined ##java
[18:51:51] *** chandan_kumar has quit IRC
[18:52:22] *** Versuchen has quit IRC
[18:52:35] *** ulfdoz has joined ##java
[18:53:19] *** surial has joined ##java
[18:53:20] * bearded_oneder performs a short, verticle, "wazzup" head jerk.
[18:54:05] <ulfdoz> g'eve. I'm using eclipselink 2.0.2 and try to have a bidirectional OneToMany-Relationship to a MappedSuperclass. However, when I try to load the persistence unit, eclipselink complains, that the entity on the 1-side of the OTM-relation references a non-entity. Is there a way to map this somehow?
[18:54:51] *** bojo has quit IRC
[18:56:11] <ulfdoz> I could understand, if it cannot be mapped directly, as JPA does not know the subclass of the mapped superclass, when reading the one-side of the relation. But I cannot imagine, that I'm the first, who hits this problem.
[18:56:19] *** fahadsadah has quit IRC
[18:59:24] *** bojo has joined ##java
[19:00:48] *** MichealH has joined ##java
[19:02:33] *** deSilva has joined ##java
[19:03:00] <porkchopdiet> Java, in Terms of Grammar, is a _context-free_ grammar. right?
[19:05:03] *** nmx has quit IRC
[19:05:27] *** pipeep has quit IRC
[19:06:22] *** fahadsadah has joined ##java
[19:08:47] <cheeser> porkchopdiet: instead of asking every hour or so, a little googling might help: http://java.sun.com/docs/books/jls/first_edition/html/2.doc.html
[19:09:06] <cheeser> http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=java+grammar#sclient=psy&hl=en&source=hp&q=java+grammar+context&aq=f&aqi=g-b1g-o1&aql=f&oq=&pbx=1&bav=on.2,or.&fp=ef34c9a9ed856910
[19:09:12] *** rretzbach has joined ##java
[19:10:06] *** irn has quit IRC
[19:11:35] *** Fanook has quit IRC
[19:12:11] *** rretzbach has quit IRC
[19:13:19] <MichealH> Im trying to run this application but I get
[19:13:20] <MichealH> <MichealH> Error occurred during initialization of VM
[19:13:20] <MichealH> <MichealH> Could not reserve enough space for object heap
[19:13:20] <MichealH> <MichealH> Could not create the Java virtual machine.
[19:15:19] *** Sliker has quit IRC
[19:17:20] *** kaemo has quit IRC
[19:19:19] *** irn has joined ##java
[19:20:39] <porkchopdiet> cheeser: thanks a lot I didn't find that :)
[19:20:48] *** irn has quit IRC
[19:21:28] <scruz> ~premature optimization
[19:21:28] <javabot> scruz, premature optimization is the practice of attempting to fix performance problems before you have evidence that they exist. It is usually wiser to focus on selecting the most appropriate algorithms for your target problem, and then focus on keeping the code simple until you can run tests (and/or use a profiler) to identify performance issues.
[19:24:12] *** jfisk1987 has joined ##java
[19:24:13] <jfisk1987> hey
[19:24:59] <jfisk1987> i have to construct a binary tree given the inorder and preorder traversals and understand how to split up the root elements and its left and right children and im trying to figure out how to recursively build it
[19:25:18] <cheeser> look at avl tree or red/black trees.
[19:25:23] *** FrozenKnight has quit IRC
[19:25:31] <jfisk1987> i have a node that has a constructor for a root,left, and right trees but im unsure how to actually link all these nodes together
[19:25:33] <cheeser> any balanced tree algorithm would work.
[19:28:57] *** frojnd has joined ##java
[19:29:00] <frojnd> Hi there.
[19:29:24] *** Carnage\ has quit IRC
[19:29:32] *** Engin has joined ##java
[19:30:05] *** FrozenKnight has joined ##java
[19:30:19] *** caverdude has joined ##java
[19:30:44] <frojnd> I have a newbie q. I use eclipse for java prgramming. I've created Person.java class as Event.java class. They are both in Project/src/default package Now. I wanna to test those classes. So I've created main.java but I don't know how to import those two classes :) in c++ I'd just #include NameOfTheClass How do I do this in java? Thank you for your help in advance.
[19:31:30] <frojnd> I know it starts with import something :)
[19:31:37] <ulfdoz> frojnd: 1) You should not use the default package 2) you do not need to import anything from the default package.
[19:31:38] <ojacobson> frojnd: In Java, if they're in the same package and they're in the compile classpath, you're done
[19:31:41] *** VJTachyon has quit IRC
[19:31:46] <ojacobson> at runtime make sure they're also in the classpath
[19:32:16] *** Naith has joined ##java
[19:32:37] <frojnd> ojacobson: they are
[19:33:05] <frojnd> ulfdoz: so I must change default package into smonething's original like myPackage or smth..
[19:33:12] *** tilerendering has joined ##java
[19:33:43] <ulfdoz> frojnd: It is not a requirement, it is just considered bad style to polute the global namespace (to say it in c++ terms).
[19:33:46] <frojnd> and after I have created myPackage then I have to import from there...
[19:33:58] <ulfdoz> frojnd: yes
[19:34:02] <frojnd> ulfdoz: jeah great.
[19:35:06] <ojacobson> ulfdoz: The default package is not globally visible
[19:35:27] <ojacobson> It's not import-able, and putting entire programs in the default package encourages name collisions later in life
[19:35:54] *** racarter has joined ##java
[19:39:00] *** riotz has quit IRC
[19:40:04] <mrapple> ok i have this String[] values = args[0].split(":");
[19:40:13] <mrapple> if values[1] turns up nothing, how do i set it to 0
[19:40:27] <mrapple> i keep getting arrayoutofbounfs and nullpointer things -_-
[19:40:30] <cheeser> strings can't be 0
[19:40:37] *** Engin has quit IRC
[19:40:51] <mrapple> how would i split up that strings into integers
[19:40:56] <cheeser> values[1] will alweays be nonnull.
[19:41:03] <cheeser> if it exists at least.
[19:41:10] <cbeust> Split it into strings, then convert each of these strings in an integer
[19:41:52] *** srji has quit IRC
[19:41:53] *** porkchopdiet has quit IRC
[19:42:18] *** Alundra has joined ##java
[19:43:09] <Alundra> How do you make a program read the filepath of an image even if the filepath changes?
[19:43:19] <cheeser> um what?
[19:43:24] <mrapple> cbeust: i tried doing that, but if theres nothing after the : in the string, i get an arrayoutofbounfs when converting it to an int
[19:43:39] <cheeser> no, you don't.
[19:43:49] <mrapple> me?
[19:43:52] <cbeust> Make sure you don't iterate past the size of the array
[19:43:55] <cheeser> you get it trying to access beyond the end of the array. the int part has nothing to do with anything.
[19:44:05] <cheeser> arrays start at 0, fwiw
[19:44:21] <mrapple> i know...
[19:45:21] *** lmatteis has joined ##java
[19:45:32] <lmatteis> hi
[19:45:44] <lmatteis> i'm new at using JDO - i'm using googles implementation
[19:45:50] <lmatteis> how do i do references?
[19:45:55] <lmatteis> like, foreign keys relations?
[19:46:06] <Alundra> I specify the file path in my program as "/Users/Alundra/Images/my_image.jpg"; but if I run the .jar from another computer, it won't read the images because the file path changes
[19:46:07] <cheeser> google's implementation? as in, GAE?
[19:46:13] <mrapple> ok, how do i check if values[1] exists...
[19:46:13] <lmatteis> cheeser: yeah
[19:46:25] <mrapple> values[1] != null is a null pointer exception
[19:46:26] <cheeser> Alundra: put the image in your jar and load with getResourceAsStream()
[19:46:36] <cheeser> ~~ mrapple show us
[19:46:36] <javabot> mrapple, 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.
[19:46:46] <cheeser> are you getting an NPE or an array error. make up your mind.
[19:47:06] <cheeser> i'm not sure GAE is actually a conforming JDO impl.
[19:47:09] <Alundra> how can I put an image in my jar?
[19:47:11] <cheeser> i could be wrong on that.
[19:47:28] <cheeser> Alundra: it's just a file. add it like you would anything else.
[19:47:33] *** Pozejdon has joined ##java
[19:47:49] <mrapple> cheeser: http://pastebin.com/VW08GxJn
[19:47:51] <Alundra> cheeser: But the .jar isn't a folder? Or... okay, I jsut add it to the jar file anyway?
[19:48:01] <cheeser> a jar is no a folder, no.
[19:48:22] *** Mkaysi has left ##java
[19:48:24] <cheeser> mrapple: and the stacktrace?
[19:48:34] <Alundra> :/
[19:48:37] <mrapple> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
[19:48:45] <mrapple> on the != null
[19:49:04] <cheeser> right. your String has no : on which to split. so you get an array of 1 String.
[19:49:15] <cheeser> thus, values[1] does not exist.
[19:49:34] <lmatteis> cheeser: any ideas?
[19:49:48] <cheeser> check the size of the array not the nullness of the element. the element will never be null.
[19:49:56] <cheeser> lmatteis: i don't. i don't use JDO. sorry.
[19:50:09] <cbeust> cheeser: sure it can't be null? How about "::".split(":")?
[19:50:54] <Alundra> cheeser: How do I add an image to a jar if I can't really add it...?
[19:50:57] <cheeser> cbeust: ""
[19:51:06] <cheeser> Alundra: you can add whatever you want to a jar
[19:51:07] <Alundra> unless you mean something else by adding it?
[19:51:08] *** kab has joined ##java
[19:51:13] <Alundra> uhm, okay
[19:51:17] <cheeser> Alundra: it's your code. just add it.
[19:51:26] <Alundra> oh, I add it in code
[19:51:37] <cheeser> your build process can add it to the jar.
[19:51:48] <cheeser> if you use maven, put it in src/main/resources
[19:51:54] *** Tashtego has joined ##java
[19:52:46] <cheeser> cbeust: System.out.println(Arrays.asList("1::2::3".split(":")));
[19:52:55] <cheeser> [1, , 2, , 3]
[19:52:59] <cbeust> Ok wasn't sure
[19:53:02] * cheeser nods.
[19:53:08] <Alundra> maven?
[19:53:11] <cheeser> ~maven
[19:53:12] <javabot> cheeser, maven is a software project management and comprehension tool, found at http://maven.apache.org/ . It can construct, build, install, and document your project. Maven is typically used in Java as a declarative build system with dependency management and a wide array of plugin offerings.
[19:54:08] <Alundra> if I develop in NetBeans, do I use it then?
[19:55:30] <scruz> not unless you choose to, i think
[19:56:02] <Alundra> oh, okay.
[19:56:07] <scruz> what i'm sure you do use is any
[19:56:10] <scruz> *ant
[19:56:13] * cheeser nods.
[19:56:16] <mrapple> cheeser: values.length?
[19:56:20] <cheeser> yep
[19:56:25] <mrapple> bingo
[19:56:27] <cheeser> ~~ mrapple arrays
[19:56:27] <javabot> mrapple, arrays is http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
[19:57:02] *** Will123456 has joined ##java
[19:57:18] *** matsebc has quit IRC
[19:57:38] *** matsebc has joined ##java
[19:57:54] <mrapple> cheeser: oh one more thing, the input could also be a letter :D
[19:58:01] *** scruz has quit IRC
[19:58:08] <mrapple> so now its dying on Integer value1 = Integer.valueOf(values[0]);
[19:59:00] <cheeser> and *how* is dying?
[19:59:12] <cheeser> ~~ mrapple exceptions
[19:59:13] <javabot> mrapple, exceptions is http://java.sun.com/docs/books/tutorial/essential/exceptions/ (also see http://billharlan.com/pub/papers/Catching_Exceptions_in_Java.html )
[19:59:14] *** riotz has joined ##java
[19:59:37] <mrapple> i know about exceptions
[19:59:45] <mrapple> so just try and if it catches one, its a string?
[20:01:15] *** rretzbach has joined ##java
[20:01:26] <cheeser> s/string/text/
[20:04:58] <Alundra> cheeser: What you suggested doesn't exist.
[20:05:41] <cheeser> what would that be?
[20:05:55] <TheTrash> I'm sorry cheeser, but exceptions don't exist.
[20:06:03] <cheeser> clearly
[20:06:10] *** gyscos has joined ##java
[20:08:15] <Alundra> NonExistentExceptionException
[20:09:18] <Alundra> uhg
[20:10:06] *** srji has joined ##java
[20:10:21] <jfisk1987> im trying to recursively build a tree but im having trouble figuring out a good way to link the nodes together
[20:10:26] <jfisk1987> would i use a linked list to hold them all?
[20:10:36] <cheeser> not if you want them to be a tree
[20:10:38] *** Auv5 has joined ##java
[20:11:04] *** epure_ has quit IRC
[20:11:18] *** kab has quit IRC
[20:11:21] <jfisk1987> how should i go about this? Im building a tree from its inorder and preorder traversals and got it so it will create a node with a parent, and left and right pointer
[20:11:28] *** epure_ has joined ##java
[20:12:19] <dreamreal> why not build a tree specifically?
[20:12:29] <dreamreal> There's nothing that says "you can't create data structures in java"
[20:13:06] *** kab has joined ##java
[20:13:07] *** CodeWar has joined ##java
[20:13:21] <jfisk1987> well im a student and kinda new to trees to be honest
[20:13:38] <dreamreal> thankfully they're horribly simple
[20:13:53] <cheeser> trees++
[20:14:02] <dreamreal> Node<T extends Comparable<T>> { Node prev; Node post; }
[20:14:16] <jfisk1987> heres what i was thinking, see if you guys agree
[20:14:32] *** tilerendering has quit IRC
[20:14:46] <jfisk1987> i have a buildTree class, that will build the new nodes
[20:14:58] <dreamreal> I agree that that's what you're thinking
[20:15:26] <jfisk1987> that way it can keep track of how many nodes are in the tree
[20:15:35] <jfisk1987> my issue is how exactly would i store all these guys.
[20:15:36] <cheeser> why would you care?
[20:15:47] <Cher> jfisk1987: Is there a requirement to keep track of the number of nodes in the tree?
[20:15:55] <jfisk1987> cher: no their isnt
[20:16:00] <dreamreal> Why not build a YourTree<T>, with add(T nodeValue)
[20:16:11] <Cher> jfisk1987: Then why do you want to keep track of the number of nodes in the tree? As cheeser said, why would you care?
[20:16:23] <jfisk1987> thats true
[20:16:35] <dreamreal> this is homework anyway
[20:16:42] <flippo> ya think?
[20:16:43] * racarter likes git
[20:16:46] <jfisk1987> ha yup
[20:17:21] <jfisk1987> ill go for trying to build my own generic tree then.
[20:18:20] <Alundra> cheeser: Okay, can you be more detailed in this whole getResourceAsStream() thing?
[20:18:30] <cheeser> ~getResourceAsStream
[20:18:30] <javabot> cheeser, getresourceasstream is a mechanism to read files from the same place your class files are stored - i.e. even from jars. You should use it for data files that go with your app, such as images for a GUI app or tabular data. Examples of use here: http://mindprod.com/jgloss/getresourceasstream.html - but note that you should always use the second form of the 3 examples listed at the top.
[20:19:01] *** aitd has joined ##java
[20:19:09] <CodeWar> jfisk1987, its good to think on your own try getting the Node part right think how you can reuse the same Node across 2-4 trees/ multiway trees/ radix trees and the simple one ie BST. ask yourself if you could reuse the same Node object for associative data structs
[20:19:30] <racarter> why only the second form?
[20:19:56] <racarter> @javabot
[20:20:07] <Cher> racarter: Because unless you explicitely know what you're doing and therefore want to use the current instance's ClassLoader it's the ClassLoader of your class that you want to use, not the ClassLoader of the instance.
[20:21:19] <racarter> I know nothing of ClassLoader. Why would those two ever be different?
[20:21:26] <racarter> and isn't the third and second form equivalent?
[20:21:38] <ojacobson> s*rial has strong opinions about it and he wrote the factoid
[20:21:48] <ojacobson> his take is that the return value rules for ClassLoader.getResource are broken as designed for app use
[20:21:58] <ojacobson> whereas Class.getResource is not
[20:22:07] <ojacobson> don't ask me, but do read the docs before using either
[20:22:16] <racarter> hmm. ok.
[20:22:24] *** Versuchen has joined ##java
[20:22:52] *** daark has joined ##java
[20:22:55] *** modernbob has quit IRC
[20:22:58] *** Alundra has left ##java
[20:25:39] <Cher> racarter: The ClassLoader of your class and the instance can easily be different if the instance is of a subclass of your class and that subclass was loaded through a different ClassLoader.
[20:26:10] *** terranova has quit IRC
[20:26:44] <Cher> racarter: For simple single jar programs, this might not matter. However, it might matter sooner as desired, thus using the ClassLoader of the class and not the instance is a good default.
[20:27:50] *** racarter has quit IRC
[20:29:15] *** Rainier has joined ##java
[20:29:25] <ojacobson> Cher: plausible, but wrong
[20:29:32] <ojacobson> or at least incomplete
[20:29:46] *** Kamaran has joined ##java
[20:29:49] <ojacobson> Describe for me a situation where a single instance of Foo would have a different classloader from Foo.class. :)
[20:30:13] <ojacobson> Disregard that, I skimmed too quickly and missed you covering this
[20:30:18] <ojacobson> ~cher++
[20:30:18] <javabot> cher has a karma level of 1, ojacobson
[20:31:06] *** modernbob has joined ##java
[20:35:11] *** modernbob has quit IRC
[20:39:38] *** shaunren has quit IRC
[20:41:21] *** [twisti] has joined ##java
[20:42:55] *** daark has quit IRC
[20:43:24] *** modernbob has joined ##java
[20:46:20] *** kab has quit IRC
[20:48:34] <lmatteis> has anyone used jetty hot deploy options with maven?
[20:48:34] *** Nikelandjelo has quit IRC
[20:48:38] *** epalm has joined ##java
[20:48:43] <lmatteis> it doesn't seem to hot deploy when i change my java files :(
[20:48:57] *** CodeWar has left ##java
[20:49:00] <lmatteis> because my java files are not in 'webapp'
[20:49:00] <lf94_> Hey guys, how do I compile programs with java.awt classes
[20:49:01] *** sukumarasingha has quit IRC
[20:49:05] <lmatteis> any ideas how i can configure this?
[20:50:13] *** kab has joined ##java
[20:50:33] <[twisti]> lf94_: with your normal java compiler
[20:50:51] <lf94_> So just javac myprogram.java ?
[20:51:01] <[twisti]> if its just one class, sure
[20:51:11] <lf94_> no it's a bunch
[20:51:37] <dreamreal> use a build tool
[20:51:44] <lf94_> Such as
[20:51:47] <[twisti]> then you have to make sure the other classes are in their proper places and stuff or do what dreamreal said
[20:51:49] <dreamreal> ant, maven
[20:51:50] <[twisti]> ant
[20:52:00] <dreamreal> since AWT is part of java, you don't have to do anything beyond build
[20:52:01] <lf94_> hm..ok
[20:52:01] <[twisti]> if you have to ask, use ant, its simple
[20:52:12] <[twisti]> or use an ide like idea
[20:52:23] <dreamreal> but don't use an IDE for a build tool
[20:52:30] <lf94_> downloading ant...
[20:52:38] <dreamreal> and ant's simplicity affects its usefulness. Maven is *much* better.
[20:52:54] <dreamreal> I wish people would stop suggesting ant; it *works* but so does a hammer for driving a screw.
[20:52:55] <[twisti]> dreamreal: it sounds like hes still in the learning stage so probably best to avoid new stuff overkill
[20:53:09] <lf94_> ok so maven, heh
[20:53:27] <dreamreal> [twisti]: and making him go through the ant manual project configuration is NOT overkill?
[20:53:32] <lf94_> [twisti] the entire java language is just weird imo, so used to C and including libs and what not
[20:53:37] <dreamreal> What could be simpler than "put your source tree in src/main/java"
[20:53:41] <[twisti]> lf94_: depends on whether you want to spend 5 minutes or 5 hours to figure out how to set it up
[20:54:13] <dreamreal> yeah, maven is the five minutes one
[20:54:14] <[twisti]> dreamreal: ant is like 5 lines which he can copy from any tutorial and change the class name
[20:54:14] <lf94_> Ok, let me pastebin my code and show you what I need to compile lol
[20:54:27] <dreamreal> [twisti]: no need to copy/paste with maven
[20:54:39] <dreamreal> just build the project with mvn archetype:generate, then "mvn package"
[20:54:49] <dreamreal> anyway, I'm off
[20:55:04] <tjsnell> we know
[20:56:03] <[twisti]> dreamreal: maybe im biased because i tried the maven eclipse integration which according to everyone i talked to is pretty terribad
[20:56:13] <lf94_> pastebin.com/3aeXpr3R
[20:56:31] <lf94_> I use command line btw to compile
[20:57:07] <lf94_> Yes my coding is terrible :s
[20:57:13] <[twisti]> lf94_: thats not a thing
[20:57:21] <lf94_> Am I importing correctly?
[20:57:33] <[twisti]> youre not doing anything correctly
[20:57:38] <lf94_> ...
[20:57:48] <[twisti]> that will never compile
[20:57:56] <lf94_> It almost does
[20:58:01] <[twisti]> you use variables that dont exist
[20:58:05] <lf94_> Where?
[20:58:13] *** zhulikas has joined ##java
[20:58:15] <sig^> you're using pastebin ):
[20:58:17] <[twisti]> line 53 for example
[20:58:26] <sig^> I almost opened your paste
[20:58:28] <lf94_> WHOOPS
[20:58:32] <lf94_> ok ignore that
[20:58:48] <zhulikas> is anyone programming embedded systems with Java? I am looking for a starting point
[20:59:25] *** topriddy has quit IRC
[20:59:30] *** JohnnyDavidson has joined ##java
[20:59:38] <lf94_> [twisti] the only errors I get now are "cannot find symbol"
[20:59:48] <lf94_> For Graphics2D, IndexColorModel etc
[20:59:56] <lf94_> So Im clearly not importing correctly
[21:00:20] <lf94_> Or it just can't find awt or something
[21:00:22] <[twisti]> ~tutorial
[21:00:22] <javabot> Please see http://download.oracle.com/javase/tutorial/
[21:00:26] <lf94_> .
[21:00:32] <Bombstone> lf94_, yes, you need to add an import for every class you require.
[21:00:33] <[twisti]> finding awt isnt the problem
[21:00:42] *** tilerendering has joined ##java
[21:00:51] <lf94_> Bombstone, is it ok to use .*
[21:00:59] <lf94_> ex: java.awt.Graphics.*
[21:01:04] <Bombstone> it's ok but a bad practice.
[21:01:27] <lf94_> nope didnt fix anything
[21:01:28] <lf94_> hrm
[21:02:07] <Bombstone> you import all the classes in that package when you're actually going to use only a few classes.
[21:02:20] <lf94_> oh siiick only 2 errors left
[21:02:28] <lf94_> Yeah I know
[21:02:32] <lf94_> I just want to this to compile for now
[21:02:44] <lf94_> dont care about efficiency at the moment B]
[21:03:01] <lmatteis> guys, i've configured jetty plugin for maven. but it doesn't seem to scan for changes on my .java files :(
[21:04:20] *** Sniffy has joined ##java
[21:04:48] <lf94_> One error woot, now what the hell did I do here...
[21:05:09] <lf94_> How do I associate the IndexColorModel with my BufferedImage
[21:05:11] *** riotz has quit IRC
[21:05:16] <[twisti]> im honestly glad your code is commented
[21:05:28] *** ktorn has quit IRC
[21:05:36] <[twisti]> because if it didnt say that its for something i will never, ever care about or use, id be really disturbed
[21:05:51] *** Nikelandjelo has joined ##java
[21:05:55] *** ktorn has joined ##java
[21:06:15] <lf94_> do I smell sarcasm
[21:06:18] <lf94_> B]
[21:06:58] <[twisti]> no
[21:07:05] <Sniffy> Hello gentlemen. I'm a moron, please be gentle. I'm trying to use images and some .ttf fonts within my program. Everything works fine when I run through the IDE but when I clean-build and execute the JAR, the directory structure changes (stuff within "src" becomes the root directory) so it can't find the resources. If I place the resources directory within the same directory as the JAR it all works but obviously that sucks. What exactly do I need to do in
[21:07:06] <Sniffy> the simplest terms? I have looked into it but can't get it working, lots of stuff about applets that isn't related to my problem
[21:07:44] <[twisti]> everything you say screams "this is going to end up some terribly, hacked, buggy mess in someones production software"
[21:07:45] <Rainier> Sniffy, you can't read files from a JAR the same way you can from the file system.
[21:07:57] <[twisti]> and im just glad its not something i might have to use some day
[21:08:05] <Sniffy> oh
[21:08:11] <Rainier> Sniffy, one way to solve this is to always load images you intend to be packed into a JAR with getResourceAsStream.
[21:08:22] <Rainier> That method is available on all Class instnaces.
[21:08:48] <Sniffy> Nice, OK I'll look into that
[21:08:49] <Rainier> So getClass().getResourceAsStream(...) for a instance, or SomeClass.class.getResourceAsStream for a static context.
[21:09:25] <Sniffy> should i package up my resources into some JAR and access it like or..?
[21:09:28] <Rainier> Sniffy, the method is relative to the package path of the class you use, so if you look for "file.png" it'll look inside the package containing that class. If you prefix the path with "/" it'll start looking at the program/JAR root.
[21:09:40] <Rainier> Sniffy, well yes with this method you can include them inside the JAR.
[21:10:07] <Sniffy> Interesting..OK that's really helpful man, thanks
[21:10:13] <Rainier> Do note that you don't need to include the "src" or "bin" directory as when run from an IDE, that is the root for the program path using / and for a JAR it's the root of the JAR file.
[21:10:39] *** Carnage\ has joined ##java
[21:11:52] *** Carnage\ has quit IRC
[21:12:22] *** lf94_ is now known as lf94
[21:13:22] *** Carnage\ has joined ##java
[21:19:02] *** RobotCow has joined ##java
[21:19:53] <Edulix> hi, is there any kind of unmanaged exception type I can use so that my function can throw it without specifying it?
[21:21:54] *** c_axis has quit IRC
[21:23:54] *** Pawnee has quit IRC
[21:27:16] *** Indigenous has quit IRC
[21:32:46] *** Sliker has joined ##java
[21:33:24] *** epure_ has quit IRC
[21:34:04] <_W_> ~~ Edulix exceptions
[21:34:05] <javabot> Edulix, exceptions is http://java.sun.com/docs/books/tutorial/essential/exceptions/ (also see http://billharlan.com/pub/papers/Catching_Exceptions_in_Java.html )
[21:34:51] <_W_> Rainier, that is _still_ wrong, in the face of subclasses
[21:35:09] <_W_> oh nevermind
[21:35:16] <_W_> I totally read that wrong
[21:36:02] *** tokam has left ##java
[21:36:20] <Edulix> thanks
[21:37:13] *** daark has joined ##java
[21:39:17] <_W_> Edulix, an alternative philosophy to what's in that first link is to only throw unchecked exceptions in the face of programmer error (e.g. arguments not fitting the contract, calling methods in the wrong order)
[21:40:08] *** Sambler has joined ##java
[21:40:25] *** Sambler has quit IRC
[21:41:19] <Will123456> hey guys. i'm looking to fit a scripting language into my java program, to aid people (the developers and the end users) in modifying it's behaviour. is it better to go with a well known language like python or lua or go with something more java-y like groovy?
[21:42:11] <Sniffy> Rainier, how do I deal with the changing directory structure when I need to declare File objects? I use the list().length for random number generation
[21:42:32] <Sniffy> I appreciate I'm being pretty thick here but I didn't foresee this being much of an issue
[21:43:05] <Rainier> list().length isn't very random I'm afraid.
[21:43:22] <Sniffy> i plug that into rand.nextInt()..
[21:44:33] <Rainier> File objects really just store their location and stuff you ask of it is queried of the FS, so you can't get a stale File object unless the FS is out of date.
[21:44:38] *** yoshx has joined ##java
[21:45:20] <cheeser> Will123456: depends on your users
[21:46:21] <Will123456> cheeser: they'll be ordinary people, not java specialists. if groovy can't really offer anything python can't (at least for my specific program) then i might as well go with python, i think!
[21:46:47] <cheeser> whatever works for you
[21:48:27] <lf94> Ok guys, my program compiles and runs, but nothing happens. I even set it to print text and nothing prints! What could I be doing wrong?: pastebin.com/Hdz91KX2
[21:49:00] *** Sambler has joined ##java
[21:49:19] <cheeser> how are you running it?
[21:49:21] *** Tashtego has quit IRC
[21:49:27] <cheeser> because that class isn't executable.
[21:49:36] <lf94> java gbDrawing
[21:49:39] <lf94> ^ like that
[21:49:45] <cheeser> hell, it doesn't even do anything.
[21:49:50] <lf94> no errors or anything shows up
[21:49:59] <cheeser> oh, tehre's a main()
[21:49:59] <lf94> cheeser, should print text
[21:49:59] <Sniffy> lf94, what IDE are you using?
[21:50:03] <lf94> notepad
[21:50:10] <lf94> + command line
[21:50:11] <Sniffy> get BlueJ
[21:50:17] <Sniffy> you're not ready for that
[21:50:18] <lf94> . no thanks
[21:50:27] <lf94> I am ready
[21:50:31] <Sniffy> clearly not
[21:50:42] <lf94> the jvm hates me
[21:50:54] *** LouisJB has joined ##java
[21:50:56] <Sniffy> the jvm hates your poor understanding
[21:51:08] <cheeser> lf94: pastebin the results of your compile and execution
[21:51:20] <lf94> cheeser, there is no output for either.
[21:51:33] <lf94> Which I assume everything is A.Ok
[21:51:36] <cheeser> pastebin the actual commands and results
[21:51:53] <lf94> javac gbDrawing.java; java gbDrawing
[21:51:57] <lf94> no output for either
[21:52:08] <lf94> I also used javaw
[21:52:13] <lf94> nothing happened still
[21:52:19] <lf94> there is zero output for all 3
[21:53:08] <cheeser> works just fine here
[21:53:18] <lf94> text prints out?
[21:53:20] <lf94> <_>
[21:53:22] <Cher> It prints "TESTDSFSDFDS" for me.
[21:53:29] <lf94> Told you, the jvm hates me
[21:53:34] <lf94> Maybe Ill clear my classes
[21:53:40] <lf94> recompile, see what happens..
[21:53:42] *** topriddy has joined ##java
[21:53:47] *** Sambler has quit IRC
[21:54:23] <lf94> Nope
[21:54:25] <lf94> What the hell.
[21:54:49] <Cher> In what execution environment (i.e. vt220 + bash, cmd.exe etc.) are you running it?
[21:54:53] <lf94> cmd.exe
[21:55:02] <lf94> It's on a netbook running win 7
[21:55:12] <lf94> Ill try running it in a bash shell
[21:55:23] <Cher> So you have a cmd.exe window open, in in that window you type "java gbDrawing"?
[21:55:28] <lf94> Yep
[21:55:34] <Cher> What does "java -version" do?
[21:55:43] <lf94> prints version data
[21:55:51] <lf94> java version "1.6 blah blah"
[21:56:04] <lf94> Java SE Runetime Environ (build 1.6 blah vlah)
[21:56:17] <lf94> Java HotSpot Client VM (build 19.1-b02)
[21:56:20] *** MadOtis has joined ##java
[21:56:20] <cheeser> ~~ lf94 paraphrase
[21:56:21] <javabot> lf94, Don't paraphrase code or errors. If you knew what was important to show us, you wouldn't need us to answer your question. You should pastebin the *actual* code and the *actual* error. Anything else is most likely going to be useless.
[21:57:35] <lf94> pastebin.com/X18HxWiW
[21:57:36] *** cheeser sets mode: -b *!~pen@g1pc2n126.g1.ntu.edu.tw
[21:57:55] <Cher> I find it strange that for you the program doesn't even print the test String. Have you tried a simple hello world example and see if it prints the text that you expect?
[21:58:16] <cheeser> again. pastbin actual output from compiling and running. aslo include the contents of that dir.
[21:58:26] <MadOtis> Hello all... I'm trying to debug a JTable issue. I've added a TableRowSorter to my JTable (which worked and rendered as expected beforehand), but once I add the sorter to the table, it stops rendering table model data. If I remove the sorter, the table renders again. Any suggestions where I need to start debugging?
[21:58:31] <lf94> cheeser I HAVE
[21:58:43] <lf94> But here we go again
[22:00:13] *** JaVaSan has joined ##java
[22:00:49] <lf94> pastebin.com/BYSBQnKe
[22:01:17] <lf94> There's gotta be a way to direct cmd.exe output to a terminal window <_>
[22:01:48] <JaVaSan> Anybody knows if is there any easy way to check if we are using a not scaped html inside javadoc? Any tool or something?
[22:02:21] <Cher> JaVaSan: Have you tried Checkstyle?
[22:02:57] <lf94> jvm hates meeee
[22:03:04] <Cher> That in fact is odd.
[22:03:06] <JaVaSan> Cher: I'm using it. Is there any rule to check that?
[22:03:33] <MadOtis> JaVaSan: You can also try PMD and write your own rules.
[22:03:47] *** Sliker has quit IRC
[22:03:49] <bearded_oneder> lf94: your JVM has AI with simulated emotions? where can i get a copy? is it open soure?
[22:04:09] <Cher> JaVaSan: For me, Checkstyle has at least reported unclosed HTML tags like unclosed <code> or unclosed <em> (I guess this is what you looking for.)
[22:04:13] <lf94> bearded_oneder it found me man just my luck right
[22:05:13] <Cher> lf94: What's LASSPATH%? What's %ERRORLEVEL% after each execution? Have you tried a simple program that prints one line on stdout and one line on stderr?
[22:05:14] <bearded_oneder> i suspect that luck and the soul in the machine have little to do with it.
[22:05:33] *** flippo has quit IRC
[22:05:40] *** Johannes13 has quit IRC
[22:05:47] <lf94> bearded_oneder, so do I. :)
[22:05:50] <Cher> Uh something ate the percent+C... maybe my irc client...
[22:06:19] <lf94> error level is zero
[22:06:20] <lf94> and
[22:06:29] *** frangiz has quit IRC
[22:07:44] <lf94> Cher, classpath is not defined
[22:07:46] <gener1c> i made an abstract AVLTree class and i want to make a data stracture that has several similar yet not the same trees that are based on that class
[22:07:48] <JaVaSan> Cher: Actualy, I'm looking for some tool that tells me, for example, I'm using a double quote inside javadoc. Instead of the double quote (") I should use (&quot;).
[22:08:12] <gener1c> the difference between 2 of them is that one has more instance variables that it uses
[22:08:16] <gener1c> about 4
[22:08:32] <gener1c> would inheritance be redundant for that matter?
[22:08:39] <Cher> lf94: It's good that classpath is not defined. I hate IBM for arbitrarily setting CLASSPATH with any tool that they install, and even worse, then forgetting "." in it.
[22:09:00] *** magn3ts has quit IRC
[22:09:05] <lf94> Ok so, now what? <_>
[22:09:14] *** Wulfspider has joined ##java
[22:09:16] <gener1c> nevermind
[22:09:23] <lf94> I think I should try this on my linux box...
[22:09:46] <Cher> lf94: What happens if you print something to stderr? Have you tried a simple print one line on stdout, print one line on stderr program? It is really strange that at least the text message doesn't appear.
[22:10:24] <lf94> nope I havent tried that
[22:10:32] <lf94> I will run a simple hello world program then
[22:10:42] *** Swaagie has joined ##java
[22:10:42] <Cher> lf94: Last thing you could try is adding System.out.flush() - maybe printf() with "\n" only, not "\r\n", does not flush on Windows. One should rather use %n instead of \n for portable format strings anyway, when the EOL shall be that of the underlying platform.
[22:10:52] *** oso96_2000 is now known as oso[OuT]
[22:11:13] *** oso[OuT] is now known as oso96_2000
[22:11:38] <cheeser> um. i've never had to do that on windows.
[22:11:46] *** racarter has joined ##java
[22:12:07] <Cher> Yeah my guess can be wrong. I don't use windows unless I'm forced to (i.e. with enough money).
[22:12:12] *** gucko has quit IRC
[22:12:20] *** frangiz has joined ##java
[22:12:48] <lf94> 'Could not find the main class: helloworld. Program will exit."
[22:13:08] <Cher> lf94: What's the name of the class in the .java file?
[22:13:16] <lf94> Ah right
[22:13:37] <lf94> that worked
[22:13:37] <racarter> Collections.sort(stringList) should alphabetize an list of strings, right?
[22:13:41] <lf94> printed 'test'
[22:13:50] <Cher> lf94: Have you tried stderr as well?
[22:14:07] <lf94> fprintf(stderr,"hello"); right?
[22:14:15] <lf94> (inlcude the system.out.)
[22:14:33] <ojacobson> ~make shit up
[22:14:33] <javabot> make: *** No rule to make target `shit up'. Stop.
[22:14:42] <cheeser> 8^)=
[22:14:47] *** cool123 has joined ##java
[22:15:02] <Cher> lf94: This is Java. No fprintf, no procedural programming, no include. System.err.println("this is stderr.");
[22:15:19] <lf94> ugh damn me
[22:15:27] <lf94> Ok, thanks
[22:15:32] <[twisti]> lf94: once more i suggest ~tutorial
[22:15:33] * cheeser damns lf94. damns him to heck!
[22:15:35] <bearded_oneder> lf94: is the class BMP2GBRI in the source file as gbDrawing.java ? as you show on lines 14 - 20 of your paste post?
[22:15:37] *** Joeytje50 has joined ##java
[22:15:42] <MadOtis> Here's a pastebin of my JFrame class: http://pastebin.com/2GYWiUrZ... If i comment out the setRowSorter on line 146, my JTable displays data, if I uncomment is, my JTable is empty... any suggestions where I need to start debugging? My model DOES contain data at that point; I've been able to determine that in debug.
[22:16:07] <bearded_oneder> the same* source
[22:16:37] <lf94> Cher, stderr works too
[22:16:48] <lf94> beadered_oneder yes it is in the same class but I dont use it once
[22:16:54] *** Joeytje50 has left ##java
[22:17:00] <lf94> same source file*
[22:17:19] <Cher> lf94: Then I'd now start with "printf debugging". I'd insert print statements at significant points to see which parts of your program are executed and which are not.
[22:17:41] <Cher> I don't suggest printf debugging as a generally good debugging technique. Just in this situation, it seems pragmatic to do so.
[22:17:57] *** oso96_2000 has quit IRC
[22:18:02] <lf94> Yea I do it in C.
[22:19:37] <lf94> Wow.
[22:19:39] <lf94> Nothing.
[22:19:49] <lf94> O_.
[22:20:04] *** matsebc has joined ##java
[22:20:22] *** sphenxes01 has quit IRC
[22:20:52] <lf94> pastebin.com/aexyPQ18
[22:21:11] <lf94> This makes absolutely zero sense to me, why does NOTHING print?...
[22:23:29] *** halhorn has joined ##java
[22:23:58] <lf94> Wow, works on this computer.
[22:24:19] *** cool123 has quit IRC
[22:24:29] <lf94> This is extremely messed up.
[22:24:32] <Cher> lf94: All I can guess is that there is something strange about the JVM/OS combination.
[22:24:42] *** cool123 has joined ##java
[22:24:46] <lf94> Yeah probably
[22:24:53] <lf94> Works fine on this computer
[22:25:04] *** gelignite has quit IRC
[22:25:16] <lf94> Pretty frustrating though :\
[22:25:36] *** cyphorious has joined ##java
[22:26:49] <Cher> lf94: Summary? It runs on your Linux box but it doesn't run on your Windows box?
[22:26:56] <lf94> Yep?
[22:27:28] <bearded_oneder> lf94: are you getting the error, "Exception in thread "main" java.lang.NoSuchMethodError: main" ?
[22:27:38] <lf94> Prints on Arch Linux, Doesnt print on Windows 7 Starter Edition
[22:27:54] *** msieradzki has joined ##java
[22:28:01] <cheeser> try running with: java -cp . gbDrawing
[22:28:04] <lf94> Just another reason for me to throw Ubuntu on that thing
[22:28:14] *** foocraft has joined ##java
[22:28:41] <lf94> cheeser, still no go.
[22:28:48] <lf94> Did you see that on a forum post? :p
[22:29:05] *** srji has quit IRC
[22:29:13] <Cher> Yeah the chances that -cp . helps were low, we already made sure that the CLASSPATH environment variable is not defined.
[22:29:40] <cheeser> missed that part. i must admit, i tuned out most of this. 8^)=
[22:30:02] <lf94> Do I file a bug report or something
[22:30:30] <Cher> lf94: I find this interesting enough to file a bug report. I would remove as much of the program as possible while it still doesn't run.
[22:31:07] <bearded_oneder> lf94: i just ran it on XP SP2 and line 43 prints, "TESTDSFSDFDS" as expected.
[22:31:16] *** cbeust has quit IRC
[22:31:21] <lf94> oh wiat
[22:31:23] <lf94> wait
[22:31:24] <lf94> hm
[22:31:49] *** cbeust has joined ##java
[22:32:08] *** c_axis has joined ##java
[22:32:17] <Cher> lf94: But really, you should use %n instead of \n.
[22:32:21] *** bitshuffler_ has quit IRC
[22:32:27] *** cbeust has quit IRC
[22:32:28] <lf94> Cher, ok
[22:32:36] <lf94> Also I think I found the problem
[22:32:44] <Cher> lf94: Independently of your problem. Either use System.out.println("text") or use System.out.printf("text%n");
[22:32:51] <Cher> What was the problem?
[22:32:52] *** em has quit IRC
[22:32:53] *** rretzbach has quit IRC
[22:33:04] <lf94> File names and class names are mixed up
[22:33:29] <lf94> I renamed something and it got cloned
[22:33:36] <lf94> and I was compiling the clone
[22:33:42] <lf94> which wasnt being updated with the printfs
[22:34:01] <lf94> how does this even happen
[22:34:10] <cheeser> this is why you should develop in a directory away from everything else.
[22:34:15] <cheeser> user error
[22:34:26] *** zhulikas has quit IRC
[22:34:29] <Cher> Ouch. A typical case of pebkac and what you get when not working with a pristine environment ;-)
[22:34:46] *** em has joined ##java
[22:34:55] <ojacobson> also, clean builds
[22:35:05] <ojacobson> SCM means not keeping copies of old code around
[22:35:11] <ojacobson> clean builds mean not keeping copies of old binaries around
[22:35:26] *** cbeust has joined ##java
[22:35:50] <lf94> Yeah I need to work in a clean environment and make sure all classes are in different files
[22:36:04] <lf94> and makes sure the filenames are the same as the class names
[22:36:16] <lf94> Why does Java has this naming scheme?
[22:36:20] *** terranova has joined ##java
[22:36:22] <Cher> lf94: Why not?
[22:36:29] *** terranova has quit IRC
[22:36:32] *** ctburley has joined ##java
[22:36:34] <lf94> It gets confusing fast? XP
[22:36:50] <Cher> lf94: Quite the opposite imo :-)
[22:37:01] *** terranova has joined ##java
[22:37:04] <lf94> Eh Im just not used to OOP crap yet. :p
[22:37:18] <Cher> Well, it's not crap ;-)
[22:37:58] <Cher> Also, compiling the wrong source code could've easily happened with C as well. That's not a matter of the programming language in use.
[22:38:31] <lf94> it happened because of the class/filename confusion XP wouldnt have happened in C ;)
[22:38:31] *** qiip has joined ##java
[22:38:39] <lf94> anyways!
[22:38:52] <lf94> Back to this...gotta figure out how to draw in a BufferedImage
[22:39:38] <Cher> I say it happened because you edited a different file than the one that you compiled. That issue is not related to the class/filename matching because you didn't define any public toplevel class in your source file.
[22:40:16] *** qiip has quit IRC
[22:41:36] <Cher> lf94: Anyway, I think you will have more fun in the long term with your Java source code if you follow the Java code conventions, especially the naming conventions.
[22:41:52] <lf94> Mhm I think so too :p
[22:42:12] <bearded_oneder> lf94: once you master it, it's organizational power becomes more evident. IMO, it seems that it's difficult to grasp, because our brains naturally process the states, properties, and behaviors of objects in the real world associatively. once you've trained your brain to view them hierarchically, it gets better.
[22:42:23] *** homie has quit IRC
[22:42:40] <Cher> bearded_oneder: May I quote this?
[22:42:44] <lf94> bearded_oneder, sounds good, I'll work on it. :)
[22:43:56] <MadOtis> Here's a pastebin of my JFrame class: http://pastebin.com/2GYWiUrZ... If i comment out the setRowSorter on line 146, my JTable displays data, if I uncomment is, my JTable is empty... any suggestions where I need to start debugging? My model DOES contain data at that point; I've been able to determine that in debug.
[22:45:30] *** rvsjoen has joined ##java
[22:45:44] *** BoF has joined ##java
[22:46:05] *** cschneid has joined ##java
[22:46:11] *** nmx has joined ##java
[22:46:51] <rvsjoen> anyone able to help me understand why this small application does not resize to the size of the panel when I call frame.pack() ? http://pastebin.com/pTjUWpe5
[22:47:14] *** zChris has joined ##java
[22:47:20] *** eidolon has joined ##java
[22:48:29] *** nmx has quit IRC
[22:48:52] *** r0bby has joined ##java
[22:50:40] *** HD|Laptop has joined ##java
[22:51:08] *** zemanel has joined ##java
[22:52:53] <Rainier> rvsjoen, because setSize doesn't do what you want. That's "actual size". pack() takes the preferredSize and makes it the "actual size"
[22:53:14] *** Candle_ has joined ##java
[22:53:20] *** m0_ has joined ##java
[22:53:46] <rvsjoen> ah, that explains alot
[22:53:46] *** nmx has joined ##java
[22:53:47] *** Garibald1 has joined ##java
[22:53:51] *** oogaw has joined ##java
[22:53:57] <bearded_oneder> Cher: it's just an anecdotal opinion. don't know that it has any value, but sure, you can quote me.
[22:53:59] <rvsjoen> setPreferredSize(new Dimension(image.getWidth(), image.getHeight())); <- that worked better! thank you
[22:54:05] *** robbyoconnor has quit IRC
[22:54:05] *** HardDisk_WP has quit IRC
[22:54:06] *** klaas has quit IRC
[22:54:06] *** Nikelandjelo has quit IRC
[22:54:06] *** halhorn has quit IRC
[22:54:06] *** armyriad has quit IRC
[22:54:06] *** Candle has quit IRC
[22:54:06] *** jaska^ has quit IRC
[22:54:06] *** Kester has quit IRC
[22:54:06] *** stylus has quit IRC
[22:54:07] *** Dux has quit IRC
[22:54:07] *** iulian has quit IRC
[22:54:07] *** Garibaldi has quit IRC
[22:54:07] *** BSWolf has quit IRC
[22:54:07] *** RLN has quit IRC
[22:54:07] *** Paradox924X has quit IRC
[22:54:08] *** zatan has quit IRC
[22:54:08] *** wchun has quit IRC
[22:54:11] *** joev has quit IRC
[22:54:11] *** Wagoo has quit IRC
[22:54:11] *** m0 has quit IRC
[22:54:11] *** sproingie has quit IRC
[22:54:11] *** modernbob has quit IRC
[22:54:11] *** iq has quit IRC
[22:54:11] *** joed has quit IRC
[22:54:16] *** Kester` has joined ##java
[22:54:18] *** modernbob has joined ##java
[22:54:20] *** Kester` is now known as Kester
[22:54:27] *** stylus has joined ##java
[22:54:33] *** matsebc has quit IRC
[22:54:38] *** Nikelandjelo has joined ##java
[22:54:40] *** HD|Laptop is now known as HardDisk_WP
[22:54:40] *** gelignite has joined ##java
[22:55:03] *** matsebc has joined ##java
[22:55:15] *** zatan has joined ##java
[22:55:25] *** caverdude has quit IRC
[22:56:14] *** armyriad has joined ##java
[22:56:26] *** halhorn has joined ##java
[22:57:05] *** BSWolf has joined ##java
[22:57:19] *** AgentCarmichael has joined ##java
[22:57:43] *** brau has joined ##java
[22:58:04] *** JaVaSan has quit IRC
[22:58:04] <AgentCarmichael> Anyone experience with SQL Developer?
[22:58:06] *** titankiller has joined ##java
[22:58:24] <nucc1> ~anyone
[22:58:24] <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.
[22:58:29] <Cher> bearded_oneder: http://www.riedquat.de/mantras - last entry.
[22:59:03] *** Paradox924X has joined ##java
[22:59:05] <AgentCarmichael> ~googlefuckoff nucc1
[22:59:06] <javabot> AgentCarmichael, what does that even *mean*?
[22:59:19] * cheeser eyes AgentCarmichael
[22:59:43] *** AgentCarmichael has left ##java
[22:59:53] <zChris> :S
[22:59:57] <zChris> What a nice chap
[22:59:57] *** Zta has joined ##java
[23:00:03] <cheeser> ~next
[23:00:03] <javabot> Another satisfied customer. Next!
[23:00:04] <bearded_oneder> lf94: you should also be careful about placing multiple unnested classes in the same source file. while technically legal (provided that only one of them is public), it can create problems. see, http://stackoverflow.com/questions/2336692/java-multiple-class-declarations-in-one-file answer #7.
[23:00:25] <lf94> Yeah Im going to keep them in seperate files from now on...
[23:00:34] <lf94> Thanks for the heads up still. :)
[23:01:14] *** ctburley has quit IRC
[23:01:59] *** matsebc has quit IRC
[23:02:09] *** FrozenKnight has quit IRC
[23:02:34] <MadOtis> Anyone have any suggestions for my JTable/TableRowSorter problem, or is it so basic that I have no business really asking it? Or am I simply asking in the wrong channel?
[23:03:01] <Cher> lf94 used up all my helping energy for the next 5 days ;-)
[23:03:15] <lf94> XD Im so sorry!
[23:03:34] <MadOtis> Cher: Heh... I know that feeling.
[23:03:37] *** new2net has joined ##java
[23:04:00] *** webczat has joined ##java
[23:04:15] <new2net> all green is good for junit testcase?
[23:04:21] <webczat> Hey, what do you use in open source java programs to build java programs automatically?
[23:04:28] <webczat> something like autoconf?
[23:04:32] <FauxFaux> Maven.
[23:04:37] <Cher> Uh no. Maven, or at least Ant.
[23:05:16] *** jjido has joined ##java
[23:05:22] <new2net> ~ant
[23:05:22] <javabot> new2net, ant is a tool for building Java programs, found at http://ant.apache.org
[23:05:36] <brau> is there any good explanation about relationship of linux/unix environment settings and java system property "java.file.encoding"?
[23:05:54] *** whaley has joined ##java
[23:06:26] <new2net> brau: can you be more specific?
[23:07:09] <webczat> does ant replace make or does it make scripts or something?
[23:07:35] *** lmatteis has quit IRC
[23:07:41] <whaley> webczat: replacement
[23:07:48] <eidolon> webczat: read the pages on it.
[23:07:56] <eidolon> ant is the java equivelent of make.
[23:08:12] <webczat> I need something that uses make, not replaces it.
[23:08:22] <tjsnell> with a much less fragile file format
[23:08:28] <brau> new2net: i'm trying to figure out which os settings (/etc/environment, maybe there are other ways..) leads to which java.file.encoding
[23:08:46] <webczat> I can use make, but checking for dependencies is hard using it
[23:08:49] <eidolon> webczat: i won't even begin to ask why, but feel free to have make call ant. or ant call make. whatever.
[23:09:50] <brau> seems that an empty file leads to ANSI X 3.4-1968 (ascii), lang=en_US leads to ISO-8859-1, etc.
[23:11:20] <bearded_oneder> Cher: will this work? "OOP seems difficult to grasp, because our brains naturally process the states, properties, and behaviors of real world objects associatively. After we've trained our brain to view them hierarchically, it becomes easier". — Alex "bearded_oneder" Ricks
[23:11:21] <Cher> brau: Interestingly, for me System.getProperty("java.file.encoding") returns null. Maybe my Linux is too old.
[23:11:39] <Cher> bearded_oneder: Of course this will work. I'll change it to your wishes.
[23:11:41] <new2net> http://developers.sun.com/dev/gadc/faq/java/files/encodings.html
[23:12:01] <brau> new2net: i'm sorry, it's just "file.encoding"
[23:12:34] <brau> which should return the default text file encoding on your machine
[23:12:57] *** MadOtis has quit IRC
[23:13:08] <new2net> brau, read 1.5
[23:13:18] <Zta> Should deleting an entity that doesn't exist though a DAO throw an exception?
[23:13:21] <Cher> brau: Ah okay, now it returns UTF-8 (which is the 1TE ;-)
[23:13:42] <webczat> Does java.sql require a driver like jdbc mysql or odbc?
[23:13:52] <Zta> Or return true/false like Collection? Or be plain void?
[23:14:36] *** fisted_ is now known as fisted
[23:14:57] <Cher> bearded_oneder: Changed. You can reload if you want to see it. (Forced reload required, because the file uses SSI and the lastmod will not have changed.)
[23:16:25] *** Pawnee has joined ##java
[23:18:00] <new2net> is testing an Interface any different than a class for junit?
[23:18:22] *** jjido has quit IRC
[23:18:39] *** jjido has joined ##java
[23:20:13] *** Carnage\ has quit IRC
[23:22:43] *** Fisiu has quit IRC
[23:23:32] *** jjido has quit IRC
[23:23:36] *** webczat has quit IRC
[23:24:34] *** gkmngrgn has joined ##java
[23:24:34] *** jjido has joined ##java
[23:26:15] *** echosystm has joined ##java
[23:26:35] <echosystm> i'm confused about MVC in web applications
[23:27:26] *** c_axis has quit IRC
[23:27:38] *** c_axis has joined ##java
[23:27:41] <echosystm> in a normal application, if i wanted two things (ie. a news feed and guestbook, for example) to be shown on every screen, i would nest those views/controllers each view
[23:28:02] <echosystm> in spring, theres no way to do that is there?
[23:28:18] <echosystm> you would need to repeat the controller logic every single time right?
[23:32:12] *** veasmkii has joined ##java
[23:36:23] *** Cher has quit IRC
[23:37:13] *** Cher has joined ##java
[23:40:34] *** rtdos has quit IRC
[23:41:42] *** homie has joined ##java
[23:43:10] *** White-- has joined ##java
[23:44:09] <White--> Is there a way to cast an object in a way that obj.getClass().getName() no longer is the original's class name but really the one I wanted it to cast to?
[23:45:26] <new2net> bah... junit :( i thought I was perfect
[23:45:40] *** jjido has quit IRC
[23:46:16] *** ulfdoz has quit IRC
[23:47:45] *** zemanel has quit IRC
[23:47:48] *** JohnnyDavidson has quit IRC
[23:49:22] *** mathesis has joined ##java
[23:49:28] <mathesis> hi
[23:50:00] <new2net> hi
[23:50:46] *** flip28 has quit IRC
[23:52:11] <_W_> White--, that isn't casting
[23:52:14] *** tigger0jk has joined ##java
[23:52:15] <_W_> ~cast
[23:52:15] <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.
[23:52:32] <_W_> White--, you would have to construct a new object of the class you want
[23:53:08] <_W_> why would you want such a thing anyway? There's bound to be some better way to do what you want
[23:53:12] <White--> _W_ thanks, that makes sense. Normally I wouldn't care, I just need to serialize an object in a way so it validates against the XSD, that's why it made a differnce for me
[23:53:37] <_W_> generate the classes from the XSD - problem solved
[23:53:50] <White--> developing on android => jaxb not available :(
[23:53:52] <_W_> JAXB was made for this
[23:53:55] <_W_> ah
[23:54:18] <White--> currently I'm rendering the classes using jaxb and using sed to patch them to work with Simple
[23:54:30] <_W_> ew
[23:54:37] *** rtdos has joined ##java
[23:54:50] <White--> pretty stupid, but better than handwriting xmls (or using dom to kill myself)
[23:55:01] <new2net> runs... 3/3 Errors... 107 Failures: 0 , looks solid to me
[23:58:50] *** Johannes13 has joined ##java
[23:59:12] *** frangiz has quit IRC
[23:59:35] *** Auv5 has quit IRC
[23:59:38] *** jjido has joined ##java
[23:59:57] *** daark has quit IRC

   March 6, 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 | 29 | 30 | 31 | >